llmxray 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AITrainingPage-CD-bWVvC.js → AITrainingPage-D9Hlzoxr.js} +1 -1
- package/dist/assets/BenchmarkPage-C2EPgHap.js +7 -0
- package/dist/assets/ComparisonPage-D4uVK99S.js +5 -0
- package/dist/assets/DashboardPage-D29jF-v_.js +116 -0
- package/dist/assets/{EmbeddingsPage-DY0ClOT-.js → EmbeddingsPage-B4Q5iOnp.js} +1 -1
- package/dist/assets/{GoogleCallbackPage-CVk5U2In.js → GoogleCallbackPage-BTVY6nY-.js} +1 -1
- package/dist/assets/{JsonTreeNode-BQTLLZr8.js → JsonTreeNode-BIbYj0yY.js} +1 -1
- package/dist/assets/{ModelCapabilityIcons.vue_vue_type_script_setup_true_lang-CC-8ifev.js → ModelCapabilityIcons.vue_vue_type_script_setup_true_lang-C3XRXlsx.js} +1 -1
- package/dist/assets/{RAGPage-DrqXiDs6.js → RAGPage-DQ6Volv_.js} +1 -1
- package/dist/assets/SessionPage-BDEjGBVj.js +15 -0
- package/dist/assets/{SettingsPage-RH-JaBkt.js → SettingsPage-CnnL86xu.js} +1 -1
- package/dist/assets/{StatusBadge.vue_vue_type_script_setup_true_lang-BoFt8y4m.js → StatusBadge.vue_vue_type_script_setup_true_lang-KoBPscTq.js} +1 -1
- package/dist/assets/{StorageGauge.vue_vue_type_style_index_0_lang-Cww3ylyV.js → StorageGauge.vue_vue_type_style_index_0_lang-C02ax0mb.js} +1 -1
- package/dist/assets/SystemPage--sYDCQWt.js +3 -0
- package/dist/assets/{TabBar.vue_vue_type_script_setup_true_lang-D1bxlZ11.js → TabBar.vue_vue_type_script_setup_true_lang-B8XosH-S.js} +1 -1
- package/dist/assets/{TokenStreamDisplay.vue_vue_type_script_setup_true_lang-DbN5kS19.js → TokenStreamDisplay.vue_vue_type_script_setup_true_lang-DESaLQAc.js} +1 -1
- package/dist/assets/ToolWorkshopPage-BOfP5qNr.js +376 -0
- package/dist/assets/{agent-store-Bmti9EJM.js → agent-store-t6Q_sS6h.js} +1 -1
- package/dist/assets/download-CoUYv-Xz.js +1 -0
- package/dist/assets/download-WPaeALA4.js +2 -0
- package/dist/assets/{generate-service-BdGdFlEd.js → generate-service-BGYA7sqG.js} +1 -1
- package/dist/assets/{google-auth-store-9fvZi3sc.js → google-auth-store-BLsepFvT.js} +1 -1
- package/dist/assets/index-ByjkY7sc.js +6 -0
- package/dist/assets/index-CLzYyqdr.css +1 -0
- package/dist/assets/{index-Co0VhPSQ.js → index-Dz52x0xn.js} +1 -1
- package/dist/assets/{metrics-store-CcJejDWm.js → metrics-store-Cnq6K9r3.js} +1 -1
- package/dist/assets/{rag-store-D6-tUXow.js → rag-store-DkMe7f2k.js} +1 -1
- package/dist/assets/share-2-Bo0B3Izb.js +1 -0
- package/dist/assets/{storage-store-C2BSRTMJ.js → storage-store-BymRCrmS.js} +1 -1
- package/dist/assets/{stream-handler-DcWLXVUd.js → stream-handler-BpZnsrRN.js} +1 -1
- package/dist/assets/{tool-workshop-store-CvimeN9w.js → tool-workshop-store-DFv0eNtc.js} +1 -1
- package/dist/assets/{toolcall-store-DxrTJwPf.js → toolcall-store-dbKJl21c.js} +1 -1
- package/dist/assets/{trash-2-CKMNSCOl.js → trash-2-bP-GrgRB.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/BenchmarkPage-bp73Urv7.js +0 -2
- package/dist/assets/ComparisonPage-BcSW8bNz.js +0 -4
- package/dist/assets/DashboardPage-BikhI-WR.js +0 -101
- package/dist/assets/SessionPage-BClm8k5v.js +0 -14
- package/dist/assets/SystemPage-Dl-w53Tz.js +0 -2
- package/dist/assets/ToolWorkshopPage-UupUHgP6.js +0 -376
- package/dist/assets/index-BQSbu0e6.css +0 -1
- package/dist/assets/index-DVVzacEJ.js +0 -6
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import{a0 as SO,w as Ge,b as ot,a1 as wO,R as JP,e as be,p as ht,s as Ki,a2 as wt,u as Se,B as fn,j as ye,g as bt,a3 as KP,m as lt,r as ze,a as Fe,a4 as Fs,a5 as PO,a6 as cr,a7 as pu,a8 as eT,f as he,F as gt,k as Jt,l as hi,y as vi,a9 as jd,aa as tT,q as Ct,i as Qe,Y as Mi,t as Te,ab as iT,ac as Zd,ad as nT,ae as rT,af as Xr,W as ut,ag as nt,ah as io,ai as sT,aj as TO,ak as Vd,al as Mu,K as wr,h as CO,am as aT,an as oT,d as lT,A as kO,o as Tc,n as uT,V as cT,v as Yi,C as Vn,D as ia,G as hT,U as fT,P as ig,z as dT,T as pT}from"./index-ByjkY7sc.js";import{u as Ud}from"./tool-workshop-store-DFv0eNtc.js";import{d as ng}from"./download-WPaeALA4.js";import{a as mT,u as gT}from"./toolcall-store-dbKJl21c.js";import{g as EO}from"./_commonjsHelpers-DsqdWQfm.js";import{canvasAiDB as qd}from"./canvas-ai-db-BolM-_G7.js";import{J as rg,a as yT,g as vT,b as OT}from"./JsonTreeNode-BIbYj0yY.js";import{D as xT}from"./base-CrPFMexR.js";import{_ as AO}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{D as sg}from"./download-CoUYv-Xz.js";import{T as bT}from"./trash-2-bP-GrgRB.js";class ST extends xT{constructor(){super(...arguments),this.tokenize=TT}equals(e,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
2
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!i.includes(`
|
|
3
|
+
`))&&(i=i.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
4
|
+
`)&&(e=e.slice(0,-1)),i.endsWith(`
|
|
5
|
+
`)&&(i=i.slice(0,-1))),super.equals(e,i,n)}}const wT=new ST;function PT(t,e,i){return wT.diff(t,e,i)}function TT(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
|
6
|
+
`));const i=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let r=0;r<n.length;r++){const s=n[r];r%2&&!e.newlineIsToken?i[i.length-1]+=s:i.push(s)}return i}function yo(t){return PO()?(pu(t),!0):!1}function Pn(t){return typeof t=="function"?t():Se(t)}const CT=typeof window<"u"&&typeof document<"u",kT=t=>typeof t<"u",ET=Object.prototype.toString,AT=t=>ET.call(t)==="[object Object]",DT=()=>{};function _T(t,e){function i(...n){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,n),{fn:e,thisArg:this,args:n})).then(r).catch(s)})}return i}const DO=t=>t();function IT(t=DO){const e=ze(!0);function i(){e.value=!1}function n(){e.value=!0}const r=(...s)=>{e.value&&t(...s)};return{isActive:sT(e),pause:i,resume:n,eventFilter:r}}function ag(t,e=!1,i="Timeout"){return new Promise((n,r)=>{setTimeout(e?()=>r(i):n,t)})}function NT(t,e,i={}){const{eventFilter:n=DO,...r}=i;return Ge(t,_T(n,e),r)}function es(t,e,i={}){const{eventFilter:n,...r}=i,{eventFilter:s,pause:a,resume:l,isActive:u}=IT(n);return{stop:NT(t,e,{...r,eventFilter:s}),pause:a,resume:l,isActive:u}}function MT(t,e={}){if(!Zd(t))return nT(t);const i=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const n in t.value)i[n]=rT(()=>({get(){return t.value[n]},set(r){var s;if((s=Pn(e.replaceRef))!=null?s:!0)if(Array.isArray(t.value)){const l=[...t.value];l[n]=r,t.value=l}else{const l={...t.value,[n]:r};Object.setPrototypeOf(l,Object.getPrototypeOf(t.value)),t.value=l}else t.value[n]=r}}));return i}function xf(t,e=!1){function i(p,{flush:v="sync",deep:g=!1,timeout:b,throwOnTimeout:m}={}){let x=null;const P=[new Promise(S=>{x=Ge(t,w=>{p(w)!==e&&(x?.(),S(w))},{flush:v,deep:g,immediate:!0})})];return b!=null&&P.push(ag(b,m).then(()=>Pn(t)).finally(()=>x?.())),Promise.race(P)}function n(p,v){if(!Zd(p))return i(w=>w===p,v);const{flush:g="sync",deep:b=!1,timeout:m,throwOnTimeout:x}=v??{};let O=null;const S=[new Promise(w=>{O=Ge([t,p],([C,E])=>{e!==(C===E)&&(O?.(),w(C))},{flush:g,deep:b,immediate:!0})})];return m!=null&&S.push(ag(m,x).then(()=>Pn(t)).finally(()=>(O?.(),Pn(t)))),Promise.race(S)}function r(p){return i(v=>!!v,p)}function s(p){return n(null,p)}function a(p){return n(void 0,p)}function l(p){return i(Number.isNaN,p)}function u(p,v){return i(g=>{const b=Array.from(g);return b.includes(p)||b.includes(Pn(p))},v)}function h(p){return c(1,p)}function c(p=1,v){let g=-1;return i(()=>(g+=1,g>=p),v)}return Array.isArray(Pn(t))?{toMatch:i,toContains:u,changed:h,changedTimes:c,get not(){return xf(t,!e)}}:{toMatch:i,toBe:n,toBeTruthy:r,toBeNull:s,toBeNaN:l,toBeUndefined:a,changed:h,changedTimes:c,get not(){return xf(t,!e)}}}function bf(t){return xf(t)}function $T(t){var e;const i=Pn(t);return(e=i?.$el)!=null?e:i}const _O=CT?window:void 0;function IO(...t){let e,i,n,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([i,n,r]=t,e=_O):[e,i,n,r]=t,!e)return DT;Array.isArray(i)||(i=[i]),Array.isArray(n)||(n=[n]);const s=[],a=()=>{s.forEach(c=>c()),s.length=0},l=(c,p,v,g)=>(c.addEventListener(p,v,g),()=>c.removeEventListener(p,v,g)),u=Ge(()=>[$T(e),Pn(r)],([c,p])=>{if(a(),!c)return;const v=AT(p)?{...p}:p;s.push(...i.flatMap(g=>n.map(b=>l(c,g,b,v))))},{immediate:!0,flush:"post"}),h=()=>{u(),a()};return yo(h),h}function LT(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function og(...t){let e,i,n={};t.length===3?(e=t[0],i=t[1],n=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,i=t[0],n=t[1]):(e=t[0],i=t[1]):(e=!0,i=t[0]);const{target:r=_O,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=n,u=LT(e);return IO(r,s,c=>{c.repeat&&Pn(l)||u(c)&&i(c)},a)}function BT(t){return JSON.parse(JSON.stringify(t))}function dh(t,e,i,n={}){var r,s,a;const{clone:l=!1,passive:u=!1,eventName:h,deep:c=!1,defaultValue:p,shouldEmit:v}=n,g=Fs(),b=i||g?.emit||((r=g?.$emit)==null?void 0:r.bind(g))||((a=(s=g?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(g?.proxy));let m=h;e||(e="modelValue"),m=m||`update:${e.toString()}`;const x=S=>l?typeof l=="function"?l(S):BT(S):S,O=()=>kT(t[e])?x(t[e]):p,P=S=>{v?v(S)&&b(m,S):b(m,S)};if(u){const S=O(),w=ze(S);let C=!1;return Ge(()=>t[e],E=>{C||(C=!0,w.value=x(E),vi(()=>C=!1))}),Ge(w,E=>{!C&&(E!==t[e]||c)&&P(E)},{deep:c}),w}else return Fe({get(){return O()},set(S){P(S)}})}var QT={value:()=>{}};function Cc(){for(var t=0,e=arguments.length,i={},n;t<e;++t){if(!(n=arguments[t]+"")||n in i||/[\s.]/.test(n))throw new Error("illegal type: "+n);i[n]=[]}return new mu(i)}function mu(t){this._=t}function FT(t,e){return t.trim().split(/^|\s+/).map(function(i){var n="",r=i.indexOf(".");if(r>=0&&(n=i.slice(r+1),i=i.slice(0,r)),i&&!e.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}mu.prototype=Cc.prototype={constructor:mu,on:function(t,e){var i=this._,n=FT(t+"",i),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(t=n[s]).type)&&(r=RT(i[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(t=n[s]).type)i[r]=lg(i[r],t.name,e);else if(e==null)for(r in i)i[r]=lg(i[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var i in e)t[i]=e[i].slice();return new mu(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var i=new Array(r),n=0,r,s;n<r;++n)i[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],n=0,r=s.length;n<r;++n)s[n].value.apply(e,i)},apply:function(t,e,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],r=0,s=n.length;r<s;++r)n[r].value.apply(e,i)}};function RT(t,e){for(var i=0,n=t.length,r;i<n;++i)if((r=t[i]).name===e)return r.value}function lg(t,e,i){for(var n=0,r=t.length;n<r;++n)if(t[n].name===e){t[n]=QT,t=t.slice(0,n).concat(t.slice(n+1));break}return i!=null&&t.push({name:e,value:i}),t}var Sf="http://www.w3.org/1999/xhtml";const ug={svg:"http://www.w3.org/2000/svg",xhtml:Sf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function kc(t){var e=t+="",i=e.indexOf(":");return i>=0&&(e=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),ug.hasOwnProperty(e)?{space:ug[e],local:t}:t}function zT(t){return function(){var e=this.ownerDocument,i=this.namespaceURI;return i===Sf&&e.documentElement.namespaceURI===Sf?e.createElement(t):e.createElementNS(i,t)}}function XT(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function NO(t){var e=kc(t);return(e.local?XT:zT)(e)}function jT(){}function Wd(t){return t==null?jT:function(){return this.querySelector(t)}}function ZT(t){typeof t!="function"&&(t=Wd(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,l=n[r]=new Array(a),u,h,c=0;c<a;++c)(u=s[c])&&(h=t.call(u,u.__data__,c,s))&&("__data__"in u&&(h.__data__=u.__data__),l[c]=h);return new Oi(n,this._parents)}function VT(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function UT(){return[]}function MO(t){return t==null?UT:function(){return this.querySelectorAll(t)}}function qT(t){return function(){return VT(t.apply(this,arguments))}}function WT(t){typeof t=="function"?t=qT(t):t=MO(t);for(var e=this._groups,i=e.length,n=[],r=[],s=0;s<i;++s)for(var a=e[s],l=a.length,u,h=0;h<l;++h)(u=a[h])&&(n.push(t.call(u,u.__data__,h,a)),r.push(u));return new Oi(n,r)}function $O(t){return function(){return this.matches(t)}}function LO(t){return function(e){return e.matches(t)}}var YT=Array.prototype.find;function GT(t){return function(){return YT.call(this.children,t)}}function HT(){return this.firstElementChild}function JT(t){return this.select(t==null?HT:GT(typeof t=="function"?t:LO(t)))}var KT=Array.prototype.filter;function eC(){return Array.from(this.children)}function tC(t){return function(){return KT.call(this.children,t)}}function iC(t){return this.selectAll(t==null?eC:tC(typeof t=="function"?t:LO(t)))}function nC(t){typeof t!="function"&&(t=$O(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,l=n[r]=[],u,h=0;h<a;++h)(u=s[h])&&t.call(u,u.__data__,h,s)&&l.push(u);return new Oi(n,this._parents)}function BO(t){return new Array(t.length)}function rC(){return new Oi(this._enter||this._groups.map(BO),this._parents)}function $u(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}$u.prototype={constructor:$u,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function sC(t){return function(){return t}}function aC(t,e,i,n,r,s){for(var a=0,l,u=e.length,h=s.length;a<h;++a)(l=e[a])?(l.__data__=s[a],n[a]=l):i[a]=new $u(t,s[a]);for(;a<u;++a)(l=e[a])&&(r[a]=l)}function oC(t,e,i,n,r,s,a){var l,u,h=new Map,c=e.length,p=s.length,v=new Array(c),g;for(l=0;l<c;++l)(u=e[l])&&(v[l]=g=a.call(u,u.__data__,l,e)+"",h.has(g)?r[l]=u:h.set(g,u));for(l=0;l<p;++l)g=a.call(t,s[l],l,s)+"",(u=h.get(g))?(n[l]=u,u.__data__=s[l],h.delete(g)):i[l]=new $u(t,s[l]);for(l=0;l<c;++l)(u=e[l])&&h.get(v[l])===u&&(r[l]=u)}function lC(t){return t.__data__}function uC(t,e){if(!arguments.length)return Array.from(this,lC);var i=e?oC:aC,n=this._parents,r=this._groups;typeof t!="function"&&(t=sC(t));for(var s=r.length,a=new Array(s),l=new Array(s),u=new Array(s),h=0;h<s;++h){var c=n[h],p=r[h],v=p.length,g=cC(t.call(c,c&&c.__data__,h,n)),b=g.length,m=l[h]=new Array(b),x=a[h]=new Array(b),O=u[h]=new Array(v);i(c,p,m,x,O,g,e);for(var P=0,S=0,w,C;P<b;++P)if(w=m[P]){for(P>=S&&(S=P+1);!(C=x[S])&&++S<b;);w._next=C||null}}return a=new Oi(a,n),a._enter=l,a._exit=u,a}function cC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function hC(){return new Oi(this._exit||this._groups.map(BO),this._parents)}function fC(t,e,i){var n=this.enter(),r=this,s=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),i==null?s.remove():i(s),n&&r?n.merge(r).order():r}function dC(t){for(var e=t.selection?t.selection():t,i=this._groups,n=e._groups,r=i.length,s=n.length,a=Math.min(r,s),l=new Array(r),u=0;u<a;++u)for(var h=i[u],c=n[u],p=h.length,v=l[u]=new Array(p),g,b=0;b<p;++b)(g=h[b]||c[b])&&(v[b]=g);for(;u<r;++u)l[u]=i[u];return new Oi(l,this._parents)}function pC(){for(var t=this._groups,e=-1,i=t.length;++e<i;)for(var n=t[e],r=n.length-1,s=n[r],a;--r>=0;)(a=n[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function mC(t){t||(t=gC);function e(p,v){return p&&v?t(p.__data__,v.__data__):!p-!v}for(var i=this._groups,n=i.length,r=new Array(n),s=0;s<n;++s){for(var a=i[s],l=a.length,u=r[s]=new Array(l),h,c=0;c<l;++c)(h=a[c])&&(u[c]=h);u.sort(e)}return new Oi(r,this._parents).order()}function gC(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function yC(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function vC(){return Array.from(this)}function OC(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length;r<s;++r){var a=n[r];if(a)return a}return null}function xC(){let t=0;for(const e of this)++t;return t}function bC(){return!this.node()}function SC(t){for(var e=this._groups,i=0,n=e.length;i<n;++i)for(var r=e[i],s=0,a=r.length,l;s<a;++s)(l=r[s])&&t.call(l,l.__data__,s,r);return this}function wC(t){return function(){this.removeAttribute(t)}}function PC(t){return function(){this.removeAttributeNS(t.space,t.local)}}function TC(t,e){return function(){this.setAttribute(t,e)}}function CC(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function kC(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function EC(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function AC(t,e){var i=kc(t);if(arguments.length<2){var n=this.node();return i.local?n.getAttributeNS(i.space,i.local):n.getAttribute(i)}return this.each((e==null?i.local?PC:wC:typeof e=="function"?i.local?EC:kC:i.local?CC:TC)(i,e))}function QO(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function DC(t){return function(){this.style.removeProperty(t)}}function _C(t,e,i){return function(){this.style.setProperty(t,e,i)}}function IC(t,e,i){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,i)}}function NC(t,e,i){return arguments.length>1?this.each((e==null?DC:typeof e=="function"?IC:_C)(t,e,i??"")):Ps(this.node(),t)}function Ps(t,e){return t.style.getPropertyValue(e)||QO(t).getComputedStyle(t,null).getPropertyValue(e)}function MC(t){return function(){delete this[t]}}function $C(t,e){return function(){this[t]=e}}function LC(t,e){return function(){var i=e.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function BC(t,e){return arguments.length>1?this.each((e==null?MC:typeof e=="function"?LC:$C)(t,e)):this.node()[t]}function FO(t){return t.trim().split(/^|\s+/)}function Yd(t){return t.classList||new RO(t)}function RO(t){this._node=t,this._names=FO(t.getAttribute("class")||"")}RO.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function zO(t,e){for(var i=Yd(t),n=-1,r=e.length;++n<r;)i.add(e[n])}function XO(t,e){for(var i=Yd(t),n=-1,r=e.length;++n<r;)i.remove(e[n])}function QC(t){return function(){zO(this,t)}}function FC(t){return function(){XO(this,t)}}function RC(t,e){return function(){(e.apply(this,arguments)?zO:XO)(this,t)}}function zC(t,e){var i=FO(t+"");if(arguments.length<2){for(var n=Yd(this.node()),r=-1,s=i.length;++r<s;)if(!n.contains(i[r]))return!1;return!0}return this.each((typeof e=="function"?RC:e?QC:FC)(i,e))}function XC(){this.textContent=""}function jC(t){return function(){this.textContent=t}}function ZC(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function VC(t){return arguments.length?this.each(t==null?XC:(typeof t=="function"?ZC:jC)(t)):this.node().textContent}function UC(){this.innerHTML=""}function qC(t){return function(){this.innerHTML=t}}function WC(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function YC(t){return arguments.length?this.each(t==null?UC:(typeof t=="function"?WC:qC)(t)):this.node().innerHTML}function GC(){this.nextSibling&&this.parentNode.appendChild(this)}function HC(){return this.each(GC)}function JC(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function KC(){return this.each(JC)}function ek(t){var e=typeof t=="function"?t:NO(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function tk(){return null}function ik(t,e){var i=typeof t=="function"?t:NO(t),n=e==null?tk:typeof e=="function"?e:Wd(e);return this.select(function(){return this.insertBefore(i.apply(this,arguments),n.apply(this,arguments)||null)})}function nk(){var t=this.parentNode;t&&t.removeChild(this)}function rk(){return this.each(nk)}function sk(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ak(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ok(t){return this.select(t?ak:sk)}function lk(t){return arguments.length?this.property("__data__",t):this.node().__data__}function uk(t){return function(e){t.call(this,e,this.__data__)}}function ck(t){return t.trim().split(/^|\s+/).map(function(e){var i="",n=e.indexOf(".");return n>=0&&(i=e.slice(n+1),e=e.slice(0,n)),{type:e,name:i}})}function hk(t){return function(){var e=this.__on;if(e){for(var i=0,n=-1,r=e.length,s;i<r;++i)s=e[i],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++n]=s;++n?e.length=n:delete this.__on}}}function fk(t,e,i){return function(){var n=this.__on,r,s=uk(e);if(n){for(var a=0,l=n.length;a<l;++a)if((r=n[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=e;return}}this.addEventListener(t.type,s,i),r={type:t.type,name:t.name,value:e,listener:s,options:i},n?n.push(r):this.__on=[r]}}function dk(t,e,i){var n=ck(t+""),r,s=n.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,h=l.length,c;u<h;++u)for(r=0,c=l[u];r<s;++r)if((a=n[r]).type===c.type&&a.name===c.name)return c.value}return}for(l=e?fk:hk,r=0;r<s;++r)this.each(l(n[r],e,i));return this}function jO(t,e,i){var n=QO(t),r=n.CustomEvent;typeof r=="function"?r=new r(e,i):(r=n.document.createEvent("Event"),i?(r.initEvent(e,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function pk(t,e){return function(){return jO(this,t,e)}}function mk(t,e){return function(){return jO(this,t,e.apply(this,arguments))}}function gk(t,e){return this.each((typeof e=="function"?mk:pk)(t,e))}function*yk(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length,a;r<s;++r)(a=n[r])&&(yield a)}var ZO=[null];function Oi(t,e){this._groups=t,this._parents=e}function Go(){return new Oi([[document.documentElement]],ZO)}function vk(){return this}Oi.prototype=Go.prototype={constructor:Oi,select:ZT,selectAll:WT,selectChild:JT,selectChildren:iC,filter:nC,data:uC,enter:rC,exit:hC,join:fC,merge:dC,selection:vk,order:pC,sort:mC,call:yC,nodes:vC,node:OC,size:xC,empty:bC,each:SC,attr:AC,style:NC,property:BC,classed:zC,text:VC,html:YC,raise:HC,lower:KC,append:ek,insert:ik,remove:rk,clone:ok,datum:lk,on:dk,dispatch:gk,[Symbol.iterator]:yk};function Di(t){return typeof t=="string"?new Oi([[document.querySelector(t)]],[document.documentElement]):new Oi([[t]],ZO)}function Ok(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Hi(t,e){if(t=Ok(t),e===void 0&&(e=t.currentTarget),e){var i=e.ownerSVGElement||e;if(i.createSVGPoint){var n=i.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const xk={passive:!1},vo={capture:!0,passive:!1};function ph(t){t.stopImmediatePropagation()}function fs(t){t.preventDefault(),t.stopImmediatePropagation()}function VO(t){var e=t.document.documentElement,i=Di(t).on("dragstart.drag",fs,vo);"onselectstart"in e?i.on("selectstart.drag",fs,vo):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function UO(t,e){var i=t.document.documentElement,n=Di(t).on("dragstart.drag",null);e&&(n.on("click.drag",fs,vo),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in i?n.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Cl=t=>()=>t;function wf(t,{sourceEvent:e,subject:i,target:n,identifier:r,active:s,x:a,y:l,dx:u,dy:h,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:c}})}wf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function bk(t){return!t.ctrlKey&&!t.button}function Sk(){return this.parentNode}function wk(t,e){return e??{x:t.x,y:t.y}}function Pk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tk(){var t=bk,e=Sk,i=wk,n=Pk,r={},s=Cc("start","drag","end"),a=0,l,u,h,c,p=0;function v(w){w.on("mousedown.drag",g).filter(n).on("touchstart.drag",x).on("touchmove.drag",O,xk).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(w,C){if(!(c||!t.call(this,w,C))){var E=S(this,e.call(this,w,C),w,C,"mouse");E&&(Di(w.view).on("mousemove.drag",b,vo).on("mouseup.drag",m,vo),VO(w.view),ph(w),h=!1,l=w.clientX,u=w.clientY,E("start",w))}}function b(w){if(fs(w),!h){var C=w.clientX-l,E=w.clientY-u;h=C*C+E*E>p}r.mouse("drag",w)}function m(w){Di(w.view).on("mousemove.drag mouseup.drag",null),UO(w.view,h),fs(w),r.mouse("end",w)}function x(w,C){if(t.call(this,w,C)){var E=w.changedTouches,k=e.call(this,w,C),A=E.length,$,F;for($=0;$<A;++$)(F=S(this,k,w,C,E[$].identifier,E[$]))&&(ph(w),F("start",w,E[$]))}}function O(w){var C=w.changedTouches,E=C.length,k,A;for(k=0;k<E;++k)(A=r[C[k].identifier])&&(fs(w),A("drag",w,C[k]))}function P(w){var C=w.changedTouches,E=C.length,k,A;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),k=0;k<E;++k)(A=r[C[k].identifier])&&(ph(w),A("end",w,C[k]))}function S(w,C,E,k,A,$){var F=s.copy(),I=Hi($||E,C),B,j,M;if((M=i.call(w,new wf("beforestart",{sourceEvent:E,target:v,identifier:A,active:a,x:I[0],y:I[1],dx:0,dy:0,dispatch:F}),k))!=null)return B=M.x-I[0]||0,j=M.y-I[1]||0,function q(X,Y,V){var oe=I,ae;switch(X){case"start":r[A]=q,ae=a++;break;case"end":delete r[A],--a;case"drag":I=Hi(V||Y,C),ae=a;break}F.call(X,w,new wf(X,{sourceEvent:Y,subject:M,target:v,identifier:A,active:ae,x:I[0]+B,y:I[1]+j,dx:I[0]-oe[0],dy:I[1]-oe[1],dispatch:F}),k)}}return v.filter=function(w){return arguments.length?(t=typeof w=="function"?w:Cl(!!w),v):t},v.container=function(w){return arguments.length?(e=typeof w=="function"?w:Cl(w),v):e},v.subject=function(w){return arguments.length?(i=typeof w=="function"?w:Cl(w),v):i},v.touchable=function(w){return arguments.length?(n=typeof w=="function"?w:Cl(!!w),v):n},v.on=function(){var w=s.on.apply(s,arguments);return w===s?v:w},v.clickDistance=function(w){return arguments.length?(p=(w=+w)*w,v):Math.sqrt(p)},v}function Gd(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function qO(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function Ho(){}var Oo=.7,Lu=1/Oo,ds="\\s*([+-]?\\d+)\\s*",xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ck=/^#([0-9a-f]{3,8})$/,kk=new RegExp(`^rgb\\(${ds},${ds},${ds}\\)$`),Ek=new RegExp(`^rgb\\(${un},${un},${un}\\)$`),Ak=new RegExp(`^rgba\\(${ds},${ds},${ds},${xo}\\)$`),Dk=new RegExp(`^rgba\\(${un},${un},${un},${xo}\\)$`),_k=new RegExp(`^hsl\\(${xo},${un},${un}\\)$`),Ik=new RegExp(`^hsla\\(${xo},${un},${un},${xo}\\)$`),cg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Gd(Ho,jr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:hg,formatHex:hg,formatHex8:Nk,formatHsl:Mk,formatRgb:fg,toString:fg});function hg(){return this.rgb().formatHex()}function Nk(){return this.rgb().formatHex8()}function Mk(){return WO(this).formatHsl()}function fg(){return this.rgb().formatRgb()}function jr(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=Ck.exec(t))?(i=e[1].length,e=parseInt(e[1],16),i===6?dg(e):i===3?new ai(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):i===8?kl(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):i===4?kl(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=kk.exec(t))?new ai(e[1],e[2],e[3],1):(e=Ek.exec(t))?new ai(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ak.exec(t))?kl(e[1],e[2],e[3],e[4]):(e=Dk.exec(t))?kl(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_k.exec(t))?gg(e[1],e[2]/100,e[3]/100,1):(e=Ik.exec(t))?gg(e[1],e[2]/100,e[3]/100,e[4]):cg.hasOwnProperty(t)?dg(cg[t]):t==="transparent"?new ai(NaN,NaN,NaN,0):null}function dg(t){return new ai(t>>16&255,t>>8&255,t&255,1)}function kl(t,e,i,n){return n<=0&&(t=e=i=NaN),new ai(t,e,i,n)}function $k(t){return t instanceof Ho||(t=jr(t)),t?(t=t.rgb(),new ai(t.r,t.g,t.b,t.opacity)):new ai}function Pf(t,e,i,n){return arguments.length===1?$k(t):new ai(t,e,i,n??1)}function ai(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}Gd(ai,Pf,qO(Ho,{brighter(t){return t=t==null?Lu:Math.pow(Lu,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Oo:Math.pow(Oo,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ai($r(this.r),$r(this.g),$r(this.b),Bu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:pg,formatHex:pg,formatHex8:Lk,formatRgb:mg,toString:mg}));function pg(){return`#${Dr(this.r)}${Dr(this.g)}${Dr(this.b)}`}function Lk(){return`#${Dr(this.r)}${Dr(this.g)}${Dr(this.b)}${Dr((isNaN(this.opacity)?1:this.opacity)*255)}`}function mg(){const t=Bu(this.opacity);return`${t===1?"rgb(":"rgba("}${$r(this.r)}, ${$r(this.g)}, ${$r(this.b)}${t===1?")":`, ${t})`}`}function Bu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $r(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Dr(t){return t=$r(t),(t<16?"0":"")+t.toString(16)}function gg(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new _i(t,e,i,n)}function WO(t){if(t instanceof _i)return new _i(t.h,t.s,t.l,t.opacity);if(t instanceof Ho||(t=jr(t)),!t)return new _i;if(t instanceof _i)return t;t=t.rgb();var e=t.r/255,i=t.g/255,n=t.b/255,r=Math.min(e,i,n),s=Math.max(e,i,n),a=NaN,l=s-r,u=(s+r)/2;return l?(e===s?a=(i-n)/l+(i<n)*6:i===s?a=(n-e)/l+2:a=(e-i)/l+4,l/=u<.5?s+r:2-s-r,a*=60):l=u>0&&u<1?0:a,new _i(a,l,u,t.opacity)}function Bk(t,e,i,n){return arguments.length===1?WO(t):new _i(t,e,i,n??1)}function _i(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}Gd(_i,Bk,qO(Ho,{brighter(t){return t=t==null?Lu:Math.pow(Lu,t),new _i(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Oo:Math.pow(Oo,t),new _i(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,r=2*i-n;return new ai(mh(t>=240?t-240:t+120,r,n),mh(t,r,n),mh(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new _i(yg(this.h),El(this.s),El(this.l),Bu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Bu(this.opacity);return`${t===1?"hsl(":"hsla("}${yg(this.h)}, ${El(this.s)*100}%, ${El(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yg(t){return t=(t||0)%360,t<0?t+360:t}function El(t){return Math.max(0,Math.min(1,t||0))}function mh(t,e,i){return(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)*255}const Hd=t=>()=>t;function Qk(t,e){return function(i){return t+i*e}}function Fk(t,e,i){return t=Math.pow(t,i),e=Math.pow(e,i)-t,i=1/i,function(n){return Math.pow(t+n*e,i)}}function Rk(t){return(t=+t)==1?YO:function(e,i){return i-e?Fk(e,i,t):Hd(isNaN(e)?i:e)}}function YO(t,e){var i=e-t;return i?Qk(t,i):Hd(isNaN(t)?e:t)}const Qu=(function t(e){var i=Rk(e);function n(r,s){var a=i((r=Pf(r)).r,(s=Pf(s)).r),l=i(r.g,s.g),u=i(r.b,s.b),h=YO(r.opacity,s.opacity);return function(c){return r.r=a(c),r.g=l(c),r.b=u(c),r.opacity=h(c),r+""}}return n.gamma=t,n})(1);function zk(t,e){e||(e=[]);var i=t?Math.min(e.length,t.length):0,n=e.slice(),r;return function(s){for(r=0;r<i;++r)n[r]=t[r]*(1-s)+e[r]*s;return n}}function Xk(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function jk(t,e){var i=e?e.length:0,n=t?Math.min(i,t.length):0,r=new Array(n),s=new Array(i),a;for(a=0;a<n;++a)r[a]=no(t[a],e[a]);for(;a<i;++a)s[a]=e[a];return function(l){for(a=0;a<n;++a)s[a]=r[a](l);return s}}function Zk(t,e){var i=new Date;return t=+t,e=+e,function(n){return i.setTime(t*(1-n)+e*n),i}}function Ji(t,e){return t=+t,e=+e,function(i){return t*(1-i)+e*i}}function Vk(t,e){var i={},n={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?i[r]=no(t[r],e[r]):n[r]=e[r];return function(s){for(r in i)n[r]=i[r](s);return n}}var Tf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gh=new RegExp(Tf.source,"g");function Uk(t){return function(){return t}}function qk(t){return function(e){return t(e)+""}}function GO(t,e){var i=Tf.lastIndex=gh.lastIndex=0,n,r,s,a=-1,l=[],u=[];for(t=t+"",e=e+"";(n=Tf.exec(t))&&(r=gh.exec(e));)(s=r.index)>i&&(s=e.slice(i,s),l[a]?l[a]+=s:l[++a]=s),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,u.push({i:a,x:Ji(n,r)})),i=gh.lastIndex;return i<e.length&&(s=e.slice(i),l[a]?l[a]+=s:l[++a]=s),l.length<2?u[0]?qk(u[0].x):Uk(e):(e=u.length,function(h){for(var c=0,p;c<e;++c)l[(p=u[c]).i]=p.x(h);return l.join("")})}function no(t,e){var i=typeof e,n;return e==null||i==="boolean"?Hd(e):(i==="number"?Ji:i==="string"?(n=jr(e))?(e=n,Qu):GO:e instanceof jr?Qu:e instanceof Date?Zk:Xk(e)?zk:Array.isArray(e)?jk:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Vk:Ji)(t,e)}var vg=180/Math.PI,Cf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function HO(t,e,i,n,r,s){var a,l,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*i+e*n)&&(i-=t*u,n-=e*u),(l=Math.sqrt(i*i+n*n))&&(i/=l,n/=l,u/=l),t*n<e*i&&(t=-t,e=-e,u=-u,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*vg,skewX:Math.atan(u)*vg,scaleX:a,scaleY:l}}var Al;function Wk(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Cf:HO(e.a,e.b,e.c,e.d,e.e,e.f)}function Yk(t){return t==null||(Al||(Al=document.createElementNS("http://www.w3.org/2000/svg","g")),Al.setAttribute("transform",t),!(t=Al.transform.baseVal.consolidate()))?Cf:(t=t.matrix,HO(t.a,t.b,t.c,t.d,t.e,t.f))}function JO(t,e,i,n){function r(h){return h.length?h.pop()+" ":""}function s(h,c,p,v,g,b){if(h!==p||c!==v){var m=g.push("translate(",null,e,null,i);b.push({i:m-4,x:Ji(h,p)},{i:m-2,x:Ji(c,v)})}else(p||v)&&g.push("translate("+p+e+v+i)}function a(h,c,p,v){h!==c?(h-c>180?c+=360:c-h>180&&(h+=360),v.push({i:p.push(r(p)+"rotate(",null,n)-2,x:Ji(h,c)})):c&&p.push(r(p)+"rotate("+c+n)}function l(h,c,p,v){h!==c?v.push({i:p.push(r(p)+"skewX(",null,n)-2,x:Ji(h,c)}):c&&p.push(r(p)+"skewX("+c+n)}function u(h,c,p,v,g,b){if(h!==p||c!==v){var m=g.push(r(g)+"scale(",null,",",null,")");b.push({i:m-4,x:Ji(h,p)},{i:m-2,x:Ji(c,v)})}else(p!==1||v!==1)&&g.push(r(g)+"scale("+p+","+v+")")}return function(h,c){var p=[],v=[];return h=t(h),c=t(c),s(h.translateX,h.translateY,c.translateX,c.translateY,p,v),a(h.rotate,c.rotate,p,v),l(h.skewX,c.skewX,p,v),u(h.scaleX,h.scaleY,c.scaleX,c.scaleY,p,v),h=c=null,function(g){for(var b=-1,m=v.length,x;++b<m;)p[(x=v[b]).i]=x.x(g);return p.join("")}}}var Gk=JO(Wk,"px, ","px)","deg)"),Hk=JO(Yk,", ",")",")"),Jk=1e-12;function Og(t){return((t=Math.exp(t))+1/t)/2}function Kk(t){return((t=Math.exp(t))-1/t)/2}function eE(t){return((t=Math.exp(2*t))-1)/(t+1)}const gu=(function t(e,i,n){function r(s,a){var l=s[0],u=s[1],h=s[2],c=a[0],p=a[1],v=a[2],g=c-l,b=p-u,m=g*g+b*b,x,O;if(m<Jk)O=Math.log(v/h)/e,x=function(k){return[l+k*g,u+k*b,h*Math.exp(e*k*O)]};else{var P=Math.sqrt(m),S=(v*v-h*h+n*m)/(2*h*i*P),w=(v*v-h*h-n*m)/(2*v*i*P),C=Math.log(Math.sqrt(S*S+1)-S),E=Math.log(Math.sqrt(w*w+1)-w);O=(E-C)/e,x=function(k){var A=k*O,$=Og(C),F=h/(i*P)*($*eE(e*A+C)-Kk(C));return[l+F*g,u+F*b,h*$/Og(e*A+C)]}}return x.duration=O*1e3*e/Math.SQRT2,x}return r.rho=function(s){var a=Math.max(.001,+s),l=a*a,u=l*l;return t(a,l,u)},r})(Math.SQRT2,2,4);var Ts=0,Oa=0,na=0,KO=1e3,Fu,xa,Ru=0,Zr=0,Ec=0,bo=typeof performance=="object"&&performance.now?performance:Date,ex=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Jd(){return Zr||(ex(tE),Zr=bo.now()+Ec)}function tE(){Zr=0}function zu(){this._call=this._time=this._next=null}zu.prototype=tx.prototype={constructor:zu,restart:function(t,e,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Jd():+i)+(e==null?0:+e),!this._next&&xa!==this&&(xa?xa._next=this:Fu=this,xa=this),this._call=t,this._time=i,kf()},stop:function(){this._call&&(this._call=null,this._time=1/0,kf())}};function tx(t,e,i){var n=new zu;return n.restart(t,e,i),n}function iE(){Jd(),++Ts;for(var t=Fu,e;t;)(e=Zr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Ts}function xg(){Zr=(Ru=bo.now())+Ec,Ts=Oa=0;try{iE()}finally{Ts=0,rE(),Zr=0}}function nE(){var t=bo.now(),e=t-Ru;e>KO&&(Ec-=e,Ru=t)}function rE(){for(var t,e=Fu,i,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(i=e._next,e._next=null,e=t?t._next=i:Fu=i);xa=t,kf(n)}function kf(t){if(!Ts){Oa&&(Oa=clearTimeout(Oa));var e=t-Zr;e>24?(t<1/0&&(Oa=setTimeout(xg,t-bo.now()-Ec)),na&&(na=clearInterval(na))):(na||(Ru=bo.now(),na=setInterval(nE,KO)),Ts=1,ex(xg))}}function bg(t,e,i){var n=new zu;return e=e==null?0:+e,n.restart(r=>{n.stop(),t(r+e)},e,i),n}var sE=Cc("start","end","cancel","interrupt"),aE=[],ix=0,Sg=1,Ef=2,yu=3,wg=4,Af=5,vu=6;function Ac(t,e,i,n,r,s){var a=t.__transition;if(!a)t.__transition={};else if(i in a)return;oE(t,i,{name:e,index:n,group:r,on:sE,tween:aE,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:ix})}function Kd(t,e){var i=Qi(t,e);if(i.state>ix)throw new Error("too late; already scheduled");return i}function dn(t,e){var i=Qi(t,e);if(i.state>yu)throw new Error("too late; already running");return i}function Qi(t,e){var i=t.__transition;if(!i||!(i=i[e]))throw new Error("transition not found");return i}function oE(t,e,i){var n=t.__transition,r;n[e]=i,i.timer=tx(s,0,i.time);function s(h){i.state=Sg,i.timer.restart(a,i.delay,i.time),i.delay<=h&&a(h-i.delay)}function a(h){var c,p,v,g;if(i.state!==Sg)return u();for(c in n)if(g=n[c],g.name===i.name){if(g.state===yu)return bg(a);g.state===wg?(g.state=vu,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete n[c]):+c<e&&(g.state=vu,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete n[c])}if(bg(function(){i.state===yu&&(i.state=wg,i.timer.restart(l,i.delay,i.time),l(h))}),i.state=Ef,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Ef){for(i.state=yu,r=new Array(v=i.tween.length),c=0,p=-1;c<v;++c)(g=i.tween[c].value.call(t,t.__data__,i.index,i.group))&&(r[++p]=g);r.length=p+1}}function l(h){for(var c=h<i.duration?i.ease.call(null,h/i.duration):(i.timer.restart(u),i.state=Af,1),p=-1,v=r.length;++p<v;)r[p].call(t,c);i.state===Af&&(i.on.call("end",t,t.__data__,i.index,i.group),u())}function u(){i.state=vu,i.timer.stop(),delete n[e];for(var h in n)return;delete t.__transition}}function Ou(t,e){var i=t.__transition,n,r,s=!0,a;if(i){e=e==null?null:e+"";for(a in i){if((n=i[a]).name!==e){s=!1;continue}r=n.state>Ef&&n.state<Af,n.state=vu,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[a]}s&&delete t.__transition}}function lE(t){return this.each(function(){Ou(this,t)})}function uE(t,e){var i,n;return function(){var r=dn(this,t),s=r.tween;if(s!==i){n=i=s;for(var a=0,l=n.length;a<l;++a)if(n[a].name===e){n=n.slice(),n.splice(a,1);break}}r.tween=n}}function cE(t,e,i){var n,r;if(typeof i!="function")throw new Error;return function(){var s=dn(this,t),a=s.tween;if(a!==n){r=(n=a).slice();for(var l={name:e,value:i},u=0,h=r.length;u<h;++u)if(r[u].name===e){r[u]=l;break}u===h&&r.push(l)}s.tween=r}}function hE(t,e){var i=this._id;if(t+="",arguments.length<2){for(var n=Qi(this.node(),i).tween,r=0,s=n.length,a;r<s;++r)if((a=n[r]).name===t)return a.value;return null}return this.each((e==null?uE:cE)(i,t,e))}function ep(t,e,i){var n=t._id;return t.each(function(){var r=dn(this,n);(r.value||(r.value={}))[e]=i.apply(this,arguments)}),function(r){return Qi(r,n).value[e]}}function nx(t,e){var i;return(typeof e=="number"?Ji:e instanceof jr?Qu:(i=jr(e))?(e=i,Qu):GO)(t,e)}function fE(t){return function(){this.removeAttribute(t)}}function dE(t){return function(){this.removeAttributeNS(t.space,t.local)}}function pE(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttribute(t);return a===r?null:a===n?s:s=e(n=a,i)}}function mE(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===r?null:a===n?s:s=e(n=a,i)}}function gE(t,e,i){var n,r,s;return function(){var a,l=i(this),u;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=l+"",a===u?null:a===n&&u===r?s:(r=u,s=e(n=a,l)))}}function yE(t,e,i){var n,r,s;return function(){var a,l=i(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=l+"",a===u?null:a===n&&u===r?s:(r=u,s=e(n=a,l)))}}function vE(t,e){var i=kc(t),n=i==="transform"?Hk:nx;return this.attrTween(t,typeof e=="function"?(i.local?yE:gE)(i,n,ep(this,"attr."+t,e)):e==null?(i.local?dE:fE)(i):(i.local?mE:pE)(i,n,e))}function OE(t,e){return function(i){this.setAttribute(t,e.call(this,i))}}function xE(t,e){return function(i){this.setAttributeNS(t.space,t.local,e.call(this,i))}}function bE(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&xE(t,s)),i}return r._value=e,r}function SE(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&OE(t,s)),i}return r._value=e,r}function wE(t,e){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;var n=kc(t);return this.tween(i,(n.local?bE:SE)(n,e))}function PE(t,e){return function(){Kd(this,t).delay=+e.apply(this,arguments)}}function TE(t,e){return e=+e,function(){Kd(this,t).delay=e}}function CE(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?PE:TE)(e,t)):Qi(this.node(),e).delay}function kE(t,e){return function(){dn(this,t).duration=+e.apply(this,arguments)}}function EE(t,e){return e=+e,function(){dn(this,t).duration=e}}function AE(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?kE:EE)(e,t)):Qi(this.node(),e).duration}function DE(t,e){if(typeof e!="function")throw new Error;return function(){dn(this,t).ease=e}}function _E(t){var e=this._id;return arguments.length?this.each(DE(e,t)):Qi(this.node(),e).ease}function IE(t,e){return function(){var i=e.apply(this,arguments);if(typeof i!="function")throw new Error;dn(this,t).ease=i}}function NE(t){if(typeof t!="function")throw new Error;return this.each(IE(this._id,t))}function ME(t){typeof t!="function"&&(t=$O(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,l=n[r]=[],u,h=0;h<a;++h)(u=s[h])&&t.call(u,u.__data__,h,s)&&l.push(u);return new Dn(n,this._parents,this._name,this._id)}function $E(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,i=t._groups,n=e.length,r=i.length,s=Math.min(n,r),a=new Array(n),l=0;l<s;++l)for(var u=e[l],h=i[l],c=u.length,p=a[l]=new Array(c),v,g=0;g<c;++g)(v=u[g]||h[g])&&(p[g]=v);for(;l<n;++l)a[l]=e[l];return new Dn(a,this._parents,this._name,this._id)}function LE(t){return(t+"").trim().split(/^|\s+/).every(function(e){var i=e.indexOf(".");return i>=0&&(e=e.slice(0,i)),!e||e==="start"})}function BE(t,e,i){var n,r,s=LE(e)?Kd:dn;return function(){var a=s(this,t),l=a.on;l!==n&&(r=(n=l).copy()).on(e,i),a.on=r}}function QE(t,e){var i=this._id;return arguments.length<2?Qi(this.node(),i).on.on(t):this.each(BE(i,t,e))}function FE(t){return function(){var e=this.parentNode;for(var i in this.__transition)if(+i!==t)return;e&&e.removeChild(this)}}function RE(){return this.on("end.remove",FE(this._id))}function zE(t){var e=this._name,i=this._id;typeof t!="function"&&(t=Wd(t));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var l=n[a],u=l.length,h=s[a]=new Array(u),c,p,v=0;v<u;++v)(c=l[v])&&(p=t.call(c,c.__data__,v,l))&&("__data__"in c&&(p.__data__=c.__data__),h[v]=p,Ac(h[v],e,i,v,h,Qi(c,i)));return new Dn(s,this._parents,e,i)}function XE(t){var e=this._name,i=this._id;typeof t!="function"&&(t=MO(t));for(var n=this._groups,r=n.length,s=[],a=[],l=0;l<r;++l)for(var u=n[l],h=u.length,c,p=0;p<h;++p)if(c=u[p]){for(var v=t.call(c,c.__data__,p,u),g,b=Qi(c,i),m=0,x=v.length;m<x;++m)(g=v[m])&&Ac(g,e,i,m,v,b);s.push(v),a.push(c)}return new Dn(s,a,e,i)}var jE=Go.prototype.constructor;function ZE(){return new jE(this._groups,this._parents)}function VE(t,e){var i,n,r;return function(){var s=Ps(this,t),a=(this.style.removeProperty(t),Ps(this,t));return s===a?null:s===i&&a===n?r:r=e(i=s,n=a)}}function rx(t){return function(){this.style.removeProperty(t)}}function UE(t,e,i){var n,r=i+"",s;return function(){var a=Ps(this,t);return a===r?null:a===n?s:s=e(n=a,i)}}function qE(t,e,i){var n,r,s;return function(){var a=Ps(this,t),l=i(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),Ps(this,t))),a===u?null:a===n&&u===r?s:(r=u,s=e(n=a,l))}}function WE(t,e){var i,n,r,s="style."+e,a="end."+s,l;return function(){var u=dn(this,t),h=u.on,c=u.value[s]==null?l||(l=rx(e)):void 0;(h!==i||r!==c)&&(n=(i=h).copy()).on(a,r=c),u.on=n}}function YE(t,e,i){var n=(t+="")=="transform"?Gk:nx;return e==null?this.styleTween(t,VE(t,n)).on("end.style."+t,rx(t)):typeof e=="function"?this.styleTween(t,qE(t,n,ep(this,"style."+t,e))).each(WE(this._id,t)):this.styleTween(t,UE(t,n,e),i).on("end.style."+t,null)}function GE(t,e,i){return function(n){this.style.setProperty(t,e.call(this,n),i)}}function HE(t,e,i){var n,r;function s(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&GE(t,a,i)),n}return s._value=e,s}function JE(t,e,i){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,HE(t,e,i??""))}function KE(t){return function(){this.textContent=t}}function eA(t){return function(){var e=t(this);this.textContent=e??""}}function tA(t){return this.tween("text",typeof t=="function"?eA(ep(this,"text",t)):KE(t==null?"":t+""))}function iA(t){return function(e){this.textContent=t.call(this,e)}}function nA(t){var e,i;function n(){var r=t.apply(this,arguments);return r!==i&&(e=(i=r)&&iA(r)),e}return n._value=t,n}function rA(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,nA(t))}function sA(){for(var t=this._name,e=this._id,i=sx(),n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],l=a.length,u,h=0;h<l;++h)if(u=a[h]){var c=Qi(u,e);Ac(u,t,i,h,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Dn(n,this._parents,t,i)}function aA(){var t,e,i=this,n=i._id,r=i.size();return new Promise(function(s,a){var l={value:a},u={value:function(){--r===0&&s()}};i.each(function(){var h=dn(this,n),c=h.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),h.on=e}),r===0&&s()})}var oA=0;function Dn(t,e,i,n){this._groups=t,this._parents=e,this._name=i,this._id=n}function sx(){return++oA}var bn=Go.prototype;Dn.prototype={constructor:Dn,select:zE,selectAll:XE,selectChild:bn.selectChild,selectChildren:bn.selectChildren,filter:ME,merge:$E,selection:ZE,transition:sA,call:bn.call,nodes:bn.nodes,node:bn.node,size:bn.size,empty:bn.empty,each:bn.each,on:QE,attr:vE,attrTween:wE,style:YE,styleTween:JE,text:tA,textTween:rA,remove:RE,tween:hE,delay:CE,duration:AE,ease:_E,easeVarying:NE,end:aA,[Symbol.iterator]:bn[Symbol.iterator]};function lA(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var uA={time:null,delay:0,duration:250,ease:lA};function cA(t,e){for(var i;!(i=t.__transition)||!(i=i[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return i}function hA(t){var e,i;t instanceof Dn?(e=t._id,t=t._name):(e=sx(),(i=uA).time=Jd(),t=t==null?null:t+"");for(var n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],l=a.length,u,h=0;h<l;++h)(u=a[h])&&Ac(u,t,e,h,a,i||cA(u,e));return new Dn(n,this._parents,t,e)}Go.prototype.interrupt=lE;Go.prototype.transition=hA;const Dl=t=>()=>t;function fA(t,{sourceEvent:e,target:i,transform:n,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:r}})}function Cn(t,e,i){this.k=t,this.x=e,this.y=i}Cn.prototype={constructor:Cn,scale:function(t){return t===1?this:new Cn(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Cn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Cs=new Cn(1,0,0);Cn.prototype;function yh(t){t.stopImmediatePropagation()}function ra(t){t.preventDefault(),t.stopImmediatePropagation()}function dA(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function pA(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Pg(){return this.__zoom||Cs}function mA(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function gA(){return navigator.maxTouchPoints||"ontouchstart"in this}function yA(t,e,i){var n=t.invertX(e[0][0])-i[0][0],r=t.invertX(e[1][0])-i[1][0],s=t.invertY(e[0][1])-i[0][1],a=t.invertY(e[1][1])-i[1][1];return t.translate(r>n?(n+r)/2:Math.min(0,n)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function vA(){var t=dA,e=pA,i=yA,n=mA,r=gA,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,u=gu,h=Cc("start","zoom","end"),c,p,v,g=500,b=150,m=0,x=10;function O(M){M.property("__zoom",Pg).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",F).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}O.transform=function(M,q,X,Y){var V=M.selection?M.selection():M;V.property("__zoom",Pg),M!==V?C(M,q,X,Y):V.interrupt().each(function(){E(this,arguments).event(Y).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},O.scaleBy=function(M,q,X,Y){O.scaleTo(M,function(){var V=this.__zoom.k,oe=typeof q=="function"?q.apply(this,arguments):q;return V*oe},X,Y)},O.scaleTo=function(M,q,X,Y){O.transform(M,function(){var V=e.apply(this,arguments),oe=this.__zoom,ae=X==null?w(V):typeof X=="function"?X.apply(this,arguments):X,fe=oe.invert(ae),D=typeof q=="function"?q.apply(this,arguments):q;return i(S(P(oe,D),ae,fe),V,a)},X,Y)},O.translateBy=function(M,q,X,Y){O.transform(M,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof X=="function"?X.apply(this,arguments):X),e.apply(this,arguments),a)},null,Y)},O.translateTo=function(M,q,X,Y,V){O.transform(M,function(){var oe=e.apply(this,arguments),ae=this.__zoom,fe=Y==null?w(oe):typeof Y=="function"?Y.apply(this,arguments):Y;return i(Cs.translate(fe[0],fe[1]).scale(ae.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof X=="function"?-X.apply(this,arguments):-X),oe,a)},Y,V)};function P(M,q){return q=Math.max(s[0],Math.min(s[1],q)),q===M.k?M:new Cn(q,M.x,M.y)}function S(M,q,X){var Y=q[0]-X[0]*M.k,V=q[1]-X[1]*M.k;return Y===M.x&&V===M.y?M:new Cn(M.k,Y,V)}function w(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function C(M,q,X,Y){M.on("start.zoom",function(){E(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(Y).end()}).tween("zoom",function(){var V=this,oe=arguments,ae=E(V,oe).event(Y),fe=e.apply(V,oe),D=X==null?w(fe):typeof X=="function"?X.apply(V,oe):X,Z=Math.max(fe[1][0]-fe[0][0],fe[1][1]-fe[0][1]),L=V.__zoom,se=typeof q=="function"?q.apply(V,oe):q,de=u(L.invert(D).concat(Z/L.k),se.invert(D).concat(Z/se.k));return function(ie){if(ie===1)ie=se;else{var R=de(ie),Q=Z/R[2];ie=new Cn(Q,D[0]-R[0]*Q,D[1]-R[1]*Q)}ae.zoom(null,ie)}})}function E(M,q,X){return!X&&M.__zooming||new k(M,q)}function k(M,q){this.that=M,this.args=q,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,q),this.taps=0}k.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,q){return this.mouse&&M!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var q=Di(this.that).datum();h.call(M,this.that,new fA(M,{sourceEvent:this.sourceEvent,target:O,transform:this.that.__zoom,dispatch:h}),q)}};function A(M,...q){if(!t.apply(this,arguments))return;var X=E(this,q).event(M),Y=this.__zoom,V=Math.max(s[0],Math.min(s[1],Y.k*Math.pow(2,n.apply(this,arguments)))),oe=Hi(M);if(X.wheel)(X.mouse[0][0]!==oe[0]||X.mouse[0][1]!==oe[1])&&(X.mouse[1]=Y.invert(X.mouse[0]=oe)),clearTimeout(X.wheel);else{if(Y.k===V)return;X.mouse=[oe,Y.invert(oe)],Ou(this),X.start()}ra(M),X.wheel=setTimeout(ae,b),X.zoom("mouse",i(S(P(Y,V),X.mouse[0],X.mouse[1]),X.extent,a));function ae(){X.wheel=null,X.end()}}function $(M,...q){if(v||!t.apply(this,arguments))return;var X=M.currentTarget,Y=E(this,q,!0).event(M),V=Di(M.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",Z,!0),oe=Hi(M,X),ae=M.clientX,fe=M.clientY;VO(M.view),yh(M),Y.mouse=[oe,this.__zoom.invert(oe)],Ou(this),Y.start();function D(L){if(ra(L),!Y.moved){var se=L.clientX-ae,de=L.clientY-fe;Y.moved=se*se+de*de>m}Y.event(L).zoom("mouse",i(S(Y.that.__zoom,Y.mouse[0]=Hi(L,X),Y.mouse[1]),Y.extent,a))}function Z(L){V.on("mousemove.zoom mouseup.zoom",null),UO(L.view,Y.moved),ra(L),Y.event(L).end()}}function F(M,...q){if(t.apply(this,arguments)){var X=this.__zoom,Y=Hi(M.changedTouches?M.changedTouches[0]:M,this),V=X.invert(Y),oe=X.k*(M.shiftKey?.5:2),ae=i(S(P(X,oe),Y,V),e.apply(this,q),a);ra(M),l>0?Di(this).transition().duration(l).call(C,ae,Y,M):Di(this).call(O.transform,ae,Y,M)}}function I(M,...q){if(t.apply(this,arguments)){var X=M.touches,Y=X.length,V=E(this,q,M.changedTouches.length===Y).event(M),oe,ae,fe,D;for(yh(M),ae=0;ae<Y;++ae)fe=X[ae],D=Hi(fe,this),D=[D,this.__zoom.invert(D),fe.identifier],V.touch0?!V.touch1&&V.touch0[2]!==D[2]&&(V.touch1=D,V.taps=0):(V.touch0=D,oe=!0,V.taps=1+!!c);c&&(c=clearTimeout(c)),oe&&(V.taps<2&&(p=D[0],c=setTimeout(function(){c=null},g)),Ou(this),V.start())}}function B(M,...q){if(this.__zooming){var X=E(this,q).event(M),Y=M.changedTouches,V=Y.length,oe,ae,fe,D;for(ra(M),oe=0;oe<V;++oe)ae=Y[oe],fe=Hi(ae,this),X.touch0&&X.touch0[2]===ae.identifier?X.touch0[0]=fe:X.touch1&&X.touch1[2]===ae.identifier&&(X.touch1[0]=fe);if(ae=X.that.__zoom,X.touch1){var Z=X.touch0[0],L=X.touch0[1],se=X.touch1[0],de=X.touch1[1],ie=(ie=se[0]-Z[0])*ie+(ie=se[1]-Z[1])*ie,R=(R=de[0]-L[0])*R+(R=de[1]-L[1])*R;ae=P(ae,Math.sqrt(ie/R)),fe=[(Z[0]+se[0])/2,(Z[1]+se[1])/2],D=[(L[0]+de[0])/2,(L[1]+de[1])/2]}else if(X.touch0)fe=X.touch0[0],D=X.touch0[1];else return;X.zoom("touch",i(S(ae,fe,D),X.extent,a))}}function j(M,...q){if(this.__zooming){var X=E(this,q).event(M),Y=M.changedTouches,V=Y.length,oe,ae;for(yh(M),v&&clearTimeout(v),v=setTimeout(function(){v=null},g),oe=0;oe<V;++oe)ae=Y[oe],X.touch0&&X.touch0[2]===ae.identifier?delete X.touch0:X.touch1&&X.touch1[2]===ae.identifier&&delete X.touch1;if(X.touch1&&!X.touch0&&(X.touch0=X.touch1,delete X.touch1),X.touch0)X.touch0[1]=this.__zoom.invert(X.touch0[0]);else if(X.end(),X.taps===2&&(ae=Hi(ae,this),Math.hypot(p[0]-ae[0],p[1]-ae[1])<x)){var fe=Di(this).on("dblclick.zoom");fe&&fe.apply(this,arguments)}}}return O.wheelDelta=function(M){return arguments.length?(n=typeof M=="function"?M:Dl(+M),O):n},O.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Dl(!!M),O):t},O.touchable=function(M){return arguments.length?(r=typeof M=="function"?M:Dl(!!M),O):r},O.extent=function(M){return arguments.length?(e=typeof M=="function"?M:Dl([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),O):e},O.scaleExtent=function(M){return arguments.length?(s[0]=+M[0],s[1]=+M[1],O):[s[0],s[1]]},O.translateExtent=function(M){return arguments.length?(a[0][0]=+M[0][0],a[1][0]=+M[1][0],a[0][1]=+M[0][1],a[1][1]=+M[1][1],O):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},O.constrain=function(M){return arguments.length?(i=M,O):i},O.duration=function(M){return arguments.length?(l=+M,O):l},O.interpolate=function(M){return arguments.length?(u=M,O):u},O.on=function(){var M=h.on.apply(h,arguments);return M===h?O:M},O.clickDistance=function(M){return arguments.length?(m=(M=+M)*M,O):Math.sqrt(m)},O.tapDistance=function(M){return arguments.length?(x=+M,O):x},O}var Xe=(t=>(t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t))(Xe||{}),tp=(t=>(t.Partial="partial",t.Full="full",t))(tp||{}),Pr=(t=>(t.Bezier="default",t.SimpleBezier="simple-bezier",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t))(Pr||{}),er=(t=>(t.Strict="strict",t.Loose="loose",t))(er||{}),Df=(t=>(t.Arrow="arrow",t.ArrowClosed="arrowclosed",t))(Df||{}),ro=(t=>(t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t))(ro||{}),ax=(t=>(t.TopLeft="top-left",t.TopCenter="top-center",t.TopRight="top-right",t.BottomLeft="bottom-left",t.BottomCenter="bottom-center",t.BottomRight="bottom-right",t))(ax||{});const OA=["INPUT","SELECT","TEXTAREA"],xA=typeof document<"u"?document:null;function _f(t){var e,i;const n=((i=(e=t.composedPath)==null?void 0:e.call(t))==null?void 0:i[0])||t.target,r=typeof n?.hasAttribute=="function"?n.hasAttribute("contenteditable"):!1,s=typeof n?.closest=="function"?n.closest(".nokey"):null;return OA.includes(n?.nodeName)||r||!!s}function bA(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function Tg(t,e,i,n){const r=e.replace("+",`
|
|
7
|
+
`).replace(`
|
|
8
|
+
|
|
9
|
+
`,`
|
|
10
|
+
+`).split(`
|
|
11
|
+
`).map(a=>a.trim().toLowerCase());if(r.length===1)return t.toLowerCase()===e.toLowerCase();n||i.add(t.toLowerCase());const s=r.every((a,l)=>i.has(a)&&Array.from(i.values())[l]===r[l]);return n&&i.delete(t.toLowerCase()),s}function SA(t,e){return i=>{if(!i.code&&!i.key)return!1;const n=wA(i.code,t);return Array.isArray(t)?t.some(r=>Tg(i[n],r,e,i.type==="keyup")):Tg(i[n],t,e,i.type==="keyup")}}function wA(t,e){return e.includes(t)?"code":"key"}function so(t,e){const i=Fe(()=>nt(e?.target)??xA),n=Mi(nt(t)===!0);let r=!1;const s=new Set;let a=u(nt(t));Ge(()=>nt(t),(h,c)=>{typeof c=="boolean"&&typeof h!="boolean"&&l(),a=u(h)},{immediate:!0}),IO(["blur","contextmenu"],l),og((...h)=>a(...h),h=>{var c,p;const v=nt(e?.actInsideInputWithModifier)??!0,g=nt(e?.preventDefault)??!1;if(r=bA(h),(!r||r&&!v)&&_f(h))return;const m=((p=(c=h.composedPath)==null?void 0:c.call(h))==null?void 0:p[0])||h.target,x=m?.nodeName==="BUTTON"||m?.nodeName==="A";!g&&(r||!x)&&h.preventDefault(),n.value=!0},{eventName:"keydown",target:i}),og((...h)=>a(...h),h=>{const c=nt(e?.actInsideInputWithModifier)??!0;if(n.value){if((!r||r&&!c)&&_f(h))return;r=!1,n.value=!1}},{eventName:"keyup",target:i});function l(){r=!1,s.clear(),n.value=nt(t)===!0}function u(h){return h===null?(l(),()=>!1):typeof h=="boolean"?(l(),n.value=h,()=>!1):Array.isArray(h)||typeof h=="string"?SA(h,s):h}return n}const ox="vue-flow__node-desc",lx="vue-flow__edge-desc",PA="vue-flow__aria-live",ux=["Enter"," ","Escape"],ps={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Xu(t){return{...t.computedPosition||{x:0,y:0},width:t.dimensions.width||0,height:t.dimensions.height||0}}function ju(t,e){const i=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),n=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(i*n)}function Dc(t){return{width:t.offsetWidth,height:t.offsetHeight}}function Vr(t,e=0,i=1){return Math.min(Math.max(t,e),i)}function cx(t,e){return{x:Vr(t.x,e[0][0],e[1][0]),y:Vr(t.y,e[0][1],e[1][1])}}function Cg(t){const e=t.getRootNode();return"elementFromPoint"in e?e:window.document}function tr(t){return t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t}function Lr(t){return t&&typeof t=="object"&&"id"in t&&"position"in t&&!tr(t)}function ba(t){return Lr(t)&&"computedPosition"in t}function _l(t){return!Number.isNaN(t)&&Number.isFinite(t)}function TA(t){return _l(t.width)&&_l(t.height)&&_l(t.x)&&_l(t.y)}function CA(t,e,i){const n={id:t.id.toString(),type:t.type??"default",dimensions:io({width:0,height:0}),computedPosition:io({z:0,...t.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:It(t.data)?t.data:{},events:io(It(t.events)?t.events:{})};return Object.assign(e??n,t,{id:t.id.toString(),parentNode:i})}function hx(t,e,i){var n,r;const s={id:t.id.toString(),type:t.type??e?.type??"default",source:t.source.toString(),target:t.target.toString(),sourceHandle:(n=t.sourceHandle)==null?void 0:n.toString(),targetHandle:(r=t.targetHandle)==null?void 0:r.toString(),updatable:t.updatable??i?.updatable,selectable:t.selectable??i?.selectable,focusable:t.focusable??i?.focusable,data:It(t.data)?t.data:{},events:io(It(t.events)?t.events:{}),label:t.label??"",interactionWidth:t.interactionWidth??i?.interactionWidth,...i??{}};return Object.assign(e??s,t,{id:t.id.toString()})}function fx(t,e,i,n){const r=typeof t=="string"?t:t.id,s=new Set,a=n==="source"?"target":"source";for(const l of i)l[a]===r&&s.add(l[n]);return e.filter(l=>s.has(l.id))}function kA(...t){if(t.length===3){const[s,a,l]=t;return fx(s,a,l,"target")}const[e,i]=t,n=typeof e=="string"?e:e.id;return i.filter(s=>tr(s)&&s.source===n).map(s=>i.find(a=>Lr(a)&&a.id===s.target))}function EA(...t){if(t.length===3){const[s,a,l]=t;return fx(s,a,l,"source")}const[e,i]=t,n=typeof e=="string"?e:e.id;return i.filter(s=>tr(s)&&s.target===n).map(s=>i.find(a=>Lr(a)&&a.id===s.source))}function dx({source:t,sourceHandle:e,target:i,targetHandle:n}){return`vueflow__edge-${t}${e??""}-${i}${n??""}`}function AA(t,e){return e.some(i=>tr(i)&&i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle))}function So({x:t,y:e},{x:i,y:n,zoom:r}){return{x:t*r+i,y:e*r+n}}function wo({x:t,y:e},{x:i,y:n,zoom:r},s=!1,a=[1,1]){const l={x:(t-i)/r,y:(e-n)/r};return s?_c(l,a):l}function px(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}}function Zu({x:t,y:e,width:i,height:n}){return{x:t,y:e,x2:t+i,y2:e+n}}function mx({x:t,y:e,x2:i,y2:n}){return{x:t,y:e,width:i-t,height:n-e}}function DA(t,e){return mx(px(Zu(t),Zu(e)))}function ip(t){let e={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let i=0;i<t.length;i++){const n=t[i];e=px(e,Zu({...n.computedPosition,...n.dimensions}))}return mx(e)}function gx(t,e,i={x:0,y:0,zoom:1},n=!1,r=!1){const s={...wo(e,i),width:e.width/i.zoom,height:e.height/i.zoom},a=[];for(const l of t){const{dimensions:u,selectable:h=!0,hidden:c=!1}=l,p=u.width??l.width??null,v=u.height??l.height??null;if(r&&!h||c)continue;const g=ju(s,Xu(l)),b=p===null||v===null,m=n&&g>0,x=(p??0)*(v??0);(b||m||g>=x||l.dragging)&&a.push(l)}return a}function Tr(t,e){const i=new Set;if(typeof t=="string")i.add(t);else if(t.length>=1)for(const n of t)i.add(n.id);return e.filter(n=>i.has(n.source)||i.has(n.target))}function ts(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=Number.parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=Number.parseFloat(t);if(!Number.isNaN(i))return Math.floor(e*i*.01)}return Jo(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function _A(t,e,i){if(typeof t=="string"||typeof t=="number"){const n=ts(t,i),r=ts(t,e);return{top:n,right:r,bottom:n,left:r,x:r*2,y:n*2}}if(typeof t=="object"){const n=ts(t.top??t.y??0,i),r=ts(t.bottom??t.y??0,i),s=ts(t.left??t.x??0,e),a=ts(t.right??t.x??0,e);return{top:n,right:a,bottom:r,left:s,x:s+a,y:n+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function IA(t,e,i,n,r,s){const{x:a,y:l}=So(t,{x:e,y:i,zoom:n}),{x:u,y:h}=So({x:t.x+t.width,y:t.y+t.height},{x:e,y:i,zoom:n}),c=r-u,p=s-h;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(p)}}function kg(t,e,i,n,r,s=.1){const a=_A(s,e,i),l=(e-a.x)/t.width,u=(i-a.y)/t.height,h=Math.min(l,u),c=Vr(h,n,r),p=t.x+t.width/2,v=t.y+t.height/2,g=e/2-p*c,b=i/2-v*c,m=IA(t,g,b,c,e,i),x={left:Math.min(m.left-a.left,0),top:Math.min(m.top-a.top,0),right:Math.min(m.right-a.right,0),bottom:Math.min(m.bottom-a.bottom,0)};return{x:g-x.left+x.right,y:b-x.top+x.bottom,zoom:c}}function NA(t,e){return{x:e.x+t.x,y:e.y+t.y,z:(t.z>e.z?t.z:e.z)+1}}function yx(t,e){if(!t.parentNode)return!1;const i=e.get(t.parentNode);return i?i.selected?!0:yx(i,e):!1}function Po(t,e){return typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`}function If(t){const e=t.ctrlKey&&To()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e}function Eg(t,e,i){return t<e?Vr(Math.abs(t-e),1,e)/e:t>i?-Vr(Math.abs(t-i),1,e)/e:0}function vx(t,e,i=15,n=40){const r=Eg(t.x,n,e.width-n)*i,s=Eg(t.y,n,e.height-n)*i;return[r,s]}function vh(t,e){if(e){const i=t.position.x+t.dimensions.width-e.dimensions.width,n=t.position.y+t.dimensions.height-e.dimensions.height;if(i>0||n>0||t.position.x<0||t.position.y<0){let r={};if(typeof e.style=="function"?r={...e.style(e)}:e.style&&(r={...e.style}),r.width=r.width??`${e.dimensions.width}px`,r.height=r.height??`${e.dimensions.height}px`,i>0)if(typeof r.width=="string"){const s=Number(r.width.replace("px",""));r.width=`${s+i}px`}else r.width+=i;if(n>0)if(typeof r.height=="string"){const s=Number(r.height.replace("px",""));r.height=`${s+n}px`}else r.height+=n;if(t.position.x<0){const s=Math.abs(t.position.x);if(e.position.x=e.position.x-s,typeof r.width=="string"){const a=Number(r.width.replace("px",""));r.width=`${a+s}px`}else r.width+=s;t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);if(e.position.y=e.position.y-s,typeof r.height=="string"){const a=Number(r.height.replace("px",""));r.height=`${a+s}px`}else r.height+=s;t.position.y=0}e.dimensions.width=Number(r.width.toString().replace("px","")),e.dimensions.height=Number(r.height.toString().replace("px","")),typeof e.style=="function"?e.style=s=>{const a=e.style;return{...a(s),...r}}:e.style={...e.style,...r}}}}function Ag(t,e){var i,n;const r=t.filter(a=>a.type==="add"||a.type==="remove");for(const a of r)if(a.type==="add")e.findIndex(u=>u.id===a.item.id)===-1&&e.push(a.item);else if(a.type==="remove"){const l=e.findIndex(u=>u.id===a.id);l!==-1&&e.splice(l,1)}const s=e.map(a=>a.id);for(const a of e)for(const l of t)if(l.id===a.id)switch(l.type){case"select":a.selected=l.selected;break;case"position":if(ba(a)&&(typeof l.position<"u"&&(a.position=l.position),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&a.parentNode)){const u=e[s.indexOf(a.parentNode)];u&&ba(u)&&vh(a,u)}break;case"dimensions":if(ba(a)&&(typeof l.dimensions<"u"&&(a.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(a.style={...a.style||{},width:`${(i=l.dimensions)==null?void 0:i.width}px`,height:`${(n=l.dimensions)==null?void 0:n.height}px`}),typeof l.resizing<"u"&&(a.resizing=l.resizing),a.expandParent&&a.parentNode)){const u=e[s.indexOf(a.parentNode)];u&&ba(u)&&(!!u.dimensions.width&&!!u.dimensions.height?vh(a,u):vi(()=>{vh(a,u)}))}break}return e}function jn(t,e){return{id:t,type:"select",selected:e}}function Dg(t){return{item:t,type:"add"}}function _g(t){return{id:t,type:"remove"}}function Ig(t,e,i,n,r){return{id:t,source:e,target:i,sourceHandle:n||null,targetHandle:r||null,type:"remove"}}function Un(t,e=new Set,i=!1){const n=[];for(const[r,s]of t){const a=e.has(r);!(s.selected===void 0&&!a)&&s.selected!==a&&(i&&(s.selected=a),n.push(jn(s.id,a)))}return n}const Ng=()=>{};function Ne(t){const e=new Set;let i=Ng,n=()=>!1;const r=()=>e.size>0||n(),s=v=>{i=v},a=()=>{i=Ng},l=v=>{n=v},u=()=>{n=()=>!1},h=v=>{e.delete(v)};return{on:v=>{e.add(v);const g=()=>h(v);return yo(g),{off:g}},off:h,trigger:v=>{const g=[i];return r()?g.push(...e):t&&g.push(t),Promise.allSettled(g.map(b=>b(v)))},hasListeners:r,listeners:e,setEmitter:s,removeEmitter:a,setHasEmitListeners:l,removeHasEmitListeners:u}}function Mg(t,e,i){let n=t;do{if(n&&n.matches(e))return!0;if(n===i)return!1;n=n.parentElement}while(n);return!1}function MA(t,e,i,n){var r,s;const a=new Map;for(const[l,u]of t)(u.selected||u.id===n)&&(!u.parentNode||!yx(u,t))&&(u.draggable||e&&typeof u.draggable>"u")&&t.get(l)&&a.set(l,{id:u.id,position:u.position||{x:0,y:0},distance:{x:i.x-((r=u.computedPosition)==null?void 0:r.x)||0,y:i.y-((s=u.computedPosition)==null?void 0:s.y)||0},from:{x:u.computedPosition.x,y:u.computedPosition.y},extent:u.extent,parentNode:u.parentNode,dimensions:{...u.dimensions},expandParent:u.expandParent});return Array.from(a.values())}function Oh({id:t,dragItems:e,findNode:i}){const n=[];for(const r of e){const s=i(r.id);s&&n.push(s)}return[t?n.find(r=>r.id===t):n[0],n]}function Ox(t){if(Array.isArray(t))switch(t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return t;default:return[0,0,0,0]}return[t,t,t,t]}function $A(t,e,i){const[n,r,s,a]=typeof t!="string"?Ox(t.padding):[0,0,0,0];return i&&typeof i.computedPosition.x<"u"&&typeof i.computedPosition.y<"u"&&typeof i.dimensions.width<"u"&&typeof i.dimensions.height<"u"?[[i.computedPosition.x+a,i.computedPosition.y+n],[i.computedPosition.x+i.dimensions.width-r,i.computedPosition.y+i.dimensions.height-s]]:!1}function LA(t,e,i,n){let r=t.extent||i;if((r==="parent"||!Array.isArray(r)&&r?.range==="parent")&&!t.expandParent)if(t.parentNode&&n&&t.dimensions.width&&t.dimensions.height){const s=$A(r,t,n);s&&(r=s)}else e(new Bt(Nt.NODE_EXTENT_INVALID,t.id)),r=i;else if(Array.isArray(r)){const s=n?.computedPosition.x||0,a=n?.computedPosition.y||0;r=[[r[0][0]+s,r[0][1]+a],[r[1][0]+s,r[1][1]+a]]}else if(r!=="parent"&&r?.range&&Array.isArray(r.range)){const[s,a,l,u]=Ox(r.padding),h=n?.computedPosition.x||0,c=n?.computedPosition.y||0;r=[[r.range[0][0]+h+u,r.range[0][1]+c+s],[r.range[1][0]+h-a,r.range[1][1]+c-l]]}return r==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:r}function BA({width:t,height:e},i){return[i[0],[i[1][0]-(t||0),i[1][1]-(e||0)]]}function np(t,e,i,n,r){const s=BA(t.dimensions,LA(t,i,n,r)),a=cx(e,s);return{position:{x:a.x-(r?.computedPosition.x||0),y:a.y-(r?.computedPosition.y||0)},computedPosition:a}}function ks(t,e,i=Xe.Left,n=!1){const r=(e?.x??0)+t.computedPosition.x,s=(e?.y??0)+t.computedPosition.y,{width:a,height:l}=e??zA(t);if(n)return{x:r+a/2,y:s+l/2};switch(e?.position??i){case Xe.Top:return{x:r+a/2,y:s};case Xe.Right:return{x:r+a,y:s+l/2};case Xe.Bottom:return{x:r+a/2,y:s+l};case Xe.Left:return{x:r,y:s+l/2}}}function $g(t,e){return t&&(e?t.find(i=>i.id===e):t[0])||null}function QA({sourcePos:t,targetPos:e,sourceWidth:i,sourceHeight:n,targetWidth:r,targetHeight:s,width:a,height:l,viewport:u}){const h={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+i,e.x+r),y2:Math.max(t.y+n,e.y+s)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const c=Zu({x:(0-u.x)/u.zoom,y:(0-u.y)/u.zoom,width:a/u.zoom,height:l/u.zoom}),p=Math.max(0,Math.min(c.x2,h.x2)-Math.max(c.x,h.x)),v=Math.max(0,Math.min(c.y2,h.y2)-Math.max(c.y,h.y));return Math.ceil(p*v)>0}function FA(t,e,i=!1){const n=typeof t.zIndex=="number";let r=n?t.zIndex:0;const s=e(t.source),a=e(t.target);return!s||!a?0:(i&&(r=n?t.zIndex:Math.max(s.computedPosition.z||0,a.computedPosition.z||0)),r)}var Nt=(t=>(t.MISSING_STYLES="MISSING_STYLES",t.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",t.NODE_INVALID="NODE_INVALID",t.NODE_NOT_FOUND="NODE_NOT_FOUND",t.NODE_MISSING_PARENT="NODE_MISSING_PARENT",t.NODE_TYPE_MISSING="NODE_TYPE_MISSING",t.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",t.EDGE_INVALID="EDGE_INVALID",t.EDGE_NOT_FOUND="EDGE_NOT_FOUND",t.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",t.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",t.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",t.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",t.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",t.EDGE_ORPHANED="EDGE_ORPHANED",t.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",t))(Nt||{});const Lg={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:t=>`Node is invalid
|
|
12
|
+
Node: ${t}`,NODE_NOT_FOUND:t=>`Node not found
|
|
13
|
+
Node: ${t}`,NODE_MISSING_PARENT:(t,e)=>`Node is missing a parent
|
|
14
|
+
Node: ${t}
|
|
15
|
+
Parent: ${e}`,NODE_TYPE_MISSING:t=>`Node type is missing
|
|
16
|
+
Type: ${t}`,NODE_EXTENT_INVALID:t=>`Only child nodes can use a parent extent
|
|
17
|
+
Node: ${t}`,EDGE_INVALID:t=>`An edge needs a source and a target
|
|
18
|
+
Edge: ${t}`,EDGE_SOURCE_MISSING:(t,e)=>`Edge source is missing
|
|
19
|
+
Edge: ${t}
|
|
20
|
+
Source: ${e}`,EDGE_TARGET_MISSING:(t,e)=>`Edge target is missing
|
|
21
|
+
Edge: ${t}
|
|
22
|
+
Target: ${e}`,EDGE_TYPE_MISSING:t=>`Edge type is missing
|
|
23
|
+
Type: ${t}`,EDGE_SOURCE_TARGET_SAME:(t,e,i)=>`Edge source and target are the same
|
|
24
|
+
Edge: ${t}
|
|
25
|
+
Source: ${e}
|
|
26
|
+
Target: ${i}`,EDGE_SOURCE_TARGET_MISSING:(t,e,i)=>`Edge source or target is missing
|
|
27
|
+
Edge: ${t}
|
|
28
|
+
Source: ${e}
|
|
29
|
+
Target: ${i}`,EDGE_ORPHANED:t=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
30
|
+
Edge: ${t}`,EDGE_NOT_FOUND:t=>`Edge not found
|
|
31
|
+
Edge: ${t}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Bt extends Error{constructor(e,...i){var n;super((n=Lg[e])==null?void 0:n.call(Lg,...i)),this.name="VueFlowError",this.code=e,this.args=i}}function rp(t){return"clientX"in t}function RA(t){return"sourceEvent"in t}function en(t,e){const i=rp(t);let n,r;return i?(n=t.clientX,r=t.clientY):"touches"in t&&t.touches.length>0?(n=t.touches[0].clientX,r=t.touches[0].clientY):"changedTouches"in t&&t.changedTouches.length>0?(n=t.changedTouches[0].clientX,r=t.changedTouches[0].clientY):(n=0,r=0),{x:n-(e?.left??0),y:r-(e?.top??0)}}const To=()=>{var t;return typeof navigator<"u"&&((t=navigator?.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function zA(t){var e,i;return{width:((e=t.dimensions)==null?void 0:e.width)??t.width??0,height:((i=t.dimensions)==null?void 0:i.height)??t.height??0}}function _c(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}const XA=()=>!0;function xh(t){t?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function jA(t,e,i){const n=[],r={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const s of e.values())ju(r,Xu(s))>0&&n.push(s);return n}const ZA=250;function VA(t,e,i,n){var r,s;let a=[],l=Number.POSITIVE_INFINITY;const u=jA(t,i,e+ZA);for(const h of u){const c=[...((r=h.handleBounds)==null?void 0:r.source)??[],...((s=h.handleBounds)==null?void 0:s.target)??[]];for(const p of c){if(n.nodeId===p.nodeId&&n.type===p.type&&n.id===p.id)continue;const{x:v,y:g}=ks(h,p,p.position,!0),b=Math.sqrt((v-t.x)**2+(g-t.y)**2);b>e||(b<l?(a=[{...p,x:v,y:g}],l=b):b===l&&a.push({...p,x:v,y:g}))}}if(!a.length)return null;if(a.length>1){const h=n.type==="source"?"target":"source";return a.find(c=>c.type===h)??a[0]}return a[0]}function Bg(t,{handle:e,connectionMode:i,fromNodeId:n,fromHandleId:r,fromType:s,doc:a,lib:l,flowId:u,isValidConnection:h=XA},c,p,v,g){const b=s==="target",m=e?a.querySelector(`.${l}-flow__handle[data-id="${u}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x,y:O}=en(t),P=a.elementFromPoint(x,O),S=P?.classList.contains(`${l}-flow__handle`)?P:m,w={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const C=xx(void 0,S),E=S.getAttribute("data-nodeid"),k=S.getAttribute("data-handleid"),A=S.classList.contains("connectable"),$=S.classList.contains("connectableend");if(!E||!C)return w;const F={source:b?E:n,sourceHandle:b?k:r,target:b?n:E,targetHandle:b?r:k};w.connection=F;const B=A&&$&&(i===er.Strict?b&&C==="source"||!b&&C==="target":E!==n||k!==r);w.isValid=B&&h(F,{nodes:p,edges:c,sourceNode:v(F.source),targetNode:v(F.target)}),w.toHandle=bx(E,C,k,g,i,!0)}return w}function xx(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function UA(t,e){let i=null;return e?i="valid":t&&!e&&(i="invalid"),i}function qA(t,e){let i=null;return e?i=!0:t&&!e&&(i=!1),i}function bx(t,e,i,n,r,s=!1){var a,l,u;const h=n.get(t);if(!h)return null;const c=r===er.Strict?(a=h.handleBounds)==null?void 0:a[e]:[...((l=h.handleBounds)==null?void 0:l.source)??[],...((u=h.handleBounds)==null?void 0:u.target)??[]],p=(i?c?.find(v=>v.id===i):c?.[0])??null;return p&&s?{...p,...ks(h,p,p.position,!0)}:p}const Nf={[Xe.Left]:Xe.Right,[Xe.Right]:Xe.Left,[Xe.Top]:Xe.Bottom,[Xe.Bottom]:Xe.Top},WA=["production","prod"];function Jo(t,...e){Sx()&&console.warn(`[Vue Flow]: ${t}`,...e)}function Sx(){return!WA.includes("production")}function Qg(t,e,i,n,r){const s=e.querySelectorAll(`.vue-flow__handle.${t}`);return s?.length?Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:r,position:a.getAttribute("data-handlepos"),x:(l.left-i.left)/n,y:(l.top-i.top)/n,...Dc(a)}}):null}function Mf(t,e,i,n,r,s=!1,a){r.value=!1,t.selected?(s||t.selected&&e)&&(n([t]),vi(()=>{a.blur()})):i([t])}function It(t){return typeof Se(t)<"u"}function YA(t,e,i,n){if(!t||!t.source||!t.target)return i(new Bt(Nt.EDGE_INVALID,t?.id??"[ID UNKNOWN]")),!1;let r;return tr(t)?r=t:r={...t,id:dx(t)},r=hx(r,void 0,n),AA(r,e)?!1:r}function GA(t,e,i,n,r){if(!e.source||!e.target)return r(new Bt(Nt.EDGE_INVALID,t.id)),!1;if(!i)return r(new Bt(Nt.EDGE_NOT_FOUND,t.id)),!1;const{id:s,...a}=t;return{...a,id:n?dx(e):s,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function Fg(t,e,i){const n={},r=[];for(let s=0;s<t.length;++s){const a=t[s];if(!Lr(a)){i(new Bt(Nt.NODE_INVALID,a?.id)||`[ID UNKNOWN|INDEX ${s}]`);continue}const l=CA(a,e(a.id),a.parentNode);a.parentNode&&(n[a.parentNode]=!0),r[s]=l}for(const s of r){const a=e(s.parentNode)||r.find(l=>l.id===s.parentNode);s.parentNode&&!a&&i(new Bt(Nt.NODE_MISSING_PARENT,s.id,s.parentNode)),(s.parentNode||n[s.id])&&(n[s.id]&&(s.isParent=!0),a&&(a.isParent=!0))}return r}function Rg(t,e,i,n,r,s){let a=r;const l=n.get(a)||new Map;n.set(a,l.set(i,e)),a=`${r}-${t}`;const u=n.get(a)||new Map;if(n.set(a,u.set(i,e)),s){a=`${r}-${t}-${s}`;const h=n.get(a)||new Map;n.set(a,h.set(i,e))}}function bh(t,e,i){t.clear();for(const n of i){const{source:r,target:s,sourceHandle:a=null,targetHandle:l=null}=n,u={edgeId:n.id,source:r,target:s,sourceHandle:a,targetHandle:l},h=`${r}-${a}--${s}-${l}`,c=`${s}-${l}--${r}-${a}`;Rg("source",u,c,t,r,a),Rg("target",u,h,t,s,l)}}function zg(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function Sh(t,e,i,n,r,s,a,l){const u=[];for(const h of t){const c=tr(h)?h:YA(h,l,r,s);if(!c)continue;const p=i(c.source),v=i(c.target);if(!p||!v){r(new Bt(Nt.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!p){r(new Bt(Nt.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!v){r(new Bt(Nt.EDGE_TARGET_MISSING,c.id,c.target));continue}if(e&&!e(c,{edges:l,nodes:a,sourceNode:p,targetNode:v})){r(new Bt(Nt.EDGE_INVALID,c.id));continue}const g=n(c.id);u.push({...hx(c,g,s),sourceNode:p,targetNode:v})}return u}const Xg=Symbol("vueFlow"),wx=Symbol("nodeId"),Px=Symbol("nodeRef"),HA=Symbol("edgeId"),JA=Symbol("edgeRef"),Ic=Symbol("slots");function Tx(t){const{vueFlowRef:e,snapToGrid:i,snapGrid:n,noDragClassName:r,nodeLookup:s,nodeExtent:a,nodeDragThreshold:l,viewport:u,autoPanOnNodeDrag:h,autoPanSpeed:c,nodesDraggable:p,panBy:v,findNode:g,multiSelectionActive:b,nodesSelectionActive:m,selectNodesOnDrag:x,removeSelectedElements:O,addSelectedNodes:P,updateNodePositions:S,emits:w}=vt(),{onStart:C,onDrag:E,onStop:k,onClick:A,el:$,disabled:F,id:I,selectable:B,dragHandle:j}=t,M=Mi(!1);let q=[],X,Y=null,V={x:void 0,y:void 0},oe={x:0,y:0},ae=null,fe=!1,D=!1,Z=0,L=!1;const se=t2(),de=({x:ke,y:$e})=>{V={x:ke,y:$e};let te=!1;if(q=q.map(H=>{const re={x:ke-H.distance.x,y:$e-H.distance.y},{computedPosition:G}=np(H,i.value?_c(re,n.value):re,w.error,a.value,H.parentNode?g(H.parentNode):void 0);return te=te||H.position.x!==G.x||H.position.y!==G.y,H.position=G,H}),D=D||te,!!te&&(S(q,!0,!0),M.value=!0,ae)){const[H,re]=Oh({id:I,dragItems:q,findNode:g});E({event:ae,node:H,nodes:re})}},ie=()=>{if(!Y)return;const[ke,$e]=vx(oe,Y,c.value);if(ke!==0||$e!==0){const te={x:(V.x??0)-ke/u.value.zoom,y:(V.y??0)-$e/u.value.zoom};v({x:ke,y:$e})&&de(te)}Z=requestAnimationFrame(ie)},R=(ke,$e)=>{fe=!0;const te=g(I);!x.value&&!b.value&&te&&(te.selected||O()),te&&nt(B)&&x.value&&Mf(te,b.value,P,O,m,!1,$e);const H=se(ke.sourceEvent);if(V=H,q=MA(s.value,p.value,H,I),q.length){const[re,G]=Oh({id:I,dragItems:q,findNode:g});C({event:ke.sourceEvent,node:re,nodes:G})}},Q=(ke,$e)=>{var te;ke.sourceEvent.type==="touchmove"&&ke.sourceEvent.touches.length>1||(D=!1,l.value===0&&R(ke,$e),V=se(ke.sourceEvent),Y=((te=e.value)==null?void 0:te.getBoundingClientRect())||null,oe=en(ke.sourceEvent,Y))},xe=(ke,$e)=>{const te=se(ke.sourceEvent);if(!L&&fe&&h.value&&(L=!0,ie()),!fe){const H=te.xSnapped-(V.x??0),re=te.ySnapped-(V.y??0);Math.sqrt(H*H+re*re)>l.value&&R(ke,$e)}(V.x!==te.xSnapped||V.y!==te.ySnapped)&&q.length&&fe&&(ae=ke.sourceEvent,oe=en(ke.sourceEvent,Y),de(te))},Re=ke=>{let $e=!1;if(!fe&&!M.value&&!b.value){const te=ke.sourceEvent,H=se(te),re=H.xSnapped-(V.x??0),G=H.ySnapped-(V.y??0),J=Math.sqrt(re*re+G*G);J!==0&&J<=l.value&&(A?.(te),$e=!0)}if(q.length&&!$e){D&&(S(q,!1,!1),D=!1);const[te,H]=Oh({id:I,dragItems:q,findNode:g});k({event:ke.sourceEvent,node:te,nodes:H})}q=[],M.value=!1,L=!1,fe=!1,V={x:void 0,y:void 0},cancelAnimationFrame(Z)};return Ge([()=>nt(F),$],([ke,$e],te,H)=>{if($e){const re=Di($e);ke||(X=Tk().on("start",G=>Q(G,$e)).on("drag",G=>xe(G,$e)).on("end",G=>Re(G)).filter(G=>{const J=G.target,le=nt(j);return!G.button&&(!r.value||!Mg(J,`.${r.value}`,$e)&&(!le||Mg(J,le,$e)))}),re.call(X)),H(()=>{re.on(".drag",null),X&&(X.on("start",null),X.on("drag",null),X.on("end",null))})}}),M}function KA(){return{doubleClick:Ne(),click:Ne(),mouseEnter:Ne(),mouseMove:Ne(),mouseLeave:Ne(),contextMenu:Ne(),updateStart:Ne(),update:Ne(),updateEnd:Ne()}}function e2(t,e){const i=KA();return i.doubleClick.on(n=>{var r,s;e.edgeDoubleClick(n),(s=(r=t.events)==null?void 0:r.doubleClick)==null||s.call(r,n)}),i.click.on(n=>{var r,s;e.edgeClick(n),(s=(r=t.events)==null?void 0:r.click)==null||s.call(r,n)}),i.mouseEnter.on(n=>{var r,s;e.edgeMouseEnter(n),(s=(r=t.events)==null?void 0:r.mouseEnter)==null||s.call(r,n)}),i.mouseMove.on(n=>{var r,s;e.edgeMouseMove(n),(s=(r=t.events)==null?void 0:r.mouseMove)==null||s.call(r,n)}),i.mouseLeave.on(n=>{var r,s;e.edgeMouseLeave(n),(s=(r=t.events)==null?void 0:r.mouseLeave)==null||s.call(r,n)}),i.contextMenu.on(n=>{var r,s;e.edgeContextMenu(n),(s=(r=t.events)==null?void 0:r.contextMenu)==null||s.call(r,n)}),i.updateStart.on(n=>{var r,s;e.edgeUpdateStart(n),(s=(r=t.events)==null?void 0:r.updateStart)==null||s.call(r,n)}),i.update.on(n=>{var r,s;e.edgeUpdate(n),(s=(r=t.events)==null?void 0:r.update)==null||s.call(r,n)}),i.updateEnd.on(n=>{var r,s;e.edgeUpdateEnd(n),(s=(r=t.events)==null?void 0:r.updateEnd)==null||s.call(r,n)}),Object.entries(i).reduce((n,[r,s])=>(n.emit[r]=s.trigger,n.on[r]=s.on,n),{emit:{},on:{}})}function t2(){const{viewport:t,snapGrid:e,snapToGrid:i,vueFlowRef:n}=vt();return r=>{var s;const a=((s=n.value)==null?void 0:s.getBoundingClientRect())??{left:0,top:0},l=RA(r)?r.sourceEvent:r,{x:u,y:h}=en(l,a),c=wo({x:u,y:h},t.value),{x:p,y:v}=i.value?_c(c,e.value):c;return{xSnapped:p,ySnapped:v,...c}}}function Il(){return!0}function Cx({handleId:t,nodeId:e,type:i,isValidConnection:n,edgeUpdaterType:r,onEdgeUpdate:s,onEdgeUpdateEnd:a}){const{id:l,vueFlowRef:u,connectionMode:h,connectionRadius:c,connectOnClick:p,connectionClickStartHandle:v,nodesConnectable:g,autoPanOnConnect:b,autoPanSpeed:m,findNode:x,panBy:O,startConnection:P,updateConnection:S,endConnection:w,emits:C,viewport:E,edges:k,nodes:A,isValidConnection:$,nodeLookup:F}=vt();let I=null,B=!1,j=null;function M(X){var Y;const V=nt(i)==="target",oe=rp(X),ae=Cg(X.target),fe=X.currentTarget;if(fe&&(oe&&X.button===0||!oe)){let D=function(K){te=en(K,Re),de=VA(wo(te,E.value,!1,[1,1]),c.value,F.value,G),H||(re(),H=!0);const ue=Bg(K,{handle:de,connectionMode:h.value,fromNodeId:nt(e),fromHandleId:nt(t),fromType:V?"target":"source",isValidConnection:se,doc:ae,lib:"vue",flowId:l,nodeLookup:F.value},k.value,A.value,x,F.value);j=ue.handleDomNode,I=ue.connection,B=qA(!!de,ue.isValid);const me={...we,isValid:B,to:ue.toHandle&&B?So({x:ue.toHandle.x,y:ue.toHandle.y},E.value):te,toHandle:ue.toHandle,toPosition:B&&ue.toHandle?ue.toHandle.position:Nf[G.position],toNode:ue.toHandle?F.value.get(ue.toHandle.nodeId):null};if(B&&de&&we?.toHandle&&me.toHandle&&we.toHandle.type===me.toHandle.type&&we.toHandle.nodeId===me.toHandle.nodeId&&we.toHandle.id===me.toHandle.id&&we.to.x===me.to.x&&we.to.y===me.to.y)return;const Pe=de??ue.toHandle;if(S(Pe&&B?So({x:Pe.x,y:Pe.y},E.value):te,Pe,UA(!!Pe,B)),we=me,!de&&!B&&!j)return xh($e);I&&I.source!==I.target&&j&&(xh($e),$e=j,j.classList.add("connecting","vue-flow__handle-connecting"),j.classList.toggle("valid",!!B),j.classList.toggle("vue-flow__handle-valid",!!B))},Z=function(K){"touches"in K&&K.touches.length>0||((de||j)&&I&&B&&(s?s(K,I):C.connect(I)),C.connectEnd(K),r&&a?.(K),xh($e),cancelAnimationFrame(ie),w(K),H=!1,B=!1,I=null,j=null,ae.removeEventListener("mousemove",D),ae.removeEventListener("mouseup",Z),ae.removeEventListener("touchmove",D),ae.removeEventListener("touchend",Z))};const L=x(nt(e));let se=nt(n)||$.value||Il;!se&&L&&(se=(V?L.isValidSourcePos:L.isValidTargetPos)||Il);let de,ie=0;const{x:R,y:Q}=en(X),xe=xx(nt(r),fe),Re=(Y=u.value)==null?void 0:Y.getBoundingClientRect();if(!Re||!xe)return;const ke=bx(nt(e),xe,nt(t),F.value,h.value);if(!ke)return;let $e,te=en(X,Re),H=!1;const re=()=>{if(!b.value)return;const[K,ue]=vx(te,Re,m.value);O({x:K,y:ue}),ie=requestAnimationFrame(re)},G={...ke,nodeId:nt(e),type:xe,position:ke.position},J=F.value.get(nt(e)),ve={inProgress:!0,isValid:null,from:ks(J,G,Xe.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:J,to:te,toHandle:null,toPosition:Nf[G.position],toNode:null};P({nodeId:nt(e),id:nt(t),type:xe,position:fe?.getAttribute("data-handlepos")||Xe.Top,...te},{x:R-Re.left,y:Q-Re.top}),C.connectStart({event:X,nodeId:nt(e),handleId:nt(t),handleType:xe});let we=ve;ae.addEventListener("mousemove",D),ae.addEventListener("mouseup",Z),ae.addEventListener("touchmove",D),ae.addEventListener("touchend",Z)}}function q(X){var Y,V;if(!p.value)return;const oe=nt(i)==="target";if(!v.value){C.clickConnectStart({event:X,nodeId:nt(e),handleId:nt(t)}),P({nodeId:nt(e),type:nt(i),id:nt(t),position:Xe.Top,...en(X)},void 0,!0);return}let ae=nt(n)||$.value||Il;const fe=x(nt(e));if(!ae&&fe&&(ae=(oe?fe.isValidSourcePos:fe.isValidTargetPos)||Il),fe&&(typeof fe.connectable>"u"?g.value:fe.connectable)===!1)return;const D=Cg(X.target),Z=Bg(X,{handle:{nodeId:nt(e),id:nt(t),type:nt(i),position:Xe.Top,...en(X)},connectionMode:h.value,fromNodeId:v.value.nodeId,fromHandleId:v.value.id??null,fromType:v.value.type,isValidConnection:ae,doc:D,lib:"vue",flowId:l,nodeLookup:F.value},k.value,A.value,x,F.value),L=((Y=Z.connection)==null?void 0:Y.source)===((V=Z.connection)==null?void 0:V.target);Z.isValid&&Z.connection&&!L&&C.connect(Z.connection),C.clickConnectEnd(X),w(X,!0)}return{handlePointerDown:M,handleClick:q}}function i2(){return cr(wx,"")}function kx(t){const e=t??i2()??"",i=cr(Px,ze(null)),{findNode:n,edges:r,emits:s}=vt(),a=n(e);return a||s.error(new Bt(Nt.NODE_NOT_FOUND,e)),{id:e,nodeEl:i,node:a,parentNode:Fe(()=>n(a.parentNode)),connectedEdges:Fe(()=>Tr([a],r.value))}}function n2(){return{doubleClick:Ne(),click:Ne(),mouseEnter:Ne(),mouseMove:Ne(),mouseLeave:Ne(),contextMenu:Ne(),dragStart:Ne(),drag:Ne(),dragStop:Ne()}}function r2(t,e){const i=n2();return i.doubleClick.on(n=>{var r,s;e.nodeDoubleClick(n),(s=(r=t.events)==null?void 0:r.doubleClick)==null||s.call(r,n)}),i.click.on(n=>{var r,s;e.nodeClick(n),(s=(r=t.events)==null?void 0:r.click)==null||s.call(r,n)}),i.mouseEnter.on(n=>{var r,s;e.nodeMouseEnter(n),(s=(r=t.events)==null?void 0:r.mouseEnter)==null||s.call(r,n)}),i.mouseMove.on(n=>{var r,s;e.nodeMouseMove(n),(s=(r=t.events)==null?void 0:r.mouseMove)==null||s.call(r,n)}),i.mouseLeave.on(n=>{var r,s;e.nodeMouseLeave(n),(s=(r=t.events)==null?void 0:r.mouseLeave)==null||s.call(r,n)}),i.contextMenu.on(n=>{var r,s;e.nodeContextMenu(n),(s=(r=t.events)==null?void 0:r.contextMenu)==null||s.call(r,n)}),i.dragStart.on(n=>{var r,s;e.nodeDragStart(n),(s=(r=t.events)==null?void 0:r.dragStart)==null||s.call(r,n)}),i.drag.on(n=>{var r,s;e.nodeDrag(n),(s=(r=t.events)==null?void 0:r.drag)==null||s.call(r,n)}),i.dragStop.on(n=>{var r,s;e.nodeDragStop(n),(s=(r=t.events)==null?void 0:r.dragStop)==null||s.call(r,n)}),Object.entries(i).reduce((n,[r,s])=>(n.emit[r]=s.trigger,n.on[r]=s.on,n),{emit:{},on:{}})}function Ex(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:i,findNode:n,snapGrid:r,snapToGrid:s,nodesDraggable:a,emits:l}=vt();return(u,h=!1)=>{const c=s.value?r.value[0]:5,p=s.value?r.value[1]:5,v=h?4:1,g=u.x*c*v,b=u.y*p*v,m=[];for(const x of t.value)if(x.draggable||a&&typeof x.draggable>"u"){const O={x:x.computedPosition.x+g,y:x.computedPosition.y+b},{position:P}=np(x,O,l.error,e.value,x.parentNode?n(x.parentNode):void 0);m.push({id:x.id,position:P,from:x.position,distance:{x:u.x,y:u.y},dimensions:x.dimensions})}i(m,!0,!1)}}const Nl=.1,s2=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function Xn(){return Jo("Viewport not initialized yet."),Promise.resolve(!1)}const a2={zoomIn:Xn,zoomOut:Xn,zoomTo:Xn,fitView:Xn,setCenter:Xn,fitBounds:Xn,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:Xn,setTransform:Xn,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function o2(t){function e(n,r){return new Promise(s=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(r?.interpolate==="linear"?no:gu).scaleBy(wh(t.d3Selection,r?.duration,r?.ease,()=>{s(!0)}),n):s(!1)})}function i(n,r,s,a){return new Promise(l=>{var u;const{x:h,y:c}=cx({x:-n,y:-r},t.translateExtent),p=Cs.translate(-h,-c).scale(s);t.d3Selection&&t.d3Zoom?(u=t.d3Zoom)==null||u.interpolate(a?.interpolate==="linear"?no:gu).transform(wh(t.d3Selection,a?.duration,a?.ease,()=>{l(!0)}),p):l(!1)})}return Fe(()=>t.d3Zoom&&t.d3Selection&&t.dimensions.width&&t.dimensions.height?{viewportInitialized:!0,zoomIn:r=>e(1.2,r),zoomOut:r=>e(1/1.2,r),zoomTo:(r,s)=>new Promise(a=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(s?.interpolate==="linear"?no:gu).scaleTo(wh(t.d3Selection,s?.duration,s?.ease,()=>{a(!0)}),r):a(!1)}),setViewport:(r,s)=>i(r.x,r.y,r.zoom,s),setTransform:(r,s)=>i(r.x,r.y,r.zoom,s),getViewport:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),getTransform:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),fitView:(r={padding:Nl,includeHiddenNodes:!1,duration:0})=>{var s,a;const l=[];for(const v of t.nodes)v.dimensions.width&&v.dimensions.height&&(r?.includeHiddenNodes||!v.hidden)&&(!((s=r.nodes)!=null&&s.length)||(a=r.nodes)!=null&&a.length&&r.nodes.includes(v.id))&&l.push(v);if(!l.length)return Promise.resolve(!1);const u=ip(l),{x:h,y:c,zoom:p}=kg(u,t.dimensions.width,t.dimensions.height,r.minZoom??t.minZoom,r.maxZoom??t.maxZoom,r.padding??Nl);return i(h,c,p,r)},setCenter:(r,s,a)=>{const l=typeof a?.zoom<"u"?a.zoom:t.maxZoom,u=t.dimensions.width/2-r*l,h=t.dimensions.height/2-s*l;return i(u,h,l,a)},fitBounds:(r,s={padding:Nl})=>{const{x:a,y:l,zoom:u}=kg(r,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,s.padding??Nl);return i(a,l,u,s)},project:r=>wo(r,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:r=>{if(t.vueFlowRef){const{x:s,y:a}=t.vueFlowRef.getBoundingClientRect(),l={x:r.x-s,y:r.y-a};return wo(l,t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:r=>{if(t.vueFlowRef){const{x:s,y:a}=t.vueFlowRef.getBoundingClientRect(),l={x:r.x+s,y:r.y+a};return So(l,t.viewport)}return{x:0,y:0}}}:a2)}function wh(t,e=0,i=s2,n=()=>{}){const r=typeof e=="number"&&e>0;return r||n(),r?t.transition().duration(e).ease(i).on("end",n):t}function l2(t,e,i){const n=SO(!0);return n.run(()=>{const r=()=>{n.run(()=>{let m,x,O=!!(i.nodes.value.length||i.edges.value.length);m=es([t.modelValue,()=>{var P,S;return(S=(P=t.modelValue)==null?void 0:P.value)==null?void 0:S.length}],([P])=>{P&&Array.isArray(P)&&(x?.pause(),i.setElements(P),!x&&!O&&P.length?O=!0:x?.resume())}),x=es([i.nodes,i.edges,()=>i.edges.value.length,()=>i.nodes.value.length],([P,S])=>{var w;(w=t.modelValue)!=null&&w.value&&Array.isArray(t.modelValue.value)&&(m?.pause(),t.modelValue.value=[...P,...S],vi(()=>{m?.resume()}))},{immediate:O}),pu(()=>{m?.stop(),x?.stop()})})},s=()=>{n.run(()=>{let m,x,O=!!i.nodes.value.length;m=es([t.nodes,()=>{var P,S;return(S=(P=t.nodes)==null?void 0:P.value)==null?void 0:S.length}],([P])=>{P&&Array.isArray(P)&&(x?.pause(),i.setNodes(P),!x&&!O&&P.length?O=!0:x?.resume())}),x=es([i.nodes,()=>i.nodes.value.length],([P])=>{var S;(S=t.nodes)!=null&&S.value&&Array.isArray(t.nodes.value)&&(m?.pause(),t.nodes.value=[...P],vi(()=>{m?.resume()}))},{immediate:O}),pu(()=>{m?.stop(),x?.stop()})})},a=()=>{n.run(()=>{let m,x,O=!!i.edges.value.length;m=es([t.edges,()=>{var P,S;return(S=(P=t.edges)==null?void 0:P.value)==null?void 0:S.length}],([P])=>{P&&Array.isArray(P)&&(x?.pause(),i.setEdges(P),!x&&!O&&P.length?O=!0:x?.resume())}),x=es([i.edges,()=>i.edges.value.length],([P])=>{var S;(S=t.edges)!=null&&S.value&&Array.isArray(t.edges.value)&&(m?.pause(),t.edges.value=[...P],vi(()=>{m?.resume()}))},{immediate:O}),pu(()=>{m?.stop(),x?.stop()})})},l=()=>{n.run(()=>{Ge(()=>e.maxZoom,()=>{e.maxZoom&&It(e.maxZoom)&&i.setMaxZoom(e.maxZoom)},{immediate:!0})})},u=()=>{n.run(()=>{Ge(()=>e.minZoom,()=>{e.minZoom&&It(e.minZoom)&&i.setMinZoom(e.minZoom)},{immediate:!0})})},h=()=>{n.run(()=>{Ge(()=>e.translateExtent,()=>{e.translateExtent&&It(e.translateExtent)&&i.setTranslateExtent(e.translateExtent)},{immediate:!0})})},c=()=>{n.run(()=>{Ge(()=>e.nodeExtent,()=>{e.nodeExtent&&It(e.nodeExtent)&&i.setNodeExtent(e.nodeExtent)},{immediate:!0})})},p=()=>{n.run(()=>{Ge(()=>e.applyDefault,()=>{It(e.applyDefault)&&(i.applyDefault.value=e.applyDefault)},{immediate:!0})})},v=()=>{n.run(()=>{const m=async x=>{let O=x;typeof e.autoConnect=="function"&&(O=await e.autoConnect(x)),O!==!1&&i.addEdges([O])};Ge(()=>e.autoConnect,()=>{It(e.autoConnect)&&(i.autoConnect.value=e.autoConnect)},{immediate:!0}),Ge(i.autoConnect,(x,O,P)=>{x?i.onConnect(m):i.hooks.value.connect.off(m),P(()=>{i.hooks.value.connect.off(m)})},{immediate:!0})})},g=()=>{const m=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const x of Object.keys(e)){const O=x;if(!m.includes(O)){const P=lt(()=>e[O]),S=i[O];Zd(S)&&n.run(()=>{Ge(P,w=>{It(w)&&(S.value=w)},{immediate:!0})})}}};r(),s(),a(),u(),l(),h(),c(),p(),v(),g()}),()=>n.stop()}function u2(){return{edgesChange:Ne(),nodesChange:Ne(),nodeDoubleClick:Ne(),nodeClick:Ne(),nodeMouseEnter:Ne(),nodeMouseMove:Ne(),nodeMouseLeave:Ne(),nodeContextMenu:Ne(),nodeDragStart:Ne(),nodeDrag:Ne(),nodeDragStop:Ne(),nodesInitialized:Ne(),miniMapNodeClick:Ne(),miniMapNodeDoubleClick:Ne(),miniMapNodeMouseEnter:Ne(),miniMapNodeMouseMove:Ne(),miniMapNodeMouseLeave:Ne(),connect:Ne(),connectStart:Ne(),connectEnd:Ne(),clickConnectStart:Ne(),clickConnectEnd:Ne(),paneReady:Ne(),init:Ne(),move:Ne(),moveStart:Ne(),moveEnd:Ne(),selectionDragStart:Ne(),selectionDrag:Ne(),selectionDragStop:Ne(),selectionContextMenu:Ne(),selectionStart:Ne(),selectionEnd:Ne(),viewportChangeStart:Ne(),viewportChange:Ne(),viewportChangeEnd:Ne(),paneScroll:Ne(),paneClick:Ne(),paneContextMenu:Ne(),paneMouseEnter:Ne(),paneMouseMove:Ne(),paneMouseLeave:Ne(),edgeContextMenu:Ne(),edgeMouseEnter:Ne(),edgeMouseMove:Ne(),edgeMouseLeave:Ne(),edgeDoubleClick:Ne(),edgeClick:Ne(),edgeUpdateStart:Ne(),edgeUpdate:Ne(),edgeUpdateEnd:Ne(),updateNodeInternals:Ne(),error:Ne(t=>Jo(t.message))}}function c2(t,e){const i=Fs();eT(()=>{for(const[r,s]of Object.entries(e.value)){const a=l=>{t(r,l)};s.setEmitter(a),yo(s.removeEmitter),s.setHasEmitListeners(()=>n(r)),yo(s.removeHasEmitListeners)}});function n(r){var s;const a=h2(r);return!!((s=i?.vnode.props)==null?void 0:s[a])}}function h2(t){const[e,...i]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(r,s)=>s.toUpperCase())}${i.length?`:${i.join(":")}`:""}`}function Ax(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:tp.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:ro.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Pr.Bezier,style:{}},connectionMode:er.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:To()?"Meta":"Control",zoomActivationKeyCode:To()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:u2(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const f2=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function d2(t,e,i){const n=o2(t),r=te=>{const H=te??[];t.hooks.updateNodeInternals.trigger(H)},s=te=>EA(te,t.nodes,t.edges),a=te=>kA(te,t.nodes,t.edges),l=te=>Tr(te,t.edges),u=({id:te,type:H,nodeId:re})=>{var G;const J=te?`-${H}-${te}`:`-${H}`;return Array.from(((G=t.connectionLookup.get(`${re}${J}`))==null?void 0:G.values())??[])},h=te=>{if(te)return e.value.get(te)},c=te=>{if(te)return i.value.get(te)},p=(te,H,re)=>{var G,J;const le=[];for(const ve of te){const we={id:ve.id,type:"position",dragging:re,from:ve.from};if(H&&(we.position=ve.position,ve.parentNode)){const K=h(ve.parentNode);we.position={x:we.position.x-(((G=K?.computedPosition)==null?void 0:G.x)??0),y:we.position.y-(((J=K?.computedPosition)==null?void 0:J.y)??0)}}le.push(we)}le?.length&&t.hooks.nodesChange.trigger(le)},v=te=>{if(!t.vueFlowRef)return;const H=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!H)return;const re=window.getComputedStyle(H),{m22:G}=new window.DOMMatrixReadOnly(re.transform),J=[];for(const le of te){const ve=le,we=h(ve.id);if(we){const K=Dc(ve.nodeElement);if(!!(K.width&&K.height&&(we.dimensions.width!==K.width||we.dimensions.height!==K.height||ve.forceUpdate))){const me=ve.nodeElement.getBoundingClientRect();we.dimensions=K,we.handleBounds.source=Qg("source",ve.nodeElement,me,G,we.id),we.handleBounds.target=Qg("target",ve.nodeElement,me,G,we.id),J.push({id:we.id,type:"dimensions",dimensions:K})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&n.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),J.length&&t.hooks.nodesChange.trigger(J)},g=(te,H)=>{const re=new Set,G=new Set;for(const ve of te)Lr(ve)?re.add(ve.id):tr(ve)&&G.add(ve.id);const J=Un(e.value,re,!0),le=Un(i.value,G);if(t.multiSelectionActive){for(const ve of re)J.push(jn(ve,H));for(const ve of G)le.push(jn(ve,H))}J.length&&t.hooks.nodesChange.trigger(J),le.length&&t.hooks.edgesChange.trigger(le)},b=te=>{if(t.multiSelectionActive){const H=te.map(re=>jn(re.id,!0));t.hooks.nodesChange.trigger(H);return}t.hooks.nodesChange.trigger(Un(e.value,new Set(te.map(H=>H.id)),!0)),t.hooks.edgesChange.trigger(Un(i.value))},m=te=>{if(t.multiSelectionActive){const H=te.map(re=>jn(re.id,!0));t.hooks.edgesChange.trigger(H);return}t.hooks.edgesChange.trigger(Un(i.value,new Set(te.map(H=>H.id)))),t.hooks.nodesChange.trigger(Un(e.value,new Set,!0))},x=te=>{g(te,!0)},O=te=>{const re=(te||t.nodes).map(G=>(G.selected=!1,jn(G.id,!1)));t.hooks.nodesChange.trigger(re)},P=te=>{const re=(te||t.edges).map(G=>(G.selected=!1,jn(G.id,!1)));t.hooks.edgesChange.trigger(re)},S=te=>{if(!te||!te.length)return g([],!1);const H=te.reduce((re,G)=>{const J=jn(G.id,!1);return Lr(G)?re.nodes.push(J):re.edges.push(J),re},{nodes:[],edges:[]});H.nodes.length&&t.hooks.nodesChange.trigger(H.nodes),H.edges.length&&t.hooks.edgesChange.trigger(H.edges)},w=te=>{var H;(H=t.d3Zoom)==null||H.scaleExtent([te,t.maxZoom]),t.minZoom=te},C=te=>{var H;(H=t.d3Zoom)==null||H.scaleExtent([t.minZoom,te]),t.maxZoom=te},E=te=>{var H;(H=t.d3Zoom)==null||H.translateExtent(te),t.translateExtent=te},k=te=>{t.nodeExtent=te,r()},A=te=>{var H;(H=t.d3Zoom)==null||H.clickDistance(te)},$=te=>{t.nodesDraggable=te,t.nodesConnectable=te,t.elementsSelectable=te},F=te=>{const H=te instanceof Function?te(t.nodes):te;!t.initialized&&!H.length||(t.nodes=Fg(H,h,t.hooks.error.trigger))},I=te=>{const H=te instanceof Function?te(t.edges):te;if(!t.initialized&&!H.length)return;const re=Sh(H,t.isValidConnection,h,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);bh(t.connectionLookup,i.value,re),t.edges=re},B=te=>{const H=te instanceof Function?te([...t.nodes,...t.edges]):te;!t.initialized&&!H.length||(F(H.filter(Lr)),I(H.filter(tr)))},j=te=>{let H=te instanceof Function?te(t.nodes):te;H=Array.isArray(H)?H:[H];const re=Fg(H,h,t.hooks.error.trigger),G=[];for(const J of re)G.push(Dg(J));G.length&&t.hooks.nodesChange.trigger(G)},M=te=>{let H=te instanceof Function?te(t.edges):te;H=Array.isArray(H)?H:[H];const re=Sh(H,t.isValidConnection,h,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),G=[];for(const J of re)G.push(Dg(J));G.length&&t.hooks.edgesChange.trigger(G)},q=(te,H=!0,re=!1)=>{const G=te instanceof Function?te(t.nodes):te,J=Array.isArray(G)?G:[G],le=[],ve=[];function we(ue){const me=l(ue);for(const Pe of me)(!It(Pe.deletable)||Pe.deletable)&&ve.push(Ig(Pe.id,Pe.source,Pe.target,Pe.sourceHandle,Pe.targetHandle))}function K(ue){const me=[];for(const Pe of t.nodes)Pe.parentNode===ue&&me.push(Pe);if(me.length){for(const Pe of me)le.push(_g(Pe.id));H&&we(me);for(const Pe of me)K(Pe.id)}}for(const ue of J){const me=typeof ue=="string"?h(ue):ue;me&&(It(me.deletable)&&!me.deletable||(le.push(_g(me.id)),H&&we([me]),re&&K(me.id)))}ve.length&&t.hooks.edgesChange.trigger(ve),le.length&&t.hooks.nodesChange.trigger(le)},X=te=>{const H=te instanceof Function?te(t.edges):te,re=Array.isArray(H)?H:[H],G=[];for(const J of re){const le=typeof J=="string"?c(J):J;le&&(It(le.deletable)&&!le.deletable||G.push(Ig(typeof J=="string"?J:J.id,le.source,le.target,le.sourceHandle,le.targetHandle)))}t.hooks.edgesChange.trigger(G)},Y=(te,H,re=!0)=>{const G=c(te.id);if(!G)return!1;const J=t.edges.indexOf(G),le=GA(te,H,G,re,t.hooks.error.trigger);if(le){const[ve]=Sh([le],t.isValidConnection,h,c,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((we,K)=>K===J?ve:we),bh(t.connectionLookup,i.value,[ve]),ve}return!1},V=(te,H,re={replace:!1})=>{const G=c(te);if(!G)return;const J=typeof H=="function"?H(G):H;G.data=re.replace?J:{...G.data,...J}},oe=te=>Ag(te,t.nodes),ae=te=>{const H=Ag(te,t.edges);return bh(t.connectionLookup,i.value,H),H},fe=(te,H,re={replace:!1})=>{const G=h(te);if(!G)return;const J=typeof H=="function"?H(G):H;re.replace?t.nodes.splice(t.nodes.indexOf(G),1,J):Object.assign(G,J)},D=(te,H,re={replace:!1})=>{const G=h(te);if(!G)return;const J=typeof H=="function"?H(G):H;G.data=re.replace?J:{...G.data,...J}},Z=(te,H,re=!1)=>{re?t.connectionClickStartHandle=te:t.connectionStartHandle=te,t.connectionEndHandle=null,t.connectionStatus=null,H&&(t.connectionPosition=H)},L=(te,H=null,re=null)=>{t.connectionStartHandle&&(t.connectionPosition=te,t.connectionEndHandle=H,t.connectionStatus=re)},se=(te,H)=>{t.connectionPosition={x:Number.NaN,y:Number.NaN},t.connectionEndHandle=null,t.connectionStatus=null,H?t.connectionClickStartHandle=null:t.connectionStartHandle=null},de=te=>{const H=TA(te),re=H?null:ba(te)?te:h(te.id);return!H&&!re?[null,null,H]:[H?te:Xu(re),re,H]},ie=(te,H=!0,re=t.nodes)=>{const[G,J,le]=de(te);if(!G)return[];const ve=[];for(const we of re||t.nodes){if(!le&&(we.id===J.id||!we.computedPosition))continue;const K=Xu(we),ue=ju(K,G);(H&&ue>0||ue>=K.width*K.height||ue>=Number(G.width)*Number(G.height))&&ve.push(we)}return ve},R=(te,H,re=!0)=>{const[G]=de(te);if(!G)return!1;const J=ju(G,H);return re&&J>0||J>=Number(G.width)*Number(G.height)},Q=te=>{const{viewport:H,dimensions:re,d3Zoom:G,d3Selection:J,translateExtent:le}=t;if(!G||!J||!te.x&&!te.y)return!1;const ve=Cs.translate(H.x+te.x,H.y+te.y).scale(H.zoom),we=[[0,0],[re.width,re.height]],K=G.constrain()(ve,we,le),ue=t.viewport.x!==K.x||t.viewport.y!==K.y||t.viewport.zoom!==K.k;return G.transform(J,K),ue},xe=te=>{const H=te instanceof Function?te(t):te,re=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];It(H.defaultEdgeOptions)&&(t.defaultEdgeOptions=H.defaultEdgeOptions);const G=H.modelValue||H.nodes||H.edges?[]:void 0;G&&(H.modelValue&&G.push(...H.modelValue),H.nodes&&G.push(...H.nodes),H.edges&&G.push(...H.edges),B(G));const J=()=>{It(H.maxZoom)&&C(H.maxZoom),It(H.minZoom)&&w(H.minZoom),It(H.translateExtent)&&E(H.translateExtent)};for(const le of Object.keys(H)){const ve=le,we=H[ve];![...f2,...re].includes(ve)&&It(we)&&(t[ve]=we)}bf(()=>t.d3Zoom).not.toBeNull().then(J),t.initialized||(t.initialized=!0)};return{updateNodePositions:p,updateNodeDimensions:v,setElements:B,setNodes:F,setEdges:I,addNodes:j,addEdges:M,removeNodes:q,removeEdges:X,findNode:h,findEdge:c,updateEdge:Y,updateEdgeData:V,updateNode:fe,updateNodeData:D,applyEdgeChanges:ae,applyNodeChanges:oe,addSelectedElements:x,addSelectedNodes:b,addSelectedEdges:m,setMinZoom:w,setMaxZoom:C,setTranslateExtent:E,setNodeExtent:k,setPaneClickDistance:A,removeSelectedElements:S,removeSelectedNodes:O,removeSelectedEdges:P,startConnection:Z,updateConnection:L,endConnection:se,setInteractive:$,setState:xe,getIntersectingNodes:ie,getIncomers:s,getOutgoers:a,getConnectedEdges:l,getHandleConnections:u,isNodeIntersecting:R,panBy:Q,fitView:te=>n.value.fitView(te),zoomIn:te=>n.value.zoomIn(te),zoomOut:te=>n.value.zoomOut(te),zoomTo:(te,H)=>n.value.zoomTo(te,H),setViewport:(te,H)=>n.value.setViewport(te,H),setTransform:(te,H)=>n.value.setTransform(te,H),getViewport:()=>n.value.getViewport(),getTransform:()=>n.value.getTransform(),setCenter:(te,H,re)=>n.value.setCenter(te,H,re),fitBounds:(te,H)=>n.value.fitBounds(te,H),project:te=>n.value.project(te),screenToFlowCoordinate:te=>n.value.screenToFlowCoordinate(te),flowToScreenCoordinate:te=>n.value.flowToScreenCoordinate(te),toObject:()=>{const te=[],H=[];for(const re of t.nodes){const{computedPosition:G,handleBounds:J,selected:le,dimensions:ve,isParent:we,resizing:K,dragging:ue,events:me,...Pe}=re;te.push(Pe)}for(const re of t.edges){const{selected:G,sourceNode:J,targetNode:le,events:ve,...we}=re;H.push(we)}return JSON.parse(JSON.stringify({nodes:te,edges:H,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:te=>new Promise(H=>{const{nodes:re,edges:G,position:J,zoom:le,viewport:ve}=te;re&&F(re),G&&I(G);const[we,K]=ve?.x&&ve?.y?[ve.x,ve.y]:J??[null,null];if(we&&K){const ue=ve?.zoom||le||t.viewport.zoom;return bf(()=>n.value.viewportInitialized).toBe(!0).then(()=>{n.value.setViewport({x:we,y:K,zoom:ue}).then(()=>{H(!0)})})}else H(!0)}),updateNodeInternals:r,viewportHelper:n,$reset:()=>{const te=Ax();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const H=Cs.translate(te.defaultViewport.x??0,te.defaultViewport.y??0).scale(Vr(te.defaultViewport.zoom??1,te.minZoom,te.maxZoom)),re=t.viewportRef.getBoundingClientRect(),G=[[0,0],[re.width,re.height]],J=t.d3Zoom.constrain()(H,G,te.translateExtent);t.d3Zoom.transform(t.d3Selection,J)}xe(te)},$destroy:()=>{}}}const p2=["data-id","data-handleid","data-nodeid","data-handlepos"],m2={name:"Handle",compatConfig:{MODE:3}},Es=ot({...m2,props:{id:{default:null},type:{},position:{default:()=>Xe.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(t,{expose:e}){const i=KP(t,["position","connectable","connectableStart","connectableEnd","id"]),n=lt(()=>i.type??"source"),r=lt(()=>i.isValidConnection??null),{id:s,connectionStartHandle:a,connectionClickStartHandle:l,connectionEndHandle:u,vueFlowRef:h,nodesConnectable:c,noDragClassName:p,noPanClassName:v}=vt(),{id:g,node:b,nodeEl:m,connectedEdges:x}=kx(),O=ze(),P=lt(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),S=lt(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),w=lt(()=>{var I,B,j,M,q,X;return((I=a.value)==null?void 0:I.nodeId)===g&&((B=a.value)==null?void 0:B.id)===t.id&&((j=a.value)==null?void 0:j.type)===n.value||((M=u.value)==null?void 0:M.nodeId)===g&&((q=u.value)==null?void 0:q.id)===t.id&&((X=u.value)==null?void 0:X.type)===n.value}),C=lt(()=>{var I,B,j;return((I=l.value)==null?void 0:I.nodeId)===g&&((B=l.value)==null?void 0:B.id)===t.id&&((j=l.value)==null?void 0:j.type)===n.value}),{handlePointerDown:E,handleClick:k}=Cx({nodeId:g,handleId:t.id,isValidConnection:r,type:n}),A=Fe(()=>typeof t.connectable=="string"&&t.connectable==="single"?!x.value.some(I=>{const B=I[`${n.value}Handle`];return I[n.value]!==g?!1:B?B===t.id:!0}):typeof t.connectable=="number"?x.value.filter(I=>{const B=I[`${n.value}Handle`];return I[n.value]!==g?!1:B?B===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(b,x.value):It(t.connectable)?t.connectable:c.value);fn(()=>{var I;if(!b.dimensions.width||!b.dimensions.height)return;const B=(I=b.handleBounds[n.value])==null?void 0:I.find(oe=>oe.id===t.id);if(!h.value||B)return;const j=h.value.querySelector(".vue-flow__transformationpane");if(!m.value||!O.value||!j||!t.id)return;const M=m.value.getBoundingClientRect(),q=O.value.getBoundingClientRect(),X=window.getComputedStyle(j),{m22:Y}=new window.DOMMatrixReadOnly(X.transform),V={id:t.id,position:t.position,x:(q.left-M.left)/Y,y:(q.top-M.top)/Y,type:n.value,nodeId:g,...Dc(O.value)};b.handleBounds[n.value]=[...b.handleBounds[n.value]??[],V]});function $(I){const B=rp(I);A.value&&P.value&&(B&&I.button===0||!B)&&E(I)}function F(I){!g||!l.value&&!P.value||A.value&&k(I)}return e({handleClick:k,handlePointerDown:E,onClick:F,onPointerDown:$}),(I,B)=>(ye(),be("div",{ref_key:"handle",ref:O,"data-id":`${Se(s)}-${Se(g)}-${t.id}-${n.value}`,"data-handleid":t.id,"data-nodeid":Se(g),"data-handlepos":I.position,class:bt(["vue-flow__handle",[`vue-flow__handle-${I.position}`,`vue-flow__handle-${t.id}`,Se(p),Se(v),n.value,{connectable:A.value,connecting:C.value,connectablestart:P.value,connectableend:S.value,connectionindicator:A.value&&(P.value&&!w.value||S.value&&w.value)}]]),onMousedown:$,onTouchstartPassive:$,onClick:F},[wt(I.$slots,"default",{id:I.id})],42,p2))}}),Nc=function({sourcePosition:t=Xe.Bottom,targetPosition:e=Xe.Top,label:i,connectable:n=!0,isValidTargetPos:r,isValidSourcePos:s,data:a}){const l=a.label??i;return[ut(Es,{type:"target",position:e,connectable:n,isValidConnection:r}),typeof l!="string"&&l?ut(l):ut(gt,[l]),ut(Es,{type:"source",position:t,connectable:n,isValidConnection:s})]};Nc.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Nc.inheritAttrs=!1;Nc.compatConfig={MODE:3};const g2=Nc,Mc=function({targetPosition:t=Xe.Top,label:e,connectable:i=!0,isValidTargetPos:n,data:r}){const s=r.label??e;return[ut(Es,{type:"target",position:t,connectable:i,isValidConnection:n}),typeof s!="string"&&s?ut(s):ut(gt,[s])]};Mc.props=["targetPosition","label","isValidTargetPos","connectable","data"];Mc.inheritAttrs=!1;Mc.compatConfig={MODE:3};const y2=Mc,$c=function({sourcePosition:t=Xe.Bottom,label:e,connectable:i=!0,isValidSourcePos:n,data:r}){const s=r.label??e;return[typeof s!="string"&&s?ut(s):ut(gt,[s]),ut(Es,{type:"source",position:t,connectable:i,isValidConnection:n})]};$c.props=["sourcePosition","label","isValidSourcePos","connectable","data"];$c.inheritAttrs=!1;$c.compatConfig={MODE:3};const v2=$c,O2=["transform"],x2=["width","height","x","y","rx","ry"],b2=["y"],S2={name:"EdgeText",compatConfig:{MODE:3}},w2=ot({...S2,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(t){const e=ze({x:0,y:0,width:0,height:0}),i=ze(null),n=Fe(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);fn(r),Ge([()=>t.x,()=>t.y,i,()=>t.label],r);function r(){if(!i.value)return;const s=i.value.getBBox();(s.width!==e.value.width||s.height!==e.value.height)&&(e.value=s)}return(s,a)=>(ye(),be("g",{transform:n.value,class:"vue-flow__edge-textwrapper"},[s.labelShowBg?(ye(),be("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*s.labelBgPadding[0]}px`,height:`${e.value.height+2*s.labelBgPadding[1]}px`,x:-s.labelBgPadding[0],y:-s.labelBgPadding[1],style:hi(s.labelBgStyle),rx:s.labelBgBorderRadius,ry:s.labelBgBorderRadius},null,12,x2)):Qe("",!0),he("text",Mu(s.$attrs,{ref_key:"el",ref:i,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:s.labelStyle}),[wt(s.$slots,"default",{},()=>[typeof s.label!="string"?(ye(),Ct(wr(s.label),{key:0})):(ye(),be(gt,{key:1},[CO(Te(s.label),1)],64))])],16,b2)],8,O2))}}),P2=["id","d","marker-end","marker-start"],T2=["d","stroke-width"],C2={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Lc=ot({...C2,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(t,{expose:e}){const i=ze(null),n=ze(null),r=ze(null),s=Vd();return e({pathEl:i,interactionEl:n,labelEl:r}),(a,l)=>(ye(),be(gt,null,[he("path",Mu(Se(s),{id:a.id,ref_key:"pathEl",ref:i,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,P2),a.interactionWidth?(ye(),be("path",{key:0,ref_key:"interactionEl",ref:n,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,T2)):Qe("",!0),a.label&&a.labelX&&a.labelY?(ye(),Ct(w2,{key:1,ref_key:"labelEl",ref:r,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Qe("",!0)],64))}});function Dx({sourceX:t,sourceY:e,targetX:i,targetY:n}){const r=Math.abs(i-t)/2,s=i<t?i+r:i-r,a=Math.abs(n-e)/2,l=n<e?n+a:n-a;return[s,l,r,a]}function _x({sourceX:t,sourceY:e,targetX:i,targetY:n,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:l}){const u=t*.125+r*.375+a*.375+i*.125,h=e*.125+s*.375+l*.375+n*.125,c=Math.abs(u-t),p=Math.abs(h-e);return[u,h,c,p]}function Ml(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function jg({pos:t,x1:e,y1:i,x2:n,y2:r,c:s}){let a,l;switch(t){case Xe.Left:a=e-Ml(e-n,s),l=i;break;case Xe.Right:a=e+Ml(n-e,s),l=i;break;case Xe.Top:a=e,l=i-Ml(i-r,s);break;case Xe.Bottom:a=e,l=i+Ml(r-i,s);break}return[a,l]}function Ix(t){const{sourceX:e,sourceY:i,sourcePosition:n=Xe.Bottom,targetX:r,targetY:s,targetPosition:a=Xe.Top,curvature:l=.25}=t,[u,h]=jg({pos:n,x1:e,y1:i,x2:r,y2:s,c:l}),[c,p]=jg({pos:a,x1:r,y1:s,x2:e,y2:i,c:l}),[v,g,b,m]=_x({sourceX:e,sourceY:i,targetX:r,targetY:s,sourceControlX:u,sourceControlY:h,targetControlX:c,targetControlY:p});return[`M${e},${i} C${u},${h} ${c},${p} ${r},${s}`,v,g,b,m]}function Zg({pos:t,x1:e,y1:i,x2:n,y2:r}){let s,a;switch(t){case Xe.Left:case Xe.Right:s=.5*(e+n),a=i;break;case Xe.Top:case Xe.Bottom:s=e,a=.5*(i+r);break}return[s,a]}function Nx(t){const{sourceX:e,sourceY:i,sourcePosition:n=Xe.Bottom,targetX:r,targetY:s,targetPosition:a=Xe.Top}=t,[l,u]=Zg({pos:n,x1:e,y1:i,x2:r,y2:s}),[h,c]=Zg({pos:a,x1:r,y1:s,x2:e,y2:i}),[p,v,g,b]=_x({sourceX:e,sourceY:i,targetX:r,targetY:s,sourceControlX:l,sourceControlY:u,targetControlX:h,targetControlY:c});return[`M${e},${i} C${l},${u} ${h},${c} ${r},${s}`,p,v,g,b]}const Vg={[Xe.Left]:{x:-1,y:0},[Xe.Right]:{x:1,y:0},[Xe.Top]:{x:0,y:-1},[Xe.Bottom]:{x:0,y:1}};function k2({source:t,sourcePosition:e=Xe.Bottom,target:i}){return e===Xe.Left||e===Xe.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1}}function Ug(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function E2({source:t,sourcePosition:e=Xe.Bottom,target:i,targetPosition:n=Xe.Top,center:r,offset:s}){const a=Vg[e],l=Vg[n],u={x:t.x+a.x*s,y:t.y+a.y*s},h={x:i.x+l.x*s,y:i.y+l.y*s},c=k2({source:u,sourcePosition:e,target:h}),p=c.x!==0?"x":"y",v=c[p];let g,b,m;const x={x:0,y:0},O={x:0,y:0},[P,S,w,C]=Dx({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(a[p]*l[p]===-1){b=r.x??P,m=r.y??S;const k=[{x:b,y:u.y},{x:b,y:h.y}],A=[{x:u.x,y:m},{x:h.x,y:m}];a[p]===v?g=p==="x"?k:A:g=p==="x"?A:k}else{const k=[{x:u.x,y:h.y}],A=[{x:h.x,y:u.y}];if(p==="x"?g=a.x===v?A:k:g=a.y===v?k:A,e===n){const j=Math.abs(t[p]-i[p]);if(j<=s){const M=Math.min(s-1,s-j);a[p]===v?x[p]=(u[p]>t[p]?-1:1)*M:O[p]=(h[p]>i[p]?-1:1)*M}}if(e!==n){const j=p==="x"?"y":"x",M=a[p]===l[j],q=u[j]>h[j],X=u[j]<h[j];(a[p]===1&&(!M&&q||M&&X)||a[p]!==1&&(!M&&X||M&&q))&&(g=p==="x"?k:A)}const $={x:u.x+x.x,y:u.y+x.y},F={x:h.x+O.x,y:h.y+O.y},I=Math.max(Math.abs($.x-g[0].x),Math.abs(F.x-g[0].x)),B=Math.max(Math.abs($.y-g[0].y),Math.abs(F.y-g[0].y));I>=B?(b=($.x+F.x)/2,m=g[0].y):(b=g[0].x,m=($.y+F.y)/2)}return[[t,{x:u.x+x.x,y:u.y+x.y},...g,{x:h.x+O.x,y:h.y+O.y},i],b,m,w,C]}function A2(t,e,i,n){const r=Math.min(Ug(t,e)/2,Ug(e,i)/2,n),{x:s,y:a}=e;if(t.x===s&&s===i.x||t.y===a&&a===i.y)return`L${s} ${a}`;if(t.y===a){const h=t.x<i.x?-1:1,c=t.y<i.y?1:-1;return`L ${s+r*h},${a}Q ${s},${a} ${s},${a+r*c}`}const l=t.x<i.x?1:-1,u=t.y<i.y?-1:1;return`L ${s},${a+r*u}Q ${s},${a} ${s+r*l},${a}`}function $f(t){const{sourceX:e,sourceY:i,sourcePosition:n=Xe.Bottom,targetX:r,targetY:s,targetPosition:a=Xe.Top,borderRadius:l=5,centerX:u,centerY:h,offset:c=20}=t,[p,v,g,b,m]=E2({source:{x:e,y:i},sourcePosition:n,target:{x:r,y:s},targetPosition:a,center:{x:u,y:h},offset:c});return[p.reduce((O,P,S)=>{let w;return S>0&&S<p.length-1?w=A2(p[S-1],P,p[S+1],l):w=`${S===0?"M":"L"}${P.x} ${P.y}`,O+=w,O},""),v,g,b,m]}function D2(t){const{sourceX:e,sourceY:i,targetX:n,targetY:r}=t,[s,a,l,u]=Dx({sourceX:e,sourceY:i,targetX:n,targetY:r});return[`M ${e},${i}L ${n},${r}`,s,a,l,u]}const _2=ot({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[i,n,r]=D2(t);return ut(Lc,{path:i,labelX:n,labelY:r,...e,...t})}}}),I2=_2,N2=ot({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[i,n,r]=$f({...t,sourcePosition:t.sourcePosition??Xe.Bottom,targetPosition:t.targetPosition??Xe.Top});return ut(Lc,{path:i,labelX:n,labelY:r,...e,...t})}}}),Mx=N2,M2=ot({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(t,{attrs:e}){return()=>ut(Mx,{...t,...e,borderRadius:0})}}),$2=M2,L2=ot({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[i,n,r]=Ix({...t,sourcePosition:t.sourcePosition??Xe.Bottom,targetPosition:t.targetPosition??Xe.Top});return ut(Lc,{path:i,labelX:n,labelY:r,...e,...t})}}}),B2=L2,Q2=ot({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[i,n,r]=Nx({...t,sourcePosition:t.sourcePosition??Xe.Bottom,targetPosition:t.targetPosition??Xe.Top});return ut(Lc,{path:i,labelX:n,labelY:r,...e,...t})}}}),F2=Q2,R2={input:v2,default:g2,output:y2},z2={default:B2,straight:I2,step:$2,smoothstep:Mx,simplebezier:F2};function X2(t,e,i){const n=Fe(()=>m=>e.value.get(m)),r=Fe(()=>m=>i.value.get(m)),s=Fe(()=>{const m={...z2,...t.edgeTypes},x=Object.keys(m);for(const O of t.edges)O.type&&!x.includes(O.type)&&(m[O.type]=O.type);return m}),a=Fe(()=>{const m={...R2,...t.nodeTypes},x=Object.keys(m);for(const O of t.nodes)O.type&&!x.includes(O.type)&&(m[O.type]=O.type);return m}),l=Fe(()=>t.onlyRenderVisibleElements?gx(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),u=Fe(()=>{if(t.onlyRenderVisibleElements){const m=[];for(const x of t.edges){const O=e.value.get(x.source),P=e.value.get(x.target);QA({sourcePos:O.computedPosition||{x:0,y:0},targetPos:P.computedPosition||{x:0,y:0},sourceWidth:O.dimensions.width,sourceHeight:O.dimensions.height,targetWidth:P.dimensions.width,targetHeight:P.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&m.push(x)}return m}return t.edges}),h=Fe(()=>[...l.value,...u.value]),c=Fe(()=>{const m=[];for(const x of t.nodes)x.selected&&m.push(x);return m}),p=Fe(()=>{const m=[];for(const x of t.edges)x.selected&&m.push(x);return m}),v=Fe(()=>[...c.value,...p.value]),g=Fe(()=>{const m=[];for(const x of t.nodes)x.dimensions.width&&x.dimensions.height&&x.handleBounds!==void 0&&m.push(x);return m}),b=Fe(()=>l.value.length>0&&g.value.length===l.value.length);return{getNode:n,getEdge:r,getElements:h,getEdgeTypes:s,getNodeTypes:a,getEdges:u,getNodes:l,getSelectedElements:v,getSelectedNodes:c,getSelectedEdges:p,getNodesInitialized:g,areNodesInitialized:b}}class Cr{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const i=(e=Fs())==null?void 0:e.appContext.app,n=i?.config.globalProperties.$vueFlowStorage??Cr.instance;return Cr.instance=n??new Cr,i&&(i.config.globalProperties.$vueFlowStorage=Cr.instance),Cr.instance}set(e,i){return this.flows.set(e,i)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,i){const n=Ax(),r=iT(n),s={};for(const[v,g]of Object.entries(r.hooks)){const b=`on${v.charAt(0).toUpperCase()+v.slice(1)}`;s[b]=g.on}const a={};for(const[v,g]of Object.entries(r.hooks))a[v]=g.trigger;const l=Fe(()=>{const v=new Map;for(const g of r.nodes)v.set(g.id,g);return v}),u=Fe(()=>{const v=new Map;for(const g of r.edges)v.set(g.id,g);return v}),h=X2(r,l,u),c=d2(r,l,u);c.setState({...r,...i});const p={...s,...h,...c,...MT(r),nodeLookup:l,edgeLookup:u,emits:a,id:e,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(e)}};return this.set(e,p),p}getId(){return`vue-flow-${this.currentId++}`}}function vt(t){const e=Cr.getInstance(),i=PO(),n=typeof t=="object",r=n?t:{id:t},s=r.id,a=s??i?.vueFlowId;let l;if(i){const u=cr(Xg,null);typeof u<"u"&&u!==null&&(!a||u.id===a)&&(l=u)}if(l||a&&(l=e.get(a)),!l||a&&l.id!==a){const u=s??e.getId(),h=e.create(u,r);l=h,(i??SO(!0)).run(()=>{Ge(h.applyDefault,(p,v,g)=>{const b=x=>{h.applyNodeChanges(x)},m=x=>{h.applyEdgeChanges(x)};p?(h.onNodesChange(b),h.onEdgesChange(m)):(h.hooks.value.nodesChange.off(b),h.hooks.value.edgesChange.off(m)),g(()=>{h.hooks.value.nodesChange.off(b),h.hooks.value.edgesChange.off(m)})},{immediate:!0}),yo(()=>{if(l){const p=e.get(l.id);p?p.$destroy():Jo(`No store instance found for id ${l.id} in storage.`)}})})}else n&&l.setState(r);if(i&&(Xr(Xg,l),i.vueFlowId=l.id),n){const u=Fs();u?.type.name!=="VueFlow"&&l.emits.error(new Bt(Nt.USEVUEFLOW_OPTIONS))}return l}function j2(t){const{emits:e,dimensions:i}=vt();let n;fn(()=>{const r=()=>{var s,a;if(!t.value||!(((a=(s=t.value).checkVisibility)==null?void 0:a.call(s))??!0))return;const l=Dc(t.value);(l.width===0||l.height===0)&&e.error(new Bt(Nt.MISSING_VIEWPORT_DIMENSIONS)),i.value={width:l.width||500,height:l.height||500}};r(),window.addEventListener("resize",r),t.value&&(n=new ResizeObserver(()=>r()),n.observe(t.value)),jd(()=>{window.removeEventListener("resize",r),n&&t.value&&n.unobserve(t.value)})})}const Z2={name:"UserSelection",compatConfig:{MODE:3}},V2=ot({...Z2,props:{userSelectionRect:{}},setup(t){return(e,i)=>(ye(),be("div",{class:"vue-flow__selection vue-flow__container",style:hi({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),U2=["tabIndex"],q2={name:"NodesSelection",compatConfig:{MODE:3}},W2=ot({...q2,setup(t){const{emits:e,viewport:i,getSelectedNodes:n,noPanClassName:r,disableKeyboardA11y:s,userSelectionActive:a}=vt(),l=Ex(),u=ze(null),h=Tx({el:u,onStart(b){e.selectionDragStart(b),e.nodeDragStart(b)},onDrag(b){e.selectionDrag(b),e.nodeDrag(b)},onStop(b){e.selectionDragStop(b),e.nodeDragStop(b)}});fn(()=>{var b;s.value||(b=u.value)==null||b.focus({preventScroll:!0})});const c=Fe(()=>ip(n.value)),p=Fe(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function v(b){e.selectionContextMenu({event:b,nodes:n.value})}function g(b){s.value||ps[b.key]&&(b.preventDefault(),l({x:ps[b.key].x,y:ps[b.key].y},b.shiftKey))}return(b,m)=>!Se(a)&&c.value.width&&c.value.height?(ye(),be("div",{key:0,class:bt(["vue-flow__nodesselection vue-flow__container",Se(r)]),style:hi({transform:`translate(${Se(i).x}px,${Se(i).y}px) scale(${Se(i).zoom})`})},[he("div",{ref_key:"el",ref:u,class:bt([{dragging:Se(h)},"vue-flow__nodesselection-rect"]),style:hi(p.value),tabIndex:Se(s)?void 0:-1,onContextmenu:v,onKeydown:g},null,46,U2)],6)):Qe("",!0)}});function Y2(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}const G2={name:"Pane",compatConfig:{MODE:3}},H2=ot({...G2,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(t){const{vueFlowRef:e,nodes:i,viewport:n,emits:r,userSelectionActive:s,removeSelectedElements:a,userSelectionRect:l,elementsSelectable:u,nodesSelectionActive:h,getSelectedEdges:c,getSelectedNodes:p,removeNodes:v,removeEdges:g,selectionMode:b,deleteKeyCode:m,multiSelectionKeyCode:x,multiSelectionActive:O,edgeLookup:P,nodeLookup:S,connectionLookup:w,defaultEdgeOptions:C,connectionStartHandle:E,panOnDrag:k}=vt(),A=Mi(null),$=Mi(new Set),F=Mi(new Set),I=Mi(null),B=lt(()=>u.value&&(t.isSelecting||s.value)),j=lt(()=>E.value!==null);let M=!1,q=!1;const X=so(m,{actInsideInputWithModifier:!1}),Y=so(x);Ge(X,se=>{se&&(v(p.value),g(c.value),h.value=!1)}),Ge(Y,se=>{O.value=se});function V(se,de){return ie=>{ie.target===de&&se?.(ie)}}function oe(se){if(M||j.value){M=!1;return}r.paneClick(se),a(),h.value=!1}function ae(se){var de;if(Array.isArray(k.value)&&((de=k.value)!=null&&de.includes(2))){se.preventDefault();return}r.paneContextMenu(se)}function fe(se){r.paneScroll(se)}function D(se){var de,ie,R;if(I.value=((de=e.value)==null?void 0:de.getBoundingClientRect())??null,!u.value||!t.isSelecting||se.button!==0||se.target!==A.value||!I.value)return;(R=(ie=se.target)==null?void 0:ie.setPointerCapture)==null||R.call(ie,se.pointerId);const{x:Q,y:xe}=Y2(se,I.value);q=!0,M=!1,a(),l.value={width:0,height:0,startX:Q,startY:xe,x:Q,y:xe},r.selectionStart(se)}function Z(se){var de;if(!I.value||!l.value)return;M=!0;const{x:ie,y:R}=en(se,I.value),{startX:Q=0,startY:xe=0}=l.value,Re={startX:Q,startY:xe,x:ie<Q?ie:Q,y:R<xe?R:xe,width:Math.abs(ie-Q),height:Math.abs(R-xe)},ke=$.value,$e=F.value;$.value=new Set(gx(i.value,Re,n.value,b.value===tp.Partial,!0).map(H=>H.id)),F.value=new Set;const te=((de=C.value)==null?void 0:de.selectable)??!0;for(const H of $.value){const re=w.value.get(H);if(re)for(const{edgeId:G}of re.values()){const J=P.value.get(G);J&&(J.selectable??te)&&F.value.add(G)}}if(!zg(ke,$.value)){const H=Un(S.value,$.value,!0);r.nodesChange(H)}if(!zg($e,F.value)){const H=Un(P.value,F.value);r.edgesChange(H)}l.value=Re,s.value=!0,h.value=!1}function L(se){var de;se.button!==0||!q||((de=se.target)==null||de.releasePointerCapture(se.pointerId),!s.value&&l.value&&se.target===A.value&&oe(se),s.value=!1,l.value=null,h.value=$.value.size>0,r.selectionEnd(se),t.selectionKeyPressed&&(M=!1),q=!1)}return(se,de)=>(ye(),be("div",{ref_key:"container",ref:A,class:bt(["vue-flow__pane vue-flow__container",{selection:se.isSelecting}]),onClick:de[0]||(de[0]=ie=>B.value?void 0:V(oe,A.value)(ie)),onContextmenu:de[1]||(de[1]=ie=>V(ae,A.value)(ie)),onWheelPassive:de[2]||(de[2]=ie=>V(fe,A.value)(ie)),onPointerenter:de[3]||(de[3]=ie=>B.value?void 0:Se(r).paneMouseEnter(ie)),onPointerdown:de[4]||(de[4]=ie=>B.value?D(ie):Se(r).paneMouseMove(ie)),onPointermove:de[5]||(de[5]=ie=>B.value?Z(ie):Se(r).paneMouseMove(ie)),onPointerup:de[6]||(de[6]=ie=>B.value?L(ie):void 0),onPointerleave:de[7]||(de[7]=ie=>Se(r).paneMouseLeave(ie))},[wt(se.$slots,"default"),Se(s)&&Se(l)?(ye(),Ct(V2,{key:0,"user-selection-rect":Se(l)},null,8,["user-selection-rect"])):Qe("",!0),Se(h)&&Se(p).length?(ye(),Ct(W2,{key:1})):Qe("",!0)],34))}}),J2={name:"Transform",compatConfig:{MODE:3}},K2=ot({...J2,setup(t){const{viewport:e,fitViewOnInit:i,fitViewOnInitDone:n}=vt(),r=Fe(()=>i.value?!n.value:!1),s=Fe(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(a,l)=>(ye(),be("div",{class:"vue-flow__transformationpane vue-flow__container",style:hi({transform:s.value,opacity:r.value?0:void 0})},[wt(a.$slots,"default")],4))}}),eD={name:"Viewport",compatConfig:{MODE:3}},tD=ot({...eD,setup(t){const{minZoom:e,maxZoom:i,defaultViewport:n,translateExtent:r,zoomActivationKeyCode:s,selectionKeyCode:a,panActivationKeyCode:l,panOnScroll:u,panOnScrollMode:h,panOnScrollSpeed:c,panOnDrag:p,zoomOnDoubleClick:v,zoomOnPinch:g,zoomOnScroll:b,preventScrolling:m,noWheelClassName:x,noPanClassName:O,emits:P,connectionStartHandle:S,userSelectionActive:w,paneDragging:C,d3Zoom:E,d3Selection:k,d3ZoomHandler:A,viewport:$,viewportRef:F,paneClickDistance:I}=vt();j2(F);const B=Mi(!1),j=Mi(!1);let M=null,q=!1,X=0,Y={x:0,y:0,zoom:0};const V=so(l),oe=so(a),ae=so(s),fe=lt(()=>(!oe.value||oe.value&&a.value===!0)&&(V.value||p.value)),D=lt(()=>V.value||u.value),Z=lt(()=>a.value===!0&&fe.value!==!0),L=lt(()=>oe.value&&a.value!==!0||w.value||Z.value),se=lt(()=>S.value!==null);fn(()=>{if(!F.value){Jo("Viewport element is missing");return}const xe=F.value,Re=xe.getBoundingClientRect(),ke=vA().clickDistance(I.value).scaleExtent([e.value,i.value]).translateExtent(r.value),$e=Di(xe).call(ke),te=$e.on("wheel.zoom"),H=Cs.translate(n.value.x??0,n.value.y??0).scale(Vr(n.value.zoom??1,e.value,i.value)),re=[[0,0],[Re.width,Re.height]],G=ke.constrain()(H,re,r.value);ke.transform($e,G),ke.wheelDelta(If),E.value=ke,k.value=$e,A.value=te,$.value={x:G.x,y:G.y,zoom:G.k},ke.on("start",J=>{var le;if(!J.sourceEvent)return null;X=J.sourceEvent.button,B.value=!0;const ve=R(J.transform);((le=J.sourceEvent)==null?void 0:le.type)==="mousedown"&&(C.value=!0),Y=ve,P.viewportChangeStart(ve),P.moveStart({event:J,flowTransform:ve})}),ke.on("end",J=>{if(!J.sourceEvent)return null;if(B.value=!1,C.value=!1,de(fe.value,X??0)&&!q&&P.paneContextMenu(J.sourceEvent),q=!1,ie(Y,J.transform)){const le=R(J.transform);Y=le,P.viewportChangeEnd(le),P.moveEnd({event:J,flowTransform:le})}}),ke.filter(J=>{var le;const ve=ae.value||b.value,we=g.value&&J.ctrlKey,K=J.button,ue=J.type==="wheel";if(K===1&&J.type==="mousedown"&&(Q(J,"vue-flow__node")||Q(J,"vue-flow__edge")))return!0;if(!fe.value&&!ve&&!D.value&&!v.value&&!g.value||w.value||se.value&&!ue||!v.value&&J.type==="dblclick"||Q(J,x.value)&&ue||Q(J,O.value)&&(!ue||D.value&&ue&&!ae.value)||!g.value&&J.ctrlKey&&ue||!ve&&!D.value&&!we&&ue)return!1;if(!g&&J.type==="touchstart"&&((le=J.touches)==null?void 0:le.length)>1)return J.preventDefault(),!1;if(!fe.value&&(J.type==="mousedown"||J.type==="touchstart")||Z.value&&Array.isArray(p.value)&&p.value.includes(0)&&K===0||Array.isArray(p.value)&&!p.value.includes(K)&&(J.type==="mousedown"||J.type==="touchstart"))return!1;const me=Array.isArray(p.value)&&p.value.includes(K)||a.value===!0&&Array.isArray(p.value)&&!p.value.includes(0)||!K||K<=1;return(!J.ctrlKey||V.value||ue)&&me}),Ge([w,fe],()=>{w.value&&!B.value?ke.on("zoom",null):w.value||ke.on("zoom",J=>{$.value={x:J.transform.x,y:J.transform.y,zoom:J.transform.k};const le=R(J.transform);q=de(fe.value,X??0),P.viewportChange(le),P.move({event:J,flowTransform:le})})},{immediate:!0}),Ge([w,D,h,ae,g,m,x],()=>{D.value&&!ae.value&&!w.value?$e.on("wheel.zoom",J=>{if(Q(J,x.value))return!1;const le=ae.value||b.value,ve=g.value&&J.ctrlKey;if(!(!m.value||D.value||le||ve))return!1;J.preventDefault(),J.stopImmediatePropagation();const K=$e.property("__zoom").k||1,ue=To();if(!V.value&&J.ctrlKey&&g.value&&ue){const Tt=Hi(J),Je=If(J),ei=K*2**Je;ke.scaleTo($e,ei,Tt,J);return}const me=J.deltaMode===1?20:1;let Pe=h.value===ro.Vertical?0:J.deltaX*me,Ve=h.value===ro.Horizontal?0:J.deltaY*me;!ue&&J.shiftKey&&h.value!==ro.Vertical&&!Pe&&Ve&&(Pe=Ve,Ve=0),ke.translateBy($e,-(Pe/K)*c.value,-(Ve/K)*c.value);const He=R($e.property("__zoom"));M&&clearTimeout(M),j.value?(P.move({event:J,flowTransform:He}),P.viewportChange(He),M=setTimeout(()=>{P.moveEnd({event:J,flowTransform:He}),P.viewportChangeEnd(He),j.value=!1},150)):(j.value=!0,P.moveStart({event:J,flowTransform:He}),P.viewportChangeStart(He))},{passive:!1}):typeof te<"u"&&$e.on("wheel.zoom",function(J,le){const ve=!m.value&&J.type==="wheel"&&!J.ctrlKey,we=ae.value||b.value,K=g.value&&J.ctrlKey;if(!we&&!u.value&&!K&&J.type==="wheel"||ve||Q(J,x.value))return null;J.preventDefault(),te.call(this,J,le)},{passive:!1})},{immediate:!0})});function de(xe,Re){return Re===2&&Array.isArray(xe)&&xe.includes(2)}function ie(xe,Re){return xe.x!==Re.x&&!Number.isNaN(Re.x)||xe.y!==Re.y&&!Number.isNaN(Re.y)||xe.zoom!==Re.k&&!Number.isNaN(Re.k)}function R(xe){return{x:xe.x,y:xe.y,zoom:xe.k}}function Q(xe,Re){return xe.target.closest(`.${Re}`)}return(xe,Re)=>(ye(),be("div",{ref_key:"viewportRef",ref:F,class:"vue-flow__viewport vue-flow__container"},[ht(H2,{"is-selecting":L.value,"selection-key-pressed":Se(oe),class:bt({connecting:se.value,dragging:Se(C),draggable:Se(p)===!0||Array.isArray(Se(p))&&Se(p).includes(0)})},{default:Ki(()=>[ht(K2,null,{default:Ki(()=>[wt(xe.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),iD=["id"],nD=["id"],rD=["id"],sD={name:"A11yDescriptions",compatConfig:{MODE:3}},aD=ot({...sD,setup(t){const{id:e,disableKeyboardA11y:i,ariaLiveMessage:n}=vt();return(r,s)=>(ye(),be(gt,null,[he("div",{id:`${Se(ox)}-${Se(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+Te(Se(i)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,iD),he("div",{id:`${Se(lx)}-${Se(e)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,nD),Se(i)?Qe("",!0):(ye(),be("div",{key:0,id:`${Se(PA)}-${Se(e)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},Te(Se(n)),9,rD))],64))}});function oD(){const t=vt();Ge(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function lD(t,e,i){return i===Xe.Left?t-e:i===Xe.Right?t+e:t}function uD(t,e,i){return i===Xe.Top?t-e:i===Xe.Bottom?t+e:t}const sp=function({radius:t=10,centerX:e=0,centerY:i=0,position:n=Xe.Top,type:r}){return ut("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${r}`,cx:lD(e,t,n),cy:uD(i,t,n),r:t,stroke:"transparent",fill:"transparent"})};sp.props=["radius","centerX","centerY","position","type"];sp.compatConfig={MODE:3};const qg=sp,cD=ot({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:i,connectionMode:n,edgeUpdaterRadius:r,emits:s,nodesSelectionActive:a,noPanClassName:l,getEdgeTypes:u,removeSelectedEdges:h,findEdge:c,findNode:p,isValidConnection:v,multiSelectionActive:g,disableKeyboardA11y:b,elementsSelectable:m,edgesUpdatable:x,edgesFocusable:O,hooks:P}=vt(),S=Fe(()=>c(t.id)),{emit:w,on:C}=e2(S.value,s),E=cr(Ic),k=Fs(),A=ze(!1),$=ze(!1),F=ze(""),I=ze(null),B=ze("source"),j=ze(null),M=lt(()=>typeof S.value.selectable>"u"?m.value:S.value.selectable),q=lt(()=>typeof S.value.updatable>"u"?x.value:S.value.updatable),X=lt(()=>typeof S.value.focusable>"u"?O.value:S.value.focusable);Xr(HA,t.id),Xr(JA,j);const Y=Fe(()=>S.value.class instanceof Function?S.value.class(S.value):S.value.class),V=Fe(()=>S.value.style instanceof Function?S.value.style(S.value):S.value.style),oe=Fe(()=>{const H=S.value.type||"default",re=E?.[`edge-${H}`];if(re)return re;let G=S.value.template??u.value[H];if(typeof G=="string"&&k){const J=Object.keys(k.appContext.components);J&&J.includes(H)&&(G=TO(H,!1))}return G&&typeof G!="string"?G:(s.error(new Bt(Nt.EDGE_TYPE_MISSING,G)),!1)}),{handlePointerDown:ae}=Cx({nodeId:F,handleId:I,type:B,isValidConnection:v,edgeUpdaterType:B,onEdgeUpdate:Z,onEdgeUpdateEnd:L});return()=>{const H=p(S.value.source),re=p(S.value.target),G="pathOptions"in S.value?S.value.pathOptions:{};if(!H&&!re)return s.error(new Bt(Nt.EDGE_SOURCE_TARGET_MISSING,S.value.id,S.value.source,S.value.target)),null;if(!H)return s.error(new Bt(Nt.EDGE_SOURCE_MISSING,S.value.id,S.value.source)),null;if(!re)return s.error(new Bt(Nt.EDGE_TARGET_MISSING,S.value.id,S.value.target)),null;if(!S.value||S.value.hidden||H.hidden||re.hidden)return null;let J;n.value===er.Strict?J=H.handleBounds.source:J=[...H.handleBounds.source||[],...H.handleBounds.target||[]];const le=$g(J,S.value.sourceHandle);let ve;n.value===er.Strict?ve=re.handleBounds.target:ve=[...re.handleBounds.target||[],...re.handleBounds.source||[]];const we=$g(ve,S.value.targetHandle),K=le?.position||Xe.Bottom,ue=we?.position||Xe.Top,{x:me,y:Pe}=ks(H,le,K),{x:Ve,y:He}=ks(re,we,ue);return S.value.sourceX=me,S.value.sourceY=Pe,S.value.targetX=Ve,S.value.targetY=He,ut("g",{ref:j,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${oe.value===!1?"default":S.value.type||"default"}`,l.value,Y.value,{updating:A.value,selected:S.value.selected,animated:S.value.animated,inactive:!M.value&&!P.value.edgeClick.hasListeners()}],tabIndex:X.value?0:void 0,"aria-label":S.value.ariaLabel===null?void 0:S.value.ariaLabel??`Edge from ${S.value.source} to ${S.value.target}`,"aria-describedby":X.value?`${lx}-${e}`:void 0,"aria-roledescription":"edge",role:X.value?"group":"img",...S.value.domAttributes,onClick:de,onContextmenu:ie,onDblclick:R,onMouseenter:Q,onMousemove:xe,onMouseleave:Re,onKeyDown:X.value?te:void 0},[$.value?null:ut(oe.value===!1?u.value.default:oe.value,{id:t.id,sourceNode:H,targetNode:re,source:S.value.source,target:S.value.target,type:S.value.type,updatable:q.value,selected:S.value.selected,animated:S.value.animated,label:S.value.label,labelStyle:S.value.labelStyle,labelShowBg:S.value.labelShowBg,labelBgStyle:S.value.labelBgStyle,labelBgPadding:S.value.labelBgPadding,labelBgBorderRadius:S.value.labelBgBorderRadius,data:S.value.data,events:{...S.value.events,...C},style:V.value,markerStart:`url('#${Po(S.value.markerStart,e)}')`,markerEnd:`url('#${Po(S.value.markerEnd,e)}')`,sourcePosition:K,targetPosition:ue,sourceX:me,sourceY:Pe,targetX:Ve,targetY:He,sourceHandleId:S.value.sourceHandle,targetHandleId:S.value.targetHandle,interactionWidth:S.value.interactionWidth,...G}),[q.value==="source"||q.value===!0?[ut("g",{onMousedown:ke,onMouseenter:fe,onMouseout:D},ut(qg,{position:K,centerX:me,centerY:Pe,radius:r.value,type:"source","data-type":"source"}))]:null,q.value==="target"||q.value===!0?[ut("g",{onMousedown:$e,onMouseenter:fe,onMouseout:D},ut(qg,{position:ue,centerX:Ve,centerY:He,radius:r.value,type:"target","data-type":"target"}))]:null]])};function fe(){A.value=!0}function D(){A.value=!1}function Z(H,re){w.update({event:H,edge:S.value,connection:re})}function L(H){w.updateEnd({event:H,edge:S.value}),$.value=!1}function se(H,re){H.button===0&&($.value=!0,F.value=re?S.value.target:S.value.source,I.value=(re?S.value.targetHandle:S.value.sourceHandle)??null,B.value=re?"target":"source",w.updateStart({event:H,edge:S.value}),ae(H))}function de(H){var re;const G={event:H,edge:S.value};M.value&&(a.value=!1,S.value.selected&&g.value?(h([S.value]),(re=j.value)==null||re.blur()):i([S.value])),w.click(G)}function ie(H){w.contextMenu({event:H,edge:S.value})}function R(H){w.doubleClick({event:H,edge:S.value})}function Q(H){w.mouseEnter({event:H,edge:S.value})}function xe(H){w.mouseMove({event:H,edge:S.value})}function Re(H){w.mouseLeave({event:H,edge:S.value})}function ke(H){se(H,!0)}function $e(H){se(H,!1)}function te(H){var re;!b.value&&ux.includes(H.key)&&M.value&&(H.key==="Escape"?((re=j.value)==null||re.blur(),h([c(t.id)])):i([c(t.id)]))}}}),hD=cD,fD=ot({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:i,connectionStartHandle:n,connectionEndHandle:r,connectionPosition:s,connectionLineType:a,connectionLineStyle:l,connectionLineOptions:u,connectionStatus:h,viewport:c,findNode:p}=vt(),v=(t=cr(Ic))==null?void 0:t["connection-line"],g=Fe(()=>{var P;return p((P=n.value)==null?void 0:P.nodeId)}),b=Fe(()=>{var P;return p((P=r.value)==null?void 0:P.nodeId)??null}),m=Fe(()=>({x:(s.value.x-c.value.x)/c.value.zoom,y:(s.value.y-c.value.y)/c.value.zoom})),x=Fe(()=>u.value.markerStart?`url(#${Po(u.value.markerStart,e)})`:""),O=Fe(()=>u.value.markerEnd?`url(#${Po(u.value.markerEnd,e)})`:"");return()=>{var P,S,w;if(!g.value||!n.value)return null;const C=n.value.id,E=n.value.type,k=g.value.handleBounds;let A=k?.[E]??[];if(i.value===er.Loose){const V=k?.[E==="source"?"target":"source"]??[];A=[...A,...V]}if(!A)return null;const $=(C?A.find(V=>V.id===C):A[0])??null,F=$?.position??Xe.Top,{x:I,y:B}=ks(g.value,$,F);let j=null;b.value&&(i.value===er.Strict?j=((P=b.value.handleBounds[E==="source"?"target":"source"])==null?void 0:P.find(V=>{var oe;return V.id===((oe=r.value)==null?void 0:oe.id)}))||null:j=((S=[...b.value.handleBounds.source??[],...b.value.handleBounds.target??[]])==null?void 0:S.find(V=>{var oe;return V.id===((oe=r.value)==null?void 0:oe.id)}))||null);const M=((w=r.value)==null?void 0:w.position)??(F?Nf[F]:null);if(!F||!M)return null;const q=a.value??u.value.type??Pr.Bezier;let X="";const Y={sourceX:I,sourceY:B,sourcePosition:F,targetX:m.value.x,targetY:m.value.y,targetPosition:M};return q===Pr.Bezier?[X]=Ix(Y):q===Pr.Step?[X]=$f({...Y,borderRadius:0}):q===Pr.SmoothStep?[X]=$f(Y):q===Pr.SimpleBezier?[X]=Nx(Y):X=`M${I},${B} ${m.value.x},${m.value.y}`,ut("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},ut("g",{class:"vue-flow__connection"},v?ut(v,{sourceX:I,sourceY:B,sourcePosition:F,targetX:m.value.x,targetY:m.value.y,targetPosition:M,sourceNode:g.value,sourceHandle:$,targetNode:b.value,targetHandle:j,markerEnd:O.value,markerStart:x.value,connectionStatus:h.value}):ut("path",{d:X,class:[u.value.class,h.value,"vue-flow__connection-path"],style:{...l.value,...u.value.style},"marker-end":O.value,"marker-start":x.value})))}}}),dD=fD,pD=["id","markerWidth","markerHeight","markerUnits","orient"],mD={name:"MarkerType",compatConfig:{MODE:3}},gD=ot({...mD,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(t){return(e,i)=>(ye(),be("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===Se(Df).ArrowClosed?(ye(),be("polyline",{key:0,style:hi({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Qe("",!0),e.type===Se(Df).Arrow?(ye(),be("polyline",{key:1,style:hi({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Qe("",!0)],8,pD))}}),yD={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},vD={name:"MarkerDefinitions",compatConfig:{MODE:3}},OD=ot({...vD,setup(t){const{id:e,edges:i,connectionLineOptions:n,defaultMarkerColor:r}=vt(),s=Fe(()=>{const a=new Set,l=[],u=h=>{if(h){const c=Po(h,e);a.has(c)||(typeof h=="object"?l.push({...h,id:c,color:h.color||r.value}):l.push({id:c,color:r.value,type:h}),a.add(c))}};for(const h of[n.value.markerEnd,n.value.markerStart])u(h);for(const h of i.value)for(const c of[h.markerStart,h.markerEnd])u(c);return l.sort((h,c)=>h.id.localeCompare(c.id))});return(a,l)=>(ye(),be("svg",yD,[he("defs",null,[(ye(!0),be(gt,null,Jt(s.value,u=>(ye(),Ct(gD,{id:u.id,key:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,"stroke-width":u.strokeWidth,orient:u.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),xD={name:"Edges",compatConfig:{MODE:3}},bD=ot({...xD,setup(t){const{findNode:e,getEdges:i,elevateEdgesOnSelect:n}=vt();return(r,s)=>(ye(),be(gt,null,[ht(OD),(ye(!0),be(gt,null,Jt(Se(i),a=>(ye(),be("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:hi({zIndex:Se(FA)(a,Se(e),Se(n))})},[ht(Se(hD),{id:a.id},null,8,["id"])],4))),128)),ht(Se(dD))],64))}}),SD=ot({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:i,selectNodesOnDrag:n,nodesSelectionActive:r,multiSelectionActive:s,emits:a,removeSelectedNodes:l,addSelectedNodes:u,updateNodeDimensions:h,onUpdateNodeInternals:c,getNodeTypes:p,nodeExtent:v,elevateNodesOnSelect:g,disableKeyboardA11y:b,ariaLiveMessage:m,snapToGrid:x,snapGrid:O,nodeDragThreshold:P,nodesDraggable:S,elementsSelectable:w,nodesConnectable:C,nodesFocusable:E,hooks:k}=vt(),A=ze(null);Xr(Px,A),Xr(wx,t.id);const $=cr(Ic),F=Fs(),I=Ex(),{node:B,parentNode:j}=kx(t.id),{emit:M,on:q}=r2(B,a),X=lt(()=>typeof B.draggable>"u"?S.value:B.draggable),Y=lt(()=>typeof B.selectable>"u"?w.value:B.selectable),V=lt(()=>typeof B.connectable>"u"?C.value:B.connectable),oe=lt(()=>typeof B.focusable>"u"?E.value:B.focusable),ae=Fe(()=>Y.value||X.value||k.value.nodeClick.hasListeners()||k.value.nodeDoubleClick.hasListeners()||k.value.nodeMouseEnter.hasListeners()||k.value.nodeMouseMove.hasListeners()||k.value.nodeMouseLeave.hasListeners()),fe=lt(()=>!!B.dimensions.width&&!!B.dimensions.height),D=Fe(()=>{const re=B.type||"default",G=$?.[`node-${re}`];if(G)return G;let J=B.template||p.value[re];if(typeof J=="string"&&F){const le=Object.keys(F.appContext.components);le&&le.includes(re)&&(J=TO(re,!1))}return J&&typeof J!="string"?J:(a.error(new Bt(Nt.NODE_TYPE_MISSING,J)),!1)}),Z=Tx({id:t.id,el:A,disabled:()=>!X.value,selectable:Y,dragHandle:()=>B.dragHandle,onStart(re){M.dragStart(re)},onDrag(re){M.drag(re)},onStop(re){M.dragStop(re)},onClick(re){te(re)}}),L=Fe(()=>B.class instanceof Function?B.class(B):B.class),se=Fe(()=>{const re=(B.style instanceof Function?B.style(B):B.style)||{},G=B.width instanceof Function?B.width(B):B.width,J=B.height instanceof Function?B.height(B):B.height;return!re.width&&G&&(re.width=typeof G=="string"?G:`${G}px`),!re.height&&J&&(re.height=typeof J=="string"?J:`${J}px`),re}),de=lt(()=>Number(B.zIndex??se.value.zIndex??0));return c(re=>{(re.includes(t.id)||!re.length)&&R()}),fn(()=>{Ge(()=>B.hidden,(re=!1,G,J)=>{!re&&A.value&&(t.resizeObserver.observe(A.value),J(()=>{A.value&&t.resizeObserver.unobserve(A.value)}))},{immediate:!0,flush:"post"})}),Ge([()=>B.type,()=>B.sourcePosition,()=>B.targetPosition],()=>{vi(()=>{h([{id:t.id,nodeElement:A.value,forceUpdate:!0}])})}),Ge([()=>B.position.x,()=>B.position.y,()=>{var re;return(re=j.value)==null?void 0:re.computedPosition.x},()=>{var re;return(re=j.value)==null?void 0:re.computedPosition.y},()=>{var re;return(re=j.value)==null?void 0:re.computedPosition.z},de,()=>B.selected,()=>B.dimensions.height,()=>B.dimensions.width,()=>{var re;return(re=j.value)==null?void 0:re.dimensions.height},()=>{var re;return(re=j.value)==null?void 0:re.dimensions.width}],([re,G,J,le,ve,we])=>{const K={x:re,y:G,z:we+(g.value&&B.selected?1e3:0)};typeof J<"u"&&typeof le<"u"?B.computedPosition=NA({x:J,y:le,z:ve},K):B.computedPosition=K},{flush:"post",immediate:!0}),Ge([()=>B.extent,v],([re,G],[J,le])=>{(re!==J||G!==le)&&ie()}),B.extent==="parent"||typeof B.extent=="object"&&"range"in B.extent&&B.extent.range==="parent"?bf(()=>fe).toBe(!0).then(ie):ie(),()=>B.hidden?null:ut("div",{ref:A,"data-id":B.id,class:["vue-flow__node",`vue-flow__node-${D.value===!1?"default":B.type||"default"}`,{[i.value]:X.value,dragging:Z?.value,draggable:X.value,selected:B.selected,selectable:Y.value,parent:B.isParent},L.value],style:{visibility:fe.value?"visible":"hidden",zIndex:B.computedPosition.z??de.value,transform:`translate(${B.computedPosition.x}px,${B.computedPosition.y}px)`,pointerEvents:ae.value?"all":"none",...se.value},tabIndex:oe.value?0:void 0,role:oe.value?"group":void 0,"aria-describedby":b.value?void 0:`${ox}-${e}`,"aria-label":B.ariaLabel,"aria-roledescription":"node",...B.domAttributes,onMouseenter:Q,onMousemove:xe,onMouseleave:Re,onContextmenu:ke,onClick:te,onDblclick:$e,onKeydown:H},[ut(D.value===!1?p.value.default:D.value,{id:B.id,type:B.type,data:B.data,events:{...B.events,...q},selected:B.selected,resizing:B.resizing,dragging:Z.value,connectable:V.value,position:B.computedPosition,dimensions:B.dimensions,isValidTargetPos:B.isValidTargetPos,isValidSourcePos:B.isValidSourcePos,parent:B.parentNode,parentNodeId:B.parentNode,zIndex:B.computedPosition.z??de.value,targetPosition:B.targetPosition,sourcePosition:B.sourcePosition,label:B.label,dragHandle:B.dragHandle,onUpdateNodeInternals:R})]);function ie(){const re=B.computedPosition,{computedPosition:G,position:J}=np(B,x.value?_c(re,O.value):re,a.error,v.value,j.value);(B.computedPosition.x!==G.x||B.computedPosition.y!==G.y)&&(B.computedPosition={...B.computedPosition,...G}),(B.position.x!==J.x||B.position.y!==J.y)&&(B.position=J)}function R(){A.value&&h([{id:t.id,nodeElement:A.value,forceUpdate:!0}])}function Q(re){Z?.value||M.mouseEnter({event:re,node:B})}function xe(re){Z?.value||M.mouseMove({event:re,node:B})}function Re(re){Z?.value||M.mouseLeave({event:re,node:B})}function ke(re){return M.contextMenu({event:re,node:B})}function $e(re){return M.doubleClick({event:re,node:B})}function te(re){Y.value&&(!n.value||!X.value||P.value>0)&&Mf(B,s.value,u,l,r,!1,A.value),M.click({event:re,node:B})}function H(re){if(!(_f(re)||b.value))if(ux.includes(re.key)&&Y.value){const G=re.key==="Escape";Mf(B,s.value,u,l,r,G,A.value)}else X.value&&B.selected&&ps[re.key]&&(re.preventDefault(),m.value=`Moved selected node ${re.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~B.position.x}, y: ${~~B.position.y}`,I({x:ps[re.key].x,y:ps[re.key].y},re.shiftKey))}}}),wD=SD;function PD(t={includeHiddenNodes:!1}){const{nodes:e}=vt();return Fe(()=>{if(e.value.length===0)return!1;for(const i of e.value)if((t.includeHiddenNodes||!i.hidden)&&(i?.handleBounds===void 0||i.dimensions.width===0||i.dimensions.height===0))return!1;return!0})}const TD={class:"vue-flow__nodes vue-flow__container"},CD={name:"Nodes",compatConfig:{MODE:3}},kD=ot({...CD,setup(t){const{getNodes:e,updateNodeDimensions:i,emits:n}=vt(),r=PD(),s=ze();return Ge(r,a=>{a&&vi(()=>{n.nodesInitialized(e.value)})},{immediate:!0}),fn(()=>{s.value=new ResizeObserver(a=>{const l=a.map(u=>({id:u.target.getAttribute("data-id"),nodeElement:u.target,forceUpdate:!0}));vi(()=>i(l))})}),jd(()=>{var a;return(a=s.value)==null?void 0:a.disconnect()}),(a,l)=>(ye(),be("div",TD,[s.value?(ye(!0),be(gt,{key:0},Jt(Se(e),(u,h,c,p)=>{const v=[u.id];if(p&&p.key===u.id&&tT(p,v))return p;const g=(ye(),Ct(Se(wD),{id:u.id,key:u.id,"resize-observer":s.value},null,8,["id","resize-observer"]));return g.memo=v,g},l,0),128)):Qe("",!0)]))}});function ED(){const{emits:t}=vt();fn(()=>{if(Sx()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new Bt(Nt.MISSING_STYLES))}})}const AD=he("div",{class:"vue-flow__edge-labels"},null,-1),DD={name:"VueFlow",compatConfig:{MODE:3}},_D=ot({...DD,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(t,{expose:e,emit:i}){const n=t,r=wO(),s=dh(n,"modelValue",i),a=dh(n,"nodes",i),l=dh(n,"edges",i),u=vt(n),h=l2({modelValue:s,nodes:a,edges:l},n,u);return c2(i,u.hooks),oD(),ED(),Xr(Ic,r),JP(h),e(u),(c,p)=>(ye(),be("div",{ref:Se(u).vueFlowRef,class:"vue-flow"},[ht(tD,null,{default:Ki(()=>[ht(bD),AD,ht(kD),wt(c.$slots,"zoom-pane")]),_:3}),wt(c.$slots,"default"),ht(aD)],512))}}),ID={name:"Panel",compatConfig:{MODE:3}},$x=ot({...ID,props:{position:{}},setup(t){const e=t,{userSelectionActive:i}=vt(),n=Fe(()=>`${e.position}`.split("-"));return(r,s)=>(ye(),be("div",{class:bt(["vue-flow__panel",n.value]),style:hi({pointerEvents:Se(i)?"none":"all"})},[wt(r.$slots,"default")],6))}});var kn=(t=>(t.Lines="lines",t.Dots="dots",t))(kn||{});const Lx=function({dimensions:t,size:e,color:i}){return ut("path",{stroke:i,"stroke-width":e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})},Bx=function({radius:t,color:e}){return ut("circle",{cx:t,cy:t,r:t,fill:e})};kn.Lines+"",kn.Dots+"";const ND={[kn.Dots]:"#81818a",[kn.Lines]:"#eee"},MD=["id","x","y","width","height","patternTransform"],$D={key:2,height:"100",width:"100"},LD=["fill"],BD=["x","y","fill"],QD={name:"Background",compatConfig:{MODE:3}},FD=ot({...QD,props:{id:{},variant:{default:()=>kn.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(t){const{id:e,viewport:i}=vt(),n=Fe(()=>{const a=i.value.zoom,[l,u]=Array.isArray(t.gap)?t.gap:[t.gap,t.gap],h=[l*a||1,u*a||1],c=t.size*a,[p,v]=Array.isArray(t.offset)?t.offset:[t.offset,t.offset],g=[p*a||1+h[0]/2,v*a||1+h[1]/2];return{scaledGap:h,offset:g,size:c}}),r=lt(()=>`pattern-${e}${t.id?`-${t.id}`:""}`),s=lt(()=>t.color||t.patternColor||ND[t.variant||kn.Dots]);return(a,l)=>(ye(),be("svg",{class:"vue-flow__background vue-flow__container",style:hi({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[wt(a.$slots,"pattern-container",{id:r.value},()=>[he("pattern",{id:r.value,x:Se(i).x%n.value.scaledGap[0],y:Se(i).y%n.value.scaledGap[1],width:n.value.scaledGap[0],height:n.value.scaledGap[1],patternTransform:`translate(-${n.value.offset[0]},-${n.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[wt(a.$slots,"pattern",{},()=>[a.variant===Se(kn).Lines?(ye(),Ct(Se(Lx),{key:0,size:a.lineWidth,color:s.value,dimensions:n.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===Se(kn).Dots?(ye(),Ct(Se(Bx),{key:1,color:s.value,radius:n.value.size/2},null,8,["color","radius"])):Qe("",!0),a.bgColor?(ye(),be("svg",$D,[he("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,LD)])):Qe("",!0)])],8,MD)]),he("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,BD),wt(a.$slots,"default",{id:r.value})],4))}}),RD={name:"ControlButton",compatConfig:{MODE:3}},zD=(t,e)=>{const i=t.__vccOpts||t;for(const[n,r]of e)i[n]=r;return i},XD={type:"button",class:"vue-flow__controls-button"};function jD(t,e,i,n,r,s){return ye(),be("button",XD,[wt(t.$slots,"default")])}const $l=zD(RD,[["render",jD]]),ZD={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},VD=he("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),UD=[VD];function qD(t,e){return ye(),be("svg",ZD,UD)}const WD={render:qD},YD={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},GD=he("path",{d:"M0 0h32v4.2H0z"},null,-1),HD=[GD];function JD(t,e){return ye(),be("svg",YD,HD)}const KD={render:JD},e_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},t_=he("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1),i_=[t_];function n_(t,e){return ye(),be("svg",e_,i_)}const r_={render:n_},s_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},a_=he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1),o_=[a_];function l_(t,e){return ye(),be("svg",s_,o_)}const u_={render:l_},c_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},h_=he("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1),f_=[h_];function d_(t,e){return ye(),be("svg",c_,f_)}const p_={render:d_},m_={name:"Controls",compatConfig:{MODE:3}},g_=ot({...m_,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>ax.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:i,nodesConnectable:n,elementsSelectable:r,setInteractive:s,zoomIn:a,zoomOut:l,fitView:u,viewport:h,minZoom:c,maxZoom:p}=vt(),v=lt(()=>i.value||n.value||r.value),g=lt(()=>h.value.zoom<=c.value),b=lt(()=>h.value.zoom>=p.value);function m(){a(),e("zoomIn")}function x(){l(),e("zoomOut")}function O(){u(t.fitViewParams),e("fitView")}function P(){s(!v.value),e("interactionChange",!v.value)}return(S,w)=>(ye(),Ct(Se($x),{class:"vue-flow__controls",position:S.position},{default:Ki(()=>[wt(S.$slots,"top"),S.showZoom?(ye(),be(gt,{key:0},[wt(S.$slots,"control-zoom-in",{},()=>[ht($l,{class:"vue-flow__controls-zoomin",disabled:b.value,onClick:m},{default:Ki(()=>[wt(S.$slots,"icon-zoom-in",{},()=>[(ye(),Ct(wr(Se(WD))))])]),_:3},8,["disabled"])]),wt(S.$slots,"control-zoom-out",{},()=>[ht($l,{class:"vue-flow__controls-zoomout",disabled:g.value,onClick:x},{default:Ki(()=>[wt(S.$slots,"icon-zoom-out",{},()=>[(ye(),Ct(wr(Se(KD))))])]),_:3},8,["disabled"])])],64)):Qe("",!0),S.showFitView?wt(S.$slots,"control-fit-view",{key:1},()=>[ht($l,{class:"vue-flow__controls-fitview",onClick:O},{default:Ki(()=>[wt(S.$slots,"icon-fit-view",{},()=>[(ye(),Ct(wr(Se(r_))))])]),_:3})]):Qe("",!0),S.showInteractive?wt(S.$slots,"control-interactive",{key:2},()=>[S.showInteractive?(ye(),Ct($l,{key:0,class:"vue-flow__controls-interactive",onClick:P},{default:Ki(()=>[v.value?wt(S.$slots,"icon-unlock",{key:0},()=>[(ye(),Ct(wr(Se(p_))))]):Qe("",!0),v.value?Qe("",!0):wt(S.$slots,"icon-lock",{key:1},()=>[(ye(),Ct(wr(Se(u_))))])]),_:3})):Qe("",!0)]):Qe("",!0),wt(S.$slots,"default")]),_:3},8,["position"]))}});var y_={value:()=>{}};function ap(){for(var t=0,e=arguments.length,i={},n;t<e;++t){if(!(n=arguments[t]+"")||n in i||/[\s.]/.test(n))throw new Error("illegal type: "+n);i[n]=[]}return new xu(i)}function xu(t){this._=t}function v_(t,e){return t.trim().split(/^|\s+/).map(function(i){var n="",r=i.indexOf(".");if(r>=0&&(n=i.slice(r+1),i=i.slice(0,r)),i&&!e.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}xu.prototype=ap.prototype={constructor:xu,on:function(t,e){var i=this._,n=v_(t+"",i),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(t=n[s]).type)&&(r=O_(i[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(t=n[s]).type)i[r]=Wg(i[r],t.name,e);else if(e==null)for(r in i)i[r]=Wg(i[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var i in e)t[i]=e[i].slice();return new xu(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var i=new Array(r),n=0,r,s;n<r;++n)i[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],n=0,r=s.length;n<r;++n)s[n].value.apply(e,i)},apply:function(t,e,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],r=0,s=n.length;r<s;++r)n[r].value.apply(e,i)}};function O_(t,e){for(var i=0,n=t.length,r;i<n;++i)if((r=t[i]).name===e)return r.value}function Wg(t,e,i){for(var n=0,r=t.length;n<r;++n)if(t[n].name===e){t[n]=y_,t=t.slice(0,n).concat(t.slice(n+1));break}return i!=null&&t.push({name:e,value:i}),t}var Lf="http://www.w3.org/1999/xhtml";const Yg={svg:"http://www.w3.org/2000/svg",xhtml:Lf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bc(t){var e=t+="",i=e.indexOf(":");return i>=0&&(e=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),Yg.hasOwnProperty(e)?{space:Yg[e],local:t}:t}function x_(t){return function(){var e=this.ownerDocument,i=this.namespaceURI;return i===Lf&&e.documentElement.namespaceURI===Lf?e.createElement(t):e.createElementNS(i,t)}}function b_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Qx(t){var e=Bc(t);return(e.local?b_:x_)(e)}function S_(){}function op(t){return t==null?S_:function(){return this.querySelector(t)}}function w_(t){typeof t!="function"&&(t=op(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,l=n[r]=new Array(a),u,h,c=0;c<a;++c)(u=s[c])&&(h=t.call(u,u.__data__,c,s))&&("__data__"in u&&(h.__data__=u.__data__),l[c]=h);return new xi(n,this._parents)}function P_(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function T_(){return[]}function Fx(t){return t==null?T_:function(){return this.querySelectorAll(t)}}function C_(t){return function(){return P_(t.apply(this,arguments))}}function k_(t){typeof t=="function"?t=C_(t):t=Fx(t);for(var e=this._groups,i=e.length,n=[],r=[],s=0;s<i;++s)for(var a=e[s],l=a.length,u,h=0;h<l;++h)(u=a[h])&&(n.push(t.call(u,u.__data__,h,a)),r.push(u));return new xi(n,r)}function Rx(t){return function(){return this.matches(t)}}function zx(t){return function(e){return e.matches(t)}}var E_=Array.prototype.find;function A_(t){return function(){return E_.call(this.children,t)}}function D_(){return this.firstElementChild}function __(t){return this.select(t==null?D_:A_(typeof t=="function"?t:zx(t)))}var I_=Array.prototype.filter;function N_(){return Array.from(this.children)}function M_(t){return function(){return I_.call(this.children,t)}}function $_(t){return this.selectAll(t==null?N_:M_(typeof t=="function"?t:zx(t)))}function L_(t){typeof t!="function"&&(t=Rx(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,l=n[r]=[],u,h=0;h<a;++h)(u=s[h])&&t.call(u,u.__data__,h,s)&&l.push(u);return new xi(n,this._parents)}function Xx(t){return new Array(t.length)}function B_(){return new xi(this._enter||this._groups.map(Xx),this._parents)}function Vu(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Vu.prototype={constructor:Vu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Q_(t){return function(){return t}}function F_(t,e,i,n,r,s){for(var a=0,l,u=e.length,h=s.length;a<h;++a)(l=e[a])?(l.__data__=s[a],n[a]=l):i[a]=new Vu(t,s[a]);for(;a<u;++a)(l=e[a])&&(r[a]=l)}function R_(t,e,i,n,r,s,a){var l,u,h=new Map,c=e.length,p=s.length,v=new Array(c),g;for(l=0;l<c;++l)(u=e[l])&&(v[l]=g=a.call(u,u.__data__,l,e)+"",h.has(g)?r[l]=u:h.set(g,u));for(l=0;l<p;++l)g=a.call(t,s[l],l,s)+"",(u=h.get(g))?(n[l]=u,u.__data__=s[l],h.delete(g)):i[l]=new Vu(t,s[l]);for(l=0;l<c;++l)(u=e[l])&&h.get(v[l])===u&&(r[l]=u)}function z_(t){return t.__data__}function X_(t,e){if(!arguments.length)return Array.from(this,z_);var i=e?R_:F_,n=this._parents,r=this._groups;typeof t!="function"&&(t=Q_(t));for(var s=r.length,a=new Array(s),l=new Array(s),u=new Array(s),h=0;h<s;++h){var c=n[h],p=r[h],v=p.length,g=j_(t.call(c,c&&c.__data__,h,n)),b=g.length,m=l[h]=new Array(b),x=a[h]=new Array(b),O=u[h]=new Array(v);i(c,p,m,x,O,g,e);for(var P=0,S=0,w,C;P<b;++P)if(w=m[P]){for(P>=S&&(S=P+1);!(C=x[S])&&++S<b;);w._next=C||null}}return a=new xi(a,n),a._enter=l,a._exit=u,a}function j_(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Z_(){return new xi(this._exit||this._groups.map(Xx),this._parents)}function V_(t,e,i){var n=this.enter(),r=this,s=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),i==null?s.remove():i(s),n&&r?n.merge(r).order():r}function U_(t){for(var e=t.selection?t.selection():t,i=this._groups,n=e._groups,r=i.length,s=n.length,a=Math.min(r,s),l=new Array(r),u=0;u<a;++u)for(var h=i[u],c=n[u],p=h.length,v=l[u]=new Array(p),g,b=0;b<p;++b)(g=h[b]||c[b])&&(v[b]=g);for(;u<r;++u)l[u]=i[u];return new xi(l,this._parents)}function q_(){for(var t=this._groups,e=-1,i=t.length;++e<i;)for(var n=t[e],r=n.length-1,s=n[r],a;--r>=0;)(a=n[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function W_(t){t||(t=Y_);function e(p,v){return p&&v?t(p.__data__,v.__data__):!p-!v}for(var i=this._groups,n=i.length,r=new Array(n),s=0;s<n;++s){for(var a=i[s],l=a.length,u=r[s]=new Array(l),h,c=0;c<l;++c)(h=a[c])&&(u[c]=h);u.sort(e)}return new xi(r,this._parents).order()}function Y_(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function G_(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function H_(){return Array.from(this)}function J_(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length;r<s;++r){var a=n[r];if(a)return a}return null}function K_(){let t=0;for(const e of this)++t;return t}function eI(){return!this.node()}function tI(t){for(var e=this._groups,i=0,n=e.length;i<n;++i)for(var r=e[i],s=0,a=r.length,l;s<a;++s)(l=r[s])&&t.call(l,l.__data__,s,r);return this}function iI(t){return function(){this.removeAttribute(t)}}function nI(t){return function(){this.removeAttributeNS(t.space,t.local)}}function rI(t,e){return function(){this.setAttribute(t,e)}}function sI(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function aI(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function oI(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function lI(t,e){var i=Bc(t);if(arguments.length<2){var n=this.node();return i.local?n.getAttributeNS(i.space,i.local):n.getAttribute(i)}return this.each((e==null?i.local?nI:iI:typeof e=="function"?i.local?oI:aI:i.local?sI:rI)(i,e))}function jx(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function uI(t){return function(){this.style.removeProperty(t)}}function cI(t,e,i){return function(){this.style.setProperty(t,e,i)}}function hI(t,e,i){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,i)}}function fI(t,e,i){return arguments.length>1?this.each((e==null?uI:typeof e=="function"?hI:cI)(t,e,i??"")):As(this.node(),t)}function As(t,e){return t.style.getPropertyValue(e)||jx(t).getComputedStyle(t,null).getPropertyValue(e)}function dI(t){return function(){delete this[t]}}function pI(t,e){return function(){this[t]=e}}function mI(t,e){return function(){var i=e.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function gI(t,e){return arguments.length>1?this.each((e==null?dI:typeof e=="function"?mI:pI)(t,e)):this.node()[t]}function Zx(t){return t.trim().split(/^|\s+/)}function lp(t){return t.classList||new Vx(t)}function Vx(t){this._node=t,this._names=Zx(t.getAttribute("class")||"")}Vx.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ux(t,e){for(var i=lp(t),n=-1,r=e.length;++n<r;)i.add(e[n])}function qx(t,e){for(var i=lp(t),n=-1,r=e.length;++n<r;)i.remove(e[n])}function yI(t){return function(){Ux(this,t)}}function vI(t){return function(){qx(this,t)}}function OI(t,e){return function(){(e.apply(this,arguments)?Ux:qx)(this,t)}}function xI(t,e){var i=Zx(t+"");if(arguments.length<2){for(var n=lp(this.node()),r=-1,s=i.length;++r<s;)if(!n.contains(i[r]))return!1;return!0}return this.each((typeof e=="function"?OI:e?yI:vI)(i,e))}function bI(){this.textContent=""}function SI(t){return function(){this.textContent=t}}function wI(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function PI(t){return arguments.length?this.each(t==null?bI:(typeof t=="function"?wI:SI)(t)):this.node().textContent}function TI(){this.innerHTML=""}function CI(t){return function(){this.innerHTML=t}}function kI(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function EI(t){return arguments.length?this.each(t==null?TI:(typeof t=="function"?kI:CI)(t)):this.node().innerHTML}function AI(){this.nextSibling&&this.parentNode.appendChild(this)}function DI(){return this.each(AI)}function _I(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function II(){return this.each(_I)}function NI(t){var e=typeof t=="function"?t:Qx(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function MI(){return null}function $I(t,e){var i=typeof t=="function"?t:Qx(t),n=e==null?MI:typeof e=="function"?e:op(e);return this.select(function(){return this.insertBefore(i.apply(this,arguments),n.apply(this,arguments)||null)})}function LI(){var t=this.parentNode;t&&t.removeChild(this)}function BI(){return this.each(LI)}function QI(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function FI(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function RI(t){return this.select(t?FI:QI)}function zI(t){return arguments.length?this.property("__data__",t):this.node().__data__}function XI(t){return function(e){t.call(this,e,this.__data__)}}function jI(t){return t.trim().split(/^|\s+/).map(function(e){var i="",n=e.indexOf(".");return n>=0&&(i=e.slice(n+1),e=e.slice(0,n)),{type:e,name:i}})}function ZI(t){return function(){var e=this.__on;if(e){for(var i=0,n=-1,r=e.length,s;i<r;++i)s=e[i],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++n]=s;++n?e.length=n:delete this.__on}}}function VI(t,e,i){return function(){var n=this.__on,r,s=XI(e);if(n){for(var a=0,l=n.length;a<l;++a)if((r=n[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=e;return}}this.addEventListener(t.type,s,i),r={type:t.type,name:t.name,value:e,listener:s,options:i},n?n.push(r):this.__on=[r]}}function UI(t,e,i){var n=jI(t+""),r,s=n.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,h=l.length,c;u<h;++u)for(r=0,c=l[u];r<s;++r)if((a=n[r]).type===c.type&&a.name===c.name)return c.value}return}for(l=e?VI:ZI,r=0;r<s;++r)this.each(l(n[r],e,i));return this}function Wx(t,e,i){var n=jx(t),r=n.CustomEvent;typeof r=="function"?r=new r(e,i):(r=n.document.createEvent("Event"),i?(r.initEvent(e,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function qI(t,e){return function(){return Wx(this,t,e)}}function WI(t,e){return function(){return Wx(this,t,e.apply(this,arguments))}}function YI(t,e){return this.each((typeof e=="function"?WI:qI)(t,e))}function*GI(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length,a;r<s;++r)(a=n[r])&&(yield a)}var Yx=[null];function xi(t,e){this._groups=t,this._parents=e}function Ko(){return new xi([[document.documentElement]],Yx)}function HI(){return this}xi.prototype=Ko.prototype={constructor:xi,select:w_,selectAll:k_,selectChild:__,selectChildren:$_,filter:L_,data:X_,enter:B_,exit:Z_,join:V_,merge:U_,selection:HI,order:q_,sort:W_,call:G_,nodes:H_,node:J_,size:K_,empty:eI,each:tI,attr:lI,style:fI,property:gI,classed:xI,text:PI,html:EI,raise:DI,lower:II,append:NI,insert:$I,remove:BI,clone:RI,datum:zI,on:UI,dispatch:YI,[Symbol.iterator]:GI};function Gn(t){return typeof t=="string"?new xi([[document.querySelector(t)]],[document.documentElement]):new xi([[t]],Yx)}function JI(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Zn(t,e){if(t=JI(t),e===void 0&&(e=t.currentTarget),e){var i=e.ownerSVGElement||e;if(i.createSVGPoint){var n=i.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const Bf={capture:!0,passive:!1};function Qf(t){t.preventDefault(),t.stopImmediatePropagation()}function KI(t){var e=t.document.documentElement,i=Gn(t).on("dragstart.drag",Qf,Bf);"onselectstart"in e?i.on("selectstart.drag",Qf,Bf):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function eN(t,e){var i=t.document.documentElement,n=Gn(t).on("dragstart.drag",null);e&&(n.on("click.drag",Qf,Bf),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in i?n.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}function up(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function Gx(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function el(){}var Co=.7,Uu=1/Co,ms="\\s*([+-]?\\d+)\\s*",ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tN=/^#([0-9a-f]{3,8})$/,iN=new RegExp(`^rgb\\(${ms},${ms},${ms}\\)$`),nN=new RegExp(`^rgb\\(${cn},${cn},${cn}\\)$`),rN=new RegExp(`^rgba\\(${ms},${ms},${ms},${ko}\\)$`),sN=new RegExp(`^rgba\\(${cn},${cn},${cn},${ko}\\)$`),aN=new RegExp(`^hsl\\(${ko},${cn},${cn}\\)$`),oN=new RegExp(`^hsla\\(${ko},${cn},${cn},${ko}\\)$`),Gg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};up(el,Eo,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Hg,formatHex:Hg,formatHex8:lN,formatHsl:uN,formatRgb:Jg,toString:Jg});function Hg(){return this.rgb().formatHex()}function lN(){return this.rgb().formatHex8()}function uN(){return Hx(this).formatHsl()}function Jg(){return this.rgb().formatRgb()}function Eo(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=tN.exec(t))?(i=e[1].length,e=parseInt(e[1],16),i===6?Kg(e):i===3?new oi(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):i===8?Ll(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):i===4?Ll(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=iN.exec(t))?new oi(e[1],e[2],e[3],1):(e=nN.exec(t))?new oi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=rN.exec(t))?Ll(e[1],e[2],e[3],e[4]):(e=sN.exec(t))?Ll(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=aN.exec(t))?iy(e[1],e[2]/100,e[3]/100,1):(e=oN.exec(t))?iy(e[1],e[2]/100,e[3]/100,e[4]):Gg.hasOwnProperty(t)?Kg(Gg[t]):t==="transparent"?new oi(NaN,NaN,NaN,0):null}function Kg(t){return new oi(t>>16&255,t>>8&255,t&255,1)}function Ll(t,e,i,n){return n<=0&&(t=e=i=NaN),new oi(t,e,i,n)}function cN(t){return t instanceof el||(t=Eo(t)),t?(t=t.rgb(),new oi(t.r,t.g,t.b,t.opacity)):new oi}function Ff(t,e,i,n){return arguments.length===1?cN(t):new oi(t,e,i,n??1)}function oi(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}up(oi,Ff,Gx(el,{brighter(t){return t=t==null?Uu:Math.pow(Uu,t),new oi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Co:Math.pow(Co,t),new oi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oi(Br(this.r),Br(this.g),Br(this.b),qu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ey,formatHex:ey,formatHex8:hN,formatRgb:ty,toString:ty}));function ey(){return`#${_r(this.r)}${_r(this.g)}${_r(this.b)}`}function hN(){return`#${_r(this.r)}${_r(this.g)}${_r(this.b)}${_r((isNaN(this.opacity)?1:this.opacity)*255)}`}function ty(){const t=qu(this.opacity);return`${t===1?"rgb(":"rgba("}${Br(this.r)}, ${Br(this.g)}, ${Br(this.b)}${t===1?")":`, ${t})`}`}function qu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Br(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _r(t){return t=Br(t),(t<16?"0":"")+t.toString(16)}function iy(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new Ii(t,e,i,n)}function Hx(t){if(t instanceof Ii)return new Ii(t.h,t.s,t.l,t.opacity);if(t instanceof el||(t=Eo(t)),!t)return new Ii;if(t instanceof Ii)return t;t=t.rgb();var e=t.r/255,i=t.g/255,n=t.b/255,r=Math.min(e,i,n),s=Math.max(e,i,n),a=NaN,l=s-r,u=(s+r)/2;return l?(e===s?a=(i-n)/l+(i<n)*6:i===s?a=(n-e)/l+2:a=(e-i)/l+4,l/=u<.5?s+r:2-s-r,a*=60):l=u>0&&u<1?0:a,new Ii(a,l,u,t.opacity)}function fN(t,e,i,n){return arguments.length===1?Hx(t):new Ii(t,e,i,n??1)}function Ii(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}up(Ii,fN,Gx(el,{brighter(t){return t=t==null?Uu:Math.pow(Uu,t),new Ii(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Co:Math.pow(Co,t),new Ii(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,r=2*i-n;return new oi(Ph(t>=240?t-240:t+120,r,n),Ph(t,r,n),Ph(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new Ii(ny(this.h),Bl(this.s),Bl(this.l),qu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=qu(this.opacity);return`${t===1?"hsl(":"hsla("}${ny(this.h)}, ${Bl(this.s)*100}%, ${Bl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ny(t){return t=(t||0)%360,t<0?t+360:t}function Bl(t){return Math.max(0,Math.min(1,t||0))}function Ph(t,e,i){return(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)*255}const Jx=t=>()=>t;function dN(t,e){return function(i){return t+i*e}}function pN(t,e,i){return t=Math.pow(t,i),e=Math.pow(e,i)-t,i=1/i,function(n){return Math.pow(t+n*e,i)}}function mN(t){return(t=+t)==1?Kx:function(e,i){return i-e?pN(e,i,t):Jx(isNaN(e)?i:e)}}function Kx(t,e){var i=e-t;return i?dN(t,i):Jx(isNaN(t)?e:t)}const ry=(function t(e){var i=mN(e);function n(r,s){var a=i((r=Ff(r)).r,(s=Ff(s)).r),l=i(r.g,s.g),u=i(r.b,s.b),h=Kx(r.opacity,s.opacity);return function(c){return r.r=a(c),r.g=l(c),r.b=u(c),r.opacity=h(c),r+""}}return n.gamma=t,n})(1);function qn(t,e){return t=+t,e=+e,function(i){return t*(1-i)+e*i}}var Rf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Th=new RegExp(Rf.source,"g");function gN(t){return function(){return t}}function yN(t){return function(e){return t(e)+""}}function vN(t,e){var i=Rf.lastIndex=Th.lastIndex=0,n,r,s,a=-1,l=[],u=[];for(t=t+"",e=e+"";(n=Rf.exec(t))&&(r=Th.exec(e));)(s=r.index)>i&&(s=e.slice(i,s),l[a]?l[a]+=s:l[++a]=s),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,u.push({i:a,x:qn(n,r)})),i=Th.lastIndex;return i<e.length&&(s=e.slice(i),l[a]?l[a]+=s:l[++a]=s),l.length<2?u[0]?yN(u[0].x):gN(e):(e=u.length,function(h){for(var c=0,p;c<e;++c)l[(p=u[c]).i]=p.x(h);return l.join("")})}var sy=180/Math.PI,zf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eb(t,e,i,n,r,s){var a,l,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*i+e*n)&&(i-=t*u,n-=e*u),(l=Math.sqrt(i*i+n*n))&&(i/=l,n/=l,u/=l),t*n<e*i&&(t=-t,e=-e,u=-u,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*sy,skewX:Math.atan(u)*sy,scaleX:a,scaleY:l}}var Ql;function ON(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?zf:eb(e.a,e.b,e.c,e.d,e.e,e.f)}function xN(t){return t==null||(Ql||(Ql=document.createElementNS("http://www.w3.org/2000/svg","g")),Ql.setAttribute("transform",t),!(t=Ql.transform.baseVal.consolidate()))?zf:(t=t.matrix,eb(t.a,t.b,t.c,t.d,t.e,t.f))}function tb(t,e,i,n){function r(h){return h.length?h.pop()+" ":""}function s(h,c,p,v,g,b){if(h!==p||c!==v){var m=g.push("translate(",null,e,null,i);b.push({i:m-4,x:qn(h,p)},{i:m-2,x:qn(c,v)})}else(p||v)&&g.push("translate("+p+e+v+i)}function a(h,c,p,v){h!==c?(h-c>180?c+=360:c-h>180&&(h+=360),v.push({i:p.push(r(p)+"rotate(",null,n)-2,x:qn(h,c)})):c&&p.push(r(p)+"rotate("+c+n)}function l(h,c,p,v){h!==c?v.push({i:p.push(r(p)+"skewX(",null,n)-2,x:qn(h,c)}):c&&p.push(r(p)+"skewX("+c+n)}function u(h,c,p,v,g,b){if(h!==p||c!==v){var m=g.push(r(g)+"scale(",null,",",null,")");b.push({i:m-4,x:qn(h,p)},{i:m-2,x:qn(c,v)})}else(p!==1||v!==1)&&g.push(r(g)+"scale("+p+","+v+")")}return function(h,c){var p=[],v=[];return h=t(h),c=t(c),s(h.translateX,h.translateY,c.translateX,c.translateY,p,v),a(h.rotate,c.rotate,p,v),l(h.skewX,c.skewX,p,v),u(h.scaleX,h.scaleY,c.scaleX,c.scaleY,p,v),h=c=null,function(g){for(var b=-1,m=v.length,x;++b<m;)p[(x=v[b]).i]=x.x(g);return p.join("")}}}var bN=tb(ON,"px, ","px)","deg)"),SN=tb(xN,", ",")",")"),wN=1e-12;function ay(t){return((t=Math.exp(t))+1/t)/2}function PN(t){return((t=Math.exp(t))-1/t)/2}function TN(t){return((t=Math.exp(2*t))-1)/(t+1)}const CN=(function t(e,i,n){function r(s,a){var l=s[0],u=s[1],h=s[2],c=a[0],p=a[1],v=a[2],g=c-l,b=p-u,m=g*g+b*b,x,O;if(m<wN)O=Math.log(v/h)/e,x=function(k){return[l+k*g,u+k*b,h*Math.exp(e*k*O)]};else{var P=Math.sqrt(m),S=(v*v-h*h+n*m)/(2*h*i*P),w=(v*v-h*h-n*m)/(2*v*i*P),C=Math.log(Math.sqrt(S*S+1)-S),E=Math.log(Math.sqrt(w*w+1)-w);O=(E-C)/e,x=function(k){var A=k*O,$=ay(C),F=h/(i*P)*($*TN(e*A+C)-PN(C));return[l+F*g,u+F*b,h*$/ay(e*A+C)]}}return x.duration=O*1e3*e/Math.SQRT2,x}return r.rho=function(s){var a=Math.max(.001,+s),l=a*a,u=l*l;return t(a,l,u)},r})(Math.SQRT2,2,4);var Ds=0,Sa=0,sa=0,ib=1e3,Wu,wa,Yu=0,Ur=0,Qc=0,Ao=typeof performance=="object"&&performance.now?performance:Date,nb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function cp(){return Ur||(nb(kN),Ur=Ao.now()+Qc)}function kN(){Ur=0}function Gu(){this._call=this._time=this._next=null}Gu.prototype=rb.prototype={constructor:Gu,restart:function(t,e,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?cp():+i)+(e==null?0:+e),!this._next&&wa!==this&&(wa?wa._next=this:Wu=this,wa=this),this._call=t,this._time=i,Xf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xf())}};function rb(t,e,i){var n=new Gu;return n.restart(t,e,i),n}function EN(){cp(),++Ds;for(var t=Wu,e;t;)(e=Ur-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Ds}function oy(){Ur=(Yu=Ao.now())+Qc,Ds=Sa=0;try{EN()}finally{Ds=0,DN(),Ur=0}}function AN(){var t=Ao.now(),e=t-Yu;e>ib&&(Qc-=e,Yu=t)}function DN(){for(var t,e=Wu,i,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(i=e._next,e._next=null,e=t?t._next=i:Wu=i);wa=t,Xf(n)}function Xf(t){if(!Ds){Sa&&(Sa=clearTimeout(Sa));var e=t-Ur;e>24?(t<1/0&&(Sa=setTimeout(oy,t-Ao.now()-Qc)),sa&&(sa=clearInterval(sa))):(sa||(Yu=Ao.now(),sa=setInterval(AN,ib)),Ds=1,nb(oy))}}function ly(t,e,i){var n=new Gu;return e=e==null?0:+e,n.restart(r=>{n.stop(),t(r+e)},e,i),n}var _N=ap("start","end","cancel","interrupt"),IN=[],sb=0,uy=1,jf=2,bu=3,cy=4,Zf=5,Su=6;function Fc(t,e,i,n,r,s){var a=t.__transition;if(!a)t.__transition={};else if(i in a)return;NN(t,i,{name:e,index:n,group:r,on:_N,tween:IN,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:sb})}function hp(t,e){var i=Fi(t,e);if(i.state>sb)throw new Error("too late; already scheduled");return i}function pn(t,e){var i=Fi(t,e);if(i.state>bu)throw new Error("too late; already running");return i}function Fi(t,e){var i=t.__transition;if(!i||!(i=i[e]))throw new Error("transition not found");return i}function NN(t,e,i){var n=t.__transition,r;n[e]=i,i.timer=rb(s,0,i.time);function s(h){i.state=uy,i.timer.restart(a,i.delay,i.time),i.delay<=h&&a(h-i.delay)}function a(h){var c,p,v,g;if(i.state!==uy)return u();for(c in n)if(g=n[c],g.name===i.name){if(g.state===bu)return ly(a);g.state===cy?(g.state=Su,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete n[c]):+c<e&&(g.state=Su,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete n[c])}if(ly(function(){i.state===bu&&(i.state=cy,i.timer.restart(l,i.delay,i.time),l(h))}),i.state=jf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===jf){for(i.state=bu,r=new Array(v=i.tween.length),c=0,p=-1;c<v;++c)(g=i.tween[c].value.call(t,t.__data__,i.index,i.group))&&(r[++p]=g);r.length=p+1}}function l(h){for(var c=h<i.duration?i.ease.call(null,h/i.duration):(i.timer.restart(u),i.state=Zf,1),p=-1,v=r.length;++p<v;)r[p].call(t,c);i.state===Zf&&(i.on.call("end",t,t.__data__,i.index,i.group),u())}function u(){i.state=Su,i.timer.stop(),delete n[e];for(var h in n)return;delete t.__transition}}function wu(t,e){var i=t.__transition,n,r,s=!0,a;if(i){e=e==null?null:e+"";for(a in i){if((n=i[a]).name!==e){s=!1;continue}r=n.state>jf&&n.state<Zf,n.state=Su,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[a]}s&&delete t.__transition}}function MN(t){return this.each(function(){wu(this,t)})}function $N(t,e){var i,n;return function(){var r=pn(this,t),s=r.tween;if(s!==i){n=i=s;for(var a=0,l=n.length;a<l;++a)if(n[a].name===e){n=n.slice(),n.splice(a,1);break}}r.tween=n}}function LN(t,e,i){var n,r;if(typeof i!="function")throw new Error;return function(){var s=pn(this,t),a=s.tween;if(a!==n){r=(n=a).slice();for(var l={name:e,value:i},u=0,h=r.length;u<h;++u)if(r[u].name===e){r[u]=l;break}u===h&&r.push(l)}s.tween=r}}function BN(t,e){var i=this._id;if(t+="",arguments.length<2){for(var n=Fi(this.node(),i).tween,r=0,s=n.length,a;r<s;++r)if((a=n[r]).name===t)return a.value;return null}return this.each((e==null?$N:LN)(i,t,e))}function fp(t,e,i){var n=t._id;return t.each(function(){var r=pn(this,n);(r.value||(r.value={}))[e]=i.apply(this,arguments)}),function(r){return Fi(r,n).value[e]}}function ab(t,e){var i;return(typeof e=="number"?qn:e instanceof Eo?ry:(i=Eo(e))?(e=i,ry):vN)(t,e)}function QN(t){return function(){this.removeAttribute(t)}}function FN(t){return function(){this.removeAttributeNS(t.space,t.local)}}function RN(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttribute(t);return a===r?null:a===n?s:s=e(n=a,i)}}function zN(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===r?null:a===n?s:s=e(n=a,i)}}function XN(t,e,i){var n,r,s;return function(){var a,l=i(this),u;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=l+"",a===u?null:a===n&&u===r?s:(r=u,s=e(n=a,l)))}}function jN(t,e,i){var n,r,s;return function(){var a,l=i(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=l+"",a===u?null:a===n&&u===r?s:(r=u,s=e(n=a,l)))}}function ZN(t,e){var i=Bc(t),n=i==="transform"?SN:ab;return this.attrTween(t,typeof e=="function"?(i.local?jN:XN)(i,n,fp(this,"attr."+t,e)):e==null?(i.local?FN:QN)(i):(i.local?zN:RN)(i,n,e))}function VN(t,e){return function(i){this.setAttribute(t,e.call(this,i))}}function UN(t,e){return function(i){this.setAttributeNS(t.space,t.local,e.call(this,i))}}function qN(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&UN(t,s)),i}return r._value=e,r}function WN(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&VN(t,s)),i}return r._value=e,r}function YN(t,e){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;var n=Bc(t);return this.tween(i,(n.local?qN:WN)(n,e))}function GN(t,e){return function(){hp(this,t).delay=+e.apply(this,arguments)}}function HN(t,e){return e=+e,function(){hp(this,t).delay=e}}function JN(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?GN:HN)(e,t)):Fi(this.node(),e).delay}function KN(t,e){return function(){pn(this,t).duration=+e.apply(this,arguments)}}function eM(t,e){return e=+e,function(){pn(this,t).duration=e}}function tM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?KN:eM)(e,t)):Fi(this.node(),e).duration}function iM(t,e){if(typeof e!="function")throw new Error;return function(){pn(this,t).ease=e}}function nM(t){var e=this._id;return arguments.length?this.each(iM(e,t)):Fi(this.node(),e).ease}function rM(t,e){return function(){var i=e.apply(this,arguments);if(typeof i!="function")throw new Error;pn(this,t).ease=i}}function sM(t){if(typeof t!="function")throw new Error;return this.each(rM(this._id,t))}function aM(t){typeof t!="function"&&(t=Rx(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,l=n[r]=[],u,h=0;h<a;++h)(u=s[h])&&t.call(u,u.__data__,h,s)&&l.push(u);return new _n(n,this._parents,this._name,this._id)}function oM(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,i=t._groups,n=e.length,r=i.length,s=Math.min(n,r),a=new Array(n),l=0;l<s;++l)for(var u=e[l],h=i[l],c=u.length,p=a[l]=new Array(c),v,g=0;g<c;++g)(v=u[g]||h[g])&&(p[g]=v);for(;l<n;++l)a[l]=e[l];return new _n(a,this._parents,this._name,this._id)}function lM(t){return(t+"").trim().split(/^|\s+/).every(function(e){var i=e.indexOf(".");return i>=0&&(e=e.slice(0,i)),!e||e==="start"})}function uM(t,e,i){var n,r,s=lM(e)?hp:pn;return function(){var a=s(this,t),l=a.on;l!==n&&(r=(n=l).copy()).on(e,i),a.on=r}}function cM(t,e){var i=this._id;return arguments.length<2?Fi(this.node(),i).on.on(t):this.each(uM(i,t,e))}function hM(t){return function(){var e=this.parentNode;for(var i in this.__transition)if(+i!==t)return;e&&e.removeChild(this)}}function fM(){return this.on("end.remove",hM(this._id))}function dM(t){var e=this._name,i=this._id;typeof t!="function"&&(t=op(t));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var l=n[a],u=l.length,h=s[a]=new Array(u),c,p,v=0;v<u;++v)(c=l[v])&&(p=t.call(c,c.__data__,v,l))&&("__data__"in c&&(p.__data__=c.__data__),h[v]=p,Fc(h[v],e,i,v,h,Fi(c,i)));return new _n(s,this._parents,e,i)}function pM(t){var e=this._name,i=this._id;typeof t!="function"&&(t=Fx(t));for(var n=this._groups,r=n.length,s=[],a=[],l=0;l<r;++l)for(var u=n[l],h=u.length,c,p=0;p<h;++p)if(c=u[p]){for(var v=t.call(c,c.__data__,p,u),g,b=Fi(c,i),m=0,x=v.length;m<x;++m)(g=v[m])&&Fc(g,e,i,m,v,b);s.push(v),a.push(c)}return new _n(s,a,e,i)}var mM=Ko.prototype.constructor;function gM(){return new mM(this._groups,this._parents)}function yM(t,e){var i,n,r;return function(){var s=As(this,t),a=(this.style.removeProperty(t),As(this,t));return s===a?null:s===i&&a===n?r:r=e(i=s,n=a)}}function ob(t){return function(){this.style.removeProperty(t)}}function vM(t,e,i){var n,r=i+"",s;return function(){var a=As(this,t);return a===r?null:a===n?s:s=e(n=a,i)}}function OM(t,e,i){var n,r,s;return function(){var a=As(this,t),l=i(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),As(this,t))),a===u?null:a===n&&u===r?s:(r=u,s=e(n=a,l))}}function xM(t,e){var i,n,r,s="style."+e,a="end."+s,l;return function(){var u=pn(this,t),h=u.on,c=u.value[s]==null?l||(l=ob(e)):void 0;(h!==i||r!==c)&&(n=(i=h).copy()).on(a,r=c),u.on=n}}function bM(t,e,i){var n=(t+="")=="transform"?bN:ab;return e==null?this.styleTween(t,yM(t,n)).on("end.style."+t,ob(t)):typeof e=="function"?this.styleTween(t,OM(t,n,fp(this,"style."+t,e))).each(xM(this._id,t)):this.styleTween(t,vM(t,n,e),i).on("end.style."+t,null)}function SM(t,e,i){return function(n){this.style.setProperty(t,e.call(this,n),i)}}function wM(t,e,i){var n,r;function s(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&SM(t,a,i)),n}return s._value=e,s}function PM(t,e,i){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,wM(t,e,i??""))}function TM(t){return function(){this.textContent=t}}function CM(t){return function(){var e=t(this);this.textContent=e??""}}function kM(t){return this.tween("text",typeof t=="function"?CM(fp(this,"text",t)):TM(t==null?"":t+""))}function EM(t){return function(e){this.textContent=t.call(this,e)}}function AM(t){var e,i;function n(){var r=t.apply(this,arguments);return r!==i&&(e=(i=r)&&EM(r)),e}return n._value=t,n}function DM(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,AM(t))}function _M(){for(var t=this._name,e=this._id,i=lb(),n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],l=a.length,u,h=0;h<l;++h)if(u=a[h]){var c=Fi(u,e);Fc(u,t,i,h,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new _n(n,this._parents,t,i)}function IM(){var t,e,i=this,n=i._id,r=i.size();return new Promise(function(s,a){var l={value:a},u={value:function(){--r===0&&s()}};i.each(function(){var h=pn(this,n),c=h.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),h.on=e}),r===0&&s()})}var NM=0;function _n(t,e,i,n){this._groups=t,this._parents=e,this._name=i,this._id=n}function lb(){return++NM}var Sn=Ko.prototype;_n.prototype={constructor:_n,select:dM,selectAll:pM,selectChild:Sn.selectChild,selectChildren:Sn.selectChildren,filter:aM,merge:oM,selection:gM,transition:_M,call:Sn.call,nodes:Sn.nodes,node:Sn.node,size:Sn.size,empty:Sn.empty,each:Sn.each,on:cM,attr:ZN,attrTween:YN,style:bM,styleTween:PM,text:kM,textTween:DM,remove:fM,tween:BN,delay:JN,duration:tM,ease:nM,easeVarying:sM,end:IM,[Symbol.iterator]:Sn[Symbol.iterator]};function MM(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $M={time:null,delay:0,duration:250,ease:MM};function LM(t,e){for(var i;!(i=t.__transition)||!(i=i[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return i}function BM(t){var e,i;t instanceof _n?(e=t._id,t=t._name):(e=lb(),(i=$M).time=cp(),t=t==null?null:t+"");for(var n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],l=a.length,u,h=0;h<l;++h)(u=a[h])&&Fc(u,t,e,h,a,i||LM(u,e));return new _n(n,this._parents,t,e)}Ko.prototype.interrupt=MN;Ko.prototype.transition=BM;const Fl=t=>()=>t;function QM(t,{sourceEvent:e,target:i,transform:n,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:r}})}function En(t,e,i){this.k=t,this.x=e,this.y=i}En.prototype={constructor:En,scale:function(t){return t===1?this:new En(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new En(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var dp=new En(1,0,0);En.prototype;function Ch(t){t.stopImmediatePropagation()}function aa(t){t.preventDefault(),t.stopImmediatePropagation()}function FM(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function RM(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function hy(){return this.__zoom||dp}function zM(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function XM(){return navigator.maxTouchPoints||"ontouchstart"in this}function jM(t,e,i){var n=t.invertX(e[0][0])-i[0][0],r=t.invertX(e[1][0])-i[1][0],s=t.invertY(e[0][1])-i[0][1],a=t.invertY(e[1][1])-i[1][1];return t.translate(r>n?(n+r)/2:Math.min(0,n)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function ZM(){var t=FM,e=RM,i=jM,n=zM,r=XM,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,u=CN,h=ap("start","zoom","end"),c,p,v,g=500,b=150,m=0,x=10;function O(M){M.property("__zoom",hy).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",F).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}O.transform=function(M,q,X,Y){var V=M.selection?M.selection():M;V.property("__zoom",hy),M!==V?C(M,q,X,Y):V.interrupt().each(function(){E(this,arguments).event(Y).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},O.scaleBy=function(M,q,X,Y){O.scaleTo(M,function(){var V=this.__zoom.k,oe=typeof q=="function"?q.apply(this,arguments):q;return V*oe},X,Y)},O.scaleTo=function(M,q,X,Y){O.transform(M,function(){var V=e.apply(this,arguments),oe=this.__zoom,ae=X==null?w(V):typeof X=="function"?X.apply(this,arguments):X,fe=oe.invert(ae),D=typeof q=="function"?q.apply(this,arguments):q;return i(S(P(oe,D),ae,fe),V,a)},X,Y)},O.translateBy=function(M,q,X,Y){O.transform(M,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof X=="function"?X.apply(this,arguments):X),e.apply(this,arguments),a)},null,Y)},O.translateTo=function(M,q,X,Y,V){O.transform(M,function(){var oe=e.apply(this,arguments),ae=this.__zoom,fe=Y==null?w(oe):typeof Y=="function"?Y.apply(this,arguments):Y;return i(dp.translate(fe[0],fe[1]).scale(ae.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof X=="function"?-X.apply(this,arguments):-X),oe,a)},Y,V)};function P(M,q){return q=Math.max(s[0],Math.min(s[1],q)),q===M.k?M:new En(q,M.x,M.y)}function S(M,q,X){var Y=q[0]-X[0]*M.k,V=q[1]-X[1]*M.k;return Y===M.x&&V===M.y?M:new En(M.k,Y,V)}function w(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function C(M,q,X,Y){M.on("start.zoom",function(){E(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(Y).end()}).tween("zoom",function(){var V=this,oe=arguments,ae=E(V,oe).event(Y),fe=e.apply(V,oe),D=X==null?w(fe):typeof X=="function"?X.apply(V,oe):X,Z=Math.max(fe[1][0]-fe[0][0],fe[1][1]-fe[0][1]),L=V.__zoom,se=typeof q=="function"?q.apply(V,oe):q,de=u(L.invert(D).concat(Z/L.k),se.invert(D).concat(Z/se.k));return function(ie){if(ie===1)ie=se;else{var R=de(ie),Q=Z/R[2];ie=new En(Q,D[0]-R[0]*Q,D[1]-R[1]*Q)}ae.zoom(null,ie)}})}function E(M,q,X){return!X&&M.__zooming||new k(M,q)}function k(M,q){this.that=M,this.args=q,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,q),this.taps=0}k.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,q){return this.mouse&&M!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var q=Gn(this.that).datum();h.call(M,this.that,new QM(M,{sourceEvent:this.sourceEvent,target:O,transform:this.that.__zoom,dispatch:h}),q)}};function A(M,...q){if(!t.apply(this,arguments))return;var X=E(this,q).event(M),Y=this.__zoom,V=Math.max(s[0],Math.min(s[1],Y.k*Math.pow(2,n.apply(this,arguments)))),oe=Zn(M);if(X.wheel)(X.mouse[0][0]!==oe[0]||X.mouse[0][1]!==oe[1])&&(X.mouse[1]=Y.invert(X.mouse[0]=oe)),clearTimeout(X.wheel);else{if(Y.k===V)return;X.mouse=[oe,Y.invert(oe)],wu(this),X.start()}aa(M),X.wheel=setTimeout(ae,b),X.zoom("mouse",i(S(P(Y,V),X.mouse[0],X.mouse[1]),X.extent,a));function ae(){X.wheel=null,X.end()}}function $(M,...q){if(v||!t.apply(this,arguments))return;var X=M.currentTarget,Y=E(this,q,!0).event(M),V=Gn(M.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",Z,!0),oe=Zn(M,X),ae=M.clientX,fe=M.clientY;KI(M.view),Ch(M),Y.mouse=[oe,this.__zoom.invert(oe)],wu(this),Y.start();function D(L){if(aa(L),!Y.moved){var se=L.clientX-ae,de=L.clientY-fe;Y.moved=se*se+de*de>m}Y.event(L).zoom("mouse",i(S(Y.that.__zoom,Y.mouse[0]=Zn(L,X),Y.mouse[1]),Y.extent,a))}function Z(L){V.on("mousemove.zoom mouseup.zoom",null),eN(L.view,Y.moved),aa(L),Y.event(L).end()}}function F(M,...q){if(t.apply(this,arguments)){var X=this.__zoom,Y=Zn(M.changedTouches?M.changedTouches[0]:M,this),V=X.invert(Y),oe=X.k*(M.shiftKey?.5:2),ae=i(S(P(X,oe),Y,V),e.apply(this,q),a);aa(M),l>0?Gn(this).transition().duration(l).call(C,ae,Y,M):Gn(this).call(O.transform,ae,Y,M)}}function I(M,...q){if(t.apply(this,arguments)){var X=M.touches,Y=X.length,V=E(this,q,M.changedTouches.length===Y).event(M),oe,ae,fe,D;for(Ch(M),ae=0;ae<Y;++ae)fe=X[ae],D=Zn(fe,this),D=[D,this.__zoom.invert(D),fe.identifier],V.touch0?!V.touch1&&V.touch0[2]!==D[2]&&(V.touch1=D,V.taps=0):(V.touch0=D,oe=!0,V.taps=1+!!c);c&&(c=clearTimeout(c)),oe&&(V.taps<2&&(p=D[0],c=setTimeout(function(){c=null},g)),wu(this),V.start())}}function B(M,...q){if(this.__zooming){var X=E(this,q).event(M),Y=M.changedTouches,V=Y.length,oe,ae,fe,D;for(aa(M),oe=0;oe<V;++oe)ae=Y[oe],fe=Zn(ae,this),X.touch0&&X.touch0[2]===ae.identifier?X.touch0[0]=fe:X.touch1&&X.touch1[2]===ae.identifier&&(X.touch1[0]=fe);if(ae=X.that.__zoom,X.touch1){var Z=X.touch0[0],L=X.touch0[1],se=X.touch1[0],de=X.touch1[1],ie=(ie=se[0]-Z[0])*ie+(ie=se[1]-Z[1])*ie,R=(R=de[0]-L[0])*R+(R=de[1]-L[1])*R;ae=P(ae,Math.sqrt(ie/R)),fe=[(Z[0]+se[0])/2,(Z[1]+se[1])/2],D=[(L[0]+de[0])/2,(L[1]+de[1])/2]}else if(X.touch0)fe=X.touch0[0],D=X.touch0[1];else return;X.zoom("touch",i(S(ae,fe,D),X.extent,a))}}function j(M,...q){if(this.__zooming){var X=E(this,q).event(M),Y=M.changedTouches,V=Y.length,oe,ae;for(Ch(M),v&&clearTimeout(v),v=setTimeout(function(){v=null},g),oe=0;oe<V;++oe)ae=Y[oe],X.touch0&&X.touch0[2]===ae.identifier?delete X.touch0:X.touch1&&X.touch1[2]===ae.identifier&&delete X.touch1;if(X.touch1&&!X.touch0&&(X.touch0=X.touch1,delete X.touch1),X.touch0)X.touch0[1]=this.__zoom.invert(X.touch0[0]);else if(X.end(),X.taps===2&&(ae=Zn(ae,this),Math.hypot(p[0]-ae[0],p[1]-ae[1])<x)){var fe=Gn(this).on("dblclick.zoom");fe&&fe.apply(this,arguments)}}}return O.wheelDelta=function(M){return arguments.length?(n=typeof M=="function"?M:Fl(+M),O):n},O.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Fl(!!M),O):t},O.touchable=function(M){return arguments.length?(r=typeof M=="function"?M:Fl(!!M),O):r},O.extent=function(M){return arguments.length?(e=typeof M=="function"?M:Fl([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),O):e},O.scaleExtent=function(M){return arguments.length?(s[0]=+M[0],s[1]=+M[1],O):[s[0],s[1]]},O.translateExtent=function(M){return arguments.length?(a[0][0]=+M[0][0],a[1][0]=+M[1][0],a[0][1]=+M[0][1],a[1][1]=+M[1][1],O):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},O.constrain=function(M){return arguments.length?(i=M,O):i},O.duration=function(M){return arguments.length?(l=+M,O):l},O.interpolate=function(M){return arguments.length?(u=M,O):u},O.on=function(){var M=h.on.apply(h,arguments);return M===h?O:M},O.clickDistance=function(M){return arguments.length?(m=(M=+M)*M,O):Math.sqrt(m)},O.tapDistance=function(M){return arguments.length?(x=+M,O):x},O}const ub=Symbol("MiniMapSlots"),VM=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],UM={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},qM=ot({...UM,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(t,{emit:e}){const i=t,n=cr(ub),r=Vd(),s=lt(()=>r.style??{});function a(p){e("click",p)}function l(p){e("dblclick",p)}function u(p){e("mouseenter",p)}function h(p){e("mousemove",p)}function c(p){e("mouseleave",p)}return(p,v)=>!p.hidden&&p.dimensions.width!==0&&p.dimensions.height!==0?(ye(),be(gt,{key:0},[Se(n)[`node-${i.type}`]?(ye(),Ct(wr(Se(n)[`node-${i.type}`]),oT(Mu({key:0},{...i,...p.$attrs})),null,16)):(ye(),be("rect",Mu({key:1,id:p.id},p.$attrs,{class:["vue-flow__minimap-node",{selected:p.selected,dragging:p.dragging}],x:p.position.x,y:p.position.y,rx:p.borderRadius,ry:p.borderRadius,width:p.dimensions.width,height:p.dimensions.height,fill:p.color||s.value.background||s.value.backgroundColor,stroke:p.strokeColor,"stroke-width":p.strokeWidth,"shape-rendering":p.shapeRendering,onClick:a,onDblclick:l,onMouseenter:u,onMousemove:h,onMouseleave:c}),null,16,VM))],64)):Qe("",!0)}}),WM=["width","height","viewBox","aria-labelledby"],YM=["id"],GM=["d","fill","stroke","stroke-width"],HM={name:"MiniMap",compatConfig:{MODE:3}},JM=ot({...HM,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(t,{emit:e}){const i=wO(),n=Vd(),r=200,s=150,{id:a,edges:l,viewport:u,translateExtent:h,dimensions:c,emits:p,d3Selection:v,d3Zoom:g,getNodesInitialized:b}=vt(),m=ze();Xr(ub,i);const x=lt(()=>{var V;return t.width??((V=n.style)==null?void 0:V.width)??r}),O=lt(()=>{var V;return t.height??((V=n.style)==null?void 0:V.height)??s}),P=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",S=Fe(()=>typeof t.nodeColor=="string"?()=>t.nodeColor:t.nodeColor),w=Fe(()=>typeof t.nodeStrokeColor=="string"?()=>t.nodeStrokeColor:t.nodeStrokeColor),C=Fe(()=>typeof t.nodeClassName=="string"?()=>t.nodeClassName:typeof t.nodeClassName=="function"?t.nodeClassName:()=>""),E=Fe(()=>ip(b.value.filter(V=>!V.hidden))),k=Fe(()=>({x:-u.value.x/u.value.zoom,y:-u.value.y/u.value.zoom,width:c.value.width/u.value.zoom,height:c.value.height/u.value.zoom})),A=Fe(()=>b.value&&b.value.length?DA(E.value,k.value):k.value),$=Fe(()=>{const V=A.value.width/x.value,oe=A.value.height/O.value;return Math.max(V,oe)}),F=Fe(()=>{const V=$.value*x.value,oe=$.value*O.value,ae=t.offsetScale*$.value;return{offset:ae,x:A.value.x-(V-A.value.width)/2-ae,y:A.value.y-(oe-A.value.height)/2-ae,width:V+ae*2,height:oe+ae*2}}),I=Fe(()=>!F.value.x||!F.value.y?"":`
|
|
32
|
+
M${F.value.x-F.value.offset},${F.value.y-F.value.offset}
|
|
33
|
+
h${F.value.width+F.value.offset*2}
|
|
34
|
+
v${F.value.height+F.value.offset*2}
|
|
35
|
+
h${-F.value.width-F.value.offset*2}z
|
|
36
|
+
M${k.value.x+t.maskBorderRadius},${k.value.y}
|
|
37
|
+
h${k.value.width-2*t.maskBorderRadius}
|
|
38
|
+
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 ${t.maskBorderRadius},${t.maskBorderRadius}
|
|
39
|
+
v${k.value.height-2*t.maskBorderRadius}
|
|
40
|
+
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 -${t.maskBorderRadius},${t.maskBorderRadius}
|
|
41
|
+
h${-(k.value.width-2*t.maskBorderRadius)}
|
|
42
|
+
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 -${t.maskBorderRadius},-${t.maskBorderRadius}
|
|
43
|
+
v${-(k.value.height-2*t.maskBorderRadius)}
|
|
44
|
+
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 ${t.maskBorderRadius},-${t.maskBorderRadius}z`);aT(V=>{if(m.value){const oe=Gn(m.value),ae=Z=>{if(Z.sourceEvent.type!=="wheel"||!v.value||!g.value)return;const L=Z.sourceEvent.ctrlKey&&To()?10:1,se=-Z.sourceEvent.deltaY*(Z.sourceEvent.deltaMode===1?.05:Z.sourceEvent.deltaMode?1:.002)*t.zoomStep,de=u.value.zoom*2**(se*L);g.value.scaleTo(v.value,de)},fe=Z=>{if(Z.sourceEvent.type!=="mousemove"||!v.value||!g.value)return;const L=$.value*Math.max(1,u.value.zoom)*(t.inversePan?-1:1),se={x:u.value.x-Z.sourceEvent.movementX*L,y:u.value.y-Z.sourceEvent.movementY*L},de=[[0,0],[c.value.width,c.value.height]],ie=dp.translate(se.x,se.y).scale(u.value.zoom),R=g.value.constrain()(ie,de,h.value);g.value.transform(v.value,R)},D=ZM().wheelDelta(Z=>If(Z)*(t.zoomStep/10)).on("zoom",t.pannable?fe:()=>{}).on("zoom.wheel",t.zoomable?ae:()=>{});oe.call(D),V(()=>{oe.on("zoom",null)})}},{flush:"post"});function B(V){const[oe,ae]=Zn(V);e("click",{event:V,position:{x:oe,y:ae}})}function j(V,oe){const ae={event:V,node:oe,connectedEdges:Tr([oe],l.value)};p.miniMapNodeClick(ae),e("nodeClick",ae)}function M(V,oe){const ae={event:V,node:oe,connectedEdges:Tr([oe],l.value)};p.miniMapNodeDoubleClick(ae),e("nodeDblclick",ae)}function q(V,oe){const ae={event:V,node:oe,connectedEdges:Tr([oe],l.value)};p.miniMapNodeMouseEnter(ae),e("nodeMouseenter",ae)}function X(V,oe){const ae={event:V,node:oe,connectedEdges:Tr([oe],l.value)};p.miniMapNodeMouseMove(ae),e("nodeMousemove",ae)}function Y(V,oe){const ae={event:V,node:oe,connectedEdges:Tr([oe],l.value)};p.miniMapNodeMouseLeave(ae),e("nodeMouseleave",ae)}return(V,oe)=>(ye(),Ct(Se($x),{position:V.position,class:bt(["vue-flow__minimap",{pannable:V.pannable,zoomable:V.zoomable}])},{default:Ki(()=>[(ye(),be("svg",{ref_key:"el",ref:m,width:x.value,height:O.value,viewBox:[F.value.x,F.value.y,F.value.width,F.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${Se(a)}`,onClick:B},[V.ariaLabel?(ye(),be("title",{key:0,id:`vue-flow__minimap-${Se(a)}`},Te(V.ariaLabel),9,YM)):Qe("",!0),(ye(!0),be(gt,null,Jt(Se(b),ae=>(ye(),Ct(qM,{id:ae.id,key:ae.id,f:"",position:ae.computedPosition,dimensions:ae.dimensions,selected:ae.selected,dragging:ae.dragging,style:hi(ae.style),class:bt(C.value(ae)),color:S.value(ae),"border-radius":V.nodeBorderRadius,"stroke-color":w.value(ae),"stroke-width":V.nodeStrokeWidth,"shape-rendering":Se(P),type:ae.type,hidden:ae.hidden,onClick:fe=>j(fe,ae),onDblclick:fe=>M(fe,ae),onMouseenter:fe=>q(fe,ae),onMousemove:fe=>X(fe,ae),onMouseleave:fe=>Y(fe,ae)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),he("path",{class:"vue-flow__minimap-mask",d:I.value,fill:V.maskColor,stroke:V.maskStrokeColor,"stroke-width":V.maskStrokeWidth,"fill-rule":"evenodd"},null,8,GM)],8,WM))]),_:1},8,["position","class"]))}});function kh(t){const e=t.definition.function,i=[],n=e.parameters?.properties??{};for(const[r,s]of Object.entries(n)){const a={name:r,type:KM(s.type),description:s.description};s.enum&&(a.enumValues=s.enum),i.push(a)}return{uid:t.id,name:e.name,description:e.description,parameters:i,body:t.implementation.code||`{
|
|
45
|
+
// TODO
|
|
46
|
+
}`,mappings:t.canvasMeta?.mappings,probeConfig:t.canvasMeta?.probeConfig,returnSchema:t.canvasMeta?.returnSchema}}function fy(t,e){const i={},n=[];for(const l of t.parameters)if(l.members&&l.members.length>0)for(const u of l.members){const h={type:dy(u.type)};u.description&&(h.description=u.description),u.enumValues&&(h.enum=u.enumValues),i[u.name]=h,n.push(u.name)}else{const u={type:dy(l.type)};l.description&&(u.description=l.description),l.enumValues&&(u.enum=l.enumValues),i[l.name]=u,n.push(l.name)}const r={type:"function",function:{name:t.name,description:t.description,parameters:{type:"object",properties:i,required:n}}},s={...e.implementation,code:t.body},a={...e.canvasMeta,mappings:t.mappings,probeConfig:t.probeConfig,returnSchema:t.returnSchema};return{definition:r,implementation:s,canvasMeta:a}}function KM(t){if(!t)return"any";switch(t){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"any[]";case"object":return"object";default:return"any"}}function dy(t){const e=t.toLowerCase();return e==="number"||e==="integer"?"number":e==="boolean"?"boolean":e.endsWith("[]")?"array":e==="object"?"object":"string"}var Eh={},Vf=function(t,e){return Vf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])},Vf(t,e)};function cb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Vf(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}var Hu=function(){return Hu=Object.assign||function(e){for(var i,n=1,r=arguments.length;n<r;n++){i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},Hu.apply(this,arguments)};function hb(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]]);return i}function fb(t,e,i,n){var r=arguments.length,s=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,i):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s}function db(t,e){return function(i,n){e(i,n,t)}}function pb(t,e,i,n,r,s){function a(O){if(O!==void 0&&typeof O!="function")throw new TypeError("Function expected");return O}for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",h=!e&&t?n.static?t:t.prototype:null,c=e||(h?Object.getOwnPropertyDescriptor(h,n.name):{}),p,v=!1,g=i.length-1;g>=0;g--){var b={};for(var m in n)b[m]=m==="access"?{}:n[m];for(var m in n.access)b.access[m]=n.access[m];b.addInitializer=function(O){if(v)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(O||null))};var x=(0,i[g])(l==="accessor"?{get:c.get,set:c.set}:c[u],b);if(l==="accessor"){if(x===void 0)continue;if(x===null||typeof x!="object")throw new TypeError("Object expected");(p=a(x.get))&&(c.get=p),(p=a(x.set))&&(c.set=p),(p=a(x.init))&&r.unshift(p)}else(p=a(x))&&(l==="field"?r.unshift(p):c[u]=p)}h&&Object.defineProperty(h,n.name,c),v=!0}function mb(t,e,i){for(var n=arguments.length>2,r=0;r<e.length;r++)i=n?e[r].call(t,i):e[r].call(t);return n?i:void 0}function gb(t){return typeof t=="symbol"?t:"".concat(t)}function yb(t,e,i){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:i?"".concat(i," ",e):e})}function vb(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ob(t,e,i,n){function r(s){return s instanceof i?s:new i(function(a){a(s)})}return new(i||(i=Promise))(function(s,a){function l(c){try{h(n.next(c))}catch(p){a(p)}}function u(c){try{h(n.throw(c))}catch(p){a(p)}}function h(c){c.done?s(c.value):r(c.value).then(l,u)}h((n=n.apply(t,e||[])).next())})}function xb(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(h){return function(c){return u([h,c])}}function u(h){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,h[0]&&(i=0)),i;)try{if(n=1,r&&(s=h[0]&2?r.return:h[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,h[1])).done)return s;switch(r=0,s&&(h=[h[0]&2,s.value]),h[0]){case 0:case 1:s=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,r=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!s||h[1]>s[0]&&h[1]<s[3])){i.label=h[1];break}if(h[0]===6&&i.label<s[1]){i.label=s[1],s=h;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(h);break}s[2]&&i.ops.pop(),i.trys.pop();continue}h=e.call(t,i)}catch(c){h=[6,c],r=0}finally{n=s=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}var Rc=Object.create?(function(t,e,i,n){n===void 0&&(n=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,r)}):(function(t,e,i,n){n===void 0&&(n=i),t[n]=e[i]});function bb(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&Rc(e,t,i)}function Ju(t){var e=typeof Symbol=="function"&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function pp(t,e){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var n=i.call(t),r,s=[],a;try{for(;(e===void 0||e-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(a)throw a.error}}return s}function Sb(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(pp(arguments[e]));return t}function wb(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var n=Array(t),r=0,e=0;e<i;e++)for(var s=arguments[e],a=0,l=s.length;a<l;a++,r++)n[r]=s[a];return n}function Pb(t,e,i){if(i||arguments.length===2)for(var n=0,r=e.length,s;n<r;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function _s(t){return this instanceof _s?(this.v=t,this):new _s(t)}function Tb(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i.apply(t,e||[]),r,s=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",a),r[Symbol.asyncIterator]=function(){return this},r;function a(g){return function(b){return Promise.resolve(b).then(g,p)}}function l(g,b){n[g]&&(r[g]=function(m){return new Promise(function(x,O){s.push([g,m,x,O])>1||u(g,m)})},b&&(r[g]=b(r[g])))}function u(g,b){try{h(n[g](b))}catch(m){v(s[0][3],m)}}function h(g){g.value instanceof _s?Promise.resolve(g.value.v).then(c,p):v(s[0][2],g)}function c(g){u("next",g)}function p(g){u("throw",g)}function v(g,b){g(b),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Cb(t){var e,i;return e={},n("next"),n("throw",function(r){throw r}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(r,s){e[r]=t[r]?function(a){return(i=!i)?{value:_s(t[r](a)),done:!1}:s?s(a):a}:s}}function kb(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof Ju=="function"?Ju(t):t[Symbol.iterator](),i={},n("next"),n("throw"),n("return"),i[Symbol.asyncIterator]=function(){return this},i);function n(s){i[s]=t[s]&&function(a){return new Promise(function(l,u){a=t[s](a),r(l,u,a.done,a.value)})}}function r(s,a,l,u){Promise.resolve(u).then(function(h){s({value:h,done:l})},a)}}function Eb(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var e$=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},Uf=function(t){return Uf=Object.getOwnPropertyNames||function(e){var i=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[i.length]=n);return i},Uf(t)};function Ab(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i=Uf(t),n=0;n<i.length;n++)i[n]!=="default"&&Rc(e,t,i[n]);return e$(e,t),e}function Db(t){return t&&t.__esModule?t:{default:t}}function _b(t,e,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(t):n?n.value:e.get(t)}function Ib(t,e,i,n,r){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?r.call(t,i):r?r.value=i:e.set(t,i),i}function Nb(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Mb(t,e,i){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],i&&(r=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:n,async:i})}else i&&t.stack.push({async:!0});return e}var t$=typeof SuppressedError=="function"?SuppressedError:function(t,e,i){var n=new Error(i);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function $b(t){function e(s){t.error=t.hasError?new t$(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var i,n=0;function r(){for(;i=t.stack.pop();)try{if(!i.async&&n===1)return n=0,t.stack.push(i),Promise.resolve().then(r);if(i.dispose){var s=i.dispose.call(i.value);if(i.async)return n|=2,Promise.resolve(s).then(r,function(a){return e(a),r()})}else n|=1}catch(a){e(a)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return r()}function Lb(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(i,n,r,s,a){return n?e?".jsx":".js":r&&(!s||!a)?i:r+s+"."+a.toLowerCase()+"js"}):t}const i$={__extends:cb,__assign:Hu,__rest:hb,__decorate:fb,__param:db,__esDecorate:pb,__runInitializers:mb,__propKey:gb,__setFunctionName:yb,__metadata:vb,__awaiter:Ob,__generator:xb,__createBinding:Rc,__exportStar:bb,__values:Ju,__read:pp,__spread:Sb,__spreadArrays:wb,__spreadArray:Pb,__await:_s,__asyncGenerator:Tb,__asyncDelegator:Cb,__asyncValues:kb,__makeTemplateObject:Eb,__importStar:Ab,__importDefault:Db,__classPrivateFieldGet:_b,__classPrivateFieldSet:Ib,__classPrivateFieldIn:Nb,__addDisposableResource:Mb,__disposeResources:$b,__rewriteRelativeImportExtension:Lb},n$=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Mb,get __assign(){return Hu},__asyncDelegator:Cb,__asyncGenerator:Tb,__asyncValues:kb,__await:_s,__awaiter:Ob,__classPrivateFieldGet:_b,__classPrivateFieldIn:Nb,__classPrivateFieldSet:Ib,__createBinding:Rc,__decorate:fb,__disposeResources:$b,__esDecorate:pb,__exportStar:bb,__extends:cb,__generator:xb,__importDefault:Db,__importStar:Ab,__makeTemplateObject:Eb,__metadata:vb,__param:db,__propKey:gb,__read:pp,__rest:hb,__rewriteRelativeImportExtension:Lb,__runInitializers:mb,__setFunctionName:yb,__spread:Sb,__spreadArray:Pb,__spreadArrays:wb,__values:Ju,default:i$},Symbol.toStringTag,{value:"Module"})),et=EO(n$),r$={},s$=Object.freeze(Object.defineProperty({__proto__:null,default:r$},Symbol.toStringTag,{value:"Module"})),Bb=EO(s$);var Ah={},Pa={exports:{}},Ta={exports:{}},is={},py;function ft(){if(py)return is;py=1,Object.defineProperty(is,"__esModule",{value:!0}),is.maybeSetModuleExports=void 0;var t=et,e=t.__importDefault(At());function i(r){var s=r.use(e.default),a=s.Type,l=s.builtInTypes,u=l.number;function h(g){return a.from(function(b){return u.check(b)&&b>=g},u+" >= "+g)}var c={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}},p=a.or(l.string,l.number,l.boolean,l.null,l.undefined),v=a.from(function(g){if(g===null)return!0;var b=typeof g;return!(b==="object"||b==="function")},p.toString());return{geq:h,defaults:c,isPrimitive:v}}is.default=i;function n(r){try{var s=r(),a=s.exports,l=a.default}catch{return}l&&l!==a&&typeof a=="object"&&(Object.assign(l,a,{default:l}),a.__esModule&&Object.defineProperty(l,"__esModule",{value:!0}),s.exports=l)}return is.maybeSetModuleExports=n,is}Ta.exports;var my;function At(){return my||(my=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Def=void 0;var i=et,n=ft(),r=Object.prototype,s=r.toString,a=r.hasOwnProperty,l=(function(){function O(){}return O.prototype.assert=function(P,S){if(!this.check(P,S)){var w=m(P);throw new Error(w+" does not match type "+this)}return!0},O.prototype.arrayOf=function(){var P=this;return new u(P)},O})(),u=(function(O){i.__extends(P,O);function P(S){var w=O.call(this)||this;return w.elemType=S,w.kind="ArrayType",w}return P.prototype.toString=function(){return"["+this.elemType+"]"},P.prototype.check=function(S,w){var C=this;return Array.isArray(S)&&S.every(function(E){return C.elemType.check(E,w)})},P})(l),h=(function(O){i.__extends(P,O);function P(S){var w=O.call(this)||this;return w.value=S,w.kind="IdentityType",w}return P.prototype.toString=function(){return String(this.value)},P.prototype.check=function(S,w){var C=S===this.value;return!C&&typeof w=="function"&&w(this,S),C},P})(l),c=(function(O){i.__extends(P,O);function P(S){var w=O.call(this)||this;return w.fields=S,w.kind="ObjectType",w}return P.prototype.toString=function(){return"{ "+this.fields.join(", ")+" }"},P.prototype.check=function(S,w){return s.call(S)===s.call({})&&this.fields.every(function(C){return C.type.check(S[C.name],w)})},P})(l),p=(function(O){i.__extends(P,O);function P(S){var w=O.call(this)||this;return w.types=S,w.kind="OrType",w}return P.prototype.toString=function(){return this.types.join(" | ")},P.prototype.check=function(S,w){return this.types.some(function(C){return C.check(S,!!w)})?!0:(typeof w=="function"&&w(this,S),!1)},P})(l),v=(function(O){i.__extends(P,O);function P(S,w){var C=O.call(this)||this;return C.name=S,C.predicate=w,C.kind="PredicateType",C}return P.prototype.toString=function(){return this.name},P.prototype.check=function(S,w){var C=this.predicate(S,w);return!C&&typeof w=="function"&&w(this,S),C},P})(l),g=(function(){function O(P,S){this.type=P,this.typeName=S,this.baseNames=[],this.ownFields=Object.create(null),this.allSupertypes=Object.create(null),this.supertypeList=[],this.allFields=Object.create(null),this.fieldNames=[],this.finalized=!1,this.buildable=!1,this.buildParams=[]}return O.prototype.isSupertypeOf=function(P){if(P instanceof O){if(this.finalized!==!0||P.finalized!==!0)throw new Error("");return a.call(P.allSupertypes,this.typeName)}else throw new Error(P+" is not a Def")},O.prototype.checkAllFields=function(P,S){var w=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function C(E){var k=w[E],A=k.type,$=k.getValue(P);return A.check($,S)}return P!==null&&typeof P=="object"&&Object.keys(w).every(C)},O.prototype.bases=function(){for(var P=[],S=0;S<arguments.length;S++)P[S]=arguments[S];var w=this.baseNames;if(this.finalized){if(P.length!==w.length)throw new Error("");for(var C=0;C<P.length;C++)if(P[C]!==w[C])throw new Error("");return this}return P.forEach(function(E){w.indexOf(E)<0&&w.push(E)}),this},O})();e.Def=g;var b=(function(){function O(P,S,w,C){this.name=P,this.type=S,this.defaultFn=w,this.hidden=!!C}return O.prototype.toString=function(){return JSON.stringify(this.name)+": "+this.type},O.prototype.getValue=function(P){var S=P[this.name];return typeof S<"u"||typeof this.defaultFn=="function"&&(S=this.defaultFn.call(P)),S},O})();function m(O){return Array.isArray(O)?"["+O.map(m).join(", ")+"]":O&&typeof O=="object"?"{ "+Object.keys(O).map(function(P){return P+": "+O[P]}).join(", ")+" }":JSON.stringify(O)}function x(O){var P={or:function(){for(var G=[],J=0;J<arguments.length;J++)G[J]=arguments[J];return new p(G.map(function(le){return P.from(le)}))},from:function(G,J){if(G instanceof u||G instanceof h||G instanceof c||G instanceof p||G instanceof v)return G;if(G instanceof g)return G.type;if(A.check(G)){if(G.length!==1)throw new Error("only one element type is permitted for typed arrays");return new u(P.from(G[0]))}if($.check(G))return new c(Object.keys(G).map(function(ve){return new b(ve,P.from(G[ve],ve))}));if(typeof G=="function"){var le=S.indexOf(G);if(le>=0)return w[le];if(typeof J!="string")throw new Error("missing name");return new v(J,G)}return new h(G)},def:function(G){return a.call(V,G)?V[G]:V[G]=new ae(G)},hasDef:function(G){return a.call(V,G)}},S=[],w=[];function C(G,J){var le=s.call(J),ve=new v(G,function(we){return s.call(we)===le});return J&&typeof J.constructor=="function"&&(S.push(J.constructor),w.push(ve)),ve}var E=C("string","truthy"),k=C("function",function(){}),A=C("array",[]),$=C("object",{}),F=C("RegExp",/./),I=C("Date",new Date),B=C("number",3),j=C("boolean",!0),M=C("null",null),q=C("undefined",void 0),X=typeof BigInt=="function"?C("BigInt",BigInt(1234)):new v("BigInt",function(){return!1}),Y={string:E,function:k,array:A,object:$,RegExp:F,Date:I,number:B,boolean:j,null:M,undefined:q,BigInt:X},V=Object.create(null);function oe(G){if(G&&typeof G=="object"){var J=G.type;if(typeof J=="string"&&a.call(V,J)){var le=V[J];if(le.finalized)return le}}return null}var ae=(function(G){i.__extends(J,G);function J(le){var ve=G.call(this,new v(le,function(we,K){return ve.check(we,K)}),le)||this;return ve}return J.prototype.check=function(le,ve){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(le===null||typeof le!="object")return!1;var we=oe(le);return we?ve&&we===this?this.checkAllFields(le,ve):this.isSupertypeOf(we)?ve?we.checkAllFields(le,ve)&&this.checkAllFields(le,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(le,ve):!1},J.prototype.build=function(){for(var le=this,ve=[],we=0;we<arguments.length;we++)ve[we]=arguments[we];if(this.buildParams=ve,this.buildable)return this;this.field("type",String,function(){return le.typeName}),this.buildable=!0;var K=function(me,Pe,Ve,He){if(!a.call(me,Pe)){var Tt=le.allFields;if(!a.call(Tt,Pe))throw new Error(""+Pe);var Je=Tt[Pe],ei=Je.type,qt;if(He)qt=Ve;else if(Je.defaultFn)qt=Je.defaultFn.call(me);else{var Bn="no value or default function given for field "+JSON.stringify(Pe)+" of "+le.typeName+"("+le.buildParams.map(function(gn){return Tt[gn]}).join(", ")+")";throw new Error(Bn)}if(!ei.check(qt))throw new Error(m(qt)+" does not match field "+Je+" of type "+le.typeName);me[Pe]=qt}},ue=function(){for(var me=[],Pe=0;Pe<arguments.length;Pe++)me[Pe]=arguments[Pe];var Ve=me.length;if(!le.finalized)throw new Error("attempting to instantiate unfinalized type "+le.typeName);var He=Object.create(L);if(le.buildParams.forEach(function(Tt,Je){Je<Ve?K(He,Tt,me[Je],!0):K(He,Tt,null,!1)}),Object.keys(le.allFields).forEach(function(Tt){K(He,Tt,null,!1)}),He.type!==le.typeName)throw new Error("");return He};return ue.from=function(me){if(!le.finalized)throw new Error("attempting to instantiate unfinalized type "+le.typeName);var Pe=Object.create(L);if(Object.keys(le.allFields).forEach(function(Ve){a.call(me,Ve)?K(Pe,Ve,me[Ve],!0):K(Pe,Ve,null,!1)}),Pe.type!==le.typeName)throw new Error("");return Pe},Object.defineProperty(Z,de(this.typeName),{enumerable:!0,value:ue}),this},J.prototype.field=function(le,ve,we,K){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(le)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[le]=new b(le,P.from(ve),we,K),this)},J.prototype.finalize=function(){var le=this;if(!this.finalized){var ve=this.allFields,we=this.allSupertypes;this.baseNames.forEach(function(ue){var me=V[ue];if(me instanceof g)me.finalize(),H(ve,me.allFields),H(we,me.allSupertypes);else{var Pe="unknown supertype name "+JSON.stringify(ue)+" for subtype "+JSON.stringify(le.typeName);throw new Error(Pe)}}),H(ve,this.ownFields),we[this.typeName]=this,this.fieldNames.length=0;for(var K in ve)a.call(ve,K)&&!ve[K].hidden&&this.fieldNames.push(K);Object.defineProperty(R,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,te(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&$e(this.typeName)}},J})(g);function fe(G){if(!a.call(V,G))throw new Error("");var J=V[G];if(J.finalized!==!0)throw new Error("");return J.supertypeList.slice(1)}function D(G){for(var J={},le=Object.keys(V),ve=le.length,we=0;we<ve;++we){var K=le[we],ue=V[K];if(ue.finalized!==!0)throw new Error(""+K);for(var me=0;me<ue.supertypeList.length;++me){var Pe=ue.supertypeList[me];if(a.call(G,Pe)){J[K]=Pe;break}}}return J}var Z=Object.create(null),L={};function se(G,J){var le=L[G];return q.check(J)?delete L[G]:(k.assert(J),Object.defineProperty(L,G,{enumerable:!0,configurable:!0,value:J})),le}function de(G){return G.replace(/^[A-Z]+/,function(J){var le=J.length;switch(le){case 0:return"";case 1:return J.toLowerCase();default:return J.slice(0,le-1).toLowerCase()+J.charAt(le-1)}})}function ie(G){return G=de(G),G.replace(/(Expression)?$/,"Statement")}var R={};function Q(G){var J=oe(G);if(J)return J.fieldNames.slice(0);if("type"in G)throw new Error("did not recognize object of type "+JSON.stringify(G.type));return Object.keys(G)}function xe(G,J){var le=oe(G);if(le){var ve=le.allFields[J];if(ve)return ve.getValue(G)}return G&&G[J]}function Re(G,J,le){Q(G).forEach(function(ve){J.call(this,ve,xe(G,ve))},le)}function ke(G,J,le){return Q(G).some(function(ve){return J.call(this,ve,xe(G,ve))},le)}function $e(G){var J=ie(G);if(!Z[J]){var le=Z[de(G)];if(le){var ve=function(){for(var we=[],K=0;K<arguments.length;K++)we[K]=arguments[K];return Z.expressionStatement(le.apply(Z,we))};ve.from=function(){for(var we=[],K=0;K<arguments.length;K++)we[K]=arguments[K];return Z.expressionStatement(le.from.apply(Z,we))},Z[J]=ve}}}function te(G,J){J.length=0,J.push(G);for(var le=Object.create(null),ve=0;ve<J.length;++ve){G=J[ve];var we=V[G];if(we.finalized!==!0)throw new Error("");a.call(le,G)&&delete J[le[G]],le[G]=ve,J.push.apply(J,we.baseNames)}for(var K=0,ue=K,me=J.length;ue<me;++ue)a.call(J,ue)&&(J[K++]=J[ue]);J.length=K}function H(G,J){return Object.keys(J).forEach(function(le){G[le]=J[le]}),G}function re(){Object.keys(V).forEach(function(G){V[G].finalize()})}return{Type:P,builtInTypes:Y,getSupertypeNames:fe,computeSupertypeLookupTable:D,builders:Z,defineMethod:se,getBuilderName:de,getStatementBuilderName:ie,namedTypes:R,getFieldNames:Q,getFieldValue:xe,eachField:Re,someField:ke,finalize:re}}e.default=x,(0,n.maybeSetModuleExports)(function(){return t})})(Ta,Ta.exports)),Ta.exports}var Ca={exports:{}},ka={exports:{}},Ea={exports:{}};Ea.exports;var gy;function Qb(){return gy||(gy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=ft(),r=i.__importDefault(At()),s=Object.prototype,a=s.hasOwnProperty;function l(u){var h=u.use(r.default),c=h.builtInTypes.array,p=h.builtInTypes.number,v=function S(w,C,E){if(!(this instanceof S))throw new Error("Path constructor cannot be invoked without 'new'");if(C){if(!(C instanceof S))throw new Error("")}else C=null,E=null;this.value=w,this.parentPath=C,this.name=E,this.__childCache=null},g=v.prototype;function b(S){return S.__childCache||(S.__childCache=Object.create(null))}function m(S,w){var C=b(S),E=S.getValueProperty(w),k=C[w];return(!a.call(C,w)||k.value!==E)&&(k=C[w]=new S.constructor(E,S,w)),k}g.getValueProperty=function(w){return this.value[w]},g.get=function(){for(var w=[],C=0;C<arguments.length;C++)w[C]=arguments[C];for(var E=this,k=w.length,A=0;A<k;++A)E=m(E,w[A]);return E},g.each=function(w,C){for(var E=[],k=this.value.length,A=0,A=0;A<k;++A)a.call(this.value,A)&&(E[A]=this.get(A));for(C=C||this,A=0;A<k;++A)a.call(E,A)&&w.call(C,E[A])},g.map=function(w,C){var E=[];return this.each(function(k){E.push(w.call(this,k))},C),E},g.filter=function(w,C){var E=[];return this.each(function(k){w.call(this,k)&&E.push(k)},C),E};function x(){}function O(S,w,C,E){if(c.assert(S.value),w===0)return x;var k=S.value.length;if(k<1)return x;var A=arguments.length;A===2?(C=0,E=k):A===3?(C=Math.max(C,0),E=k):(C=Math.max(C,0),E=Math.min(E,k)),p.assert(C),p.assert(E);for(var $=Object.create(null),F=b(S),I=C;I<E;++I)if(a.call(S.value,I)){var B=S.get(I);if(B.name!==I)throw new Error("");var j=I+w;B.name=j,$[j]=B,delete F[I]}return delete F.length,function(){for(var M in $){var q=$[M];if(q.name!==+M)throw new Error("");F[M]=q,S.value[M]=q.value}}}g.shift=function(){var w=O(this,-1),C=this.value.shift();return w(),C},g.unshift=function(){for(var w=[],C=0;C<arguments.length;C++)w[C]=arguments[C];var E=O(this,w.length),k=this.value.unshift.apply(this.value,w);return E(),k},g.push=function(){for(var w=[],C=0;C<arguments.length;C++)w[C]=arguments[C];return c.assert(this.value),delete b(this).length,this.value.push.apply(this.value,w)},g.pop=function(){c.assert(this.value);var w=b(this);return delete w[this.value.length-1],delete w.length,this.value.pop()},g.insertAt=function(w){var C=arguments.length,E=O(this,C-1,w);if(E===x&&C<=1)return this;w=Math.max(w,0);for(var k=1;k<C;++k)this.value[w+k-1]=arguments[k];return E(),this},g.insertBefore=function(){for(var w=[],C=0;C<arguments.length;C++)w[C]=arguments[C];for(var E=this.parentPath,k=w.length,A=[this.name],$=0;$<k;++$)A.push(w[$]);return E.insertAt.apply(E,A)},g.insertAfter=function(){for(var w=[],C=0;C<arguments.length;C++)w[C]=arguments[C];for(var E=this.parentPath,k=w.length,A=[this.name+1],$=0;$<k;++$)A.push(w[$]);return E.insertAt.apply(E,A)};function P(S){if(!(S instanceof v))throw new Error("");var w=S.parentPath;if(!w)return S;var C=w.value,E=b(w);if(C[S.name]===S.value)E[S.name]=S;else if(c.check(C)){var k=C.indexOf(S.value);k>=0&&(E[S.name=k]=S)}else C[S.name]=S.value,E[S.name]=S;if(C[S.name]!==S.value)throw new Error("");if(S.parentPath.get(S.name)!==S)throw new Error("");return S}return g.replace=function(w){var C=[],E=this.parentPath.value,k=b(this.parentPath),A=arguments.length;if(P(this),c.check(E)){for(var $=E.length,F=O(this.parentPath,A-1,this.name+1),I=[this.name,1],B=0;B<A;++B)I.push(arguments[B]);var j=E.splice.apply(E,I);if(j[0]!==this.value)throw new Error("");if(E.length!==$-1+A)throw new Error("");if(F(),A===0)delete this.value,delete k[this.name],this.__childCache=null;else{if(E[this.name]!==w)throw new Error("");for(this.value!==w&&(this.value=w,this.__childCache=null),B=0;B<A;++B)C.push(this.parentPath.get(this.name+B));if(C[0]!==this)throw new Error("")}}else if(A===1)this.value!==w&&(this.__childCache=null),this.value=E[this.name]=w,C.push(this);else if(A===0)delete E[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return C},v}e.default=l,(0,n.maybeSetModuleExports)(function(){return t})})(Ea,Ea.exports)),Ea.exports}var Aa={exports:{}};Aa.exports;var yy;function a$(){return yy||(yy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=ft(),r=i.__importDefault(At()),s=Object.prototype.hasOwnProperty;function a(l){var u=l.use(r.default),h=u.Type,c=u.namedTypes,p=c.Node,v=c.Expression,g=u.builtInTypes.array,b=u.builders,m=function I(B,j){if(!(this instanceof I))throw new Error("Scope constructor cannot be invoked without 'new'");O.check(B.value)||x.assert(B.value);var M;if(j){if(!(j instanceof I))throw new Error("");M=j.depth+1}else j=null,M=0;Object.defineProperties(this,{path:{value:B},node:{value:B.value},isGlobal:{value:!j,enumerable:!0},depth:{value:M},parent:{value:j},bindings:{value:{}},types:{value:{}}})},x=h.or(c.Program,c.Function,c.CatchClause),O=h.or(c.Function,c.ClassDeclaration,c.ClassExpression,c.InterfaceDeclaration,c.TSInterfaceDeclaration,c.TypeAlias,c.TSTypeAliasDeclaration),P=h.or(c.TypeParameter,c.TSTypeParameter);m.isEstablishedBy=function(I){return x.check(I)||O.check(I)};var S=m.prototype;S.didScan=!1,S.declares=function(I){return this.scan(),s.call(this.bindings,I)},S.declaresType=function(I){return this.scan(),s.call(this.types,I)},S.declareTemporary=function(I){if(I){if(!/^[a-z$_]/i.test(I))throw new Error("")}else I="t$";I+=this.depth.toString(36)+"$",this.scan();for(var B=0;this.declares(I+B);)++B;var j=I+B;return this.bindings[j]=u.builders.identifier(j)},S.injectTemporary=function(I,B){I||(I=this.declareTemporary());var j=this.path.get("body");return c.BlockStatement.check(j.value)&&(j=j.get("body")),j.unshift(b.variableDeclaration("var",[b.variableDeclarator(I,B||null)])),I},S.scan=function(I){if(I||!this.didScan){for(var B in this.bindings)delete this.bindings[B];for(var B in this.types)delete this.types[B];w(this.path,this.bindings,this.types),this.didScan=!0}},S.getBindings=function(){return this.scan(),this.bindings},S.getTypes=function(){return this.scan(),this.types};function w(I,B,j){var M=I.value;if(O.check(M)){var q=I.get("typeParameters","params");g.check(q.value)&&q.each(function(X){F(X,j)})}x.check(M)&&(c.CatchClause.check(M)?A(I.get("param"),B):C(I,B,j))}function C(I,B,j){var M=I.value;I.parent&&c.FunctionExpression.check(I.parent.node)&&I.parent.node.id&&A(I.parent.get("id"),B),M&&(g.check(M)?I.each(function(q){k(q,B,j)}):c.Function.check(M)?(I.get("params").each(function(q){A(q,B)}),k(I.get("body"),B,j),C(I.get("typeParameters"),B,j)):c.TypeAlias&&c.TypeAlias.check(M)||c.InterfaceDeclaration&&c.InterfaceDeclaration.check(M)||c.TSTypeAliasDeclaration&&c.TSTypeAliasDeclaration.check(M)||c.TSInterfaceDeclaration&&c.TSInterfaceDeclaration.check(M)?$(I.get("id"),j):c.VariableDeclarator.check(M)?(A(I.get("id"),B),k(I.get("init"),B,j)):M.type==="ImportSpecifier"||M.type==="ImportNamespaceSpecifier"||M.type==="ImportDefaultSpecifier"?A(I.get(M.local?"local":M.name?"name":"id"),B):p.check(M)&&!v.check(M)&&u.eachField(M,function(q,X){var Y=I.get(q);if(!E(Y,X))throw new Error("");k(Y,B,j)}))}function E(I,B){return!!(I.value===B||Array.isArray(I.value)&&I.value.length===0&&Array.isArray(B)&&B.length===0)}function k(I,B,j){var M=I.value;if(!(!M||v.check(M)))if(c.FunctionDeclaration.check(M)&&M.id!==null)A(I.get("id"),B);else if(c.ClassDeclaration&&c.ClassDeclaration.check(M)&&M.id!==null)A(I.get("id"),B),C(I.get("typeParameters"),B,j);else if(c.InterfaceDeclaration&&c.InterfaceDeclaration.check(M)||c.TSInterfaceDeclaration&&c.TSInterfaceDeclaration.check(M))$(I.get("id"),j);else if(x.check(M)){if(c.CatchClause.check(M)&&c.Identifier.check(M.param)){var q=M.param.name,X=s.call(B,q);C(I.get("body"),B,j),X||delete B[q]}}else C(I,B,j)}function A(I,B){var j=I.value;c.Pattern.assert(j),c.Identifier.check(j)?s.call(B,j.name)?B[j.name].push(I):B[j.name]=[I]:c.AssignmentPattern&&c.AssignmentPattern.check(j)?A(I.get("left"),B):c.ObjectPattern&&c.ObjectPattern.check(j)?I.get("properties").each(function(M){var q=M.value;c.Pattern.check(q)?A(M,B):c.Property.check(q)||c.ObjectProperty&&c.ObjectProperty.check(q)?A(M.get("value"),B):c.SpreadProperty&&c.SpreadProperty.check(q)&&A(M.get("argument"),B)}):c.ArrayPattern&&c.ArrayPattern.check(j)?I.get("elements").each(function(M){var q=M.value;c.Pattern.check(q)?A(M,B):c.SpreadElement&&c.SpreadElement.check(q)&&A(M.get("argument"),B)}):c.PropertyPattern&&c.PropertyPattern.check(j)?A(I.get("pattern"),B):(c.SpreadElementPattern&&c.SpreadElementPattern.check(j)||c.RestElement&&c.RestElement.check(j)||c.SpreadPropertyPattern&&c.SpreadPropertyPattern.check(j))&&A(I.get("argument"),B)}function $(I,B){var j=I.value;c.Pattern.assert(j),c.Identifier.check(j)&&(s.call(B,j.name)?B[j.name].push(I):B[j.name]=[I])}function F(I,B){var j=I.value;P.assert(j),s.call(B,j.name)?B[j.name].push(I):B[j.name]=[I]}return S.lookup=function(I){for(var B=this;B&&!B.declares(I);B=B.parent);return B},S.lookupType=function(I){for(var B=this;B&&!B.declaresType(I);B=B.parent);return B},S.getGlobalScope=function(){for(var I=this;!I.isGlobal;)I=I.parent;return I},m}e.default=a,(0,n.maybeSetModuleExports)(function(){return t})})(Aa,Aa.exports)),Aa.exports}ka.exports;var vy;function Fb(){return vy||(vy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(At()),r=i.__importDefault(Qb()),s=i.__importDefault(a$()),a=ft();function l(u){var h=u.use(n.default),c=h.namedTypes,p=h.builders,v=h.builtInTypes.number,g=h.builtInTypes.array,b=u.use(r.default),m=u.use(s.default),x=function A($,F,I){if(!(this instanceof A))throw new Error("NodePath constructor cannot be invoked without 'new'");b.call(this,$,F,I)},O=x.prototype=Object.create(b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(O,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),O.replace=function(){return delete this.node,delete this.parent,delete this.scope,b.prototype.replace.apply(this,arguments)},O.prune=function(){var A=this.parent;return this.replace(),E(A)},O._computeNode=function(){var A=this.value;if(c.Node.check(A))return A;var $=this.parentPath;return $&&$.node||null},O._computeParent=function(){var A=this.value,$=this.parentPath;if(!c.Node.check(A)){for(;$&&!c.Node.check($.value);)$=$.parentPath;$&&($=$.parentPath)}for(;$&&!c.Node.check($.value);)$=$.parentPath;return $||null},O._computeScope=function(){var A=this.value,$=this.parentPath,F=$&&$.scope;return c.Node.check(A)&&m.isEstablishedBy(A)&&(F=new m(this,F)),F||null},O.getValueProperty=function(A){return h.getFieldValue(this.value,A)},O.needsParens=function(A){var $=this.parentPath;if(!$)return!1;var F=this.value;if(!c.Expression.check(F)||F.type==="Identifier")return!1;for(;!c.Node.check($.value);)if($=$.parentPath,!$)return!1;var I=$.value;switch(F.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return I.type==="MemberExpression"&&this.name==="object"&&I.object===F;case"BinaryExpression":case"LogicalExpression":switch(I.type){case"CallExpression":return this.name==="callee"&&I.callee===F;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&I.object===F;case"BinaryExpression":case"LogicalExpression":{var B=F,j=I.operator,M=S[j],q=B.operator,X=S[q];if(M>X)return!0;if(M===X&&this.name==="right"){if(I.right!==B)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(I.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(I.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return I.type==="MemberExpression"&&v.check(F.value)&&this.name==="object"&&I.object===F;case"AssignmentExpression":case"ConditionalExpression":switch(I.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&I.callee===F;case"ConditionalExpression":return this.name==="test"&&I.test===F;case"MemberExpression":return this.name==="object"&&I.object===F;default:return!1}default:if(I.type==="NewExpression"&&this.name==="callee"&&I.callee===F)return w(F)}return!!(A!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function P(A){return c.BinaryExpression.check(A)||c.LogicalExpression.check(A)}var S={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(A,$){A.forEach(function(F){S[F]=$})});function w(A){return c.CallExpression.check(A)?!0:g.check(A)?A.some(w):c.Node.check(A)?h.someField(A,function($,F){return w(F)}):!1}O.canBeFirstInStatement=function(){var A=this.node;return!c.FunctionExpression.check(A)&&!c.ObjectExpression.check(A)},O.firstInStatement=function(){return C(this)};function C(A){for(var $,F;A.parent;A=A.parent){if($=A.node,F=A.parent.node,c.BlockStatement.check(F)&&A.parent.name==="body"&&A.name===0){if(F.body[0]!==$)throw new Error("Nodes must be equal");return!0}if(c.ExpressionStatement.check(F)&&A.name==="expression"){if(F.expression!==$)throw new Error("Nodes must be equal");return!0}if(c.SequenceExpression.check(F)&&A.parent.name==="expressions"&&A.name===0){if(F.expressions[0]!==$)throw new Error("Nodes must be equal");continue}if(c.CallExpression.check(F)&&A.name==="callee"){if(F.callee!==$)throw new Error("Nodes must be equal");continue}if(c.MemberExpression.check(F)&&A.name==="object"){if(F.object!==$)throw new Error("Nodes must be equal");continue}if(c.ConditionalExpression.check(F)&&A.name==="test"){if(F.test!==$)throw new Error("Nodes must be equal");continue}if(P(F)&&A.name==="left"){if(F.left!==$)throw new Error("Nodes must be equal");continue}if(c.UnaryExpression.check(F)&&!F.prefix&&A.name==="argument"){if(F.argument!==$)throw new Error("Nodes must be equal");continue}return!1}return!0}function E(A){if(c.VariableDeclaration.check(A.node)){var $=A.get("declarations").value;if(!$||$.length===0)return A.prune()}else if(c.ExpressionStatement.check(A.node)){if(!A.get("expression").value)return A.prune()}else c.IfStatement.check(A.node)&&k(A);return A}function k(A){var $=A.get("test").value,F=A.get("alternate").value,I=A.get("consequent").value;if(!I&&!F){var B=p.expressionStatement($);A.replace(B)}else if(!I&&F){var j=p.unaryExpression("!",$,!0);c.UnaryExpression.check($)&&$.operator==="!"&&(j=$.argument),A.get("test").replace(j),A.get("consequent").replace(F),A.get("alternate").replace()}}return x}e.default=l,(0,a.maybeSetModuleExports)(function(){return t})})(ka,ka.exports)),ka.exports}Ca.exports;var Oy;function o$(){return Oy||(Oy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(At()),r=i.__importDefault(Fb()),s=ft(),a=Object.prototype.hasOwnProperty;function l(u){var h=u.use(n.default),c=u.use(r.default),p=h.builtInTypes.array,v=h.builtInTypes.object,g=h.builtInTypes.function,b,m=function E(){if(!(this instanceof E))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=x(this),this._shouldVisitComments=a.call(this._methodNameTable,"Block")||a.call(this._methodNameTable,"Line"),this.Context=w(this),this._visiting=!1,this._changeReported=!1};function x(E){var k=Object.create(null);for(var A in E)/^visit[A-Z]/.test(A)&&(k[A.slice(5)]=!0);for(var $=h.computeSupertypeLookupTable(k),F=Object.create(null),I=Object.keys($),B=I.length,j=0;j<B;++j){var M=I[j];A="visit"+$[M],g.check(E[A])&&(F[M]=A)}return F}m.fromMethodsObject=function(k){if(k instanceof m)return k;if(!v.check(k))return new m;var A=function F(){if(!(this instanceof F))throw new Error("Visitor constructor cannot be invoked without 'new'");m.call(this)},$=A.prototype=Object.create(P);return $.constructor=A,O($,k),O(A,m),g.assert(A.fromMethodsObject),g.assert(A.visit),new A};function O(E,k){for(var A in k)a.call(k,A)&&(E[A]=k[A]);return E}m.visit=function(k,A){return m.fromMethodsObject(A).visit(k)};var P=m.prototype;P.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var E=arguments.length,k=new Array(E),A=0;A<E;++A)k[A]=arguments[A];k[0]instanceof c||(k[0]=new c({root:k[0]}).get("root")),this.reset.apply(this,k);var $;try{var F=this.visitWithoutReset(k[0]);$=!0}finally{if(this._visiting=!1,!$&&this._abortRequested)return k[0].value}return F},P.AbortRequest=function(){},P.abort=function(){var E=this;E._abortRequested=!0;var k=new E.AbortRequest;throw k.cancel=function(){E._abortRequested=!1},k},P.reset=function(E){},P.visitWithoutReset=function(E){if(this instanceof this.Context)return this.visitor.visitWithoutReset(E);if(!(E instanceof c))throw new Error("");var k=E.value,A=k&&typeof k=="object"&&typeof k.type=="string"&&this._methodNameTable[k.type];if(A){var $=this.acquireContext(E);try{return $.invokeVisitorMethod(A)}finally{this.releaseContext($)}}else return S(E,this)};function S(E,k){if(!(E instanceof c))throw new Error("");if(!(k instanceof m))throw new Error("");var A=E.value;if(p.check(A))E.each(k.visitWithoutReset,k);else if(v.check(A)){var $=h.getFieldNames(A);k._shouldVisitComments&&A.comments&&$.indexOf("comments")<0&&$.push("comments");for(var F=$.length,I=[],B=0;B<F;++B){var j=$[B];a.call(A,j)||(A[j]=h.getFieldValue(A,j)),I.push(E.get(j))}for(var B=0;B<F;++B)k.visitWithoutReset(I[B])}return E.value}P.acquireContext=function(E){return this._reusableContextStack.length===0?new this.Context(E):this._reusableContextStack.pop().reset(E)},P.releaseContext=function(E){if(!(E instanceof this.Context))throw new Error("");this._reusableContextStack.push(E),E.currentPath=null},P.reportChanged=function(){this._changeReported=!0},P.wasChangeReported=function(){return this._changeReported};function w(E){function k($){if(!(this instanceof k))throw new Error("");if(!(this instanceof m))throw new Error("");if(!($ instanceof c))throw new Error("");Object.defineProperty(this,"visitor",{value:E,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=$,this.needToCallTraverse=!0,Object.seal(this)}if(!(E instanceof m))throw new Error("");var A=k.prototype=Object.create(E);return A.constructor=k,O(A,C),k}var C=Object.create(null);return C.reset=function(k){if(!(this instanceof this.Context))throw new Error("");if(!(k instanceof c))throw new Error("");return this.currentPath=k,this.needToCallTraverse=!0,this},C.invokeVisitorMethod=function(k){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof c))throw new Error("");var A=this.visitor[k].call(this,this.currentPath);if(A===!1?this.needToCallTraverse=!1:A!==b&&(this.currentPath=this.currentPath.replace(A)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+k);var $=this.currentPath;return $&&$.value},C.traverse=function(k,A){if(!(this instanceof this.Context))throw new Error("");if(!(k instanceof c))throw new Error("");if(!(this.currentPath instanceof c))throw new Error("");return this.needToCallTraverse=!1,S(k,m.fromMethodsObject(A||this.visitor))},C.visit=function(k,A){if(!(this instanceof this.Context))throw new Error("");if(!(k instanceof c))throw new Error("");if(!(this.currentPath instanceof c))throw new Error("");return this.needToCallTraverse=!1,m.fromMethodsObject(A||this.visitor).visitWithoutReset(k)},C.reportChanged=function(){this.visitor.reportChanged()},C.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},m}e.default=l,(0,s.maybeSetModuleExports)(function(){return t})})(Ca,Ca.exports)),Ca.exports}var Da={exports:{}};Da.exports;var xy;function l$(){return xy||(xy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=ft(),r=i.__importDefault(At());function s(a){var l=a.use(r.default),u=l.getFieldNames,h=l.getFieldValue,c=l.builtInTypes.array,p=l.builtInTypes.object,v=l.builtInTypes.Date,g=l.builtInTypes.RegExp,b=Object.prototype.hasOwnProperty;function m(w,C,E){return c.check(E)?E.length=0:E=null,O(w,C,E)}m.assert=function(w,C){var E=[];if(!m(w,C,E))if(E.length===0){if(w!==C)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+E.map(x).join(""))};function x(w){return/[_$a-z][_$a-z0-9]*/i.test(w)?"."+w:"["+JSON.stringify(w)+"]"}function O(w,C,E){return w===C?!0:c.check(w)?P(w,C,E):p.check(w)?S(w,C,E):v.check(w)?v.check(C)&&+w==+C:g.check(w)?g.check(C)&&w.source===C.source&&w.global===C.global&&w.multiline===C.multiline&&w.ignoreCase===C.ignoreCase:w==C}function P(w,C,E){c.assert(w);var k=w.length;if(!c.check(C)||C.length!==k)return E&&E.push("length"),!1;for(var A=0;A<k;++A){if(E&&E.push(A),A in w!=A in C||!O(w[A],C[A],E))return!1;if(E){var $=E.pop();if($!==A)throw new Error(""+$)}}return!0}function S(w,C,E){if(p.assert(w),!p.check(C))return!1;if(w.type!==C.type)return E&&E.push("type"),!1;var k=u(w),A=k.length,$=u(C),F=$.length;if(A===F){for(var I=0;I<A;++I){var B=k[I],j=h(w,B),M=h(C,B);if(E&&E.push(B),!O(j,M,E))return!1;if(E){var q=E.pop();if(q!==B)throw new Error(""+q)}}return!0}if(!E)return!1;var X=Object.create(null);for(I=0;I<A;++I)X[k[I]]=!0;for(I=0;I<F;++I){if(B=$[I],!b.call(X,B))return E.push(B),!1;delete X[B]}for(B in X){E.push(B);break}return!1}return m}e.default=s,(0,n.maybeSetModuleExports)(function(){return t})})(Da,Da.exports)),Da.exports}Pa.exports;var by;function u$(){return by||(by=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(At()),r=i.__importDefault(o$()),s=i.__importDefault(l$()),a=i.__importDefault(Qb()),l=i.__importDefault(Fb()),u=ft();function h(p){var v=c(),g=v.use(n.default);p.forEach(v.use),g.finalize();var b=v.use(r.default);return{Type:g.Type,builtInTypes:g.builtInTypes,namedTypes:g.namedTypes,builders:g.builders,defineMethod:g.defineMethod,getFieldNames:g.getFieldNames,getFieldValue:g.getFieldValue,eachField:g.eachField,someField:g.someField,getSupertypeNames:g.getSupertypeNames,getBuilderName:g.getBuilderName,astNodesAreEquivalent:v.use(s.default),finalize:g.finalize,Path:v.use(a.default),NodePath:v.use(l.default),PathVisitor:b,use:v.use,visit:b.visit}}e.default=h;function c(){var p=[],v=[];function g(m){var x=p.indexOf(m);return x===-1&&(x=p.length,p.push(m),v[x]=m(b)),v[x]}var b={use:g};return b}(0,u.maybeSetModuleExports)(function(){return t})})(Pa,Pa.exports)),Pa.exports}var _a={exports:{}},Ia={exports:{}},Na={exports:{}},Ma={exports:{}},$a={exports:{}},La={exports:{}},Ba={exports:{}};Ba.exports;var Sy;function Rb(){return Sy||(Sy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=ft();function n(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}e.default=n,(0,i.maybeSetModuleExports)(function(){return t})})(Ba,Ba.exports)),Ba.exports}La.exports;var wy;function zb(){return wy||(wy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=ft(),r=i.__importDefault(Rb());function s(a){var l=a.use(r.default);return l.BinaryOperators.indexOf("**")<0&&l.BinaryOperators.push("**"),l.AssignmentOperators.indexOf("**=")<0&&l.AssignmentOperators.push("**="),l}e.default=s,(0,n.maybeSetModuleExports)(function(){return t})})(La,La.exports)),La.exports}$a.exports;var Py;function Xb(){return Py||(Py=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=ft(),r=i.__importDefault(zb());function s(a){var l=a.use(r.default);return l.LogicalOperators.indexOf("??")<0&&l.LogicalOperators.push("??"),l}e.default=s,(0,n.maybeSetModuleExports)(function(){return t})})($a,$a.exports)),$a.exports}Ma.exports;var Ty;function c$(){return Ty||(Ty=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=ft(),r=i.__importDefault(Xb());function s(a){var l=a.use(r.default);return l.LogicalOperators.forEach(function(u){var h=u+"=";l.AssignmentOperators.indexOf(h)<0&&l.AssignmentOperators.push(h)}),l}e.default=s,(0,n.maybeSetModuleExports)(function(){return t})})(Ma,Ma.exports)),Ma.exports}var Qa={exports:{}},Fa={exports:{}},Ra={exports:{}},za={exports:{}},Xa={exports:{}},ja={exports:{}},Za={exports:{}};Za.exports;var Cy;function h$(){return Cy||(Cy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(Rb()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){var u=l.use(r.default),h=u.Type,c=h.def,p=h.or,v=l.use(s.default),g=v.defaults,b=v.geq,m=l.use(n.default),x=m.BinaryOperators,O=m.AssignmentOperators,P=m.LogicalOperators;c("Printable").field("loc",p(c("SourceLocation"),null),g.null,!0),c("Node").bases("Printable").field("type",String).field("comments",p([c("Comment")],null),g.null,!0),c("SourceLocation").field("start",c("Position")).field("end",c("Position")).field("source",p(String,null),g.null),c("Position").field("line",b(1)).field("column",b(0)),c("File").bases("Node").build("program","name").field("program",c("Program")).field("name",p(String,null),g.null),c("Program").bases("Node").build("body").field("body",[c("Statement")]),c("Function").bases("Node").field("id",p(c("Identifier"),null),g.null).field("params",[c("Pattern")]).field("body",c("BlockStatement")).field("generator",Boolean,g.false).field("async",Boolean,g.false),c("Statement").bases("Node"),c("EmptyStatement").bases("Statement").build(),c("BlockStatement").bases("Statement").build("body").field("body",[c("Statement")]),c("ExpressionStatement").bases("Statement").build("expression").field("expression",c("Expression")),c("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",c("Expression")).field("consequent",c("Statement")).field("alternate",p(c("Statement"),null),g.null),c("LabeledStatement").bases("Statement").build("label","body").field("label",c("Identifier")).field("body",c("Statement")),c("BreakStatement").bases("Statement").build("label").field("label",p(c("Identifier"),null),g.null),c("ContinueStatement").bases("Statement").build("label").field("label",p(c("Identifier"),null),g.null),c("WithStatement").bases("Statement").build("object","body").field("object",c("Expression")).field("body",c("Statement")),c("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",c("Expression")).field("cases",[c("SwitchCase")]).field("lexical",Boolean,g.false),c("ReturnStatement").bases("Statement").build("argument").field("argument",p(c("Expression"),null)),c("ThrowStatement").bases("Statement").build("argument").field("argument",c("Expression")),c("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",c("BlockStatement")).field("handler",p(c("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[c("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[c("CatchClause")],g.emptyArray).field("finalizer",p(c("BlockStatement"),null),g.null),c("CatchClause").bases("Node").build("param","guard","body").field("param",c("Pattern")).field("guard",p(c("Expression"),null),g.null).field("body",c("BlockStatement")),c("WhileStatement").bases("Statement").build("test","body").field("test",c("Expression")).field("body",c("Statement")),c("DoWhileStatement").bases("Statement").build("body","test").field("body",c("Statement")).field("test",c("Expression")),c("ForStatement").bases("Statement").build("init","test","update","body").field("init",p(c("VariableDeclaration"),c("Expression"),null)).field("test",p(c("Expression"),null)).field("update",p(c("Expression"),null)).field("body",c("Statement")),c("ForInStatement").bases("Statement").build("left","right","body").field("left",p(c("VariableDeclaration"),c("Expression"))).field("right",c("Expression")).field("body",c("Statement")),c("DebuggerStatement").bases("Statement").build(),c("Declaration").bases("Statement"),c("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",c("Identifier")),c("FunctionExpression").bases("Function","Expression").build("id","params","body"),c("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",p("var","let","const")).field("declarations",[c("VariableDeclarator")]),c("VariableDeclarator").bases("Node").build("id","init").field("id",c("Pattern")).field("init",p(c("Expression"),null),g.null),c("Expression").bases("Node"),c("ThisExpression").bases("Expression").build(),c("ArrayExpression").bases("Expression").build("elements").field("elements",[p(c("Expression"),null)]),c("ObjectExpression").bases("Expression").build("properties").field("properties",[c("Property")]),c("Property").bases("Node").build("kind","key","value").field("kind",p("init","get","set")).field("key",p(c("Literal"),c("Identifier"))).field("value",c("Expression")),c("SequenceExpression").bases("Expression").build("expressions").field("expressions",[c("Expression")]);var S=p("-","+","!","~","typeof","void","delete");c("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",S).field("argument",c("Expression")).field("prefix",Boolean,g.true);var w=p.apply(void 0,x);c("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",w).field("left",c("Expression")).field("right",c("Expression"));var C=p.apply(void 0,O);c("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",C).field("left",p(c("Pattern"),c("MemberExpression"))).field("right",c("Expression"));var E=p("++","--");c("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",E).field("argument",c("Expression")).field("prefix",Boolean);var k=p.apply(void 0,P);c("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",k).field("left",c("Expression")).field("right",c("Expression")),c("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",c("Expression")).field("consequent",c("Expression")).field("alternate",c("Expression")),c("NewExpression").bases("Expression").build("callee","arguments").field("callee",c("Expression")).field("arguments",[c("Expression")]),c("CallExpression").bases("Expression").build("callee","arguments").field("callee",c("Expression")).field("arguments",[c("Expression")]),c("MemberExpression").bases("Expression").build("object","property","computed").field("object",c("Expression")).field("property",p(c("Identifier"),c("Expression"))).field("computed",Boolean,function(){var A=this.property.type;return A==="Literal"||A==="MemberExpression"||A==="BinaryExpression"}),c("Pattern").bases("Node"),c("SwitchCase").bases("Node").build("test","consequent").field("test",p(c("Expression"),null)).field("consequent",[c("Statement")]),c("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,g.false),c("Literal").bases("Expression").build("value").field("value",p(String,Boolean,null,Number,RegExp,BigInt)),c("Comment").bases("Printable").field("value",String).field("leading",Boolean,g.true).field("trailing",Boolean,g.false)}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Za,Za.exports)),Za.exports}ja.exports;var ky;function f$(){return ky||(ky=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(h$()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){l.use(n.default);var u=l.use(r.default),h=u.Type.def,c=u.Type.or,p=l.use(s.default).defaults;h("Function").field("generator",Boolean,p.false).field("expression",Boolean,p.false).field("defaults",[c(h("Expression"),null)],p.emptyArray).field("rest",c(h("Identifier"),null),p.null),h("RestElement").bases("Pattern").build("argument").field("argument",h("Pattern")).field("typeAnnotation",c(h("TypeAnnotation"),h("TSTypeAnnotation"),null),p.null),h("SpreadElementPattern").bases("Pattern").build("argument").field("argument",h("Pattern")),h("FunctionDeclaration").build("id","params","body","generator","expression").field("id",c(h("Identifier"),null)),h("FunctionExpression").build("id","params","body","generator","expression"),h("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,p.null).field("body",c(h("BlockStatement"),h("Expression"))).field("generator",!1,p.false),h("ForOfStatement").bases("Statement").build("left","right","body").field("left",c(h("VariableDeclaration"),h("Pattern"))).field("right",h("Expression")).field("body",h("Statement")),h("YieldExpression").bases("Expression").build("argument","delegate").field("argument",c(h("Expression"),null)).field("delegate",Boolean,p.false),h("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",h("Expression")).field("blocks",[h("ComprehensionBlock")]).field("filter",c(h("Expression"),null)),h("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",h("Expression")).field("blocks",[h("ComprehensionBlock")]).field("filter",c(h("Expression"),null)),h("ComprehensionBlock").bases("Node").build("left","right","each").field("left",h("Pattern")).field("right",h("Expression")).field("each",Boolean),h("Property").field("key",c(h("Literal"),h("Identifier"),h("Expression"))).field("value",c(h("Expression"),h("Pattern"))).field("method",Boolean,p.false).field("shorthand",Boolean,p.false).field("computed",Boolean,p.false),h("ObjectProperty").field("shorthand",Boolean,p.false),h("PropertyPattern").bases("Pattern").build("key","pattern").field("key",c(h("Literal"),h("Identifier"),h("Expression"))).field("pattern",h("Pattern")).field("computed",Boolean,p.false),h("ObjectPattern").bases("Pattern").build("properties").field("properties",[c(h("PropertyPattern"),h("Property"))]),h("ArrayPattern").bases("Pattern").build("elements").field("elements",[c(h("Pattern"),null)]),h("SpreadElement").bases("Node").build("argument").field("argument",h("Expression")),h("ArrayExpression").field("elements",[c(h("Expression"),h("SpreadElement"),h("RestElement"),null)]),h("NewExpression").field("arguments",[c(h("Expression"),h("SpreadElement"))]),h("CallExpression").field("arguments",[c(h("Expression"),h("SpreadElement"))]),h("AssignmentPattern").bases("Pattern").build("left","right").field("left",h("Pattern")).field("right",h("Expression")),h("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",c("constructor","method","get","set")).field("key",h("Expression")).field("value",h("Function")).field("computed",Boolean,p.false).field("static",Boolean,p.false);var v=c(h("MethodDefinition"),h("VariableDeclarator"),h("ClassPropertyDefinition"),h("ClassProperty"),h("StaticBlock"));h("ClassProperty").bases("Declaration").build("key").field("key",c(h("Literal"),h("Identifier"),h("Expression"))).field("computed",Boolean,p.false),h("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",v),h("ClassBody").bases("Declaration").build("body").field("body",[v]),h("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",c(h("Identifier"),null)).field("body",h("ClassBody")).field("superClass",c(h("Expression"),null),p.null),h("ClassExpression").bases("Expression").build("id","body","superClass").field("id",c(h("Identifier"),null),p.null).field("body",h("ClassBody")).field("superClass",c(h("Expression"),null),p.null),h("Super").bases("Expression").build(),h("Specifier").bases("Node"),h("ModuleSpecifier").bases("Specifier").field("local",c(h("Identifier"),null),p.null).field("id",c(h("Identifier"),null),p.null).field("name",c(h("Identifier"),null),p.null),h("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",h("Identifier")),h("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),h("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),h("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[c(h("ImportSpecifier"),h("ImportNamespaceSpecifier"),h("ImportDefaultSpecifier"))],p.emptyArray).field("source",h("Literal")).field("importKind",c("value","type"),function(){return"value"}),h("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",c(h("Declaration"),null)).field("specifiers",[h("ExportSpecifier")],p.emptyArray).field("source",c(h("Literal"),null),p.null),h("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",h("Identifier")),h("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",c(h("Declaration"),h("Expression"))),h("ExportAllDeclaration").bases("Declaration").build("source").field("source",h("Literal")),h("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",h("Expression")).field("quasi",h("TemplateLiteral")),h("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[h("TemplateElement")]).field("expressions",[h("Expression")]),h("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),h("MetaProperty").bases("Expression").build("meta","property").field("meta",h("Identifier")).field("property",h("Identifier"))}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(ja,ja.exports)),ja.exports}Xa.exports;var Ey;function d$(){return Ey||(Ey=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(zb()),r=i.__importDefault(f$()),s=ft();function a(l){l.use(n.default),l.use(r.default)}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Xa,Xa.exports)),Xa.exports}za.exports;var Ay;function p$(){return Ay||(Ay=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(d$()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){l.use(n.default);var u=l.use(r.default),h=u.Type.def,c=l.use(s.default).defaults;h("Function").field("async",Boolean,c.false),h("AwaitExpression").bases("Expression").build("argument").field("argument",h("Expression"))}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(za,za.exports)),za.exports}Ra.exports;var Dy;function m$(){return Dy||(Dy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(p$()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){l.use(n.default);var u=l.use(r.default),h=u.Type.def,c=u.Type.or,p=l.use(s.default).defaults;h("ForOfStatement").field("await",Boolean,p.false),h("SpreadProperty").bases("Node").build("argument").field("argument",h("Expression")),h("ObjectExpression").field("properties",[c(h("Property"),h("SpreadProperty"),h("SpreadElement"))]),h("TemplateElement").field("value",{cooked:c(String,null),raw:String}),h("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",h("Pattern")),h("ObjectPattern").field("properties",[c(h("PropertyPattern"),h("Property"),h("RestElement"),h("SpreadPropertyPattern"))])}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Ra,Ra.exports)),Ra.exports}Fa.exports;var _y;function g$(){return _y||(_y=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(m$()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){l.use(n.default);var u=l.use(r.default),h=u.Type.def,c=u.Type.or,p=l.use(s.default).defaults;h("CatchClause").field("param",c(h("Pattern"),null),p.null)}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Fa,Fa.exports)),Fa.exports}Qa.exports;var Iy;function y$(){return Iy||(Iy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(Xb()),r=i.__importDefault(g$()),s=i.__importDefault(At()),a=i.__importStar(ft());function l(u){u.use(n.default),u.use(r.default);var h=u.use(s.default),c=h.Type.def,p=h.Type.or,v=u.use(a.default),g=v.defaults;c("ImportExpression").bases("Expression").build("source").field("source",c("Expression")),c("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",c("Literal")).field("exported",p(c("Identifier"),null,void 0),g.null),c("ChainElement").bases("Node").field("optional",Boolean,g.false),c("CallExpression").bases("Expression","ChainElement"),c("MemberExpression").bases("Expression","ChainElement"),c("ChainExpression").bases("Expression").build("expression").field("expression",c("ChainElement")),c("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,g.true),c("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,g.true)}e.default=l,(0,a.maybeSetModuleExports)(function(){return t})})(Qa,Qa.exports)),Qa.exports}Na.exports;var Ny;function v$(){return Ny||(Ny=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(c$()),r=i.__importDefault(y$()),s=ft();function a(l){l.use(n.default),l.use(r.default)}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Na,Na.exports)),Na.exports}Ia.exports;var My;function O$(){return My||(My=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(v$()),r=i.__importDefault(At()),s=ft();function a(l){l.use(n.default);var u=l.use(r.default),h=u.Type.def;h("StaticBlock").bases("Declaration").build("body").field("body",[h("Statement")])}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Ia,Ia.exports)),Ia.exports}_a.exports;var $y;function tl(){return $y||($y=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(At()),r=i.__importStar(ft()),s=i.__importDefault(O$());function a(l){l.use(s.default);var u=l.use(n.default),h=u.Type,c=u.Type.def,p=h.or,v=l.use(r.default),g=v.defaults;c("AwaitExpression").build("argument","all").field("argument",p(c("Expression"),null)).field("all",Boolean,g.false),c("Decorator").bases("Node").build("expression").field("expression",c("Expression")),c("Property").field("decorators",p([c("Decorator")],null),g.null),c("MethodDefinition").field("decorators",p([c("Decorator")],null),g.null),c("PrivateName").bases("Expression","Pattern").build("id").field("id",c("Identifier")),c("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",c("PrivateName")).field("value",p(c("Expression"),null),g.null),c("ImportAttribute").bases("Node").build("key","value").field("key",p(c("Identifier"),c("Literal"))).field("value",c("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(function(b){c(b).field("assertions",[c("ImportAttribute")],g.emptyArray)}),c("RecordExpression").bases("Expression").build("properties").field("properties",[p(c("ObjectProperty"),c("ObjectMethod"),c("SpreadElement"))]),c("TupleExpression").bases("Expression").build("elements").field("elements",[p(c("Expression"),c("SpreadElement"),null)]),c("ModuleExpression").bases("Node").build("body").field("body",c("Program"))}e.default=a,(0,r.maybeSetModuleExports)(function(){return t})})(_a,_a.exports)),_a.exports}var Va={exports:{}};Va.exports;var Ly;function x$(){return Ly||(Ly=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(tl()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){l.use(n.default);var u=l.use(r.default),h=u.Type.def,c=u.Type.or,p=l.use(s.default).defaults;h("JSXAttribute").bases("Node").build("name","value").field("name",c(h("JSXIdentifier"),h("JSXNamespacedName"))).field("value",c(h("Literal"),h("JSXExpressionContainer"),h("JSXElement"),h("JSXFragment"),null),p.null),h("JSXIdentifier").bases("Identifier").build("name").field("name",String),h("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",h("JSXIdentifier")).field("name",h("JSXIdentifier")),h("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",c(h("JSXIdentifier"),h("JSXMemberExpression"))).field("property",h("JSXIdentifier")).field("computed",Boolean,p.false);var v=c(h("JSXIdentifier"),h("JSXNamespacedName"),h("JSXMemberExpression"));h("JSXSpreadAttribute").bases("Node").build("argument").field("argument",h("Expression"));var g=[c(h("JSXAttribute"),h("JSXSpreadAttribute"))];h("JSXExpressionContainer").bases("Expression").build("expression").field("expression",c(h("Expression"),h("JSXEmptyExpression")));var b=[c(h("JSXText"),h("JSXExpressionContainer"),h("JSXSpreadChild"),h("JSXElement"),h("JSXFragment"),h("Literal"))];h("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",h("JSXOpeningElement")).field("closingElement",c(h("JSXClosingElement"),null),p.null).field("children",b,p.emptyArray).field("name",v,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",g,function(){return this.openingElement.attributes},!0),h("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",v).field("attributes",g,p.emptyArray).field("selfClosing",Boolean,p.false),h("JSXClosingElement").bases("Node").build("name").field("name",v),h("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",h("JSXOpeningFragment")).field("closingFragment",h("JSXClosingFragment")).field("children",b,p.emptyArray),h("JSXOpeningFragment").bases("Node").build(),h("JSXClosingFragment").bases("Node").build(),h("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),h("JSXEmptyExpression").bases("Node").build(),h("JSXSpreadChild").bases("Node").build("expression").field("expression",h("Expression"))}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Va,Va.exports)),Va.exports}var Ua={exports:{}},qa={exports:{}};qa.exports;var By;function jb(){return By||(By=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(At()),r=i.__importStar(ft());function s(a){var l=a.use(n.default),u=l.Type.def,h=l.Type.or,c=a.use(r.default).defaults,p=h(u("TypeAnnotation"),u("TSTypeAnnotation"),null),v=h(u("TypeParameterDeclaration"),u("TSTypeParameterDeclaration"),null);u("Identifier").field("typeAnnotation",p,c.null),u("ObjectPattern").field("typeAnnotation",p,c.null),u("Function").field("returnType",p,c.null).field("typeParameters",v,c.null),u("ClassProperty").build("key","value","typeAnnotation","static").field("value",h(u("Expression"),null)).field("static",Boolean,c.false).field("typeAnnotation",p,c.null),["ClassDeclaration","ClassExpression"].forEach(function(g){u(g).field("typeParameters",v,c.null).field("superTypeParameters",h(u("TypeParameterInstantiation"),u("TSTypeParameterInstantiation"),null),c.null).field("implements",h([u("ClassImplements")],[u("TSExpressionWithTypeArguments")]),c.emptyArray)})}e.default=s,(0,r.maybeSetModuleExports)(function(){return t})})(qa,qa.exports)),qa.exports}Ua.exports;var Qy;function Zb(){return Qy||(Qy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(tl()),r=i.__importDefault(jb()),s=i.__importDefault(At()),a=i.__importStar(ft());function l(u){u.use(n.default),u.use(r.default);var h=u.use(s.default),c=h.Type.def,p=h.Type.or,v=u.use(a.default).defaults;c("Flow").bases("Node"),c("FlowType").bases("Flow"),c("AnyTypeAnnotation").bases("FlowType").build(),c("EmptyTypeAnnotation").bases("FlowType").build(),c("MixedTypeAnnotation").bases("FlowType").build(),c("VoidTypeAnnotation").bases("FlowType").build(),c("SymbolTypeAnnotation").bases("FlowType").build(),c("NumberTypeAnnotation").bases("FlowType").build(),c("BigIntTypeAnnotation").bases("FlowType").build(),c("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),c("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),c("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),c("StringTypeAnnotation").bases("FlowType").build(),c("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),c("BooleanTypeAnnotation").bases("FlowType").build(),c("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),c("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",c("FlowType")),c("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",c("FlowType")),c("NullLiteralTypeAnnotation").bases("FlowType").build(),c("NullTypeAnnotation").bases("FlowType").build(),c("ThisTypeAnnotation").bases("FlowType").build(),c("ExistsTypeAnnotation").bases("FlowType").build(),c("ExistentialTypeParam").bases("FlowType").build(),c("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[c("FunctionTypeParam")]).field("returnType",c("FlowType")).field("rest",p(c("FunctionTypeParam"),null)).field("typeParameters",p(c("TypeParameterDeclaration"),null)),c("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",p(c("Identifier"),null)).field("typeAnnotation",c("FlowType")).field("optional",Boolean),c("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",c("FlowType")),c("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[p(c("ObjectTypeProperty"),c("ObjectTypeSpreadProperty"))]).field("indexers",[c("ObjectTypeIndexer")],v.emptyArray).field("callProperties",[c("ObjectTypeCallProperty")],v.emptyArray).field("inexact",p(Boolean,void 0),v.undefined).field("exact",Boolean,v.false).field("internalSlots",[c("ObjectTypeInternalSlot")],v.emptyArray),c("Variance").bases("Node").build("kind").field("kind",p("plus","minus"));var g=p(c("Variance"),"plus","minus",null);c("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",p(c("Literal"),c("Identifier"))).field("value",c("FlowType")).field("optional",Boolean).field("variance",g,v.null),c("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",c("Identifier")).field("key",c("FlowType")).field("value",c("FlowType")).field("variance",g,v.null).field("static",Boolean,v.false),c("ObjectTypeCallProperty").bases("Node").build("value").field("value",c("FunctionTypeAnnotation")).field("static",Boolean,v.false),c("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",p(c("Identifier"),c("QualifiedTypeIdentifier"))).field("id",c("Identifier")),c("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",p(c("Identifier"),c("QualifiedTypeIdentifier"))).field("typeParameters",p(c("TypeParameterInstantiation"),null)),c("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",c("Identifier")).field("property",p(c("MemberTypeAnnotation"),c("GenericTypeAnnotation"))),c("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",c("FlowType")).field("indexType",c("FlowType")),c("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",c("FlowType")).field("indexType",c("FlowType")).field("optional",Boolean),c("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[c("FlowType")]),c("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[c("FlowType")]),c("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",c("FlowType")),c("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",c("FlowType")),c("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",c("Identifier")).field("value",c("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),c("TypeParameterDeclaration").bases("Node").build("params").field("params",[c("TypeParameter")]),c("TypeParameterInstantiation").bases("Node").build("params").field("params",[c("FlowType")]),c("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",g,v.null).field("bound",p(c("TypeAnnotation"),null),v.null).field("default",p(c("FlowType"),null),v.null),c("ClassProperty").field("variance",g,v.null),c("ClassImplements").bases("Node").build("id").field("id",c("Identifier")).field("superClass",p(c("Expression"),null),v.null).field("typeParameters",p(c("TypeParameterInstantiation"),null),v.null),c("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",c("ObjectTypeAnnotation")).field("extends",p([c("InterfaceExtends")],null),v.null),c("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",c("Identifier")).field("typeParameters",p(c("TypeParameterDeclaration"),null),v.null).field("body",c("ObjectTypeAnnotation")).field("extends",[c("InterfaceExtends")]),c("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),c("InterfaceExtends").bases("Node").build("id").field("id",c("Identifier")).field("typeParameters",p(c("TypeParameterInstantiation"),null),v.null),c("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",c("Identifier")).field("typeParameters",p(c("TypeParameterDeclaration"),null)).field("right",c("FlowType")),c("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),c("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",c("Identifier")).field("typeParameters",p(c("TypeParameterDeclaration"),null)).field("impltype",c("FlowType")).field("supertype",p(c("FlowType"),null)),c("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",p(c("FlowType"),null)),c("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",c("Expression")).field("typeAnnotation",c("TypeAnnotation")),c("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[c("FlowType")]),c("DeclareVariable").bases("Statement").build("id").field("id",c("Identifier")),c("DeclareFunction").bases("Statement").build("id").field("id",c("Identifier")).field("predicate",p(c("FlowPredicate"),null),v.null),c("DeclareClass").bases("InterfaceDeclaration").build("id"),c("DeclareModule").bases("Statement").build("id","body").field("id",p(c("Identifier"),c("Literal"))).field("body",c("BlockStatement")),c("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",c("TypeAnnotation")),c("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",p(c("DeclareVariable"),c("DeclareFunction"),c("DeclareClass"),c("FlowType"),c("TypeAlias"),c("DeclareOpaqueType"),c("InterfaceDeclaration"),null)).field("specifiers",[p(c("ExportSpecifier"),c("ExportBatchSpecifier"))],v.emptyArray).field("source",p(c("Literal"),null),v.null),c("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",p(c("Literal"),null),v.null),c("ImportDeclaration").field("importKind",p("value","type","typeof"),function(){return"value"}),c("FlowPredicate").bases("Flow"),c("InferredPredicate").bases("FlowPredicate").build(),c("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",c("Expression")),c("Function").field("predicate",p(c("FlowPredicate"),null),v.null),c("CallExpression").field("typeArguments",p(null,c("TypeParameterInstantiation")),v.null),c("NewExpression").field("typeArguments",p(null,c("TypeParameterInstantiation")),v.null),c("EnumDeclaration").bases("Declaration").build("id","body").field("id",c("Identifier")).field("body",p(c("EnumBooleanBody"),c("EnumNumberBody"),c("EnumStringBody"),c("EnumSymbolBody"))),c("EnumBooleanBody").build("members","explicitType").field("members",[c("EnumBooleanMember")]).field("explicitType",Boolean),c("EnumNumberBody").build("members","explicitType").field("members",[c("EnumNumberMember")]).field("explicitType",Boolean),c("EnumStringBody").build("members","explicitType").field("members",p([c("EnumStringMember")],[c("EnumDefaultedMember")])).field("explicitType",Boolean),c("EnumSymbolBody").build("members").field("members",[c("EnumDefaultedMember")]),c("EnumBooleanMember").build("id","init").field("id",c("Identifier")).field("init",p(c("Literal"),Boolean)),c("EnumNumberMember").build("id","init").field("id",c("Identifier")).field("init",c("Literal")),c("EnumStringMember").build("id","init").field("id",c("Identifier")).field("init",c("Literal")),c("EnumDefaultedMember").build("id").field("id",c("Identifier"))}e.default=l,(0,a.maybeSetModuleExports)(function(){return t})})(Ua,Ua.exports)),Ua.exports}var Wa={exports:{}};Wa.exports;var Fy;function b$(){return Fy||(Fy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(tl()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){l.use(n.default);var u=l.use(r.default),h=l.use(s.default).defaults,c=u.Type.def,p=u.Type.or;c("VariableDeclaration").field("declarations",[p(c("VariableDeclarator"),c("Identifier"))]),c("Property").field("value",p(c("Expression"),c("Pattern"))),c("ArrayPattern").field("elements",[p(c("Pattern"),c("SpreadElement"),null)]),c("ObjectPattern").field("properties",[p(c("Property"),c("PropertyPattern"),c("SpreadPropertyPattern"),c("SpreadProperty"))]),c("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),c("ExportBatchSpecifier").bases("Specifier").build(),c("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",p(c("Declaration"),c("Expression"),null)).field("specifiers",[p(c("ExportSpecifier"),c("ExportBatchSpecifier"))],h.emptyArray).field("source",p(c("Literal"),null),h.null),c("Block").bases("Comment").build("value","leading","trailing"),c("Line").bases("Comment").build("value","leading","trailing")}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Wa,Wa.exports)),Wa.exports}var Ya={exports:{}},Ga={exports:{}};Ga.exports;var Ry;function Vb(){return Ry||(Ry=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(tl()),r=i.__importDefault(At()),s=i.__importStar(ft());function a(l){var u,h,c,p,v;l.use(n.default);var g=l.use(r.default),b=l.use(s.default).defaults,m=g.Type.def,x=g.Type.or,O=g.builtInTypes.undefined;m("Noop").bases("Statement").build(),m("DoExpression").bases("Expression").build("body").field("body",[m("Statement")]),m("BindExpression").bases("Expression").build("object","callee").field("object",x(m("Expression"),null)).field("callee",m("Expression")),m("ParenthesizedExpression").bases("Expression").build("expression").field("expression",m("Expression")),m("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",m("Identifier")),m("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",m("Identifier")),m("CommentBlock").bases("Comment").build("value","leading","trailing"),m("CommentLine").bases("Comment").build("value","leading","trailing"),m("Directive").bases("Node").build("value").field("value",m("DirectiveLiteral")),m("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,b["use strict"]),m("InterpreterDirective").bases("Node").build("value").field("value",String),m("BlockStatement").bases("Statement").build("body").field("body",[m("Statement")]).field("directives",[m("Directive")],b.emptyArray),m("Program").bases("Node").build("body").field("body",[m("Statement")]).field("directives",[m("Directive")],b.emptyArray).field("interpreter",x(m("InterpreterDirective"),null),b.null);function P(E,k){return E===void 0&&(E=String),["extra",{rawValue:E,raw:String},function(){var $=g.getFieldValue(this,"value");return{rawValue:$,raw:k?k($):String($)}}]}(u=m("StringLiteral").bases("Literal").build("value").field("value",String)).field.apply(u,P(String,function(E){return JSON.stringify(E)})),(h=m("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",x(String,null),b.null)).field.apply(h,P(Number)),(c=m("BigIntLiteral").bases("Literal").build("value").field("value",x(String,Number))).field.apply(c,P(String,function(E){return E+"n"})),(p=m("DecimalLiteral").bases("Literal").build("value").field("value",String)).field.apply(p,P(String,function(E){return E+"m"})),m("NullLiteral").bases("Literal").build().field("value",null,b.null),m("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),(v=m("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)})).field.apply(v,P(x(RegExp,O),function(E){return"/".concat(E.pattern,"/").concat(E.flags||"")})).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var S=x(m("Property"),m("ObjectMethod"),m("ObjectProperty"),m("SpreadProperty"),m("SpreadElement"));m("ObjectExpression").bases("Expression").build("properties").field("properties",[S]),m("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",x("method","get","set")).field("key",x(m("Literal"),m("Identifier"),m("Expression"))).field("params",[m("Pattern")]).field("body",m("BlockStatement")).field("computed",Boolean,b.false).field("generator",Boolean,b.false).field("async",Boolean,b.false).field("accessibility",x(m("Literal"),null),b.null).field("decorators",x([m("Decorator")],null),b.null),m("ObjectProperty").bases("Node").build("key","value").field("key",x(m("Literal"),m("Identifier"),m("Expression"))).field("value",x(m("Expression"),m("Pattern"))).field("accessibility",x(m("Literal"),null),b.null).field("computed",Boolean,b.false);var w=x(m("MethodDefinition"),m("VariableDeclarator"),m("ClassPropertyDefinition"),m("ClassProperty"),m("ClassPrivateProperty"),m("ClassMethod"),m("ClassPrivateMethod"),m("ClassAccessorProperty"),m("StaticBlock"));m("ClassBody").bases("Declaration").build("body").field("body",[w]),m("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",x(m("Literal"),m("Identifier"),m("Expression"))),m("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",m("PrivateName")),m("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",x(m("Literal"),m("Identifier"),m("PrivateName"),m("Expression"))).field("value",x(m("Expression"),null),b.null),["ClassMethod","ClassPrivateMethod"].forEach(function(E){m(E).field("kind",x("get","set","method","constructor"),function(){return"method"}).field("body",m("BlockStatement")).field("access",x("public","private","protected",null),b.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(function(E){m(E).field("computed",Boolean,b.false).field("static",Boolean,b.false).field("abstract",Boolean,b.false).field("accessibility",x("public","private","protected",null),b.null).field("decorators",x([m("Decorator")],null),b.null).field("definite",Boolean,b.false).field("optional",Boolean,b.false).field("override",Boolean,b.false).field("readonly",Boolean,b.false)});var C=x(m("Property"),m("PropertyPattern"),m("SpreadPropertyPattern"),m("SpreadProperty"),m("ObjectProperty"),m("RestProperty"),m("RestElement"));m("ObjectPattern").bases("Pattern").build("properties").field("properties",[C]).field("decorators",x([m("Decorator")],null),b.null),m("SpreadProperty").bases("Node").build("argument").field("argument",m("Expression")),m("RestProperty").bases("Node").build("argument").field("argument",m("Expression")),m("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",x(m("VariableDeclaration"),m("Expression"))).field("right",m("Expression")).field("body",m("Statement")),m("Import").bases("Expression").build()}e.default=a,(0,s.maybeSetModuleExports)(function(){return t})})(Ga,Ga.exports)),Ga.exports}Ya.exports;var zy;function S$(){return zy||(zy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(At()),r=i.__importDefault(Vb()),s=i.__importDefault(Zb()),a=ft();function l(u){var h=u.use(n.default),c=h.Type.def;u.use(r.default),u.use(s.default),c("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),c("TopicReference").bases("Expression").build()}e.default=l,(0,a.maybeSetModuleExports)(function(){return t})})(Ya,Ya.exports)),Ya.exports}var Ha={exports:{}};Ha.exports;var Xy;function w$(){return Xy||(Xy=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=et,n=i.__importDefault(Vb()),r=i.__importDefault(jb()),s=i.__importDefault(At()),a=i.__importStar(ft());function l(u){u.use(n.default),u.use(r.default);var h=u.use(s.default),c=h.namedTypes,p=h.Type.def,v=h.Type.or,g=u.use(a.default).defaults,b=h.Type.from(function(P,S){return!!(c.StringLiteral&&c.StringLiteral.check(P,S)||c.Literal&&c.Literal.check(P,S)&&typeof P.value=="string")},"StringLiteral");p("TSType").bases("Node");var m=v(p("Identifier"),p("TSQualifiedName"));p("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",m),p("TSHasOptionalTypeParameterInstantiation").field("typeParameters",v(p("TSTypeParameterInstantiation"),null),g.null),p("TSHasOptionalTypeParameters").field("typeParameters",v(p("TSTypeParameterDeclaration"),null,void 0),g.null),p("TSHasOptionalTypeAnnotation").field("typeAnnotation",v(p("TSTypeAnnotation"),null),g.null),p("TSQualifiedName").bases("Node").build("left","right").field("left",m).field("right",m),p("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",p("Expression")).field("typeAnnotation",p("TSType")).field("extra",v({parenthesized:Boolean},null),g.null),p("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",p("Expression")).field("typeAnnotation",p("TSType")),p("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",p("Expression")).field("typeAnnotation",p("TSType")),p("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",p("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(function(P){p(P).bases("TSType").build()}),p("TSArrayType").bases("TSType").build("elementType").field("elementType",p("TSType")),p("TSLiteralType").bases("TSType").build("literal").field("literal",v(p("NumericLiteral"),p("StringLiteral"),p("BooleanLiteral"),p("TemplateLiteral"),p("UnaryExpression"),p("BigIntLiteral"))),p("TemplateLiteral").field("expressions",v([p("Expression")],[p("TSType")])),["TSUnionType","TSIntersectionType"].forEach(function(P){p(P).bases("TSType").build("types").field("types",[p("TSType")])}),p("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",p("TSType")).field("extendsType",p("TSType")).field("trueType",p("TSType")).field("falseType",p("TSType")),p("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",p("TSTypeParameter")),p("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",p("TSType"));var x=[v(p("Identifier"),p("RestElement"),p("ArrayPattern"),p("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(function(P){p(P).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",x)}),p("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,g.false).field("async",Boolean,g.false).field("generator",Boolean,g.false).field("id",v(p("Identifier"),null),g.null).field("params",[p("Pattern")]).field("returnType",v(p("TSTypeAnnotation"),p("Noop"),null),g.null),p("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,g.false).field("generator",Boolean,g.false).field("params",[p("Pattern")]).field("abstract",Boolean,g.false).field("accessibility",v("public","private","protected",void 0),g.undefined).field("static",Boolean,g.false).field("computed",Boolean,g.false).field("optional",Boolean,g.false).field("key",v(p("Identifier"),p("StringLiteral"),p("NumericLiteral"),p("Expression"))).field("kind",v("get","set","method","constructor"),function(){return"method"}).field("access",v("public","private","protected",void 0),g.undefined).field("decorators",v([p("Decorator")],null),g.null).field("returnType",v(p("TSTypeAnnotation"),p("Noop"),null),g.null),p("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",v(Boolean,"+","-"),g.false).field("typeParameter",p("TSTypeParameter")).field("optional",v(Boolean,"+","-"),g.false).field("typeAnnotation",v(p("TSType"),null),g.null),p("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[v(p("TSType"),p("TSNamedTupleMember"))]),p("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",p("Identifier")).field("optional",Boolean,g.false).field("elementType",p("TSType")),p("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",p("TSType")),p("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",p("TSType")),p("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",p("TSType")).field("indexType",p("TSType")),p("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",p("TSType")),p("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",v(p("TSType"),p("TSTypeAnnotation"))),p("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[p("Identifier")]).field("readonly",Boolean,g.false),p("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",p("Expression")).field("computed",Boolean,g.false).field("readonly",Boolean,g.false).field("optional",Boolean,g.false).field("initializer",v(p("Expression"),null),g.null),p("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",p("Expression")).field("computed",Boolean,g.false).field("optional",Boolean,g.false).field("parameters",x),p("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",v(p("Identifier"),p("TSThisType"))).field("typeAnnotation",v(p("TSTypeAnnotation"),null),g.null).field("asserts",Boolean,g.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(function(P){p(P).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",x)}),p("TSEnumMember").bases("Node").build("id","initializer").field("id",v(p("Identifier"),b)).field("initializer",v(p("Expression"),null),g.null),p("TSTypeQuery").bases("TSType").build("exprName").field("exprName",v(m,p("TSImportType")));var O=v(p("TSCallSignatureDeclaration"),p("TSConstructSignatureDeclaration"),p("TSIndexSignature"),p("TSMethodSignature"),p("TSPropertySignature"));p("TSTypeLiteral").bases("TSType").build("members").field("members",[O]),p("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",v(p("Identifier"),String)).field("constraint",v(p("TSType"),void 0),g.undefined).field("default",v(p("TSType"),void 0),g.undefined),p("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",p("TSType")).field("expression",p("Expression")).field("extra",v({parenthesized:Boolean},null),g.null),p("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[p("TSTypeParameter")]),p("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",p("Expression")),p("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[p("TSType")]),p("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",p("Identifier")).field("const",Boolean,g.false).field("declare",Boolean,g.false).field("members",[p("TSEnumMember")]).field("initializer",v(p("Expression"),null),g.null),p("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",p("Identifier")).field("declare",Boolean,g.false).field("typeAnnotation",p("TSType")),p("TSModuleBlock").bases("Node").build("body").field("body",[p("Statement")]),p("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",v(b,m)).field("declare",Boolean,g.false).field("global",Boolean,g.false).field("body",v(p("TSModuleBlock"),p("TSModuleDeclaration"),null),g.null),p("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",b).field("qualifier",v(m,void 0),g.undefined),p("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",p("Identifier")).field("isExport",Boolean,g.false).field("moduleReference",v(m,p("TSExternalModuleReference"))),p("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",b),p("TSExportAssignment").bases("Statement").build("expression").field("expression",p("Expression")),p("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",p("Identifier")),p("TSInterfaceBody").bases("Node").build("body").field("body",[O]),p("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",m),p("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",m).field("declare",Boolean,g.false).field("extends",v([p("TSExpressionWithTypeArguments")],null),g.null).field("body",p("TSInterfaceBody")),p("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",v("public","private","protected",void 0),g.undefined).field("readonly",Boolean,g.false).field("parameter",v(p("Identifier"),p("AssignmentPattern"))),p("ClassProperty").field("access",v("public","private","protected",void 0),g.undefined),p("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),p("ClassBody").field("body",[v(p("MethodDefinition"),p("VariableDeclarator"),p("ClassPropertyDefinition"),p("ClassProperty"),p("ClassPrivateProperty"),p("ClassAccessorProperty"),p("ClassMethod"),p("ClassPrivateMethod"),p("StaticBlock"),p("TSDeclareMethod"),O)])}e.default=l,(0,a.maybeSetModuleExports)(function(){return t})})(Ha,Ha.exports)),Ha.exports}var Dh={},jy;function P$(){return jy||(jy=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.namedTypes=void 0,t.namedTypes||(t.namedTypes={})})(Dh)),Dh}var Zy;function ir(){return Zy||(Zy=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.visit=t.use=t.Type=t.someField=t.PathVisitor=t.Path=t.NodePath=t.namedTypes=t.getSupertypeNames=t.getFieldValue=t.getFieldNames=t.getBuilderName=t.finalize=t.eachField=t.defineMethod=t.builtInTypes=t.builders=t.astNodesAreEquivalent=void 0;var e=et,i=e.__importDefault(u$()),n=e.__importDefault(tl()),r=e.__importDefault(x$()),s=e.__importDefault(Zb()),a=e.__importDefault(b$()),l=e.__importDefault(S$()),u=e.__importDefault(w$()),h=P$();Object.defineProperty(t,"namedTypes",{enumerable:!0,get:function(){return h.namedTypes}});var c=(0,i.default)([n.default,r.default,s.default,a.default,l.default,u.default]),p=c.astNodesAreEquivalent,v=c.builders,g=c.builtInTypes,b=c.defineMethod,m=c.eachField,x=c.finalize,O=c.getBuilderName,P=c.getFieldNames,S=c.getFieldValue,w=c.getSupertypeNames,C=c.namedTypes,E=c.NodePath,k=c.Path,A=c.PathVisitor,$=c.someField,F=c.Type,I=c.use,B=c.visit;t.astNodesAreEquivalent=p,t.builders=v,t.builtInTypes=g,t.defineMethod=b,t.eachField=m,t.finalize=x,t.getBuilderName=O,t.getFieldNames=P,t.getFieldValue=S,t.getSupertypeNames=w,t.NodePath=E,t.Path=k,t.PathVisitor=A,t.someField=$,t.Type=F,t.use=I,t.visit=B,Object.assign(h.namedTypes,C)})(Ah)),Ah}var oa={},_h,Vy;function hr(){if(Vy)return _h;Vy=1;var t="Invariant failed";function e(i,n){if(!i)throw new Error(t)}return _h=e,_h}var la={},pt={},ua={},Ih={},Rl={},zl={},Uy;function T$(){if(Uy)return zl;Uy=1;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return zl.encode=function(e){if(0<=e&&e<t.length)return t[e];throw new TypeError("Must be between 0 and 63: "+e)},zl.decode=function(e){var i=65,n=90,r=97,s=122,a=48,l=57,u=43,h=47,c=26,p=52;return i<=e&&e<=n?e-i:r<=e&&e<=s?e-r+c:a<=e&&e<=l?e-a+p:e==u?62:e==h?63:-1},zl}var qy;function Ub(){if(qy)return Rl;qy=1;var t=T$(),e=5,i=1<<e,n=i-1,r=i;function s(l){return l<0?(-l<<1)+1:(l<<1)+0}function a(l){var u=(l&1)===1,h=l>>1;return u?-h:h}return Rl.encode=function(u){var h="",c,p=s(u);do c=p&n,p>>>=e,p>0&&(c|=r),h+=t.encode(c);while(p>0);return h},Rl.decode=function(u,h,c){var p=u.length,v=0,g=0,b,m;do{if(h>=p)throw new Error("Expected more digits in base 64 VLQ value.");if(m=t.decode(u.charCodeAt(h++)),m===-1)throw new Error("Invalid base64 digit: "+u.charAt(h-1));b=!!(m&r),m&=n,v=v+(m<<g),g+=e}while(b);c.value=a(v),c.rest=h},Rl}var Nh={},Wy;function il(){return Wy||(Wy=1,(function(t){function e(w,C,E){if(C in w)return w[C];if(arguments.length===3)return E;throw new Error('"'+C+'" is a required argument.')}t.getArg=e;var i=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function r(w){var C=w.match(i);return C?{scheme:C[1],auth:C[2],host:C[3],port:C[4],path:C[5]}:null}t.urlParse=r;function s(w){var C="";return w.scheme&&(C+=w.scheme+":"),C+="//",w.auth&&(C+=w.auth+"@"),w.host&&(C+=w.host),w.port&&(C+=":"+w.port),w.path&&(C+=w.path),C}t.urlGenerate=s;function a(w){var C=w,E=r(w);if(E){if(!E.path)return w;C=E.path}for(var k=t.isAbsolute(C),A=C.split(/\/+/),$,F=0,I=A.length-1;I>=0;I--)$=A[I],$==="."?A.splice(I,1):$===".."?F++:F>0&&($===""?(A.splice(I+1,F),F=0):(A.splice(I,2),F--));return C=A.join("/"),C===""&&(C=k?"/":"."),E?(E.path=C,s(E)):C}t.normalize=a;function l(w,C){w===""&&(w="."),C===""&&(C=".");var E=r(C),k=r(w);if(k&&(w=k.path||"/"),E&&!E.scheme)return k&&(E.scheme=k.scheme),s(E);if(E||C.match(n))return C;if(k&&!k.host&&!k.path)return k.host=C,s(k);var A=C.charAt(0)==="/"?C:a(w.replace(/\/+$/,"")+"/"+C);return k?(k.path=A,s(k)):A}t.join=l,t.isAbsolute=function(w){return w.charAt(0)==="/"||i.test(w)};function u(w,C){w===""&&(w="."),w=w.replace(/\/$/,"");for(var E=0;C.indexOf(w+"/")!==0;){var k=w.lastIndexOf("/");if(k<0||(w=w.slice(0,k),w.match(/^([^\/]+:\/)?\/*$/)))return C;++E}return Array(E+1).join("../")+C.substr(w.length+1)}t.relative=u;var h=(function(){var w=Object.create(null);return!("__proto__"in w)})();function c(w){return w}function p(w){return g(w)?"$"+w:w}t.toSetString=h?c:p;function v(w){return g(w)?w.slice(1):w}t.fromSetString=h?c:v;function g(w){if(!w)return!1;var C=w.length;if(C<9||w.charCodeAt(C-1)!==95||w.charCodeAt(C-2)!==95||w.charCodeAt(C-3)!==111||w.charCodeAt(C-4)!==116||w.charCodeAt(C-5)!==111||w.charCodeAt(C-6)!==114||w.charCodeAt(C-7)!==112||w.charCodeAt(C-8)!==95||w.charCodeAt(C-9)!==95)return!1;for(var E=C-10;E>=0;E--)if(w.charCodeAt(E)!==36)return!1;return!0}function b(w,C,E){var k=x(w.source,C.source);return k!==0||(k=w.originalLine-C.originalLine,k!==0)||(k=w.originalColumn-C.originalColumn,k!==0||E)||(k=w.generatedColumn-C.generatedColumn,k!==0)||(k=w.generatedLine-C.generatedLine,k!==0)?k:x(w.name,C.name)}t.compareByOriginalPositions=b;function m(w,C,E){var k=w.generatedLine-C.generatedLine;return k!==0||(k=w.generatedColumn-C.generatedColumn,k!==0||E)||(k=x(w.source,C.source),k!==0)||(k=w.originalLine-C.originalLine,k!==0)||(k=w.originalColumn-C.originalColumn,k!==0)?k:x(w.name,C.name)}t.compareByGeneratedPositionsDeflated=m;function x(w,C){return w===C?0:w===null?1:C===null?-1:w>C?1:-1}function O(w,C){var E=w.generatedLine-C.generatedLine;return E!==0||(E=w.generatedColumn-C.generatedColumn,E!==0)||(E=x(w.source,C.source),E!==0)||(E=w.originalLine-C.originalLine,E!==0)||(E=w.originalColumn-C.originalColumn,E!==0)?E:x(w.name,C.name)}t.compareByGeneratedPositionsInflated=O;function P(w){return JSON.parse(w.replace(/^\)]}'[^\n]*\n/,""))}t.parseSourceMapInput=P;function S(w,C,E){if(C=C||"",w&&(w[w.length-1]!=="/"&&C[0]!=="/"&&(w+="/"),C=w+C),E){var k=r(E);if(!k)throw new Error("sourceMapURL could not be parsed");if(k.path){var A=k.path.lastIndexOf("/");A>=0&&(k.path=k.path.substring(0,A+1))}C=l(s(k),C)}return a(C)}t.computeSourceURL=S})(Nh)),Nh}var Mh={},Yy;function qb(){if(Yy)return Mh;Yy=1;var t=il(),e=Object.prototype.hasOwnProperty,i=typeof Map<"u";function n(){this._array=[],this._set=i?new Map:Object.create(null)}return n.fromArray=function(s,a){for(var l=new n,u=0,h=s.length;u<h;u++)l.add(s[u],a);return l},n.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},n.prototype.add=function(s,a){var l=i?s:t.toSetString(s),u=i?this.has(s):e.call(this._set,l),h=this._array.length;(!u||a)&&this._array.push(s),u||(i?this._set.set(s,h):this._set[l]=h)},n.prototype.has=function(s){if(i)return this._set.has(s);var a=t.toSetString(s);return e.call(this._set,a)},n.prototype.indexOf=function(s){if(i){var a=this._set.get(s);if(a>=0)return a}else{var l=t.toSetString(s);if(e.call(this._set,l))return this._set[l]}throw new Error('"'+s+'" is not in the set.')},n.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},n.prototype.toArray=function(){return this._array.slice()},Mh.ArraySet=n,Mh}var $h={},Gy;function C$(){if(Gy)return $h;Gy=1;var t=il();function e(n,r){var s=n.generatedLine,a=r.generatedLine,l=n.generatedColumn,u=r.generatedColumn;return a>s||a==s&&u>=l||t.compareByGeneratedPositionsInflated(n,r)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return i.prototype.unsortedForEach=function(r,s){this._array.forEach(r,s)},i.prototype.add=function(r){e(this._last,r)?(this._last=r,this._array.push(r)):(this._sorted=!1,this._array.push(r))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},$h.MappingList=i,$h}var Hy;function Wb(){if(Hy)return Ih;Hy=1;var t=Ub(),e=il(),i=qb().ArraySet,n=C$().MappingList;function r(s){s||(s={}),this._file=e.getArg(s,"file",null),this._sourceRoot=e.getArg(s,"sourceRoot",null),this._skipValidation=e.getArg(s,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new n,this._sourcesContents=null}return r.prototype._version=3,r.fromSourceMap=function(a){var l=a.sourceRoot,u=new r({file:a.file,sourceRoot:l});return a.eachMapping(function(h){var c={generated:{line:h.generatedLine,column:h.generatedColumn}};h.source!=null&&(c.source=h.source,l!=null&&(c.source=e.relative(l,c.source)),c.original={line:h.originalLine,column:h.originalColumn},h.name!=null&&(c.name=h.name)),u.addMapping(c)}),a.sources.forEach(function(h){var c=h;l!==null&&(c=e.relative(l,h)),u._sources.has(c)||u._sources.add(c);var p=a.sourceContentFor(h);p!=null&&u.setSourceContent(h,p)}),u},r.prototype.addMapping=function(a){var l=e.getArg(a,"generated"),u=e.getArg(a,"original",null),h=e.getArg(a,"source",null),c=e.getArg(a,"name",null);this._skipValidation||this._validateMapping(l,u,h,c),h!=null&&(h=String(h),this._sources.has(h)||this._sources.add(h)),c!=null&&(c=String(c),this._names.has(c)||this._names.add(c)),this._mappings.add({generatedLine:l.line,generatedColumn:l.column,originalLine:u!=null&&u.line,originalColumn:u!=null&&u.column,source:h,name:c})},r.prototype.setSourceContent=function(a,l){var u=a;this._sourceRoot!=null&&(u=e.relative(this._sourceRoot,u)),l!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[e.toSetString(u)]=l):this._sourcesContents&&(delete this._sourcesContents[e.toSetString(u)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},r.prototype.applySourceMap=function(a,l,u){var h=l;if(l==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);h=a.file}var c=this._sourceRoot;c!=null&&(h=e.relative(c,h));var p=new i,v=new i;this._mappings.unsortedForEach(function(g){if(g.source===h&&g.originalLine!=null){var b=a.originalPositionFor({line:g.originalLine,column:g.originalColumn});b.source!=null&&(g.source=b.source,u!=null&&(g.source=e.join(u,g.source)),c!=null&&(g.source=e.relative(c,g.source)),g.originalLine=b.line,g.originalColumn=b.column,b.name!=null&&(g.name=b.name))}var m=g.source;m!=null&&!p.has(m)&&p.add(m);var x=g.name;x!=null&&!v.has(x)&&v.add(x)},this),this._sources=p,this._names=v,a.sources.forEach(function(g){var b=a.sourceContentFor(g);b!=null&&(u!=null&&(g=e.join(u,g)),c!=null&&(g=e.relative(c,g)),this.setSourceContent(g,b))},this)},r.prototype._validateMapping=function(a,l,u,h){if(l&&typeof l.line!="number"&&typeof l.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!l&&!u&&!h)){if(a&&"line"in a&&"column"in a&&l&&"line"in l&&"column"in l&&a.line>0&&a.column>=0&&l.line>0&&l.column>=0&&u)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:a,source:u,original:l,name:h}))}},r.prototype._serializeMappings=function(){for(var a=0,l=1,u=0,h=0,c=0,p=0,v="",g,b,m,x,O=this._mappings.toArray(),P=0,S=O.length;P<S;P++){if(b=O[P],g="",b.generatedLine!==l)for(a=0;b.generatedLine!==l;)g+=";",l++;else if(P>0){if(!e.compareByGeneratedPositionsInflated(b,O[P-1]))continue;g+=","}g+=t.encode(b.generatedColumn-a),a=b.generatedColumn,b.source!=null&&(x=this._sources.indexOf(b.source),g+=t.encode(x-p),p=x,g+=t.encode(b.originalLine-1-h),h=b.originalLine-1,g+=t.encode(b.originalColumn-u),u=b.originalColumn,b.name!=null&&(m=this._names.indexOf(b.name),g+=t.encode(m-c),c=m)),v+=g}return v},r.prototype._generateSourcesContent=function(a,l){return a.map(function(u){if(!this._sourcesContents)return null;l!=null&&(u=e.relative(l,u));var h=e.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,h)?this._sourcesContents[h]:null},this)},r.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},r.prototype.toString=function(){return JSON.stringify(this.toJSON())},Ih.SourceMapGenerator=r,Ih}var ca={},Lh={},Jy;function k$(){return Jy||(Jy=1,(function(t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2;function e(i,n,r,s,a,l){var u=Math.floor((n-i)/2)+i,h=a(r,s[u],!0);return h===0?u:h>0?n-u>1?e(u,n,r,s,a,l):l==t.LEAST_UPPER_BOUND?n<s.length?n:-1:u:u-i>1?e(i,u,r,s,a,l):l==t.LEAST_UPPER_BOUND?u:i<0?-1:i}t.search=function(n,r,s,a){if(r.length===0)return-1;var l=e(-1,r.length,n,r,s,a||t.GREATEST_LOWER_BOUND);if(l<0)return-1;for(;l-1>=0&&s(r[l],r[l-1],!0)===0;)--l;return l}})(Lh)),Lh}var Bh={},Ky;function E$(){if(Ky)return Bh;Ky=1;function t(n,r,s){var a=n[r];n[r]=n[s],n[s]=a}function e(n,r){return Math.round(n+Math.random()*(r-n))}function i(n,r,s,a){if(s<a){var l=e(s,a),u=s-1;t(n,l,a);for(var h=n[a],c=s;c<a;c++)r(n[c],h)<=0&&(u+=1,t(n,u,c));t(n,u+1,c);var p=u+1;i(n,r,s,p-1),i(n,r,p+1,a)}}return Bh.quickSort=function(n,r){i(n,r,0,n.length-1)},Bh}var e0;function A$(){if(e0)return ca;e0=1;var t=il(),e=k$(),i=qb().ArraySet,n=Ub(),r=E$().quickSort;function s(h,c){var p=h;return typeof h=="string"&&(p=t.parseSourceMapInput(h)),p.sections!=null?new u(p,c):new a(p,c)}s.fromSourceMap=function(h,c){return a.fromSourceMap(h,c)},s.prototype._version=3,s.prototype.__generatedMappings=null,Object.defineProperty(s.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),s.prototype.__originalMappings=null,Object.defineProperty(s.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),s.prototype._charIsMappingSeparator=function(c,p){var v=c.charAt(p);return v===";"||v===","},s.prototype._parseMappings=function(c,p){throw new Error("Subclasses must implement _parseMappings")},s.GENERATED_ORDER=1,s.ORIGINAL_ORDER=2,s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.prototype.eachMapping=function(c,p,v){var g=p||null,b=v||s.GENERATED_ORDER,m;switch(b){case s.GENERATED_ORDER:m=this._generatedMappings;break;case s.ORIGINAL_ORDER:m=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var x=this.sourceRoot;m.map(function(O){var P=O.source===null?null:this._sources.at(O.source);return P=t.computeSourceURL(x,P,this._sourceMapURL),{source:P,generatedLine:O.generatedLine,generatedColumn:O.generatedColumn,originalLine:O.originalLine,originalColumn:O.originalColumn,name:O.name===null?null:this._names.at(O.name)}},this).forEach(c,g)},s.prototype.allGeneratedPositionsFor=function(c){var p=t.getArg(c,"line"),v={source:t.getArg(c,"source"),originalLine:p,originalColumn:t.getArg(c,"column",0)};if(v.source=this._findSourceIndex(v.source),v.source<0)return[];var g=[],b=this._findMapping(v,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,e.LEAST_UPPER_BOUND);if(b>=0){var m=this._originalMappings[b];if(c.column===void 0)for(var x=m.originalLine;m&&m.originalLine===x;)g.push({line:t.getArg(m,"generatedLine",null),column:t.getArg(m,"generatedColumn",null),lastColumn:t.getArg(m,"lastGeneratedColumn",null)}),m=this._originalMappings[++b];else for(var O=m.originalColumn;m&&m.originalLine===p&&m.originalColumn==O;)g.push({line:t.getArg(m,"generatedLine",null),column:t.getArg(m,"generatedColumn",null),lastColumn:t.getArg(m,"lastGeneratedColumn",null)}),m=this._originalMappings[++b]}return g},ca.SourceMapConsumer=s;function a(h,c){var p=h;typeof h=="string"&&(p=t.parseSourceMapInput(h));var v=t.getArg(p,"version"),g=t.getArg(p,"sources"),b=t.getArg(p,"names",[]),m=t.getArg(p,"sourceRoot",null),x=t.getArg(p,"sourcesContent",null),O=t.getArg(p,"mappings"),P=t.getArg(p,"file",null);if(v!=this._version)throw new Error("Unsupported version: "+v);m&&(m=t.normalize(m)),g=g.map(String).map(t.normalize).map(function(S){return m&&t.isAbsolute(m)&&t.isAbsolute(S)?t.relative(m,S):S}),this._names=i.fromArray(b.map(String),!0),this._sources=i.fromArray(g,!0),this._absoluteSources=this._sources.toArray().map(function(S){return t.computeSourceURL(m,S,c)}),this.sourceRoot=m,this.sourcesContent=x,this._mappings=O,this._sourceMapURL=c,this.file=P}a.prototype=Object.create(s.prototype),a.prototype.consumer=s,a.prototype._findSourceIndex=function(h){var c=h;if(this.sourceRoot!=null&&(c=t.relative(this.sourceRoot,c)),this._sources.has(c))return this._sources.indexOf(c);var p;for(p=0;p<this._absoluteSources.length;++p)if(this._absoluteSources[p]==h)return p;return-1},a.fromSourceMap=function(c,p){var v=Object.create(a.prototype),g=v._names=i.fromArray(c._names.toArray(),!0),b=v._sources=i.fromArray(c._sources.toArray(),!0);v.sourceRoot=c._sourceRoot,v.sourcesContent=c._generateSourcesContent(v._sources.toArray(),v.sourceRoot),v.file=c._file,v._sourceMapURL=p,v._absoluteSources=v._sources.toArray().map(function(E){return t.computeSourceURL(v.sourceRoot,E,p)});for(var m=c._mappings.toArray().slice(),x=v.__generatedMappings=[],O=v.__originalMappings=[],P=0,S=m.length;P<S;P++){var w=m[P],C=new l;C.generatedLine=w.generatedLine,C.generatedColumn=w.generatedColumn,w.source&&(C.source=b.indexOf(w.source),C.originalLine=w.originalLine,C.originalColumn=w.originalColumn,w.name&&(C.name=g.indexOf(w.name)),O.push(C)),x.push(C)}return r(v.__originalMappings,t.compareByOriginalPositions),v},a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function l(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}a.prototype._parseMappings=function(c,p){for(var v=1,g=0,b=0,m=0,x=0,O=0,P=c.length,S=0,w={},C={},E=[],k=[],A,$,F,I,B;S<P;)if(c.charAt(S)===";")v++,S++,g=0;else if(c.charAt(S)===",")S++;else{for(A=new l,A.generatedLine=v,I=S;I<P&&!this._charIsMappingSeparator(c,I);I++);if($=c.slice(S,I),F=w[$],F)S+=$.length;else{for(F=[];S<I;)n.decode(c,S,C),B=C.value,S=C.rest,F.push(B);if(F.length===2)throw new Error("Found a source, but no line and column");if(F.length===3)throw new Error("Found a source and line, but no column");w[$]=F}A.generatedColumn=g+F[0],g=A.generatedColumn,F.length>1&&(A.source=x+F[1],x+=F[1],A.originalLine=b+F[2],b=A.originalLine,A.originalLine+=1,A.originalColumn=m+F[3],m=A.originalColumn,F.length>4&&(A.name=O+F[4],O+=F[4])),k.push(A),typeof A.originalLine=="number"&&E.push(A)}r(k,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=k,r(E,t.compareByOriginalPositions),this.__originalMappings=E},a.prototype._findMapping=function(c,p,v,g,b,m){if(c[v]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+c[v]);if(c[g]<0)throw new TypeError("Column must be greater than or equal to 0, got "+c[g]);return e.search(c,p,b,m)},a.prototype.computeColumnSpans=function(){for(var c=0;c<this._generatedMappings.length;++c){var p=this._generatedMappings[c];if(c+1<this._generatedMappings.length){var v=this._generatedMappings[c+1];if(p.generatedLine===v.generatedLine){p.lastGeneratedColumn=v.generatedColumn-1;continue}}p.lastGeneratedColumn=1/0}},a.prototype.originalPositionFor=function(c){var p={generatedLine:t.getArg(c,"line"),generatedColumn:t.getArg(c,"column")},v=this._findMapping(p,this._generatedMappings,"generatedLine","generatedColumn",t.compareByGeneratedPositionsDeflated,t.getArg(c,"bias",s.GREATEST_LOWER_BOUND));if(v>=0){var g=this._generatedMappings[v];if(g.generatedLine===p.generatedLine){var b=t.getArg(g,"source",null);b!==null&&(b=this._sources.at(b),b=t.computeSourceURL(this.sourceRoot,b,this._sourceMapURL));var m=t.getArg(g,"name",null);return m!==null&&(m=this._names.at(m)),{source:b,line:t.getArg(g,"originalLine",null),column:t.getArg(g,"originalColumn",null),name:m}}}return{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(c){return c==null}):!1},a.prototype.sourceContentFor=function(c,p){if(!this.sourcesContent)return null;var v=this._findSourceIndex(c);if(v>=0)return this.sourcesContent[v];var g=c;this.sourceRoot!=null&&(g=t.relative(this.sourceRoot,g));var b;if(this.sourceRoot!=null&&(b=t.urlParse(this.sourceRoot))){var m=g.replace(/^file:\/\//,"");if(b.scheme=="file"&&this._sources.has(m))return this.sourcesContent[this._sources.indexOf(m)];if((!b.path||b.path=="/")&&this._sources.has("/"+g))return this.sourcesContent[this._sources.indexOf("/"+g)]}if(p)return null;throw new Error('"'+g+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(c){var p=t.getArg(c,"source");if(p=this._findSourceIndex(p),p<0)return{line:null,column:null,lastColumn:null};var v={source:p,originalLine:t.getArg(c,"line"),originalColumn:t.getArg(c,"column")},g=this._findMapping(v,this._originalMappings,"originalLine","originalColumn",t.compareByOriginalPositions,t.getArg(c,"bias",s.GREATEST_LOWER_BOUND));if(g>=0){var b=this._originalMappings[g];if(b.source===v.source)return{line:t.getArg(b,"generatedLine",null),column:t.getArg(b,"generatedColumn",null),lastColumn:t.getArg(b,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},ca.BasicSourceMapConsumer=a;function u(h,c){var p=h;typeof h=="string"&&(p=t.parseSourceMapInput(h));var v=t.getArg(p,"version"),g=t.getArg(p,"sections");if(v!=this._version)throw new Error("Unsupported version: "+v);this._sources=new i,this._names=new i;var b={line:-1,column:0};this._sections=g.map(function(m){if(m.url)throw new Error("Support for url field in sections not implemented.");var x=t.getArg(m,"offset"),O=t.getArg(x,"line"),P=t.getArg(x,"column");if(O<b.line||O===b.line&&P<b.column)throw new Error("Section offsets must be ordered and non-overlapping.");return b=x,{generatedOffset:{generatedLine:O+1,generatedColumn:P+1},consumer:new s(t.getArg(m,"map"),c)}})}return u.prototype=Object.create(s.prototype),u.prototype.constructor=s,u.prototype._version=3,Object.defineProperty(u.prototype,"sources",{get:function(){for(var h=[],c=0;c<this._sections.length;c++)for(var p=0;p<this._sections[c].consumer.sources.length;p++)h.push(this._sections[c].consumer.sources[p]);return h}}),u.prototype.originalPositionFor=function(c){var p={generatedLine:t.getArg(c,"line"),generatedColumn:t.getArg(c,"column")},v=e.search(p,this._sections,function(b,m){var x=b.generatedLine-m.generatedOffset.generatedLine;return x||b.generatedColumn-m.generatedOffset.generatedColumn}),g=this._sections[v];return g?g.consumer.originalPositionFor({line:p.generatedLine-(g.generatedOffset.generatedLine-1),column:p.generatedColumn-(g.generatedOffset.generatedLine===p.generatedLine?g.generatedOffset.generatedColumn-1:0),bias:c.bias}):{source:null,line:null,column:null,name:null}},u.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(c){return c.consumer.hasContentsOfAllSources()})},u.prototype.sourceContentFor=function(c,p){for(var v=0;v<this._sections.length;v++){var g=this._sections[v],b=g.consumer.sourceContentFor(c,!0);if(b)return b}if(p)return null;throw new Error('"'+c+'" is not in the SourceMap.')},u.prototype.generatedPositionFor=function(c){for(var p=0;p<this._sections.length;p++){var v=this._sections[p];if(v.consumer._findSourceIndex(t.getArg(c,"source"))!==-1){var g=v.consumer.generatedPositionFor(c);if(g){var b={line:g.line+(v.generatedOffset.generatedLine-1),column:g.column+(v.generatedOffset.generatedLine===g.line?v.generatedOffset.generatedColumn-1:0)};return b}}}return{line:null,column:null}},u.prototype._parseMappings=function(c,p){this.__generatedMappings=[],this.__originalMappings=[];for(var v=0;v<this._sections.length;v++)for(var g=this._sections[v],b=g.consumer._generatedMappings,m=0;m<b.length;m++){var x=b[m],O=g.consumer._sources.at(x.source);O=t.computeSourceURL(g.consumer.sourceRoot,O,this._sourceMapURL),this._sources.add(O),O=this._sources.indexOf(O);var P=null;x.name&&(P=g.consumer._names.at(x.name),this._names.add(P),P=this._names.indexOf(P));var S={source:O,generatedLine:x.generatedLine+(g.generatedOffset.generatedLine-1),generatedColumn:x.generatedColumn+(g.generatedOffset.generatedLine===x.generatedLine?g.generatedOffset.generatedColumn-1:0),originalLine:x.originalLine,originalColumn:x.originalColumn,name:P};this.__generatedMappings.push(S),typeof S.originalLine=="number"&&this.__originalMappings.push(S)}r(this.__generatedMappings,t.compareByGeneratedPositionsDeflated),r(this.__originalMappings,t.compareByOriginalPositions)},ca.IndexedSourceMapConsumer=u,ca}var Qh={},t0;function D$(){if(t0)return Qh;t0=1;var t=Wb().SourceMapGenerator,e=il(),i=/(\r?\n)/,n=10,r="$$$isSourceNode$$$";function s(a,l,u,h,c){this.children=[],this.sourceContents={},this.line=a??null,this.column=l??null,this.source=u??null,this.name=c??null,this[r]=!0,h!=null&&this.add(h)}return s.fromStringWithSourceMap=function(l,u,h){var c=new s,p=l.split(i),v=0,g=function(){var P=w(),S=w()||"";return P+S;function w(){return v<p.length?p[v++]:void 0}},b=1,m=0,x=null;return u.eachMapping(function(P){if(x!==null)if(b<P.generatedLine)O(x,g()),b++,m=0;else{var S=p[v]||"",w=S.substr(0,P.generatedColumn-m);p[v]=S.substr(P.generatedColumn-m),m=P.generatedColumn,O(x,w),x=P;return}for(;b<P.generatedLine;)c.add(g()),b++;if(m<P.generatedColumn){var S=p[v]||"";c.add(S.substr(0,P.generatedColumn)),p[v]=S.substr(P.generatedColumn),m=P.generatedColumn}x=P},this),v<p.length&&(x&&O(x,g()),c.add(p.splice(v).join(""))),u.sources.forEach(function(P){var S=u.sourceContentFor(P);S!=null&&(h!=null&&(P=e.join(h,P)),c.setSourceContent(P,S))}),c;function O(P,S){if(P===null||P.source===void 0)c.add(S);else{var w=h?e.join(h,P.source):P.source;c.add(new s(P.originalLine,P.originalColumn,w,S,P.name))}}},s.prototype.add=function(l){if(Array.isArray(l))l.forEach(function(u){this.add(u)},this);else if(l[r]||typeof l=="string")l&&this.children.push(l);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+l);return this},s.prototype.prepend=function(l){if(Array.isArray(l))for(var u=l.length-1;u>=0;u--)this.prepend(l[u]);else if(l[r]||typeof l=="string")this.children.unshift(l);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+l);return this},s.prototype.walk=function(l){for(var u,h=0,c=this.children.length;h<c;h++)u=this.children[h],u[r]?u.walk(l):u!==""&&l(u,{source:this.source,line:this.line,column:this.column,name:this.name})},s.prototype.join=function(l){var u,h,c=this.children.length;if(c>0){for(u=[],h=0;h<c-1;h++)u.push(this.children[h]),u.push(l);u.push(this.children[h]),this.children=u}return this},s.prototype.replaceRight=function(l,u){var h=this.children[this.children.length-1];return h[r]?h.replaceRight(l,u):typeof h=="string"?this.children[this.children.length-1]=h.replace(l,u):this.children.push("".replace(l,u)),this},s.prototype.setSourceContent=function(l,u){this.sourceContents[e.toSetString(l)]=u},s.prototype.walkSourceContents=function(l){for(var u=0,h=this.children.length;u<h;u++)this.children[u][r]&&this.children[u].walkSourceContents(l);for(var c=Object.keys(this.sourceContents),u=0,h=c.length;u<h;u++)l(e.fromSetString(c[u]),this.sourceContents[c[u]])},s.prototype.toString=function(){var l="";return this.walk(function(u){l+=u}),l},s.prototype.toStringWithSourceMap=function(l){var u={code:"",line:1,column:0},h=new t(l),c=!1,p=null,v=null,g=null,b=null;return this.walk(function(m,x){u.code+=m,x.source!==null&&x.line!==null&&x.column!==null?((p!==x.source||v!==x.line||g!==x.column||b!==x.name)&&h.addMapping({source:x.source,original:{line:x.line,column:x.column},generated:{line:u.line,column:u.column},name:x.name}),p=x.source,v=x.line,g=x.column,b=x.name,c=!0):c&&(h.addMapping({generated:{line:u.line,column:u.column}}),p=null,c=!1);for(var O=0,P=m.length;O<P;O++)m.charCodeAt(O)===n?(u.line++,u.column=0,O+1===P?(p=null,c=!1):c&&h.addMapping({source:x.source,original:{line:x.line,column:x.column},generated:{line:u.line,column:u.column},name:x.name})):u.column++}),this.walkSourceContents(function(m,x){h.setSourceContent(m,x)}),{code:u.code,map:h}},Qh.SourceNode=s,Qh}var i0;function Yb(){return i0||(i0=1,ua.SourceMapGenerator=Wb().SourceMapGenerator,ua.SourceMapConsumer=A$().SourceMapConsumer,ua.SourceNode=D$().SourceNode),ua}var n0;function $n(){if(n0)return pt;n0=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.isTrailingCommaEnabled=pt.getParentExportDeclaration=pt.isExportDeclaration=pt.fixFaultyLocations=pt.getTrueLoc=pt.composeSourceMaps=pt.copyPos=pt.comparePos=pt.getUnionOfKeys=pt.getOption=pt.isBrowser=pt.getLineTerminator=void 0;var t=et,e=t.__importDefault(hr()),i=t.__importStar(ir()),n=i.namedTypes,r=t.__importDefault(Yb()),s=r.default.SourceMapConsumer,a=r.default.SourceMapGenerator,l=Object.prototype.hasOwnProperty;function u(){return h()?`
|
|
47
|
+
`:Bb.EOL||`
|
|
48
|
+
`}pt.getLineTerminator=u;function h(){return typeof window<"u"&&typeof window.document<"u"}pt.isBrowser=h;function c(k,A,$){return k&&l.call(k,A)?k[A]:$}pt.getOption=c;function p(){for(var k=[],A=0;A<arguments.length;A++)k[A]=arguments[A];for(var $={},F=k.length,I=0;I<F;++I)for(var B=Object.keys(k[I]),j=B.length,M=0;M<j;++M)$[B[M]]=!0;return $}pt.getUnionOfKeys=p;function v(k,A){return k.line-A.line||k.column-A.column}pt.comparePos=v;function g(k){return{line:k.line,column:k.column}}pt.copyPos=g;function b(k,A){if(k){if(!A)return k}else return A||null;var $=new s(k),F=new s(A),I=new a({file:A.file,sourceRoot:A.sourceRoot}),B={};return F.eachMapping(function(j){var M=$.originalPositionFor({line:j.originalLine,column:j.originalColumn}),q=M.source;if(q!==null){I.addMapping({source:q,original:g(M),generated:{line:j.generatedLine,column:j.generatedColumn},name:j.name});var X=$.sourceContentFor(q);X&&!l.call(B,q)&&(B[q]=X,I.setSourceContent(q,X))}}),I.toJSON()}pt.composeSourceMaps=b;function m(k,A){if(!k.loc)return null;var $={start:k.loc.start,end:k.loc.end};function F(I){x($,I.loc)}return k.declaration&&k.declaration.decorators&&w(k)&&k.declaration.decorators.forEach(F),v($.start,$.end)<0&&($.start=g($.start),A.skipSpaces($.start,!1,!0),v($.start,$.end)<0&&($.end=g($.end),A.skipSpaces($.end,!0,!0))),k.comments&&k.comments.forEach(F),$}pt.getTrueLoc=m;function x(k,A){k&&A&&(v(A.start,k.start)<0&&(k.start=A.start),v(k.end,A.end)<0&&(k.end=A.end))}function O(k,A){var $=k.loc;if($&&($.start.line<1&&($.start.line=1),$.end.line<1&&($.end.line=1)),k.type==="File"&&($.start=A.firstPos(),$.end=A.lastPos()),P(k,A),S(k,A),$&&k.decorators)k.decorators.forEach(function(j){x($,j.loc)});else if(k.declaration&&w(k)){k.declaration.loc=null;var F=k.declaration.decorators;F&&F.forEach(function(j){x($,j.loc)})}else if(n.MethodDefinition&&n.MethodDefinition.check(k)||n.Property.check(k)&&(k.method||k.shorthand))k.value.loc=null,n.FunctionExpression.check(k.value)&&(k.value.id=null);else if(k.type==="ObjectTypeProperty"){var I=k.loc,B=I&&I.end;B&&(B=g(B),A.prevPos(B)&&A.charAt(B)===","&&(B=A.skipSpaces(B,!0,!0))&&(I.end=B))}}pt.fixFaultyLocations=O;function P(k,A){if(k.type!=="ForStatement")return;function $(F){for(var I=F&&F.loc,B=I&&I.start,j=I&&g(I.end);B&&j&&v(B,j)<0&&(A.prevPos(j),A.charAt(j)===";");)I.end.line=j.line,I.end.column=j.column}$(k.init),$(k.test),$(k.update)}function S(k,A){if(k.type==="TemplateLiteral"&&k.quasis.length!==0){if(k.loc){var $=g(k.loc.start);(0,e.default)(A.charAt($)==="`"),(0,e.default)(A.nextPos($));var F=k.quasis[0];v(F.loc.start,$)<0&&(F.loc.start=$);var I=g(k.loc.end);(0,e.default)(A.prevPos(I)),(0,e.default)(A.charAt(I)==="`");var B=k.quasis[k.quasis.length-1];v(I,B.loc.end)<0&&(B.loc.end=I)}k.expressions.forEach(function(j,M){var q=A.skipSpaces(j.loc.start,!0,!1);if(A.prevPos(q)&&A.charAt(q)==="{"&&A.prevPos(q)&&A.charAt(q)==="$"){var X=k.quasis[M];v(q,X.loc.end)<0&&(X.loc.end=q)}var Y=A.skipSpaces(j.loc.end,!1,!1);if(A.charAt(Y)==="}"){(0,e.default)(A.nextPos(Y));var V=k.quasis[M+1];v(V.loc.start,Y)<0&&(V.loc.start=Y)}})}}function w(k){if(k)switch(k.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}pt.isExportDeclaration=w;function C(k){var A=k.getParentNode();return k.getName()==="declaration"&&w(A)?A:null}pt.getParentExportDeclaration=C;function E(k,A){var $=k.trailingComma;return typeof $=="object"?!!$[A]:!!$}return pt.isTrailingCommaEnabled=E,pt}var ha={},Pu={exports:{}},_$=Pu.exports,r0;function Gb(){return r0||(r0=1,(function(t,e){(function(n,r){t.exports=r()})(_$,function(){return(function(i){var n={};function r(s){if(n[s])return n[s].exports;var a=n[s]={exports:{},id:s,loaded:!1};return i[s].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}return r.m=i,r.c=n,r.p="",r(0)})([function(i,n,r){Object.defineProperty(n,"__esModule",{value:!0});var s=r(1),a=r(3),l=r(8),u=r(15);function h(b,m,x){var O=null,P=function(F,I){x&&x(F,I),O&&O.visit(F,I)},S=typeof x=="function"?P:null,w=!1;if(m){w=typeof m.comment=="boolean"&&m.comment;var C=typeof m.attachComment=="boolean"&&m.attachComment;(w||C)&&(O=new s.CommentHandler,O.attach=C,m.comment=!0,S=P)}var E=!1;m&&typeof m.sourceType=="string"&&(E=m.sourceType==="module");var k;m&&typeof m.jsx=="boolean"&&m.jsx?k=new a.JSXParser(b,m,S):k=new l.Parser(b,m,S);var A=E?k.parseModule():k.parseScript(),$=A;return w&&O&&($.comments=O.comments),k.config.tokens&&($.tokens=k.tokens),k.config.tolerant&&($.errors=k.errorHandler.errors),$}n.parse=h;function c(b,m,x){var O=m||{};return O.sourceType="module",h(b,O,x)}n.parseModule=c;function p(b,m,x){var O=m||{};return O.sourceType="script",h(b,O,x)}n.parseScript=p;function v(b,m,x){var O=new u.Tokenizer(b,m),P;P=[];try{for(;;){var S=O.getNextToken();if(!S)break;x&&(S=x(S)),P.push(S)}}catch(w){O.errorHandler.tolerate(w)}return O.errorHandler.tolerant&&(P.errors=O.errors()),P}n.tokenize=v;var g=r(2);n.Syntax=g.Syntax,n.version="4.0.1"},function(i,n,r){Object.defineProperty(n,"__esModule",{value:!0});var s=r(2),a=(function(){function l(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return l.prototype.insertInnerComments=function(u,h){if(u.type===s.Syntax.BlockStatement&&u.body.length===0){for(var c=[],p=this.leading.length-1;p>=0;--p){var v=this.leading[p];h.end.offset>=v.start&&(c.unshift(v.comment),this.leading.splice(p,1),this.trailing.splice(p,1))}c.length&&(u.innerComments=c)}},l.prototype.findTrailingComments=function(u){var h=[];if(this.trailing.length>0){for(var c=this.trailing.length-1;c>=0;--c){var p=this.trailing[c];p.start>=u.end.offset&&h.unshift(p.comment)}return this.trailing.length=0,h}var v=this.stack[this.stack.length-1];if(v&&v.node.trailingComments){var g=v.node.trailingComments[0];g&&g.range[0]>=u.end.offset&&(h=v.node.trailingComments,delete v.node.trailingComments)}return h},l.prototype.findLeadingComments=function(u){for(var h=[],c;this.stack.length>0;){var p=this.stack[this.stack.length-1];if(p&&p.start>=u.start.offset)c=p.node,this.stack.pop();else break}if(c){for(var v=c.leadingComments?c.leadingComments.length:0,g=v-1;g>=0;--g){var b=c.leadingComments[g];b.range[1]<=u.start.offset&&(h.unshift(b),c.leadingComments.splice(g,1))}return c.leadingComments&&c.leadingComments.length===0&&delete c.leadingComments,h}for(var g=this.leading.length-1;g>=0;--g){var p=this.leading[g];p.start<=u.start.offset&&(h.unshift(p.comment),this.leading.splice(g,1))}return h},l.prototype.visitNode=function(u,h){if(!(u.type===s.Syntax.Program&&u.body.length>0)){this.insertInnerComments(u,h);var c=this.findTrailingComments(h),p=this.findLeadingComments(h);p.length>0&&(u.leadingComments=p),c.length>0&&(u.trailingComments=c),this.stack.push({node:u,start:h.start.offset})}},l.prototype.visitComment=function(u,h){var c=u.type[0]==="L"?"Line":"Block",p={type:c,value:u.value};if(u.range&&(p.range=u.range),u.loc&&(p.loc=u.loc),this.comments.push(p),this.attach){var v={comment:{type:c,value:u.value,range:[h.start.offset,h.end.offset]},start:h.start.offset};u.loc&&(v.comment.loc=u.loc),u.type=c,this.leading.push(v),this.trailing.push(v)}},l.prototype.visit=function(u,h){u.type==="LineComment"?this.visitComment(u,h):u.type==="BlockComment"?this.visitComment(u,h):this.attach&&this.visitNode(u,h)},l})();n.CommentHandler=a},function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(i,n,r){var s=this&&this.__extends||(function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,O){x.__proto__=O}||function(x,O){for(var P in O)O.hasOwnProperty(P)&&(x[P]=O[P])};return function(x,O){m(x,O);function P(){this.constructor=x}x.prototype=O===null?Object.create(O):(P.prototype=O.prototype,new P)}})();Object.defineProperty(n,"__esModule",{value:!0});var a=r(4),l=r(5),u=r(6),h=r(7),c=r(8),p=r(13),v=r(14);p.TokenName[100]="JSXIdentifier",p.TokenName[101]="JSXText";function g(m){var x;switch(m.type){case u.JSXSyntax.JSXIdentifier:var O=m;x=O.name;break;case u.JSXSyntax.JSXNamespacedName:var P=m;x=g(P.namespace)+":"+g(P.name);break;case u.JSXSyntax.JSXMemberExpression:var S=m;x=g(S.object)+"."+g(S.property);break}return x}var b=(function(m){s(x,m);function x(O,P,S){return m.call(this,O,P,S)||this}return x.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():m.prototype.parsePrimaryExpression.call(this)},x.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},x.prototype.finishJSX=function(){this.nextToken()},x.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},x.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},x.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},x.prototype.scanXHTMLEntity=function(O){for(var P="&",S=!0,w=!1,C=!1,E=!1;!this.scanner.eof()&&S&&!w;){var k=this.scanner.source[this.scanner.index];if(k===O)break;if(w=k===";",P+=k,++this.scanner.index,!w)switch(P.length){case 2:C=k==="#";break;case 3:C&&(E=k==="x",S=E||a.Character.isDecimalDigit(k.charCodeAt(0)),C=C&&!E);break;default:S=S&&!(C&&!a.Character.isDecimalDigit(k.charCodeAt(0))),S=S&&!(E&&!a.Character.isHexDigit(k.charCodeAt(0)));break}}if(S&&w&&P.length>2){var A=P.substr(1,P.length-2);C&&A.length>1?P=String.fromCharCode(parseInt(A.substr(1),10)):E&&A.length>2?P=String.fromCharCode(parseInt("0"+A.substr(1),16)):!C&&!E&&v.XHTMLEntities[A]&&(P=v.XHTMLEntities[A])}return P},x.prototype.lexJSX=function(){var O=this.scanner.source.charCodeAt(this.scanner.index);if(O===60||O===62||O===47||O===58||O===61||O===123||O===125){var P=this.scanner.source[this.scanner.index++];return{type:7,value:P,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(O===34||O===39){for(var S=this.scanner.index,w=this.scanner.source[this.scanner.index++],C="";!this.scanner.eof();){var E=this.scanner.source[this.scanner.index++];if(E===w)break;E==="&"?C+=this.scanXHTMLEntity(w):C+=E}return{type:8,value:C,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:S,end:this.scanner.index}}if(O===46){var k=this.scanner.source.charCodeAt(this.scanner.index+1),A=this.scanner.source.charCodeAt(this.scanner.index+2),P=k===46&&A===46?"...":".",S=this.scanner.index;return this.scanner.index+=P.length,{type:7,value:P,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:S,end:this.scanner.index}}if(O===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(a.Character.isIdentifierStart(O)&&O!==92){var S=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var E=this.scanner.source.charCodeAt(this.scanner.index);if(a.Character.isIdentifierPart(E)&&E!==92)++this.scanner.index;else if(E===45)++this.scanner.index;else break}var $=this.scanner.source.slice(S,this.scanner.index);return{type:100,value:$,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:S,end:this.scanner.index}}return this.scanner.lex()},x.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var O=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(O)),O},x.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var O=this.scanner.index,P="";!this.scanner.eof();){var S=this.scanner.source[this.scanner.index];if(S==="{"||S==="<")break;++this.scanner.index,P+=S,a.Character.isLineTerminator(S.charCodeAt(0))&&(++this.scanner.lineNumber,S==="\r"&&this.scanner.source[this.scanner.index]===`
|
|
49
|
+
`&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var w={type:101,value:P,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:O,end:this.scanner.index};return P.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(w)),w},x.prototype.peekJSXToken=function(){var O=this.scanner.saveState();this.scanner.scanComments();var P=this.lexJSX();return this.scanner.restoreState(O),P},x.prototype.expectJSX=function(O){var P=this.nextJSXToken();(P.type!==7||P.value!==O)&&this.throwUnexpectedToken(P)},x.prototype.matchJSX=function(O){var P=this.peekJSXToken();return P.type===7&&P.value===O},x.prototype.parseJSXIdentifier=function(){var O=this.createJSXNode(),P=this.nextJSXToken();return P.type!==100&&this.throwUnexpectedToken(P),this.finalize(O,new l.JSXIdentifier(P.value))},x.prototype.parseJSXElementName=function(){var O=this.createJSXNode(),P=this.parseJSXIdentifier();if(this.matchJSX(":")){var S=P;this.expectJSX(":");var w=this.parseJSXIdentifier();P=this.finalize(O,new l.JSXNamespacedName(S,w))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var C=P;this.expectJSX(".");var E=this.parseJSXIdentifier();P=this.finalize(O,new l.JSXMemberExpression(C,E))}return P},x.prototype.parseJSXAttributeName=function(){var O=this.createJSXNode(),P,S=this.parseJSXIdentifier();if(this.matchJSX(":")){var w=S;this.expectJSX(":");var C=this.parseJSXIdentifier();P=this.finalize(O,new l.JSXNamespacedName(w,C))}else P=S;return P},x.prototype.parseJSXStringLiteralAttribute=function(){var O=this.createJSXNode(),P=this.nextJSXToken();P.type!==8&&this.throwUnexpectedToken(P);var S=this.getTokenRaw(P);return this.finalize(O,new h.Literal(P.value,S))},x.prototype.parseJSXExpressionAttribute=function(){var O=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var P=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(O,new l.JSXExpressionContainer(P))},x.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},x.prototype.parseJSXNameValueAttribute=function(){var O=this.createJSXNode(),P=this.parseJSXAttributeName(),S=null;return this.matchJSX("=")&&(this.expectJSX("="),S=this.parseJSXAttributeValue()),this.finalize(O,new l.JSXAttribute(P,S))},x.prototype.parseJSXSpreadAttribute=function(){var O=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var P=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(O,new l.JSXSpreadAttribute(P))},x.prototype.parseJSXAttributes=function(){for(var O=[];!this.matchJSX("/")&&!this.matchJSX(">");){var P=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();O.push(P)}return O},x.prototype.parseJSXOpeningElement=function(){var O=this.createJSXNode();this.expectJSX("<");var P=this.parseJSXElementName(),S=this.parseJSXAttributes(),w=this.matchJSX("/");return w&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(O,new l.JSXOpeningElement(P,w,S))},x.prototype.parseJSXBoundaryElement=function(){var O=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var P=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(O,new l.JSXClosingElement(P))}var S=this.parseJSXElementName(),w=this.parseJSXAttributes(),C=this.matchJSX("/");return C&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(O,new l.JSXOpeningElement(S,C,w))},x.prototype.parseJSXEmptyExpression=function(){var O=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(O,new l.JSXEmptyExpression)},x.prototype.parseJSXExpressionContainer=function(){var O=this.createJSXNode();this.expectJSX("{");var P;return this.matchJSX("}")?(P=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),P=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(O,new l.JSXExpressionContainer(P))},x.prototype.parseJSXChildren=function(){for(var O=[];!this.scanner.eof();){var P=this.createJSXChildNode(),S=this.nextJSXText();if(S.start<S.end){var w=this.getTokenRaw(S),C=this.finalize(P,new l.JSXText(S.value,w));O.push(C)}if(this.scanner.source[this.scanner.index]==="{"){var E=this.parseJSXExpressionContainer();O.push(E)}else break}return O},x.prototype.parseComplexJSXElement=function(O){for(var P=[];!this.scanner.eof();){O.children=O.children.concat(this.parseJSXChildren());var S=this.createJSXChildNode(),w=this.parseJSXBoundaryElement();if(w.type===u.JSXSyntax.JSXOpeningElement){var C=w;if(C.selfClosing){var E=this.finalize(S,new l.JSXElement(C,[],null));O.children.push(E)}else P.push(O),O={node:S,opening:C,closing:null,children:[]}}if(w.type===u.JSXSyntax.JSXClosingElement){O.closing=w;var k=g(O.opening.name),A=g(O.closing.name);if(k!==A&&this.tolerateError("Expected corresponding JSX closing tag for %0",k),P.length>0){var E=this.finalize(O.node,new l.JSXElement(O.opening,O.children,O.closing));O=P[P.length-1],O.children.push(E),P.pop()}else break}}return O},x.prototype.parseJSXElement=function(){var O=this.createJSXNode(),P=this.parseJSXOpeningElement(),S=[],w=null;if(!P.selfClosing){var C=this.parseComplexJSXElement({node:O,opening:P,closing:w,children:S});S=C.children,w=C.closing}return this.finalize(O,new l.JSXElement(P,S,w))},x.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var O=this.parseJSXElement();return this.finishJSX(),O},x.prototype.isStartOfExpression=function(){return m.prototype.isStartOfExpression.call(this)||this.match("<")},x})(c.Parser);n.JSXParser=b},function(i,n){Object.defineProperty(n,"__esModule",{value:!0});var r={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};n.Character={fromCodePoint:function(s){return s<65536?String.fromCharCode(s):String.fromCharCode(55296+(s-65536>>10))+String.fromCharCode(56320+(s-65536&1023))},isWhiteSpace:function(s){return s===32||s===9||s===11||s===12||s===160||s>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(s)>=0},isLineTerminator:function(s){return s===10||s===13||s===8232||s===8233},isIdentifierStart:function(s){return s===36||s===95||s>=65&&s<=90||s>=97&&s<=122||s===92||s>=128&&r.NonAsciiIdentifierStart.test(n.Character.fromCodePoint(s))},isIdentifierPart:function(s){return s===36||s===95||s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===92||s>=128&&r.NonAsciiIdentifierPart.test(n.Character.fromCodePoint(s))},isDecimalDigit:function(s){return s>=48&&s<=57},isHexDigit:function(s){return s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102},isOctalDigit:function(s){return s>=48&&s<=55}}},function(i,n,r){Object.defineProperty(n,"__esModule",{value:!0});var s=r(6),a=(function(){function O(P){this.type=s.JSXSyntax.JSXClosingElement,this.name=P}return O})();n.JSXClosingElement=a;var l=(function(){function O(P,S,w){this.type=s.JSXSyntax.JSXElement,this.openingElement=P,this.children=S,this.closingElement=w}return O})();n.JSXElement=l;var u=(function(){function O(){this.type=s.JSXSyntax.JSXEmptyExpression}return O})();n.JSXEmptyExpression=u;var h=(function(){function O(P){this.type=s.JSXSyntax.JSXExpressionContainer,this.expression=P}return O})();n.JSXExpressionContainer=h;var c=(function(){function O(P){this.type=s.JSXSyntax.JSXIdentifier,this.name=P}return O})();n.JSXIdentifier=c;var p=(function(){function O(P,S){this.type=s.JSXSyntax.JSXMemberExpression,this.object=P,this.property=S}return O})();n.JSXMemberExpression=p;var v=(function(){function O(P,S){this.type=s.JSXSyntax.JSXAttribute,this.name=P,this.value=S}return O})();n.JSXAttribute=v;var g=(function(){function O(P,S){this.type=s.JSXSyntax.JSXNamespacedName,this.namespace=P,this.name=S}return O})();n.JSXNamespacedName=g;var b=(function(){function O(P,S,w){this.type=s.JSXSyntax.JSXOpeningElement,this.name=P,this.selfClosing=S,this.attributes=w}return O})();n.JSXOpeningElement=b;var m=(function(){function O(P){this.type=s.JSXSyntax.JSXSpreadAttribute,this.argument=P}return O})();n.JSXSpreadAttribute=m;var x=(function(){function O(P,S){this.type=s.JSXSyntax.JSXText,this.value=P,this.raw=S}return O})();n.JSXText=x},function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(i,n,r){Object.defineProperty(n,"__esModule",{value:!0});var s=r(2),a=(function(){function ce(ge){this.type=s.Syntax.ArrayExpression,this.elements=ge}return ce})();n.ArrayExpression=a;var l=(function(){function ce(ge){this.type=s.Syntax.ArrayPattern,this.elements=ge}return ce})();n.ArrayPattern=l;var u=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ArrowFunctionExpression,this.id=null,this.params=ge,this.body=Ce,this.generator=!1,this.expression=Ue,this.async=!1}return ce})();n.ArrowFunctionExpression=u;var h=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.AssignmentExpression,this.operator=ge,this.left=Ce,this.right=Ue}return ce})();n.AssignmentExpression=h;var c=(function(){function ce(ge,Ce){this.type=s.Syntax.AssignmentPattern,this.left=ge,this.right=Ce}return ce})();n.AssignmentPattern=c;var p=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ArrowFunctionExpression,this.id=null,this.params=ge,this.body=Ce,this.generator=!1,this.expression=Ue,this.async=!0}return ce})();n.AsyncArrowFunctionExpression=p;var v=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.FunctionDeclaration,this.id=ge,this.params=Ce,this.body=Ue,this.generator=!1,this.expression=!1,this.async=!0}return ce})();n.AsyncFunctionDeclaration=v;var g=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.FunctionExpression,this.id=ge,this.params=Ce,this.body=Ue,this.generator=!1,this.expression=!1,this.async=!0}return ce})();n.AsyncFunctionExpression=g;var b=(function(){function ce(ge){this.type=s.Syntax.AwaitExpression,this.argument=ge}return ce})();n.AwaitExpression=b;var m=(function(){function ce(ge,Ce,Ue){var $t=ge==="||"||ge==="&&";this.type=$t?s.Syntax.LogicalExpression:s.Syntax.BinaryExpression,this.operator=ge,this.left=Ce,this.right=Ue}return ce})();n.BinaryExpression=m;var x=(function(){function ce(ge){this.type=s.Syntax.BlockStatement,this.body=ge}return ce})();n.BlockStatement=x;var O=(function(){function ce(ge){this.type=s.Syntax.BreakStatement,this.label=ge}return ce})();n.BreakStatement=O;var P=(function(){function ce(ge,Ce){this.type=s.Syntax.CallExpression,this.callee=ge,this.arguments=Ce}return ce})();n.CallExpression=P;var S=(function(){function ce(ge,Ce){this.type=s.Syntax.CatchClause,this.param=ge,this.body=Ce}return ce})();n.CatchClause=S;var w=(function(){function ce(ge){this.type=s.Syntax.ClassBody,this.body=ge}return ce})();n.ClassBody=w;var C=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ClassDeclaration,this.id=ge,this.superClass=Ce,this.body=Ue}return ce})();n.ClassDeclaration=C;var E=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ClassExpression,this.id=ge,this.superClass=Ce,this.body=Ue}return ce})();n.ClassExpression=E;var k=(function(){function ce(ge,Ce){this.type=s.Syntax.MemberExpression,this.computed=!0,this.object=ge,this.property=Ce}return ce})();n.ComputedMemberExpression=k;var A=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ConditionalExpression,this.test=ge,this.consequent=Ce,this.alternate=Ue}return ce})();n.ConditionalExpression=A;var $=(function(){function ce(ge){this.type=s.Syntax.ContinueStatement,this.label=ge}return ce})();n.ContinueStatement=$;var F=(function(){function ce(){this.type=s.Syntax.DebuggerStatement}return ce})();n.DebuggerStatement=F;var I=(function(){function ce(ge,Ce){this.type=s.Syntax.ExpressionStatement,this.expression=ge,this.directive=Ce}return ce})();n.Directive=I;var B=(function(){function ce(ge,Ce){this.type=s.Syntax.DoWhileStatement,this.body=ge,this.test=Ce}return ce})();n.DoWhileStatement=B;var j=(function(){function ce(){this.type=s.Syntax.EmptyStatement}return ce})();n.EmptyStatement=j;var M=(function(){function ce(ge){this.type=s.Syntax.ExportAllDeclaration,this.source=ge}return ce})();n.ExportAllDeclaration=M;var q=(function(){function ce(ge){this.type=s.Syntax.ExportDefaultDeclaration,this.declaration=ge}return ce})();n.ExportDefaultDeclaration=q;var X=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ExportNamedDeclaration,this.declaration=ge,this.specifiers=Ce,this.source=Ue}return ce})();n.ExportNamedDeclaration=X;var Y=(function(){function ce(ge,Ce){this.type=s.Syntax.ExportSpecifier,this.exported=Ce,this.local=ge}return ce})();n.ExportSpecifier=Y;var V=(function(){function ce(ge){this.type=s.Syntax.ExpressionStatement,this.expression=ge}return ce})();n.ExpressionStatement=V;var oe=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ForInStatement,this.left=ge,this.right=Ce,this.body=Ue,this.each=!1}return ce})();n.ForInStatement=oe;var ae=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.ForOfStatement,this.left=ge,this.right=Ce,this.body=Ue}return ce})();n.ForOfStatement=ae;var fe=(function(){function ce(ge,Ce,Ue,$t){this.type=s.Syntax.ForStatement,this.init=ge,this.test=Ce,this.update=Ue,this.body=$t}return ce})();n.ForStatement=fe;var D=(function(){function ce(ge,Ce,Ue,$t){this.type=s.Syntax.FunctionDeclaration,this.id=ge,this.params=Ce,this.body=Ue,this.generator=$t,this.expression=!1,this.async=!1}return ce})();n.FunctionDeclaration=D;var Z=(function(){function ce(ge,Ce,Ue,$t){this.type=s.Syntax.FunctionExpression,this.id=ge,this.params=Ce,this.body=Ue,this.generator=$t,this.expression=!1,this.async=!1}return ce})();n.FunctionExpression=Z;var L=(function(){function ce(ge){this.type=s.Syntax.Identifier,this.name=ge}return ce})();n.Identifier=L;var se=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.IfStatement,this.test=ge,this.consequent=Ce,this.alternate=Ue}return ce})();n.IfStatement=se;var de=(function(){function ce(ge,Ce){this.type=s.Syntax.ImportDeclaration,this.specifiers=ge,this.source=Ce}return ce})();n.ImportDeclaration=de;var ie=(function(){function ce(ge){this.type=s.Syntax.ImportDefaultSpecifier,this.local=ge}return ce})();n.ImportDefaultSpecifier=ie;var R=(function(){function ce(ge){this.type=s.Syntax.ImportNamespaceSpecifier,this.local=ge}return ce})();n.ImportNamespaceSpecifier=R;var Q=(function(){function ce(ge,Ce){this.type=s.Syntax.ImportSpecifier,this.local=ge,this.imported=Ce}return ce})();n.ImportSpecifier=Q;var xe=(function(){function ce(ge,Ce){this.type=s.Syntax.LabeledStatement,this.label=ge,this.body=Ce}return ce})();n.LabeledStatement=xe;var Re=(function(){function ce(ge,Ce){this.type=s.Syntax.Literal,this.value=ge,this.raw=Ce}return ce})();n.Literal=Re;var ke=(function(){function ce(ge,Ce){this.type=s.Syntax.MetaProperty,this.meta=ge,this.property=Ce}return ce})();n.MetaProperty=ke;var $e=(function(){function ce(ge,Ce,Ue,$t,pr){this.type=s.Syntax.MethodDefinition,this.key=ge,this.computed=Ce,this.value=Ue,this.kind=$t,this.static=pr}return ce})();n.MethodDefinition=$e;var te=(function(){function ce(ge){this.type=s.Syntax.Program,this.body=ge,this.sourceType="module"}return ce})();n.Module=te;var H=(function(){function ce(ge,Ce){this.type=s.Syntax.NewExpression,this.callee=ge,this.arguments=Ce}return ce})();n.NewExpression=H;var re=(function(){function ce(ge){this.type=s.Syntax.ObjectExpression,this.properties=ge}return ce})();n.ObjectExpression=re;var G=(function(){function ce(ge){this.type=s.Syntax.ObjectPattern,this.properties=ge}return ce})();n.ObjectPattern=G;var J=(function(){function ce(ge,Ce,Ue,$t,pr,Jr){this.type=s.Syntax.Property,this.key=Ce,this.computed=Ue,this.value=$t,this.kind=ge,this.method=pr,this.shorthand=Jr}return ce})();n.Property=J;var le=(function(){function ce(ge,Ce,Ue,$t){this.type=s.Syntax.Literal,this.value=ge,this.raw=Ce,this.regex={pattern:Ue,flags:$t}}return ce})();n.RegexLiteral=le;var ve=(function(){function ce(ge){this.type=s.Syntax.RestElement,this.argument=ge}return ce})();n.RestElement=ve;var we=(function(){function ce(ge){this.type=s.Syntax.ReturnStatement,this.argument=ge}return ce})();n.ReturnStatement=we;var K=(function(){function ce(ge){this.type=s.Syntax.Program,this.body=ge,this.sourceType="script"}return ce})();n.Script=K;var ue=(function(){function ce(ge){this.type=s.Syntax.SequenceExpression,this.expressions=ge}return ce})();n.SequenceExpression=ue;var me=(function(){function ce(ge){this.type=s.Syntax.SpreadElement,this.argument=ge}return ce})();n.SpreadElement=me;var Pe=(function(){function ce(ge,Ce){this.type=s.Syntax.MemberExpression,this.computed=!1,this.object=ge,this.property=Ce}return ce})();n.StaticMemberExpression=Pe;var Ve=(function(){function ce(){this.type=s.Syntax.Super}return ce})();n.Super=Ve;var He=(function(){function ce(ge,Ce){this.type=s.Syntax.SwitchCase,this.test=ge,this.consequent=Ce}return ce})();n.SwitchCase=He;var Tt=(function(){function ce(ge,Ce){this.type=s.Syntax.SwitchStatement,this.discriminant=ge,this.cases=Ce}return ce})();n.SwitchStatement=Tt;var Je=(function(){function ce(ge,Ce){this.type=s.Syntax.TaggedTemplateExpression,this.tag=ge,this.quasi=Ce}return ce})();n.TaggedTemplateExpression=Je;var ei=(function(){function ce(ge,Ce){this.type=s.Syntax.TemplateElement,this.value=ge,this.tail=Ce}return ce})();n.TemplateElement=ei;var qt=(function(){function ce(ge,Ce){this.type=s.Syntax.TemplateLiteral,this.quasis=ge,this.expressions=Ce}return ce})();n.TemplateLiteral=qt;var Bn=(function(){function ce(){this.type=s.Syntax.ThisExpression}return ce})();n.ThisExpression=Bn;var gn=(function(){function ce(ge){this.type=s.Syntax.ThrowStatement,this.argument=ge}return ce})();n.ThrowStatement=gn;var ji=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.TryStatement,this.block=ge,this.handler=Ce,this.finalizer=Ue}return ce})();n.TryStatement=ji;var Zs=(function(){function ce(ge,Ce){this.type=s.Syntax.UnaryExpression,this.operator=ge,this.argument=Ce,this.prefix=!0}return ce})();n.UnaryExpression=Zs;var yn=(function(){function ce(ge,Ce,Ue){this.type=s.Syntax.UpdateExpression,this.operator=ge,this.argument=Ce,this.prefix=Ue}return ce})();n.UpdateExpression=yn;var zt=(function(){function ce(ge,Ce){this.type=s.Syntax.VariableDeclaration,this.declarations=ge,this.kind=Ce}return ce})();n.VariableDeclaration=zt;var ti=(function(){function ce(ge,Ce){this.type=s.Syntax.VariableDeclarator,this.id=ge,this.init=Ce}return ce})();n.VariableDeclarator=ti;var Qn=(function(){function ce(ge,Ce){this.type=s.Syntax.WhileStatement,this.test=ge,this.body=Ce}return ce})();n.WhileStatement=Qn;var Hr=(function(){function ce(ge,Ce){this.type=s.Syntax.WithStatement,this.object=ge,this.body=Ce}return ce})();n.WithStatement=Hr;var Vs=(function(){function ce(ge,Ce){this.type=s.Syntax.YieldExpression,this.argument=ge,this.delegate=Ce}return ce})();n.YieldExpression=Vs},function(i,n,r){Object.defineProperty(n,"__esModule",{value:!0});var s=r(9),a=r(10),l=r(11),u=r(7),h=r(12),c=r(2),p=r(13),v="ArrowParameterPlaceHolder",g=(function(){function b(m,x,O){x===void 0&&(x={}),this.config={range:typeof x.range=="boolean"&&x.range,loc:typeof x.loc=="boolean"&&x.loc,source:null,tokens:typeof x.tokens=="boolean"&&x.tokens,comment:typeof x.comment=="boolean"&&x.comment,tolerant:typeof x.tolerant=="boolean"&&x.tolerant},this.config.loc&&x.source&&x.source!==null&&(this.config.source=String(x.source)),this.delegate=O,this.errorHandler=new a.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new h.Scanner(m,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return b.prototype.throwError=function(m){var x=Array.prototype.slice.call(arguments,1),O=m.replace(/%(\d)/g,function(C,E){return s.assert(E<x.length,"Message reference must be in range"),x[E]}),P=this.lastMarker.index,S=this.lastMarker.line,w=this.lastMarker.column+1;throw this.errorHandler.createError(P,S,w,O)},b.prototype.tolerateError=function(m){var x=Array.prototype.slice.call(arguments,1),O=m.replace(/%(\d)/g,function(C,E){return s.assert(E<x.length,"Message reference must be in range"),x[E]}),P=this.lastMarker.index,S=this.scanner.lineNumber,w=this.lastMarker.column+1;this.errorHandler.tolerateError(P,S,w,O)},b.prototype.unexpectedTokenError=function(m,x){var O=x||l.Messages.UnexpectedToken,P;if(m?(x||(O=m.type===2?l.Messages.UnexpectedEOS:m.type===3?l.Messages.UnexpectedIdentifier:m.type===6?l.Messages.UnexpectedNumber:m.type===8?l.Messages.UnexpectedString:m.type===10?l.Messages.UnexpectedTemplate:l.Messages.UnexpectedToken,m.type===4&&(this.scanner.isFutureReservedWord(m.value)?O=l.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(m.value)&&(O=l.Messages.StrictReservedWord))),P=m.value):P="ILLEGAL",O=O.replace("%0",P),m&&typeof m.lineNumber=="number"){var S=m.start,w=m.lineNumber,C=this.lastMarker.index-this.lastMarker.column,E=m.start-C+1;return this.errorHandler.createError(S,w,E,O)}else{var S=this.lastMarker.index,w=this.lastMarker.line,E=this.lastMarker.column+1;return this.errorHandler.createError(S,w,E,O)}},b.prototype.throwUnexpectedToken=function(m,x){throw this.unexpectedTokenError(m,x)},b.prototype.tolerateUnexpectedToken=function(m,x){this.errorHandler.tolerate(this.unexpectedTokenError(m,x))},b.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var m=this.scanner.scanComments();if(m.length>0&&this.delegate)for(var x=0;x<m.length;++x){var O=m[x],P=void 0;P={type:O.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(O.slice[0],O.slice[1])},this.config.range&&(P.range=O.range),this.config.loc&&(P.loc=O.loc);var S={start:{line:O.loc.start.line,column:O.loc.start.column,offset:O.range[0]},end:{line:O.loc.end.line,column:O.loc.end.column,offset:O.range[1]}};this.delegate(P,S)}}},b.prototype.getTokenRaw=function(m){return this.scanner.source.slice(m.start,m.end)},b.prototype.convertToken=function(m){var x={type:p.TokenName[m.type],value:this.getTokenRaw(m)};if(this.config.range&&(x.range=[m.start,m.end]),this.config.loc&&(x.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),m.type===9){var O=m.pattern,P=m.flags;x.regex={pattern:O,flags:P}}return x},b.prototype.nextToken=function(){var m=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var x=this.scanner.lex();return this.hasLineTerminator=m.lineNumber!==x.lineNumber,x&&this.context.strict&&x.type===3&&this.scanner.isStrictModeReservedWord(x.value)&&(x.type=4),this.lookahead=x,this.config.tokens&&x.type!==2&&this.tokens.push(this.convertToken(x)),m},b.prototype.nextRegexToken=function(){this.collectComments();var m=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(m))),this.lookahead=m,this.nextToken(),m},b.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},b.prototype.startNode=function(m,x){x===void 0&&(x=0);var O=m.start-m.lineStart,P=m.lineNumber;return O<0&&(O+=x,P--),{index:m.start,line:P,column:O}},b.prototype.finalize=function(m,x){if(this.config.range&&(x.range=[m.index,this.lastMarker.index]),this.config.loc&&(x.loc={start:{line:m.line,column:m.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(x.loc.source=this.config.source)),this.delegate){var O={start:{line:m.line,column:m.column,offset:m.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(x,O)}return x},b.prototype.expect=function(m){var x=this.nextToken();(x.type!==7||x.value!==m)&&this.throwUnexpectedToken(x)},b.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var m=this.lookahead;m.type===7&&m.value===","?this.nextToken():m.type===7&&m.value===";"?(this.nextToken(),this.tolerateUnexpectedToken(m)):this.tolerateUnexpectedToken(m,l.Messages.UnexpectedToken)}else this.expect(",")},b.prototype.expectKeyword=function(m){var x=this.nextToken();(x.type!==4||x.value!==m)&&this.throwUnexpectedToken(x)},b.prototype.match=function(m){return this.lookahead.type===7&&this.lookahead.value===m},b.prototype.matchKeyword=function(m){return this.lookahead.type===4&&this.lookahead.value===m},b.prototype.matchContextualKeyword=function(m){return this.lookahead.type===3&&this.lookahead.value===m},b.prototype.matchAssign=function(){if(this.lookahead.type!==7)return!1;var m=this.lookahead.value;return m==="="||m==="*="||m==="**="||m==="/="||m==="%="||m==="+="||m==="-="||m==="<<="||m===">>="||m===">>>="||m==="&="||m==="^="||m==="|="},b.prototype.isolateCoverGrammar=function(m){var x=this.context.isBindingElement,O=this.context.isAssignmentTarget,P=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var S=m.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=x,this.context.isAssignmentTarget=O,this.context.firstCoverInitializedNameError=P,S},b.prototype.inheritCoverGrammar=function(m){var x=this.context.isBindingElement,O=this.context.isAssignmentTarget,P=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var S=m.call(this);return this.context.isBindingElement=this.context.isBindingElement&&x,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&O,this.context.firstCoverInitializedNameError=P||this.context.firstCoverInitializedNameError,S},b.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type!==2&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},b.prototype.parsePrimaryExpression=function(){var m=this.createNode(),x,O,P;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),x=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(m,new u.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,l.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,O=this.nextToken(),P=this.getTokenRaw(O),x=this.finalize(m,new u.Literal(O.value,P));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,O=this.nextToken(),P=this.getTokenRaw(O),x=this.finalize(m,new u.Literal(O.value==="true",P));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,O=this.nextToken(),P=this.getTokenRaw(O),x=this.finalize(m,new u.Literal(null,P));break;case 10:x=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,x=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":x=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":x=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,O=this.nextRegexToken(),P=this.getTokenRaw(O),x=this.finalize(m,new u.RegexLiteral(O.regex,P,O.pattern,O.flags));break;default:x=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?x=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?x=this.finalize(m,new u.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?x=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),x=this.finalize(m,new u.ThisExpression)):this.matchKeyword("class")?x=this.parseClassExpression():x=this.throwUnexpectedToken(this.nextToken()));break;default:x=this.throwUnexpectedToken(this.nextToken())}return x},b.prototype.parseSpreadElement=function(){var m=this.createNode();this.expect("...");var x=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(m,new u.SpreadElement(x))},b.prototype.parseArrayInitializer=function(){var m=this.createNode(),x=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),x.push(null);else if(this.match("...")){var O=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),x.push(O)}else x.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(m,new u.ArrayExpression(x))},b.prototype.parsePropertyMethod=function(m){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var x=this.context.strict,O=this.context.allowStrictDirective;this.context.allowStrictDirective=m.simple;var P=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&m.firstRestricted&&this.tolerateUnexpectedToken(m.firstRestricted,m.message),this.context.strict&&m.stricted&&this.tolerateUnexpectedToken(m.stricted,m.message),this.context.strict=x,this.context.allowStrictDirective=O,P},b.prototype.parsePropertyMethodFunction=function(){var m=!1,x=this.createNode(),O=this.context.allowYield;this.context.allowYield=!0;var P=this.parseFormalParameters(),S=this.parsePropertyMethod(P);return this.context.allowYield=O,this.finalize(x,new u.FunctionExpression(null,P.params,S,m))},b.prototype.parsePropertyMethodAsyncFunction=function(){var m=this.createNode(),x=this.context.allowYield,O=this.context.await;this.context.allowYield=!1,this.context.await=!0;var P=this.parseFormalParameters(),S=this.parsePropertyMethod(P);return this.context.allowYield=x,this.context.await=O,this.finalize(m,new u.AsyncFunctionExpression(null,P.params,S))},b.prototype.parseObjectPropertyKey=function(){var m=this.createNode(),x=this.nextToken(),O;switch(x.type){case 8:case 6:this.context.strict&&x.octal&&this.tolerateUnexpectedToken(x,l.Messages.StrictOctalLiteral);var P=this.getTokenRaw(x);O=this.finalize(m,new u.Literal(x.value,P));break;case 3:case 1:case 5:case 4:O=this.finalize(m,new u.Identifier(x.value));break;case 7:x.value==="["?(O=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):O=this.throwUnexpectedToken(x);break;default:O=this.throwUnexpectedToken(x)}return O},b.prototype.isPropertyKey=function(m,x){return m.type===c.Syntax.Identifier&&m.name===x||m.type===c.Syntax.Literal&&m.value===x},b.prototype.parseObjectProperty=function(m){var x=this.createNode(),O=this.lookahead,P,S=null,w=null,C=!1,E=!1,k=!1,A=!1;if(O.type===3){var $=O.value;this.nextToken(),C=this.match("["),A=!this.hasLineTerminator&&$==="async"&&!this.match(":")&&!this.match("(")&&!this.match("*")&&!this.match(","),S=A?this.parseObjectPropertyKey():this.finalize(x,new u.Identifier($))}else this.match("*")?this.nextToken():(C=this.match("["),S=this.parseObjectPropertyKey());var F=this.qualifiedPropertyName(this.lookahead);if(O.type===3&&!A&&O.value==="get"&&F)P="get",C=this.match("["),S=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod();else if(O.type===3&&!A&&O.value==="set"&&F)P="set",C=this.match("["),S=this.parseObjectPropertyKey(),w=this.parseSetterMethod();else if(O.type===7&&O.value==="*"&&F)P="init",C=this.match("["),S=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),E=!0;else if(S||this.throwUnexpectedToken(this.lookahead),P="init",this.match(":")&&!A)!C&&this.isPropertyKey(S,"__proto__")&&(m.value&&this.tolerateError(l.Messages.DuplicateProtoProperty),m.value=!0),this.nextToken(),w=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))w=A?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),E=!0;else if(O.type===3){var $=this.finalize(x,new u.Identifier(O.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),k=!0;var I=this.isolateCoverGrammar(this.parseAssignmentExpression);w=this.finalize(x,new u.AssignmentPattern($,I))}else k=!0,w=$}else this.throwUnexpectedToken(this.nextToken());return this.finalize(x,new u.Property(P,S,C,w,E,k))},b.prototype.parseObjectInitializer=function(){var m=this.createNode();this.expect("{");for(var x=[],O={value:!1};!this.match("}");)x.push(this.parseObjectProperty(O)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(m,new u.ObjectExpression(x))},b.prototype.parseTemplateHead=function(){s.assert(this.lookahead.head,"Template literal must start with a template head");var m=this.createNode(),x=this.nextToken(),O=x.value,P=x.cooked;return this.finalize(m,new u.TemplateElement({raw:O,cooked:P},x.tail))},b.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var m=this.createNode(),x=this.nextToken(),O=x.value,P=x.cooked;return this.finalize(m,new u.TemplateElement({raw:O,cooked:P},x.tail))},b.prototype.parseTemplateLiteral=function(){var m=this.createNode(),x=[],O=[],P=this.parseTemplateHead();for(O.push(P);!P.tail;)x.push(this.parseExpression()),P=this.parseTemplateElement(),O.push(P);return this.finalize(m,new u.TemplateLiteral(O,x))},b.prototype.reinterpretExpressionAsPattern=function(m){switch(m.type){case c.Syntax.Identifier:case c.Syntax.MemberExpression:case c.Syntax.RestElement:case c.Syntax.AssignmentPattern:break;case c.Syntax.SpreadElement:m.type=c.Syntax.RestElement,this.reinterpretExpressionAsPattern(m.argument);break;case c.Syntax.ArrayExpression:m.type=c.Syntax.ArrayPattern;for(var x=0;x<m.elements.length;x++)m.elements[x]!==null&&this.reinterpretExpressionAsPattern(m.elements[x]);break;case c.Syntax.ObjectExpression:m.type=c.Syntax.ObjectPattern;for(var x=0;x<m.properties.length;x++)this.reinterpretExpressionAsPattern(m.properties[x].value);break;case c.Syntax.AssignmentExpression:m.type=c.Syntax.AssignmentPattern,delete m.operator,this.reinterpretExpressionAsPattern(m.left);break}},b.prototype.parseGroupExpression=function(){var m;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),m={type:v,params:[],async:!1};else{var x=this.lookahead,O=[];if(this.match("..."))m=this.parseRestElement(O),this.expect(")"),this.match("=>")||this.expect("=>"),m={type:v,params:[m],async:!1};else{var P=!1;if(this.context.isBindingElement=!0,m=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var S=[];for(this.context.isAssignmentTarget=!1,S.push(m);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var w=0;w<S.length;w++)this.reinterpretExpressionAsPattern(S[w]);P=!0,m={type:v,params:S,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),S.push(this.parseRestElement(O)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var w=0;w<S.length;w++)this.reinterpretExpressionAsPattern(S[w]);P=!0,m={type:v,params:S,async:!1}}else S.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(P)break}P||(m=this.finalize(this.startNode(x),new u.SequenceExpression(S)))}if(!P){if(this.expect(")"),this.match("=>")&&(m.type===c.Syntax.Identifier&&m.name==="yield"&&(P=!0,m={type:v,params:[m],async:!1}),!P)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),m.type===c.Syntax.SequenceExpression)for(var w=0;w<m.expressions.length;w++)this.reinterpretExpressionAsPattern(m.expressions[w]);else this.reinterpretExpressionAsPattern(m);var C=m.type===c.Syntax.SequenceExpression?m.expressions:[m];m={type:v,params:C,async:!1}}this.context.isBindingElement=!1}}}return m},b.prototype.parseArguments=function(){this.expect("(");var m=[];if(!this.match(")"))for(;;){var x=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(m.push(x),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),m},b.prototype.isIdentifierName=function(m){return m.type===3||m.type===4||m.type===1||m.type===5},b.prototype.parseIdentifierName=function(){var m=this.createNode(),x=this.nextToken();return this.isIdentifierName(x)||this.throwUnexpectedToken(x),this.finalize(m,new u.Identifier(x.value))},b.prototype.parseNewExpression=function(){var m=this.createNode(),x=this.parseIdentifierName();s.assert(x.name==="new","New expression must start with `new`");var O;if(this.match("."))if(this.nextToken(),this.lookahead.type===3&&this.context.inFunctionBody&&this.lookahead.value==="target"){var P=this.parseIdentifierName();O=new u.MetaProperty(x,P)}else this.throwUnexpectedToken(this.lookahead);else{var S=this.isolateCoverGrammar(this.parseLeftHandSideExpression),w=this.match("(")?this.parseArguments():[];O=new u.NewExpression(S,w),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(m,O)},b.prototype.parseAsyncArgument=function(){var m=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,m},b.prototype.parseAsyncArguments=function(){this.expect("(");var m=[];if(!this.match(")"))for(;;){var x=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(m.push(x),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),m},b.prototype.parseLeftHandSideExpressionAllowCall=function(){var m=this.lookahead,x=this.matchContextualKeyword("async"),O=this.context.allowIn;this.context.allowIn=!0;var P;for(this.matchKeyword("super")&&this.context.inFunctionBody?(P=this.createNode(),this.nextToken(),P=this.finalize(P,new u.Super),!this.match("(")&&!this.match(".")&&!this.match("[")&&this.throwUnexpectedToken(this.lookahead)):P=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var S=this.parseIdentifierName();P=this.finalize(this.startNode(m),new u.StaticMemberExpression(P,S))}else if(this.match("(")){var w=x&&m.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var C=w?this.parseAsyncArguments():this.parseArguments();if(P=this.finalize(this.startNode(m),new u.CallExpression(P,C)),w&&this.match("=>")){for(var E=0;E<C.length;++E)this.reinterpretExpressionAsPattern(C[E]);P={type:v,params:C,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var S=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),P=this.finalize(this.startNode(m),new u.ComputedMemberExpression(P,S))}else if(this.lookahead.type===10&&this.lookahead.head){var k=this.parseTemplateLiteral();P=this.finalize(this.startNode(m),new u.TaggedTemplateExpression(P,k))}else break;return this.context.allowIn=O,P},b.prototype.parseSuper=function(){var m=this.createNode();return this.expectKeyword("super"),!this.match("[")&&!this.match(".")&&this.throwUnexpectedToken(this.lookahead),this.finalize(m,new u.Super)},b.prototype.parseLeftHandSideExpression=function(){s.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var m=this.startNode(this.lookahead),x=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var O=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),x=this.finalize(m,new u.ComputedMemberExpression(x,O))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var O=this.parseIdentifierName();x=this.finalize(m,new u.StaticMemberExpression(x,O))}else if(this.lookahead.type===10&&this.lookahead.head){var P=this.parseTemplateLiteral();x=this.finalize(m,new u.TaggedTemplateExpression(x,P))}else break;return x},b.prototype.parseUpdateExpression=function(){var m,x=this.lookahead;if(this.match("++")||this.match("--")){var O=this.startNode(x),P=this.nextToken();m=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&m.type===c.Syntax.Identifier&&this.scanner.isRestrictedWord(m.name)&&this.tolerateError(l.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(l.Messages.InvalidLHSInAssignment);var S=!0;m=this.finalize(O,new u.UpdateExpression(P.value,m,S)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(m=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7&&(this.match("++")||this.match("--"))){this.context.strict&&m.type===c.Syntax.Identifier&&this.scanner.isRestrictedWord(m.name)&&this.tolerateError(l.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(l.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var w=this.nextToken().value,S=!1;m=this.finalize(this.startNode(x),new u.UpdateExpression(w,m,S))}return m},b.prototype.parseAwaitExpression=function(){var m=this.createNode();this.nextToken();var x=this.parseUnaryExpression();return this.finalize(m,new u.AwaitExpression(x))},b.prototype.parseUnaryExpression=function(){var m;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var x=this.startNode(this.lookahead),O=this.nextToken();m=this.inheritCoverGrammar(this.parseUnaryExpression),m=this.finalize(x,new u.UnaryExpression(O.value,m)),this.context.strict&&m.operator==="delete"&&m.argument.type===c.Syntax.Identifier&&this.tolerateError(l.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else this.context.await&&this.matchContextualKeyword("await")?m=this.parseAwaitExpression():m=this.parseUpdateExpression();return m},b.prototype.parseExponentiationExpression=function(){var m=this.lookahead,x=this.inheritCoverGrammar(this.parseUnaryExpression);if(x.type!==c.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var O=x,P=this.isolateCoverGrammar(this.parseExponentiationExpression);x=this.finalize(this.startNode(m),new u.BinaryExpression("**",O,P))}return x},b.prototype.binaryPrecedence=function(m){var x=m.value,O;return m.type===7?O=this.operatorPrecedence[x]||0:m.type===4?O=x==="instanceof"||this.context.allowIn&&x==="in"?7:0:O=0,O},b.prototype.parseBinaryExpression=function(){var m=this.lookahead,x=this.inheritCoverGrammar(this.parseExponentiationExpression),O=this.lookahead,P=this.binaryPrecedence(O);if(P>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var S=[m,this.lookahead],w=x,C=this.isolateCoverGrammar(this.parseExponentiationExpression),E=[w,O.value,C],k=[P];P=this.binaryPrecedence(this.lookahead),!(P<=0);){for(;E.length>2&&P<=k[k.length-1];){C=E.pop();var A=E.pop();k.pop(),w=E.pop(),S.pop();var $=this.startNode(S[S.length-1]);E.push(this.finalize($,new u.BinaryExpression(A,w,C)))}E.push(this.nextToken().value),k.push(P),S.push(this.lookahead),E.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var F=E.length-1;x=E[F];for(var I=S.pop();F>1;){var B=S.pop(),j=I&&I.lineStart,$=this.startNode(B,j),A=E[F-1];x=this.finalize($,new u.BinaryExpression(A,E[F-2],x)),F-=2,I=B}}return x},b.prototype.parseConditionalExpression=function(){var m=this.lookahead,x=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var O=this.context.allowIn;this.context.allowIn=!0;var P=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=O,this.expect(":");var S=this.isolateCoverGrammar(this.parseAssignmentExpression);x=this.finalize(this.startNode(m),new u.ConditionalExpression(x,P,S)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return x},b.prototype.checkPatternParam=function(m,x){switch(x.type){case c.Syntax.Identifier:this.validateParam(m,x,x.name);break;case c.Syntax.RestElement:this.checkPatternParam(m,x.argument);break;case c.Syntax.AssignmentPattern:this.checkPatternParam(m,x.left);break;case c.Syntax.ArrayPattern:for(var O=0;O<x.elements.length;O++)x.elements[O]!==null&&this.checkPatternParam(m,x.elements[O]);break;case c.Syntax.ObjectPattern:for(var O=0;O<x.properties.length;O++)this.checkPatternParam(m,x.properties[O].value);break}m.simple=m.simple&&x instanceof u.Identifier},b.prototype.reinterpretAsCoverFormalsList=function(m){var x=[m],O,P=!1;switch(m.type){case c.Syntax.Identifier:break;case v:x=m.params,P=m.async;break;default:return null}O={simple:!0,paramSet:{}};for(var S=0;S<x.length;++S){var w=x[S];w.type===c.Syntax.AssignmentPattern?w.right.type===c.Syntax.YieldExpression&&(w.right.argument&&this.throwUnexpectedToken(this.lookahead),w.right.type=c.Syntax.Identifier,w.right.name="yield",delete w.right.argument,delete w.right.delegate):P&&w.type===c.Syntax.Identifier&&w.name==="await"&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(O,w),x[S]=w}if(this.context.strict||!this.context.allowYield)for(var S=0;S<x.length;++S){var w=x[S];w.type===c.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(O.message===l.Messages.StrictParamDupe){var C=this.context.strict?O.stricted:O.firstRestricted;this.throwUnexpectedToken(C,O.message)}return{simple:O.simple,params:x,stricted:O.stricted,firstRestricted:O.firstRestricted,message:O.message}},b.prototype.parseAssignmentExpression=function(){var m;if(!this.context.allowYield&&this.matchKeyword("yield"))m=this.parseYieldExpression();else{var x=this.lookahead,O=x;if(m=this.parseConditionalExpression(),O.type===3&&O.lineNumber===this.lookahead.lineNumber&&O.value==="async"&&(this.lookahead.type===3||this.matchKeyword("yield"))){var P=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(P),m={type:v,params:[P],async:!0}}if(m.type===v||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var S=m.async,w=this.reinterpretAsCoverFormalsList(m);if(w){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var C=this.context.strict,E=this.context.allowStrictDirective;this.context.allowStrictDirective=w.simple;var k=this.context.allowYield,A=this.context.await;this.context.allowYield=!0,this.context.await=S;var $=this.startNode(x);this.expect("=>");var F=void 0;if(this.match("{")){var I=this.context.allowIn;this.context.allowIn=!0,F=this.parseFunctionSourceElements(),this.context.allowIn=I}else F=this.isolateCoverGrammar(this.parseAssignmentExpression);var B=F.type!==c.Syntax.BlockStatement;this.context.strict&&w.firstRestricted&&this.throwUnexpectedToken(w.firstRestricted,w.message),this.context.strict&&w.stricted&&this.tolerateUnexpectedToken(w.stricted,w.message),m=S?this.finalize($,new u.AsyncArrowFunctionExpression(w.params,F,B)):this.finalize($,new u.ArrowFunctionExpression(w.params,F,B)),this.context.strict=C,this.context.allowStrictDirective=E,this.context.allowYield=k,this.context.await=A}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(l.Messages.InvalidLHSInAssignment),this.context.strict&&m.type===c.Syntax.Identifier){var j=m;this.scanner.isRestrictedWord(j.name)&&this.tolerateUnexpectedToken(O,l.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(j.name)&&this.tolerateUnexpectedToken(O,l.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(m):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),O=this.nextToken();var M=O.value,q=this.isolateCoverGrammar(this.parseAssignmentExpression);m=this.finalize(this.startNode(x),new u.AssignmentExpression(M,m,q)),this.context.firstCoverInitializedNameError=null}}return m},b.prototype.parseExpression=function(){var m=this.lookahead,x=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var O=[];for(O.push(x);this.lookahead.type!==2&&this.match(",");)this.nextToken(),O.push(this.isolateCoverGrammar(this.parseAssignmentExpression));x=this.finalize(this.startNode(m),new u.SequenceExpression(O))}return x},b.prototype.parseStatementListItem=function(){var m;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,l.Messages.IllegalExportDeclaration),m=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,l.Messages.IllegalImportDeclaration),m=this.parseImportDeclaration();break;case"const":m=this.parseLexicalDeclaration({inFor:!1});break;case"function":m=this.parseFunctionDeclaration();break;case"class":m=this.parseClassDeclaration();break;case"let":m=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:m=this.parseStatement();break}else m=this.parseStatement();return m},b.prototype.parseBlock=function(){var m=this.createNode();this.expect("{");for(var x=[];!this.match("}");)x.push(this.parseStatementListItem());return this.expect("}"),this.finalize(m,new u.BlockStatement(x))},b.prototype.parseLexicalBinding=function(m,x){var O=this.createNode(),P=[],S=this.parsePattern(P,m);this.context.strict&&S.type===c.Syntax.Identifier&&this.scanner.isRestrictedWord(S.name)&&this.tolerateError(l.Messages.StrictVarName);var w=null;return m==="const"?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),w=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(l.Messages.DeclarationMissingInitializer,"const")):(!x.inFor&&S.type!==c.Syntax.Identifier||this.match("="))&&(this.expect("="),w=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(O,new u.VariableDeclarator(S,w))},b.prototype.parseBindingList=function(m,x){for(var O=[this.parseLexicalBinding(m,x)];this.match(",");)this.nextToken(),O.push(this.parseLexicalBinding(m,x));return O},b.prototype.isLexicalDeclaration=function(){var m=this.scanner.saveState();this.scanner.scanComments();var x=this.scanner.lex();return this.scanner.restoreState(m),x.type===3||x.type===7&&x.value==="["||x.type===7&&x.value==="{"||x.type===4&&x.value==="let"||x.type===4&&x.value==="yield"},b.prototype.parseLexicalDeclaration=function(m){var x=this.createNode(),O=this.nextToken().value;s.assert(O==="let"||O==="const","Lexical declaration must be either let or const");var P=this.parseBindingList(O,m);return this.consumeSemicolon(),this.finalize(x,new u.VariableDeclaration(P,O))},b.prototype.parseBindingRestElement=function(m,x){var O=this.createNode();this.expect("...");var P=this.parsePattern(m,x);return this.finalize(O,new u.RestElement(P))},b.prototype.parseArrayPattern=function(m,x){var O=this.createNode();this.expect("[");for(var P=[];!this.match("]");)if(this.match(","))this.nextToken(),P.push(null);else{if(this.match("...")){P.push(this.parseBindingRestElement(m,x));break}else P.push(this.parsePatternWithDefault(m,x));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(O,new u.ArrayPattern(P))},b.prototype.parsePropertyPattern=function(m,x){var O=this.createNode(),P=!1,S=!1,w=!1,C,E;if(this.lookahead.type===3){var k=this.lookahead;C=this.parseVariableIdentifier();var A=this.finalize(O,new u.Identifier(k.value));if(this.match("=")){m.push(k),S=!0,this.nextToken();var $=this.parseAssignmentExpression();E=this.finalize(this.startNode(k),new u.AssignmentPattern(A,$))}else this.match(":")?(this.expect(":"),E=this.parsePatternWithDefault(m,x)):(m.push(k),S=!0,E=A)}else P=this.match("["),C=this.parseObjectPropertyKey(),this.expect(":"),E=this.parsePatternWithDefault(m,x);return this.finalize(O,new u.Property("init",C,P,E,w,S))},b.prototype.parseObjectPattern=function(m,x){var O=this.createNode(),P=[];for(this.expect("{");!this.match("}");)P.push(this.parsePropertyPattern(m,x)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(O,new u.ObjectPattern(P))},b.prototype.parsePattern=function(m,x){var O;return this.match("[")?O=this.parseArrayPattern(m,x):this.match("{")?O=this.parseObjectPattern(m,x):(this.matchKeyword("let")&&(x==="const"||x==="let")&&this.tolerateUnexpectedToken(this.lookahead,l.Messages.LetInLexicalBinding),m.push(this.lookahead),O=this.parseVariableIdentifier(x)),O},b.prototype.parsePatternWithDefault=function(m,x){var O=this.lookahead,P=this.parsePattern(m,x);if(this.match("=")){this.nextToken();var S=this.context.allowYield;this.context.allowYield=!0;var w=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=S,P=this.finalize(this.startNode(O),new u.AssignmentPattern(P,w))}return P},b.prototype.parseVariableIdentifier=function(m){var x=this.createNode(),O=this.nextToken();return O.type===4&&O.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(O,l.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(O):O.type!==3?this.context.strict&&O.type===4&&this.scanner.isStrictModeReservedWord(O.value)?this.tolerateUnexpectedToken(O,l.Messages.StrictReservedWord):(this.context.strict||O.value!=="let"||m!=="var")&&this.throwUnexpectedToken(O):(this.context.isModule||this.context.await)&&O.type===3&&O.value==="await"&&this.tolerateUnexpectedToken(O),this.finalize(x,new u.Identifier(O.value))},b.prototype.parseVariableDeclaration=function(m){var x=this.createNode(),O=[],P=this.parsePattern(O,"var");this.context.strict&&P.type===c.Syntax.Identifier&&this.scanner.isRestrictedWord(P.name)&&this.tolerateError(l.Messages.StrictVarName);var S=null;return this.match("=")?(this.nextToken(),S=this.isolateCoverGrammar(this.parseAssignmentExpression)):P.type!==c.Syntax.Identifier&&!m.inFor&&this.expect("="),this.finalize(x,new u.VariableDeclarator(P,S))},b.prototype.parseVariableDeclarationList=function(m){var x={inFor:m.inFor},O=[];for(O.push(this.parseVariableDeclaration(x));this.match(",");)this.nextToken(),O.push(this.parseVariableDeclaration(x));return O},b.prototype.parseVariableStatement=function(){var m=this.createNode();this.expectKeyword("var");var x=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(m,new u.VariableDeclaration(x,"var"))},b.prototype.parseEmptyStatement=function(){var m=this.createNode();return this.expect(";"),this.finalize(m,new u.EmptyStatement)},b.prototype.parseExpressionStatement=function(){var m=this.createNode(),x=this.parseExpression();return this.consumeSemicolon(),this.finalize(m,new u.ExpressionStatement(x))},b.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(l.Messages.StrictFunction),this.parseStatement()},b.prototype.parseIfStatement=function(){var m=this.createNode(),x,O=null;this.expectKeyword("if"),this.expect("(");var P=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),x=this.finalize(this.createNode(),new u.EmptyStatement)):(this.expect(")"),x=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),O=this.parseIfClause())),this.finalize(m,new u.IfStatement(P,x,O))},b.prototype.parseDoWhileStatement=function(){var m=this.createNode();this.expectKeyword("do");var x=this.context.inIteration;this.context.inIteration=!0;var O=this.parseStatement();this.context.inIteration=x,this.expectKeyword("while"),this.expect("(");var P=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(m,new u.DoWhileStatement(O,P))},b.prototype.parseWhileStatement=function(){var m=this.createNode(),x;this.expectKeyword("while"),this.expect("(");var O=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),x=this.finalize(this.createNode(),new u.EmptyStatement);else{this.expect(")");var P=this.context.inIteration;this.context.inIteration=!0,x=this.parseStatement(),this.context.inIteration=P}return this.finalize(m,new u.WhileStatement(O,x))},b.prototype.parseForStatement=function(){var m=null,x=null,O=null,P=!0,S,w,C=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){m=this.createNode(),this.nextToken();var E=this.context.allowIn;this.context.allowIn=!1;var k=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=E,k.length===1&&this.matchKeyword("in")){var A=k[0];A.init&&(A.id.type===c.Syntax.ArrayPattern||A.id.type===c.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(l.Messages.ForInOfLoopInitializer,"for-in"),m=this.finalize(m,new u.VariableDeclaration(k,"var")),this.nextToken(),S=m,w=this.parseExpression(),m=null}else k.length===1&&k[0].init===null&&this.matchContextualKeyword("of")?(m=this.finalize(m,new u.VariableDeclaration(k,"var")),this.nextToken(),S=m,w=this.parseAssignmentExpression(),m=null,P=!1):(m=this.finalize(m,new u.VariableDeclaration(k,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){m=this.createNode();var $=this.nextToken().value;if(!this.context.strict&&this.lookahead.value==="in")m=this.finalize(m,new u.Identifier($)),this.nextToken(),S=m,w=this.parseExpression(),m=null;else{var E=this.context.allowIn;this.context.allowIn=!1;var k=this.parseBindingList($,{inFor:!0});this.context.allowIn=E,k.length===1&&k[0].init===null&&this.matchKeyword("in")?(m=this.finalize(m,new u.VariableDeclaration(k,$)),this.nextToken(),S=m,w=this.parseExpression(),m=null):k.length===1&&k[0].init===null&&this.matchContextualKeyword("of")?(m=this.finalize(m,new u.VariableDeclaration(k,$)),this.nextToken(),S=m,w=this.parseAssignmentExpression(),m=null,P=!1):(this.consumeSemicolon(),m=this.finalize(m,new u.VariableDeclaration(k,$)))}}else{var F=this.lookahead,E=this.context.allowIn;if(this.context.allowIn=!1,m=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=E,this.matchKeyword("in"))(!this.context.isAssignmentTarget||m.type===c.Syntax.AssignmentExpression)&&this.tolerateError(l.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(m),S=m,w=this.parseExpression(),m=null;else if(this.matchContextualKeyword("of"))(!this.context.isAssignmentTarget||m.type===c.Syntax.AssignmentExpression)&&this.tolerateError(l.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(m),S=m,w=this.parseAssignmentExpression(),m=null,P=!1;else{if(this.match(",")){for(var I=[m];this.match(",");)this.nextToken(),I.push(this.isolateCoverGrammar(this.parseAssignmentExpression));m=this.finalize(this.startNode(F),new u.SequenceExpression(I))}this.expect(";")}}typeof S>"u"&&(this.match(";")||(x=this.parseExpression()),this.expect(";"),this.match(")")||(O=this.parseExpression()));var B;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),B=this.finalize(this.createNode(),new u.EmptyStatement);else{this.expect(")");var j=this.context.inIteration;this.context.inIteration=!0,B=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=j}return typeof S>"u"?this.finalize(C,new u.ForStatement(m,x,O,B)):P?this.finalize(C,new u.ForInStatement(S,w,B)):this.finalize(C,new u.ForOfStatement(S,w,B))},b.prototype.parseContinueStatement=function(){var m=this.createNode();this.expectKeyword("continue");var x=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var O=this.parseVariableIdentifier();x=O;var P="$"+O.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,P)||this.throwError(l.Messages.UnknownLabel,O.name)}return this.consumeSemicolon(),x===null&&!this.context.inIteration&&this.throwError(l.Messages.IllegalContinue),this.finalize(m,new u.ContinueStatement(x))},b.prototype.parseBreakStatement=function(){var m=this.createNode();this.expectKeyword("break");var x=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var O=this.parseVariableIdentifier(),P="$"+O.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,P)||this.throwError(l.Messages.UnknownLabel,O.name),x=O}return this.consumeSemicolon(),x===null&&!this.context.inIteration&&!this.context.inSwitch&&this.throwError(l.Messages.IllegalBreak),this.finalize(m,new u.BreakStatement(x))},b.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(l.Messages.IllegalReturn);var m=this.createNode();this.expectKeyword("return");var x=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&this.lookahead.type!==2||this.lookahead.type===8||this.lookahead.type===10,O=x?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(m,new u.ReturnStatement(O))},b.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(l.Messages.StrictModeWith);var m=this.createNode(),x;this.expectKeyword("with"),this.expect("(");var O=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),x=this.finalize(this.createNode(),new u.EmptyStatement)):(this.expect(")"),x=this.parseStatement()),this.finalize(m,new u.WithStatement(O,x))},b.prototype.parseSwitchCase=function(){var m=this.createNode(),x;this.matchKeyword("default")?(this.nextToken(),x=null):(this.expectKeyword("case"),x=this.parseExpression()),this.expect(":");for(var O=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)O.push(this.parseStatementListItem());return this.finalize(m,new u.SwitchCase(x,O))},b.prototype.parseSwitchStatement=function(){var m=this.createNode();this.expectKeyword("switch"),this.expect("(");var x=this.parseExpression();this.expect(")");var O=this.context.inSwitch;this.context.inSwitch=!0;var P=[],S=!1;for(this.expect("{");!this.match("}");){var w=this.parseSwitchCase();w.test===null&&(S&&this.throwError(l.Messages.MultipleDefaultsInSwitch),S=!0),P.push(w)}return this.expect("}"),this.context.inSwitch=O,this.finalize(m,new u.SwitchStatement(x,P))},b.prototype.parseLabelledStatement=function(){var m=this.createNode(),x=this.parseExpression(),O;if(x.type===c.Syntax.Identifier&&this.match(":")){this.nextToken();var P=x,S="$"+P.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,S)&&this.throwError(l.Messages.Redeclaration,"Label",P.name),this.context.labelSet[S]=!0;var w=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),w=this.parseClassDeclaration();else if(this.matchKeyword("function")){var C=this.lookahead,E=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(C,l.Messages.StrictFunction):E.generator&&this.tolerateUnexpectedToken(C,l.Messages.GeneratorInLegacyContext),w=E}else w=this.parseStatement();delete this.context.labelSet[S],O=new u.LabeledStatement(P,w)}else this.consumeSemicolon(),O=new u.ExpressionStatement(x);return this.finalize(m,O)},b.prototype.parseThrowStatement=function(){var m=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(l.Messages.NewlineAfterThrow);var x=this.parseExpression();return this.consumeSemicolon(),this.finalize(m,new u.ThrowStatement(x))},b.prototype.parseCatchClause=function(){var m=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var x=[],O=this.parsePattern(x),P={},S=0;S<x.length;S++){var w="$"+x[S].value;Object.prototype.hasOwnProperty.call(P,w)&&this.tolerateError(l.Messages.DuplicateBinding,x[S].value),P[w]=!0}this.context.strict&&O.type===c.Syntax.Identifier&&this.scanner.isRestrictedWord(O.name)&&this.tolerateError(l.Messages.StrictCatchVariable),this.expect(")");var C=this.parseBlock();return this.finalize(m,new u.CatchClause(O,C))},b.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},b.prototype.parseTryStatement=function(){var m=this.createNode();this.expectKeyword("try");var x=this.parseBlock(),O=this.matchKeyword("catch")?this.parseCatchClause():null,P=this.matchKeyword("finally")?this.parseFinallyClause():null;return!O&&!P&&this.throwError(l.Messages.NoCatchOrFinally),this.finalize(m,new u.TryStatement(x,O,P))},b.prototype.parseDebuggerStatement=function(){var m=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(m,new u.DebuggerStatement)},b.prototype.parseStatement=function(){var m;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:m=this.parseExpressionStatement();break;case 7:var x=this.lookahead.value;x==="{"?m=this.parseBlock():x==="("?m=this.parseExpressionStatement():x===";"?m=this.parseEmptyStatement():m=this.parseExpressionStatement();break;case 3:m=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":m=this.parseBreakStatement();break;case"continue":m=this.parseContinueStatement();break;case"debugger":m=this.parseDebuggerStatement();break;case"do":m=this.parseDoWhileStatement();break;case"for":m=this.parseForStatement();break;case"function":m=this.parseFunctionDeclaration();break;case"if":m=this.parseIfStatement();break;case"return":m=this.parseReturnStatement();break;case"switch":m=this.parseSwitchStatement();break;case"throw":m=this.parseThrowStatement();break;case"try":m=this.parseTryStatement();break;case"var":m=this.parseVariableStatement();break;case"while":m=this.parseWhileStatement();break;case"with":m=this.parseWithStatement();break;default:m=this.parseExpressionStatement();break}break;default:m=this.throwUnexpectedToken(this.lookahead)}return m},b.prototype.parseFunctionSourceElements=function(){var m=this.createNode();this.expect("{");var x=this.parseDirectivePrologues(),O=this.context.labelSet,P=this.context.inIteration,S=this.context.inSwitch,w=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;this.lookahead.type!==2&&!this.match("}");)x.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=O,this.context.inIteration=P,this.context.inSwitch=S,this.context.inFunctionBody=w,this.finalize(m,new u.BlockStatement(x))},b.prototype.validateParam=function(m,x,O){var P="$"+O;this.context.strict?(this.scanner.isRestrictedWord(O)&&(m.stricted=x,m.message=l.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(m.paramSet,P)&&(m.stricted=x,m.message=l.Messages.StrictParamDupe)):m.firstRestricted||(this.scanner.isRestrictedWord(O)?(m.firstRestricted=x,m.message=l.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(O)?(m.firstRestricted=x,m.message=l.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(m.paramSet,P)&&(m.stricted=x,m.message=l.Messages.StrictParamDupe)),typeof Object.defineProperty=="function"?Object.defineProperty(m.paramSet,P,{value:!0,enumerable:!0,writable:!0,configurable:!0}):m.paramSet[P]=!0},b.prototype.parseRestElement=function(m){var x=this.createNode();this.expect("...");var O=this.parsePattern(m);return this.match("=")&&this.throwError(l.Messages.DefaultRestParameter),this.match(")")||this.throwError(l.Messages.ParameterAfterRestParameter),this.finalize(x,new u.RestElement(O))},b.prototype.parseFormalParameter=function(m){for(var x=[],O=this.match("...")?this.parseRestElement(x):this.parsePatternWithDefault(x),P=0;P<x.length;P++)this.validateParam(m,x[P],x[P].value);m.simple=m.simple&&O instanceof u.Identifier,m.params.push(O)},b.prototype.parseFormalParameters=function(m){var x;if(x={simple:!0,params:[],firstRestricted:m},this.expect("("),!this.match(")"))for(x.paramSet={};this.lookahead.type!==2&&(this.parseFormalParameter(x),!(this.match(")")||(this.expect(","),this.match(")")))););return this.expect(")"),{simple:x.simple,params:x.params,stricted:x.stricted,firstRestricted:x.firstRestricted,message:x.message}},b.prototype.matchAsyncFunction=function(){var m=this.matchContextualKeyword("async");if(m){var x=this.scanner.saveState();this.scanner.scanComments();var O=this.scanner.lex();this.scanner.restoreState(x),m=x.lineNumber===O.lineNumber&&O.type===4&&O.value==="function"}return m},b.prototype.parseFunctionDeclaration=function(m){var x=this.createNode(),O=this.matchContextualKeyword("async");O&&this.nextToken(),this.expectKeyword("function");var P=O?!1:this.match("*");P&&this.nextToken();var S,w=null,C=null;if(!m||!this.match("(")){var E=this.lookahead;w=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(E.value)&&this.tolerateUnexpectedToken(E,l.Messages.StrictFunctionName):this.scanner.isRestrictedWord(E.value)?(C=E,S=l.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(E.value)&&(C=E,S=l.Messages.StrictReservedWord)}var k=this.context.await,A=this.context.allowYield;this.context.await=O,this.context.allowYield=!P;var $=this.parseFormalParameters(C),F=$.params,I=$.stricted;C=$.firstRestricted,$.message&&(S=$.message);var B=this.context.strict,j=this.context.allowStrictDirective;this.context.allowStrictDirective=$.simple;var M=this.parseFunctionSourceElements();return this.context.strict&&C&&this.throwUnexpectedToken(C,S),this.context.strict&&I&&this.tolerateUnexpectedToken(I,S),this.context.strict=B,this.context.allowStrictDirective=j,this.context.await=k,this.context.allowYield=A,O?this.finalize(x,new u.AsyncFunctionDeclaration(w,F,M)):this.finalize(x,new u.FunctionDeclaration(w,F,M,P))},b.prototype.parseFunctionExpression=function(){var m=this.createNode(),x=this.matchContextualKeyword("async");x&&this.nextToken(),this.expectKeyword("function");var O=x?!1:this.match("*");O&&this.nextToken();var P,S=null,w,C=this.context.await,E=this.context.allowYield;if(this.context.await=x,this.context.allowYield=!O,!this.match("(")){var k=this.lookahead;S=!this.context.strict&&!O&&this.matchKeyword("yield")?this.parseIdentifierName():this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(k.value)&&this.tolerateUnexpectedToken(k,l.Messages.StrictFunctionName):this.scanner.isRestrictedWord(k.value)?(w=k,P=l.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(k.value)&&(w=k,P=l.Messages.StrictReservedWord)}var A=this.parseFormalParameters(w),$=A.params,F=A.stricted;w=A.firstRestricted,A.message&&(P=A.message);var I=this.context.strict,B=this.context.allowStrictDirective;this.context.allowStrictDirective=A.simple;var j=this.parseFunctionSourceElements();return this.context.strict&&w&&this.throwUnexpectedToken(w,P),this.context.strict&&F&&this.tolerateUnexpectedToken(F,P),this.context.strict=I,this.context.allowStrictDirective=B,this.context.await=C,this.context.allowYield=E,x?this.finalize(m,new u.AsyncFunctionExpression(S,$,j)):this.finalize(m,new u.FunctionExpression(S,$,j,O))},b.prototype.parseDirective=function(){var m=this.lookahead,x=this.createNode(),O=this.parseExpression(),P=O.type===c.Syntax.Literal?this.getTokenRaw(m).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(x,P?new u.Directive(O,P):new u.ExpressionStatement(O))},b.prototype.parseDirectivePrologues=function(){for(var m=null,x=[];;){var O=this.lookahead;if(O.type!==8)break;var P=this.parseDirective();x.push(P);var S=P.directive;if(typeof S!="string")break;S==="use strict"?(this.context.strict=!0,m&&this.tolerateUnexpectedToken(m,l.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(O,l.Messages.IllegalLanguageModeDirective)):!m&&O.octal&&(m=O)}return x},b.prototype.qualifiedPropertyName=function(m){switch(m.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return m.value==="["}return!1},b.prototype.parseGetterMethod=function(){var m=this.createNode(),x=!1,O=this.context.allowYield;this.context.allowYield=!x;var P=this.parseFormalParameters();P.params.length>0&&this.tolerateError(l.Messages.BadGetterArity);var S=this.parsePropertyMethod(P);return this.context.allowYield=O,this.finalize(m,new u.FunctionExpression(null,P.params,S,x))},b.prototype.parseSetterMethod=function(){var m=this.createNode(),x=!1,O=this.context.allowYield;this.context.allowYield=!x;var P=this.parseFormalParameters();P.params.length!==1?this.tolerateError(l.Messages.BadSetterArity):P.params[0]instanceof u.RestElement&&this.tolerateError(l.Messages.BadSetterRestParameter);var S=this.parsePropertyMethod(P);return this.context.allowYield=O,this.finalize(m,new u.FunctionExpression(null,P.params,S,x))},b.prototype.parseGeneratorMethod=function(){var m=this.createNode(),x=!0,O=this.context.allowYield;this.context.allowYield=!0;var P=this.parseFormalParameters();this.context.allowYield=!1;var S=this.parsePropertyMethod(P);return this.context.allowYield=O,this.finalize(m,new u.FunctionExpression(null,P.params,S,x))},b.prototype.isStartOfExpression=function(){var m=!0,x=this.lookahead.value;switch(this.lookahead.type){case 7:m=x==="["||x==="("||x==="{"||x==="+"||x==="-"||x==="!"||x==="~"||x==="++"||x==="--"||x==="/"||x==="/=";break;case 4:m=x==="class"||x==="delete"||x==="function"||x==="let"||x==="new"||x==="super"||x==="this"||x==="typeof"||x==="void"||x==="yield";break}return m},b.prototype.parseYieldExpression=function(){var m=this.createNode();this.expectKeyword("yield");var x=null,O=!1;if(!this.hasLineTerminator){var P=this.context.allowYield;this.context.allowYield=!1,O=this.match("*"),O?(this.nextToken(),x=this.parseAssignmentExpression()):this.isStartOfExpression()&&(x=this.parseAssignmentExpression()),this.context.allowYield=P}return this.finalize(m,new u.YieldExpression(x,O))},b.prototype.parseClassElement=function(m){var x=this.lookahead,O=this.createNode(),P="",S=null,w=null,C=!1,E=!1,k=!1,A=!1;if(this.match("*"))this.nextToken();else{C=this.match("["),S=this.parseObjectPropertyKey();var $=S;if($.name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(x=this.lookahead,k=!0,C=this.match("["),this.match("*")?this.nextToken():S=this.parseObjectPropertyKey()),x.type===3&&!this.hasLineTerminator&&x.value==="async"){var F=this.lookahead.value;F!==":"&&F!=="("&&F!=="*"&&(A=!0,x=this.lookahead,S=this.parseObjectPropertyKey(),x.type===3&&x.value==="constructor"&&this.tolerateUnexpectedToken(x,l.Messages.ConstructorIsAsync))}}var I=this.qualifiedPropertyName(this.lookahead);return x.type===3?x.value==="get"&&I?(P="get",C=this.match("["),S=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod()):x.value==="set"&&I&&(P="set",C=this.match("["),S=this.parseObjectPropertyKey(),w=this.parseSetterMethod()):x.type===7&&x.value==="*"&&I&&(P="init",C=this.match("["),S=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),E=!0),!P&&S&&this.match("(")&&(P="init",w=A?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),E=!0),P||this.throwUnexpectedToken(this.lookahead),P==="init"&&(P="method"),C||(k&&this.isPropertyKey(S,"prototype")&&this.throwUnexpectedToken(x,l.Messages.StaticPrototype),!k&&this.isPropertyKey(S,"constructor")&&((P!=="method"||!E||w&&w.generator)&&this.throwUnexpectedToken(x,l.Messages.ConstructorSpecialMethod),m.value?this.throwUnexpectedToken(x,l.Messages.DuplicateConstructor):m.value=!0,P="constructor")),this.finalize(O,new u.MethodDefinition(S,C,w,P,k))},b.prototype.parseClassElementList=function(){var m=[],x={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():m.push(this.parseClassElement(x));return this.expect("}"),m},b.prototype.parseClassBody=function(){var m=this.createNode(),x=this.parseClassElementList();return this.finalize(m,new u.ClassBody(x))},b.prototype.parseClassDeclaration=function(m){var x=this.createNode(),O=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var P=m&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),S=null;this.matchKeyword("extends")&&(this.nextToken(),S=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var w=this.parseClassBody();return this.context.strict=O,this.finalize(x,new u.ClassDeclaration(P,S,w))},b.prototype.parseClassExpression=function(){var m=this.createNode(),x=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var O=this.lookahead.type===3?this.parseVariableIdentifier():null,P=null;this.matchKeyword("extends")&&(this.nextToken(),P=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var S=this.parseClassBody();return this.context.strict=x,this.finalize(m,new u.ClassExpression(O,P,S))},b.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var m=this.createNode(),x=this.parseDirectivePrologues();this.lookahead.type!==2;)x.push(this.parseStatementListItem());return this.finalize(m,new u.Module(x))},b.prototype.parseScript=function(){for(var m=this.createNode(),x=this.parseDirectivePrologues();this.lookahead.type!==2;)x.push(this.parseStatementListItem());return this.finalize(m,new u.Script(x))},b.prototype.parseModuleSpecifier=function(){var m=this.createNode();this.lookahead.type!==8&&this.throwError(l.Messages.InvalidModuleSpecifier);var x=this.nextToken(),O=this.getTokenRaw(x);return this.finalize(m,new u.Literal(x.value,O))},b.prototype.parseImportSpecifier=function(){var m=this.createNode(),x,O;return this.lookahead.type===3?(x=this.parseVariableIdentifier(),O=x,this.matchContextualKeyword("as")&&(this.nextToken(),O=this.parseVariableIdentifier())):(x=this.parseIdentifierName(),O=x,this.matchContextualKeyword("as")?(this.nextToken(),O=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(m,new u.ImportSpecifier(O,x))},b.prototype.parseNamedImports=function(){this.expect("{");for(var m=[];!this.match("}");)m.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),m},b.prototype.parseImportDefaultSpecifier=function(){var m=this.createNode(),x=this.parseIdentifierName();return this.finalize(m,new u.ImportDefaultSpecifier(x))},b.prototype.parseImportNamespaceSpecifier=function(){var m=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(l.Messages.NoAsAfterImportNamespace),this.nextToken();var x=this.parseIdentifierName();return this.finalize(m,new u.ImportNamespaceSpecifier(x))},b.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(l.Messages.IllegalImportDeclaration);var m=this.createNode();this.expectKeyword("import");var x,O=[];if(this.lookahead.type===8)x=this.parseModuleSpecifier();else{if(this.match("{")?O=O.concat(this.parseNamedImports()):this.match("*")?O.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(O.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?O.push(this.parseImportNamespaceSpecifier()):this.match("{")?O=O.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var P=this.lookahead.value?l.Messages.UnexpectedToken:l.Messages.MissingFromClause;this.throwError(P,this.lookahead.value)}this.nextToken(),x=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(m,new u.ImportDeclaration(O,x))},b.prototype.parseExportSpecifier=function(){var m=this.createNode(),x=this.parseIdentifierName(),O=x;return this.matchContextualKeyword("as")&&(this.nextToken(),O=this.parseIdentifierName()),this.finalize(m,new u.ExportSpecifier(x,O))},b.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(l.Messages.IllegalExportDeclaration);var m=this.createNode();this.expectKeyword("export");var x;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var O=this.parseFunctionDeclaration(!0);x=this.finalize(m,new u.ExportDefaultDeclaration(O))}else if(this.matchKeyword("class")){var O=this.parseClassDeclaration(!0);x=this.finalize(m,new u.ExportDefaultDeclaration(O))}else if(this.matchContextualKeyword("async")){var O=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();x=this.finalize(m,new u.ExportDefaultDeclaration(O))}else{this.matchContextualKeyword("from")&&this.throwError(l.Messages.UnexpectedToken,this.lookahead.value);var O=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),x=this.finalize(m,new u.ExportDefaultDeclaration(O))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var P=this.lookahead.value?l.Messages.UnexpectedToken:l.Messages.MissingFromClause;this.throwError(P,this.lookahead.value)}this.nextToken();var S=this.parseModuleSpecifier();this.consumeSemicolon(),x=this.finalize(m,new u.ExportAllDeclaration(S))}else if(this.lookahead.type===4){var O=void 0;switch(this.lookahead.value){case"let":case"const":O=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":O=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}x=this.finalize(m,new u.ExportNamedDeclaration(O,[],null))}else if(this.matchAsyncFunction()){var O=this.parseFunctionDeclaration();x=this.finalize(m,new u.ExportNamedDeclaration(O,[],null))}else{var w=[],C=null,E=!1;for(this.expect("{");!this.match("}");)E=E||this.matchKeyword("default"),w.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),C=this.parseModuleSpecifier(),this.consumeSemicolon();else if(E){var P=this.lookahead.value?l.Messages.UnexpectedToken:l.Messages.MissingFromClause;this.throwError(P,this.lookahead.value)}else this.consumeSemicolon();x=this.finalize(m,new u.ExportNamedDeclaration(null,w,C))}return x},b})();n.Parser=g},function(i,n){Object.defineProperty(n,"__esModule",{value:!0});function r(s,a){if(!s)throw new Error("ASSERT: "+a)}n.assert=r},function(i,n){Object.defineProperty(n,"__esModule",{value:!0});var r=(function(){function s(){this.errors=[],this.tolerant=!1}return s.prototype.recordError=function(a){this.errors.push(a)},s.prototype.tolerate=function(a){if(this.tolerant)this.recordError(a);else throw a},s.prototype.constructError=function(a,l){var u=new Error(a);try{throw u}catch(h){Object.create&&Object.defineProperty&&(u=Object.create(h),Object.defineProperty(u,"column",{value:l}))}return u},s.prototype.createError=function(a,l,u,h){var c="Line "+l+": "+h,p=this.constructError(c,u);return p.index=a,p.lineNumber=l,p.description=h,p},s.prototype.throwError=function(a,l,u,h){throw this.createError(a,l,u,h)},s.prototype.tolerateError=function(a,l,u,h){var c=this.createError(a,l,u,h);if(this.tolerant)this.recordError(c);else throw c},s})();n.ErrorHandler=r},function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(i,n,r){Object.defineProperty(n,"__esModule",{value:!0});var s=r(9),a=r(4),l=r(11);function u(p){return"0123456789abcdef".indexOf(p.toLowerCase())}function h(p){return"01234567".indexOf(p)}var c=(function(){function p(v,g){this.source=v,this.errorHandler=g,this.trackComment=!1,this.isModule=!1,this.length=v.length,this.index=0,this.lineNumber=v.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return p.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},p.prototype.restoreState=function(v){this.index=v.index,this.lineNumber=v.lineNumber,this.lineStart=v.lineStart},p.prototype.eof=function(){return this.index>=this.length},p.prototype.throwUnexpectedToken=function(v){return v===void 0&&(v=l.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,v)},p.prototype.tolerateUnexpectedToken=function(v){v===void 0&&(v=l.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,v)},p.prototype.skipSingleLineComment=function(v){var g=[],b,m;for(this.trackComment&&(g=[],b=this.index-v,m={start:{line:this.lineNumber,column:this.index-this.lineStart-v},end:{}});!this.eof();){var x=this.source.charCodeAt(this.index);if(++this.index,a.Character.isLineTerminator(x)){if(this.trackComment){m.end={line:this.lineNumber,column:this.index-this.lineStart-1};var O={multiLine:!1,slice:[b+v,this.index-1],range:[b,this.index-1],loc:m};g.push(O)}return x===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,g}}if(this.trackComment){m.end={line:this.lineNumber,column:this.index-this.lineStart};var O={multiLine:!1,slice:[b+v,this.index],range:[b,this.index],loc:m};g.push(O)}return g},p.prototype.skipMultiLineComment=function(){var v=[],g,b;for(this.trackComment&&(v=[],g=this.index-2,b={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var m=this.source.charCodeAt(this.index);if(a.Character.isLineTerminator(m))m===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(m===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){b.end={line:this.lineNumber,column:this.index-this.lineStart};var x={multiLine:!0,slice:[g+2,this.index-2],range:[g,this.index],loc:b};v.push(x)}return v}++this.index}else++this.index}if(this.trackComment){b.end={line:this.lineNumber,column:this.index-this.lineStart};var x={multiLine:!0,slice:[g+2,this.index],range:[g,this.index],loc:b};v.push(x)}return this.tolerateUnexpectedToken(),v},p.prototype.scanComments=function(){var v;this.trackComment&&(v=[]);for(var g=this.index===0;!this.eof();){var b=this.source.charCodeAt(this.index);if(a.Character.isWhiteSpace(b))++this.index;else if(a.Character.isLineTerminator(b))++this.index,b===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,g=!0;else if(b===47)if(b=this.source.charCodeAt(this.index+1),b===47){this.index+=2;var m=this.skipSingleLineComment(2);this.trackComment&&(v=v.concat(m)),g=!0}else if(b===42){this.index+=2;var m=this.skipMultiLineComment();this.trackComment&&(v=v.concat(m))}else break;else if(g&&b===45)if(this.source.charCodeAt(this.index+1)===45&&this.source.charCodeAt(this.index+2)===62){this.index+=3;var m=this.skipSingleLineComment(3);this.trackComment&&(v=v.concat(m))}else break;else if(b===60&&!this.isModule)if(this.source.slice(this.index+1,this.index+4)==="!--"){this.index+=4;var m=this.skipSingleLineComment(4);this.trackComment&&(v=v.concat(m))}else break;else break}return v},p.prototype.isFutureReservedWord=function(v){switch(v){case"enum":case"export":case"import":case"super":return!0;default:return!1}},p.prototype.isStrictModeReservedWord=function(v){switch(v){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},p.prototype.isRestrictedWord=function(v){return v==="eval"||v==="arguments"},p.prototype.isKeyword=function(v){switch(v.length){case 2:return v==="if"||v==="in"||v==="do";case 3:return v==="var"||v==="for"||v==="new"||v==="try"||v==="let";case 4:return v==="this"||v==="else"||v==="case"||v==="void"||v==="with"||v==="enum";case 5:return v==="while"||v==="break"||v==="catch"||v==="throw"||v==="const"||v==="yield"||v==="class"||v==="super";case 6:return v==="return"||v==="typeof"||v==="delete"||v==="switch"||v==="export"||v==="import";case 7:return v==="default"||v==="finally"||v==="extends";case 8:return v==="function"||v==="continue"||v==="debugger";case 10:return v==="instanceof";default:return!1}},p.prototype.codePointAt=function(v){var g=this.source.charCodeAt(v);if(g>=55296&&g<=56319){var b=this.source.charCodeAt(v+1);if(b>=56320&&b<=57343){var m=g;g=(m-55296)*1024+b-56320+65536}}return g},p.prototype.scanHexEscape=function(v){for(var g=v==="u"?4:2,b=0,m=0;m<g;++m)if(!this.eof()&&a.Character.isHexDigit(this.source.charCodeAt(this.index)))b=b*16+u(this.source[this.index++]);else return null;return String.fromCharCode(b)},p.prototype.scanUnicodeCodePointEscape=function(){var v=this.source[this.index],g=0;for(v==="}"&&this.throwUnexpectedToken();!this.eof()&&(v=this.source[this.index++],!!a.Character.isHexDigit(v.charCodeAt(0)));)g=g*16+u(v);return(g>1114111||v!=="}")&&this.throwUnexpectedToken(),a.Character.fromCodePoint(g)},p.prototype.getIdentifier=function(){for(var v=this.index++;!this.eof();){var g=this.source.charCodeAt(this.index);if(g===92)return this.index=v,this.getComplexIdentifier();if(g>=55296&&g<57343)return this.index=v,this.getComplexIdentifier();if(a.Character.isIdentifierPart(g))++this.index;else break}return this.source.slice(v,this.index)},p.prototype.getComplexIdentifier=function(){var v=this.codePointAt(this.index),g=a.Character.fromCodePoint(v);this.index+=g.length;var b;for(v===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,b=this.scanUnicodeCodePointEscape()):(b=this.scanHexEscape("u"),(b===null||b==="\\"||!a.Character.isIdentifierStart(b.charCodeAt(0)))&&this.throwUnexpectedToken()),g=b);!this.eof()&&(v=this.codePointAt(this.index),!!a.Character.isIdentifierPart(v));)b=a.Character.fromCodePoint(v),g+=b,this.index+=b.length,v===92&&(g=g.substr(0,g.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,b=this.scanUnicodeCodePointEscape()):(b=this.scanHexEscape("u"),(b===null||b==="\\"||!a.Character.isIdentifierPart(b.charCodeAt(0)))&&this.throwUnexpectedToken()),g+=b);return g},p.prototype.octalToDecimal=function(v){var g=v!=="0",b=h(v);return!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(g=!0,b=b*8+h(this.source[this.index++]),"0123".indexOf(v)>=0&&!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(b=b*8+h(this.source[this.index++]))),{code:b,octal:g}},p.prototype.scanIdentifier=function(){var v,g=this.index,b=this.source.charCodeAt(g)===92?this.getComplexIdentifier():this.getIdentifier();if(b.length===1?v=3:this.isKeyword(b)?v=4:b==="null"?v=5:b==="true"||b==="false"?v=1:v=3,v!==3&&g+b.length!==this.index){var m=this.index;this.index=g,this.tolerateUnexpectedToken(l.Messages.InvalidEscapedReservedWord),this.index=m}return{type:v,value:b,lineNumber:this.lineNumber,lineStart:this.lineStart,start:g,end:this.index}},p.prototype.scanPunctuator=function(){var v=this.index,g=this.source[this.index];switch(g){case"(":case"{":g==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,g="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:g=this.source.substr(this.index,4),g===">>>="?this.index+=4:(g=g.substr(0,3),g==="==="||g==="!=="||g===">>>"||g==="<<="||g===">>="||g==="**="?this.index+=3:(g=g.substr(0,2),g==="&&"||g==="||"||g==="=="||g==="!="||g==="+="||g==="-="||g==="*="||g==="/="||g==="++"||g==="--"||g==="<<"||g===">>"||g==="&="||g==="|="||g==="^="||g==="%="||g==="<="||g===">="||g==="=>"||g==="**"?this.index+=2:(g=this.source[this.index],"<>=!+-*%&|^/".indexOf(g)>=0&&++this.index)))}return this.index===v&&this.throwUnexpectedToken(),{type:7,value:g,lineNumber:this.lineNumber,lineStart:this.lineStart,start:v,end:this.index}},p.prototype.scanHexLiteral=function(v){for(var g="";!this.eof()&&a.Character.isHexDigit(this.source.charCodeAt(this.index));)g+=this.source[this.index++];return g.length===0&&this.throwUnexpectedToken(),a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+g,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:v,end:this.index}},p.prototype.scanBinaryLiteral=function(v){for(var g="",b;!this.eof()&&(b=this.source[this.index],!(b!=="0"&&b!=="1"));)g+=this.source[this.index++];return g.length===0&&this.throwUnexpectedToken(),this.eof()||(b=this.source.charCodeAt(this.index),(a.Character.isIdentifierStart(b)||a.Character.isDecimalDigit(b))&&this.throwUnexpectedToken()),{type:6,value:parseInt(g,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:v,end:this.index}},p.prototype.scanOctalLiteral=function(v,g){var b="",m=!1;for(a.Character.isOctalDigit(v.charCodeAt(0))?(m=!0,b="0"+this.source[this.index++]):++this.index;!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index));)b+=this.source[this.index++];return!m&&b.length===0&&this.throwUnexpectedToken(),(a.Character.isIdentifierStart(this.source.charCodeAt(this.index))||a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(b,8),octal:m,lineNumber:this.lineNumber,lineStart:this.lineStart,start:g,end:this.index}},p.prototype.isImplicitOctalLiteral=function(){for(var v=this.index+1;v<this.length;++v){var g=this.source[v];if(g==="8"||g==="9")return!1;if(!a.Character.isOctalDigit(g.charCodeAt(0)))return!0}return!0},p.prototype.scanNumericLiteral=function(){var v=this.index,g=this.source[v];s.assert(a.Character.isDecimalDigit(g.charCodeAt(0))||g===".","Numeric literal must start with a decimal digit or a decimal point");var b="";if(g!=="."){if(b=this.source[this.index++],g=this.source[this.index],b==="0"){if(g==="x"||g==="X")return++this.index,this.scanHexLiteral(v);if(g==="b"||g==="B")return++this.index,this.scanBinaryLiteral(v);if(g==="o"||g==="O")return this.scanOctalLiteral(g,v);if(g&&a.Character.isOctalDigit(g.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(g,v)}for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)b+=this.source[this.index++];g=this.source[this.index]}if(g==="."){for(b+=this.source[this.index++];a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)b+=this.source[this.index++];g=this.source[this.index]}if(g==="e"||g==="E")if(b+=this.source[this.index++],g=this.source[this.index],(g==="+"||g==="-")&&(b+=this.source[this.index++]),a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)b+=this.source[this.index++];else this.throwUnexpectedToken();return a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(b),lineNumber:this.lineNumber,lineStart:this.lineStart,start:v,end:this.index}},p.prototype.scanStringLiteral=function(){var v=this.index,g=this.source[v];s.assert(g==="'"||g==='"',"String literal must starts with a quote"),++this.index;for(var b=!1,m="";!this.eof();){var x=this.source[this.index++];if(x===g){g="";break}else if(x==="\\")if(x=this.source[this.index++],!x||!a.Character.isLineTerminator(x.charCodeAt(0)))switch(x){case"u":if(this.source[this.index]==="{")++this.index,m+=this.scanUnicodeCodePointEscape();else{var O=this.scanHexEscape(x);O===null&&this.throwUnexpectedToken(),m+=O}break;case"x":var P=this.scanHexEscape(x);P===null&&this.throwUnexpectedToken(l.Messages.InvalidHexEscapeSequence),m+=P;break;case"n":m+=`
|
|
50
|
+
`;break;case"r":m+="\r";break;case"t":m+=" ";break;case"b":m+="\b";break;case"f":m+="\f";break;case"v":m+="\v";break;case"8":case"9":m+=x,this.tolerateUnexpectedToken();break;default:if(x&&a.Character.isOctalDigit(x.charCodeAt(0))){var S=this.octalToDecimal(x);b=S.octal||b,m+=String.fromCharCode(S.code)}else m+=x;break}else++this.lineNumber,x==="\r"&&this.source[this.index]===`
|
|
51
|
+
`&&++this.index,this.lineStart=this.index;else{if(a.Character.isLineTerminator(x.charCodeAt(0)))break;m+=x}}return g!==""&&(this.index=v,this.throwUnexpectedToken()),{type:8,value:m,octal:b,lineNumber:this.lineNumber,lineStart:this.lineStart,start:v,end:this.index}},p.prototype.scanTemplate=function(){var v="",g=!1,b=this.index,m=this.source[b]==="`",x=!1,O=2;for(++this.index;!this.eof();){var P=this.source[this.index++];if(P==="`"){O=1,x=!0,g=!0;break}else if(P==="$"){if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,g=!0;break}v+=P}else if(P==="\\")if(P=this.source[this.index++],a.Character.isLineTerminator(P.charCodeAt(0)))++this.lineNumber,P==="\r"&&this.source[this.index]===`
|
|
52
|
+
`&&++this.index,this.lineStart=this.index;else switch(P){case"n":v+=`
|
|
53
|
+
`;break;case"r":v+="\r";break;case"t":v+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,v+=this.scanUnicodeCodePointEscape();else{var S=this.index,w=this.scanHexEscape(P);w!==null?v+=w:(this.index=S,v+=P)}break;case"x":var C=this.scanHexEscape(P);C===null&&this.throwUnexpectedToken(l.Messages.InvalidHexEscapeSequence),v+=C;break;case"b":v+="\b";break;case"f":v+="\f";break;case"v":v+="\v";break;default:P==="0"?(a.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(l.Messages.TemplateOctalLiteral),v+="\0"):a.Character.isOctalDigit(P.charCodeAt(0))?this.throwUnexpectedToken(l.Messages.TemplateOctalLiteral):v+=P;break}else a.Character.isLineTerminator(P.charCodeAt(0))?(++this.lineNumber,P==="\r"&&this.source[this.index]===`
|
|
54
|
+
`&&++this.index,this.lineStart=this.index,v+=`
|
|
55
|
+
`):v+=P}return g||this.throwUnexpectedToken(),m||this.curlyStack.pop(),{type:10,value:this.source.slice(b+1,this.index-O),cooked:v,head:m,tail:x,lineNumber:this.lineNumber,lineStart:this.lineStart,start:b,end:this.index}},p.prototype.testRegExp=function(v,g){var b="",m=v,x=this;g.indexOf("u")>=0&&(m=m.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(O,P,S){var w=parseInt(P||S,16);return w>1114111&&x.throwUnexpectedToken(l.Messages.InvalidRegExp),w<=65535?String.fromCharCode(w):b}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b));try{RegExp(m)}catch{this.throwUnexpectedToken(l.Messages.InvalidRegExp)}try{return new RegExp(v,g)}catch{return null}},p.prototype.scanRegExpBody=function(){var v=this.source[this.index];s.assert(v==="/","Regular expression literal must start with a slash");for(var g=this.source[this.index++],b=!1,m=!1;!this.eof();)if(v=this.source[this.index++],g+=v,v==="\\")v=this.source[this.index++],a.Character.isLineTerminator(v.charCodeAt(0))&&this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),g+=v;else if(a.Character.isLineTerminator(v.charCodeAt(0)))this.throwUnexpectedToken(l.Messages.UnterminatedRegExp);else if(b)v==="]"&&(b=!1);else if(v==="/"){m=!0;break}else v==="["&&(b=!0);return m||this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),g.substr(1,g.length-2)},p.prototype.scanRegExpFlags=function(){for(var v="",g="";!this.eof();){var b=this.source[this.index];if(!a.Character.isIdentifierPart(b.charCodeAt(0)))break;if(++this.index,b==="\\"&&!this.eof())if(b=this.source[this.index],b==="u"){++this.index;var m=this.index,x=this.scanHexEscape("u");if(x!==null)for(g+=x,v+="\\u";m<this.index;++m)v+=this.source[m];else this.index=m,g+="u",v+="\\u";this.tolerateUnexpectedToken()}else v+="\\",this.tolerateUnexpectedToken();else g+=b,v+=b}return g},p.prototype.scanRegExp=function(){var v=this.index,g=this.scanRegExpBody(),b=this.scanRegExpFlags(),m=this.testRegExp(g,b);return{type:9,value:"",pattern:g,flags:b,regex:m,lineNumber:this.lineNumber,lineStart:this.lineStart,start:v,end:this.index}},p.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var v=this.source.charCodeAt(this.index);return a.Character.isIdentifierStart(v)?this.scanIdentifier():v===40||v===41||v===59?this.scanPunctuator():v===39||v===34?this.scanStringLiteral():v===46?a.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():a.Character.isDecimalDigit(v)?this.scanNumericLiteral():v===96||v===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():v>=55296&&v<57343&&a.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},p})();n.Scanner=c},function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.TokenName={},n.TokenName[1]="Boolean",n.TokenName[2]="<end>",n.TokenName[3]="Identifier",n.TokenName[4]="Keyword",n.TokenName[5]="Null",n.TokenName[6]="Numeric",n.TokenName[7]="Punctuator",n.TokenName[8]="String",n.TokenName[9]="RegularExpression",n.TokenName[10]="Template"},function(i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(i,n,r){Object.defineProperty(n,"__esModule",{value:!0});var s=r(10),a=r(12),l=r(13),u=(function(){function c(){this.values=[],this.curly=this.paren=-1}return c.prototype.beforeFunctionExpression=function(p){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(p)>=0},c.prototype.isRegexStart=function(){var p=this.values[this.values.length-1],v=p!==null;switch(p){case"this":case"]":v=!1;break;case")":var g=this.values[this.paren-1];v=g==="if"||g==="while"||g==="for"||g==="with";break;case"}":if(v=!1,this.values[this.curly-3]==="function"){var b=this.values[this.curly-4];v=b?!this.beforeFunctionExpression(b):!1}else if(this.values[this.curly-4]==="function"){var b=this.values[this.curly-5];v=b?!this.beforeFunctionExpression(b):!0}break}return v},c.prototype.push=function(p){p.type===7||p.type===4?(p.value==="{"?this.curly=this.values.length:p.value==="("&&(this.paren=this.values.length),this.values.push(p.value)):this.values.push(null)},c})(),h=(function(){function c(p,v){this.errorHandler=new s.ErrorHandler,this.errorHandler.tolerant=v?typeof v.tolerant=="boolean"&&v.tolerant:!1,this.scanner=new a.Scanner(p,this.errorHandler),this.scanner.trackComment=v?typeof v.comment=="boolean"&&v.comment:!1,this.trackRange=v?typeof v.range=="boolean"&&v.range:!1,this.trackLoc=v?typeof v.loc=="boolean"&&v.loc:!1,this.buffer=[],this.reader=new u}return c.prototype.errors=function(){return this.errorHandler.errors},c.prototype.getNextToken=function(){if(this.buffer.length===0){var p=this.scanner.scanComments();if(this.scanner.trackComment)for(var v=0;v<p.length;++v){var g=p[v],b=this.scanner.source.slice(g.slice[0],g.slice[1]),m={type:g.multiLine?"BlockComment":"LineComment",value:b};this.trackRange&&(m.range=g.range),this.trackLoc&&(m.loc=g.loc),this.buffer.push(m)}if(!this.scanner.eof()){var x=void 0;this.trackLoc&&(x={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var O=this.scanner.source[this.scanner.index]==="/"&&this.reader.isRegexStart(),P=O?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(P);var S={type:l.TokenName[P.type],value:this.scanner.source.slice(P.start,P.end)};if(this.trackRange&&(S.range=[P.start,P.end]),this.trackLoc&&(x.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},S.loc=x),P.type===9){var w=P.pattern,C=P.flags;S.regex={pattern:w,flags:C}}this.buffer.push(S)}}return this.buffer.shift()},c})();n.Tokenizer=h}])})})(Pu)),Pu.exports}var s0;function I$(){if(s0)return ha;s0=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.parse=void 0;var t=$n();function e(i,n){var r=[],s=Gb().parse(i,{loc:!0,locations:!0,comment:!0,onComment:r,range:(0,t.getOption)(n,"range",!1),tolerant:(0,t.getOption)(n,"tolerant",!0),tokens:!0,jsx:(0,t.getOption)(n,"jsx",!1),sourceType:(0,t.getOption)(n,"sourceType","module")});return Array.isArray(s.comments)||(s.comments=r),s}return ha.parse=e,ha}var a0;function mp(){if(a0)return la;a0=1,Object.defineProperty(la,"__esModule",{value:!0}),la.normalize=void 0;var t=$n(),e={parser:I$(),tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:(0,t.getLineTerminator)(),wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0,tokens:!0},i=e.hasOwnProperty;function n(r){var s=r||e;function a(l){return i.call(s,l)?s[l]:e[l]}return{tabWidth:+a("tabWidth"),useTabs:!!a("useTabs"),reuseWhitespace:!!a("reuseWhitespace"),lineTerminator:a("lineTerminator"),wrapColumn:Math.max(a("wrapColumn"),0),sourceFileName:a("sourceFileName"),sourceMapName:a("sourceMapName"),sourceRoot:a("sourceRoot"),inputSourceMap:a("inputSourceMap"),parser:a("esprima")||a("parser"),range:a("range"),tolerant:a("tolerant"),quote:a("quote"),trailingComma:a("trailingComma"),arrayBracketSpacing:a("arrayBracketSpacing"),objectCurlySpacing:a("objectCurlySpacing"),arrowParensAlways:a("arrowParensAlways"),flowObjectCommas:a("flowObjectCommas"),tokens:!!a("tokens")}}return la.normalize=n,la}var Ai={},Xl={},o0;function N$(){if(o0)return Xl;o0=1,Object.defineProperty(Xl,"__esModule",{value:!0});var t=et,e=t.__importDefault(hr()),i=$n(),n=(function(){function l(u,h,c){c===void 0&&(c=h),this.sourceLines=u,this.sourceLoc=h,this.targetLoc=c}return l.prototype.slice=function(u,h,c){c===void 0&&(c=u.lastPos());var p=this.sourceLines,v=this.sourceLoc,g=this.targetLoc;function b(m){var x=v[m],O=g[m],P=h;return m==="end"?P=c:(0,e.default)(m==="start"),a(p,x,u,O,P)}if((0,i.comparePos)(h,g.start)<=0)if((0,i.comparePos)(g.end,c)<=0)g={start:s(g.start,h.line,h.column),end:s(g.end,h.line,h.column)};else{if((0,i.comparePos)(c,g.start)<=0)return null;v={start:v.start,end:b("end")},g={start:s(g.start,h.line,h.column),end:s(c,h.line,h.column)}}else{if((0,i.comparePos)(g.end,h)<=0)return null;(0,i.comparePos)(g.end,c)<=0?(v={start:b("start"),end:v.end},g={start:{line:1,column:0},end:s(g.end,h.line,h.column)}):(v={start:b("start"),end:b("end")},g={start:{line:1,column:0},end:s(c,h.line,h.column)})}return new l(this.sourceLines,v,g)},l.prototype.add=function(u,h){return new l(this.sourceLines,this.sourceLoc,{start:r(this.targetLoc.start,u,h),end:r(this.targetLoc.end,u,h)})},l.prototype.subtract=function(u,h){return new l(this.sourceLines,this.sourceLoc,{start:s(this.targetLoc.start,u,h),end:s(this.targetLoc.end,u,h)})},l.prototype.indent=function(u,h,c){if(h===void 0&&(h=!1),c===void 0&&(c=!1),u===0)return this;var p=this.targetLoc,v=p.start.line,g=p.end.line;if(h&&v===1&&g===1)return this;if(p={start:p.start,end:p.end},!h||v>1){var b=p.start.column+u;p.start={line:v,column:c?Math.max(0,b):b}}if(!h||g>1){var m=p.end.column+u;p.end={line:g,column:c?Math.max(0,m):m}}return new l(this.sourceLines,this.sourceLoc,p)},l})();Xl.default=n;function r(l,u,h){return{line:l.line+u-1,column:l.line===1?l.column+h:l.column}}function s(l,u,h){return{line:l.line-u+1,column:l.line===u?l.column-h:l.column}}function a(l,u,h,c,p){var v=(0,i.comparePos)(c,p);if(v===0)return u;var g,b;if(v<0){g=l.skipSpaces(u)||l.lastPos(),b=h.skipSpaces(c)||h.lastPos();var m=p.line-b.line;for(g.line+=m,b.line+=m,m>0?(g.column=0,b.column=0):(0,e.default)(m===0);(0,i.comparePos)(b,p)<0&&h.nextPos(b,!0);)(0,e.default)(l.nextPos(g,!0)),(0,e.default)(l.charAt(g)===h.charAt(b))}else{g=l.skipSpaces(u,!0)||l.firstPos(),b=h.skipSpaces(c,!0)||h.firstPos();var m=p.line-b.line;for(g.line+=m,b.line+=m,m<0?(g.column=l.getLineLength(g.line),b.column=h.getLineLength(b.line)):(0,e.default)(m===0);(0,i.comparePos)(p,b)<0&&h.prevPos(b,!0);)(0,e.default)(l.prevPos(g,!0)),(0,e.default)(l.charAt(g)===h.charAt(b))}return g}return Xl}var l0;function zc(){if(l0)return Ai;l0=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.concat=Ai.fromString=Ai.countSpaces=Ai.Lines=void 0;var t=et,e=t.__importDefault(hr()),i=t.__importDefault(Yb()),n=mp(),r=$n(),s=t.__importDefault(N$()),a=(function(){function P(S,w){w===void 0&&(w=null),this.infos=S,this.mappings=[],this.cachedSourceMap=null,this.cachedTabWidth=void 0,(0,e.default)(S.length>0),this.length=S.length,this.name=w||null,this.name&&this.mappings.push(new s.default(this,{start:this.firstPos(),end:this.lastPos()}))}return P.prototype.toString=function(S){return this.sliceString(this.firstPos(),this.lastPos(),S)},P.prototype.getSourceMap=function(S,w){if(!S)return null;var C=this;function E($){return $=$||{},$.file=S,w&&($.sourceRoot=w),$}if(C.cachedSourceMap)return E(C.cachedSourceMap.toJSON());var k=new i.default.SourceMapGenerator(E()),A={};return C.mappings.forEach(function($){for(var F=$.sourceLines.skipSpaces($.sourceLoc.start)||$.sourceLines.lastPos(),I=C.skipSpaces($.targetLoc.start)||C.lastPos();(0,r.comparePos)(F,$.sourceLoc.end)<0&&(0,r.comparePos)(I,$.targetLoc.end)<0;){var B=$.sourceLines.charAt(F),j=C.charAt(I);(0,e.default)(B===j);var M=$.sourceLines.name;if(k.addMapping({source:M,original:{line:F.line,column:F.column},generated:{line:I.line,column:I.column}}),!u.call(A,M)){var q=$.sourceLines.toString();k.setSourceContent(M,q),A[M]=q}C.nextPos(I,!0),$.sourceLines.nextPos(F,!0)}}),C.cachedSourceMap=k,k.toJSON()},P.prototype.bootstrapCharAt=function(S){(0,e.default)(typeof S=="object"),(0,e.default)(typeof S.line=="number"),(0,e.default)(typeof S.column=="number");var w=S.line,C=S.column,E=this.toString().split(v),k=E[w-1];return typeof k>"u"?"":C===k.length&&w<E.length?`
|
|
56
|
+
`:C>=k.length?"":k.charAt(C)},P.prototype.charAt=function(S){(0,e.default)(typeof S=="object"),(0,e.default)(typeof S.line=="number"),(0,e.default)(typeof S.column=="number");var w=S.line,C=S.column,E=this,k=E.infos,A=k[w-1],$=C;if(typeof A>"u"||$<0)return"";var F=this.getIndentAt(w);return $<F?" ":($+=A.sliceStart-F,$===A.sliceEnd&&w<this.length?`
|
|
57
|
+
`:$>=A.sliceEnd?"":A.line.charAt($))},P.prototype.stripMargin=function(S,w){if(S===0)return this;if((0,e.default)(S>0,"negative margin: "+S),w&&this.length===1)return this;var C=new P(this.infos.map(function(k,A){return k.line&&(A>0||!w)&&(k=t.__assign(t.__assign({},k),{indent:Math.max(0,k.indent-S)})),k}));if(this.mappings.length>0){var E=C.mappings;(0,e.default)(E.length===0),this.mappings.forEach(function(k){E.push(k.indent(S,w,!0))})}return C},P.prototype.indent=function(S){if(S===0)return this;var w=new P(this.infos.map(function(E){return E.line&&!E.locked&&(E=t.__assign(t.__assign({},E),{indent:E.indent+S})),E}));if(this.mappings.length>0){var C=w.mappings;(0,e.default)(C.length===0),this.mappings.forEach(function(E){C.push(E.indent(S))})}return w},P.prototype.indentTail=function(S){if(S===0)return this;if(this.length<2)return this;var w=new P(this.infos.map(function(E,k){return k>0&&E.line&&!E.locked&&(E=t.__assign(t.__assign({},E),{indent:E.indent+S})),E}));if(this.mappings.length>0){var C=w.mappings;(0,e.default)(C.length===0),this.mappings.forEach(function(E){C.push(E.indent(S,!0))})}return w},P.prototype.lockIndentTail=function(){return this.length<2?this:new P(this.infos.map(function(S,w){return t.__assign(t.__assign({},S),{locked:w>0})}))},P.prototype.getIndentAt=function(S){return(0,e.default)(S>=1,"no line "+S+" (line numbers start from 1)"),Math.max(this.infos[S-1].indent,0)},P.prototype.guessTabWidth=function(){if(typeof this.cachedTabWidth=="number")return this.cachedTabWidth;for(var S=[],w=0,C=1,E=this.length;C<=E;++C){var k=this.infos[C-1],A=k.line.slice(k.sliceStart,k.sliceEnd);if(!b(A)){var $=Math.abs(k.indent-w);S[$]=~~S[$]+1,w=k.indent}}for(var F=-1,I=2,B=1;B<S.length;B+=1)u.call(S,B)&&S[B]>F&&(F=S[B],I=B);return this.cachedTabWidth=I},P.prototype.startsWithComment=function(){if(this.infos.length===0)return!1;var S=this.infos[0],w=S.sliceStart,C=S.sliceEnd,E=S.line.slice(w,C).trim();return E.length===0||E.slice(0,2)==="//"||E.slice(0,2)==="/*"},P.prototype.isOnlyWhitespace=function(){return b(this.toString())},P.prototype.isPrecededOnlyByWhitespace=function(S){var w=this.infos[S.line-1],C=Math.max(w.indent,0),E=S.column-C;if(E<=0)return!0;var k=w.sliceStart,A=Math.min(k+E,w.sliceEnd),$=w.line.slice(k,A);return b($)},P.prototype.getLineLength=function(S){var w=this.infos[S-1];return this.getIndentAt(S)+w.sliceEnd-w.sliceStart},P.prototype.nextPos=function(S,w){w===void 0&&(w=!1);var C=Math.max(S.line,0),E=Math.max(S.column,0);return E<this.getLineLength(C)?(S.column+=1,w?!!this.skipSpaces(S,!1,!0):!0):C<this.length?(S.line+=1,S.column=0,w?!!this.skipSpaces(S,!1,!0):!0):!1},P.prototype.prevPos=function(S,w){w===void 0&&(w=!1);var C=S.line,E=S.column;if(E<1){if(C-=1,C<1)return!1;E=this.getLineLength(C)}else E=Math.min(E-1,this.getLineLength(C));return S.line=C,S.column=E,w?!!this.skipSpaces(S,!0,!0):!0},P.prototype.firstPos=function(){return{line:1,column:0}},P.prototype.lastPos=function(){return{line:this.length,column:this.getLineLength(this.length)}},P.prototype.skipSpaces=function(S,w,C){if(w===void 0&&(w=!1),C===void 0&&(C=!1),S?S=C?S:{line:S.line,column:S.column}:w?S=this.lastPos():S=this.firstPos(),w){for(;this.prevPos(S);)if(!b(this.charAt(S))&&this.nextPos(S))return S;return null}else{for(;b(this.charAt(S));)if(!this.nextPos(S))return null;return S}},P.prototype.trimLeft=function(){var S=this.skipSpaces(this.firstPos(),!1,!0);return S?this.slice(S):O},P.prototype.trimRight=function(){var S=this.skipSpaces(this.lastPos(),!0,!0);return S?this.slice(this.firstPos(),S):O},P.prototype.trim=function(){var S=this.skipSpaces(this.firstPos(),!1,!0);if(S===null)return O;var w=this.skipSpaces(this.lastPos(),!0,!0);return w===null?O:this.slice(S,w)},P.prototype.eachPos=function(S,w,C){w===void 0&&(w=this.firstPos()),C===void 0&&(C=!1);var E=this.firstPos();if(w&&(E.line=w.line,E.column=w.column),!(C&&!this.skipSpaces(E,!1,!0)))do S.call(this,E);while(this.nextPos(E,C))},P.prototype.bootstrapSlice=function(S,w){var C=this.toString().split(v).slice(S.line-1,w.line);return C.length>0&&(C.push(C.pop().slice(0,w.column)),C[0]=C[0].slice(S.column)),g(C.join(`
|
|
58
|
+
`))},P.prototype.slice=function(S,w){if(!w){if(!S)return this;w=this.lastPos()}if(!S)throw new Error("cannot slice with end but not start");var C=this.infos.slice(S.line-1,w.line);S.line===w.line?C[0]=m(C[0],S.column,w.column):((0,e.default)(S.line<w.line),C[0]=m(C[0],S.column),C.push(m(C.pop(),0,w.column)));var E=new P(C);if(this.mappings.length>0){var k=E.mappings;(0,e.default)(k.length===0),this.mappings.forEach(function(A){var $=A.slice(this,S,w);$&&k.push($)},this)}return E},P.prototype.bootstrapSliceString=function(S,w,C){return this.slice(S,w).toString(C)},P.prototype.sliceString=function(S,w,C){S===void 0&&(S=this.firstPos()),w===void 0&&(w=this.lastPos());for(var E=(0,n.normalize)(C),k=E.tabWidth,A=E.useTabs,$=E.reuseWhitespace,F=E.lineTerminator,I=[],B=S.line;B<=w.line;++B){var j=this.infos[B-1];B===S.line?B===w.line?j=m(j,S.column,w.column):j=m(j,S.column):B===w.line&&(j=m(j,0,w.column));var M=Math.max(j.indent,0),q=j.line.slice(0,j.sliceStart);if($&&b(q)&&c(q,k)===M){I.push(j.line.slice(0,j.sliceEnd));continue}var X=0,Y=M;A&&(X=Math.floor(M/k),Y-=X*k);var V="";X>0&&(V+=new Array(X+1).join(" ")),Y>0&&(V+=new Array(Y+1).join(" ")),V+=j.line.slice(j.sliceStart,j.sliceEnd),I.push(V)}return I.join(F)},P.prototype.isEmpty=function(){return this.length<2&&this.getLineLength(1)<1},P.prototype.join=function(S){var w=this,C=[],E=[],k;function A(I){if(I!==null){if(k){var B=I.infos[0],j=new Array(B.indent+1).join(" "),M=C.length,q=Math.max(k.indent,0)+k.sliceEnd-k.sliceStart;k.line=k.line.slice(0,k.sliceEnd)+j+B.line.slice(B.sliceStart,B.sliceEnd),k.locked=k.locked||B.locked,k.sliceEnd=k.line.length,I.mappings.length>0&&I.mappings.forEach(function(X){E.push(X.add(M,q))})}else I.mappings.length>0&&E.push.apply(E,I.mappings);I.infos.forEach(function(X,Y){(!k||Y>0)&&(k=t.__assign({},X),C.push(k))})}}function $(I,B){B>0&&A(w),A(I)}if(S.map(function(I){var B=g(I);return B.isEmpty()?null:B}).forEach(function(I,B){w.isEmpty()?A(I):$(I,B)}),C.length<1)return O;var F=new P(C);return F.mappings=E,F},P.prototype.concat=function(){for(var S=[],w=0;w<arguments.length;w++)S[w]=arguments[w];var C=[this];return C.push.apply(C,S),(0,e.default)(C.length===S.length+1),O.join(C)},P})();Ai.Lines=a;var l={},u=l.hasOwnProperty,h=10;function c(P,S){for(var w=0,C=P.length,E=0;E<C;++E)switch(P.charCodeAt(E)){case 9:{(0,e.default)(typeof S=="number"),(0,e.default)(S>0);var k=Math.ceil(w/S)*S;k===w?w+=S:w=k;break}case 11:case 12:case 13:case 65279:break;default:w+=1;break}return w}Ai.countSpaces=c;var p=/^\s*/,v=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function g(P,S){if(P instanceof a)return P;P+="";var w=S&&S.tabWidth,C=P.indexOf(" ")<0,E=!S&&C&&P.length<=h;if((0,e.default)(w||C,`No tab width specified but encountered tabs in string
|
|
59
|
+
`+P),E&&u.call(l,P))return l[P];var k=new a(P.split(v).map(function(A){var $=p.exec(A)[0];return{line:A,indent:c($,w),locked:!1,sliceStart:$.length,sliceEnd:A.length}}),(0,n.normalize)(S).sourceFileName);return E&&(l[P]=k),k}Ai.fromString=g;function b(P){return!/\S/.test(P)}function m(P,S,w){var C=P.sliceStart,E=P.sliceEnd,k=Math.max(P.indent,0),A=k+E-C;return typeof w>"u"&&(w=A),S=Math.max(S,0),w=Math.min(w,A),w=Math.max(w,S),w<k?(k=w,E=C):E-=A-w,A=w,A-=S,S<k?k-=S:(S-=k,k=0,C+=S),(0,e.default)(k>=0),(0,e.default)(C<=E),(0,e.default)(A===k+E-C),P.indent===k&&P.sliceStart===C&&P.sliceEnd===E?P:{line:P.line,indent:k,locked:!1,sliceStart:C,sliceEnd:E}}function x(P){return O.join(P)}Ai.concat=x;var O=g("");return Ai}var Or={},u0;function Hb(){if(u0)return Or;u0=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.printComments=Or.attach=void 0;var t=et,e=t.__importDefault(hr()),i=t.__importStar(ir()),n=i.namedTypes,r=i.builtInTypes.array,s=i.builtInTypes.object,a=zc(),l=$n(),u=new WeakMap;function h(w,C,E){if(!w)return E;if((0,l.fixFaultyLocations)(w,C),E){if(n.Node.check(w)&&n.SourceLocation.check(w.loc)){for(var k=E.length-1;k>=0;--k){var A=E[k];if(A&&A.loc&&(0,l.comparePos)(A.loc.end,w.loc.start)<=0)break}return E.splice(k+1,0,w),E}}else{var $=u.get(w);if($)return $}var F;if(r.check(w))F=Object.keys(w);else if(s.check(w))F=i.getFieldNames(w);else return E;E||u.set(w,E=[]);for(var k=0,I=F.length;k<I;++k)h(w[F[k]],C,E);return E}function c(w,C,E){for(var k=h(w,E),A=0,$=k&&k.length,F,I;typeof $=="number"&&A<$;){var B=A+$>>1,j=k[B];if((0,l.comparePos)(j.loc.start,C.loc.start)<=0&&(0,l.comparePos)(C.loc.end,j.loc.end)<=0){c(C.enclosingNode=j,C,E);return}if((0,l.comparePos)(j.loc.end,C.loc.start)<=0){F=j,A=B+1;continue}if((0,l.comparePos)(C.loc.end,j.loc.start)<=0){I=j,$=B;continue}throw new Error("Comment location overlaps with node location")}F&&(C.precedingNode=F),I&&(C.followingNode=I)}function p(w,C,E){if(r.check(w)){var k=[];w.forEach(function(A){A.loc.lines=E,c(C,A,E);var $=A.precedingNode,F=A.enclosingNode,I=A.followingNode;if($&&I){var B=k.length;if(B>0){var j=k[B-1];(0,e.default)(j.precedingNode===A.precedingNode==(j.followingNode===A.followingNode)),j.followingNode!==A.followingNode&&v(k,E)}k.push(A)}else if($)v(k,E),x($,A);else if(I)v(k,E),b(I,A);else if(F)v(k,E),m(F,A);else throw new Error("AST contains no nodes at all?")}),v(k,E),w.forEach(function(A){delete A.precedingNode,delete A.enclosingNode,delete A.followingNode})}}Or.attach=p;function v(w,C){var E=w.length;if(E!==0){for(var k=w[0].precedingNode,A=w[0].followingNode,$=A.loc.start,F=E,I;F>0;--F){I=w[F-1],(0,e.default)(I.precedingNode===k),(0,e.default)(I.followingNode===A);var B=C.sliceString(I.loc.end,$);if(/\S/.test(B))break;$=I.loc.start}for(;F<=E&&(I=w[F])&&(I.type==="Line"||I.type==="CommentLine")&&I.loc.start.column>A.loc.start.column;)++F;if(F){var j=w[F-1].enclosingNode;j?.type==="CallExpression"&&--F}w.forEach(function(M,q){q<F?x(k,M):b(A,M)}),w.length=0}}function g(w,C){var E=w.comments||(w.comments=[]);E.push(C)}function b(w,C){C.leading=!0,C.trailing=!1,g(w,C)}function m(w,C){C.leading=!1,C.trailing=!1,g(w,C)}function x(w,C){C.leading=!1,C.trailing=!0,g(w,C)}function O(w,C){var E=w.getValue();n.Comment.assert(E);var k=E.loc,A=k&&k.lines,$=[C(w)];if(E.trailing)$.push(`
|
|
60
|
+
`);else if(A instanceof a.Lines){var F=A.slice(k.end,A.skipSpaces(k.end)||A.lastPos());F.length===1?$.push(F):$.push(new Array(F.length).join(`
|
|
61
|
+
`))}else $.push(`
|
|
62
|
+
`);return(0,a.concat)($)}function P(w,C){var E=w.getValue(w);n.Comment.assert(E);var k=E.loc,A=k&&k.lines,$=[];if(A instanceof a.Lines){var F=A.skipSpaces(k.start,!0)||A.firstPos(),I=A.slice(F,k.start);I.length===1?$.push(I):$.push(new Array(I.length).join(`
|
|
63
|
+
`))}return $.push(C(w)),(0,a.concat)($)}function S(w,C){var E=w.getValue(),k=C(w),A=n.Node.check(E)&&i.getFieldValue(E,"comments");if(!A||A.length===0)return k;var $=[],F=[k];return w.each(function(I){var B=I.getValue(),j=i.getFieldValue(B,"leading"),M=i.getFieldValue(B,"trailing");j||M&&!(n.Statement.check(E)||B.type==="Block"||B.type==="CommentBlock")?$.push(O(I,C)):M&&F.push(P(I,C))},"comments"),$.push.apply($,F),(0,a.concat)($)}return Or.printComments=S,Or}var c0;function M$(){if(c0)return oa;c0=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.parse=void 0;var t=et,e=t.__importDefault(hr()),i=t.__importStar(ir()),n=i.builders,r=i.builtInTypes.object,s=i.builtInTypes.array,a=mp(),l=zc(),u=Hb(),h=t.__importStar($n());function c(g,b){b=(0,a.normalize)(b);var m=(0,l.fromString)(g,b),x=m.toString({tabWidth:b.tabWidth,reuseWhitespace:!1,useTabs:!1}),O=[],P=b.parser.parse(x,{jsx:!0,loc:!0,locations:!0,range:b.range,comment:!0,onComment:O,tolerant:h.getOption(b,"tolerant",!0),ecmaVersion:6,sourceType:h.getOption(b,"sourceType","module")}),S=Array.isArray(P.tokens)?P.tokens:Gb().tokenize(x,{loc:!0});delete P.tokens,S.forEach(function(k){typeof k.value!="string"&&(k.value=m.sliceString(k.loc.start,k.loc.end))}),Array.isArray(P.comments)&&(O=P.comments,delete P.comments),P.loc?h.fixFaultyLocations(P,m):P.loc={start:m.firstPos(),end:m.lastPos()},P.loc.lines=m,P.loc.indent=0;var w,C;P.type==="Program"?(C=P,w=n.file(P,b.sourceFileName||null),w.loc={start:m.firstPos(),end:m.lastPos(),lines:m,indent:0}):P.type==="File"&&(w=P,C=w.program),b.tokens&&(w.tokens=S);var E=h.getTrueLoc({type:C.type,loc:C.loc,body:[],comments:O},m);return C.loc.start=E.start,C.loc.end=E.end,(0,u.attach)(O,C.body.length?w.program:w,m),new p(m,S).copy(w)}oa.parse=c;var p=function g(b,m){(0,e.default)(this instanceof g),this.lines=b,this.tokens=m,this.startTokenIndex=0,this.endTokenIndex=m.length,this.indent=0,this.seen=new Map},v=p.prototype;return v.copy=function(g){if(this.seen.has(g))return this.seen.get(g);if(s.check(g)){var b=new Array(g.length);return this.seen.set(g,b),g.forEach(function($,F){b[F]=this.copy($)},this),b}if(!r.check(g))return g;h.fixFaultyLocations(g,this.lines);var m=Object.create(Object.getPrototypeOf(g),{original:{value:g,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(g,m);var x=g.loc,O=this.indent,P=O,S=this.startTokenIndex,w=this.endTokenIndex;x&&((g.type==="Block"||g.type==="Line"||g.type==="CommentBlock"||g.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(x.start))&&(P=this.indent=x.start.column),x.lines=this.lines,x.tokens=this.tokens,x.indent=P,this.findTokenRange(x));for(var C=Object.keys(g),E=C.length,k=0;k<E;++k){var A=C[k];A==="loc"||A==="tokens"&&g.type==="File"?m[A]=g[A]:m[A]=this.copy(g[A])}return this.indent=O,this.startTokenIndex=S,this.endTokenIndex=w,m},v.findTokenRange=function(g){for(;this.startTokenIndex>0;){var b=g.tokens[this.startTokenIndex];if(h.comparePos(g.start,b.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<g.tokens.length;){var b=g.tokens[this.endTokenIndex];if(h.comparePos(b.loc.end,g.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){var b=g.tokens[this.startTokenIndex];if(h.comparePos(b.loc.start,g.start)<0)++this.startTokenIndex;else break}for(g.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){var b=g.tokens[this.endTokenIndex-1];if(h.comparePos(g.end,b.loc.end)<0)--this.endTokenIndex;else break}g.end.token=this.endTokenIndex},oa}var fa={},jl={},h0;function Jb(){if(h0)return jl;h0=1,Object.defineProperty(jl,"__esModule",{value:!0});var t=et,e=t.__importDefault(hr()),i=t.__importStar(ir()),n=t.__importStar($n()),r=i.namedTypes,s=i.builtInTypes.array,a=i.builtInTypes.number,l={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(g,b){g.forEach(function(m){l[m]=b})});var u=function g(b){(0,e.default)(this instanceof g),this.stack=[b]},h=u.prototype;u.from=function(g){if(g instanceof u)return g.copy();if(g instanceof i.NodePath){for(var b=Object.create(u.prototype),m=[g.value],x=void 0;x=g.parentPath;g=x)m.push(g.name,x.value);return b.stack=m.reverse(),b}return new u(g)},h.copy=function(){var b=Object.create(u.prototype);return b.stack=this.stack.slice(0),b},h.getName=function(){var b=this.stack,m=b.length;return m>1?b[m-2]:null},h.getValue=function(){var b=this.stack;return b[b.length-1]},h.valueIsDuplicate=function(){var g=this.stack,b=g.length-1;return g.lastIndexOf(g[b],b-1)>=0};function c(g,b){for(var m=g.stack,x=m.length-1;x>=0;x-=2){var O=m[x];if(r.Node.check(O)&&--b<0)return O}return null}h.getNode=function(b){return b===void 0&&(b=0),c(this,~~b)},h.getParentNode=function(b){return b===void 0&&(b=0),c(this,~~b+1)},h.getRootValue=function(){var b=this.stack;return b.length%2===0?b[1]:b[0]},h.call=function(b){for(var m=this.stack,x=m.length,O=m[x-1],P=arguments.length,S=1;S<P;++S){var w=arguments[S];O=O[w],m.push(w,O)}var C=b(this);return m.length=x,C},h.each=function(b){for(var m=this.stack,x=m.length,O=m[x-1],P=arguments.length,S=1;S<P;++S){var w=arguments[S];O=O[w],m.push(w,O)}for(var S=0;S<O.length;++S)S in O&&(m.push(S,O[S]),b(this),m.length-=2);m.length=x},h.map=function(b){for(var m=this.stack,x=m.length,O=m[x-1],P=arguments.length,S=1;S<P;++S){var w=arguments[S];O=O[w],m.push(w,O)}for(var C=new Array(O.length),S=0;S<O.length;++S)S in O&&(m.push(S,O[S]),C[S]=b(this,S),m.length-=2);return m.length=x,C},h.hasParens=function(){var g=this.getNode(),b=this.getPrevToken(g);if(!b)return!1;var m=this.getNextToken(g);if(!m)return!1;if(b.value==="("){if(m.value===")")return!0;var x=!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0);if(x)return!0}return!1},h.getPrevToken=function(g){g=g||this.getNode();var b=g&&g.loc,m=b&&b.tokens;if(m&&b.start.token>0){var x=m[b.start.token-1];if(x){var O=this.getRootValue().loc;if(n.comparePos(O.start,x.loc.start)<=0)return x}}return null},h.getNextToken=function(g){g=g||this.getNode();var b=g&&g.loc,m=b&&b.tokens;if(m&&b.end.token<m.length){var x=m[b.end.token];if(x){var O=this.getRootValue().loc;if(n.comparePos(x.loc.end,O.end)<=0)return x}}return null},h.needsParens=function(g){var b=this.getNode();if(b.type==="AssignmentExpression"&&b.left.type==="ObjectPattern")return!0;var m=this.getParentNode(),x=this.getName();if(this.getValue()!==b||r.Statement.check(b)||b.type==="Identifier"||m&&m.type==="ParenthesizedExpression")return!1;if(b.extra&&b.extra.parenthesized)return!0;if(!m)return!1;if(b.type==="UnaryExpression"&&m.type==="BinaryExpression"&&x==="left"&&m.left===b&&m.operator==="**")return!0;switch(b.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return m.type==="MemberExpression"&&x==="object"&&m.object===b;case"BinaryExpression":case"LogicalExpression":switch(m.type){case"CallExpression":return x==="callee"&&m.callee===b;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return x==="object"&&m.object===b;case"BinaryExpression":case"LogicalExpression":{var O=m.operator,P=l[O],S=b.operator,w=l[S];if(P>w)return!0;if(P===w&&x==="right")return(0,e.default)(m.right===b),!0;break}default:return!1}break;case"SequenceExpression":switch(m.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return x!=="expression";default:return!0}case"OptionalIndexedAccessType":return b.optional&&m.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return m.type==="NullableTypeAnnotation";case"Literal":return m.type==="MemberExpression"&&a.check(b.value)&&x==="object"&&m.object===b;case"NumericLiteral":return m.type==="MemberExpression"&&x==="object"&&m.object===b;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(m.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return x==="callee"&&m.callee===b;case"ConditionalExpression":return x==="test"&&m.test===b;case"MemberExpression":return x==="object"&&m.object===b;default:return!1}case"ArrowFunctionExpression":return r.CallExpression.check(m)&&x==="callee"&&m.callee===b||r.MemberExpression.check(m)&&x==="object"&&m.object===b||r.TSAsExpression&&r.TSAsExpression.check(m)&&x==="expression"&&m.expression===b?!0:p(m);case"ObjectExpression":if(m.type==="ArrowFunctionExpression"&&x==="body"&&m.body===b)return!0;break;case"TSAsExpression":if(m.type==="ArrowFunctionExpression"&&x==="body"&&m.body===b&&b.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(x==="declaration"&&r.ExportDefaultDeclaration.check(m)&&r.FunctionExpression.check(b.callee))return!0}return m.type==="NewExpression"&&x==="callee"&&m.callee===b?v(b):!!(g!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function p(g){return r.BinaryExpression.check(g)||r.LogicalExpression.check(g)}function v(g){return r.CallExpression.check(g)?!0:s.check(g)?g.some(v):r.Node.check(g)?i.someField(g,function(b,m){return v(m)}):!1}return h.canBeFirstInStatement=function(){var g=this.getNode();return!(r.FunctionExpression.check(g)||r.ObjectExpression.check(g)||r.ClassExpression.check(g))},h.firstInStatement=function(){for(var g=this.stack,b,m,x,O,P=g.length-1;P>=0;P-=2)if(r.Node.check(g[P])&&(x=b,O=m,b=g[P-1],m=g[P]),!(!m||!O)){if(r.BlockStatement.check(m)&&b==="body"&&x===0)return(0,e.default)(m.body[0]===O),!0;if(r.ExpressionStatement.check(m)&&x==="expression")return(0,e.default)(m.expression===O),!0;if(r.AssignmentExpression.check(m)&&x==="left")return(0,e.default)(m.left===O),!0;if(r.ArrowFunctionExpression.check(m)&&x==="body")return(0,e.default)(m.body===O),!0;if(r.SequenceExpression.check(m)&&g[P+1]==="expressions"&&x===0){(0,e.default)(m.expressions[0]===O);continue}if(r.CallExpression.check(m)&&x==="callee"){(0,e.default)(m.callee===O);continue}if(r.MemberExpression.check(m)&&x==="object"){(0,e.default)(m.object===O);continue}if(r.ConditionalExpression.check(m)&&x==="test"){(0,e.default)(m.test===O);continue}if(p(m)&&x==="left"){(0,e.default)(m.left===O);continue}if(r.UnaryExpression.check(m)&&!m.prefix&&x==="argument"){(0,e.default)(m.argument===O);continue}return!1}return!0},jl.default=u,jl}var xr={},f0;function $$(){if(f0)return xr;f0=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.getReprinter=xr.Patcher=void 0;var t=et,e=t.__importDefault(hr()),i=t.__importStar(zc()),n=t.__importStar(ir()),r=n.namedTypes.Printable,s=n.namedTypes.Expression,a=n.namedTypes.ReturnStatement,l=n.namedTypes.SourceLocation,u=$n(),h=t.__importDefault(Jb()),c=n.builtInTypes.object,p=n.builtInTypes.array,v=n.builtInTypes.string,g=/[0-9a-z_$]/i,b=function $(F){(0,e.default)(this instanceof $),(0,e.default)(F instanceof i.Lines);var I=this,B=[];I.replace=function(j,M){v.check(M)&&(M=i.fromString(M)),B.push({lines:M,start:j.start,end:j.end})},I.get=function(j){j=j||{start:{line:1,column:0},end:{line:F.length,column:F.getLineLength(F.length)}};var M=j.start,q=[];function X(Y,V){(0,e.default)((0,u.comparePos)(Y,V)<=0),q.push(F.slice(Y,V))}return B.sort(function(Y,V){return(0,u.comparePos)(Y.start,V.start)}).forEach(function(Y){(0,u.comparePos)(M,Y.start)>0||(X(M,Y.start),q.push(Y.lines),M=Y.end)}),X(M,j.end),i.concat(q)}};xr.Patcher=b;var m=b.prototype;m.tryToReprintComments=function($,F,I){var B=this;if(!$.comments&&!F.comments)return!0;var j=h.default.from($),M=h.default.from(F);j.stack.push("comments",x($)),M.stack.push("comments",x(F));var q=[],X=E(j,M,q);return X&&q.length>0&&q.forEach(function(Y){var V=Y.oldPath.getValue();(0,e.default)(V.leading||V.trailing),B.replace(V.loc,I(Y.newPath).indentTail(V.loc.indent))}),X};function x($){var F=[];return $.comments&&$.comments.length>0&&$.comments.forEach(function(I){(I.leading||I.trailing)&&F.push(I)}),F}m.deleteComments=function($){if($.comments){var F=this;$.comments.forEach(function(I){I.leading?F.replace({start:I.loc.start,end:$.loc.lines.skipSpaces(I.loc.end,!1,!1)},""):I.trailing&&F.replace({start:$.loc.lines.skipSpaces(I.loc.start,!0,!1),end:I.loc.end},"")})}};function O($){(0,e.default)($ instanceof h.default);var F=$.getValue();if(r.check(F)){var I=F.original,B=I&&I.loc,j=B&&B.lines,M=[];if(!(!j||!w($,M)))return function(q){var X=new b(j);M.forEach(function(V){var oe=V.newPath.getValue(),ae=V.oldPath.getValue();l.assert(ae.loc,!0);var fe=!X.tryToReprintComments(oe,ae,q);fe&&X.deleteComments(ae);var D=q(V.newPath,{includeComments:fe,avoidRootParens:ae.type===oe.type&&V.oldPath.hasParens()}).indentTail(ae.loc.indent),Z=P(j,ae.loc,D),L=S(j,ae.loc,D);if(Z||L){var se=[];Z&&se.push(" "),se.push(D),L&&se.push(" "),D=i.concat(se)}X.replace(ae.loc,D)});var Y=X.get(B).indentTail(-I.loc.indent);return $.needsParens()?i.concat(["(",Y,")"]):Y}}}xr.getReprinter=O;function P($,F,I){var B=(0,u.copyPos)(F.start),j=$.prevPos(B)&&$.charAt(B),M=I.charAt(I.firstPos());return j&&g.test(j)&&M&&g.test(M)}function S($,F,I){var B=$.charAt(F.end),j=I.lastPos(),M=I.prevPos(j)&&I.charAt(j);return M&&g.test(M)&&B&&g.test(B)}function w($,F){var I=$.getValue();r.assert(I);var B=I.original;if(r.assert(B),(0,e.default)(F.length===0),I.type!==B.type)return!1;var j=new h.default(B),M=A($,j,F);return M||(F.length=0),M}function C($,F,I){var B=$.getValue(),j=F.getValue();return B===j?!0:p.check(B)?E($,F,I):c.check(B)?k($,F,I):!1}function E($,F,I){var B=$.getValue(),j=F.getValue();if(B===j||$.valueIsDuplicate()||F.valueIsDuplicate())return!0;p.assert(B);var M=B.length;if(!(p.check(j)&&j.length===M))return!1;for(var q=0;q<M;++q){$.stack.push(q,B[q]),F.stack.push(q,j[q]);var X=C($,F,I);if($.stack.length-=2,F.stack.length-=2,!X)return!1}return!0}function k($,F,I){var B=$.getValue();if(c.assert(B),B.original===null)return!1;var j=F.getValue();if(!c.check(j))return!1;if(B===j||$.valueIsDuplicate()||F.valueIsDuplicate())return!0;if(r.check(B)){if(!r.check(j))return!1;var M=$.getParentNode(),q=F.getParentNode();if(q!==null&&q.type==="FunctionTypeAnnotation"&&M!==null&&M.type==="FunctionTypeAnnotation"){var X=q.params.length!==1||!!q.params[0].name,Y=M.params.length!==1||!!M.params[0].name;if(!X&&Y)return!1}if(B.type===j.type){var V=[];if(A($,F,V))I.push.apply(I,V);else if(j.loc)I.push({oldPath:F.copy(),newPath:$.copy()});else return!1;return!0}return s.check(B)&&s.check(j)&&j.loc?(I.push({oldPath:F.copy(),newPath:$.copy()}),!0):!1}return A($,F,I)}function A($,F,I){var B=$.getValue(),j=F.getValue();if(c.assert(B),c.assert(j),B.original===null||$.needsParens()&&!F.hasParens())return!1;var M=(0,u.getUnionOfKeys)(j,B);(j.type==="File"||B.type==="File")&&delete M.tokens,delete M.loc;var q=I.length;for(var X in M)if(X.charAt(0)!=="_"){$.stack.push(X,n.getFieldValue(B,X)),F.stack.push(X,n.getFieldValue(j,X));var Y=C($,F,I);if($.stack.length-=2,F.stack.length-=2,!Y)return!1}return!(a.check($.getNode())&&I.length>q)}return xr}var d0;function L$(){if(d0)return fa;d0=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.Printer=void 0;var t=et,e=t.__importDefault(hr()),i=t.__importStar(ir()),n=Hb(),r=t.__importDefault(Jb()),s=zc(),a=mp(),l=$$(),u=t.__importStar($n()),h=i.namedTypes,c=i.builtInTypes.string,p=i.builtInTypes.object,v=function D(Z,L){(0,e.default)(this instanceof D),c.assert(Z),this.code=Z,L&&(p.assert(L),this.map=L)},g=v.prototype,b=!1;g.toString=function(){return b||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),b=!0),this.code};var m=new v(""),x=function D(Z){(0,e.default)(this instanceof D);var L=Z&&Z.tabWidth;Z=(0,a.normalize)(Z),Z.sourceFileName=null;function se(ie,R){return ie=Object.assign({},ie,R),function(Q){return de(Q,ie)}}function de(ie,R){if((0,e.default)(ie instanceof r.default),R=R||{},R.includeComments)return(0,n.printComments)(ie,se(R,{includeComments:!1}));var Q=Z.tabWidth;if(!L){var xe=ie.getNode().loc;xe&&xe.lines&&xe.lines.guessTabWidth&&(Z.tabWidth=xe.lines.guessTabWidth())}var Re=(0,l.getReprinter)(ie),ke=Re?Re(de):O(ie,Z,R,se(R,{includeComments:!0,avoidRootParens:!1}));return Z.tabWidth=Q,ke}this.print=function(ie){if(!ie)return m;var R=de(r.default.from(ie),{includeComments:!0,avoidRootParens:!1});return new v(R.toString(Z),u.composeSourceMaps(Z.inputSourceMap,R.getSourceMap(Z.sourceMapName,Z.sourceRoot)))},this.printGenerically=function(ie){if(!ie)return m;function R(ke){return(0,n.printComments)(ke,function($e){return O($e,Z,{avoidRootParens:!1},R)})}var Q=r.default.from(ie),xe=Z.reuseWhitespace;Z.reuseWhitespace=!1;var Re=new v(R(Q).toString(Z));return Z.reuseWhitespace=xe,Re}};fa.Printer=x;function O(D,Z,L,se){(0,e.default)(D instanceof r.default);var de=D.getValue(),ie=[],R=P(D,Z,se);if(!de||R.isEmpty())return R;var Q=!1,xe=S(D,se);return xe.isEmpty()?L.avoidRootParens||(Q=D.needsParens()):ie.push(xe),Q&&ie.unshift("("),ie.push(R),Q&&ie.push(")"),(0,s.concat)(ie)}function P(D,Z,L){var se,de,ie,R=D.getValue();if(!R)return(0,s.fromString)("");if(typeof R=="string")return(0,s.fromString)(R,Z);h.Printable.assert(R);var Q=[];switch(R.type){case"File":return D.call(L,"program");case"Program":return R.directives&&D.each(function(qe){Q.push(L(qe),`;
|
|
64
|
+
`)},"directives"),R.interpreter&&Q.push(D.call(L,"interpreter")),Q.push(D.call(function(qe){return w(qe,Z,L)},"body")),(0,s.concat)(Q);case"Noop":case"EmptyStatement":return(0,s.fromString)("");case"ExpressionStatement":return(0,s.concat)([D.call(L,"expression"),";"]);case"ParenthesizedExpression":return(0,s.concat)(["(",D.call(L,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return(0,s.fromString)(" ").join([D.call(L,"left"),R.operator,D.call(L,"right")]);case"AssignmentPattern":return(0,s.concat)([D.call(L,"left")," = ",D.call(L,"right")]);case"MemberExpression":case"OptionalMemberExpression":{Q.push(D.call(L,"object"));var xe=D.call(L,"property"),Re=i.getFieldValue(R,"optional");return R.computed?Q.push(Re?"?.[":"[",xe,"]"):Q.push(Re?"?.":".",xe),(0,s.concat)(Q)}case"ChainExpression":return D.call(L,"expression");case"MetaProperty":return(0,s.concat)([D.call(L,"meta"),".",D.call(L,"property")]);case"BindExpression":return R.object&&Q.push(D.call(L,"object")),Q.push("::",D.call(L,"callee")),(0,s.concat)(Q);case"Path":return(0,s.fromString)(".").join(R.body);case"Identifier":return(0,s.concat)([(0,s.fromString)(R.name,Z),R.optional?"?":"",D.call(L,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return(0,s.concat)(["...",D.call(L,"argument"),D.call(L,"typeAnnotation")]);case"FunctionDeclaration":case"FunctionExpression":case"TSDeclareFunction":return R.declare&&Q.push("declare "),R.async&&Q.push("async "),Q.push("function"),R.generator&&Q.push("*"),R.id?Q.push(" ",D.call(L,"id"),D.call(L,"typeParameters")):R.typeParameters&&Q.push(D.call(L,"typeParameters")),Q.push("(",$(D,Z,L),")",D.call(L,"returnType")),R.body&&Q.push(" ",D.call(L,"body")),(0,s.concat)(Q);case"ArrowFunctionExpression":return R.async&&Q.push("async "),R.typeParameters&&Q.push(D.call(L,"typeParameters")),!Z.arrowParensAlways&&R.params.length===1&&!R.rest&&R.params[0].type==="Identifier"&&!R.params[0].typeAnnotation&&!R.returnType?Q.push(D.call(L,"params",0)):Q.push("(",$(D,Z,L),")",D.call(L,"returnType")),Q.push(" => ",D.call(L,"body")),(0,s.concat)(Q);case"MethodDefinition":return k(D,Z,L);case"YieldExpression":return Q.push("yield"),R.delegate&&Q.push("*"),R.argument&&Q.push(" ",D.call(L,"argument")),(0,s.concat)(Q);case"AwaitExpression":return Q.push("await"),R.all&&Q.push("*"),R.argument&&Q.push(" ",D.call(L,"argument")),(0,s.concat)(Q);case"ModuleExpression":return(0,s.concat)([`module {
|
|
65
|
+
`,D.call(L,"body").indent(Z.tabWidth),`
|
|
66
|
+
}`]);case"ModuleDeclaration":return Q.push("module",D.call(L,"id")),R.source?((0,e.default)(!R.body),Q.push("from",D.call(L,"source"))):Q.push(D.call(L,"body")),(0,s.fromString)(" ").join(Q);case"ImportSpecifier":return R.importKind&&R.importKind!=="value"&&Q.push(R.importKind+" "),R.imported?(Q.push(D.call(L,"imported")),R.local&&R.local.name!==R.imported.name&&Q.push(" as ",D.call(L,"local"))):R.id&&(Q.push(D.call(L,"id")),R.name&&Q.push(" as ",D.call(L,"name"))),(0,s.concat)(Q);case"ExportSpecifier":return R.exportKind&&R.exportKind!=="value"&&Q.push(R.exportKind+" "),R.local?(Q.push(D.call(L,"local")),R.exported&&R.exported.name!==R.local.name&&Q.push(" as ",D.call(L,"exported"))):R.id&&(Q.push(D.call(L,"id")),R.name&&Q.push(" as ",D.call(L,"name"))),(0,s.concat)(Q);case"ExportBatchSpecifier":return(0,s.fromString)("*");case"ImportNamespaceSpecifier":return Q.push("* as "),R.local?Q.push(D.call(L,"local")):R.id&&Q.push(D.call(L,"id")),(0,s.concat)(Q);case"ImportDefaultSpecifier":return R.local?D.call(L,"local"):D.call(L,"id");case"TSExportAssignment":return(0,s.concat)(["export = ",D.call(L,"expression")]);case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return I(D,Z,L);case"ExportAllDeclaration":return Q.push("export *"),R.exported&&Q.push(" as ",D.call(L,"exported")),Q.push(" from ",D.call(L,"source"),";"),(0,s.concat)(Q);case"TSNamespaceExportDeclaration":return Q.push("export as namespace ",D.call(L,"id")),fe((0,s.concat)(Q));case"ExportNamespaceSpecifier":return(0,s.concat)(["* as ",D.call(L,"exported")]);case"ExportDefaultSpecifier":return D.call(L,"exported");case"Import":return(0,s.fromString)("import",Z);case"ImportExpression":return(0,s.concat)(["import(",D.call(L,"source"),")"]);case"ImportDeclaration":{if(Q.push("import "),R.importKind&&R.importKind!=="value"&&Q.push(R.importKind+" "),R.specifiers&&R.specifiers.length>0){var ke=[],$e=[];if(D.each(function(qe){var it=qe.getValue();it.type==="ImportSpecifier"?$e.push(L(qe)):(it.type==="ImportDefaultSpecifier"||it.type==="ImportNamespaceSpecifier")&&ke.push(L(qe))},"specifiers"),ke.forEach(function(qe,it){it>0&&Q.push(", "),Q.push(qe)}),$e.length>0){var te=(0,s.fromString)(", ").join($e);te.getLineLength(1)>Z.wrapColumn&&(te=(0,s.concat)([(0,s.fromString)(`,
|
|
67
|
+
`).join($e).indent(Z.tabWidth),","])),ke.length>0&&Q.push(", "),te.length>1?Q.push(`{
|
|
68
|
+
`,te,`
|
|
69
|
+
}`):Z.objectCurlySpacing?Q.push("{ ",te," }"):Q.push("{",te,"}")}Q.push(" from ")}return Q.push(D.call(L,"source"),F(D,Z,L),";"),(0,s.concat)(Q)}case"ImportAttribute":return(0,s.concat)([D.call(L,"key"),": ",D.call(L,"value")]);case"StaticBlock":Q.push("static ");case"BlockStatement":{var H=D.call(function(qe){return w(qe,Z,L)},"body");return H.isEmpty()&&(!R.directives||R.directives.length===0)?(Q.push("{}"),(0,s.concat)(Q)):(Q.push(`{
|
|
70
|
+
`),R.directives&&D.each(function(qe){Q.push(fe(L(qe).indent(Z.tabWidth)),R.directives.length>1||!H.isEmpty()?`
|
|
71
|
+
`:"")},"directives"),Q.push(H.indent(Z.tabWidth)),Q.push(`
|
|
72
|
+
}`),(0,s.concat)(Q))}case"ReturnStatement":{if(Q.push("return"),R.argument){var re=((se=h.JSXElement)===null||se===void 0?void 0:se.check(R.argument))||((de=h.JSXFragment)===null||de===void 0?void 0:de.check(R.argument)),G=D.call(L,"argument");G.startsWithComment()||G.length>1&&re?(re&&(!((ie=R.argument.extra)===null||ie===void 0)&&ie.parenthesized)&&(R.argument.extra.parenthesized=!1,G=D.call(L,"argument"),R.argument.extra.parenthesized=!0),Q.push(" ",(0,s.concat)([`(
|
|
73
|
+
`,G]).indentTail(Z.tabWidth),`
|
|
74
|
+
)`)):Q.push(" ",G)}return Q.push(";"),(0,s.concat)(Q)}case"CallExpression":case"OptionalCallExpression":return Q.push(D.call(L,"callee")),R.typeParameters&&Q.push(D.call(L,"typeParameters")),R.typeArguments&&Q.push(D.call(L,"typeArguments")),i.getFieldValue(R,"optional")&&Q.push("?."),Q.push(A(D,Z,L)),(0,s.concat)(Q);case"RecordExpression":Q.push("#");case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":{var J=R.type==="ObjectTypeAnnotation",le=Z.flowObjectCommas?",":J?";":",",ve=[],we=!1;J&&(ve.push("indexers","callProperties"),R.internalSlots!=null&&ve.push("internalSlots")),ve.push("properties");var K=0;ve.forEach(function(qe){K+=R[qe].length});var ue=J&&K===1||K===0,me=R.exact?"{|":"{",Pe=R.exact?"|}":"}";Q.push(ue?me:me+`
|
|
75
|
+
`);var Ve=Q.length-1,He=0;if(ve.forEach(function(qe){D.each(function(it){var bi=L(it);ue||(bi=bi.indent(Z.tabWidth));var Ei=!J&&bi.length>1;Ei&&we&&Q.push(`
|
|
76
|
+
`),Q.push(bi),He<K-1?(Q.push(le+(Ei?`
|
|
77
|
+
|
|
78
|
+
`:`
|
|
79
|
+
`)),we=!Ei):(K!==1&&J||!ue&&u.isTrailingCommaEnabled(Z,"objects")&&it.getValue().type!=="RestElement")&&Q.push(le),He++},qe)}),R.inexact){var Tt=(0,s.fromString)("...",Z);ue?(K>0&&Q.push(le," "),Q.push(Tt)):Q.push(`
|
|
80
|
+
`,Tt.indent(Z.tabWidth))}return Q.push(ue?Pe:`
|
|
81
|
+
`+Pe),He!==0&&ue&&Z.objectCurlySpacing&&(Q[Ve]=me+" ",Q[Q.length-1]=" "+Pe),R.typeAnnotation&&Q.push(D.call(L,"typeAnnotation")),(0,s.concat)(Q)}case"PropertyPattern":return(0,s.concat)([D.call(L,"key"),": ",D.call(L,"pattern")]);case"ObjectProperty":case"Property":{if(R.method||R.kind==="get"||R.kind==="set")return k(D,Z,L);if(R.shorthand&&R.value.type==="AssignmentPattern")return D.call(L,"value");var Je=D.call(L,"key");return R.computed?Q.push("[",Je,"]"):Q.push(Je),(!R.shorthand||R.key.name!==R.value.name)&&Q.push(": ",D.call(L,"value")),(0,s.concat)(Q)}case"ClassMethod":case"ObjectMethod":case"ClassPrivateMethod":case"TSDeclareMethod":return k(D,Z,L);case"PrivateName":return(0,s.concat)(["#",D.call(L,"id")]);case"Decorator":return(0,s.concat)(["@",D.call(L,"expression")]);case"TupleExpression":Q.push("#");case"ArrayExpression":case"ArrayPattern":{var ei=R.elements,qt=ei.length,Bn=D.map(L,"elements"),gn=(0,s.fromString)(", ").join(Bn),ji=gn.getLineLength(1)<=Z.wrapColumn;return ji?Z.arrayBracketSpacing?Q.push("[ "):Q.push("["):Q.push(`[
|
|
82
|
+
`),D.each(function(qe){var it=qe.getName(),bi=qe.getValue();if(!bi)Q.push(",");else{var Ei=Bn[it];ji?it>0&&Q.push(" "):Ei=Ei.indent(Z.tabWidth),Q.push(Ei),(it<qt-1||!ji&&u.isTrailingCommaEnabled(Z,"arrays"))&&Q.push(","),ji||Q.push(`
|
|
83
|
+
`)}},"elements"),ji&&Z.arrayBracketSpacing?Q.push(" ]"):Q.push("]"),R.typeAnnotation&&Q.push(D.call(L,"typeAnnotation")),(0,s.concat)(Q)}case"SequenceExpression":return(0,s.fromString)(", ").join(D.map(L,"expressions"));case"ThisExpression":return(0,s.fromString)("this");case"Super":return(0,s.fromString)("super");case"NullLiteral":return(0,s.fromString)("null");case"RegExpLiteral":return(0,s.fromString)(V(R)||"/".concat(R.pattern,"/").concat(R.flags||""),Z);case"BigIntLiteral":return(0,s.fromString)(V(R)||R.value+"n",Z);case"NumericLiteral":return(0,s.fromString)(V(R)||R.value,Z);case"DecimalLiteral":return(0,s.fromString)(V(R)||R.value+"m",Z);case"StringLiteral":return(0,s.fromString)(ae(R.value,Z));case"BooleanLiteral":case"Literal":return(0,s.fromString)(V(R)||(typeof R.value=="string"?ae(R.value,Z):R.value),Z);case"Directive":return D.call(L,"value");case"DirectiveLiteral":return(0,s.fromString)(V(R)||ae(R.value,Z),Z);case"InterpreterDirective":return(0,s.fromString)("#!".concat(R.value,`
|
|
84
|
+
`),Z);case"ModuleSpecifier":if(R.local)throw new Error("The ESTree ModuleSpecifier type should be abstract");return(0,s.fromString)(ae(R.value,Z),Z);case"UnaryExpression":return Q.push(R.operator),/[a-z]$/.test(R.operator)&&Q.push(" "),Q.push(D.call(L,"argument")),(0,s.concat)(Q);case"UpdateExpression":return Q.push(D.call(L,"argument"),R.operator),R.prefix&&Q.reverse(),(0,s.concat)(Q);case"ConditionalExpression":return(0,s.concat)([D.call(L,"test")," ? ",D.call(L,"consequent")," : ",D.call(L,"alternate")]);case"NewExpression":{Q.push("new ",D.call(L,"callee")),R.typeParameters&&Q.push(D.call(L,"typeParameters")),R.typeArguments&&Q.push(D.call(L,"typeArguments"));var Zs=R.arguments;return Zs&&Q.push(A(D,Z,L)),(0,s.concat)(Q)}case"VariableDeclaration":{R.declare&&Q.push("declare "),Q.push(R.kind," ");var yn=0,zt=D.map(function(qe){var it=L(qe);return yn=Math.max(it.length,yn),it},"declarations");yn===1?Q.push((0,s.fromString)(", ").join(zt)):zt.length>1?Q.push((0,s.fromString)(`,
|
|
85
|
+
`).join(zt).indentTail(R.kind.length+1)):Q.push(zt[0]);var ti=D.getParentNode();return!h.ForStatement.check(ti)&&!h.ForInStatement.check(ti)&&!(h.ForOfStatement&&h.ForOfStatement.check(ti))&&!(h.ForAwaitStatement&&h.ForAwaitStatement.check(ti))&&Q.push(";"),(0,s.concat)(Q)}case"VariableDeclarator":return R.init?(0,s.fromString)(" = ").join([D.call(L,"id"),D.call(L,"init")]):D.call(L,"id");case"WithStatement":return(0,s.concat)(["with (",D.call(L,"object"),") ",D.call(L,"body")]);case"IfStatement":{var Qn=M(D.call(L,"consequent"),Z);return Q.push("if (",D.call(L,"test"),")",Qn),R.alternate&&Q.push(X(Qn)?" else":`
|
|
86
|
+
else`,M(D.call(L,"alternate"),Z)),(0,s.concat)(Q)}case"ForStatement":{var Hr=D.call(L,"init"),Vs=Hr.length>1?`;
|
|
87
|
+
`:"; ",ce="for (",ge=(0,s.fromString)(Vs).join([Hr,D.call(L,"test"),D.call(L,"update")]).indentTail(ce.length),Ce=(0,s.concat)([ce,ge,")"]),Ue=M(D.call(L,"body"),Z);return Q.push(Ce),Ce.length>1&&(Q.push(`
|
|
88
|
+
`),Ue=Ue.trimLeft()),Q.push(Ue),(0,s.concat)(Q)}case"WhileStatement":return(0,s.concat)(["while (",D.call(L,"test"),")",M(D.call(L,"body"),Z)]);case"ForInStatement":return(0,s.concat)([R.each?"for each (":"for (",D.call(L,"left")," in ",D.call(L,"right"),")",M(D.call(L,"body"),Z)]);case"ForOfStatement":case"ForAwaitStatement":return Q.push("for "),(R.await||R.type==="ForAwaitStatement")&&Q.push("await "),Q.push("(",D.call(L,"left")," of ",D.call(L,"right"),")",M(D.call(L,"body"),Z)),(0,s.concat)(Q);case"DoWhileStatement":{var $t=(0,s.concat)(["do",M(D.call(L,"body"),Z)]);return Q.push($t),X($t)?Q.push(" while"):Q.push(`
|
|
89
|
+
while`),Q.push(" (",D.call(L,"test"),");"),(0,s.concat)(Q)}case"DoExpression":{var pr=D.call(function(qe){return w(qe,Z,L)},"body");return(0,s.concat)([`do {
|
|
90
|
+
`,pr.indent(Z.tabWidth),`
|
|
91
|
+
}`])}case"BreakStatement":return Q.push("break"),R.label&&Q.push(" ",D.call(L,"label")),Q.push(";"),(0,s.concat)(Q);case"ContinueStatement":return Q.push("continue"),R.label&&Q.push(" ",D.call(L,"label")),Q.push(";"),(0,s.concat)(Q);case"LabeledStatement":return(0,s.concat)([D.call(L,"label"),`:
|
|
92
|
+
`,D.call(L,"body")]);case"TryStatement":return Q.push("try ",D.call(L,"block")),R.handler?Q.push(" ",D.call(L,"handler")):R.handlers&&D.each(function(qe){Q.push(" ",L(qe))},"handlers"),R.finalizer&&Q.push(" finally ",D.call(L,"finalizer")),(0,s.concat)(Q);case"CatchClause":return Q.push("catch "),R.param&&Q.push("(",D.call(L,"param")),R.guard&&Q.push(" if ",D.call(L,"guard")),R.param&&Q.push(") "),Q.push(D.call(L,"body")),(0,s.concat)(Q);case"ThrowStatement":return(0,s.concat)(["throw ",D.call(L,"argument"),";"]);case"SwitchStatement":return(0,s.concat)(["switch (",D.call(L,"discriminant"),`) {
|
|
93
|
+
`,(0,s.fromString)(`
|
|
94
|
+
`).join(D.map(L,"cases")),`
|
|
95
|
+
}`]);case"SwitchCase":return R.test?Q.push("case ",D.call(L,"test"),":"):Q.push("default:"),R.consequent.length>0&&Q.push(`
|
|
96
|
+
`,D.call(function(qe){return w(qe,Z,L)},"consequent").indent(Z.tabWidth)),(0,s.concat)(Q);case"DebuggerStatement":return(0,s.fromString)("debugger;");case"JSXAttribute":return Q.push(D.call(L,"name")),R.value&&Q.push("=",D.call(L,"value")),(0,s.concat)(Q);case"JSXIdentifier":return(0,s.fromString)(R.name,Z);case"JSXNamespacedName":return(0,s.fromString)(":").join([D.call(L,"namespace"),D.call(L,"name")]);case"JSXMemberExpression":return(0,s.fromString)(".").join([D.call(L,"object"),D.call(L,"property")]);case"JSXSpreadAttribute":return(0,s.concat)(["{...",D.call(L,"argument"),"}"]);case"JSXSpreadChild":return(0,s.concat)(["{...",D.call(L,"expression"),"}"]);case"JSXExpressionContainer":return(0,s.concat)(["{",D.call(L,"expression"),"}"]);case"JSXElement":case"JSXFragment":{var Jr="opening"+(R.type==="JSXElement"?"Element":"Fragment"),Us="closing"+(R.type==="JSXElement"?"Element":"Fragment"),ml=D.call(L,Jr);if(R[Jr].selfClosing)return(0,e.default)(!R[Us],"unexpected "+Us+" element in self-closing "+R.type),ml;var qs=(0,s.concat)(D.map(function(qe){var it=qe.getValue();if(h.Literal.check(it)&&typeof it.value=="string"){if(/\S/.test(it.value))return it.value.replace(/^\s+/g,"");if(/\n/.test(it.value))return`
|
|
97
|
+
`}return L(qe)},"children")).indentTail(Z.tabWidth),Ws=D.call(L,Us);return(0,s.concat)([ml,qs,Ws])}case"JSXOpeningElement":{Q.push("<",D.call(L,"name"));var gl=D.call(L,"typeParameters");gl.length&&Q.push(gl);var mr=[];D.each(function(qe){mr.push(" ",L(qe))},"attributes");var Kr=(0,s.concat)(mr),je=Kr.length>1||Kr.getLineLength(1)>Z.wrapColumn;return je&&(mr.forEach(function(qe,it){qe===" "&&((0,e.default)(it%2===0),mr[it]=`
|
|
98
|
+
`)}),Kr=(0,s.concat)(mr).indentTail(Z.tabWidth)),Q.push(Kr,R.selfClosing?" />":">"),(0,s.concat)(Q)}case"JSXClosingElement":return(0,s.concat)(["</",D.call(L,"name"),">"]);case"JSXOpeningFragment":return(0,s.fromString)("<>");case"JSXClosingFragment":return(0,s.fromString)("</>");case"JSXText":return(0,s.fromString)(R.value,Z);case"JSXEmptyExpression":return(0,s.fromString)("");case"TypeAnnotatedIdentifier":return(0,s.concat)([D.call(L,"annotation")," ",D.call(L,"identifier")]);case"ClassBody":return R.body.length===0?(0,s.fromString)("{}"):(0,s.concat)([`{
|
|
99
|
+
`,D.call(function(qe){return w(qe,Z,L)},"body").indent(Z.tabWidth),`
|
|
100
|
+
}`]);case"ClassPropertyDefinition":return Q.push("static ",D.call(L,"definition")),h.MethodDefinition.check(R.definition)||Q.push(";"),(0,s.concat)(Q);case"ClassProperty":{R.declare&&Q.push("declare ");var yl=R.accessibility||R.access;typeof yl=="string"&&Q.push(yl," "),R.static&&Q.push("static "),R.abstract&&Q.push("abstract "),R.readonly&&Q.push("readonly ");var Je=D.call(L,"key");return R.computed&&(Je=(0,s.concat)(["[",Je,"]"])),R.variance&&(Je=(0,s.concat)([j(D,L),Je])),Q.push(Je),R.optional&&Q.push("?"),R.definite&&Q.push("!"),R.typeAnnotation&&Q.push(D.call(L,"typeAnnotation")),R.value&&Q.push(" = ",D.call(L,"value")),Q.push(";"),(0,s.concat)(Q)}case"ClassPrivateProperty":return R.static&&Q.push("static "),Q.push(D.call(L,"key")),R.typeAnnotation&&Q.push(D.call(L,"typeAnnotation")),R.value&&Q.push(" = ",D.call(L,"value")),Q.push(";"),(0,s.concat)(Q);case"ClassAccessorProperty":return Q.push.apply(Q,t.__spreadArray(t.__spreadArray([],E(R),!1),["accessor "],!1)),R.computed?Q.push("[",D.call(L,"key"),"]"):Q.push(D.call(L,"key")),R.optional&&Q.push("?"),R.definite&&Q.push("!"),R.typeAnnotation&&Q.push(D.call(L,"typeAnnotation")),R.value&&Q.push(" = ",D.call(L,"value")),Q.push(";"),(0,s.concat)(Q);case"ClassDeclaration":case"ClassExpression":case"DeclareClass":return R.declare&&Q.push("declare "),R.abstract&&Q.push("abstract "),Q.push("class"),R.id&&Q.push(" ",D.call(L,"id")),R.typeParameters&&Q.push(D.call(L,"typeParameters")),R.superClass&&Q.push(" extends ",D.call(L,"superClass"),D.call(L,"superTypeParameters")),R.extends&&R.extends.length>0&&Q.push(" extends ",(0,s.fromString)(", ").join(D.map(L,"extends"))),R.implements&&R.implements.length>0&&Q.push(" implements ",(0,s.fromString)(", ").join(D.map(L,"implements"))),Q.push(" ",D.call(L,"body")),R.type==="DeclareClass"?B(D,Q):(0,s.concat)(Q);case"TemplateElement":return(0,s.fromString)(R.value.raw,Z).lockIndentTail();case"TemplateLiteral":{var Ys=D.map(L,"expressions");return Q.push("`"),D.each(function(qe){var it=qe.getName();Q.push(L(qe)),it<Ys.length&&Q.push("${",Ys[it],"}")},"quasis"),Q.push("`"),(0,s.concat)(Q).lockIndentTail()}case"TaggedTemplateExpression":return Q.push(D.call(L,"tag")),R.typeParameters&&Q.push(D.call(L,"typeParameters")),Q.push(D.call(L,"quasi")),(0,s.concat)(Q);case"Node":case"Printable":case"SourceLocation":case"Position":case"Statement":case"Function":case"Pattern":case"Expression":case"Declaration":case"Specifier":case"NamedSpecifier":case"Comment":case"Flow":case"FlowType":case"FlowPredicate":case"MemberTypeAnnotation":case"Type":case"TSHasOptionalTypeParameterInstantiation":case"TSHasOptionalTypeParameters":case"TSHasOptionalTypeAnnotation":case"ChainElement":throw new Error("unprintable type: "+JSON.stringify(R.type));case"CommentBlock":case"Block":return(0,s.concat)(["/*",(0,s.fromString)(R.value,Z),"*/"]);case"CommentLine":case"Line":return(0,s.concat)(["//",(0,s.fromString)(R.value,Z)]);case"TypeAnnotation":return R.typeAnnotation?(R.typeAnnotation.type!=="FunctionTypeAnnotation"&&Q.push(": "),Q.push(D.call(L,"typeAnnotation")),(0,s.concat)(Q)):(0,s.fromString)("");case"ExistentialTypeParam":case"ExistsTypeAnnotation":return(0,s.fromString)("*",Z);case"EmptyTypeAnnotation":return(0,s.fromString)("empty",Z);case"AnyTypeAnnotation":return(0,s.fromString)("any",Z);case"MixedTypeAnnotation":return(0,s.fromString)("mixed",Z);case"ArrayTypeAnnotation":return(0,s.concat)([D.call(L,"elementType"),"[]"]);case"TupleTypeAnnotation":{var vl=D.map(L,"types"),gn=(0,s.fromString)(", ").join(vl),gr=gn.getLineLength(1)<=Z.wrapColumn;return gr?Z.arrayBracketSpacing?Q.push("[ "):Q.push("["):Q.push(`[
|
|
101
|
+
`),D.each(function(it){var bi=it.getName(),Ei=it.getValue();if(!Ei)Q.push(",");else{var Fn=vl[bi];gr?bi>0&&Q.push(" "):Fn=Fn.indent(Z.tabWidth),Q.push(Fn),(bi<R.types.length-1||!gr&&u.isTrailingCommaEnabled(Z,"arrays"))&&Q.push(","),gr||Q.push(`
|
|
102
|
+
`)}},"types"),gr&&Z.arrayBracketSpacing?Q.push(" ]"):Q.push("]"),(0,s.concat)(Q)}case"BooleanTypeAnnotation":return(0,s.fromString)("boolean",Z);case"BooleanLiteralTypeAnnotation":return(0,e.default)(typeof R.value=="boolean"),(0,s.fromString)(""+R.value,Z);case"InterfaceTypeAnnotation":return Q.push("interface"),R.extends&&R.extends.length>0&&Q.push(" extends ",(0,s.fromString)(", ").join(D.map(L,"extends"))),Q.push(" ",D.call(L,"body")),(0,s.concat)(Q);case"DeclareFunction":return B(D,["function ",D.call(L,"id"),";"]);case"DeclareModule":return B(D,["module ",D.call(L,"id")," ",D.call(L,"body")]);case"DeclareModuleExports":return B(D,["module.exports",D.call(L,"typeAnnotation")]);case"DeclareVariable":return B(D,["var ",D.call(L,"id"),";"]);case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return(0,s.concat)(["declare ",I(D,Z,L)]);case"EnumDeclaration":return(0,s.concat)(["enum ",D.call(L,"id"),D.call(L,"body")]);case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":return(R.type==="EnumSymbolBody"||R.explicitType)&&Q.push(" of ",R.type.slice(4,-4).toLowerCase()),Q.push(` {
|
|
103
|
+
`,(0,s.fromString)(`
|
|
104
|
+
`).join(D.map(L,"members")).indent(Z.tabWidth),`
|
|
105
|
+
}`),(0,s.concat)(Q);case"EnumDefaultedMember":return(0,s.concat)([D.call(L,"id"),","]);case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":return(0,s.concat)([D.call(L,"id")," = ",D.call(L,"init"),","]);case"InferredPredicate":return(0,s.fromString)("%checks",Z);case"DeclaredPredicate":return(0,s.concat)(["%checks(",D.call(L,"value"),")"]);case"FunctionTypeAnnotation":{var ki=D.getParentNode(0),Ol=!(h.ObjectTypeCallProperty.check(ki)||h.ObjectTypeInternalSlot.check(ki)&&ki.method||h.DeclareFunction.check(D.getParentNode(2))),sh=Ol&&!h.FunctionTypeParam.check(ki)&&!h.TypeAlias.check(ki);sh&&Q.push(": ");var xl=!!R.typeParameters,yr=xl||R.params.length!==1||R.params[0].name;return Q.push(xl?D.call(L,"typeParameters"):"",yr?"(":"",$(D,Z,L),yr?")":""),R.returnType&&Q.push(Ol?" => ":": ",D.call(L,"returnType")),(0,s.concat)(Q)}case"FunctionTypeParam":{var vn=D.call(L,"name");return Q.push(vn),R.optional&&Q.push("?"),vn.infos[0].line&&Q.push(": "),Q.push(D.call(L,"typeAnnotation")),(0,s.concat)(Q)}case"GenericTypeAnnotation":return(0,s.concat)([D.call(L,"id"),D.call(L,"typeParameters")]);case"DeclareInterface":Q.push("declare ");case"InterfaceDeclaration":case"TSInterfaceDeclaration":return R.declare&&Q.push("declare "),Q.push("interface ",D.call(L,"id"),D.call(L,"typeParameters")," "),R.extends&&R.extends.length>0&&Q.push("extends ",(0,s.fromString)(", ").join(D.map(L,"extends"))," "),R.body&&Q.push(D.call(L,"body")),(0,s.concat)(Q);case"ClassImplements":case"InterfaceExtends":return(0,s.concat)([D.call(L,"id"),D.call(L,"typeParameters")]);case"IntersectionTypeAnnotation":return(0,s.fromString)(" & ").join(D.map(L,"types"));case"NullableTypeAnnotation":return(0,s.concat)(["?",D.call(L,"typeAnnotation")]);case"NullLiteralTypeAnnotation":return(0,s.fromString)("null",Z);case"ThisTypeAnnotation":return(0,s.fromString)("this",Z);case"NumberTypeAnnotation":return(0,s.fromString)("number",Z);case"ObjectTypeCallProperty":return D.call(L,"value");case"ObjectTypeIndexer":return R.static&&Q.push("static "),Q.push(j(D,L),"["),R.id&&Q.push(D.call(L,"id"),": "),Q.push(D.call(L,"key"),"]: ",D.call(L,"value")),(0,s.concat)(Q);case"ObjectTypeProperty":return(0,s.concat)([j(D,L),D.call(L,"key"),R.optional?"?":"",": ",D.call(L,"value")]);case"ObjectTypeInternalSlot":return(0,s.concat)([R.static?"static ":"","[[",D.call(L,"id"),"]]",R.optional?"?":"",R.value.type!=="FunctionTypeAnnotation"?": ":"",D.call(L,"value")]);case"QualifiedTypeIdentifier":return(0,s.concat)([D.call(L,"qualification"),".",D.call(L,"id")]);case"StringLiteralTypeAnnotation":return(0,s.fromString)(ae(R.value,Z),Z);case"NumberLiteralTypeAnnotation":case"NumericLiteralTypeAnnotation":return(0,e.default)(typeof R.value=="number"),(0,s.fromString)(JSON.stringify(R.value),Z);case"BigIntLiteralTypeAnnotation":return(0,s.fromString)(R.raw,Z);case"StringTypeAnnotation":return(0,s.fromString)("string",Z);case"DeclareTypeAlias":Q.push("declare ");case"TypeAlias":return(0,s.concat)(["type ",D.call(L,"id"),D.call(L,"typeParameters")," = ",D.call(L,"right"),";"]);case"DeclareOpaqueType":Q.push("declare ");case"OpaqueType":return Q.push("opaque type ",D.call(L,"id"),D.call(L,"typeParameters")),R.supertype&&Q.push(": ",D.call(L,"supertype")),R.impltype&&Q.push(" = ",D.call(L,"impltype")),Q.push(";"),(0,s.concat)(Q);case"TypeCastExpression":return(0,s.concat)(["(",D.call(L,"expression"),D.call(L,"typeAnnotation"),")"]);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return(0,s.concat)(["<",(0,s.fromString)(", ").join(D.map(L,"params")),">"]);case"Variance":return R.kind==="plus"?(0,s.fromString)("+"):R.kind==="minus"?(0,s.fromString)("-"):(0,s.fromString)("");case"TypeParameter":return R.variance&&Q.push(j(D,L)),Q.push(D.call(L,"name")),R.bound&&Q.push(D.call(L,"bound")),R.default&&Q.push("=",D.call(L,"default")),(0,s.concat)(Q);case"TypeofTypeAnnotation":return(0,s.concat)([(0,s.fromString)("typeof ",Z),D.call(L,"argument")]);case"IndexedAccessType":case"OptionalIndexedAccessType":return(0,s.concat)([D.call(L,"objectType"),R.optional?"?.":"","[",D.call(L,"indexType"),"]"]);case"UnionTypeAnnotation":return(0,s.fromString)(" | ").join(D.map(L,"types"));case"VoidTypeAnnotation":return(0,s.fromString)("void",Z);case"NullTypeAnnotation":return(0,s.fromString)("null",Z);case"SymbolTypeAnnotation":return(0,s.fromString)("symbol",Z);case"BigIntTypeAnnotation":return(0,s.fromString)("bigint",Z);case"TSType":throw new Error("unprintable type: "+JSON.stringify(R.type));case"TSNumberKeyword":return(0,s.fromString)("number",Z);case"TSBigIntKeyword":return(0,s.fromString)("bigint",Z);case"TSObjectKeyword":return(0,s.fromString)("object",Z);case"TSBooleanKeyword":return(0,s.fromString)("boolean",Z);case"TSStringKeyword":return(0,s.fromString)("string",Z);case"TSSymbolKeyword":return(0,s.fromString)("symbol",Z);case"TSAnyKeyword":return(0,s.fromString)("any",Z);case"TSVoidKeyword":return(0,s.fromString)("void",Z);case"TSIntrinsicKeyword":return(0,s.fromString)("intrinsic",Z);case"TSThisType":return(0,s.fromString)("this",Z);case"TSNullKeyword":return(0,s.fromString)("null",Z);case"TSUndefinedKeyword":return(0,s.fromString)("undefined",Z);case"TSUnknownKeyword":return(0,s.fromString)("unknown",Z);case"TSNeverKeyword":return(0,s.fromString)("never",Z);case"TSArrayType":return(0,s.concat)([D.call(L,"elementType"),"[]"]);case"TSLiteralType":return D.call(L,"literal");case"TSUnionType":return(0,s.fromString)(" | ").join(D.map(L,"types"));case"TSIntersectionType":return(0,s.fromString)(" & ").join(D.map(L,"types"));case"TSConditionalType":return Q.push(D.call(L,"checkType")," extends ",D.call(L,"extendsType")," ? ",D.call(L,"trueType")," : ",D.call(L,"falseType")),(0,s.concat)(Q);case"TSInferType":return Q.push("infer ",D.call(L,"typeParameter")),(0,s.concat)(Q);case"TSParenthesizedType":return(0,s.concat)(["(",D.call(L,"typeAnnotation"),")"]);case"TSFunctionType":return(0,s.concat)([D.call(L,"typeParameters"),"(",$(D,Z,L),") => ",D.call(L,"typeAnnotation","typeAnnotation")]);case"TSConstructorType":return(0,s.concat)(["new ",D.call(L,"typeParameters"),"(",$(D,Z,L),") => ",D.call(L,"typeAnnotation","typeAnnotation")]);case"TSMappedType":return Q.push(R.readonly?"readonly ":"","[",D.call(L,"typeParameter"),"]",R.optional?"?":""),R.typeAnnotation&&Q.push(": ",D.call(L,"typeAnnotation"),";"),(0,s.concat)([`{
|
|
106
|
+
`,(0,s.concat)(Q).indent(Z.tabWidth),`
|
|
107
|
+
}`]);case"TSTupleType":return(0,s.concat)(["[",(0,s.fromString)(", ").join(D.map(L,"elementTypes")),"]"]);case"TSNamedTupleMember":return Q.push(D.call(L,"label")),R.optional&&Q.push("?"),Q.push(": ",D.call(L,"elementType")),(0,s.concat)(Q);case"TSRestType":return(0,s.concat)(["...",D.call(L,"typeAnnotation")]);case"TSOptionalType":return(0,s.concat)([D.call(L,"typeAnnotation"),"?"]);case"TSIndexedAccessType":return(0,s.concat)([D.call(L,"objectType"),"[",D.call(L,"indexType"),"]"]);case"TSTypeOperator":return(0,s.concat)([D.call(L,"operator")," ",D.call(L,"typeAnnotation")]);case"TSTypeLiteral":{var Gs=(0,s.fromString)(`
|
|
108
|
+
`).join(D.map(L,"members").map(function(qe){return q(qe)!==";"?qe.concat(";"):qe}));return Gs.isEmpty()?(0,s.fromString)("{}",Z):(Q.push(`{
|
|
109
|
+
`,Gs.indent(Z.tabWidth),`
|
|
110
|
+
}`),(0,s.concat)(Q))}case"TSEnumMember":return Q.push(D.call(L,"id")),R.initializer&&Q.push(" = ",D.call(L,"initializer")),(0,s.concat)(Q);case"TSTypeQuery":return(0,s.concat)(["typeof ",D.call(L,"exprName")]);case"TSParameterProperty":return R.accessibility&&Q.push(R.accessibility," "),R.export&&Q.push("export "),R.static&&Q.push("static "),R.readonly&&Q.push("readonly "),Q.push(D.call(L,"parameter")),(0,s.concat)(Q);case"TSTypeReference":return(0,s.concat)([D.call(L,"typeName"),D.call(L,"typeParameters")]);case"TSQualifiedName":return(0,s.concat)([D.call(L,"left"),".",D.call(L,"right")]);case"TSAsExpression":case"TSSatisfiesExpression":{var Hs=D.call(L,"expression");return Q.push(Hs,R.type==="TSSatisfiesExpression"?" satisfies ":" as ",D.call(L,"typeAnnotation")),(0,s.concat)(Q)}case"TSTypeCastExpression":return(0,s.concat)([D.call(L,"expression"),D.call(L,"typeAnnotation")]);case"TSNonNullExpression":return(0,s.concat)([D.call(L,"expression"),"!"]);case"TSTypeAnnotation":return(0,s.concat)([": ",D.call(L,"typeAnnotation")]);case"TSIndexSignature":return(0,s.concat)([R.readonly?"readonly ":"","[",D.map(L,"parameters"),"]",D.call(L,"typeAnnotation")]);case"TSPropertySignature":return Q.push(j(D,L),R.readonly?"readonly ":""),R.computed?Q.push("[",D.call(L,"key"),"]"):Q.push(D.call(L,"key")),Q.push(R.optional?"?":"",D.call(L,"typeAnnotation")),(0,s.concat)(Q);case"TSMethodSignature":return R.kind==="get"?Q.push("get "):R.kind==="set"&&Q.push("set "),R.computed?Q.push("[",D.call(L,"key"),"]"):Q.push(D.call(L,"key")),R.optional&&Q.push("?"),Q.push(D.call(L,"typeParameters"),"(",$(D,Z,L),")",D.call(L,"typeAnnotation")),(0,s.concat)(Q);case"TSTypePredicate":return R.asserts&&Q.push("asserts "),Q.push(D.call(L,"parameterName")),R.typeAnnotation&&Q.push(" is ",D.call(L,"typeAnnotation","typeAnnotation")),(0,s.concat)(Q);case"TSCallSignatureDeclaration":return(0,s.concat)([D.call(L,"typeParameters"),"(",$(D,Z,L),")",D.call(L,"typeAnnotation")]);case"TSConstructSignatureDeclaration":return R.typeParameters?Q.push("new",D.call(L,"typeParameters")):Q.push("new "),Q.push("(",$(D,Z,L),")",D.call(L,"typeAnnotation")),(0,s.concat)(Q);case"TSTypeAliasDeclaration":return(0,s.concat)([R.declare?"declare ":"","type ",D.call(L,"id"),D.call(L,"typeParameters")," = ",D.call(L,"typeAnnotation"),";"]);case"TSTypeParameter":{Q.push(D.call(L,"name"));var ki=D.getParentNode(0),Js=h.TSMappedType.check(ki);return R.constraint&&Q.push(Js?" in ":" extends ",D.call(L,"constraint")),R.default&&Q.push(" = ",D.call(L,"default")),(0,s.concat)(Q)}case"TSTypeAssertion":return Q.push("<",D.call(L,"typeAnnotation"),"> ",D.call(L,"expression")),(0,s.concat)(Q);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return(0,s.concat)(["<",(0,s.fromString)(", ").join(D.map(L,"params")),">"]);case"TSEnumDeclaration":{Q.push(R.declare?"declare ":"",R.const?"const ":"","enum ",D.call(L,"id"));var bl=(0,s.fromString)(`,
|
|
111
|
+
`).join(D.map(L,"members"));return bl.isEmpty()?Q.push(" {}"):Q.push(` {
|
|
112
|
+
`,bl.indent(Z.tabWidth),`
|
|
113
|
+
}`),(0,s.concat)(Q)}case"TSExpressionWithTypeArguments":return(0,s.concat)([D.call(L,"expression"),D.call(L,"typeParameters")]);case"TSInterfaceBody":{var te=(0,s.fromString)(`
|
|
114
|
+
`).join(D.map(L,"body").map(function(it){return q(it)!==";"?it.concat(";"):it}));return te.isEmpty()?(0,s.fromString)("{}",Z):(0,s.concat)([`{
|
|
115
|
+
`,te.indent(Z.tabWidth),`
|
|
116
|
+
}`])}case"TSImportType":return Q.push("import(",D.call(L,"argument"),")"),R.qualifier&&Q.push(".",D.call(L,"qualifier")),R.typeParameters&&Q.push(D.call(L,"typeParameters")),(0,s.concat)(Q);case"TSImportEqualsDeclaration":return R.isExport&&Q.push("export "),Q.push("import ",D.call(L,"id")," = ",D.call(L,"moduleReference")),fe((0,s.concat)(Q));case"TSExternalModuleReference":return(0,s.concat)(["require(",D.call(L,"expression"),")"]);case"TSModuleDeclaration":{var ki=D.getParentNode();if(ki.type==="TSModuleDeclaration")Q.push(".");else if(R.declare&&Q.push("declare "),!R.global){var On=R.id.type==="StringLiteral"||R.id.type==="Literal"&&typeof R.id.value=="string";if(On)Q.push("module ");else if(R.loc&&R.loc.lines&&R.id.loc){var Zi=R.loc.lines.sliceString(R.loc.start,R.id.loc.start);Zi.indexOf("module")>=0?Q.push("module "):Q.push("namespace ")}else Q.push("namespace ")}return Q.push(D.call(L,"id")),R.body&&(Q.push(" "),Q.push(D.call(L,"body"))),(0,s.concat)(Q)}case"TSModuleBlock":{var xn=D.call(function(qe){return w(qe,Z,L)},"body");return xn.isEmpty()?Q.push("{}"):Q.push(`{
|
|
117
|
+
`,xn.indent(Z.tabWidth),`
|
|
118
|
+
}`),(0,s.concat)(Q)}case"TSInstantiationExpression":return Q.push(D.call(L,"expression"),D.call(L,"typeParameters")),(0,s.concat)(Q);case"V8IntrinsicIdentifier":return(0,s.concat)(["%",D.call(L,"name")]);case"TopicReference":return(0,s.fromString)("#");default:debugger;throw new Error("unknown type: "+JSON.stringify(R.type))}}function S(D,Z){var L=[],se=D.getValue();return se.decorators&&se.decorators.length>0&&!u.getParentExportDeclaration(D)?D.each(function(de){L.push(Z(de),`
|
|
119
|
+
`)},"decorators"):u.isExportDeclaration(se)&&se.declaration&&se.declaration.decorators&&D.each(function(de){L.push(Z(de),`
|
|
120
|
+
`)},"declaration","decorators"),(0,s.concat)(L)}function w(D,Z,L){var se=[],de=!1,ie=!1;D.each(function(Re){var ke=Re.getValue();ke&&(ke.type==="EmptyStatement"&&!(ke.comments&&ke.comments.length>0)||(h.Comment.check(ke)?de=!0:h.Statement.check(ke)?ie=!0:c.assert(ke),se.push({node:ke,printed:L(Re)})))}),de&&(0,e.default)(ie===!1,"Comments may appear as statements in otherwise empty statement lists, but may not coexist with non-Comment nodes.");var R=null,Q=se.length,xe=[];return se.forEach(function(Re,ke){var $e=Re.printed,te=Re.node,H=$e.length>1,re=ke>0,G=ke<Q-1,J,le,ve=te&&te.loc&&te.loc.lines,we=ve&&Z.reuseWhitespace&&u.getTrueLoc(te,ve);if(re)if(we){var K=ve.skipSpaces(we.start,!0),ue=K?K.line:1,me=we.start.line-ue;J=Array(me+1).join(`
|
|
121
|
+
`)}else J=H?`
|
|
122
|
+
|
|
123
|
+
`:`
|
|
124
|
+
`;else J="";if(G)if(we){var Pe=ve.skipSpaces(we.end),Ve=Pe?Pe.line:ve.length,He=Ve-we.end.line;le=Array(He+1).join(`
|
|
125
|
+
`)}else le=H?`
|
|
126
|
+
|
|
127
|
+
`:`
|
|
128
|
+
`;else le="";xe.push(C(R,J),$e),G?R=le:le&&xe.push(le)}),(0,s.concat)(xe)}function C(D,Z){if(!D&&!Z)return(0,s.fromString)("");if(!D)return(0,s.fromString)(Z);if(!Z)return(0,s.fromString)(D);var L=(0,s.fromString)(D),se=(0,s.fromString)(Z);return se.length>L.length?se:L}function E(D){var Z=[];D.declare&&Z.push("declare ");var L=D.accessibility||D.access;return typeof L=="string"&&Z.push(L," "),D.static&&Z.push("static "),D.override&&Z.push("override "),D.abstract&&Z.push("abstract "),D.readonly&&Z.push("readonly "),Z}function k(D,Z,L){var se=D.getNode(),de=se.kind,ie=[],R=se.value;h.FunctionExpression.check(R)||(R=se),ie.push.apply(ie,E(se)),R.async&&ie.push("async "),R.generator&&ie.push("*"),(de==="get"||de==="set")&&ie.push(de," ");var Q=D.call(L,"key");return se.computed&&(Q=(0,s.concat)(["[",Q,"]"])),ie.push(Q),se.optional&&ie.push("?"),se===R?(ie.push(D.call(L,"typeParameters"),"(",$(D,Z,L),")",D.call(L,"returnType")),se.body?ie.push(" ",D.call(L,"body")):ie.push(";")):(ie.push(D.call(L,"value","typeParameters"),"(",D.call(function(xe){return $(xe,Z,L)},"value"),")",D.call(L,"value","returnType")),R.body?ie.push(" ",D.call(L,"value","body")):ie.push(";")),(0,s.concat)(ie)}function A(D,Z,L){var se=D.map(L,"arguments"),de=u.isTrailingCommaEnabled(Z,"parameters"),ie=(0,s.fromString)(", ").join(se);return ie.getLineLength(1)>Z.wrapColumn?(ie=(0,s.fromString)(`,
|
|
129
|
+
`).join(se),(0,s.concat)([`(
|
|
130
|
+
`,ie.indent(Z.tabWidth),de?`,
|
|
131
|
+
)`:`
|
|
132
|
+
)`])):(0,s.concat)(["(",ie,")"])}function $(D,Z,L){var se=D.getValue(),de,ie=[];se.params?(de=se.params,ie=D.map(L,"params")):se.parameters&&(de=se.parameters,ie=D.map(L,"parameters")),se.defaults&&D.each(function(Q){var xe=Q.getName(),Re=ie[xe];Re&&Q.getValue()&&(ie[xe]=(0,s.concat)([Re," = ",L(Q)]))},"defaults"),se.rest&&ie.push((0,s.concat)(["...",D.call(L,"rest")]));var R=(0,s.fromString)(", ").join(ie);return R.length>1||R.getLineLength(1)>Z.wrapColumn?(R=(0,s.fromString)(`,
|
|
133
|
+
`).join(ie),u.isTrailingCommaEnabled(Z,"parameters")&&!se.rest&&de[de.length-1].type!=="RestElement"?R=(0,s.concat)([R,`,
|
|
134
|
+
`]):R=(0,s.concat)([R,`
|
|
135
|
+
`]),(0,s.concat)([`
|
|
136
|
+
`,R.indent(Z.tabWidth)])):R}function F(D,Z,L){var se=D.getValue();if(se.assertions&&se.assertions.length>0){var de=[" assert {"],ie=D.map(L,"assertions"),R=(0,s.fromString)(", ").join(ie);return R.length>1||R.getLineLength(1)>Z.wrapColumn?de.push(`
|
|
137
|
+
`,(0,s.fromString)(`,
|
|
138
|
+
`).join(ie).indent(Z.tabWidth),`
|
|
139
|
+
}`):de.push(" ",R," }"),(0,s.concat)(de)}return(0,s.fromString)("")}function I(D,Z,L){var se=D.getValue(),de=["export "];se.exportKind&&se.exportKind==="type"&&(se.declaration||de.push("type "));var ie=Z.objectCurlySpacing;if(h.Declaration.assert(se),(se.default||se.type==="ExportDefaultDeclaration")&&de.push("default "),se.declaration)de.push(D.call(L,"declaration"));else if(se.specifiers){if(se.specifiers.length===1&&se.specifiers[0].type==="ExportBatchSpecifier")de.push("*");else if(se.specifiers.length===0)de.push("{}");else if(se.specifiers[0].type==="ExportDefaultSpecifier"||se.specifiers[0].type==="ExportNamespaceSpecifier"){var R=[],Q=[];if(D.each(function(ke){var $e=ke.getValue();$e.type==="ExportDefaultSpecifier"||$e.type==="ExportNamespaceSpecifier"?R.push(L(ke)):Q.push(L(ke))},"specifiers"),R.forEach(function(ke,$e){$e>0&&de.push(", "),de.push(ke)}),Q.length>0){var xe=(0,s.fromString)(", ").join(Q);xe.getLineLength(1)>Z.wrapColumn&&(xe=(0,s.concat)([(0,s.fromString)(`,
|
|
140
|
+
`).join(Q).indent(Z.tabWidth),","])),R.length>0&&de.push(", "),xe.length>1?de.push(`{
|
|
141
|
+
`,xe,`
|
|
142
|
+
}`):Z.objectCurlySpacing?de.push("{ ",xe," }"):de.push("{",xe,"}")}}else de.push(ie?"{ ":"{",(0,s.fromString)(", ").join(D.map(L,"specifiers")),ie?" }":"}");se.source&&de.push(" from ",D.call(L,"source"),F(D,Z,L))}var Re=(0,s.concat)(de);return q(Re)!==";"&&!(se.declaration&&(se.declaration.type==="FunctionDeclaration"||se.declaration.type==="ClassDeclaration"||se.declaration.type==="TSModuleDeclaration"||se.declaration.type==="TSInterfaceDeclaration"||se.declaration.type==="TSEnumDeclaration"))&&(Re=(0,s.concat)([Re,";"])),Re}function B(D,Z){var L=u.getParentExportDeclaration(D);return L?(0,e.default)(L.type==="DeclareExportDeclaration"):Z.unshift("declare "),(0,s.concat)(Z)}function j(D,Z){return D.call(function(L){var se=L.getValue();return se?se==="plus"?(0,s.fromString)("+"):se==="minus"?(0,s.fromString)("-"):Z(L):(0,s.fromString)("")},"variance")}function M(D,Z){return D.length>1?(0,s.concat)([" ",D]):(0,s.concat)([`
|
|
143
|
+
`,fe(D).indent(Z.tabWidth)])}function q(D){var Z=D.lastPos();do{var L=D.charAt(Z);if(/\S/.test(L))return L}while(D.prevPos(Z))}function X(D){return q(D)==="}"}function Y(D){return D.replace(/['"]/g,function(Z){return Z==='"'?"'":'"'})}function V(D){var Z=i.getFieldValue(D,"value"),L=i.getFieldValue(D,"extra");if(L&&typeof L.raw=="string"&&Z==L.rawValue)return L.raw;if(D.type==="Literal"){var se=D.raw;if(typeof se=="string"&&Z==se)return se}}function oe(D){return JSON.stringify(D).replace(/[\u2028\u2029]/g,function(Z){return"\\u"+Z.charCodeAt(0).toString(16)})}function ae(D,Z){switch(c.assert(D),Z.quote){case"auto":{var L=oe(D),se=Y(oe(Y(D)));return L.length>se.length?se:L}case"single":return Y(oe(Y(D)));default:return oe(D)}}function fe(D){var Z=q(D);return!Z||`
|
|
144
|
+
};`.indexOf(Z)<0?(0,s.concat)([D,";"]):D}return fa}var p0;function B$(){return p0||(p0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.run=t.prettyPrint=t.print=t.visit=t.types=t.parse=void 0;var e=et,i=e.__importDefault(Bb),n=e.__importStar(ir());t.types=n;var r=M$();Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return r.parse}});var s=L$(),a=ir();Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return a.visit}});function l(g,b){return new s.Printer(b).print(g)}t.print=l;function u(g,b){return new s.Printer(b).printGenerically(g)}t.prettyPrint=u;function h(g,b){return c(process.argv[2],g,b)}t.run=h;function c(g,b,m){i.default.readFile(g,"utf-8",function(x,O){if(x){console.error(x);return}v(O,b,m)})}function p(g){process.stdout.write(g)}function v(g,b,m){var x=m&&m.writeback||p;b((0,r.parse)(g,m),function(O){x(l(O,m).code)})}})(Eh)),Eh}var Do=B$(),ns={},m0;function Q$(){if(m0)return ns;m0=1,Object.defineProperty(ns,"__esModule",{value:!0});function t(_,f){if(_==null)return{};var o={};for(var d in _)if({}.hasOwnProperty.call(_,d)){if(f.indexOf(d)!==-1)continue;o[d]=_[d]}return o}class e{constructor(f,o,d){this.line=void 0,this.column=void 0,this.index=void 0,this.line=f,this.column=o,this.index=d}}class i{constructor(f,o){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=f,this.end=o}}function n(_,f){const{line:o,column:d,index:y}=_;return new e(o,d+f,y+f)}const r="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var s={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:r},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:r}};const a={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},l=_=>_.type==="UpdateExpression"?a.UpdateExpression[`${_.prefix}`]:a[_.type];var u={AccessorIsGenerator:({kind:_})=>`A ${_}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:_})=>`Missing initializer in ${_} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:_})=>`\`${_}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:_,exportName:f})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
145
|
+
- Did you mean \`export { '${_}' as '${f}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:_})=>`'${_==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:_})=>`Unsyntactic ${_==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:_})=>`A string literal cannot be used as an imported binding.
|
|
146
|
+
- Did you mean \`import { "${_}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:_})=>`Expected number in radix ${_}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:_})=>`Escape sequence in keyword ${_}.`,InvalidIdentifier:({identifierName:_})=>`Invalid identifier ${_}.`,InvalidLhs:({ancestor:_})=>`Invalid left-hand side in ${l(_)}.`,InvalidLhsBinding:({ancestor:_})=>`Binding invalid left-hand side in ${l(_)}.`,InvalidLhsOptionalChaining:({ancestor:_})=>`Invalid optional chaining in the left-hand side of ${l(_)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:_})=>`Unexpected character '${_}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:_})=>`Private name #${_} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:_})=>`Label '${_}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:_})=>`This experimental syntax requires enabling the parser plugin: ${_.map(f=>JSON.stringify(f)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:_})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${_.map(f=>JSON.stringify(f)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:_})=>`Duplicate key "${_}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:_})=>`An export name cannot include a lone surrogate, found '\\u${_.toString(16)}'.`,ModuleExportUndefined:({localName:_})=>`Export '${_}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:_})=>`Private names are only allowed in property accesses (\`obj.#${_}\`) or in \`in\` expressions (\`#${_} in obj\`).`,PrivateNameRedeclaration:({identifierName:_})=>`Duplicate private name #${_}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:_})=>`Unexpected keyword '${_}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:_})=>`Unexpected reserved word '${_}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:_,unexpected:f})=>`Unexpected token${f?` '${f}'.`:""}${_?`, expected "${_}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:_,onlyValidPropertyName:f})=>`The only valid meta property for ${_} is ${_}.${f}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:_})=>`Identifier '${_}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},h={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:_})=>`Assigning to '${_}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:_})=>`Binding '${_}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},c={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:_})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(_)}\`.`};const p=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var v=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:_})=>`Invalid topic token ${_}. In order to use ${_} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${_}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:_})=>`Hack-style pipe body cannot be an unparenthesized ${l({type:_})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'});const g=["message"];function b(_,f,o){Object.defineProperty(_,f,{enumerable:!1,configurable:!0,value:o})}function m({toMessage:_,code:f,reasonCode:o,syntaxPlugin:d}){const y=o==="MissingPlugin"||o==="MissingOneOfPlugins",T={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};return T[o]&&(o=T[o]),function N(z,U){const W=new SyntaxError;return W.code=f,W.reasonCode=o,W.loc=z,W.pos=z.index,W.syntaxPlugin=d,y&&(W.missingPlugin=U.missingPlugin),b(W,"clone",function(pe={}){var Ee;const{line:Ae,column:Be,index:st}=(Ee=pe.loc)!=null?Ee:z;return N(new e(Ae,Be,st),Object.assign({},U,pe.details))}),b(W,"details",U),Object.defineProperty(W,"message",{configurable:!0,get(){const ee=`${_(U)} (${z.line}:${z.column})`;return this.message=ee,ee},set(ee){Object.defineProperty(this,"message",{value:ee,writable:!0})}}),W}}function x(_,f){if(Array.isArray(_))return d=>x(d,_[0]);const o={};for(const d of Object.keys(_)){const y=_[d],T=typeof y=="string"?{message:()=>y}:typeof y=="function"?{message:y}:y,{message:N}=T,z=t(T,g),U=typeof N=="string"?()=>N:N;o[d]=m(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:d,toMessage:U},f?{syntaxPlugin:f}:{},z))}return o}const O=Object.assign({},x(s),x(u),x(h),x(c),x`pipelineOperator`(v));function P(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function S(_){const f=P();if(_==null)return f;if(_.annexB!=null&&_.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(const o of Object.keys(f))_[o]!=null&&(f[o]=_[o]);if(f.startLine===1)_.startIndex==null&&f.startColumn>0?f.startIndex=f.startColumn:_.startColumn==null&&f.startIndex>0&&(f.startColumn=f.startIndex);else if((_.startColumn==null||_.startIndex==null)&&_.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(f.sourceType==="commonjs"){if(_.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(_.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(_.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return f}const{defineProperty:w}=Object,C=(_,f)=>{_&&w(_,f,{enumerable:!1,value:_[f]})};function E(_){return C(_.loc.start,"index"),C(_.loc.end,"index"),_}var k=_=>class extends _{parse(){const o=E(super.parse());return this.optionFlags&256&&(o.tokens=o.tokens.map(E)),o}parseRegExpLiteral({pattern:o,flags:d}){let y=null;try{y=new RegExp(o,d)}catch{}const T=this.estreeParseLiteral(y);return T.regex={pattern:o,flags:d},T}parseBigIntLiteral(o){let d;try{d=BigInt(o)}catch{d=null}const y=this.estreeParseLiteral(d);return y.bigint=String(y.value||o),y}parseDecimalLiteral(o){const y=this.estreeParseLiteral(null);return y.decimal=String(y.value||o),y}estreeParseLiteral(o){return this.parseLiteral(o,"Literal")}parseStringLiteral(o){return this.estreeParseLiteral(o)}parseNumericLiteral(o){return this.estreeParseLiteral(o)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(o){return this.estreeParseLiteral(o)}estreeParseChainExpression(o,d){const y=this.startNodeAtNode(o);return y.expression=o,this.finishNodeAt(y,"ChainExpression",d)}directiveToStmt(o){const d=o.value;delete o.value,this.castNodeTo(d,"Literal"),d.raw=d.extra.raw,d.value=d.extra.expressionValue;const y=this.castNodeTo(o,"ExpressionStatement");return y.expression=d,y.directive=d.extra.rawValue,delete d.extra,y}fillOptionalPropertiesForTSESLint(o){}cloneEstreeStringLiteral(o){const{start:d,end:y,loc:T,range:N,raw:z,value:U}=o,W=Object.create(o.constructor.prototype);return W.type="Literal",W.start=d,W.end=y,W.loc=T,W.range=N,W.raw=z,W.value=U,W}initFunction(o,d){super.initFunction(o,d),o.expression=!1}checkDeclaration(o){o!=null&&this.isObjectProperty(o)?this.checkDeclaration(o.value):super.checkDeclaration(o)}getObjectOrClassMethodParams(o){return o.value.params}isValidDirective(o){var d;return o.type==="ExpressionStatement"&&o.expression.type==="Literal"&&typeof o.expression.value=="string"&&!((d=o.expression.extra)!=null&&d.parenthesized)}parseBlockBody(o,d,y,T,N){super.parseBlockBody(o,d,y,T,N);const z=o.directives.map(U=>this.directiveToStmt(U));o.body=z.concat(o.body),delete o.directives}parsePrivateName(){const o=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(o):o}convertPrivateNameToPrivateIdentifier(o){const d=super.getPrivateNameSV(o);return delete o.id,o.name=d,this.castNodeTo(o,"PrivateIdentifier")}isPrivateName(o){return this.getPluginOption("estree","classFeatures")?o.type==="PrivateIdentifier":super.isPrivateName(o)}getPrivateNameSV(o){return this.getPluginOption("estree","classFeatures")?o.name:super.getPrivateNameSV(o)}parseLiteral(o,d){const y=super.parseLiteral(o,d);return y.raw=y.extra.raw,delete y.extra,y}parseFunctionBody(o,d,y=!1){super.parseFunctionBody(o,d,y),o.expression=o.body.type!=="BlockStatement"}parseMethod(o,d,y,T,N,z,U=!1){let W=this.startNode();W.kind=o.kind,W=super.parseMethod(W,d,y,T,N,z,U),delete W.kind;const{typeParameters:ee}=o;ee&&(delete o.typeParameters,W.typeParameters=ee,this.resetStartLocationFromNode(W,ee));const pe=this.castNodeTo(W,"FunctionExpression");return o.value=pe,z==="ClassPrivateMethod"&&(o.computed=!1),z==="ObjectMethod"?(o.kind==="method"&&(o.kind="init"),o.shorthand=!1,this.finishNode(o,"Property")):this.finishNode(o,"MethodDefinition")}nameIsConstructor(o){return o.type==="Literal"?o.value==="constructor":super.nameIsConstructor(o)}parseClassProperty(...o){const d=super.parseClassProperty(...o);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(d,"PropertyDefinition"),d}parseClassPrivateProperty(...o){const d=super.parseClassPrivateProperty(...o);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(d,"PropertyDefinition"),d.computed=!1),d}parseClassAccessorProperty(o){const d=super.parseClassAccessorProperty(o);return this.getPluginOption("estree","classFeatures")&&(d.abstract&&this.hasPlugin("typescript")?(delete d.abstract,this.castNodeTo(d,"TSAbstractAccessorProperty")):this.castNodeTo(d,"AccessorProperty")),d}parseObjectProperty(o,d,y,T){const N=super.parseObjectProperty(o,d,y,T);return N&&(N.kind="init",this.castNodeTo(N,"Property")),N}finishObjectProperty(o){return o.kind="init",this.finishNode(o,"Property")}isValidLVal(o,d,y,T){return o==="Property"?"value":super.isValidLVal(o,d,y,T)}isAssignable(o,d){return o!=null&&this.isObjectProperty(o)?this.isAssignable(o.value,d):super.isAssignable(o,d)}toAssignable(o,d=!1){if(o!=null&&this.isObjectProperty(o)){const{key:y,value:T}=o;this.isPrivateName(y)&&this.classScope.usePrivateName(this.getPrivateNameSV(y),y.loc.start),this.toAssignable(T,d)}else super.toAssignable(o,d)}toAssignableObjectExpressionProp(o,d,y){o.type==="Property"&&(o.kind==="get"||o.kind==="set")?this.raise(O.PatternHasAccessor,o.key):o.type==="Property"&&o.method?this.raise(O.PatternHasMethod,o.key):super.toAssignableObjectExpressionProp(o,d,y)}finishCallExpression(o,d){const y=super.finishCallExpression(o,d);if(y.callee.type==="Import"){var T,N;this.castNodeTo(y,"ImportExpression"),y.source=y.arguments[0],y.options=(T=y.arguments[1])!=null?T:null,y.attributes=(N=y.arguments[1])!=null?N:null,delete y.arguments,delete y.callee}else y.type==="OptionalCallExpression"?this.castNodeTo(y,"CallExpression"):y.optional=!1;return y}toReferencedArguments(o){o.type!=="ImportExpression"&&super.toReferencedArguments(o)}parseExport(o,d){const y=this.state.lastTokStartLoc,T=super.parseExport(o,d);switch(T.type){case"ExportAllDeclaration":T.exported=null;break;case"ExportNamedDeclaration":T.specifiers.length===1&&T.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(T,"ExportAllDeclaration"),T.exported=T.specifiers[0].exported,delete T.specifiers);case"ExportDefaultDeclaration":{var N;const{declaration:z}=T;z?.type==="ClassDeclaration"&&((N=z.decorators)==null?void 0:N.length)>0&&z.start===T.start&&this.resetStartLocation(T,y)}break}return T}stopParseSubscript(o,d){const y=super.stopParseSubscript(o,d);return d.optionalChainMember?this.estreeParseChainExpression(y,o.loc.end):y}parseMember(o,d,y,T,N){const z=super.parseMember(o,d,y,T,N);return z.type==="OptionalMemberExpression"?this.castNodeTo(z,"MemberExpression"):z.optional=!1,z}isOptionalMemberExpression(o){return o.type==="ChainExpression"?o.expression.type==="MemberExpression":super.isOptionalMemberExpression(o)}hasPropertyAsPrivateName(o){return o.type==="ChainExpression"&&(o=o.expression),super.hasPropertyAsPrivateName(o)}isObjectProperty(o){return o.type==="Property"&&o.kind==="init"&&!o.method}isObjectMethod(o){return o.type==="Property"&&(o.method||o.kind==="get"||o.kind==="set")}castNodeTo(o,d){const y=super.castNodeTo(o,d);return this.fillOptionalPropertiesForTSESLint(y),y}cloneIdentifier(o){const d=super.cloneIdentifier(o);return this.fillOptionalPropertiesForTSESLint(d),d}cloneStringLiteral(o){return o.type==="Literal"?this.cloneEstreeStringLiteral(o):super.cloneStringLiteral(o)}finishNodeAt(o,d,y){return E(super.finishNodeAt(o,d,y))}finishNode(o,d){const y=super.finishNode(o,d);return this.fillOptionalPropertiesForTSESLint(y),y}resetStartLocation(o,d){super.resetStartLocation(o,d),E(o)}resetEndLocation(o,d=this.state.lastTokEndLoc){super.resetEndLocation(o,d),E(o)}};class A{constructor(f,o){this.token=void 0,this.preserveSpace=void 0,this.token=f,this.preserveSpace=!!o}}const $={brace:new A("{"),j_oTag:new A("<tag"),j_cTag:new A("</tag"),j_expr:new A("<tag>...</tag>",!0)};$.template=new A("`",!0);const F=!0,I=!0,B=!0,j=!0,M=!0,q=!0;class X{constructor(f,o={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=f,this.keyword=o.keyword,this.beforeExpr=!!o.beforeExpr,this.startsExpr=!!o.startsExpr,this.rightAssociative=!!o.rightAssociative,this.isLoop=!!o.isLoop,this.isAssign=!!o.isAssign,this.prefix=!!o.prefix,this.postfix=!!o.postfix,this.binop=o.binop!=null?o.binop:null,this.updateContext=null}}const Y=new Map;function V(_,f={}){f.keyword=_;const o=ie(_,f);return Y.set(_,o),o}function oe(_,f){return ie(_,{beforeExpr:F,binop:f})}let ae=-1;const fe=[],D=[],Z=[],L=[],se=[],de=[];function ie(_,f={}){var o,d,y,T;return++ae,D.push(_),Z.push((o=f.binop)!=null?o:-1),L.push((d=f.beforeExpr)!=null?d:!1),se.push((y=f.startsExpr)!=null?y:!1),de.push((T=f.prefix)!=null?T:!1),fe.push(new X(_,f)),ae}function R(_,f={}){var o,d,y,T;return++ae,Y.set(_,ae),D.push(_),Z.push((o=f.binop)!=null?o:-1),L.push((d=f.beforeExpr)!=null?d:!1),se.push((y=f.startsExpr)!=null?y:!1),de.push((T=f.prefix)!=null?T:!1),fe.push(new X("name",f)),ae}const Q={bracketL:ie("[",{beforeExpr:F,startsExpr:I}),bracketHashL:ie("#[",{beforeExpr:F,startsExpr:I}),bracketBarL:ie("[|",{beforeExpr:F,startsExpr:I}),bracketR:ie("]"),bracketBarR:ie("|]"),braceL:ie("{",{beforeExpr:F,startsExpr:I}),braceBarL:ie("{|",{beforeExpr:F,startsExpr:I}),braceHashL:ie("#{",{beforeExpr:F,startsExpr:I}),braceR:ie("}"),braceBarR:ie("|}"),parenL:ie("(",{beforeExpr:F,startsExpr:I}),parenR:ie(")"),comma:ie(",",{beforeExpr:F}),semi:ie(";",{beforeExpr:F}),colon:ie(":",{beforeExpr:F}),doubleColon:ie("::",{beforeExpr:F}),dot:ie("."),question:ie("?",{beforeExpr:F}),questionDot:ie("?."),arrow:ie("=>",{beforeExpr:F}),template:ie("template"),ellipsis:ie("...",{beforeExpr:F}),backQuote:ie("`",{startsExpr:I}),dollarBraceL:ie("${",{beforeExpr:F,startsExpr:I}),templateTail:ie("...`",{startsExpr:I}),templateNonTail:ie("...${",{beforeExpr:F,startsExpr:I}),at:ie("@"),hash:ie("#",{startsExpr:I}),interpreterDirective:ie("#!..."),eq:ie("=",{beforeExpr:F,isAssign:j}),assign:ie("_=",{beforeExpr:F,isAssign:j}),slashAssign:ie("_=",{beforeExpr:F,isAssign:j}),xorAssign:ie("_=",{beforeExpr:F,isAssign:j}),moduloAssign:ie("_=",{beforeExpr:F,isAssign:j}),incDec:ie("++/--",{prefix:M,postfix:q,startsExpr:I}),bang:ie("!",{beforeExpr:F,prefix:M,startsExpr:I}),tilde:ie("~",{beforeExpr:F,prefix:M,startsExpr:I}),doubleCaret:ie("^^",{startsExpr:I}),doubleAt:ie("@@",{startsExpr:I}),pipeline:oe("|>",0),nullishCoalescing:oe("??",1),logicalOR:oe("||",1),logicalAND:oe("&&",2),bitwiseOR:oe("|",3),bitwiseXOR:oe("^",4),bitwiseAND:oe("&",5),equality:oe("==/!=/===/!==",6),lt:oe("</>/<=/>=",7),gt:oe("</>/<=/>=",7),relational:oe("</>/<=/>=",7),bitShift:oe("<</>>/>>>",8),bitShiftL:oe("<</>>/>>>",8),bitShiftR:oe("<</>>/>>>",8),plusMin:ie("+/-",{beforeExpr:F,binop:9,prefix:M,startsExpr:I}),modulo:ie("%",{binop:10,startsExpr:I}),star:ie("*",{binop:10}),slash:oe("/",10),exponent:ie("**",{beforeExpr:F,binop:11,rightAssociative:!0}),_in:V("in",{beforeExpr:F,binop:7}),_instanceof:V("instanceof",{beforeExpr:F,binop:7}),_break:V("break"),_case:V("case",{beforeExpr:F}),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",{beforeExpr:F}),_else:V("else",{beforeExpr:F}),_finally:V("finally"),_function:V("function",{startsExpr:I}),_if:V("if"),_return:V("return",{beforeExpr:F}),_switch:V("switch"),_throw:V("throw",{beforeExpr:F,prefix:M,startsExpr:I}),_try:V("try"),_var:V("var"),_const:V("const"),_with:V("with"),_new:V("new",{beforeExpr:F,startsExpr:I}),_this:V("this",{startsExpr:I}),_super:V("super",{startsExpr:I}),_class:V("class",{startsExpr:I}),_extends:V("extends",{beforeExpr:F}),_export:V("export"),_import:V("import",{startsExpr:I}),_null:V("null",{startsExpr:I}),_true:V("true",{startsExpr:I}),_false:V("false",{startsExpr:I}),_typeof:V("typeof",{beforeExpr:F,prefix:M,startsExpr:I}),_void:V("void",{beforeExpr:F,prefix:M,startsExpr:I}),_delete:V("delete",{beforeExpr:F,prefix:M,startsExpr:I}),_do:V("do",{isLoop:B,beforeExpr:F}),_for:V("for",{isLoop:B}),_while:V("while",{isLoop:B}),_as:R("as",{startsExpr:I}),_assert:R("assert",{startsExpr:I}),_async:R("async",{startsExpr:I}),_await:R("await",{startsExpr:I}),_defer:R("defer",{startsExpr:I}),_from:R("from",{startsExpr:I}),_get:R("get",{startsExpr:I}),_let:R("let",{startsExpr:I}),_meta:R("meta",{startsExpr:I}),_of:R("of",{startsExpr:I}),_sent:R("sent",{startsExpr:I}),_set:R("set",{startsExpr:I}),_source:R("source",{startsExpr:I}),_static:R("static",{startsExpr:I}),_using:R("using",{startsExpr:I}),_yield:R("yield",{startsExpr:I}),_asserts:R("asserts",{startsExpr:I}),_checks:R("checks",{startsExpr:I}),_exports:R("exports",{startsExpr:I}),_global:R("global",{startsExpr:I}),_implements:R("implements",{startsExpr:I}),_intrinsic:R("intrinsic",{startsExpr:I}),_infer:R("infer",{startsExpr:I}),_is:R("is",{startsExpr:I}),_mixins:R("mixins",{startsExpr:I}),_proto:R("proto",{startsExpr:I}),_require:R("require",{startsExpr:I}),_satisfies:R("satisfies",{startsExpr:I}),_keyof:R("keyof",{startsExpr:I}),_readonly:R("readonly",{startsExpr:I}),_unique:R("unique",{startsExpr:I}),_abstract:R("abstract",{startsExpr:I}),_declare:R("declare",{startsExpr:I}),_enum:R("enum",{startsExpr:I}),_module:R("module",{startsExpr:I}),_namespace:R("namespace",{startsExpr:I}),_interface:R("interface",{startsExpr:I}),_type:R("type",{startsExpr:I}),_opaque:R("opaque",{startsExpr:I}),name:ie("name",{startsExpr:I}),placeholder:ie("%%",{startsExpr:I}),string:ie("string",{startsExpr:I}),num:ie("num",{startsExpr:I}),bigint:ie("bigint",{startsExpr:I}),decimal:ie("decimal",{startsExpr:I}),regexp:ie("regexp",{startsExpr:I}),privateName:ie("#name",{startsExpr:I}),eof:ie("eof"),jsxName:ie("jsxName"),jsxText:ie("jsxText",{beforeExpr:F}),jsxTagStart:ie("jsxTagStart",{startsExpr:I}),jsxTagEnd:ie("jsxTagEnd")};function xe(_){return _>=93&&_<=133}function Re(_){return _<=92}function ke(_){return _>=58&&_<=133}function $e(_){return _>=58&&_<=137}function te(_){return L[_]}function H(_){return se[_]}function re(_){return _>=29&&_<=33}function G(_){return _>=129&&_<=131}function J(_){return _>=90&&_<=92}function le(_){return _>=58&&_<=92}function ve(_){return _>=39&&_<=59}function we(_){return _===34}function K(_){return de[_]}function ue(_){return _>=121&&_<=123}function me(_){return _>=124&&_<=130}function Pe(_){return D[_]}function Ve(_){return Z[_]}function He(_){return _===57}function Tt(_){return _>=24&&_<=25}function Je(_){return fe[_]}fe[8].updateContext=_=>{_.pop()},fe[5].updateContext=fe[7].updateContext=fe[23].updateContext=_=>{_.push($.brace)},fe[22].updateContext=_=>{_[_.length-1]===$.template?_.pop():_.push($.template)},fe[143].updateContext=_=>{_.push($.j_expr,$.j_oTag)};let ei="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",qt="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const Bn=new RegExp("["+ei+"]"),gn=new RegExp("["+ei+qt+"]");ei=qt=null;const ji=[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,7,25,39,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,5,57,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,24,43,261,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,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,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,208,30,2,2,2,1,2,6,3,4,10,1,225,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,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Zs=[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,78,5,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,199,7,137,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,55,9,266,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,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function yn(_,f){let o=65536;for(let d=0,y=f.length;d<y;d+=2){if(o+=f[d],o>_)return!1;if(o+=f[d+1],o>=_)return!0}return!1}function zt(_){return _<65?_===36:_<=90?!0:_<97?_===95:_<=122?!0:_<=65535?_>=170&&Bn.test(String.fromCharCode(_)):yn(_,ji)}function ti(_){return _<48?_===36:_<58?!0:_<65?!1:_<=90?!0:_<97?_===95:_<=122?!0:_<=65535?_>=170&&gn.test(String.fromCharCode(_)):yn(_,ji)||yn(_,Zs)}const Qn={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Hr=new Set(Qn.keyword),Vs=new Set(Qn.strict),ce=new Set(Qn.strictBind);function ge(_,f){return f&&_==="await"||_==="enum"}function Ce(_,f){return ge(_,f)||Vs.has(_)}function Ue(_){return ce.has(_)}function $t(_,f){return Ce(_,f)||Ue(_)}function pr(_){return Hr.has(_)}function Jr(_,f,o){return _===64&&f===64&&zt(o)}const Us=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function ml(_){return Us.has(_)}class qs{constructor(f){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=f}}class Ws{constructor(f,o){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=f,this.inModule=o}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){const f=this.currentThisScopeFlags();return(f&64)>0&&(f&2)===0}get inStaticBlock(){for(let f=this.scopeStack.length-1;;f--){const{flags:o}=this.scopeStack[f];if(o&128)return!0;if(o&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(f){return new qs(f)}enter(f){this.scopeStack.push(this.createScope(f))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(f){return!!(f.flags&130||!this.parser.inModule&&f.flags&1)}declareName(f,o,d){let y=this.currentScope();if(o&8||o&16){this.checkRedeclarationInScope(y,f,o,d);let T=y.names.get(f)||0;o&16?T=T|4:(y.firstLexicalName||(y.firstLexicalName=f),T=T|2),y.names.set(f,T),o&8&&this.maybeExportDefined(y,f)}else if(o&4)for(let T=this.scopeStack.length-1;T>=0&&(y=this.scopeStack[T],this.checkRedeclarationInScope(y,f,o,d),y.names.set(f,(y.names.get(f)||0)|1),this.maybeExportDefined(y,f),!(y.flags&1667));--T);this.parser.inModule&&y.flags&1&&this.undefinedExports.delete(f)}maybeExportDefined(f,o){this.parser.inModule&&f.flags&1&&this.undefinedExports.delete(o)}checkRedeclarationInScope(f,o,d,y){this.isRedeclaredInScope(f,o,d)&&this.parser.raise(O.VarRedeclaration,y,{identifierName:o})}isRedeclaredInScope(f,o,d){if(!(d&1))return!1;if(d&8)return f.names.has(o);const y=f.names.get(o)||0;return d&16?(y&2)>0||!this.treatFunctionsAsVarInScope(f)&&(y&1)>0:(y&2)>0&&!(f.flags&8&&f.firstLexicalName===o)||!this.treatFunctionsAsVarInScope(f)&&(y&4)>0}checkLocalExport(f){const{name:o}=f;this.scopeStack[0].names.has(o)||this.undefinedExports.set(o,f.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let f=this.scopeStack.length-1;;f--){const{flags:o}=this.scopeStack[f];if(o&1667)return o}}currentThisScopeFlags(){for(let f=this.scopeStack.length-1;;f--){const{flags:o}=this.scopeStack[f];if(o&1731&&!(o&4))return o}}}class gl extends qs{constructor(...f){super(...f),this.declareFunctions=new Set}}class mr extends Ws{createScope(f){return new gl(f)}declareName(f,o,d){const y=this.currentScope();if(o&2048){this.checkRedeclarationInScope(y,f,o,d),this.maybeExportDefined(y,f),y.declareFunctions.add(f);return}super.declareName(f,o,d)}isRedeclaredInScope(f,o,d){if(super.isRedeclaredInScope(f,o,d))return!0;if(d&2048&&!f.declareFunctions.has(o)){const y=f.names.get(o);return(y&4)>0||(y&2)>0}return!1}checkLocalExport(f){this.scopeStack[0].declareFunctions.has(f.name)||super.checkLocalExport(f)}}const Kr=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),je=x`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:_})=>`Cannot overwrite reserved type ${_}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:_,enumName:f})=>`Boolean enum members need to be initialized. Use either \`${_} = true,\` or \`${_} = false,\` in enum \`${f}\`.`,EnumDuplicateMemberName:({memberName:_,enumName:f})=>`Enum member names need to be unique, but the name \`${_}\` has already been used before in enum \`${f}\`.`,EnumInconsistentMemberValues:({enumName:_})=>`Enum \`${_}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:_,enumName:f})=>`Enum type \`${_}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${f}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:_})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${_}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:_,memberName:f,explicitType:o})=>`Enum \`${_}\` has type \`${o}\`, so the initializer of \`${f}\` needs to be a ${o} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:_,memberName:f})=>`Symbol enum members cannot be initialized. Use \`${f},\` in enum \`${_}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:_,memberName:f})=>`The enum member initializer for \`${f}\` needs to be a literal (either a boolean, number, or string) in enum \`${_}\`.`,EnumInvalidMemberName:({enumName:_,memberName:f,suggestion:o})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${f}\`, consider using \`${o}\`, in enum \`${_}\`.`,EnumNumberMemberNotInitialized:({enumName:_,memberName:f})=>`Number enum members need to be initialized, e.g. \`${f} = 1\` in enum \`${_}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:_})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${_}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:_})=>`Unexpected reserved type ${_}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:_,suggestion:f})=>`\`declare export ${_}\` is not supported. Use \`${f}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function yl(_){return _.type==="DeclareExportAllDeclaration"||_.type==="DeclareExportDeclaration"&&(!_.declaration||_.declaration.type!=="TypeAlias"&&_.declaration.type!=="InterfaceDeclaration")}function Ys(_){return _.importKind==="type"||_.importKind==="typeof"}const vl={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function gr(_,f){const o=[],d=[];for(let y=0;y<_.length;y++)(f(_[y],y,_)?o:d).push(_[y]);return[o,d]}const ki=/\*?\s*@((?:no)?flow)\b/;var Ol=_=>class extends _{constructor(...o){super(...o),this.flowPragma=void 0}getScopeHandler(){return mr}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(o,d){o!==134&&o!==13&&o!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(o,d)}addComment(o){if(this.flowPragma===void 0){const d=ki.exec(o.value);if(d)if(d[1]==="flow")this.flowPragma="flow";else if(d[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(o)}flowParseTypeInitialiser(o){const d=this.state.inType;this.state.inType=!0,this.expect(o||14);const y=this.flowParseType();return this.state.inType=d,y}flowParsePredicate(){const o=this.startNode(),d=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>d.index+1&&this.raise(je.UnexpectedSpaceBetweenModuloChecks,d),this.eat(10)?(o.value=super.parseExpression(),this.expect(11),this.finishNode(o,"DeclaredPredicate")):this.finishNode(o,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){const o=this.state.inType;this.state.inType=!0,this.expect(14);let d=null,y=null;return this.match(54)?(this.state.inType=o,y=this.flowParsePredicate()):(d=this.flowParseType(),this.state.inType=o,this.match(54)&&(y=this.flowParsePredicate())),[d,y]}flowParseDeclareClass(o){return this.next(),this.flowParseInterfaceish(o,!0),this.finishNode(o,"DeclareClass")}flowParseDeclareFunction(o){this.next();const d=o.id=this.parseIdentifier(),y=this.startNode(),T=this.startNode();this.match(47)?y.typeParameters=this.flowParseTypeParameterDeclaration():y.typeParameters=null,this.expect(10);const N=this.flowParseFunctionTypeParams();return y.params=N.params,y.rest=N.rest,y.this=N._this,this.expect(11),[y.returnType,o.predicate]=this.flowParseTypeAndPredicateInitialiser(),T.typeAnnotation=this.finishNode(y,"FunctionTypeAnnotation"),d.typeAnnotation=this.finishNode(T,"TypeAnnotation"),this.resetEndLocation(d),this.semicolon(),this.scope.declareName(o.id.name,2048,o.id.loc.start),this.finishNode(o,"DeclareFunction")}flowParseDeclare(o,d){if(this.match(80))return this.flowParseDeclareClass(o);if(this.match(68))return this.flowParseDeclareFunction(o);if(this.match(74))return this.flowParseDeclareVariable(o);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(o):(d&&this.raise(je.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(o));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(o);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(o);if(this.isContextual(129))return this.flowParseDeclareInterface(o);if(this.match(82))return this.flowParseDeclareExportDeclaration(o,d);throw this.unexpected()}flowParseDeclareVariable(o){return this.next(),o.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(o.id.name,5,o.id.loc.start),this.semicolon(),this.finishNode(o,"DeclareVariable")}flowParseDeclareModule(o){this.scope.enter(0),this.match(134)?o.id=super.parseExprAtom():o.id=this.parseIdentifier();const d=o.body=this.startNode(),y=d.body=[];for(this.expect(5);!this.match(8);){const z=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(je.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),y.push(super.parseImport(z))):(this.expectContextual(125,je.UnsupportedStatementInDeclareModule),y.push(this.flowParseDeclare(z,!0)))}this.scope.exit(),this.expect(8),this.finishNode(d,"BlockStatement");let T=null,N=!1;return y.forEach(z=>{yl(z)?(T==="CommonJS"&&this.raise(je.AmbiguousDeclareModuleKind,z),T="ES"):z.type==="DeclareModuleExports"&&(N&&this.raise(je.DuplicateDeclareModuleExports,z),T==="ES"&&this.raise(je.AmbiguousDeclareModuleKind,z),T="CommonJS",N=!0)}),o.kind=T||"CommonJS",this.finishNode(o,"DeclareModule")}flowParseDeclareExportDeclaration(o,d){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?o.declaration=this.flowParseDeclare(this.startNode()):(o.declaration=this.flowParseType(),this.semicolon()),o.default=!0,this.finishNode(o,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!d){const y=this.state.value;throw this.raise(je.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:y,suggestion:vl[y]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return o.declaration=this.flowParseDeclare(this.startNode()),o.default=!1,this.finishNode(o,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return o=this.parseExport(o,null),o.type==="ExportNamedDeclaration"?(o.default=!1,delete o.exportKind,this.castNodeTo(o,"DeclareExportDeclaration")):this.castNodeTo(o,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(o){return this.next(),this.expectContextual(111),o.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(o,"DeclareModuleExports")}flowParseDeclareTypeAlias(o){this.next();const d=this.flowParseTypeAlias(o);return this.castNodeTo(d,"DeclareTypeAlias"),d}flowParseDeclareOpaqueType(o){this.next();const d=this.flowParseOpaqueType(o,!0);return this.castNodeTo(d,"DeclareOpaqueType"),d}flowParseDeclareInterface(o){return this.next(),this.flowParseInterfaceish(o,!1),this.finishNode(o,"DeclareInterface")}flowParseInterfaceish(o,d){if(o.id=this.flowParseRestrictedIdentifier(!d,!0),this.scope.declareName(o.id.name,d?17:8201,o.id.loc.start),this.match(47)?o.typeParameters=this.flowParseTypeParameterDeclaration():o.typeParameters=null,o.extends=[],this.eat(81))do o.extends.push(this.flowParseInterfaceExtends());while(!d&&this.eat(12));if(d){if(o.implements=[],o.mixins=[],this.eatContextual(117))do o.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do o.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}o.body=this.flowParseObjectType({allowStatic:d,allowExact:!1,allowSpread:!1,allowProto:d,allowInexact:!1})}flowParseInterfaceExtends(){const o=this.startNode();return o.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?o.typeParameters=this.flowParseTypeParameterInstantiation():o.typeParameters=null,this.finishNode(o,"InterfaceExtends")}flowParseInterface(o){return this.flowParseInterfaceish(o,!1),this.finishNode(o,"InterfaceDeclaration")}checkNotUnderscore(o){o==="_"&&this.raise(je.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(o,d,y){Kr.has(o)&&this.raise(y?je.AssignReservedType:je.UnexpectedReservedType,d,{reservedType:o})}flowParseRestrictedIdentifier(o,d){return this.checkReservedType(this.state.value,this.state.startLoc,d),this.parseIdentifier(o)}flowParseTypeAlias(o){return o.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(o.id.name,8201,o.id.loc.start),this.match(47)?o.typeParameters=this.flowParseTypeParameterDeclaration():o.typeParameters=null,o.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(o,"TypeAlias")}flowParseOpaqueType(o,d){return this.expectContextual(130),o.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(o.id.name,8201,o.id.loc.start),this.match(47)?o.typeParameters=this.flowParseTypeParameterDeclaration():o.typeParameters=null,o.supertype=null,this.match(14)&&(o.supertype=this.flowParseTypeInitialiser(14)),o.impltype=null,d||(o.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(o,"OpaqueType")}flowParseTypeParameter(o=!1){const d=this.state.startLoc,y=this.startNode(),T=this.flowParseVariance(),N=this.flowParseTypeAnnotatableIdentifier();return y.name=N.name,y.variance=T,y.bound=N.typeAnnotation,this.match(29)?(this.eat(29),y.default=this.flowParseType()):o&&this.raise(je.MissingTypeParamDefault,d),this.finishNode(y,"TypeParameter")}flowParseTypeParameterDeclaration(){const o=this.state.inType,d=this.startNode();d.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let y=!1;do{const T=this.flowParseTypeParameter(y);d.params.push(T),T.default&&(y=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=o,this.finishNode(d,"TypeParameterDeclaration")}flowInTopLevelContext(o){if(this.curContext()!==$.brace){const d=this.state.context;this.state.context=[d[0]];try{return o()}finally{this.state.context=d}}else return o()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){const o=this.startNode(),d=this.state.inType;return this.state.inType=!0,o.params=[],this.flowInTopLevelContext(()=>{this.expect(47);const y=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)o.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=y}),this.state.inType=d,!this.state.inType&&this.curContext()===$.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(o,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;const o=this.startNode(),d=this.state.inType;for(o.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)o.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=d,this.finishNode(o,"TypeParameterInstantiation")}flowParseInterfaceType(){const o=this.startNode();if(this.expectContextual(129),o.extends=[],this.eat(81))do o.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return o.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(o,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(o,d,y){return o.static=d,this.lookahead().type===14?(o.id=this.flowParseObjectPropertyKey(),o.key=this.flowParseTypeInitialiser()):(o.id=null,o.key=this.flowParseType()),this.expect(3),o.value=this.flowParseTypeInitialiser(),o.variance=y,this.finishNode(o,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(o,d){return o.static=d,o.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(o.method=!0,o.optional=!1,o.value=this.flowParseObjectTypeMethodish(this.startNodeAt(o.loc.start))):(o.method=!1,this.eat(17)&&(o.optional=!0),o.value=this.flowParseTypeInitialiser()),this.finishNode(o,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(o){for(o.params=[],o.rest=null,o.typeParameters=null,o.this=null,this.match(47)&&(o.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(o.this=this.flowParseFunctionTypeParam(!0),o.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)o.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(o.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),o.returnType=this.flowParseTypeInitialiser(),this.finishNode(o,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(o,d){const y=this.startNode();return o.static=d,o.value=this.flowParseObjectTypeMethodish(y),this.finishNode(o,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:o,allowExact:d,allowSpread:y,allowProto:T,allowInexact:N}){const z=this.state.inType;this.state.inType=!0;const U=this.startNode();U.callProperties=[],U.properties=[],U.indexers=[],U.internalSlots=[];let W,ee,pe=!1;for(d&&this.match(6)?(this.expect(6),W=9,ee=!0):(this.expect(5),W=8,ee=!1),U.exact=ee;!this.match(W);){let Ae=!1,Be=null,st=null;const Ot=this.startNode();if(T&&this.isContextual(118)){const dt=this.lookahead();dt.type!==14&&dt.type!==17&&(this.next(),Be=this.state.startLoc,o=!1)}if(o&&this.isContextual(106)){const dt=this.lookahead();dt.type!==14&&dt.type!==17&&(this.next(),Ae=!0)}const Ye=this.flowParseVariance();if(this.eat(0))Be!=null&&this.unexpected(Be),this.eat(0)?(Ye&&this.unexpected(Ye.loc.start),U.internalSlots.push(this.flowParseObjectTypeInternalSlot(Ot,Ae))):U.indexers.push(this.flowParseObjectTypeIndexer(Ot,Ae,Ye));else if(this.match(10)||this.match(47))Be!=null&&this.unexpected(Be),Ye&&this.unexpected(Ye.loc.start),U.callProperties.push(this.flowParseObjectTypeCallProperty(Ot,Ae));else{let dt="init";if(this.isContextual(99)||this.isContextual(104)){const zn=this.lookahead();$e(zn.type)&&(dt=this.state.value,this.next())}const vr=this.flowParseObjectTypeProperty(Ot,Ae,Be,Ye,dt,y,N??!ee);vr===null?(pe=!0,st=this.state.lastTokStartLoc):U.properties.push(vr)}this.flowObjectTypeSemicolon(),st&&!this.match(8)&&!this.match(9)&&this.raise(je.UnexpectedExplicitInexactInObject,st)}this.expect(W),y&&(U.inexact=pe);const Ee=this.finishNode(U,"ObjectTypeAnnotation");return this.state.inType=z,Ee}flowParseObjectTypeProperty(o,d,y,T,N,z,U){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(z?U||this.raise(je.InexactInsideExact,this.state.lastTokStartLoc):this.raise(je.InexactInsideNonObject,this.state.lastTokStartLoc),T&&this.raise(je.InexactVariance,T),null):(z||this.raise(je.UnexpectedSpreadType,this.state.lastTokStartLoc),y!=null&&this.unexpected(y),T&&this.raise(je.SpreadVariance,T),o.argument=this.flowParseType(),this.finishNode(o,"ObjectTypeSpreadProperty"));{o.key=this.flowParseObjectPropertyKey(),o.static=d,o.proto=y!=null,o.kind=N;let W=!1;return this.match(47)||this.match(10)?(o.method=!0,y!=null&&this.unexpected(y),T&&this.unexpected(T.loc.start),o.value=this.flowParseObjectTypeMethodish(this.startNodeAt(o.loc.start)),(N==="get"||N==="set")&&this.flowCheckGetterSetterParams(o),!z&&o.key.name==="constructor"&&o.value.this&&this.raise(je.ThisParamBannedInConstructor,o.value.this)):(N!=="init"&&this.unexpected(),o.method=!1,this.eat(17)&&(W=!0),o.value=this.flowParseTypeInitialiser(),o.variance=T),o.optional=W,this.finishNode(o,"ObjectTypeProperty")}}flowCheckGetterSetterParams(o){const d=o.kind==="get"?0:1,y=o.value.params.length+(o.value.rest?1:0);o.value.this&&this.raise(o.kind==="get"?je.GetterMayNotHaveThisParam:je.SetterMayNotHaveThisParam,o.value.this),y!==d&&this.raise(o.kind==="get"?O.BadGetterArity:O.BadSetterArity,o),o.kind==="set"&&o.value.rest&&this.raise(O.BadSetterRestParameter,o)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(o,d){o??(o=this.state.startLoc);let y=d||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){const T=this.startNodeAt(o);T.qualification=y,T.id=this.flowParseRestrictedIdentifier(!0),y=this.finishNode(T,"QualifiedTypeIdentifier")}return y}flowParseGenericType(o,d){const y=this.startNodeAt(o);return y.typeParameters=null,y.id=this.flowParseQualifiedTypeIdentifier(o,d),this.match(47)&&(y.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(y,"GenericTypeAnnotation")}flowParseTypeofType(){const o=this.startNode();return this.expect(87),o.argument=this.flowParsePrimaryType(),this.finishNode(o,"TypeofTypeAnnotation")}flowParseTupleType(){const o=this.startNode();for(o.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(o.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(o,"TupleTypeAnnotation")}flowParseFunctionTypeParam(o){let d=null,y=!1,T=null;const N=this.startNode(),z=this.lookahead(),U=this.state.type===78;return z.type===14||z.type===17?(U&&!o&&this.raise(je.ThisParamMustBeFirst,N),d=this.parseIdentifier(U),this.eat(17)&&(y=!0,U&&this.raise(je.ThisParamMayNotBeOptional,N)),T=this.flowParseTypeInitialiser()):T=this.flowParseType(),N.name=d,N.optional=y,N.typeAnnotation=T,this.finishNode(N,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(o){const d=this.startNodeAt(o.loc.start);return d.name=null,d.optional=!1,d.typeAnnotation=o,this.finishNode(d,"FunctionTypeParam")}flowParseFunctionTypeParams(o=[]){let d=null,y=null;for(this.match(78)&&(y=this.flowParseFunctionTypeParam(!0),y.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)o.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(d=this.flowParseFunctionTypeParam(!1)),{params:o,rest:d,_this:y}}flowIdentToTypeAnnotation(o,d,y){switch(y.name){case"any":return this.finishNode(d,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(d,"BooleanTypeAnnotation");case"mixed":return this.finishNode(d,"MixedTypeAnnotation");case"empty":return this.finishNode(d,"EmptyTypeAnnotation");case"number":return this.finishNode(d,"NumberTypeAnnotation");case"string":return this.finishNode(d,"StringTypeAnnotation");case"symbol":return this.finishNode(d,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(y.name),this.flowParseGenericType(o,y)}}flowParsePrimaryType(){const o=this.state.startLoc,d=this.startNode();let y,T,N=!1;const z=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,T=this.flowParseTupleType(),this.state.noAnonFunctionType=z,T;case 47:{const U=this.startNode();return U.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),y=this.flowParseFunctionTypeParams(),U.params=y.params,U.rest=y.rest,U.this=y._this,this.expect(11),this.expect(19),U.returnType=this.flowParseType(),this.finishNode(U,"FunctionTypeAnnotation")}case 10:{const U=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(xe(this.state.type)||this.match(78)){const W=this.lookahead().type;N=W!==17&&W!==14}else N=!0;if(N){if(this.state.noAnonFunctionType=!1,T=this.flowParseType(),this.state.noAnonFunctionType=z,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),T;this.eat(12)}return T?y=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(T)]):y=this.flowParseFunctionTypeParams(),U.params=y.params,U.rest=y.rest,U.this=y._this,this.expect(11),this.expect(19),U.returnType=this.flowParseType(),U.typeParameters=null,this.finishNode(U,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return d.value=this.match(85),this.next(),this.finishNode(d,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",d);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",d);throw this.raise(je.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(d,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(d,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(d,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(d,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(le(this.state.type)){const U=Pe(this.state.type);return this.next(),super.createIdentifier(d,U)}else if(xe(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(o,d,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){const o=this.state.startLoc;let d=this.flowParsePrimaryType(),y=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){const T=this.startNodeAt(o),N=this.eat(18);y=y||N,this.expect(0),!N&&this.match(3)?(T.elementType=d,this.next(),d=this.finishNode(T,"ArrayTypeAnnotation")):(T.objectType=d,T.indexType=this.flowParseType(),this.expect(3),y?(T.optional=N,d=this.finishNode(T,"OptionalIndexedAccessType")):d=this.finishNode(T,"IndexedAccessType"))}return d}flowParsePrefixType(){const o=this.startNode();return this.eat(17)?(o.typeAnnotation=this.flowParsePrefixType(),this.finishNode(o,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){const o=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){const d=this.startNodeAt(o.loc.start);return d.params=[this.reinterpretTypeAsFunctionTypeParam(o)],d.rest=null,d.this=null,d.returnType=this.flowParseType(),d.typeParameters=null,this.finishNode(d,"FunctionTypeAnnotation")}return o}flowParseIntersectionType(){const o=this.startNode();this.eat(45);const d=this.flowParseAnonFunctionWithoutParens();for(o.types=[d];this.eat(45);)o.types.push(this.flowParseAnonFunctionWithoutParens());return o.types.length===1?d:this.finishNode(o,"IntersectionTypeAnnotation")}flowParseUnionType(){const o=this.startNode();this.eat(43);const d=this.flowParseIntersectionType();for(o.types=[d];this.eat(43);)o.types.push(this.flowParseIntersectionType());return o.types.length===1?d:this.finishNode(o,"UnionTypeAnnotation")}flowParseType(){const o=this.state.inType;this.state.inType=!0;const d=this.flowParseUnionType();return this.state.inType=o,d}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){const o=this.state.startLoc,d=this.parseIdentifier();return this.flowParseGenericType(o,d)}else return this.flowParseType()}flowParseTypeAnnotation(){const o=this.startNode();return o.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(o,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(o){const d=o?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(d.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(d)),d}typeCastToParameter(o){return o.expression.typeAnnotation=o.typeAnnotation,this.resetEndLocation(o.expression,o.typeAnnotation.loc.end),o.expression}flowParseVariance(){let o=null;return this.match(53)?(o=this.startNode(),this.state.value==="+"?o.kind="plus":o.kind="minus",this.next(),this.finishNode(o,"Variance")):o}parseFunctionBody(o,d,y=!1){if(d){this.forwardNoArrowParamsConversionAt(o,()=>super.parseFunctionBody(o,!0,y));return}super.parseFunctionBody(o,!1,y)}parseFunctionBodyAndFinish(o,d,y=!1){if(this.match(14)){const T=this.startNode();[T.typeAnnotation,o.predicate]=this.flowParseTypeAndPredicateInitialiser(),o.returnType=T.typeAnnotation?this.finishNode(T,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(o,d,y)}parseStatementLike(o){if(this.state.strict&&this.isContextual(129)){const y=this.lookahead();if(ke(y.type)){const T=this.startNode();return this.next(),this.flowParseInterface(T)}}else if(this.isContextual(126)){const y=this.startNode();return this.next(),this.flowParseEnumDeclaration(y)}const d=super.parseStatementLike(o);return this.flowPragma===void 0&&!this.isValidDirective(d)&&(this.flowPragma=null),d}parseExpressionStatement(o,d,y){if(d.type==="Identifier"){if(d.name==="declare"){if(this.match(80)||xe(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(o)}else if(xe(this.state.type)){if(d.name==="interface")return this.flowParseInterface(o);if(d.name==="type")return this.flowParseTypeAlias(o);if(d.name==="opaque")return this.flowParseOpaqueType(o,!1)}}return super.parseExpressionStatement(o,d,y)}shouldParseExportDeclaration(){const{type:o}=this.state;return o===126||G(o)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){const{type:o}=this.state;return o===126||G(o)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){const o=this.startNode();return this.next(),this.flowParseEnumDeclaration(o)}return super.parseExportDefaultExpression()}parseConditional(o,d,y){if(!this.match(17))return o;if(this.state.maybeInArrowParameters){const Ee=this.lookaheadCharCode();if(Ee===44||Ee===61||Ee===58||Ee===41)return this.setOptionalParametersError(y),o}this.expect(17);const T=this.state.clone(),N=this.state.noArrowAt,z=this.startNodeAt(d);let{consequent:U,failed:W}=this.tryParseConditionalConsequent(),[ee,pe]=this.getArrowLikeExpressions(U);if(W||pe.length>0){const Ee=[...N];if(pe.length>0){this.state=T,this.state.noArrowAt=Ee;for(let Ae=0;Ae<pe.length;Ae++)Ee.push(pe[Ae].start);({consequent:U,failed:W}=this.tryParseConditionalConsequent()),[ee,pe]=this.getArrowLikeExpressions(U)}W&&ee.length>1&&this.raise(je.AmbiguousConditionalArrow,T.startLoc),W&&ee.length===1&&(this.state=T,Ee.push(ee[0].start),this.state.noArrowAt=Ee,{consequent:U,failed:W}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(U,!0),this.state.noArrowAt=N,this.expect(14),z.test=o,z.consequent=U,z.alternate=this.forwardNoArrowParamsConversionAt(z,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(z,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);const o=this.parseMaybeAssignAllowIn(),d=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:o,failed:d}}getArrowLikeExpressions(o,d){const y=[o],T=[];for(;y.length!==0;){const N=y.pop();N.type==="ArrowFunctionExpression"&&N.body.type!=="BlockStatement"?(N.typeParameters||!N.returnType?this.finishArrowValidation(N):T.push(N),y.push(N.body)):N.type==="ConditionalExpression"&&(y.push(N.consequent),y.push(N.alternate))}return d?(T.forEach(N=>this.finishArrowValidation(N)),[T,[]]):gr(T,N=>N.params.every(z=>this.isAssignable(z,!0)))}finishArrowValidation(o){var d;this.toAssignableList(o.params,(d=o.extra)==null?void 0:d.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(o,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(o,d){let y;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(o.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),y=d(),this.state.noArrowParamsConversionAt.pop()):y=d(),y}parseParenItem(o,d){const y=super.parseParenItem(o,d);if(this.eat(17)&&(y.optional=!0,this.resetEndLocation(o)),this.match(14)){const T=this.startNodeAt(d);return T.expression=y,T.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(T,"TypeCastExpression")}return y}assertModuleNodeAllowed(o){o.type==="ImportDeclaration"&&(o.importKind==="type"||o.importKind==="typeof")||o.type==="ExportNamedDeclaration"&&o.exportKind==="type"||o.type==="ExportAllDeclaration"&&o.exportKind==="type"||super.assertModuleNodeAllowed(o)}parseExportDeclaration(o){if(this.isContextual(130)){o.exportKind="type";const d=this.startNode();return this.next(),this.match(5)?(o.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(o),null):this.flowParseTypeAlias(d)}else if(this.isContextual(131)){o.exportKind="type";const d=this.startNode();return this.next(),this.flowParseOpaqueType(d,!1)}else if(this.isContextual(129)){o.exportKind="type";const d=this.startNode();return this.next(),this.flowParseInterface(d)}else if(this.isContextual(126)){o.exportKind="value";const d=this.startNode();return this.next(),this.flowParseEnumDeclaration(d)}else return super.parseExportDeclaration(o)}eatExportStar(o){return super.eatExportStar(o)?!0:this.isContextual(130)&&this.lookahead().type===55?(o.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(o){const{startLoc:d}=this.state,y=super.maybeParseExportNamespaceSpecifier(o);return y&&o.exportKind==="type"&&this.unexpected(d),y}parseClassId(o,d,y){super.parseClassId(o,d,y),this.match(47)&&(o.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(o,d,y){const{startLoc:T}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(o,d))return;d.declare=!0}super.parseClassMember(o,d,y),d.declare&&(d.type!=="ClassProperty"&&d.type!=="ClassPrivateProperty"&&d.type!=="PropertyDefinition"?this.raise(je.DeclareClassElement,T):d.value&&this.raise(je.DeclareClassFieldInitializer,d.value))}isIterator(o){return o==="iterator"||o==="asyncIterator"}readIterator(){const o=super.readWord1(),d="@@"+o;(!this.isIterator(o)||!this.state.inType)&&this.raise(O.InvalidIdentifier,this.state.curPosition(),{identifierName:d}),this.finishToken(132,d)}getTokenFromCode(o){const d=this.input.charCodeAt(this.state.pos+1);o===123&&d===124?this.finishOp(6,2):this.state.inType&&(o===62||o===60)?this.finishOp(o===62?48:47,1):this.state.inType&&o===63?d===46?this.finishOp(18,2):this.finishOp(17,1):Jr(o,d,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(o)}isAssignable(o,d){return o.type==="TypeCastExpression"?this.isAssignable(o.expression,d):super.isAssignable(o,d)}toAssignable(o,d=!1){!d&&o.type==="AssignmentExpression"&&o.left.type==="TypeCastExpression"&&(o.left=this.typeCastToParameter(o.left)),super.toAssignable(o,d)}toAssignableList(o,d,y){for(let T=0;T<o.length;T++){const N=o[T];N?.type==="TypeCastExpression"&&(o[T]=this.typeCastToParameter(N))}super.toAssignableList(o,d,y)}toReferencedList(o,d){for(let T=0;T<o.length;T++){var y;const N=o[T];N&&N.type==="TypeCastExpression"&&!((y=N.extra)!=null&&y.parenthesized)&&(o.length>1||!d)&&this.raise(je.TypeCastInPattern,N.typeAnnotation)}return o}parseArrayLike(o,d,y){const T=super.parseArrayLike(o,d,y);return y!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(T.elements),T}isValidLVal(o,d,y,T){return o==="TypeCastExpression"||super.isValidLVal(o,d,y,T)}parseClassProperty(o){return this.match(14)&&(o.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(o)}parseClassPrivateProperty(o){return this.match(14)&&(o.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(o)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(o){return!this.match(14)&&super.isNonstaticConstructor(o)}pushClassMethod(o,d,y,T,N,z){if(d.variance&&this.unexpected(d.variance.loc.start),delete d.variance,this.match(47)&&(d.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(o,d,y,T,N,z),d.params&&N){const U=d.params;U.length>0&&this.isThisParam(U[0])&&this.raise(je.ThisParamBannedInConstructor,d)}else if(d.type==="MethodDefinition"&&N&&d.value.params){const U=d.value.params;U.length>0&&this.isThisParam(U[0])&&this.raise(je.ThisParamBannedInConstructor,d)}}pushClassPrivateMethod(o,d,y,T){d.variance&&this.unexpected(d.variance.loc.start),delete d.variance,this.match(47)&&(d.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(o,d,y,T)}parseClassSuper(o){if(super.parseClassSuper(o),o.superClass&&(this.match(47)||this.match(51))&&(o.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();const d=o.implements=[];do{const y=this.startNode();y.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?y.typeParameters=this.flowParseTypeParameterInstantiation():y.typeParameters=null,d.push(this.finishNode(y,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(o){super.checkGetterSetterParams(o);const d=this.getObjectOrClassMethodParams(o);if(d.length>0){const y=d[0];this.isThisParam(y)&&o.kind==="get"?this.raise(je.GetterMayNotHaveThisParam,y):this.isThisParam(y)&&this.raise(je.SetterMayNotHaveThisParam,y)}}parsePropertyNamePrefixOperator(o){o.variance=this.flowParseVariance()}parseObjPropValue(o,d,y,T,N,z,U){o.variance&&this.unexpected(o.variance.loc.start),delete o.variance;let W;this.match(47)&&!z&&(W=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());const ee=super.parseObjPropValue(o,d,y,T,N,z,U);return W&&((ee.value||ee).typeParameters=W),ee}parseFunctionParamType(o){return this.eat(17)&&(o.type!=="Identifier"&&this.raise(je.PatternIsOptional,o),this.isThisParam(o)&&this.raise(je.ThisParamMayNotBeOptional,o),o.optional=!0),this.match(14)?o.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(o)&&this.raise(je.ThisParamAnnotationRequired,o),this.match(29)&&this.isThisParam(o)&&this.raise(je.ThisParamNoDefault,o),this.resetEndLocation(o),o}parseMaybeDefault(o,d){const y=super.parseMaybeDefault(o,d);return y.type==="AssignmentPattern"&&y.typeAnnotation&&y.right.start<y.typeAnnotation.start&&this.raise(je.TypeBeforeInitializer,y.typeAnnotation),y}checkImportReflection(o){super.checkImportReflection(o),o.module&&o.importKind!=="value"&&this.raise(je.ImportReflectionHasImportType,o.specifiers[0].loc.start)}parseImportSpecifierLocal(o,d,y){d.local=Ys(o)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),o.specifiers.push(this.finishImportSpecifier(d,y))}isPotentialImportPhase(o){if(super.isPotentialImportPhase(o))return!0;if(this.isContextual(130)){if(!o)return!0;const d=this.lookaheadCharCode();return d===123||d===42}return!o&&this.isContextual(87)}applyImportPhase(o,d,y,T){if(super.applyImportPhase(o,d,y,T),d){if(!y&&this.match(65))return;o.exportKind=y==="type"?y:"value"}else y==="type"&&this.match(55)&&this.unexpected(),o.importKind=y==="type"||y==="typeof"?y:"value"}parseImportSpecifier(o,d,y,T,N){const z=o.imported;let U=null;z.type==="Identifier"&&(z.name==="type"?U="type":z.name==="typeof"&&(U="typeof"));let W=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){const pe=this.parseIdentifier(!0);U!==null&&!ke(this.state.type)?(o.imported=pe,o.importKind=U,o.local=this.cloneIdentifier(pe)):(o.imported=z,o.importKind=null,o.local=this.parseIdentifier())}else{if(U!==null&&ke(this.state.type))o.imported=this.parseIdentifier(!0),o.importKind=U;else{if(d)throw this.raise(O.ImportBindingIsString,o,{importName:z.value});o.imported=z,o.importKind=null}this.eatContextual(93)?o.local=this.parseIdentifier():(W=!0,o.local=this.cloneIdentifier(o.imported))}const ee=Ys(o);return y&&ee&&this.raise(je.ImportTypeShorthandOnlyInPureImport,o),(y||ee)&&this.checkReservedType(o.local.name,o.local.loc.start,!0),W&&!y&&!ee&&this.checkReservedWord(o.local.name,o.loc.start,!0,!0),this.finishImportSpecifier(o,"ImportSpecifier")}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(o,d){const y=o.kind;y!=="get"&&y!=="set"&&this.match(47)&&(o.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(o,d)}parseVarId(o,d){super.parseVarId(o,d),this.match(14)&&(o.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(o.id))}parseAsyncArrowFromCallExpression(o,d){if(this.match(14)){const y=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,o.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=y}return super.parseAsyncArrowFromCallExpression(o,d)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(o,d){var y;let T=null,N;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(T=this.state.clone(),N=this.tryParse(()=>super.parseMaybeAssign(o,d),T),!N.error)return N.node;const{context:W}=this.state,ee=W[W.length-1];(ee===$.j_oTag||ee===$.j_expr)&&W.pop()}if((y=N)!=null&&y.error||this.match(47)){var z,U;T=T||this.state.clone();let W;const ee=this.tryParse(Ee=>{var Ae;W=this.flowParseTypeParameterDeclaration();const Be=this.forwardNoArrowParamsConversionAt(W,()=>{const Ot=super.parseMaybeAssign(o,d);return this.resetStartLocationFromNode(Ot,W),Ot});(Ae=Be.extra)!=null&&Ae.parenthesized&&Ee();const st=this.maybeUnwrapTypeCastExpression(Be);return st.type!=="ArrowFunctionExpression"&&Ee(),st.typeParameters=W,this.resetStartLocationFromNode(st,W),Be},T);let pe=null;if(ee.node&&this.maybeUnwrapTypeCastExpression(ee.node).type==="ArrowFunctionExpression"){if(!ee.error&&!ee.aborted)return ee.node.async&&this.raise(je.UnexpectedTypeParameterBeforeAsyncArrowFunction,W),ee.node;pe=ee.node}if((z=N)!=null&&z.node)return this.state=N.failState,N.node;if(pe)return this.state=ee.failState,pe;throw(U=N)!=null&&U.thrown?N.error:ee.thrown?ee.error:this.raise(je.UnexpectedTokenAfterTypeParameter,W)}return super.parseMaybeAssign(o,d)}parseArrow(o){if(this.match(14)){const d=this.tryParse(()=>{const y=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;const T=this.startNode();return[T.typeAnnotation,o.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=y,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),T});if(d.thrown)return null;d.error&&(this.state=d.failState),o.returnType=d.node.typeAnnotation?this.finishNode(d.node,"TypeAnnotation"):null}return super.parseArrow(o)}shouldParseArrow(o){return this.match(14)||super.shouldParseArrow(o)}setArrowFunctionParameters(o,d){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(o.start))?o.params=d:super.setArrowFunctionParameters(o,d)}checkParams(o,d,y,T=!0){if(!(y&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(o.start)))){for(let N=0;N<o.params.length;N++)this.isThisParam(o.params[N])&&N>0&&this.raise(je.ThisParamMustBeFirst,o.params[N]);super.checkParams(o,d,y,T)}}parseParenAndDistinguishExpression(o){return super.parseParenAndDistinguishExpression(o&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(o,d,y){if(o.type==="Identifier"&&o.name==="async"&&this.state.noArrowAt.includes(d.index)){this.next();const T=this.startNodeAt(d);T.callee=o,T.arguments=super.parseCallExpressionArguments(),o=this.finishNode(T,"CallExpression")}else if(o.type==="Identifier"&&o.name==="async"&&this.match(47)){const T=this.state.clone(),N=this.tryParse(U=>this.parseAsyncArrowWithTypeParameters(d)||U(),T);if(!N.error&&!N.aborted)return N.node;const z=this.tryParse(()=>super.parseSubscripts(o,d,y),T);if(z.node&&!z.error)return z.node;if(N.node)return this.state=N.failState,N.node;if(z.node)return this.state=z.failState,z.node;throw N.error||z.error}return super.parseSubscripts(o,d,y)}parseSubscript(o,d,y,T){if(this.match(18)&&this.isLookaheadToken_lt()){if(T.optionalChainMember=!0,y)return T.stop=!0,o;this.next();const N=this.startNodeAt(d);return N.callee=o,N.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),N.arguments=this.parseCallExpressionArguments(),N.optional=!0,this.finishCallExpression(N,!0)}else if(!y&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){const N=this.startNodeAt(d);N.callee=o;const z=this.tryParse(()=>(N.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),N.arguments=super.parseCallExpressionArguments(),T.optionalChainMember&&(N.optional=!1),this.finishCallExpression(N,T.optionalChainMember)));if(z.node)return z.error&&(this.state=z.failState),z.node}return super.parseSubscript(o,d,y,T)}parseNewCallee(o){super.parseNewCallee(o);let d=null;this.shouldParseTypes()&&this.match(47)&&(d=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),o.typeArguments=d}parseAsyncArrowWithTypeParameters(o){const d=this.startNodeAt(o);if(this.parseFunctionParams(d,!1),!!this.parseArrow(d))return super.parseArrowExpression(d,void 0,!0)}readToken_mult_modulo(o){const d=this.input.charCodeAt(this.state.pos+1);if(o===42&&d===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(o)}readToken_pipe_amp(o){const d=this.input.charCodeAt(this.state.pos+1);if(o===124&&d===125){this.finishOp(9,2);return}super.readToken_pipe_amp(o)}parseTopLevel(o,d){const y=super.parseTopLevel(o,d);return this.state.hasFlowComment&&this.raise(je.UnterminatedFlowComment,this.state.curPosition()),y}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(je.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();const o=this.skipFlowComment();o&&(this.state.pos+=o,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){const{pos:o}=this.state;let d=2;for(;[32,9].includes(this.input.charCodeAt(o+d));)d++;const y=this.input.charCodeAt(d+o),T=this.input.charCodeAt(d+o+1);return y===58&&T===58?d+2:this.input.slice(d+o,d+o+12)==="flow-include"?d+12:y===58&&T!==58?d:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(O.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(o,{enumName:d,memberName:y}){this.raise(je.EnumBooleanMemberNotInitialized,o,{memberName:y,enumName:d})}flowEnumErrorInvalidMemberInitializer(o,d){return this.raise(d.explicitType?d.explicitType==="symbol"?je.EnumInvalidMemberInitializerSymbolType:je.EnumInvalidMemberInitializerPrimaryType:je.EnumInvalidMemberInitializerUnknownType,o,d)}flowEnumErrorNumberMemberNotInitialized(o,d){this.raise(je.EnumNumberMemberNotInitialized,o,d)}flowEnumErrorStringMemberInconsistentlyInitialized(o,d){this.raise(je.EnumStringMemberInconsistentlyInitialized,o,d)}flowEnumMemberInit(){const o=this.state.startLoc,d=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{const y=this.parseNumericLiteral(this.state.value);return d()?{type:"number",loc:y.loc.start,value:y}:{type:"invalid",loc:o}}case 134:{const y=this.parseStringLiteral(this.state.value);return d()?{type:"string",loc:y.loc.start,value:y}:{type:"invalid",loc:o}}case 85:case 86:{const y=this.parseBooleanLiteral(this.match(85));return d()?{type:"boolean",loc:y.loc.start,value:y}:{type:"invalid",loc:o}}default:return{type:"invalid",loc:o}}}flowEnumMemberRaw(){const o=this.state.startLoc,d=this.parseIdentifier(!0),y=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:o};return{id:d,init:y}}flowEnumCheckExplicitTypeMismatch(o,d,y){const{explicitType:T}=d;T!==null&&T!==y&&this.flowEnumErrorInvalidMemberInitializer(o,d)}flowEnumMembers({enumName:o,explicitType:d}){const y=new Set,T={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]};let N=!1;for(;!this.match(8);){if(this.eat(21)){N=!0;break}const z=this.startNode(),{id:U,init:W}=this.flowEnumMemberRaw(),ee=U.name;if(ee==="")continue;/^[a-z]/.test(ee)&&this.raise(je.EnumInvalidMemberName,U,{memberName:ee,suggestion:ee[0].toUpperCase()+ee.slice(1),enumName:o}),y.has(ee)&&this.raise(je.EnumDuplicateMemberName,U,{memberName:ee,enumName:o}),y.add(ee);const pe={enumName:o,explicitType:d,memberName:ee};switch(z.id=U,W.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(W.loc,pe,"boolean"),z.init=W.value,T.booleanMembers.push(this.finishNode(z,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(W.loc,pe,"number"),z.init=W.value,T.numberMembers.push(this.finishNode(z,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(W.loc,pe,"string"),z.init=W.value,T.stringMembers.push(this.finishNode(z,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(W.loc,pe);case"none":switch(d){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(W.loc,pe);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(W.loc,pe);break;default:T.defaultedMembers.push(this.finishNode(z,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:T,hasUnknownMembers:N}}flowEnumStringMembers(o,d,{enumName:y}){if(o.length===0)return d;if(d.length===0)return o;if(d.length>o.length){for(const T of o)this.flowEnumErrorStringMemberInconsistentlyInitialized(T,{enumName:y});return d}else{for(const T of d)this.flowEnumErrorStringMemberInconsistentlyInitialized(T,{enumName:y});return o}}flowEnumParseExplicitType({enumName:o}){if(!this.eatContextual(102))return null;if(!xe(this.state.type))throw this.raise(je.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:o});const{value:d}=this.state;return this.next(),d!=="boolean"&&d!=="number"&&d!=="string"&&d!=="symbol"&&this.raise(je.EnumInvalidExplicitType,this.state.startLoc,{enumName:o,invalidEnumType:d}),d}flowEnumBody(o,d){const y=d.name,T=d.loc.start,N=this.flowEnumParseExplicitType({enumName:y});this.expect(5);const{members:z,hasUnknownMembers:U}=this.flowEnumMembers({enumName:y,explicitType:N});switch(o.hasUnknownMembers=U,N){case"boolean":return o.explicitType=!0,o.members=z.booleanMembers,this.expect(8),this.finishNode(o,"EnumBooleanBody");case"number":return o.explicitType=!0,o.members=z.numberMembers,this.expect(8),this.finishNode(o,"EnumNumberBody");case"string":return o.explicitType=!0,o.members=this.flowEnumStringMembers(z.stringMembers,z.defaultedMembers,{enumName:y}),this.expect(8),this.finishNode(o,"EnumStringBody");case"symbol":return o.members=z.defaultedMembers,this.expect(8),this.finishNode(o,"EnumSymbolBody");default:{const W=()=>(o.members=[],this.expect(8),this.finishNode(o,"EnumStringBody"));o.explicitType=!1;const ee=z.booleanMembers.length,pe=z.numberMembers.length,Ee=z.stringMembers.length,Ae=z.defaultedMembers.length;if(!ee&&!pe&&!Ee&&!Ae)return W();if(!ee&&!pe)return o.members=this.flowEnumStringMembers(z.stringMembers,z.defaultedMembers,{enumName:y}),this.expect(8),this.finishNode(o,"EnumStringBody");if(!pe&&!Ee&&ee>=Ae){for(const Be of z.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(Be.loc.start,{enumName:y,memberName:Be.id.name});return o.members=z.booleanMembers,this.expect(8),this.finishNode(o,"EnumBooleanBody")}else if(!ee&&!Ee&&pe>=Ae){for(const Be of z.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(Be.loc.start,{enumName:y,memberName:Be.id.name});return o.members=z.numberMembers,this.expect(8),this.finishNode(o,"EnumNumberBody")}else return this.raise(je.EnumInconsistentMemberValues,T,{enumName:y}),W()}}}flowParseEnumDeclaration(o){const d=this.parseIdentifier();return o.id=d,o.body=this.flowEnumBody(this.startNode(),d),this.finishNode(o,"EnumDeclaration")}jsxParseOpeningElementAfterName(o){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(o.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(o)}isLookaheadToken_lt(){const o=this.nextTokenStart();if(this.input.charCodeAt(o)===60){const d=this.input.charCodeAt(o+1);return d!==60&&d!==61}return!1}reScan_lt_gt(){const{type:o}=this.state;o===47?(this.state.pos-=1,this.readToken_lt()):o===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){const{type:o}=this.state;return o===51?(this.state.pos-=2,this.finishOp(47,1),47):o}maybeUnwrapTypeCastExpression(o){return o.type==="TypeCastExpression"?o.expression:o}};const sh={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},xl=/\r\n|[\r\n\u2028\u2029]/,yr=new RegExp(xl.source,"g");function vn(_){switch(_){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Gs(_,f,o){for(let d=f;d<o;d++)if(vn(_.charCodeAt(d)))return!0;return!1}const Hs=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Js=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function bl(_){switch(_){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}const On=x`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:_})=>`Expected corresponding JSX closing tag for <${_}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:_,HTMLEntity:f})=>`Unexpected token \`${_}\`. Did you mean \`${f}\` or \`{'${_}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function Zi(_){return _?_.type==="JSXOpeningFragment"||_.type==="JSXClosingFragment":!1}function xn(_){if(_.type==="JSXIdentifier")return _.name;if(_.type==="JSXNamespacedName")return _.namespace.name+":"+_.name.name;if(_.type==="JSXMemberExpression")return xn(_.object)+"."+xn(_.property);throw new Error("Node had unexpected type: "+_.type)}var qe=_=>class extends _{jsxReadToken(){let o="",d=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(On.UnterminatedJsxContent,this.state.startLoc);const y=this.input.charCodeAt(this.state.pos);switch(y){case 60:case 123:if(this.state.pos===this.state.start){y===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(y);return}o+=this.input.slice(d,this.state.pos),this.finishToken(142,o);return;case 38:o+=this.input.slice(d,this.state.pos),o+=this.jsxReadEntity(),d=this.state.pos;break;default:vn(y)?(o+=this.input.slice(d,this.state.pos),o+=this.jsxReadNewLine(!0),d=this.state.pos):++this.state.pos}}}jsxReadNewLine(o){const d=this.input.charCodeAt(this.state.pos);let y;return++this.state.pos,d===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,y=o?`
|
|
147
|
+
`:`\r
|
|
148
|
+
`):y=String.fromCharCode(d),++this.state.curLine,this.state.lineStart=this.state.pos,y}jsxReadString(o){let d="",y=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(O.UnterminatedString,this.state.startLoc);const T=this.input.charCodeAt(this.state.pos);if(T===o)break;T===38?(d+=this.input.slice(y,this.state.pos),d+=this.jsxReadEntity(),y=this.state.pos):vn(T)?(d+=this.input.slice(y,this.state.pos),d+=this.jsxReadNewLine(!1),y=this.state.pos):++this.state.pos}d+=this.input.slice(y,this.state.pos++),this.finishToken(134,d)}jsxReadEntity(){const o=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let d=10;this.codePointAtPos(this.state.pos)===120&&(d=16,++this.state.pos);const y=this.readInt(d,void 0,!1,"bail");if(y!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(y)}else{let d=0,y=!1;for(;d++<10&&this.state.pos<this.length&&!(y=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(y){const T=this.input.slice(o,this.state.pos),N=sh[T];if(++this.state.pos,N)return N}}return this.state.pos=o,"&"}jsxReadWord(){let o;const d=this.state.pos;do o=this.input.charCodeAt(++this.state.pos);while(ti(o)||o===45);this.finishToken(141,this.input.slice(d,this.state.pos))}jsxParseIdentifier(){const o=this.startNode();return this.match(141)?o.name=this.state.value:le(this.state.type)?o.name=Pe(this.state.type):this.unexpected(),this.next(),this.finishNode(o,"JSXIdentifier")}jsxParseNamespacedName(){const o=this.state.startLoc,d=this.jsxParseIdentifier();if(!this.eat(14))return d;const y=this.startNodeAt(o);return y.namespace=d,y.name=this.jsxParseIdentifier(),this.finishNode(y,"JSXNamespacedName")}jsxParseElementName(){const o=this.state.startLoc;let d=this.jsxParseNamespacedName();if(d.type==="JSXNamespacedName")return d;for(;this.eat(16);){const y=this.startNodeAt(o);y.object=d,y.property=this.jsxParseIdentifier(),d=this.finishNode(y,"JSXMemberExpression")}return d}jsxParseAttributeValue(){let o;switch(this.state.type){case 5:return o=this.startNode(),this.setContext($.brace),this.next(),o=this.jsxParseExpressionContainer(o,$.j_oTag),o.expression.type==="JSXEmptyExpression"&&this.raise(On.AttributeIsEmpty,o),o;case 143:case 134:return this.parseExprAtom();default:throw this.raise(On.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){const o=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(o,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(o){return this.next(),o.expression=this.parseExpression(),this.setContext($.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(o,"JSXSpreadChild")}jsxParseExpressionContainer(o,d){if(this.match(8))o.expression=this.jsxParseEmptyExpression();else{const y=this.parseExpression();o.expression=y}return this.setContext(d),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(o,"JSXExpressionContainer")}jsxParseAttribute(){const o=this.startNode();return this.match(5)?(this.setContext($.brace),this.next(),this.expect(21),o.argument=this.parseMaybeAssignAllowIn(),this.setContext($.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(o,"JSXSpreadAttribute")):(o.name=this.jsxParseNamespacedName(),o.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(o,"JSXAttribute"))}jsxParseOpeningElementAt(o){const d=this.startNodeAt(o);return this.eat(144)?this.finishNode(d,"JSXOpeningFragment"):(d.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(d))}jsxParseOpeningElementAfterName(o){const d=[];for(;!this.match(56)&&!this.match(144);)d.push(this.jsxParseAttribute());return o.attributes=d,o.selfClosing=this.eat(56),this.expect(144),this.finishNode(o,"JSXOpeningElement")}jsxParseClosingElementAt(o){const d=this.startNodeAt(o);return this.eat(144)?this.finishNode(d,"JSXClosingFragment"):(d.name=this.jsxParseElementName(),this.expect(144),this.finishNode(d,"JSXClosingElement"))}jsxParseElementAt(o){const d=this.startNodeAt(o),y=[],T=this.jsxParseOpeningElementAt(o);let N=null;if(!T.selfClosing){e:for(;;)switch(this.state.type){case 143:if(o=this.state.startLoc,this.next(),this.eat(56)){N=this.jsxParseClosingElementAt(o);break e}y.push(this.jsxParseElementAt(o));break;case 142:y.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{const z=this.startNode();this.setContext($.brace),this.next(),this.match(21)?y.push(this.jsxParseSpreadChild(z)):y.push(this.jsxParseExpressionContainer(z,$.j_expr));break}default:this.unexpected()}Zi(T)&&!Zi(N)&&N!==null?this.raise(On.MissingClosingTagFragment,N):!Zi(T)&&Zi(N)?this.raise(On.MissingClosingTagElement,N,{openingTagName:xn(T.name)}):!Zi(T)&&!Zi(N)&&xn(N.name)!==xn(T.name)&&this.raise(On.MissingClosingTagElement,N,{openingTagName:xn(T.name)})}if(Zi(T)?(d.openingFragment=T,d.closingFragment=N):(d.openingElement=T,d.closingElement=N),d.children=y,this.match(47))throw this.raise(On.UnwrappedAdjacentJSXElements,this.state.startLoc);return Zi(T)?this.finishNode(d,"JSXFragment"):this.finishNode(d,"JSXElement")}jsxParseElement(){const o=this.state.startLoc;return this.next(),this.jsxParseElementAt(o)}setContext(o){const{context:d}=this.state;d[d.length-1]=o}parseExprAtom(o){return this.match(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(o)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(o){const d=this.curContext();if(d===$.j_expr){this.jsxReadToken();return}if(d===$.j_oTag||d===$.j_cTag){if(zt(o)){this.jsxReadWord();return}if(o===62){++this.state.pos,this.finishToken(144);return}if((o===34||o===39)&&d===$.j_oTag){this.jsxReadString(o);return}}if(o===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(o)}updateContext(o){const{context:d,type:y}=this.state;if(y===56&&o===143)d.splice(-2,2,$.j_cTag),this.state.canStartJSXElement=!1;else if(y===143)d.push($.j_oTag);else if(y===144){const T=d[d.length-1];T===$.j_oTag&&o===56||T===$.j_cTag?(d.pop(),this.state.canStartJSXElement=d[d.length-1]===$.j_expr):(this.setContext($.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=te(y)}};class it extends qs{constructor(...f){super(...f),this.tsNames=new Map}}class bi extends Ws{constructor(...f){super(...f),this.importsStack=[]}createScope(f){return this.importsStack.push(new Set),new it(f)}enter(f){f===1024&&this.importsStack.push(new Set),super.enter(f)}exit(){const f=super.exit();return f===1024&&this.importsStack.pop(),f}hasImport(f,o){const d=this.importsStack.length;if(this.importsStack[d-1].has(f))return!0;if(!o&&d>1){for(let y=0;y<d-1;y++)if(this.importsStack[y].has(f))return!0}return!1}declareName(f,o,d){if(o&4096){this.hasImport(f,!0)&&this.parser.raise(O.VarRedeclaration,d,{identifierName:f}),this.importsStack[this.importsStack.length-1].add(f);return}const y=this.currentScope();let T=y.tsNames.get(f)||0;if(o&1024){this.maybeExportDefined(y,f),y.tsNames.set(f,T|16);return}super.declareName(f,o,d),o&2&&(o&1||(this.checkRedeclarationInScope(y,f,o,d),this.maybeExportDefined(y,f)),T=T|1),o&256&&(T=T|2),o&512&&(T=T|4),o&128&&(T=T|8),T&&y.tsNames.set(f,T)}isRedeclaredInScope(f,o,d){const y=f.tsNames.get(o);if((y&2)>0){if(d&256){const T=!!(d&512),N=(y&4)>0;return T!==N}return!0}return d&128&&(y&8)>0?f.names.get(o)&2?!!(d&1):!1:d&2&&(y&1)>0?!0:super.isRedeclaredInScope(f,o,d)}checkLocalExport(f){const{name:o}=f;if(this.hasImport(o))return;const d=this.scopeStack.length;for(let y=d-1;y>=0;y--){const N=this.scopeStack[y].tsNames.get(o);if((N&1)>0||(N&16)>0)return}super.checkLocalExport(f)}}class Ei{constructor(){this.stacks=[]}enter(f){this.stacks.push(f)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}}function Fn(_,f){return(_?2:0)|(f?1:0)}class pP{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(f){return f+this.startIndex}offsetToSourcePos(f){return f-this.startIndex}hasPlugin(f){if(typeof f=="string")return this.plugins.has(f);{const[o,d]=f;if(!this.hasPlugin(o))return!1;const y=this.plugins.get(o);for(const T of Object.keys(d))if(y?.[T]!==d[T])return!1;return!0}}getPluginOption(f,o){var d;return(d=this.plugins.get(f))==null?void 0:d[o]}}function um(_,f){_.trailingComments===void 0?_.trailingComments=f:_.trailingComments.unshift(...f)}function mP(_,f){_.leadingComments===void 0?_.leadingComments=f:_.leadingComments.unshift(...f)}function Ks(_,f){_.innerComments===void 0?_.innerComments=f:_.innerComments.unshift(...f)}function Vi(_,f,o){let d=null,y=f.length;for(;d===null&&y>0;)d=f[--y];d===null||d.start>o.start?Ks(_,o.comments):um(d,o.comments)}class gP extends pP{addComment(f){this.filename&&(f.loc.filename=this.filename);const{commentsLen:o}=this.state;this.comments.length!==o&&(this.comments.length=o),this.comments.push(f),this.state.commentsLen++}processComment(f){const{commentStack:o}=this.state,d=o.length;if(d===0)return;let y=d-1;const T=o[y];T.start===f.end&&(T.leadingNode=f,y--);const{start:N}=f;for(;y>=0;y--){const z=o[y],U=z.end;if(U>N)z.containingNode=f,this.finalizeComment(z),o.splice(y,1);else{U===N&&(z.trailingNode=f);break}}}finalizeComment(f){var o;const{comments:d}=f;if(f.leadingNode!==null||f.trailingNode!==null)f.leadingNode!==null&&um(f.leadingNode,d),f.trailingNode!==null&&mP(f.trailingNode,d);else{const y=f.containingNode,T=f.start;if(this.input.charCodeAt(this.offsetToSourcePos(T)-1)===44)switch(y.type){case"ObjectExpression":case"ObjectPattern":Vi(y,y.properties,f);break;case"CallExpression":case"OptionalCallExpression":Vi(y,y.arguments,f);break;case"ImportExpression":Vi(y,[y.source,(o=y.options)!=null?o:null],f);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Vi(y,y.params,f);break;case"ArrayExpression":case"ArrayPattern":Vi(y,y.elements,f);break;case"ExportNamedDeclaration":case"ImportDeclaration":Vi(y,y.specifiers,f);break;case"TSEnumDeclaration":Vi(y,y.members,f);break;case"TSEnumBody":Vi(y,y.members,f);break;default:{if(y.type==="RecordExpression"){Vi(y,y.properties,f);break}if(y.type==="TupleExpression"){Vi(y,y.elements,f);break}Ks(y,d)}}else Ks(y,d)}}finalizeRemainingComments(){const{commentStack:f}=this.state;for(let o=f.length-1;o>=0;o--)this.finalizeComment(f[o]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(f){const{commentStack:o}=this.state,{length:d}=o;if(d===0)return;const y=o[d-1];y.leadingNode===f&&(y.leadingNode=null)}takeSurroundingComments(f,o,d){const{commentStack:y}=this.state,T=y.length;if(T===0)return;let N=T-1;for(;N>=0;N--){const z=y[N],U=z.end;if(z.start===d)z.leadingNode=f;else if(U===o)z.trailingNode=f;else if(U<o)break}}}class ah{constructor(){this.flags=1024,this.startIndex=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[$.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(f){f?this.flags|=1:this.flags&=-2}init({strictMode:f,sourceType:o,startIndex:d,startLine:y,startColumn:T}){this.strict=f===!1?!1:f===!0?!0:o==="module",this.startIndex=d,this.curLine=y,this.lineStart=-T,this.startLoc=this.endLoc=new e(y,T,d)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(f){f?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(f){f?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(f){f?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(f){f?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(f){f?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(f){f?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(f){f?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(f){f?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(f){f?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(f){f?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(f){f?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(f){f?this.flags|=4096:this.flags&=-4097}curPosition(){return new e(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){const f=new ah;return f.flags=this.flags,f.startIndex=this.startIndex,f.curLine=this.curLine,f.lineStart=this.lineStart,f.startLoc=this.startLoc,f.endLoc=this.endLoc,f.errors=this.errors.slice(),f.potentialArrowAt=this.potentialArrowAt,f.noArrowAt=this.noArrowAt.slice(),f.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),f.topicContext=this.topicContext,f.labels=this.labels.slice(),f.commentsLen=this.commentsLen,f.commentStack=this.commentStack.slice(),f.pos=this.pos,f.type=this.type,f.value=this.value,f.start=this.start,f.end=this.end,f.lastTokEndLoc=this.lastTokEndLoc,f.lastTokStartLoc=this.lastTokStartLoc,f.context=this.context.slice(),f.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,f.strictErrors=this.strictErrors,f.tokensLength=this.tokensLength,f}}var yP=function(f){return f>=48&&f<=57};const cm={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Sl={bin:_=>_===48||_===49,oct:_=>_>=48&&_<=55,dec:_=>_>=48&&_<=57,hex:_=>_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102};function hm(_,f,o,d,y,T){const N=o,z=d,U=y;let W="",ee=null,pe=o;const{length:Ee}=f;for(;;){if(o>=Ee){T.unterminated(N,z,U),W+=f.slice(pe,o);break}const Ae=f.charCodeAt(o);if(vP(_,Ae,f,o)){W+=f.slice(pe,o);break}if(Ae===92){W+=f.slice(pe,o);const Be=OP(f,o,d,y,_==="template",T);Be.ch===null&&!ee?ee={pos:o,lineStart:d,curLine:y}:W+=Be.ch,{pos:o,lineStart:d,curLine:y}=Be,pe=o}else Ae===8232||Ae===8233?(++o,++y,d=o):Ae===10||Ae===13?_==="template"?(W+=f.slice(pe,o)+`
|
|
149
|
+
`,++o,Ae===13&&f.charCodeAt(o)===10&&++o,++y,pe=d=o):T.unterminated(N,z,U):++o}return{pos:o,str:W,firstInvalidLoc:ee,lineStart:d,curLine:y,containsInvalid:!!ee}}function vP(_,f,o,d){return _==="template"?f===96||f===36&&o.charCodeAt(d+1)===123:f===(_==="double"?34:39)}function OP(_,f,o,d,y,T){const N=!y;f++;const z=W=>({pos:f,ch:W,lineStart:o,curLine:d}),U=_.charCodeAt(f++);switch(U){case 110:return z(`
|
|
150
|
+
`);case 114:return z("\r");case 120:{let W;return{code:W,pos:f}=oh(_,f,o,d,2,!1,N,T),z(W===null?null:String.fromCharCode(W))}case 117:{let W;return{code:W,pos:f}=dm(_,f,o,d,N,T),z(W===null?null:String.fromCodePoint(W))}case 116:return z(" ");case 98:return z("\b");case 118:return z("\v");case 102:return z("\f");case 13:_.charCodeAt(f)===10&&++f;case 10:o=f,++d;case 8232:case 8233:return z("");case 56:case 57:if(y)return z(null);T.strictNumericEscape(f-1,o,d);default:if(U>=48&&U<=55){const W=f-1;let pe=/^[0-7]+/.exec(_.slice(W,f+2))[0],Ee=parseInt(pe,8);Ee>255&&(pe=pe.slice(0,-1),Ee=parseInt(pe,8)),f+=pe.length-1;const Ae=_.charCodeAt(f);if(pe!=="0"||Ae===56||Ae===57){if(y)return z(null);T.strictNumericEscape(W,o,d)}return z(String.fromCharCode(Ee))}return z(String.fromCharCode(U))}}function oh(_,f,o,d,y,T,N,z){const U=f;let W;return{n:W,pos:f}=fm(_,f,o,d,16,y,T,!1,z,!N),W===null&&(N?z.invalidEscapeSequence(U,o,d):f=U-1),{code:W,pos:f}}function fm(_,f,o,d,y,T,N,z,U,W){const ee=f,pe=y===16?cm.hex:cm.decBinOct,Ee=y===16?Sl.hex:y===10?Sl.dec:y===8?Sl.oct:Sl.bin;let Ae=!1,Be=0;for(let st=0,Ot=T??1/0;st<Ot;++st){const Ye=_.charCodeAt(f);let dt;if(Ye===95&&z!=="bail"){const vr=_.charCodeAt(f-1),zn=_.charCodeAt(f+1);if(z){if(Number.isNaN(zn)||!Ee(zn)||pe.has(vr)||pe.has(zn)){if(W)return{n:null,pos:f};U.unexpectedNumericSeparator(f,o,d)}}else{if(W)return{n:null,pos:f};U.numericSeparatorInEscapeSequence(f,o,d)}++f;continue}if(Ye>=97?dt=Ye-97+10:Ye>=65?dt=Ye-65+10:yP(Ye)?dt=Ye-48:dt=1/0,dt>=y){if(dt<=9&&W)return{n:null,pos:f};if(dt<=9&&U.invalidDigit(f,o,d,y))dt=0;else if(N)dt=0,Ae=!0;else break}++f,Be=Be*y+dt}return f===ee||T!=null&&f-ee!==T||Ae?{n:null,pos:f}:{n:Be,pos:f}}function dm(_,f,o,d,y,T){const N=_.charCodeAt(f);let z;if(N===123){if(++f,{code:z,pos:f}=oh(_,f,o,d,_.indexOf("}",f)-f,!0,y,T),++f,z!==null&&z>1114111)if(y)T.invalidCodePoint(f,o,d);else return{code:null,pos:f}}else({code:z,pos:f}=oh(_,f,o,d,4,!1,y,T));return{code:z,pos:f}}function ea(_,f,o){return new e(o,_-f,_)}const xP=new Set([103,109,115,105,121,117,100,118]);class Rn{constructor(f){const o=f.startIndex||0;this.type=f.type,this.value=f.value,this.start=o+f.start,this.end=o+f.end,this.loc=new i(f.startLoc,f.endLoc)}}class bP extends gP{constructor(f,o){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(d,y,T,N)=>this.optionFlags&2048?(this.raise(O.InvalidDigit,ea(d,y,T),{radix:N}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(O.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(O.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(O.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(O.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(d,y,T)=>{this.recordStrictModeErrors(O.StrictNumericEscape,ea(d,y,T))},unterminated:(d,y,T)=>{throw this.raise(O.UnterminatedString,ea(d-1,y,T))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(O.StrictNumericEscape),unterminated:(d,y,T)=>{throw this.raise(O.UnterminatedTemplate,ea(d,y,T))}}),this.state=new ah,this.state.init(f),this.input=o,this.length=o.length,this.comments=[],this.isLookahead=!1}pushToken(f){this.tokens.length=this.state.tokensLength,this.tokens.push(f),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new Rn(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(f){return this.match(f)?(this.next(),!0):!1}match(f){return this.state.type===f}createLookaheadState(f){return{pos:f.pos,value:null,type:f.type,start:f.start,end:f.end,context:[this.curContext()],inType:f.inType,startLoc:f.startLoc,lastTokEndLoc:f.lastTokEndLoc,curLine:f.curLine,lineStart:f.lineStart,curPosition:f.curPosition}}lookahead(){const f=this.state;this.state=this.createLookaheadState(f),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;const o=this.state;return this.state=f,o}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(f){return Hs.lastIndex=f,Hs.test(this.input)?Hs.lastIndex:f}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(f){return this.input.charCodeAt(this.nextTokenStartSince(f))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(f){return Js.lastIndex=f,Js.test(this.input)?Js.lastIndex:f}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(f){let o=this.input.charCodeAt(f);if((o&64512)===55296&&++f<this.input.length){const d=this.input.charCodeAt(f);(d&64512)===56320&&(o=65536+((o&1023)<<10)+(d&1023))}return o}setStrict(f){this.state.strict=f,f&&(this.state.strictErrors.forEach(([o,d])=>this.raise(o,d)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(f){let o;this.isLookahead||(o=this.state.curPosition());const d=this.state.pos,y=this.input.indexOf(f,d+2);if(y===-1)throw this.raise(O.UnterminatedComment,this.state.curPosition());for(this.state.pos=y+f.length,yr.lastIndex=d+2;yr.test(this.input)&&yr.lastIndex<=y;)++this.state.curLine,this.state.lineStart=yr.lastIndex;if(this.isLookahead)return;const T={type:"CommentBlock",value:this.input.slice(d+2,y),start:this.sourceToOffsetPos(d),end:this.sourceToOffsetPos(y+f.length),loc:new i(o,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(T),T}skipLineComment(f){const o=this.state.pos;let d;this.isLookahead||(d=this.state.curPosition());let y=this.input.charCodeAt(this.state.pos+=f);if(this.state.pos<this.length)for(;!vn(y)&&++this.state.pos<this.length;)y=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;const T=this.state.pos,z={type:"CommentLine",value:this.input.slice(o+f,T),start:this.sourceToOffsetPos(o),end:this.sourceToOffsetPos(T),loc:new i(d,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(z),z}skipSpace(){const f=this.state.pos,o=this.optionFlags&4096?[]:null;e:for(;this.state.pos<this.length;){const d=this.input.charCodeAt(this.state.pos);switch(d){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{const y=this.skipBlockComment("*/");y!==void 0&&(this.addComment(y),o?.push(y));break}case 47:{const y=this.skipLineComment(2);y!==void 0&&(this.addComment(y),o?.push(y));break}default:break e}break;default:if(bl(d))++this.state.pos;else if(d===45&&!this.inModule&&this.optionFlags&8192){const y=this.state.pos;if(this.input.charCodeAt(y+1)===45&&this.input.charCodeAt(y+2)===62&&(f===0||this.state.lineStart>f)){const T=this.skipLineComment(3);T!==void 0&&(this.addComment(T),o?.push(T))}else break e}else if(d===60&&!this.inModule&&this.optionFlags&8192){const y=this.state.pos;if(this.input.charCodeAt(y+1)===33&&this.input.charCodeAt(y+2)===45&&this.input.charCodeAt(y+3)===45){const T=this.skipLineComment(4);T!==void 0&&(this.addComment(T),o?.push(T))}else break e}else break e}}if(o?.length>0){const d=this.state.pos,y={start:this.sourceToOffsetPos(f),end:this.sourceToOffsetPos(d),comments:o,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(y)}}finishToken(f,o){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();const d=this.state.type;this.state.type=f,this.state.value=o,this.isLookahead||this.updateContext(d)}replaceToken(f){this.state.type=f,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;const f=this.state.pos+1,o=this.codePointAtPos(f);if(o>=48&&o<=57)throw this.raise(O.UnexpectedDigitAfterHash,this.state.curPosition());if(o===123||o===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(o===123?O.RecordExpressionHashIncorrectStartSyntaxType:O.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,o===123?this.finishToken(7):this.finishToken(1)}else zt(o)?(++this.state.pos,this.finishToken(139,this.readWord1(o))):o===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){const f=this.input.charCodeAt(this.state.pos+1);if(f>=48&&f<=57){this.readNumber(!0);return}f===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let f=this.input.charCodeAt(this.state.pos+1);if(f!==33)return!1;const o=this.state.pos;for(this.state.pos+=1;!vn(f)&&++this.state.pos<this.length;)f=this.input.charCodeAt(this.state.pos);const d=this.input.slice(o+2,this.state.pos);return this.finishToken(28,d),!0}readToken_mult_modulo(f){let o=f===42?55:54,d=1,y=this.input.charCodeAt(this.state.pos+1);f===42&&y===42&&(d++,y=this.input.charCodeAt(this.state.pos+2),o=57),y===61&&!this.state.inType&&(d++,o=f===37?33:30),this.finishOp(o,d)}readToken_pipe_amp(f){const o=this.input.charCodeAt(this.state.pos+1);if(o===f){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(f===124?41:42,2);return}if(f===124){if(o===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&o===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(O.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&o===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(O.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(o===61){this.finishOp(30,2);return}this.finishOp(f===124?43:45,1)}readToken_caret(){const f=this.input.charCodeAt(this.state.pos+1);f===61&&!this.state.inType?this.finishOp(32,2):f===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(f){const o=this.input.charCodeAt(this.state.pos+1);if(o===f){this.finishOp(34,2);return}o===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){const{pos:f}=this.state,o=this.input.charCodeAt(f+1);if(o===60){if(this.input.charCodeAt(f+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(o===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){const{pos:f}=this.state,o=this.input.charCodeAt(f+1);if(o===62){const d=this.input.charCodeAt(f+2)===62?3:2;if(this.input.charCodeAt(f+d)===61){this.finishOp(30,d+1);return}this.finishOp(52,d);return}if(o===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(f){const o=this.input.charCodeAt(this.state.pos+1);if(o===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(f===61&&o===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(f===61?29:35,1)}readToken_question(){const f=this.input.charCodeAt(this.state.pos+1),o=this.input.charCodeAt(this.state.pos+2);f===63?o===61?this.finishOp(30,3):this.finishOp(40,2):f===46&&!(o>=48&&o<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(f){switch(f){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(O.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(O.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{const o=this.input.charCodeAt(this.state.pos+1);if(o===120||o===88){this.readRadixNumber(16);return}if(o===111||o===79){this.readRadixNumber(8);return}if(o===98||o===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(f);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(f);return;case 124:case 38:this.readToken_pipe_amp(f);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(f);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(f);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(zt(f)){this.readWord(f);return}}throw this.raise(O.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(f)})}finishOp(f,o){const d=this.input.slice(this.state.pos,this.state.pos+o);this.state.pos+=o,this.finishToken(f,d)}readRegexp(){const f=this.state.startLoc,o=this.state.start+1;let d,y,{pos:T}=this.state;for(;;++T){if(T>=this.length)throw this.raise(O.UnterminatedRegExp,n(f,1));const W=this.input.charCodeAt(T);if(vn(W))throw this.raise(O.UnterminatedRegExp,n(f,1));if(d)d=!1;else{if(W===91)y=!0;else if(W===93&&y)y=!1;else if(W===47&&!y)break;d=W===92}}const N=this.input.slice(o,T);++T;let z="";const U=()=>n(f,T+2-o);for(;T<this.length;){const W=this.codePointAtPos(T),ee=String.fromCharCode(W);if(xP.has(W))W===118?z.includes("u")&&this.raise(O.IncompatibleRegExpUVFlags,U()):W===117&&z.includes("v")&&this.raise(O.IncompatibleRegExpUVFlags,U()),z.includes(ee)&&this.raise(O.DuplicateRegExpFlags,U());else if(ti(W)||W===92)this.raise(O.MalformedRegExpFlags,U());else break;++T,z+=ee}this.state.pos=T,this.finishToken(138,{pattern:N,flags:z})}readInt(f,o,d=!1,y=!0){const{n:T,pos:N}=fm(this.input,this.state.pos,this.state.lineStart,this.state.curLine,f,o,d,y,this.errorHandlers_readInt,!1);return this.state.pos=N,T}readRadixNumber(f){const o=this.state.pos,d=this.state.curPosition();let y=!1;this.state.pos+=2;const T=this.readInt(f);T==null&&this.raise(O.InvalidDigit,n(d,2),{radix:f});const N=this.input.charCodeAt(this.state.pos);if(N===110)++this.state.pos,y=!0;else if(N===109)throw this.raise(O.InvalidDecimal,d);if(zt(this.codePointAtPos(this.state.pos)))throw this.raise(O.NumberIdentifier,this.state.curPosition());if(y){const z=this.input.slice(o,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,z);return}this.finishToken(135,T)}readNumber(f){const o=this.state.pos,d=this.state.curPosition();let y=!1,T=!1,N=!1,z=!1;!f&&this.readInt(10)===null&&this.raise(O.InvalidNumber,this.state.curPosition());const U=this.state.pos-o>=2&&this.input.charCodeAt(o)===48;if(U){const Ae=this.input.slice(o,this.state.pos);if(this.recordStrictModeErrors(O.StrictOctalLiteral,d),!this.state.strict){const Be=Ae.indexOf("_");Be>0&&this.raise(O.ZeroDigitNumericSeparator,n(d,Be))}z=U&&!/[89]/.test(Ae)}let W=this.input.charCodeAt(this.state.pos);if(W===46&&!z&&(++this.state.pos,this.readInt(10),y=!0,W=this.input.charCodeAt(this.state.pos)),(W===69||W===101)&&!z&&(W=this.input.charCodeAt(++this.state.pos),(W===43||W===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(O.InvalidOrMissingExponent,d),y=!0,N=!0,W=this.input.charCodeAt(this.state.pos)),W===110&&((y||U)&&this.raise(O.InvalidBigIntLiteral,d),++this.state.pos,T=!0),W===109){this.expectPlugin("decimal",this.state.curPosition()),(N||U)&&this.raise(O.InvalidDecimal,d),++this.state.pos;var ee=!0}if(zt(this.codePointAtPos(this.state.pos)))throw this.raise(O.NumberIdentifier,this.state.curPosition());const pe=this.input.slice(o,this.state.pos).replace(/[_mn]/g,"");if(T){this.finishToken(136,pe);return}if(ee){this.finishToken(137,pe);return}const Ee=z?parseInt(pe,8):parseFloat(pe);this.finishToken(135,Ee)}readCodePoint(f){const{code:o,pos:d}=dm(this.input,this.state.pos,this.state.lineStart,this.state.curLine,f,this.errorHandlers_readCodePoint);return this.state.pos=d,o}readString(f){const{str:o,pos:d,curLine:y,lineStart:T}=hm(f===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=d+1,this.state.lineStart=T,this.state.curLine=y,this.finishToken(134,o)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){const f=this.input[this.state.pos],{str:o,firstInvalidLoc:d,pos:y,curLine:T,lineStart:N}=hm("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=y+1,this.state.lineStart=N,this.state.curLine=T,d&&(this.state.firstInvalidTemplateEscapePos=new e(d.curLine,d.pos-d.lineStart,this.sourceToOffsetPos(d.pos))),this.input.codePointAt(y)===96?this.finishToken(24,d?null:f+o+"`"):(this.state.pos++,this.finishToken(25,d?null:f+o+"${"))}recordStrictModeErrors(f,o){const d=o.index;this.state.strict&&!this.state.strictErrors.has(d)?this.raise(f,o):this.state.strictErrors.set(d,[f,o])}readWord1(f){this.state.containsEsc=!1;let o="";const d=this.state.pos;let y=this.state.pos;for(f!==void 0&&(this.state.pos+=f<=65535?1:2);this.state.pos<this.length;){const T=this.codePointAtPos(this.state.pos);if(ti(T))this.state.pos+=T<=65535?1:2;else if(T===92){this.state.containsEsc=!0,o+=this.input.slice(y,this.state.pos);const N=this.state.curPosition(),z=this.state.pos===d?zt:ti;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(O.MissingUnicodeEscape,this.state.curPosition()),y=this.state.pos-1;continue}++this.state.pos;const U=this.readCodePoint(!0);U!==null&&(z(U)||this.raise(O.EscapedCharNotAnIdentifier,N),o+=String.fromCodePoint(U)),y=this.state.pos}else break}return o+this.input.slice(y,this.state.pos)}readWord(f){const o=this.readWord1(f),d=Y.get(o);d!==void 0?this.finishToken(d,Pe(d)):this.finishToken(132,o)}checkKeywordEscapes(){const{type:f}=this.state;le(f)&&this.state.containsEsc&&this.raise(O.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Pe(f)})}raise(f,o,d={}){const y=o instanceof e?o:o.loc.start,T=f(y,d);if(!(this.optionFlags&2048))throw T;return this.isLookahead||this.state.errors.push(T),T}raiseOverwrite(f,o,d={}){const y=o instanceof e?o:o.loc.start,T=y.index,N=this.state.errors;for(let z=N.length-1;z>=0;z--){const U=N[z];if(U.loc.index===T)return N[z]=f(y,d);if(U.loc.index<T)break}return this.raise(f,o,d)}updateContext(f){}unexpected(f,o){throw this.raise(O.UnexpectedToken,f??this.state.startLoc,{expected:o?Pe(o):null})}expectPlugin(f,o){if(this.hasPlugin(f))return!0;throw this.raise(O.MissingPlugin,o??this.state.startLoc,{missingPlugin:[f]})}expectOnePlugin(f){if(!f.some(o=>this.hasPlugin(o)))throw this.raise(O.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:f})}errorBuilder(f){return(o,d,y)=>{this.raise(f,ea(o,d,y))}}}class SP{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}}class wP{constructor(f){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=f}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new SP)}exit(){const f=this.stack.pop(),o=this.current();for(const[d,y]of Array.from(f.undefinedPrivateNames))o?o.undefinedPrivateNames.has(d)||o.undefinedPrivateNames.set(d,y):this.parser.raise(O.InvalidPrivateFieldResolution,y,{identifierName:d})}declarePrivateName(f,o,d){const{privateNames:y,loneAccessors:T,undefinedPrivateNames:N}=this.current();let z=y.has(f);if(o&3){const U=z&&T.get(f);if(U){const W=U&4,ee=o&4,pe=U&3,Ee=o&3;z=pe===Ee||W!==ee,z||T.delete(f)}else z||T.set(f,o)}z&&this.parser.raise(O.PrivateNameRedeclaration,d,{identifierName:f}),y.add(f),N.delete(f)}usePrivateName(f,o){let d;for(d of this.stack)if(d.privateNames.has(f))return;d?d.undefinedPrivateNames.set(f,o):this.parser.raise(O.InvalidPrivateFieldResolution,o,{identifierName:f})}}class wl{constructor(f=0){this.type=f}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}}class pm extends wl{constructor(f){super(f),this.declarationErrors=new Map}recordDeclarationError(f,o){const d=o.index;this.declarationErrors.set(d,[f,o])}clearDeclarationError(f){this.declarationErrors.delete(f)}iterateErrors(f){this.declarationErrors.forEach(f)}}class PP{constructor(f){this.parser=void 0,this.stack=[new wl],this.parser=f}enter(f){this.stack.push(f)}exit(){this.stack.pop()}recordParameterInitializerError(f,o){const d=o.loc.start,{stack:y}=this;let T=y.length-1,N=y[T];for(;!N.isCertainlyParameterDeclaration();){if(N.canBeArrowParameterDeclaration())N.recordDeclarationError(f,d);else return;N=y[--T]}this.parser.raise(f,d)}recordArrowParameterBindingError(f,o){const{stack:d}=this,y=d[d.length-1],T=o.loc.start;if(y.isCertainlyParameterDeclaration())this.parser.raise(f,T);else if(y.canBeArrowParameterDeclaration())y.recordDeclarationError(f,T);else return}recordAsyncArrowParametersError(f){const{stack:o}=this;let d=o.length-1,y=o[d];for(;y.canBeArrowParameterDeclaration();)y.type===2&&y.recordDeclarationError(O.AwaitBindingIdentifier,f),y=o[--d]}validateAsPattern(){const{stack:f}=this,o=f[f.length-1];o.canBeArrowParameterDeclaration()&&o.iterateErrors(([d,y])=>{this.parser.raise(d,y);let T=f.length-2,N=f[T];for(;N.canBeArrowParameterDeclaration();)N.clearDeclarationError(y.index),N=f[--T]})}}function TP(){return new wl(3)}function CP(){return new pm(1)}function kP(){return new pm(2)}function mm(){return new wl}class EP extends bP{addExtra(f,o,d,y=!0){if(!f)return;let{extra:T}=f;T==null&&(T={},f.extra=T),y?T[o]=d:Object.defineProperty(T,o,{enumerable:y,value:d})}isContextual(f){return this.state.type===f&&!this.state.containsEsc}isUnparsedContextual(f,o){if(this.input.startsWith(o,f)){const d=this.input.charCodeAt(f+o.length);return!(ti(d)||(d&64512)===55296)}return!1}isLookaheadContextual(f){const o=this.nextTokenStart();return this.isUnparsedContextual(o,f)}eatContextual(f){return this.isContextual(f)?(this.next(),!0):!1}expectContextual(f,o){if(!this.eatContextual(f)){if(o!=null)throw this.raise(o,this.state.startLoc);this.unexpected(null,f)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Gs(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Gs(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(f=!0){(f?this.isLineTerminator():this.eat(13))||this.raise(O.MissingSemicolon,this.state.lastTokEndLoc)}expect(f,o){this.eat(f)||this.unexpected(o,f)}tryParse(f,o=this.state.clone()){const d={node:null};try{const y=f((T=null)=>{throw d.node=T,d});if(this.state.errors.length>o.errors.length){const T=this.state;return this.state=o,this.state.tokensLength=T.tokensLength,{node:y,error:T.errors[o.errors.length],thrown:!1,aborted:!1,failState:T}}return{node:y,error:null,thrown:!1,aborted:!1,failState:null}}catch(y){const T=this.state;if(this.state=o,y instanceof SyntaxError)return{node:null,error:y,thrown:!0,aborted:!1,failState:T};if(y===d)return{node:d.node,error:null,thrown:!1,aborted:!0,failState:T};throw y}}checkExpressionErrors(f,o){if(!f)return!1;const{shorthandAssignLoc:d,doubleProtoLoc:y,privateKeyLoc:T,optionalParametersLoc:N,voidPatternLoc:z}=f,U=!!d||!!y||!!N||!!T||!!z;if(!o)return U;d!=null&&this.raise(O.InvalidCoverInitializedName,d),y!=null&&this.raise(O.DuplicateProto,y),T!=null&&this.raise(O.UnexpectedPrivateField,T),N!=null&&this.unexpected(N),z!=null&&this.raise(O.InvalidCoverDiscardElement,z)}isLiteralPropertyName(){return $e(this.state.type)}isPrivateName(f){return f.type==="PrivateName"}getPrivateNameSV(f){return f.id.name}hasPropertyAsPrivateName(f){return(f.type==="MemberExpression"||f.type==="OptionalMemberExpression")&&this.isPrivateName(f.property)}isObjectProperty(f){return f.type==="ObjectProperty"}isObjectMethod(f){return f.type==="ObjectMethod"}initializeScopes(f=this.options.sourceType==="module"){const o=this.state.labels;this.state.labels=[];const d=this.exportedIdentifiers;this.exportedIdentifiers=new Set;const y=this.inModule;this.inModule=f;const T=this.scope,N=this.getScopeHandler();this.scope=new N(this,f);const z=this.prodParam;this.prodParam=new Ei;const U=this.classScope;this.classScope=new wP(this);const W=this.expressionScope;return this.expressionScope=new PP(this),()=>{this.state.labels=o,this.exportedIdentifiers=d,this.inModule=y,this.scope=T,this.prodParam=z,this.classScope=U,this.expressionScope=W}}enterInitialScopes(){let f=0;(this.inModule||this.optionFlags&1)&&(f|=2),this.optionFlags&32&&(f|=1);const o=!this.inModule&&this.options.sourceType==="commonjs";(o||this.optionFlags&2)&&(f|=4),this.prodParam.enter(f);let d=o?514:1;this.optionFlags&4&&(d|=512),this.scope.enter(d)}checkDestructuringPrivate(f){const{privateKeyLoc:o}=f;o!==null&&this.expectPlugin("destructuringPrivate",o)}}class Pl{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null,this.voidPatternLoc=null}}class Tl{constructor(f,o,d){this.type="",this.start=o,this.end=0,this.loc=new i(d),f?.optionFlags&128&&(this.range=[o,0]),f!=null&&f.filename&&(this.loc.filename=f.filename)}}const lh=Tl.prototype;lh.__clone=function(){const _=new Tl(void 0,this.start,this.loc.start),f=Object.keys(this);for(let o=0,d=f.length;o<d;o++){const y=f[o];y!=="leadingComments"&&y!=="trailingComments"&&y!=="innerComments"&&(_[y]=this[y])}return _};class AP extends EP{startNode(){const f=this.state.startLoc;return new Tl(this,f.index,f)}startNodeAt(f){return new Tl(this,f.index,f)}startNodeAtNode(f){return this.startNodeAt(f.loc.start)}finishNode(f,o){return this.finishNodeAt(f,o,this.state.lastTokEndLoc)}finishNodeAt(f,o,d){return f.type=o,f.end=d.index,f.loc.end=d,this.optionFlags&128&&(f.range[1]=d.index),this.optionFlags&4096&&this.processComment(f),f}resetStartLocation(f,o){f.start=o.index,f.loc.start=o,this.optionFlags&128&&(f.range[0]=o.index)}resetEndLocation(f,o=this.state.lastTokEndLoc){f.end=o.index,f.loc.end=o,this.optionFlags&128&&(f.range[1]=o.index)}resetStartLocationFromNode(f,o){this.resetStartLocation(f,o.loc.start)}castNodeTo(f,o){return f.type=o,f}cloneIdentifier(f){const{type:o,start:d,end:y,loc:T,range:N,name:z}=f,U=Object.create(lh);return U.type=o,U.start=d,U.end=y,U.loc=T,U.range=N,U.name=z,f.extra&&(U.extra=f.extra),U}cloneStringLiteral(f){const{type:o,start:d,end:y,loc:T,range:N,extra:z}=f,U=Object.create(lh);return U.type=o,U.start=d,U.end=y,U.loc=T,U.range=N,U.extra=z,U.value=f.value,U}}const uh=_=>_.type==="ParenthesizedExpression"?uh(_.expression):_;class DP extends AP{toAssignable(f,o=!1){var d,y;let T;switch((f.type==="ParenthesizedExpression"||(d=f.extra)!=null&&d.parenthesized)&&(T=uh(f),o?T.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(O.InvalidParenthesizedAssignment,f):T.type!=="CallExpression"&&T.type!=="MemberExpression"&&!this.isOptionalMemberExpression(T)&&this.raise(O.InvalidParenthesizedAssignment,f):this.raise(O.InvalidParenthesizedAssignment,f)),f.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(f,"ObjectPattern");for(let z=0,U=f.properties.length,W=U-1;z<U;z++){var N;const ee=f.properties[z],pe=z===W;this.toAssignableObjectExpressionProp(ee,pe,o),pe&&ee.type==="RestElement"&&(N=f.extra)!=null&&N.trailingCommaLoc&&this.raise(O.RestTrailingComma,f.extra.trailingCommaLoc)}break;case"ObjectProperty":{const{key:z,value:U}=f;this.isPrivateName(z)&&this.classScope.usePrivateName(this.getPrivateNameSV(z),z.loc.start),this.toAssignable(U,o);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(f,"ArrayPattern"),this.toAssignableList(f.elements,(y=f.extra)==null?void 0:y.trailingCommaLoc,o);break;case"AssignmentExpression":f.operator!=="="&&this.raise(O.MissingEqInAssignment,f.left.loc.end),this.castNodeTo(f,"AssignmentPattern"),delete f.operator,f.left.type==="VoidPattern"&&this.raise(O.VoidPatternInitializer,f.left),this.toAssignable(f.left,o);break;case"ParenthesizedExpression":this.toAssignable(T,o);break}}toAssignableObjectExpressionProp(f,o,d){if(f.type==="ObjectMethod")this.raise(f.kind==="get"||f.kind==="set"?O.PatternHasAccessor:O.PatternHasMethod,f.key);else if(f.type==="SpreadElement"){this.castNodeTo(f,"RestElement");const y=f.argument;this.checkToRestConversion(y,!1),this.toAssignable(y,d),o||this.raise(O.RestTrailingComma,f)}else this.toAssignable(f,d)}toAssignableList(f,o,d){const y=f.length-1;for(let T=0;T<=y;T++){const N=f[T];N&&(this.toAssignableListItem(f,T,d),N.type==="RestElement"&&(T<y?this.raise(O.RestTrailingComma,N):o&&this.raise(O.RestTrailingComma,o)))}}toAssignableListItem(f,o,d){const y=f[o];if(y.type==="SpreadElement"){this.castNodeTo(y,"RestElement");const T=y.argument;this.checkToRestConversion(T,!0),this.toAssignable(T,d)}else this.toAssignable(y,d)}isAssignable(f,o){switch(f.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{const d=f.properties.length-1;return f.properties.every((y,T)=>y.type!=="ObjectMethod"&&(T===d||y.type!=="SpreadElement")&&this.isAssignable(y))}case"ObjectProperty":return this.isAssignable(f.value);case"SpreadElement":return this.isAssignable(f.argument);case"ArrayExpression":return f.elements.every(d=>d===null||this.isAssignable(d));case"AssignmentExpression":return f.operator==="=";case"ParenthesizedExpression":return this.isAssignable(f.expression);case"MemberExpression":case"OptionalMemberExpression":return!o;default:return!1}}toReferencedList(f,o){return f}toReferencedListDeep(f,o){this.toReferencedList(f,o);for(const d of f)d?.type==="ArrayExpression"&&this.toReferencedListDeep(d.elements)}parseSpread(f){const o=this.startNode();return this.next(),o.argument=this.parseMaybeAssignAllowIn(f,void 0),this.finishNode(o,"SpreadElement")}parseRestBinding(){const f=this.startNode();this.next();const o=this.parseBindingAtom();return o.type==="VoidPattern"&&this.raise(O.UnexpectedVoidPattern,o),f.argument=o,this.finishNode(f,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{const f=this.startNode();return this.next(),f.elements=this.parseBindingList(3,93,1),this.finishNode(f,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0);case 88:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(f,o,d){const y=d&1,T=[];let N=!0;for(;!this.eat(f);)if(N?N=!1:this.expect(12),y&&this.match(12))T.push(null);else{if(this.eat(f))break;if(this.match(21)){let z=this.parseRestBinding();if((this.hasPlugin("flow")||d&2)&&(z=this.parseFunctionParamType(z)),T.push(z),!this.checkCommaAfterRest(o)){this.expect(f);break}}else{const z=[];if(d&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(O.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)z.push(this.parseDecorator());T.push(this.parseBindingElement(d,z))}}return T}parseBindingRestProperty(f){return this.next(),this.hasPlugin("discardBinding")&&this.match(88)?(f.argument=this.parseVoidPattern(null),this.raise(O.UnexpectedVoidPattern,f.argument)):f.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(f,"RestElement")}parseBindingProperty(){const{type:f,startLoc:o}=this.state;if(f===21)return this.parseBindingRestProperty(this.startNode());const d=this.startNode();return f===139?(this.expectPlugin("destructuringPrivate",o),this.classScope.usePrivateName(this.state.value,o),d.key=this.parsePrivateName()):this.parsePropertyName(d),d.method=!1,this.parseObjPropValue(d,o,!1,!1,!0,!1)}parseBindingElement(f,o){const d=this.parseMaybeDefault();return(this.hasPlugin("flow")||f&2)&&this.parseFunctionParamType(d),o.length&&(d.decorators=o,this.resetStartLocationFromNode(d,o[0])),this.parseMaybeDefault(d.loc.start,d)}parseFunctionParamType(f){return f}parseMaybeDefault(f,o){if(f??(f=this.state.startLoc),o=o??this.parseBindingAtom(),!this.eat(29))return o;const d=this.startNodeAt(f);return o.type==="VoidPattern"&&this.raise(O.VoidPatternInitializer,o),d.left=o,d.right=this.parseMaybeAssignAllowIn(),this.finishNode(d,"AssignmentPattern")}isValidLVal(f,o,d,y){switch(f){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!o&&!this.state.strict&&this.optionFlags&8192)return!0}return!1}isOptionalMemberExpression(f){return f.type==="OptionalMemberExpression"}checkLVal(f,o,d=64,y=!1,T=!1,N=!1,z=!1){var U;const W=f.type;if(this.isObjectMethod(f))return;const ee=this.isOptionalMemberExpression(f);if(ee||W==="MemberExpression"){ee&&(this.expectPlugin("optionalChainingAssign",f.loc.start),o.type!=="AssignmentExpression"&&this.raise(O.InvalidLhsOptionalChaining,f,{ancestor:o})),d!==64&&this.raise(O.InvalidPropertyBindingPattern,f);return}if(W==="Identifier"){this.checkIdentifier(f,d,T);const{name:Ye}=f;y&&(y.has(Ye)?this.raise(O.ParamDupe,f):y.add(Ye));return}else W==="VoidPattern"&&o.type==="CatchClause"&&this.raise(O.VoidPatternCatchClauseParam,f);const pe=uh(f);z||(z=pe.type==="CallExpression"&&(pe.callee.type==="Import"||pe.callee.type==="Super"));const Ee=this.isValidLVal(W,z,!(N||(U=f.extra)!=null&&U.parenthesized)&&o.type==="AssignmentExpression",d);if(Ee===!0)return;if(Ee===!1){const Ye=d===64?O.InvalidLhs:O.InvalidLhsBinding;this.raise(Ye,f,{ancestor:o});return}let Ae,Be;typeof Ee=="string"?(Ae=Ee,Be=W==="ParenthesizedExpression"):[Ae,Be]=Ee;const st=W==="ArrayPattern"||W==="ObjectPattern"?{type:W}:o,Ot=f[Ae];if(Array.isArray(Ot))for(const Ye of Ot)Ye&&this.checkLVal(Ye,st,d,y,T,Be,!0);else Ot&&this.checkLVal(Ot,st,d,y,T,Be,z)}checkIdentifier(f,o,d=!1){this.state.strict&&(d?$t(f.name,this.inModule):Ue(f.name))&&(o===64?this.raise(O.StrictEvalArguments,f,{referenceName:f.name}):this.raise(O.StrictEvalArgumentsBinding,f,{bindingName:f.name})),o&8192&&f.name==="let"&&this.raise(O.LetInLexicalBinding,f),o&64||this.declareNameFromIdentifier(f,o)}declareNameFromIdentifier(f,o){this.scope.declareName(f.name,o,f.loc.start)}checkToRestConversion(f,o){switch(f.type){case"ParenthesizedExpression":this.checkToRestConversion(f.expression,o);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(o)break;default:this.raise(O.InvalidRestAssignmentPattern,f)}}checkCommaAfterRest(f){return this.match(12)?(this.raise(this.lookaheadCharCode()===f?O.RestTrailingComma:O.ElementAfterRest,this.state.startLoc),!0):!1}}const ch=/in(?:stanceof)?|as|satisfies/y;function _P(_){if(_==null)throw new Error(`Unexpected ${_} value.`);return _}function gm(_){if(!_)throw new Error("Assert fail")}const Le=x`typescript`({AbstractMethodHasImplementation:({methodName:_})=>`Method '${_}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:_})=>`Property '${_}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"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:_})=>`'declare' is not allowed in ${_}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:_})=>`Accessibility modifier already seen: '${_}'.`,DuplicateModifier:({modifier:_})=>`Duplicate modifier: '${_}'.`,EmptyHeritageClauseType:({token:_})=>`'${_}' 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'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:_})=>`'${_[0]}' modifier cannot be used with '${_[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:_})=>`Index signatures cannot have an accessibility modifier ('${_}').`,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.",InvalidHeritageClauseType:({token:_})=>`'${_}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:_=>`'${_}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:_})=>`'${_}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:_})=>`'${_}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:_})=>`'${_}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:_=>`'${_}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:_})=>`'${_[0]}' modifier must precede '${_[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.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'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:_})=>`Private elements cannot have an accessibility modifier ('${_}').`,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 `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:_})=>`Single type parameter ${_} should have a trailing comma. Example usage: <${_},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",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.",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:_})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${_}.`,UsingDeclarationInAmbientContext:_=>`'${_}' declarations are not allowed in ambient contexts.`});function IP(_){switch(_){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}}function ym(_){return _==="private"||_==="public"||_==="protected"}function NP(_){return _==="in"||_==="out"}var MP=_=>class extends _{constructor(...o){super(...o),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:Le.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:Le.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:Le.InvalidModifierOnTypeParameter})}getScopeHandler(){return bi}tsIsIdentifier(){return xe(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(o,d,y){if(!xe(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;const T=this.state.value;if(o.includes(T)){if(y&&this.match(106)||d&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return T}}tsParseModifiers({allowedModifiers:o,disallowedModifiers:d,stopOnStartOfClassStaticBlock:y,errorTemplate:T=Le.InvalidModifierOnTypeMember},N){const z=(W,ee,pe,Ee)=>{ee===pe&&N[Ee]&&this.raise(Le.InvalidModifiersOrder,W,{orderedModifiers:[pe,Ee]})},U=(W,ee,pe,Ee)=>{(N[pe]&&ee===Ee||N[Ee]&&ee===pe)&&this.raise(Le.IncompatibleModifiers,W,{modifiers:[pe,Ee]})};for(;;){const{startLoc:W}=this.state,ee=this.tsParseModifier(o.concat(d??[]),y,N.static);if(!ee)break;ym(ee)?N.accessibility?this.raise(Le.DuplicateAccessibilityModifier,W,{modifier:ee}):(z(W,ee,ee,"override"),z(W,ee,ee,"static"),z(W,ee,ee,"readonly"),N.accessibility=ee):NP(ee)?(N[ee]&&this.raise(Le.DuplicateModifier,W,{modifier:ee}),N[ee]=!0,z(W,ee,"in","out")):(hasOwnProperty.call(N,ee)?this.raise(Le.DuplicateModifier,W,{modifier:ee}):(z(W,ee,"static","readonly"),z(W,ee,"static","override"),z(W,ee,"override","readonly"),z(W,ee,"abstract","override"),U(W,ee,"declare","override"),U(W,ee,"static","abstract")),N[ee]=!0),d!=null&&d.includes(ee)&&this.raise(T,W,{modifier:ee})}}tsIsListTerminator(o){switch(o){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(o,d){const y=[];for(;!this.tsIsListTerminator(o);)y.push(d());return y}tsParseDelimitedList(o,d,y){return _P(this.tsParseDelimitedListWorker(o,d,!0,y))}tsParseDelimitedListWorker(o,d,y,T){const N=[];let z=-1;for(;!this.tsIsListTerminator(o);){z=-1;const U=d();if(U==null)return;if(N.push(U),this.eat(12)){z=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(o))break;y&&this.expect(12);return}return T&&(T.value=z),N}tsParseBracketedList(o,d,y,T,N){T||(y?this.expect(0):this.expect(47));const z=this.tsParseDelimitedList(o,d,N);return y?this.expect(3):this.expect(48),z}tsParseImportType(){const o=this.startNode();return this.expect(83),this.expect(10),this.match(134)?o.argument=this.parseStringLiteral(this.state.value):(this.raise(Le.UnsupportedImportTypeArgument,this.state.startLoc),o.argument=super.parseExprAtom()),this.eat(12)?o.options=this.tsParseImportTypeOptions():o.options=null,this.expect(11),this.eat(16)&&(o.qualifier=this.tsParseEntityName(3)),this.match(47)&&(o.typeParameters=this.tsParseTypeArguments()),this.finishNode(o,"TSImportType")}tsParseImportTypeOptions(){const o=this.startNode();this.expect(5);const d=this.startNode();return this.isContextual(76)?(d.method=!1,d.key=this.parseIdentifier(!0),d.computed=!1,d.shorthand=!1):this.unexpected(null,76),this.expect(14),d.value=this.tsParseImportTypeWithPropertyValue(),o.properties=[this.finishObjectProperty(d)],this.eat(12),this.expect(8),this.finishNode(o,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){const o=this.startNode(),d=[];for(this.expect(5);!this.match(8);){const y=this.state.type;xe(y)||y===134?d.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return o.properties=d,this.next(),this.finishNode(o,"ObjectExpression")}tsParseEntityName(o){let d;if(o&1&&this.match(78))if(o&2)d=this.parseIdentifier(!0);else{const y=this.startNode();this.next(),d=this.finishNode(y,"ThisExpression")}else d=this.parseIdentifier(!!(o&1));for(;this.eat(16);){const y=this.startNodeAtNode(d);y.left=d,y.right=this.parseIdentifier(!!(o&1)),d=this.finishNode(y,"TSQualifiedName")}return d}tsParseTypeReference(){const o=this.startNode();return o.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(o.typeParameters=this.tsParseTypeArguments()),this.finishNode(o,"TSTypeReference")}tsParseThisTypePredicate(o){this.next();const d=this.startNodeAtNode(o);return d.parameterName=o,d.typeAnnotation=this.tsParseTypeAnnotation(!1),d.asserts=!1,this.finishNode(d,"TSTypePredicate")}tsParseThisTypeNode(){const o=this.startNode();return this.next(),this.finishNode(o,"TSThisType")}tsParseTypeQuery(){const o=this.startNode();return this.expect(87),this.match(83)?o.exprName=this.tsParseImportType():o.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(o.typeParameters=this.tsParseTypeArguments()),this.finishNode(o,"TSTypeQuery")}tsParseTypeParameter(o){const d=this.startNode();return o(d),d.name=this.tsParseTypeParameterName(),d.constraint=this.tsEatThenParseType(81),d.default=this.tsEatThenParseType(29),this.finishNode(d,"TSTypeParameter")}tsTryParseTypeParameters(o){if(this.match(47))return this.tsParseTypeParameters(o)}tsParseTypeParameters(o){const d=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();const y={value:-1};return d.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,o),!1,!0,y),d.params.length===0&&this.raise(Le.EmptyTypeParameters,d),y.value!==-1&&this.addExtra(d,"trailingComma",y.value),this.finishNode(d,"TSTypeParameterDeclaration")}tsFillSignature(o,d){const y=o===19,T="parameters",N="typeAnnotation";d.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),d[T]=this.tsParseBindingListForSignature(),y?d[N]=this.tsParseTypeOrTypePredicateAnnotation(o):this.match(o)&&(d[N]=this.tsParseTypeOrTypePredicateAnnotation(o))}tsParseBindingListForSignature(){const o=super.parseBindingList(11,41,2);for(const d of o){const{type:y}=d;(y==="AssignmentPattern"||y==="TSParameterProperty")&&this.raise(Le.UnsupportedSignatureParameterKind,d,{type:y})}return o}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(o,d){return this.tsFillSignature(14,d),this.tsParseTypeMemberSemicolon(),this.finishNode(d,o)}tsIsUnambiguouslyIndexSignature(){return this.next(),xe(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(o){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);const d=this.parseIdentifier();d.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(d),this.expect(3),o.parameters=[d];const y=this.tsTryParseTypeAnnotation();return y&&(o.typeAnnotation=y),this.tsParseTypeMemberSemicolon(),this.finishNode(o,"TSIndexSignature")}tsParsePropertyOrMethodSignature(o,d){if(this.eat(17)&&(o.optional=!0),this.match(10)||this.match(47)){d&&this.raise(Le.ReadonlyForMethodSignature,o);const y=o;y.kind&&this.match(47)&&this.raise(Le.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,y),this.tsParseTypeMemberSemicolon();const T="parameters",N="typeAnnotation";if(y.kind==="get")y[T].length>0&&(this.raise(O.BadGetterArity,this.state.curPosition()),this.isThisParam(y[T][0])&&this.raise(Le.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(y.kind==="set"){if(y[T].length!==1)this.raise(O.BadSetterArity,this.state.curPosition());else{const z=y[T][0];this.isThisParam(z)&&this.raise(Le.AccessorCannotDeclareThisParameter,this.state.curPosition()),z.type==="Identifier"&&z.optional&&this.raise(Le.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),z.type==="RestElement"&&this.raise(Le.SetAccessorCannotHaveRestParameter,this.state.curPosition())}y[N]&&this.raise(Le.SetAccessorCannotHaveReturnType,y[N])}else y.kind="method";return this.finishNode(y,"TSMethodSignature")}else{const y=o;d&&(y.readonly=!0);const T=this.tsTryParseTypeAnnotation();return T&&(y.typeAnnotation=T),this.tsParseTypeMemberSemicolon(),this.finishNode(y,"TSPropertySignature")}}tsParseTypeMember(){const o=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",o);if(this.match(77)){const y=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",o):(o.key=this.createIdentifier(y,"new"),this.tsParsePropertyOrMethodSignature(o,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},o);const d=this.tsTryParseIndexSignature(o);return d||(super.parsePropertyName(o),!o.computed&&o.key.type==="Identifier"&&(o.key.name==="get"||o.key.name==="set")&&this.tsTokenCanFollowModifier()&&(o.kind=o.key.name,super.parsePropertyName(o),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(o,!!o.readonly))}tsParseTypeLiteral(){const o=this.startNode();return o.members=this.tsParseObjectTypeMembers(),this.finishNode(o,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);const o=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),o}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){const o=this.startNode();this.expect(5),this.match(53)?(o.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(o.readonly=!0),this.expect(0);const d=this.startNode();return d.name=this.tsParseTypeParameterName(),d.constraint=this.tsExpectThenParseType(58),o.typeParameter=this.finishNode(d,"TSTypeParameter"),o.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(o.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(o.optional=!0),o.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(o,"TSMappedType")}tsParseTupleType(){const o=this.startNode();o.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let d=!1;return o.elementTypes.forEach(y=>{const{type:T}=y;d&&T!=="TSRestType"&&T!=="TSOptionalType"&&!(T==="TSNamedTupleMember"&&y.optional)&&this.raise(Le.OptionalTypeBeforeRequired,y),d||(d=T==="TSNamedTupleMember"&&y.optional||T==="TSOptionalType")}),this.finishNode(o,"TSTupleType")}tsParseTupleElementType(){const o=this.state.startLoc,d=this.eat(21),{startLoc:y}=this.state;let T,N,z,U;const ee=ke(this.state.type)?this.lookaheadCharCode():null;if(ee===58)T=!0,z=!1,N=this.parseIdentifier(!0),this.expect(14),U=this.tsParseType();else if(ee===63){z=!0;const pe=this.state.value,Ee=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(T=!0,N=this.createIdentifier(this.startNodeAt(y),pe),this.expect(17),this.expect(14),U=this.tsParseType()):(T=!1,U=Ee,this.expect(17))}else U=this.tsParseType(),z=this.eat(17),T=this.eat(14);if(T){let pe;N?(pe=this.startNodeAt(y),pe.optional=z,pe.label=N,pe.elementType=U,this.eat(17)&&(pe.optional=!0,this.raise(Le.TupleOptionalAfterType,this.state.lastTokStartLoc))):(pe=this.startNodeAt(y),pe.optional=z,this.raise(Le.InvalidTupleMemberLabel,U),pe.label=U,pe.elementType=this.tsParseType()),U=this.finishNode(pe,"TSNamedTupleMember")}else if(z){const pe=this.startNodeAt(y);pe.typeAnnotation=U,U=this.finishNode(pe,"TSOptionalType")}if(d){const pe=this.startNodeAt(o);pe.typeAnnotation=U,U=this.finishNode(pe,"TSRestType")}return U}tsParseParenthesizedType(){const o=this.startNode();return this.expect(10),o.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(o,"TSParenthesizedType")}tsParseFunctionOrConstructorType(o,d){const y=this.startNode();return o==="TSConstructorType"&&(y.abstract=!!d,d&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,y)),this.finishNode(y,o)}tsParseLiteralTypeNode(){const o=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:o.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(o,"TSLiteralType")}tsParseTemplateLiteralType(){const o=this.startNode();return o.literal=super.parseTemplate(!1),this.finishNode(o,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){const o=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(o):o}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){const o=this.startNode(),d=this.lookahead();return d.type!==135&&d.type!==136&&this.unexpected(),o.literal=this.parseMaybeUnary(),this.finishNode(o,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{const{type:o}=this.state;if(xe(o)||o===88||o===84){const d=o===88?"TSVoidKeyword":o===84?"TSNullKeyword":IP(this.state.value);if(d!==void 0&&this.lookaheadCharCode()!==46){const y=this.startNode();return this.next(),this.finishNode(y,d)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){const{startLoc:o}=this.state;let d=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){const y=this.startNodeAt(o);y.elementType=d,this.expect(3),d=this.finishNode(y,"TSArrayType")}else{const y=this.startNodeAt(o);y.objectType=d,y.indexType=this.tsParseType(),this.expect(3),d=this.finishNode(y,"TSIndexedAccessType")}return d}tsParseTypeOperator(){const o=this.startNode(),d=this.state.value;return this.next(),o.operator=d,o.typeAnnotation=this.tsParseTypeOperatorOrHigher(),d==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(o),this.finishNode(o,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(o){switch(o.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(Le.UnexpectedReadonly,o)}}tsParseInferType(){const o=this.startNode();this.expectContextual(115);const d=this.startNode();return d.name=this.tsParseTypeParameterName(),d.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),o.typeParameter=this.finishNode(d,"TSTypeParameter"),this.finishNode(o,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){const o=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return o}}tsParseTypeOperatorOrHigher(){return ue(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(o,d,y){const T=this.startNode(),N=this.eat(y),z=[];do z.push(d());while(this.eat(y));return z.length===1&&!N?z[0]:(T.types=z,this.finishNode(T,o))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(xe(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){const{errors:o}=this.state,d=o.length;try{return this.parseObjectLike(8,!0),o.length===d}catch{return!1}}if(this.match(0)){this.next();const{errors:o}=this.state,d=o.length;try{return super.parseBindingList(3,93,1),o.length===d}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(o){return this.tsInType(()=>{const d=this.startNode();this.expect(o);const y=this.startNode(),T=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(T&&this.match(78)){let U=this.tsParseThisTypeOrThisTypePredicate();return U.type==="TSThisType"?(y.parameterName=U,y.asserts=!0,y.typeAnnotation=null,U=this.finishNode(y,"TSTypePredicate")):(this.resetStartLocationFromNode(U,y),U.asserts=!0),d.typeAnnotation=U,this.finishNode(d,"TSTypeAnnotation")}const N=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!N)return T?(y.parameterName=this.parseIdentifier(),y.asserts=T,y.typeAnnotation=null,d.typeAnnotation=this.finishNode(y,"TSTypePredicate"),this.finishNode(d,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,d);const z=this.tsParseTypeAnnotation(!1);return y.parameterName=N,y.typeAnnotation=z,y.asserts=T,d.typeAnnotation=this.finishNode(y,"TSTypePredicate"),this.finishNode(d,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){const o=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),o}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;const o=this.state.containsEsc;return this.next(),!xe(this.state.type)&&!this.match(78)?!1:(o&&this.raise(O.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(o=!0,d=this.startNode()){return this.tsInType(()=>{o&&this.expect(14),d.typeAnnotation=this.tsParseType()}),this.finishNode(d,"TSTypeAnnotation")}tsParseType(){gm(this.state.inType);const o=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return o;const d=this.startNodeAtNode(o);return d.checkType=o,d.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),d.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),d.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(d,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(Le.ReservedTypeAssertion,this.state.startLoc);const o=this.startNode();return o.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),o.expression=this.parseMaybeUnary(),this.finishNode(o,"TSTypeAssertion")}tsParseHeritageClause(o){const d=this.state.startLoc,y=this.tsParseDelimitedList("HeritageClauseElement",()=>{const T=this.startNode();return T.expression=this.tsParseEntityName(3),this.match(47)&&(T.typeParameters=this.tsParseTypeArguments()),this.finishNode(T,"TSExpressionWithTypeArguments")});return y.length||this.raise(Le.EmptyHeritageClauseType,d,{token:o}),y}tsParseInterfaceDeclaration(o,d={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),d.declare&&(o.declare=!0),xe(this.state.type)?(o.id=this.parseIdentifier(),this.checkIdentifier(o.id,130)):(o.id=null,this.raise(Le.MissingInterfaceName,this.state.startLoc)),o.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(o.extends=this.tsParseHeritageClause("extends"));const y=this.startNode();return y.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),o.body=this.finishNode(y,"TSInterfaceBody"),this.finishNode(o,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(o){return o.id=this.parseIdentifier(),this.checkIdentifier(o.id,2),o.typeAnnotation=this.tsInType(()=>{if(o.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){const d=this.startNode();return this.next(),this.finishNode(d,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(o,"TSTypeAliasDeclaration")}tsInTopLevelContext(o){if(this.curContext()!==$.brace){const d=this.state.context;this.state.context=[d[0]];try{return o()}finally{this.state.context=d}}else return o()}tsInType(o){const d=this.state.inType;this.state.inType=!0;try{return o()}finally{this.state.inType=d}}tsInDisallowConditionalTypesContext(o){const d=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return o()}finally{this.state.inDisallowConditionalTypesContext=d}}tsInAllowConditionalTypesContext(o){const d=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return o()}finally{this.state.inDisallowConditionalTypesContext=d}}tsEatThenParseType(o){if(this.match(o))return this.tsNextThenParseType()}tsExpectThenParseType(o){return this.tsInType(()=>(this.expect(o),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){const o=this.startNode();return o.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(o.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(o,"TSEnumMember")}tsParseEnumDeclaration(o,d={}){return d.const&&(o.const=!0),d.declare&&(o.declare=!0),this.expectContextual(126),o.id=this.parseIdentifier(),this.checkIdentifier(o.id,o.const?8971:8459),this.expect(5),o.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(o,"TSEnumDeclaration")}tsParseEnumBody(){const o=this.startNode();return this.expect(5),o.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(o,"TSEnumBody")}tsParseModuleBlock(){const o=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(o.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(o,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(o,d=!1){if(o.id=this.parseIdentifier(),d||this.checkIdentifier(o.id,1024),this.eat(16)){const y=this.startNode();this.tsParseModuleOrNamespaceDeclaration(y,!0),o.body=y}else this.scope.enter(1024),this.prodParam.enter(0),o.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(o,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(o){return this.isContextual(112)?(o.kind="global",o.global=!0,o.id=this.parseIdentifier()):this.match(134)?(o.kind="module",o.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),o.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(o,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(o,d,y){o.isExport=y||!1,o.id=d||this.parseIdentifier(),this.checkIdentifier(o.id,4096),this.expect(29);const T=this.tsParseModuleReference();return o.importKind==="type"&&T.type!=="TSExternalModuleReference"&&this.raise(Le.ImportAliasHasImportType,T),o.moduleReference=T,this.semicolon(),this.finishNode(o,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){const o=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),o.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(o,"TSExternalModuleReference")}tsLookAhead(o){const d=this.state.clone(),y=o();return this.state=d,y}tsTryParseAndCatch(o){const d=this.tryParse(y=>o()||y());if(!(d.aborted||!d.node))return d.error&&(this.state=d.failState),d.node}tsTryParse(o){const d=this.state.clone(),y=o();if(y!==void 0&&y!==!1)return y;this.state=d}tsTryParseDeclare(o){if(this.isLineTerminator())return;const d=this.state.type;return this.tsInAmbientContext(()=>{switch(d){case 68:return o.declare=!0,super.parseFunctionStatement(o,!1,!1);case 80:return o.declare=!0,this.parseClass(o,!0,!1);case 126:return this.tsParseEnumDeclaration(o,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(o);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(o.declare=!0,this.parseVarStatement(o,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(o,{const:!0,declare:!0}));case 107:if(this.isUsing())return this.raise(Le.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),o.declare=!0,this.parseVarStatement(o,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise(Le.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),o.declare=!0,this.next(),this.parseVarStatement(o,"await using",!0);break;case 129:{const y=this.tsParseInterfaceDeclaration(o,{declare:!0});if(y)return y}default:if(xe(d))return this.tsParseDeclaration(o,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(o,d,y,T){switch(d){case 124:if(this.tsCheckLineTerminator(y)&&(this.match(80)||xe(this.state.type)))return this.tsParseAbstractDeclaration(o,T);break;case 127:if(this.tsCheckLineTerminator(y)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(o);if(xe(this.state.type))return o.kind="module",this.tsParseModuleOrNamespaceDeclaration(o)}break;case 128:if(this.tsCheckLineTerminator(y)&&xe(this.state.type))return o.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(o);break;case 130:if(this.tsCheckLineTerminator(y)&&xe(this.state.type))return this.tsParseTypeAliasDeclaration(o);break}}tsCheckLineTerminator(o){return o?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(o){if(!this.match(47))return;const d=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;const y=this.tsTryParseAndCatch(()=>{const T=this.startNodeAt(o);return T.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(T),T.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),T});if(this.state.maybeInArrowParameters=d,!!y)return super.parseArrowExpression(y,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){const o=this.startNode();return o.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),o.params.length===0?this.raise(Le.EmptyTypeArguments,o):!this.state.inType&&this.curContext()===$.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(o,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return me(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(o,d){const y=d.length?d[0].loc.start:this.state.startLoc,T={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},T);const N=T.accessibility,z=T.override,U=T.readonly;!(o&4)&&(N||U||z)&&this.raise(Le.UnexpectedParameterModifier,y);const W=this.parseMaybeDefault();o&2&&this.parseFunctionParamType(W);const ee=this.parseMaybeDefault(W.loc.start,W);if(N||U||z){const pe=this.startNodeAt(y);return d.length&&(pe.decorators=d),N&&(pe.accessibility=N),U&&(pe.readonly=U),z&&(pe.override=z),ee.type!=="Identifier"&&ee.type!=="AssignmentPattern"&&this.raise(Le.UnsupportedParameterPropertyKind,pe),pe.parameter=ee,this.finishNode(pe,"TSParameterProperty")}return d.length&&(W.decorators=d),ee}isSimpleParameter(o){return o.type==="TSParameterProperty"&&super.isSimpleParameter(o.parameter)||super.isSimpleParameter(o)}tsDisallowOptionalPattern(o){for(const d of o.params)d.type!=="Identifier"&&d.optional&&!this.state.isAmbientContext&&this.raise(Le.PatternIsOptional,d)}setArrowFunctionParameters(o,d,y){super.setArrowFunctionParameters(o,d,y),this.tsDisallowOptionalPattern(o)}parseFunctionBodyAndFinish(o,d,y=!1){this.match(14)&&(o.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));const T=d==="FunctionDeclaration"?"TSDeclareFunction":d==="ClassMethod"||d==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return T&&!this.match(5)&&this.isLineTerminator()?this.finishNode(o,T):T==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(Le.DeclareFunctionHasImplementation,o),o.declare)?super.parseFunctionBodyAndFinish(o,T,y):(this.tsDisallowOptionalPattern(o),super.parseFunctionBodyAndFinish(o,d,y))}registerFunctionStatementId(o){!o.body&&o.id?this.checkIdentifier(o.id,1024):super.registerFunctionStatementId(o)}tsCheckForInvalidTypeCasts(o){o.forEach(d=>{d?.type==="TSTypeCastExpression"&&this.raise(Le.UnexpectedTypeAnnotation,d.typeAnnotation)})}toReferencedList(o,d){return this.tsCheckForInvalidTypeCasts(o),o}parseArrayLike(o,d,y){const T=super.parseArrayLike(o,d,y);return T.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(T.elements),T}parseSubscript(o,d,y,T){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();const z=this.startNodeAt(d);return z.expression=o,this.finishNode(z,"TSNonNullExpression")}let N=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(y)return T.stop=!0,o;T.optionalChainMember=N=!0,this.next()}if(this.match(47)||this.match(51)){let z;const U=this.tsTryParseAndCatch(()=>{if(!y&&this.atPossibleAsyncArrow(o)){const Ee=this.tsTryParseGenericAsyncArrowFunction(d);if(Ee)return T.stop=!0,Ee}const W=this.tsParseTypeArgumentsInExpression();if(!W)return;if(N&&!this.match(10)){z=this.state.curPosition();return}if(Tt(this.state.type)){const Ee=super.parseTaggedTemplateExpression(o,d,T);return Ee.typeParameters=W,Ee}if(!y&&this.eat(10)){const Ee=this.startNodeAt(d);return Ee.callee=o,Ee.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(Ee.arguments),Ee.typeParameters=W,T.optionalChainMember&&(Ee.optional=N),this.finishCallExpression(Ee,T.optionalChainMember)}const ee=this.state.type;if(ee===48||ee===52||ee!==10&&ee!==93&&ee!==120&&H(ee)&&!this.hasPrecedingLineBreak())return;const pe=this.startNodeAt(d);return pe.expression=o,pe.typeParameters=W,this.finishNode(pe,"TSInstantiationExpression")});if(z&&this.unexpected(z,10),U)return U.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(Le.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(U.expression=super.stopParseSubscript(o,T))),U}return super.parseSubscript(o,d,y,T)}parseNewCallee(o){var d;super.parseNewCallee(o);const{callee:y}=o;y.type==="TSInstantiationExpression"&&!((d=y.extra)!=null&&d.parenthesized)&&(o.typeParameters=y.typeParameters,o.callee=y.expression)}parseExprOp(o,d,y){let T;if(Ve(58)>y&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(T=this.isContextual(120)))){const N=this.startNodeAt(d);return N.expression=o,N.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(T&&this.raise(O.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(N,T?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(N,d,y)}return super.parseExprOp(o,d,y)}checkReservedWord(o,d,y,T){this.state.isAmbientContext||super.checkReservedWord(o,d,y,T)}checkImportReflection(o){super.checkImportReflection(o),o.module&&o.importKind!=="value"&&this.raise(Le.ImportReflectionHasImportType,o.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(o){if(super.isPotentialImportPhase(o))return!0;if(this.isContextual(130)){const d=this.lookaheadCharCode();return o?d===123||d===42:d!==61}return!o&&this.isContextual(87)}applyImportPhase(o,d,y,T){super.applyImportPhase(o,d,y,T),d?o.exportKind=y==="type"?"type":"value":o.importKind=y==="type"||y==="typeof"?y:"value"}parseImport(o){if(this.match(134))return o.importKind="value",super.parseImport(o);let d;if(xe(this.state.type)&&this.lookaheadCharCode()===61)return o.importKind="value",this.tsParseImportEqualsDeclaration(o);if(this.isContextual(130)){const y=this.parseMaybeImportPhase(o,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(o,y);d=super.parseImportSpecifiersAndAfter(o,y)}else d=super.parseImport(o);return d.importKind==="type"&&d.specifiers.length>1&&d.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(Le.TypeImportCannotSpecifyDefaultAndNamed,d),d}parseExport(o,d){if(this.match(83)){const y=o;this.next();let T=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?T=this.parseMaybeImportPhase(y,!1):y.importKind="value",this.tsParseImportEqualsDeclaration(y,T,!0)}else if(this.eat(29)){const y=o;return y.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(y,"TSExportAssignment")}else if(this.eatContextual(93)){const y=o;return this.expectContextual(128),y.id=this.parseIdentifier(),this.semicolon(),this.finishNode(y,"TSNamespaceExportDeclaration")}else return super.parseExport(o,d)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){const o=this.startNode();return this.next(),o.abstract=!0,this.parseClass(o,!0,!0)}if(this.match(129)){const o=this.tsParseInterfaceDeclaration(this.startNode());if(o)return o}return super.parseExportDefaultExpression()}parseVarStatement(o,d,y=!1){const{isAmbientContext:T}=this.state,N=super.parseVarStatement(o,d,y||T);if(!T)return N;if(!o.declare&&(d==="using"||d==="await using"))return this.raiseOverwrite(Le.UsingDeclarationInAmbientContext,o,d),N;for(const{id:z,init:U}of N.declarations)U&&(d==="var"||d==="let"||z.typeAnnotation?this.raise(Le.InitializerNotAllowedInAmbientContext,U):LP(U,this.hasPlugin("estree"))||this.raise(Le.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,U));return N}parseStatementContent(o,d){if(!this.state.containsEsc)switch(this.state.type){case 75:{if(this.isLookaheadContextual("enum")){const y=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(y,{const:!0})}break}case 124:case 125:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){const y=this.state.type,T=this.startNode();this.next();const N=y===125?this.tsTryParseDeclare(T):this.tsParseAbstractDeclaration(T,d);return N?(y===125&&(N.declare=!0),N):(T.expression=this.createIdentifier(this.startNodeAt(T.loc.start),y===125?"declare":"abstract"),this.semicolon(!1),this.finishNode(T,"ExpressionStatement"))}break}case 126:return this.tsParseEnumDeclaration(this.startNode());case 112:{if(this.lookaheadCharCode()===123){const T=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(T)}break}case 129:{const y=this.tsParseInterfaceDeclaration(this.startNode());if(y)return y;break}case 127:{if(this.nextTokenIsIdentifierOrStringLiteralOnSameLine()){const y=this.startNode();return this.next(),this.tsParseDeclaration(y,127,!1,d)}break}case 128:{if(this.nextTokenIsIdentifierOnSameLine()){const y=this.startNode();return this.next(),this.tsParseDeclaration(y,128,!1,d)}break}case 130:{if(this.nextTokenIsIdentifierOnSameLine()){const y=this.startNode();return this.next(),this.tsParseTypeAliasDeclaration(y)}break}}return super.parseStatementContent(o,d)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(o,d){return d.some(y=>ym(y)?o.accessibility===y:!!o[y])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(o,d,y){const T=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:T,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:Le.InvalidModifierOnTypeParameterPositions},d);const N=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(d,T)&&this.raise(Le.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(o,d)):this.parseClassMemberWithIsStatic(o,d,y,!!d.static)};d.declare?this.tsInAmbientContext(N):N()}parseClassMemberWithIsStatic(o,d,y,T){const N=this.tsTryParseIndexSignature(d);if(N){o.body.push(N),d.abstract&&this.raise(Le.IndexSignatureHasAbstract,d),d.accessibility&&this.raise(Le.IndexSignatureHasAccessibility,d,{modifier:d.accessibility}),d.declare&&this.raise(Le.IndexSignatureHasDeclare,d),d.override&&this.raise(Le.IndexSignatureHasOverride,d);return}!this.state.inAbstractClass&&d.abstract&&this.raise(Le.NonAbstractClassHasAbstractMethod,d),d.override&&(y.hadSuperClass||this.raise(Le.OverrideNotInSubClass,d)),super.parseClassMemberWithIsStatic(o,d,y,T)}parsePostMemberNameModifiers(o){this.eat(17)&&(o.optional=!0),o.readonly&&this.match(10)&&this.raise(Le.ClassMethodHasReadonly,o),o.declare&&this.match(10)&&this.raise(Le.ClassMethodHasDeclare,o)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(o,d,y){if(!this.match(17))return o;if(this.state.maybeInArrowParameters){const T=this.lookaheadCharCode();if(T===44||T===61||T===58||T===41)return this.setOptionalParametersError(y),o}return super.parseConditional(o,d,y)}parseParenItem(o,d){const y=super.parseParenItem(o,d);if(this.eat(17)&&(y.optional=!0,this.resetEndLocation(o)),this.match(14)){const T=this.startNodeAt(d);return T.expression=o,T.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(T,"TSTypeCastExpression")}return o}parseExportDeclaration(o){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(o));const d=this.state.startLoc,y=this.eatContextual(125);if(y&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(Le.ExpectedAmbientAfterExportDeclare,this.state.startLoc);const N=xe(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(o);return N?((N.type==="TSInterfaceDeclaration"||N.type==="TSTypeAliasDeclaration"||y)&&(o.exportKind="type"),y&&N.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(N,d),N.declare=!0),N):null}parseClassId(o,d,y,T){if((!d||y)&&this.isContextual(113))return;super.parseClassId(o,d,y,o.declare?1024:8331);const N=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);N&&(o.typeParameters=N)}parseClassPropertyAnnotation(o){o.optional||(this.eat(35)?o.definite=!0:this.eat(17)&&(o.optional=!0));const d=this.tsTryParseTypeAnnotation();d&&(o.typeAnnotation=d)}parseClassProperty(o){if(this.parseClassPropertyAnnotation(o),this.state.isAmbientContext&&!(o.readonly&&!o.typeAnnotation)&&this.match(29)&&this.raise(Le.DeclareClassFieldHasInitializer,this.state.startLoc),o.abstract&&this.match(29)){const{key:d}=o;this.raise(Le.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:d.type==="Identifier"&&!o.computed?d.name:`[${this.input.slice(this.offsetToSourcePos(d.start),this.offsetToSourcePos(d.end))}]`})}return super.parseClassProperty(o)}parseClassPrivateProperty(o){return o.abstract&&this.raise(Le.PrivateElementHasAbstract,o),o.accessibility&&this.raise(Le.PrivateElementHasAccessibility,o,{modifier:o.accessibility}),this.parseClassPropertyAnnotation(o),super.parseClassPrivateProperty(o)}parseClassAccessorProperty(o){return this.parseClassPropertyAnnotation(o),o.optional&&this.raise(Le.AccessorCannotBeOptional,o),super.parseClassAccessorProperty(o)}pushClassMethod(o,d,y,T,N,z){const U=this.tsTryParseTypeParameters(this.tsParseConstModifier);U&&N&&this.raise(Le.ConstructorHasTypeParameters,U);const{declare:W=!1,kind:ee}=d;W&&(ee==="get"||ee==="set")&&this.raise(Le.DeclareAccessor,d,{kind:ee}),U&&(d.typeParameters=U),super.pushClassMethod(o,d,y,T,N,z)}pushClassPrivateMethod(o,d,y,T){const N=this.tsTryParseTypeParameters(this.tsParseConstModifier);N&&(d.typeParameters=N),super.pushClassPrivateMethod(o,d,y,T)}declareClassPrivateMethodInScope(o,d){o.type!=="TSDeclareMethod"&&(o.type==="MethodDefinition"&&o.value.body==null||super.declareClassPrivateMethodInScope(o,d))}parseClassSuper(o){if(super.parseClassSuper(o),o.superClass)if(o.superClass.type==="TSInstantiationExpression"){const d=o.superClass,y=d.expression;this.takeSurroundingComments(y,y.start,y.end);const T=d.typeParameters;this.takeSurroundingComments(T,T.start,T.end),o.superClass=y,o.superTypeParameters=T}else(this.match(47)||this.match(51))&&(o.superTypeParameters=this.tsParseTypeArgumentsInExpression());this.eatContextual(113)&&(o.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(o,d,y,T,N,z,U){const W=this.tsTryParseTypeParameters(this.tsParseConstModifier);return W&&(o.typeParameters=W),super.parseObjPropValue(o,d,y,T,N,z,U)}parseFunctionParams(o,d){const y=this.tsTryParseTypeParameters(this.tsParseConstModifier);y&&(o.typeParameters=y),super.parseFunctionParams(o,d)}parseVarId(o,d){super.parseVarId(o,d),o.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(o.definite=!0);const y=this.tsTryParseTypeAnnotation();y&&(o.id.typeAnnotation=y,this.resetEndLocation(o.id))}parseAsyncArrowFromCallExpression(o,d){return this.match(14)&&(o.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(o,d)}parseMaybeAssign(o,d){var y,T,N,z,U;let W,ee,pe;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(W=this.state.clone(),ee=this.tryParse(()=>super.parseMaybeAssign(o,d),W),!ee.error)return ee.node;const{context:Be}=this.state,st=Be[Be.length-1];(st===$.j_oTag||st===$.j_expr)&&Be.pop()}if(!((y=ee)!=null&&y.error)&&!this.match(47))return super.parseMaybeAssign(o,d);(!W||W===this.state)&&(W=this.state.clone());let Ee;const Ae=this.tryParse(Be=>{var st,Ot;Ee=this.tsParseTypeParameters(this.tsParseConstModifier);const Ye=super.parseMaybeAssign(o,d);return(Ye.type!=="ArrowFunctionExpression"||(st=Ye.extra)!=null&&st.parenthesized)&&Be(),((Ot=Ee)==null?void 0:Ot.params.length)!==0&&this.resetStartLocationFromNode(Ye,Ee),Ye.typeParameters=Ee,Ye},W);if(!Ae.error&&!Ae.aborted)return Ee&&this.reportReservedArrowTypeParam(Ee),Ae.node;if(!ee&&(gm(!this.hasPlugin("jsx")),pe=this.tryParse(()=>super.parseMaybeAssign(o,d),W),!pe.error))return pe.node;if((T=ee)!=null&&T.node)return this.state=ee.failState,ee.node;if(Ae.node)return this.state=Ae.failState,Ee&&this.reportReservedArrowTypeParam(Ee),Ae.node;if((N=pe)!=null&&N.node)return this.state=pe.failState,pe.node;throw((z=ee)==null?void 0:z.error)||Ae.error||((U=pe)==null?void 0:U.error)}reportReservedArrowTypeParam(o){var d;o.params.length===1&&!o.params[0].constraint&&!((d=o.extra)!=null&&d.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(Le.ReservedArrowTypeParam,o)}parseMaybeUnary(o,d){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(o,d)}parseArrow(o){if(this.match(14)){const d=this.tryParse(y=>{const T=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&y(),T});if(d.aborted)return;d.thrown||(d.error&&(this.state=d.failState),o.returnType=d.node)}return super.parseArrow(o)}parseFunctionParamType(o){this.eat(17)&&(o.optional=!0);const d=this.tsTryParseTypeAnnotation();return d&&(o.typeAnnotation=d),this.resetEndLocation(o),o}isAssignable(o,d){switch(o.type){case"TSTypeCastExpression":return this.isAssignable(o.expression,d);case"TSParameterProperty":return!0;default:return super.isAssignable(o,d)}}toAssignable(o,d=!1){switch(o.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(o,d);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":d?this.expressionScope.recordArrowParameterBindingError(Le.UnexpectedTypeCastInParameter,o):this.raise(Le.UnexpectedTypeCastInParameter,o),this.toAssignable(o.expression,d);break;case"AssignmentExpression":!d&&o.left.type==="TSTypeCastExpression"&&(o.left=this.typeCastToParameter(o.left));default:super.toAssignable(o,d)}}toAssignableParenthesizedExpression(o,d){switch(o.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(o.expression,d);break;default:super.toAssignable(o,d)}}checkToRestConversion(o,d){switch(o.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(o.expression,!1);break;default:super.checkToRestConversion(o,d)}}isValidLVal(o,d,y,T){switch(o){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(T!==64||!y)&&["expression",!0];default:return super.isValidLVal(o,d,y,T)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(o,d){if(this.match(47)||this.match(51)){const y=this.tsParseTypeArgumentsInExpression();if(this.match(10)){const T=super.parseMaybeDecoratorArguments(o,d);return T.typeParameters=y,T}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(o,d)}checkCommaAfterRest(o){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===o?(this.next(),!1):super.checkCommaAfterRest(o)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(o,d){const y=super.parseMaybeDefault(o,d);return y.type==="AssignmentPattern"&&y.typeAnnotation&&y.right.start<y.typeAnnotation.start&&this.raise(Le.TypeAnnotationAfterAssign,y.typeAnnotation),y}getTokenFromCode(o){if(this.state.inType){if(o===62){this.finishOp(48,1);return}if(o===60){this.finishOp(47,1);return}}super.getTokenFromCode(o)}reScan_lt_gt(){const{type:o}=this.state;o===47?(this.state.pos-=1,this.readToken_lt()):o===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){const{type:o}=this.state;return o===51?(this.state.pos-=2,this.finishOp(47,1),47):o}toAssignableListItem(o,d,y){const T=o[d];T.type==="TSTypeCastExpression"&&(o[d]=this.typeCastToParameter(T)),super.toAssignableListItem(o,d,y)}typeCastToParameter(o){return o.expression.typeAnnotation=o.typeAnnotation,this.resetEndLocation(o.expression,o.typeAnnotation.loc.end),o.expression}shouldParseArrow(o){return this.match(14)?o.every(d=>this.isAssignable(d,!0)):super.shouldParseArrow(o)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(o){if(this.match(47)||this.match(51)){const d=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());d&&(o.typeParameters=d)}return super.jsxParseOpeningElementAfterName(o)}getGetterSetterExpectedParamCount(o){const d=super.getGetterSetterExpectedParamCount(o),T=this.getObjectOrClassMethodParams(o)[0];return T&&this.isThisParam(T)?d+1:d}parseCatchClauseParam(){const o=super.parseCatchClauseParam(),d=this.tsTryParseTypeAnnotation();return d&&(o.typeAnnotation=d,this.resetEndLocation(o)),o}tsInAmbientContext(o){const{isAmbientContext:d,strict:y}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return o()}finally{this.state.isAmbientContext=d,this.state.strict=y}}parseClass(o,d,y){const T=this.state.inAbstractClass;this.state.inAbstractClass=!!o.abstract;try{return super.parseClass(o,d,y)}finally{this.state.inAbstractClass=T}}tsParseAbstractDeclaration(o,d){if(this.match(80))return o.abstract=!0,this.maybeTakeDecorators(d,this.parseClass(o,!0,!1));if(this.isContextual(129))return this.hasFollowingLineBreak()?null:(o.abstract=!0,this.raise(Le.NonClassMethodPropertyHasAbstractModifier,o),this.tsParseInterfaceDeclaration(o));throw this.unexpected(null,80)}parseMethod(o,d,y,T,N,z,U){const W=super.parseMethod(o,d,y,T,N,z,U);if((W.abstract||W.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?W.value:W).body){const{key:Ee}=W;this.raise(Le.AbstractMethodHasImplementation,W,{methodName:Ee.type==="Identifier"&&!W.computed?Ee.name:`[${this.input.slice(this.offsetToSourcePos(Ee.start),this.offsetToSourcePos(Ee.end))}]`})}return W}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(o,d,y,T){return!d&&T?(this.parseTypeOnlyImportExportSpecifier(o,!1,y),this.finishNode(o,"ExportSpecifier")):(o.exportKind="value",super.parseExportSpecifier(o,d,y,T))}parseImportSpecifier(o,d,y,T,N){return!d&&T?(this.parseTypeOnlyImportExportSpecifier(o,!0,y),this.finishNode(o,"ImportSpecifier")):(o.importKind="value",super.parseImportSpecifier(o,d,y,T,y?4098:4096))}parseTypeOnlyImportExportSpecifier(o,d,y){const T=d?"imported":"local",N=d?"local":"exported";let z=o[T],U,W=!1,ee=!0;const pe=z.loc.start;if(this.isContextual(93)){const Ae=this.parseIdentifier();if(this.isContextual(93)){const Be=this.parseIdentifier();ke(this.state.type)?(W=!0,z=Ae,U=d?this.parseIdentifier():this.parseModuleExportName(),ee=!1):(U=Be,ee=!1)}else ke(this.state.type)?(ee=!1,U=d?this.parseIdentifier():this.parseModuleExportName()):(W=!0,z=Ae)}else ke(this.state.type)&&(W=!0,d?(z=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(z.name,z.loc.start,!0,!0)):z=this.parseModuleExportName());W&&y&&this.raise(d?Le.TypeModifierIsUsedInTypeImports:Le.TypeModifierIsUsedInTypeExports,pe),o[T]=z,o[N]=U;const Ee=d?"importKind":"exportKind";o[Ee]=W?"type":"value",ee&&this.eatContextual(93)&&(o[N]=d?this.parseIdentifier():this.parseModuleExportName()),o[N]||(o[N]=this.cloneIdentifier(o[T])),d&&this.checkIdentifier(o[N],W?4098:4096)}fillOptionalPropertiesForTSESLint(o){var d,y,T,N,z,U,W,ee,pe,Ee,Ae,Be,st,Ot,Ye,dt,vr,zn,Cm,km,Em,Am,Dm,_m,Im,Nm,Mm,$m,Lm,Bm,Qm,Fm,Rm,zm,Xm,jm,Zm,Vm,Um,qm,Wm,Ym,Gm,Hm,Jm,Km,eg,tg;switch(o.type){case"ExpressionStatement":(d=o.directive)!=null||(o.directive=void 0);return;case"RestElement":o.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(y=o.decorators)!=null||(o.decorators=[]),(T=o.optional)!=null||(o.optional=!1),(N=o.typeAnnotation)!=null||(o.typeAnnotation=void 0);return;case"TSParameterProperty":(z=o.accessibility)!=null||(o.accessibility=void 0),(U=o.decorators)!=null||(o.decorators=[]),(W=o.override)!=null||(o.override=!1),(ee=o.readonly)!=null||(o.readonly=!1),(pe=o.static)!=null||(o.static=!1);return;case"TSEmptyBodyFunctionExpression":o.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(Ee=o.declare)!=null||(o.declare=!1),(Ae=o.returnType)!=null||(o.returnType=void 0),(Be=o.typeParameters)!=null||(o.typeParameters=void 0);return;case"Property":(st=o.optional)!=null||(o.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(Ot=o.optional)!=null||(o.optional=!1);case"TSIndexSignature":(Ye=o.accessibility)!=null||(o.accessibility=void 0),(dt=o.readonly)!=null||(o.readonly=!1),(vr=o.static)!=null||(o.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":(zn=o.declare)!=null||(o.declare=!1),(Cm=o.definite)!=null||(o.definite=!1),(km=o.readonly)!=null||(o.readonly=!1),(Em=o.typeAnnotation)!=null||(o.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(Am=o.accessibility)!=null||(o.accessibility=void 0),(Dm=o.decorators)!=null||(o.decorators=[]),(_m=o.override)!=null||(o.override=!1),(Im=o.optional)!=null||(o.optional=!1);return;case"ClassExpression":(Nm=o.id)!=null||(o.id=null);case"ClassDeclaration":(Mm=o.abstract)!=null||(o.abstract=!1),($m=o.declare)!=null||(o.declare=!1),(Lm=o.decorators)!=null||(o.decorators=[]),(Bm=o.implements)!=null||(o.implements=[]),(Qm=o.superTypeArguments)!=null||(o.superTypeArguments=void 0),(Fm=o.typeParameters)!=null||(o.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(Rm=o.declare)!=null||(o.declare=!1);return;case"VariableDeclarator":(zm=o.definite)!=null||(o.definite=!1);return;case"TSEnumDeclaration":(Xm=o.const)!=null||(o.const=!1),(jm=o.declare)!=null||(o.declare=!1);return;case"TSEnumMember":(Zm=o.computed)!=null||(o.computed=!1);return;case"TSImportType":(Vm=o.qualifier)!=null||(o.qualifier=null),(Um=o.options)!=null||(o.options=null);return;case"TSInterfaceDeclaration":(qm=o.declare)!=null||(o.declare=!1),(Wm=o.extends)!=null||(o.extends=[]);return;case"TSMappedType":(Ym=o.optional)!=null||(o.optional=!1),(Gm=o.readonly)!=null||(o.readonly=void 0);return;case"TSModuleDeclaration":(Hm=o.declare)!=null||(o.declare=!1),(Jm=o.global)!=null||(o.global=o.kind==="global");return;case"TSTypeParameter":(Km=o.const)!=null||(o.const=!1),(eg=o.in)!=null||(o.in=!1),(tg=o.out)!=null||(o.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(o,d){if(zt(o)){if(ch.lastIndex=d,ch.test(this.input)){const y=this.codePointAtPos(ch.lastIndex);if(!ti(y)&&y!==92)return!1}return!0}else return o===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){const o=this.nextTokenInLineStart(),d=this.codePointAtPos(o);return this.chStartsBindingIdentifierAndNotRelationalOperator(d,o)}nextTokenIsIdentifierOrStringLiteralOnSameLine(){const o=this.nextTokenInLineStart(),d=this.codePointAtPos(o);return this.chStartsBindingIdentifier(d,o)||d===34||d===39}};function $P(_){if(_.type!=="MemberExpression")return!1;const{computed:f,property:o}=_;return f&&o.type!=="StringLiteral"&&(o.type!=="TemplateLiteral"||o.expressions.length>0)?!1:Om(_.object)}function LP(_,f){var o;const{type:d}=_;if((o=_.extra)!=null&&o.parenthesized)return!1;if(f){if(d==="Literal"){const{value:y}=_;if(typeof y=="string"||typeof y=="boolean")return!0}}else if(d==="StringLiteral"||d==="BooleanLiteral")return!0;return!!(vm(_,f)||BP(_,f)||d==="TemplateLiteral"&&_.expressions.length===0||$P(_))}function vm(_,f){return f?_.type==="Literal"&&(typeof _.value=="number"||"bigint"in _):_.type==="NumericLiteral"||_.type==="BigIntLiteral"}function BP(_,f){if(_.type==="UnaryExpression"){const{operator:o,argument:d}=_;if(o==="-"&&vm(d,f))return!0}return!1}function Om(_){return _.type==="Identifier"?!0:_.type!=="MemberExpression"||_.computed?!1:Om(_.object)}const xm=x`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."});var QP=_=>class extends _{parsePlaceholder(o){if(this.match(133)){const d=this.startNode();return this.next(),this.assertNoSpace(),d.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(d,o)}}finishPlaceholder(o,d){let y=o;return(!y.expectedNode||!y.type)&&(y=this.finishNode(y,"Placeholder")),y.expectedNode=d,y}getTokenFromCode(o){o===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(o)}parseExprAtom(o){return this.parsePlaceholder("Expression")||super.parseExprAtom(o)}parseIdentifier(o){return this.parsePlaceholder("Identifier")||super.parseIdentifier(o)}checkReservedWord(o,d,y,T){o!==void 0&&super.checkReservedWord(o,d,y,T)}cloneIdentifier(o){const d=super.cloneIdentifier(o);return d.type==="Placeholder"&&(d.expectedNode=o.expectedNode),d}cloneStringLiteral(o){return o.type==="Placeholder"?this.cloneIdentifier(o):super.cloneStringLiteral(o)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(o,d,y,T){return o==="Placeholder"||super.isValidLVal(o,d,y,T)}toAssignable(o,d){o&&o.type==="Placeholder"&&o.expectedNode==="Expression"?o.expectedNode="Pattern":super.toAssignable(o,d)}chStartsBindingIdentifier(o,d){if(super.chStartsBindingIdentifier(o,d))return!0;const y=this.nextTokenStart();return this.input.charCodeAt(y)===37&&this.input.charCodeAt(y+1)===37}verifyBreakContinue(o,d){var y;((y=o.label)==null?void 0:y.type)!=="Placeholder"&&super.verifyBreakContinue(o,d)}parseExpressionStatement(o,d){var y;if(d.type!=="Placeholder"||(y=d.extra)!=null&&y.parenthesized)return super.parseExpressionStatement(o,d);if(this.match(14)){const N=o;return N.label=this.finishPlaceholder(d,"Identifier"),this.next(),N.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(N,"LabeledStatement")}this.semicolon();const T=o;return T.name=d.name,this.finishPlaceholder(T,"Statement")}parseBlock(o,d,y){return this.parsePlaceholder("BlockStatement")||super.parseBlock(o,d,y)}parseFunctionId(o){return this.parsePlaceholder("Identifier")||super.parseFunctionId(o)}parseClass(o,d,y){const T=d?"ClassDeclaration":"ClassExpression";this.next();const N=this.state.strict,z=this.parsePlaceholder("Identifier");if(z)if(this.match(81)||this.match(133)||this.match(5))o.id=z;else{if(y||!d)return o.id=null,o.body=this.finishPlaceholder(z,"ClassBody"),this.finishNode(o,T);throw this.raise(xm.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(o,d,y);return super.parseClassSuper(o),o.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!o.superClass,N),this.finishNode(o,T)}parseExport(o,d){const y=this.parsePlaceholder("Identifier");if(!y)return super.parseExport(o,d);const T=o;if(!this.isContextual(98)&&!this.match(12))return T.specifiers=[],T.source=null,T.declaration=this.finishPlaceholder(y,"Declaration"),this.finishNode(T,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");const N=this.startNode();return N.exported=y,T.specifiers=[this.finishNode(N,"ExportDefaultSpecifier")],super.parseExport(T,d)}isExportDefaultSpecifier(){if(this.match(65)){const o=this.nextTokenStart();if(this.isUnparsedContextual(o,"from")&&this.input.startsWith(Pe(133),this.nextTokenStartSince(o+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(o,d){var y;return(y=o.specifiers)!=null&&y.length?!0:super.maybeParseExportDefaultSpecifier(o,d)}checkExport(o){const{specifiers:d}=o;d!=null&&d.length&&(o.specifiers=d.filter(y=>y.exported.type==="Placeholder")),super.checkExport(o),o.specifiers=d}parseImport(o){const d=this.parsePlaceholder("Identifier");if(!d)return super.parseImport(o);if(o.specifiers=[],!this.isContextual(98)&&!this.match(12))return o.source=this.finishPlaceholder(d,"StringLiteral"),this.semicolon(),this.finishNode(o,"ImportDeclaration");const y=this.startNodeAtNode(d);return y.local=d,o.specifiers.push(this.finishNode(y,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(o)||this.parseNamedImportSpecifiers(o)),this.expectContextual(98),o.source=this.parseImportSource(),this.semicolon(),this.finishNode(o,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(xm.UnexpectedSpace,this.state.lastTokEndLoc)}},FP=_=>class extends _{parseV8Intrinsic(){if(this.match(54)){const o=this.state.startLoc,d=this.startNode();if(this.next(),xe(this.state.type)){const y=this.parseIdentifierName(),T=this.createIdentifier(d,y);if(this.castNodeTo(T,"V8IntrinsicIdentifier"),this.match(10))return T}this.unexpected(o)}}parseExprAtom(o){return this.parseV8Intrinsic()||super.parseExprAtom(o)}};const bm=["minimal","fsharp","hack","smart"],Sm=["^^","@@","^","%","#"];function RP(_){if(_.has("decorators")){if(_.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");const d=_.get("decorators").decoratorsBeforeExport;if(d!=null&&typeof d!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");const y=_.get("decorators").allowCallParenthesized;if(y!=null&&typeof y!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(_.has("flow")&&_.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(_.has("placeholders")&&_.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(_.has("pipelineOperator")){var f;const d=_.get("pipelineOperator").proposal;if(!bm.includes(d)){const y=bm.map(T=>`"${T}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${y}.`)}if(d==="hack"){var o;if(_.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(_.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");const y=_.get("pipelineOperator").topicToken;if(!Sm.includes(y)){const T=Sm.map(N=>`"${N}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${T}.`)}if(y==="#"&&((o=_.get("recordAndTuple"))==null?void 0:o.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",_.get("recordAndTuple")])}\`.`)}else if(d==="smart"&&((f=_.get("recordAndTuple"))==null?void 0:f.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",_.get("recordAndTuple")])}\`.`)}if(_.has("moduleAttributes")){if(_.has("deprecatedImportAssert")||_.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(_.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(_.has("importAssertions")&&_.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(_.has("deprecatedImportAssert")||_.has("importAttributes")&&_.get("importAttributes").deprecatedAssertSyntax&&_.set("deprecatedImportAssert",{}),_.has("recordAndTuple")){const d=_.get("recordAndTuple").syntaxType;if(d!=null){const y=["hash","bar"];if(!y.includes(d))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+y.map(T=>`'${T}'`).join(", "))}}if(_.has("asyncDoExpressions")&&!_.has("doExpressions")){const d=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw d.missingPlugins="doExpressions",d}if(_.has("optionalChainingAssign")&&_.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(_.has("discardBinding")&&_.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.")}const wm={estree:k,jsx:qe,flow:Ol,typescript:MP,v8intrinsic:FP,placeholders:QP},zP=Object.keys(wm);class XP extends DP{checkProto(f,o,d,y){if(f.type==="SpreadElement"||this.isObjectMethod(f)||f.computed||f.shorthand)return d;const T=f.key;return(T.type==="Identifier"?T.name:T.value)==="__proto__"?o?(this.raise(O.RecordNoProto,T),!0):(d&&(y?y.doubleProtoLoc===null&&(y.doubleProtoLoc=T.loc.start):this.raise(O.DuplicateProto,T)),!0):d}shouldExitDescending(f,o){return f.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(f.start)===o}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(O.ParseExpressionEmptyInput,this.state.startLoc);const f=this.parseExpression();if(!this.match(140))throw this.raise(O.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),f.comments=this.comments,f.errors=this.state.errors,this.optionFlags&256&&(f.tokens=this.tokens),f}parseExpression(f,o){return f?this.disallowInAnd(()=>this.parseExpressionBase(o)):this.allowInAnd(()=>this.parseExpressionBase(o))}parseExpressionBase(f){const o=this.state.startLoc,d=this.parseMaybeAssign(f);if(this.match(12)){const y=this.startNodeAt(o);for(y.expressions=[d];this.eat(12);)y.expressions.push(this.parseMaybeAssign(f));return this.toReferencedList(y.expressions),this.finishNode(y,"SequenceExpression")}return d}parseMaybeAssignDisallowIn(f,o){return this.disallowInAnd(()=>this.parseMaybeAssign(f,o))}parseMaybeAssignAllowIn(f,o){return this.allowInAnd(()=>this.parseMaybeAssign(f,o))}setOptionalParametersError(f){f.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(f,o){const d=this.state.startLoc,y=this.isContextual(108);if(y&&this.prodParam.hasYield){this.next();let U=this.parseYield(d);return o&&(U=o.call(this,U,d)),U}let T;f?T=!1:(f=new Pl,T=!0);const{type:N}=this.state;(N===10||xe(N))&&(this.state.potentialArrowAt=this.state.start);let z=this.parseMaybeConditional(f);if(o&&(z=o.call(this,z,d)),re(this.state.type)){const U=this.startNodeAt(d),W=this.state.value;if(U.operator=W,this.match(29)){this.toAssignable(z,!0),U.left=z;const ee=d.index;f.doubleProtoLoc!=null&&f.doubleProtoLoc.index>=ee&&(f.doubleProtoLoc=null),f.shorthandAssignLoc!=null&&f.shorthandAssignLoc.index>=ee&&(f.shorthandAssignLoc=null),f.privateKeyLoc!=null&&f.privateKeyLoc.index>=ee&&(this.checkDestructuringPrivate(f),f.privateKeyLoc=null),f.voidPatternLoc!=null&&f.voidPatternLoc.index>=ee&&(f.voidPatternLoc=null)}else U.left=z;return this.next(),U.right=this.parseMaybeAssign(),this.checkLVal(z,this.finishNode(U,"AssignmentExpression"),void 0,void 0,void 0,void 0,W==="||="||W==="&&="||W==="??="),U}else T&&this.checkExpressionErrors(f,!0);if(y){const{type:U}=this.state;if((this.hasPlugin("v8intrinsic")?H(U):H(U)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(O.YieldNotInGeneratorFunction,d),this.parseYield(d)}return z}parseMaybeConditional(f){const o=this.state.startLoc,d=this.state.potentialArrowAt,y=this.parseExprOps(f);return this.shouldExitDescending(y,d)?y:this.parseConditional(y,o,f)}parseConditional(f,o,d){if(this.eat(17)){const y=this.startNodeAt(o);return y.test=f,y.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),y.alternate=this.parseMaybeAssign(),this.finishNode(y,"ConditionalExpression")}return f}parseMaybeUnaryOrPrivate(f){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(f)}parseExprOps(f){const o=this.state.startLoc,d=this.state.potentialArrowAt,y=this.parseMaybeUnaryOrPrivate(f);return this.shouldExitDescending(y,d)?y:this.parseExprOp(y,o,-1)}parseExprOp(f,o,d){if(this.isPrivateName(f)){const T=this.getPrivateNameSV(f);(d>=Ve(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(O.PrivateInExpectedIn,f,{identifierName:T}),this.classScope.usePrivateName(T,f.loc.start)}const y=this.state.type;if(ve(y)&&(this.prodParam.hasIn||!this.match(58))){let T=Ve(y);if(T>d){if(y===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return f;this.checkPipelineAtInfixOperator(f,o)}const N=this.startNodeAt(o);N.left=f,N.operator=this.state.value;const z=y===41||y===42,U=y===40;if(U&&(T=Ve(42)),this.next(),y===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(O.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);N.right=this.parseExprOpRightExpr(y,T);const W=this.finishNode(N,z||U?"LogicalExpression":"BinaryExpression"),ee=this.state.type;if(U&&(ee===41||ee===42)||z&&ee===40)throw this.raise(O.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(W,o,d)}}return f}parseExprOpRightExpr(f,o){const d=this.state.startLoc;switch(f){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(o))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(O.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(f,o),d)});default:return this.parseExprOpBaseRightExpr(f,o)}}parseExprOpBaseRightExpr(f,o){const d=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),d,He(f)?o-1:o)}parseHackPipeBody(){var f;const{startLoc:o}=this.state,d=this.parseMaybeAssign();return p.has(d.type)&&!((f=d.extra)!=null&&f.parenthesized)&&this.raise(O.PipeUnparenthesizedBody,o,{type:d.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(O.PipeTopicUnused,o),d}checkExponentialAfterUnary(f){this.match(57)&&this.raise(O.UnexpectedTokenUnaryExponentiation,f.argument)}parseMaybeUnary(f,o){const d=this.state.startLoc,y=this.isContextual(96);if(y&&this.recordAwaitIfAllowed()){this.next();const U=this.parseAwait(d);return o||this.checkExponentialAfterUnary(U),U}const T=this.match(34),N=this.startNode();if(K(this.state.type)){N.operator=this.state.value,N.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");const U=this.match(89);if(this.next(),N.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(f,!0),this.state.strict&&U){const W=N.argument;W.type==="Identifier"?this.raise(O.StrictDelete,N):this.hasPropertyAsPrivateName(W)&&this.raise(O.DeletePrivateField,N)}if(!T)return o||this.checkExponentialAfterUnary(N),this.finishNode(N,"UnaryExpression")}const z=this.parseUpdate(N,T,f);if(y){const{type:U}=this.state;if((this.hasPlugin("v8intrinsic")?H(U):H(U)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(O.AwaitNotInAsyncContext,d),this.parseAwait(d)}return z}parseUpdate(f,o,d){if(o){const N=f;return this.checkLVal(N.argument,this.finishNode(N,"UpdateExpression")),f}const y=this.state.startLoc;let T=this.parseExprSubscripts(d);if(this.checkExpressionErrors(d,!1))return T;for(;we(this.state.type)&&!this.canInsertSemicolon();){const N=this.startNodeAt(y);N.operator=this.state.value,N.prefix=!1,N.argument=T,this.next(),this.checkLVal(T,T=this.finishNode(N,"UpdateExpression"))}return T}parseExprSubscripts(f){const o=this.state.startLoc,d=this.state.potentialArrowAt,y=this.parseExprAtom(f);return this.shouldExitDescending(y,d)?y:this.parseSubscripts(y,o)}parseSubscripts(f,o,d){const y={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(f),stop:!1};do f=this.parseSubscript(f,o,d,y),y.maybeAsyncArrow=!1;while(!y.stop);return f}parseSubscript(f,o,d,y){const{type:T}=this.state;if(!d&&T===15)return this.parseBind(f,o,d,y);if(Tt(T))return this.parseTaggedTemplateExpression(f,o,y);let N=!1;if(T===18){if(d&&(this.raise(O.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(f,y);y.optionalChainMember=N=!0,this.next()}if(!d&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(f,o,y,N);{const z=this.eat(0);return z||N||this.eat(16)?this.parseMember(f,o,y,z,N):this.stopParseSubscript(f,y)}}stopParseSubscript(f,o){return o.stop=!0,f}parseMember(f,o,d,y,T){const N=this.startNodeAt(o);return N.object=f,N.computed=y,y?(N.property=this.parseExpression(),this.expect(3)):this.match(139)?(f.type==="Super"&&this.raise(O.SuperPrivateField,o),this.classScope.usePrivateName(this.state.value,this.state.startLoc),N.property=this.parsePrivateName()):N.property=this.parseIdentifier(!0),d.optionalChainMember?(N.optional=T,this.finishNode(N,"OptionalMemberExpression")):this.finishNode(N,"MemberExpression")}parseBind(f,o,d,y){const T=this.startNodeAt(o);return T.object=f,this.next(),T.callee=this.parseNoCallExpr(),y.stop=!0,this.parseSubscripts(this.finishNode(T,"BindExpression"),o,d)}parseCoverCallAndAsyncArrowHead(f,o,d,y){const T=this.state.maybeInArrowParameters;let N=null;this.state.maybeInArrowParameters=!0,this.next();const z=this.startNodeAt(o);z.callee=f;const{maybeAsyncArrow:U,optionalChainMember:W}=d;U&&(this.expressionScope.enter(kP()),N=new Pl),W&&(z.optional=y),y?z.arguments=this.parseCallExpressionArguments():z.arguments=this.parseCallExpressionArguments(f.type!=="Super",z,N);let ee=this.finishCallExpression(z,W);return U&&this.shouldParseAsyncArrow()&&!y?(d.stop=!0,this.checkDestructuringPrivate(N),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),ee=this.parseAsyncArrowFromCallExpression(this.startNodeAt(o),ee)):(U&&(this.checkExpressionErrors(N,!0),this.expressionScope.exit()),this.toReferencedArguments(ee)),this.state.maybeInArrowParameters=T,ee}toReferencedArguments(f,o){this.toReferencedListDeep(f.arguments,o)}parseTaggedTemplateExpression(f,o,d){const y=this.startNodeAt(o);return y.tag=f,y.quasi=this.parseTemplate(!0),d.optionalChainMember&&this.raise(O.OptionalChainingNoTemplate,o),this.finishNode(y,"TaggedTemplateExpression")}atPossibleAsyncArrow(f){return f.type==="Identifier"&&f.name==="async"&&this.state.lastTokEndLoc.index===f.end&&!this.canInsertSemicolon()&&f.end-f.start===5&&this.offsetToSourcePos(f.start)===this.state.potentialArrowAt}finishCallExpression(f,o){if(f.callee.type==="Import")if(f.arguments.length===0||f.arguments.length>2)this.raise(O.ImportCallArity,f);else for(const d of f.arguments)d.type==="SpreadElement"&&this.raise(O.ImportCallSpreadArgument,d);return this.finishNode(f,o?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(f,o,d){const y=[];let T=!0;const N=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(11);){if(T)T=!1;else if(this.expect(12),this.match(11)){o&&this.addTrailingCommaExtraToNode(o),this.next();break}y.push(this.parseExprListItem(11,!1,d,f))}return this.state.inFSharpPipelineDirectBody=N,y}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(f,o){var d;return this.resetPreviousNodeTrailingComments(o),this.expect(19),this.parseArrowExpression(f,o.arguments,!0,(d=o.extra)==null?void 0:d.trailingCommaLoc),o.innerComments&&Ks(f,o.innerComments),o.callee.trailingComments&&Ks(f,o.callee.trailingComments),f}parseNoCallExpr(){const f=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),f,!0)}parseExprAtom(f){let o,d=null;const{type:y}=this.state;switch(y){case 79:return this.parseSuper();case 83:return o=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(o):this.match(10)?this.optionFlags&512?this.parseImportCall(o):this.finishNode(o,"Import"):(this.raise(O.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(o,"Import"));case 78:return o=this.startNode(),this.next(),this.finishNode(o,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{const T=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(T)}case 0:return this.parseArrayLike(3,!1,f);case 5:return this.parseObjectLike(8,!1,!1,f);case 68:return this.parseFunctionOrFunctionSent();case 26:d=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(d,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{o=this.startNode(),this.next(),o.object=null;const T=o.callee=this.parseNoCallExpr();if(T.type==="MemberExpression")return this.finishNode(o,"BindExpression");throw this.raise(O.UnsupportedBind,T)}case 139:return this.raise(O.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{const T=this.getPluginOption("pipelineOperator","proposal");if(T)return this.parseTopicReference(T);throw this.unexpected()}case 47:{const T=this.input.codePointAt(this.nextTokenStart());throw zt(T)||T===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(y===137)return this.parseDecimalLiteral(this.state.value);if(y===2||y===1)return this.parseArrayLike(this.state.type===2?4:3,!0);if(y===6||y===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0);if(xe(y)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();const T=this.state.potentialArrowAt===this.state.start,N=this.state.containsEsc,z=this.parseIdentifier();if(!N&&z.name==="async"&&!this.canInsertSemicolon()){const{type:U}=this.state;if(U===68)return this.resetPreviousNodeTrailingComments(z),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(z));if(xe(U))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(z)):z;if(U===90)return this.resetPreviousNodeTrailingComments(z),this.parseDo(this.startNodeAtNode(z),!0)}return T&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(z),[z],!1)):z}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(f,o){const d=this.getPluginOption("pipelineOperator","proposal");if(d)return this.state.type=f,this.state.value=o,this.state.pos--,this.state.end--,this.state.endLoc=n(this.state.endLoc,-1),this.parseTopicReference(d);throw this.unexpected()}parseTopicReference(f){const o=this.startNode(),d=this.state.startLoc,y=this.state.type;return this.next(),this.finishTopicReference(o,d,f,y)}finishTopicReference(f,o,d,y){if(this.testTopicReferenceConfiguration(d,o,y))return d==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(O.PipeTopicUnbound,o),this.registerTopicReference(),this.finishNode(f,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(O.PrimaryTopicNotAllowed,o),this.registerTopicReference(),this.finishNode(f,"PipelinePrimaryTopicReference"));throw this.raise(O.PipeTopicUnconfiguredToken,o,{token:Pe(y)})}testTopicReferenceConfiguration(f,o,d){switch(f){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Pe(d)}]);case"smart":return d===27;default:throw this.raise(O.PipeTopicRequiresHackPipes,o)}}parseAsyncArrowUnaryFunction(f){this.prodParam.enter(Fn(!0,this.prodParam.hasYield));const o=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(O.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(f,o,!0)}parseDo(f,o){this.expectPlugin("doExpressions"),o&&this.expectPlugin("asyncDoExpressions"),f.async=o,this.next();const d=this.state.labels;return this.state.labels=[],o?(this.prodParam.enter(2),f.body=this.parseBlock(),this.prodParam.exit()):f.body=this.parseBlock(),this.state.labels=d,this.finishNode(f,"DoExpression")}parseSuper(){const f=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper?this.optionFlags&16||this.raise(O.SuperNotAllowed,f):this.scope.allowSuper||this.optionFlags&16||this.raise(O.UnexpectedSuper,f),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(O.UnsupportedSuper,f),this.finishNode(f,"Super")}parsePrivateName(){const f=this.startNode(),o=this.startNodeAt(n(this.state.startLoc,1)),d=this.state.value;return this.next(),f.id=this.createIdentifier(o,d),this.finishNode(f,"PrivateName")}parseFunctionOrFunctionSent(){const f=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){const o=this.createIdentifier(this.startNodeAtNode(f),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(f,o,"sent")}return this.parseFunction(f)}parseMetaProperty(f,o,d){f.meta=o;const y=this.state.containsEsc;return f.property=this.parseIdentifier(!0),(f.property.name!==d||y)&&this.raise(O.UnsupportedMetaProperty,f.property,{target:o.name,onlyValidPropertyName:d}),this.finishNode(f,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(f){if(this.next(),this.isContextual(105)||this.isContextual(97)){const o=this.isContextual(105);return this.expectPlugin(o?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),f.phase=o?"source":"defer",this.parseImportCall(f)}else{const o=this.createIdentifierAt(this.startNodeAtNode(f),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(O.ImportMetaOutsideModule,o),this.sawUnambiguousESM=!0),this.parseMetaProperty(f,o,"meta")}}parseLiteralAtNode(f,o,d){return this.addExtra(d,"rawValue",f),this.addExtra(d,"raw",this.input.slice(this.offsetToSourcePos(d.start),this.state.end)),d.value=f,this.next(),this.finishNode(d,o)}parseLiteral(f,o){const d=this.startNode();return this.parseLiteralAtNode(f,o,d)}parseStringLiteral(f){return this.parseLiteral(f,"StringLiteral")}parseNumericLiteral(f){return this.parseLiteral(f,"NumericLiteral")}parseBigIntLiteral(f){return this.parseLiteral(f,"BigIntLiteral")}parseDecimalLiteral(f){return this.parseLiteral(f,"DecimalLiteral")}parseRegExpLiteral(f){const o=this.startNode();return this.addExtra(o,"raw",this.input.slice(this.offsetToSourcePos(o.start),this.state.end)),o.pattern=f.pattern,o.flags=f.flags,this.next(),this.finishNode(o,"RegExpLiteral")}parseBooleanLiteral(f){const o=this.startNode();return o.value=f,this.next(),this.finishNode(o,"BooleanLiteral")}parseNullLiteral(){const f=this.startNode();return this.next(),this.finishNode(f,"NullLiteral")}parseParenAndDistinguishExpression(f){const o=this.state.startLoc;let d;this.next(),this.expressionScope.enter(CP());const y=this.state.maybeInArrowParameters,T=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;const N=this.state.startLoc,z=[],U=new Pl;let W=!0,ee,pe;for(;!this.match(11);){if(W)W=!1;else if(this.expect(12,U.optionalParametersLoc===null?null:U.optionalParametersLoc),this.match(11)){pe=this.state.startLoc;break}if(this.match(21)){const Be=this.state.startLoc;if(ee=this.state.startLoc,z.push(this.parseParenItem(this.parseRestBinding(),Be)),!this.checkCommaAfterRest(41))break}else z.push(this.parseMaybeAssignAllowInOrVoidPattern(11,U,this.parseParenItem))}const Ee=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=y,this.state.inFSharpPipelineDirectBody=T;let Ae=this.startNodeAt(o);return f&&this.shouldParseArrow(z)&&(Ae=this.parseArrow(Ae))?(this.checkDestructuringPrivate(U),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(Ae,z,!1),Ae):(this.expressionScope.exit(),z.length||this.unexpected(this.state.lastTokStartLoc),pe&&this.unexpected(pe),ee&&this.unexpected(ee),this.checkExpressionErrors(U,!0),this.toReferencedListDeep(z,!0),z.length>1?(d=this.startNodeAt(N),d.expressions=z,this.finishNode(d,"SequenceExpression"),this.resetEndLocation(d,Ee)):d=z[0],this.wrapParenthesis(o,d))}wrapParenthesis(f,o){if(!(this.optionFlags&1024))return this.addExtra(o,"parenthesized",!0),this.addExtra(o,"parenStart",f.index),this.takeSurroundingComments(o,f.index,this.state.lastTokEndLoc.index),o;const d=this.startNodeAt(f);return d.expression=o,this.finishNode(d,"ParenthesizedExpression")}shouldParseArrow(f){return!this.canInsertSemicolon()}parseArrow(f){if(this.eat(19))return f}parseParenItem(f,o){return f}parseNewOrNewTarget(){const f=this.startNode();if(this.next(),this.match(16)){const o=this.createIdentifier(this.startNodeAtNode(f),"new");this.next();const d=this.parseMetaProperty(f,o,"target");return this.scope.allowNewTarget||this.raise(O.UnexpectedNewTarget,d),d}return this.parseNew(f)}parseNew(f){if(this.parseNewCallee(f),this.eat(10)){const o=this.parseExprList(11);this.toReferencedList(o),f.arguments=o}else f.arguments=[];return this.finishNode(f,"NewExpression")}parseNewCallee(f){const o=this.match(83),d=this.parseNoCallExpr();f.callee=d,o&&(d.type==="Import"||d.type==="ImportExpression")&&this.raise(O.ImportCallNotNewExpression,d)}parseTemplateElement(f){const{start:o,startLoc:d,end:y,value:T}=this.state,N=o+1,z=this.startNodeAt(n(d,1));T===null&&(f||this.raise(O.InvalidEscapeSequenceTemplate,n(this.state.firstInvalidTemplateEscapePos,1)));const U=this.match(24),W=U?-1:-2,ee=y+W;z.value={raw:this.input.slice(N,ee).replace(/\r\n?/g,`
|
|
151
|
+
`),cooked:T===null?null:T.slice(1,W)},z.tail=U,this.next();const pe=this.finishNode(z,"TemplateElement");return this.resetEndLocation(pe,n(this.state.lastTokEndLoc,W)),pe}parseTemplate(f){const o=this.startNode();let d=this.parseTemplateElement(f);const y=[d],T=[];for(;!d.tail;)T.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),y.push(d=this.parseTemplateElement(f));return o.expressions=T,o.quasis=y,this.finishNode(o,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(f,o,d,y){d&&this.expectPlugin("recordAndTuple");const T=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let N=!1,z=!0;const U=this.startNode();for(U.properties=[],this.next();!this.match(f);){if(z)z=!1;else if(this.expect(12),this.match(f)){this.addTrailingCommaExtraToNode(U);break}let ee;o?ee=this.parseBindingProperty():(ee=this.parsePropertyDefinition(y),N=this.checkProto(ee,d,N,y)),d&&!this.isObjectProperty(ee)&&ee.type!=="SpreadElement"&&this.raise(O.InvalidRecordProperty,ee),ee.shorthand&&this.addExtra(ee,"shorthand",!0),U.properties.push(ee)}this.next(),this.state.inFSharpPipelineDirectBody=T;let W="ObjectExpression";return o?W="ObjectPattern":d&&(W="RecordExpression"),this.finishNode(U,W)}addTrailingCommaExtraToNode(f){this.addExtra(f,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(f,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(f){return!f.computed&&f.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(f){let o=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(O.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());const d=this.startNode();let y=!1,T=!1,N;if(this.match(21))return o.length&&this.unexpected(),this.parseSpread();o.length&&(d.decorators=o,o=[]),d.method=!1,f&&(N=this.state.startLoc);let z=this.eat(55);this.parsePropertyNamePrefixOperator(d);const U=this.state.containsEsc;if(this.parsePropertyName(d,f),!z&&!U&&this.maybeAsyncOrAccessorProp(d)){const{key:W}=d,ee=W.name;ee==="async"&&!this.hasPrecedingLineBreak()&&(y=!0,this.resetPreviousNodeTrailingComments(W),z=this.eat(55),this.parsePropertyName(d)),(ee==="get"||ee==="set")&&(T=!0,this.resetPreviousNodeTrailingComments(W),d.kind=ee,this.match(55)&&(z=!0,this.raise(O.AccessorIsGenerator,this.state.curPosition(),{kind:ee}),this.next()),this.parsePropertyName(d))}return this.parseObjPropValue(d,N,z,y,!1,T,f)}getGetterSetterExpectedParamCount(f){return f.kind==="get"?0:1}getObjectOrClassMethodParams(f){return f.params}checkGetterSetterParams(f){var o;const d=this.getGetterSetterExpectedParamCount(f),y=this.getObjectOrClassMethodParams(f);y.length!==d&&this.raise(f.kind==="get"?O.BadGetterArity:O.BadSetterArity,f),f.kind==="set"&&((o=y[y.length-1])==null?void 0:o.type)==="RestElement"&&this.raise(O.BadSetterRestParameter,f)}parseObjectMethod(f,o,d,y,T){if(T){const N=this.parseMethod(f,o,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(N),N}if(d||o||this.match(10))return y&&this.unexpected(),f.kind="method",f.method=!0,this.parseMethod(f,o,d,!1,!1,"ObjectMethod")}parseObjectProperty(f,o,d,y){if(f.shorthand=!1,this.eat(14))return f.value=d?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,y),this.finishObjectProperty(f);if(!f.computed&&f.key.type==="Identifier"){if(this.checkReservedWord(f.key.name,f.key.loc.start,!0,!1),d)f.value=this.parseMaybeDefault(o,this.cloneIdentifier(f.key));else if(this.match(29)){const T=this.state.startLoc;y!=null?y.shorthandAssignLoc===null&&(y.shorthandAssignLoc=T):this.raise(O.InvalidCoverInitializedName,T),f.value=this.parseMaybeDefault(o,this.cloneIdentifier(f.key))}else f.value=this.cloneIdentifier(f.key);return f.shorthand=!0,this.finishObjectProperty(f)}}finishObjectProperty(f){return this.finishNode(f,"ObjectProperty")}parseObjPropValue(f,o,d,y,T,N,z){const U=this.parseObjectMethod(f,d,y,T,N)||this.parseObjectProperty(f,o,T,z);return U||this.unexpected(),U}parsePropertyName(f,o){if(this.eat(0))f.computed=!0,f.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{const{type:d,value:y}=this.state;let T;if(ke(d))T=this.parseIdentifier(!0);else switch(d){case 135:T=this.parseNumericLiteral(y);break;case 134:T=this.parseStringLiteral(y);break;case 136:T=this.parseBigIntLiteral(y);break;case 139:{const N=this.state.startLoc;o!=null?o.privateKeyLoc===null&&(o.privateKeyLoc=N):this.raise(O.UnexpectedPrivateField,N),T=this.parsePrivateName();break}default:if(d===137){T=this.parseDecimalLiteral(y);break}this.unexpected()}f.key=T,d!==139&&(f.computed=!1)}}initFunction(f,o){f.id=null,f.generator=!1,f.async=o}parseMethod(f,o,d,y,T,N,z=!1){this.initFunction(f,d),f.generator=o,this.scope.enter(530|(z?576:0)|(T?32:0)),this.prodParam.enter(Fn(d,f.generator)),this.parseFunctionParams(f,y);const U=this.parseFunctionBodyAndFinish(f,N,!0);return this.prodParam.exit(),this.scope.exit(),U}parseArrayLike(f,o,d){o&&this.expectPlugin("recordAndTuple");const y=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;const T=this.startNode();return this.next(),T.elements=this.parseExprList(f,!o,d,T),this.state.inFSharpPipelineDirectBody=y,this.finishNode(T,o?"TupleExpression":"ArrayExpression")}parseArrowExpression(f,o,d,y){this.scope.enter(518);let T=Fn(d,!1);!this.match(5)&&this.prodParam.hasIn&&(T|=8),this.prodParam.enter(T),this.initFunction(f,d);const N=this.state.maybeInArrowParameters;return o&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(f,o,y)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(f,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=N,this.finishNode(f,"ArrowFunctionExpression")}setArrowFunctionParameters(f,o,d){this.toAssignableList(o,d,!1),f.params=o}parseFunctionBodyAndFinish(f,o,d=!1){return this.parseFunctionBody(f,!1,d),this.finishNode(f,o)}parseFunctionBody(f,o,d=!1){const y=o&&!this.match(5);if(this.expressionScope.enter(mm()),y)f.body=this.parseMaybeAssign(),this.checkParams(f,!1,o,!1);else{const T=this.state.strict,N=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),f.body=this.parseBlock(!0,!1,z=>{const U=!this.isSimpleParamList(f.params);z&&U&&this.raise(O.IllegalLanguageModeDirective,(f.kind==="method"||f.kind==="constructor")&&f.key?f.key.loc.end:f);const W=!T&&this.state.strict;this.checkParams(f,!this.state.strict&&!o&&!d&&!U,o,W),this.state.strict&&f.id&&this.checkIdentifier(f.id,65,W)}),this.prodParam.exit(),this.state.labels=N}this.expressionScope.exit()}isSimpleParameter(f){return f.type==="Identifier"}isSimpleParamList(f){for(let o=0,d=f.length;o<d;o++)if(!this.isSimpleParameter(f[o]))return!1;return!0}checkParams(f,o,d,y=!0){const T=!o&&new Set,N={type:"FormalParameters"};for(const z of f.params)this.checkLVal(z,N,5,T,y)}parseExprList(f,o,d,y){const T=[];let N=!0;for(;!this.eat(f);){if(N)N=!1;else if(this.expect(12),this.match(f)){y&&this.addTrailingCommaExtraToNode(y),this.next();break}T.push(this.parseExprListItem(f,o,d))}return T}parseExprListItem(f,o,d,y){let T;if(this.match(12))o||this.raise(O.UnexpectedToken,this.state.curPosition(),{unexpected:","}),T=null;else if(this.match(21)){const N=this.state.startLoc;T=this.parseParenItem(this.parseSpread(d),N)}else if(this.match(17)){this.expectPlugin("partialApplication"),y||this.raise(O.UnexpectedArgumentPlaceholder,this.state.startLoc);const N=this.startNode();this.next(),T=this.finishNode(N,"ArgumentPlaceholder")}else T=this.parseMaybeAssignAllowInOrVoidPattern(f,d,this.parseParenItem);return T}parseIdentifier(f){const o=this.startNode(),d=this.parseIdentifierName(f);return this.createIdentifier(o,d)}createIdentifier(f,o){return f.name=o,f.loc.identifierName=o,this.finishNode(f,"Identifier")}createIdentifierAt(f,o,d){return f.name=o,f.loc.identifierName=o,this.finishNodeAt(f,"Identifier",d)}parseIdentifierName(f){let o;const{startLoc:d,type:y}=this.state;ke(y)?o=this.state.value:this.unexpected();const T=Re(y);return f?T&&this.replaceToken(132):this.checkReservedWord(o,d,T,!1),this.next(),o}checkReservedWord(f,o,d,y){if(f.length>10||!ml(f))return;if(d&&pr(f)){this.raise(O.UnexpectedKeyword,o,{keyword:f});return}if((this.state.strict?y?$t:Ce:ge)(f,this.inModule)){this.raise(O.UnexpectedReservedWord,o,{reservedWord:f});return}else if(f==="yield"){if(this.prodParam.hasYield){this.raise(O.YieldBindingIdentifier,o);return}}else if(f==="await"){if(this.prodParam.hasAwait){this.raise(O.AwaitBindingIdentifier,o);return}if(this.scope.inStaticBlock){this.raise(O.AwaitBindingIdentifierInStaticBlock,o);return}this.expressionScope.recordAsyncArrowParametersError(o)}else if(f==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(O.ArgumentsInClass,o);return}}recordAwaitIfAllowed(){const f=this.prodParam.hasAwait;return f&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),f}parseAwait(f){const o=this.startNodeAt(f);return this.expressionScope.recordParameterInitializerError(O.AwaitExpressionFormalParameter,o),this.eat(55)&&this.raise(O.ObsoleteAwaitStar,o),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(o.argument=this.parseMaybeUnary(null,!0)),this.finishNode(o,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;const{type:f}=this.state;return f===53||f===10||f===0||Tt(f)||f===102&&!this.state.containsEsc||f===138||f===56||this.hasPlugin("v8intrinsic")&&f===54}parseYield(f){const o=this.startNodeAt(f);this.expressionScope.recordParameterInitializerError(O.YieldInParameter,o);let d=!1,y=null;if(!this.hasPrecedingLineBreak())switch(d=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!d)break;default:y=this.parseMaybeAssign()}return o.delegate=d,o.argument=y,this.finishNode(o,"YieldExpression")}parseImportCall(f){if(this.next(),f.source=this.parseMaybeAssignAllowIn(),f.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(f.source);else if(f.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(f.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(O.ImportCallArity,f)}}return this.expect(11),this.finishNode(f,"ImportExpression")}checkPipelineAtInfixOperator(f,o){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&f.type==="SequenceExpression"&&this.raise(O.PipelineHeadSequenceExpression,o)}parseSmartPipelineBodyInStyle(f,o){if(this.isSimpleReference(f)){const d=this.startNodeAt(o);return d.callee=f,this.finishNode(d,"PipelineBareFunction")}else{const d=this.startNodeAt(o);return this.checkSmartPipeTopicBodyEarlyErrors(o),d.expression=f,this.finishNode(d,"PipelineTopicExpression")}}isSimpleReference(f){switch(f.type){case"MemberExpression":return!f.computed&&this.isSimpleReference(f.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(f){if(this.match(19))throw this.raise(O.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(O.PipelineTopicUnused,f)}withTopicBindingContext(f){const o=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return f()}finally{this.state.topicContext=o}}withSmartMixTopicForbiddingContext(f){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){const o=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return f()}finally{this.state.topicContext=o}}else return f()}withSoloAwaitPermittingContext(f){const o=this.state.soloAwait;this.state.soloAwait=!0;try{return f()}finally{this.state.soloAwait=o}}allowInAnd(f){const o=this.prodParam.currentFlags();if(8&~o){this.prodParam.enter(o|8);try{return f()}finally{this.prodParam.exit()}}return f()}disallowInAnd(f){const o=this.prodParam.currentFlags();if(8&o){this.prodParam.enter(o&-9);try{return f()}finally{this.prodParam.exit()}}return f()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(f){const o=this.state.startLoc;this.state.potentialArrowAt=this.state.start;const d=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;const y=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),o,f);return this.state.inFSharpPipelineDirectBody=d,y}parseModuleExpression(){this.expectPlugin("moduleBlocks");const f=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);const o=this.startNodeAt(this.state.endLoc);this.next();const d=this.initializeScopes(!0);this.enterInitialScopes();try{f.body=this.parseProgram(o,8,"module")}finally{d()}return this.finishNode(f,"ModuleExpression")}parseVoidPattern(f){this.expectPlugin("discardBinding");const o=this.startNode();return f!=null&&(f.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(o,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(f,o,d){if(o!=null&&this.match(88)){const y=this.lookaheadCharCode();if(y===44||y===(f===3?93:f===8?125:41)||y===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(o))}return this.parseMaybeAssignAllowIn(o,d)}parsePropertyNamePrefixOperator(f){}}const hh={kind:1},jP={kind:2},ZP=/[\uD800-\uDFFF]/u,fh=/in(?:stanceof)?/y;function VP(_,f,o){for(let d=0;d<_.length;d++){const y=_[d],{type:T}=y;if(typeof T=="number"){if(T===139){const{loc:N,start:z,value:U,end:W}=y,ee=z+1,pe=n(N.start,1);_.splice(d,1,new Rn({type:Je(27),value:"#",start:z,end:ee,startLoc:N.start,endLoc:pe}),new Rn({type:Je(132),value:U,start:ee,end:W,startLoc:pe,endLoc:N.end})),d++;continue}if(Tt(T)){const{loc:N,start:z,value:U,end:W}=y,ee=z+1,pe=n(N.start,1);let Ee;f.charCodeAt(z-o)===96?Ee=new Rn({type:Je(22),value:"`",start:z,end:ee,startLoc:N.start,endLoc:pe}):Ee=new Rn({type:Je(8),value:"}",start:z,end:ee,startLoc:N.start,endLoc:pe});let Ae,Be,st,Ot;T===24?(Be=W-1,st=n(N.end,-1),Ae=U===null?null:U.slice(1,-1),Ot=new Rn({type:Je(22),value:"`",start:Be,end:W,startLoc:st,endLoc:N.end})):(Be=W-2,st=n(N.end,-2),Ae=U===null?null:U.slice(1,-2),Ot=new Rn({type:Je(23),value:"${",start:Be,end:W,startLoc:st,endLoc:N.end})),_.splice(d,1,Ee,new Rn({type:Je(20),value:Ae,start:ee,end:Be,startLoc:pe,endLoc:st}),Ot),d+=2;continue}y.type=Je(T)}}return _}class UP extends XP{parseTopLevel(f,o){return f.program=this.parseProgram(o,140,this.options.sourceType==="module"?"module":"script"),f.comments=this.comments,this.optionFlags&256&&(f.tokens=VP(this.tokens,this.input,this.startIndex)),this.finishNode(f,"File")}parseProgram(f,o,d){if(f.sourceType=d,f.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(f,!0,!0,o),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(const[T,N]of Array.from(this.scope.undefinedExports))this.raise(O.ModuleExportUndefined,N,{localName:T});this.addExtra(f,"topLevelAwait",this.state.hasTopLevelAwait)}let y;return o===140?y=this.finishNode(f,"Program"):y=this.finishNodeAt(f,"Program",n(this.state.startLoc,-1)),y}stmtToDirective(f){const o=this.castNodeTo(f,"Directive"),d=this.castNodeTo(f.expression,"DirectiveLiteral"),y=d.value,T=this.input.slice(this.offsetToSourcePos(d.start),this.offsetToSourcePos(d.end)),N=d.value=T.slice(1,-1);return this.addExtra(d,"raw",T),this.addExtra(d,"rawValue",N),this.addExtra(d,"expressionValue",y),o.value=d,delete f.expression,o}parseInterpreterDirective(){if(!this.match(28))return null;const f=this.startNode();return f.value=this.state.value,this.next(),this.finishNode(f,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(107)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(107))return!1;const f=this.nextTokenInLineStart(),o=this.codePointAtPos(f);if(this.isUnparsedContextual(f,"of")){const d=this.lookaheadCharCodeSince(f+2);if(d!==61&&d!==58&&d!==59)return!1}return!!(this.chStartsBindingIdentifier(o,f)||this.isUnparsedContextual(f,"void"))}nextTokenIsIdentifierOnSameLine(){const f=this.nextTokenInLineStart(),o=this.codePointAtPos(f);return this.chStartsBindingIdentifier(o,f)}isAwaitUsing(){if(!this.isContextual(96))return!1;let f=this.nextTokenInLineStart();if(this.isUnparsedContextual(f,"using")){f=this.nextTokenInLineStartSince(f+5);const o=this.codePointAtPos(f);if(this.chStartsBindingIdentifier(o,f))return!0}return!1}chStartsBindingIdentifier(f,o){if(zt(f)){if(fh.lastIndex=o,fh.test(this.input)){const d=this.codePointAtPos(fh.lastIndex);if(!ti(d)&&d!==92)return!1}return!0}else return f===92}chStartsBindingPattern(f){return f===91||f===123}hasFollowingBindingAtom(){const f=this.nextTokenStart(),o=this.codePointAtPos(f);return this.chStartsBindingPattern(o)||this.chStartsBindingIdentifier(o,f)}hasInLineFollowingBindingIdentifierOrBrace(){const f=this.nextTokenInLineStart(),o=this.codePointAtPos(f);return o===123||this.chStartsBindingIdentifier(o,f)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(f=!1){let o=0;return this.options.annexB&&!this.state.strict&&(o|=4,f&&(o|=8)),this.parseStatementLike(o)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(f){let o=null;return this.match(26)&&(o=this.parseDecorators(!0)),this.parseStatementContent(f,o)}parseStatementContent(f,o){const d=this.state.type,y=this.startNode(),T=!!(f&2),N=!!(f&4),z=f&1;switch(d){case 60:return this.parseBreakContinueStatement(y,!0);case 63:return this.parseBreakContinueStatement(y,!1);case 64:return this.parseDebuggerStatement(y);case 90:return this.parseDoWhileStatement(y);case 91:return this.parseForStatement(y);case 68:if(this.lookaheadCharCode()===46)break;return N||this.raise(this.state.strict?O.StrictFunction:this.options.annexB?O.SloppyFunctionAnnexB:O.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(y,!1,!T&&N);case 80:return T||this.unexpected(),this.parseClass(this.maybeTakeDecorators(o,y),!0);case 69:return this.parseIfStatement(y);case 70:return this.parseReturnStatement(y);case 71:return this.parseSwitchStatement(y);case 72:return this.parseThrowStatement(y);case 73:return this.parseTryStatement(y);case 96:if(this.isAwaitUsing())return this.allowsUsing()?T?this.recordAwaitIfAllowed()||this.raise(O.AwaitUsingNotInAsyncContext,y):this.raise(O.UnexpectedLexicalDeclaration,y):this.raise(O.UnexpectedUsingDeclaration,y),this.next(),this.parseVarStatement(y,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?T||this.raise(O.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(O.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(y,"using");case 100:{if(this.state.containsEsc)break;const ee=this.nextTokenStart(),pe=this.codePointAtPos(ee);if(pe!==91&&(!T&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(pe,ee)&&pe!==123))break}case 75:T||this.raise(O.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{const ee=this.state.value;return this.parseVarStatement(y,ee)}case 92:return this.parseWhileStatement(y);case 76:return this.parseWithStatement(y);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(y);case 83:{const ee=this.lookaheadCharCode();if(ee===40||ee===46)break}case 82:{!(this.optionFlags&8)&&!z&&this.raise(O.UnexpectedImportExport,this.state.startLoc),this.next();let ee;return d===83?ee=this.parseImport(y):ee=this.parseExport(y,o),this.assertModuleNodeAllowed(ee),ee}default:if(this.isAsyncFunction())return T||this.raise(O.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(y,!0,!T&&N)}const U=this.state.value,W=this.parseExpression();return xe(d)&&W.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(y,U,W,f):this.parseExpressionStatement(y,W,o)}assertModuleNodeAllowed(f){!(this.optionFlags&8)&&!this.inModule&&this.raise(O.ImportOutsideModule,f)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(f,o,d){if(f){var y;(y=o.decorators)!=null&&y.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(O.DecoratorsBeforeAfterExport,o.decorators[0]),o.decorators.unshift(...f)):o.decorators=f,this.resetStartLocationFromNode(o,f[0]),d&&this.resetStartLocationFromNode(d,o)}return o}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(f){const o=[];do o.push(this.parseDecorator());while(this.match(26));if(this.match(82))f||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(O.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(O.UnexpectedLeadingDecorator,this.state.startLoc);return o}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);const f=this.startNode();if(this.next(),this.hasPlugin("decorators")){const o=this.state.startLoc;let d;if(this.match(10)){const y=this.state.startLoc;this.next(),d=this.parseExpression(),this.expect(11),d=this.wrapParenthesis(y,d);const T=this.state.startLoc;f.expression=this.parseMaybeDecoratorArguments(d,y),this.getPluginOption("decorators","allowCallParenthesized")===!1&&f.expression!==d&&this.raise(O.DecoratorArgumentsOutsideParentheses,T)}else{for(d=this.parseIdentifier(!1);this.eat(16);){const y=this.startNodeAt(o);y.object=d,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),y.property=this.parsePrivateName()):y.property=this.parseIdentifier(!0),y.computed=!1,d=this.finishNode(y,"MemberExpression")}f.expression=this.parseMaybeDecoratorArguments(d,o)}}else f.expression=this.parseExprSubscripts();return this.finishNode(f,"Decorator")}parseMaybeDecoratorArguments(f,o){if(this.eat(10)){const d=this.startNodeAt(o);return d.callee=f,d.arguments=this.parseCallExpressionArguments(),this.toReferencedList(d.arguments),this.finishNode(d,"CallExpression")}return f}parseBreakContinueStatement(f,o){return this.next(),this.isLineTerminator()?f.label=null:(f.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(f,o),this.finishNode(f,o?"BreakStatement":"ContinueStatement")}verifyBreakContinue(f,o){let d;for(d=0;d<this.state.labels.length;++d){const y=this.state.labels[d];if((f.label==null||y.name===f.label.name)&&(y.kind!=null&&(o||y.kind===1)||f.label&&o))break}if(d===this.state.labels.length){const y=o?"BreakStatement":"ContinueStatement";this.raise(O.IllegalBreakContinue,f,{type:y})}}parseDebuggerStatement(f){return this.next(),this.semicolon(),this.finishNode(f,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);const f=this.parseExpression();return this.expect(11),f}parseDoWhileStatement(f){return this.next(),this.state.labels.push(hh),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),f.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(f,"DoWhileStatement")}parseForStatement(f){this.next(),this.state.labels.push(hh);let o=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(o=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return o!==null&&this.unexpected(o),this.parseFor(f,null);const d=this.isContextual(100);{const U=this.isAwaitUsing(),W=U||this.isForUsing(),ee=d&&this.hasFollowingBindingAtom()||W;if(this.match(74)||this.match(75)||ee){const pe=this.startNode();let Ee;U?(Ee="await using",this.recordAwaitIfAllowed()||this.raise(O.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):Ee=this.state.value,this.next(),this.parseVar(pe,!0,Ee);const Ae=this.finishNode(pe,"VariableDeclaration"),Be=this.match(58);return Be&&W&&this.raise(O.ForInUsing,Ae),(Be||this.isContextual(102))&&Ae.declarations.length===1?this.parseForIn(f,Ae,o):(o!==null&&this.unexpected(o),this.parseFor(f,Ae))}}const y=this.isContextual(95),T=new Pl,N=this.parseExpression(!0,T),z=this.isContextual(102);if(z&&(d&&this.raise(O.ForOfLet,N),o===null&&y&&N.type==="Identifier"&&this.raise(O.ForOfAsync,N)),z||this.match(58)){this.checkDestructuringPrivate(T),this.toAssignable(N,!0);const U=z?"ForOfStatement":"ForInStatement";return this.checkLVal(N,{type:U}),this.parseForIn(f,N,o)}else this.checkExpressionErrors(T,!0);return o!==null&&this.unexpected(o),this.parseFor(f,N)}parseFunctionStatement(f,o,d){return this.next(),this.parseFunction(f,1|(d?2:0)|(o?8:0))}parseIfStatement(f){return this.next(),f.test=this.parseHeaderExpression(),f.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),f.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(f,"IfStatement")}parseReturnStatement(f){return this.prodParam.hasReturn||this.raise(O.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?f.argument=null:(f.argument=this.parseExpression(),this.semicolon()),this.finishNode(f,"ReturnStatement")}parseSwitchStatement(f){this.next(),f.discriminant=this.parseHeaderExpression();const o=f.cases=[];this.expect(5),this.state.labels.push(jP),this.scope.enter(256);let d;for(let y;!this.match(8);)if(this.match(61)||this.match(65)){const T=this.match(61);d&&this.finishNode(d,"SwitchCase"),o.push(d=this.startNode()),d.consequent=[],this.next(),T?d.test=this.parseExpression():(y&&this.raise(O.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),y=!0,d.test=null),this.expect(14)}else d?d.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),d&&this.finishNode(d,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(f,"SwitchStatement")}parseThrowStatement(f){return this.next(),this.hasPrecedingLineBreak()&&this.raise(O.NewlineAfterThrow,this.state.lastTokEndLoc),f.argument=this.parseExpression(),this.semicolon(),this.finishNode(f,"ThrowStatement")}parseCatchClauseParam(){const f=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&f.type==="Identifier"?8:0),this.checkLVal(f,{type:"CatchClause"},9),f}parseTryStatement(f){if(this.next(),f.block=this.parseBlock(),f.handler=null,this.match(62)){const o=this.startNode();this.next(),this.match(10)?(this.expect(10),o.param=this.parseCatchClauseParam(),this.expect(11)):(o.param=null,this.scope.enter(0)),o.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),f.handler=this.finishNode(o,"CatchClause")}return f.finalizer=this.eat(67)?this.parseBlock():null,!f.handler&&!f.finalizer&&this.raise(O.NoCatchOrFinally,f),this.finishNode(f,"TryStatement")}parseVarStatement(f,o,d=!1){return this.next(),this.parseVar(f,!1,o,d),this.semicolon(),this.finishNode(f,"VariableDeclaration")}parseWhileStatement(f){return this.next(),f.test=this.parseHeaderExpression(),this.state.labels.push(hh),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(f,"WhileStatement")}parseWithStatement(f){return this.state.strict&&this.raise(O.StrictWith,this.state.startLoc),this.next(),f.object=this.parseHeaderExpression(),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(f,"WithStatement")}parseEmptyStatement(f){return this.next(),this.finishNode(f,"EmptyStatement")}parseLabeledStatement(f,o,d,y){for(const N of this.state.labels)N.name===o&&this.raise(O.LabelRedeclaration,d,{labelName:o});const T=J(this.state.type)?1:this.match(71)?2:null;for(let N=this.state.labels.length-1;N>=0;N--){const z=this.state.labels[N];if(z.statementStart===f.start)z.statementStart=this.sourceToOffsetPos(this.state.start),z.kind=T;else break}return this.state.labels.push({name:o,kind:T,statementStart:this.sourceToOffsetPos(this.state.start)}),f.body=y&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),f.label=d,this.finishNode(f,"LabeledStatement")}parseExpressionStatement(f,o,d){return f.expression=o,this.semicolon(),this.finishNode(f,"ExpressionStatement")}parseBlock(f=!1,o=!0,d){const y=this.startNode();return f&&this.state.strictErrors.clear(),this.expect(5),o&&this.scope.enter(0),this.parseBlockBody(y,f,!1,8,d),o&&this.scope.exit(),this.finishNode(y,"BlockStatement")}isValidDirective(f){return f.type==="ExpressionStatement"&&f.expression.type==="StringLiteral"&&!f.expression.extra.parenthesized}parseBlockBody(f,o,d,y,T){const N=f.body=[],z=f.directives=[];this.parseBlockOrModuleBlockBody(N,o?z:void 0,d,y,T)}parseBlockOrModuleBlockBody(f,o,d,y,T){const N=this.state.strict;let z=!1,U=!1;for(;!this.match(y);){const W=d?this.parseModuleItem():this.parseStatementListItem();if(o&&!U){if(this.isValidDirective(W)){const ee=this.stmtToDirective(W);o.push(ee),!z&&ee.value.value==="use strict"&&(z=!0,this.setStrict(!0));continue}U=!0,this.state.strictErrors.clear()}f.push(W)}T?.call(this,z),N||this.setStrict(!1),this.next()}parseFor(f,o){return f.init=o,this.semicolon(!1),f.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),f.update=this.match(11)?null:this.parseExpression(),this.expect(11),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(f,"ForStatement")}parseForIn(f,o,d){const y=this.match(58);return this.next(),y?d!==null&&this.unexpected(d):f.await=d!==null,o.type==="VariableDeclaration"&&o.declarations[0].init!=null&&(!y||!this.options.annexB||this.state.strict||o.kind!=="var"||o.declarations[0].id.type!=="Identifier")&&this.raise(O.ForInOfLoopInitializer,o,{type:y?"ForInStatement":"ForOfStatement"}),o.type==="AssignmentPattern"&&this.raise(O.InvalidLhs,o,{ancestor:{type:"ForStatement"}}),f.left=o,f.right=y?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),f.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(f,y?"ForInStatement":"ForOfStatement")}parseVar(f,o,d,y=!1){const T=f.declarations=[];for(f.kind=d;;){const N=this.startNode();if(this.parseVarId(N,d),N.init=this.eat(29)?o?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,N.init===null&&!y&&(N.id.type!=="Identifier"&&!(o&&(this.match(58)||this.isContextual(102)))?this.raise(O.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(d==="const"||d==="using"||d==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(O.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:d})),T.push(this.finishNode(N,"VariableDeclarator")),!this.eat(12))break}return f}parseVarId(f,o){const d=this.parseBindingAtom();o==="using"||o==="await using"?(d.type==="ArrayPattern"||d.type==="ObjectPattern")&&this.raise(O.UsingDeclarationHasBindingPattern,d.loc.start):d.type==="VoidPattern"&&this.raise(O.UnexpectedVoidPattern,d.loc.start),this.checkLVal(d,{type:"VariableDeclarator"},o==="var"?5:8201),f.id=d}parseAsyncFunctionExpression(f){return this.parseFunction(f,8)}parseFunction(f,o=0){const d=o&2,y=!!(o&1),T=y&&!(o&4),N=!!(o&8);this.initFunction(f,N),this.match(55)&&(d&&this.raise(O.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),f.generator=!0),y&&(f.id=this.parseFunctionId(T));const z=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(Fn(N,f.generator)),y||(f.id=this.parseFunctionId()),this.parseFunctionParams(f,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(f,y?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),y&&!d&&this.registerFunctionStatementId(f),this.state.maybeInArrowParameters=z,f}parseFunctionId(f){return f||xe(this.state.type)?this.parseIdentifier():null}parseFunctionParams(f,o){this.expect(10),this.expressionScope.enter(TP()),f.params=this.parseBindingList(11,41,2|(o?4:0)),this.expressionScope.exit()}registerFunctionStatementId(f){f.id&&this.scope.declareName(f.id.name,!this.options.annexB||this.state.strict||f.generator||f.async?this.scope.treatFunctionsAsVar?5:8201:17,f.id.loc.start)}parseClass(f,o,d){this.next();const y=this.state.strict;return this.state.strict=!0,this.parseClassId(f,o,d),this.parseClassSuper(f),f.body=this.parseClassBody(!!f.superClass,y),this.finishNode(f,o?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(f){return f.type==="Identifier"&&f.name==="constructor"||f.type==="StringLiteral"&&f.value==="constructor"}isNonstaticConstructor(f){return!f.computed&&!f.static&&this.nameIsConstructor(f.key)}parseClassBody(f,o){this.classScope.enter();const d={hadConstructor:!1,hadSuperClass:f};let y=[];const T=this.startNode();if(T.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(y.length>0)throw this.raise(O.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){y.push(this.parseDecorator());continue}const N=this.startNode();y.length&&(N.decorators=y,this.resetStartLocationFromNode(N,y[0]),y=[]),this.parseClassMember(T,N,d),N.kind==="constructor"&&N.decorators&&N.decorators.length>0&&this.raise(O.DecoratorConstructor,N)}}),this.state.strict=o,this.next(),y.length)throw this.raise(O.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(T,"ClassBody")}parseClassMemberFromModifier(f,o){const d=this.parseIdentifier(!0);if(this.isClassMethod()){const y=o;return y.kind="method",y.computed=!1,y.key=d,y.static=!1,this.pushClassMethod(f,y,!1,!1,!1,!1),!0}else if(this.isClassProperty()){const y=o;return y.computed=!1,y.key=d,y.static=!1,f.body.push(this.parseClassProperty(y)),!0}return this.resetPreviousNodeTrailingComments(d),!1}parseClassMember(f,o,d){const y=this.isContextual(106);if(y){if(this.parseClassMemberFromModifier(f,o))return;if(this.eat(5)){this.parseClassStaticBlock(f,o);return}}this.parseClassMemberWithIsStatic(f,o,d,y)}parseClassMemberWithIsStatic(f,o,d,y){const T=o,N=o,z=o,U=o,W=o,ee=T,pe=T;if(o.static=y,this.parsePropertyNamePrefixOperator(o),this.eat(55)){ee.kind="method";const Ye=this.match(139);if(this.parseClassElementName(ee),this.parsePostMemberNameModifiers(ee),Ye){this.pushClassPrivateMethod(f,N,!0,!1);return}this.isNonstaticConstructor(T)&&this.raise(O.ConstructorIsGenerator,T.key),this.pushClassMethod(f,T,!0,!1,!1,!1);return}const Ee=!this.state.containsEsc&&xe(this.state.type),Ae=this.parseClassElementName(o),Be=Ee?Ae.name:null,st=this.isPrivateName(Ae),Ot=this.state.startLoc;if(this.parsePostMemberNameModifiers(pe),this.isClassMethod()){if(ee.kind="method",st){this.pushClassPrivateMethod(f,N,!1,!1);return}const Ye=this.isNonstaticConstructor(T);let dt=!1;Ye&&(T.kind="constructor",d.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(O.DuplicateConstructor,Ae),Ye&&this.hasPlugin("typescript")&&o.override&&this.raise(O.OverrideOnConstructor,Ae),d.hadConstructor=!0,dt=d.hadSuperClass),this.pushClassMethod(f,T,!1,!1,Ye,dt)}else if(this.isClassProperty())st?this.pushClassPrivateProperty(f,U):this.pushClassProperty(f,z);else if(Be==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(Ae);const Ye=this.eat(55);pe.optional&&this.unexpected(Ot),ee.kind="method";const dt=this.match(139);this.parseClassElementName(ee),this.parsePostMemberNameModifiers(pe),dt?this.pushClassPrivateMethod(f,N,Ye,!0):(this.isNonstaticConstructor(T)&&this.raise(O.ConstructorIsAsync,T.key),this.pushClassMethod(f,T,Ye,!0,!1,!1))}else if((Be==="get"||Be==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(Ae),ee.kind=Be;const Ye=this.match(139);this.parseClassElementName(T),Ye?this.pushClassPrivateMethod(f,N,!1,!1):(this.isNonstaticConstructor(T)&&this.raise(O.ConstructorIsAccessor,T.key),this.pushClassMethod(f,T,!1,!1,!1,!1)),this.checkGetterSetterParams(T)}else if(Be==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(Ae);const Ye=this.match(139);this.parseClassElementName(z),this.pushClassAccessorProperty(f,W,Ye)}else this.isLineTerminator()?st?this.pushClassPrivateProperty(f,U):this.pushClassProperty(f,z):this.unexpected()}parseClassElementName(f){const{type:o,value:d}=this.state;if((o===132||o===134)&&f.static&&d==="prototype"&&this.raise(O.StaticPrototype,this.state.startLoc),o===139){d==="constructor"&&this.raise(O.ConstructorClassPrivateField,this.state.startLoc);const y=this.parsePrivateName();return f.key=y,y}return this.parsePropertyName(f),f.key}parseClassStaticBlock(f,o){var d;this.scope.enter(720);const y=this.state.labels;this.state.labels=[],this.prodParam.enter(0);const T=o.body=[];this.parseBlockOrModuleBlockBody(T,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=y,f.body.push(this.finishNode(o,"StaticBlock")),(d=o.decorators)!=null&&d.length&&this.raise(O.DecoratorStaticBlock,o)}pushClassProperty(f,o){!o.computed&&this.nameIsConstructor(o.key)&&this.raise(O.ConstructorClassField,o.key),f.body.push(this.parseClassProperty(o))}pushClassPrivateProperty(f,o){const d=this.parseClassPrivateProperty(o);f.body.push(d),this.classScope.declarePrivateName(this.getPrivateNameSV(d.key),0,d.key.loc.start)}pushClassAccessorProperty(f,o,d){!d&&!o.computed&&this.nameIsConstructor(o.key)&&this.raise(O.ConstructorClassField,o.key);const y=this.parseClassAccessorProperty(o);f.body.push(y),d&&this.classScope.declarePrivateName(this.getPrivateNameSV(y.key),0,y.key.loc.start)}pushClassMethod(f,o,d,y,T,N){f.body.push(this.parseMethod(o,d,y,T,N,"ClassMethod",!0))}pushClassPrivateMethod(f,o,d,y){const T=this.parseMethod(o,d,y,!1,!1,"ClassPrivateMethod",!0);f.body.push(T);const N=T.kind==="get"?T.static?6:2:T.kind==="set"?T.static?5:1:0;this.declareClassPrivateMethodInScope(T,N)}declareClassPrivateMethodInScope(f,o){this.classScope.declarePrivateName(this.getPrivateNameSV(f.key),o,f.key.loc.start)}parsePostMemberNameModifiers(f){}parseClassPrivateProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassPrivateProperty")}parseClassProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassProperty")}parseClassAccessorProperty(f){return this.parseInitializer(f),this.semicolon(),this.finishNode(f,"ClassAccessorProperty")}parseInitializer(f){this.scope.enter(592),this.expressionScope.enter(mm()),this.prodParam.enter(0),f.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(f,o,d,y=8331){if(xe(this.state.type))f.id=this.parseIdentifier(),o&&this.declareNameFromIdentifier(f.id,y);else if(d||!o)f.id=null;else throw this.raise(O.MissingClassName,this.state.startLoc)}parseClassSuper(f){f.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(f,o){const d=this.parseMaybeImportPhase(f,!0),y=this.maybeParseExportDefaultSpecifier(f,d),T=!y||this.eat(12),N=T&&this.eatExportStar(f),z=N&&this.maybeParseExportNamespaceSpecifier(f),U=T&&(!z||this.eat(12)),W=y||N;if(N&&!z){if(y&&this.unexpected(),o)throw this.raise(O.UnsupportedDecoratorExport,f);return this.parseExportFrom(f,!0),this.sawUnambiguousESM=!0,this.finishNode(f,"ExportAllDeclaration")}const ee=this.maybeParseExportNamedSpecifiers(f);y&&T&&!N&&!ee&&this.unexpected(null,5),z&&U&&this.unexpected(null,98);let pe;if(W||ee){if(pe=!1,o)throw this.raise(O.UnsupportedDecoratorExport,f);this.parseExportFrom(f,W)}else pe=this.maybeParseExportDeclaration(f);if(W||ee||pe){var Ee;const Ae=f;if(this.checkExport(Ae,!0,!1,!!Ae.source),((Ee=Ae.declaration)==null?void 0:Ee.type)==="ClassDeclaration")this.maybeTakeDecorators(o,Ae.declaration,Ae);else if(o)throw this.raise(O.UnsupportedDecoratorExport,f);return this.sawUnambiguousESM=!0,this.finishNode(Ae,"ExportNamedDeclaration")}if(this.eat(65)){const Ae=f,Be=this.parseExportDefaultExpression();if(Ae.declaration=Be,Be.type==="ClassDeclaration")this.maybeTakeDecorators(o,Be,Ae);else if(o)throw this.raise(O.UnsupportedDecoratorExport,f);return this.checkExport(Ae,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(Ae,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(f){return this.eat(55)}maybeParseExportDefaultSpecifier(f,o){if(o||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",o?.loc.start);const d=o||this.parseIdentifier(!0),y=this.startNodeAtNode(d);return y.exported=d,f.specifiers=[this.finishNode(y,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(f){if(this.isContextual(93)){var o,d;(d=(o=f).specifiers)!=null||(o.specifiers=[]);const y=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),y.exported=this.parseModuleExportName(),f.specifiers.push(this.finishNode(y,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(f){if(this.match(5)){const o=f;o.specifiers||(o.specifiers=[]);const d=o.exportKind==="type";return o.specifiers.push(...this.parseExportSpecifiers(d)),o.source=null,this.hasPlugin("importAssertions")?o.assertions=[]:o.attributes=[],o.declaration=null,!0}return!1}maybeParseExportDeclaration(f){return this.shouldParseExportDeclaration()?(f.specifiers=[],f.source=null,this.hasPlugin("importAssertions")?f.assertions=[]:f.attributes=[],f.declaration=this.parseExportDeclaration(f),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;const f=this.nextTokenInLineStart();return this.isUnparsedContextual(f,"function")}parseExportDefaultExpression(){const f=this.startNode();if(this.match(68))return this.next(),this.parseFunction(f,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(f,13);if(this.match(80))return this.parseClass(f,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(O.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(O.UnsupportedDefaultExport,this.state.startLoc);const o=this.parseMaybeAssignAllowIn();return this.semicolon(),o}parseExportDeclaration(f){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){const{type:f}=this.state;if(xe(f)){if(f===95&&!this.state.containsEsc||f===100)return!1;if((f===130||f===129)&&!this.state.containsEsc){const y=this.nextTokenStart(),T=this.input.charCodeAt(y);if(T===123||this.chStartsBindingIdentifier(T,y)&&!this.input.startsWith("from",y))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;const o=this.nextTokenStart(),d=this.isUnparsedContextual(o,"from");if(this.input.charCodeAt(o)===44||xe(this.state.type)&&d)return!0;if(this.match(65)&&d){const y=this.input.charCodeAt(this.nextTokenStartSince(o+4));return y===34||y===39}return!1}parseExportFrom(f,o){this.eatContextual(98)?(f.source=this.parseImportSource(),this.checkExport(f),this.maybeParseImportAttributes(f),this.checkJSONModuleImport(f)):o&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){const{type:f}=this.state;return f===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(O.DecoratorBeforeExport,this.state.startLoc),!0):this.isUsing()?(this.raise(O.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(O.UsingDeclarationExport,this.state.startLoc),!0):f===74||f===75||f===68||f===80||this.isLet()||this.isAsyncFunction()}checkExport(f,o,d,y){if(o){var T;if(d){if(this.checkDuplicateExports(f,"default"),this.hasPlugin("exportDefaultFrom")){var N;const z=f.declaration;z.type==="Identifier"&&z.name==="from"&&z.end-z.start===4&&!((N=z.extra)!=null&&N.parenthesized)&&this.raise(O.ExportDefaultFromAsIdentifier,z)}}else if((T=f.specifiers)!=null&&T.length)for(const z of f.specifiers){const{exported:U}=z,W=U.type==="Identifier"?U.name:U.value;if(this.checkDuplicateExports(z,W),!y&&z.local){const{local:ee}=z;ee.type!=="Identifier"?this.raise(O.ExportBindingIsString,z,{localName:ee.value,exportName:W}):(this.checkReservedWord(ee.name,ee.loc.start,!0,!1),this.scope.checkLocalExport(ee))}}else if(f.declaration){const z=f.declaration;if(z.type==="FunctionDeclaration"||z.type==="ClassDeclaration"){const{id:U}=z;if(!U)throw new Error("Assertion failure");this.checkDuplicateExports(f,U.name)}else if(z.type==="VariableDeclaration")for(const U of z.declarations)this.checkDeclaration(U.id)}}}checkDeclaration(f){if(f.type==="Identifier")this.checkDuplicateExports(f,f.name);else if(f.type==="ObjectPattern")for(const o of f.properties)this.checkDeclaration(o);else if(f.type==="ArrayPattern")for(const o of f.elements)o&&this.checkDeclaration(o);else f.type==="ObjectProperty"?this.checkDeclaration(f.value):f.type==="RestElement"?this.checkDeclaration(f.argument):f.type==="AssignmentPattern"&&this.checkDeclaration(f.left)}checkDuplicateExports(f,o){this.exportedIdentifiers.has(o)&&(o==="default"?this.raise(O.DuplicateDefaultExport,f):this.raise(O.DuplicateExport,f,{exportName:o})),this.exportedIdentifiers.add(o)}parseExportSpecifiers(f){const o=[];let d=!0;for(this.expect(5);!this.eat(8);){if(d)d=!1;else if(this.expect(12),this.eat(8))break;const y=this.isContextual(130),T=this.match(134),N=this.startNode();N.local=this.parseModuleExportName(),o.push(this.parseExportSpecifier(N,T,f,y))}return o}parseExportSpecifier(f,o,d,y){return this.eatContextual(93)?f.exported=this.parseModuleExportName():o?f.exported=this.cloneStringLiteral(f.local):f.exported||(f.exported=this.cloneIdentifier(f.local)),this.finishNode(f,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){const f=this.parseStringLiteral(this.state.value),o=ZP.exec(f.value);return o&&this.raise(O.ModuleExportNameHasLoneSurrogate,f,{surrogateCharCode:o[0].charCodeAt(0)}),f}return this.parseIdentifier(!0)}isJSONModuleImport(f){return f.assertions!=null?f.assertions.some(({key:o,value:d})=>d.value==="json"&&(o.type==="Identifier"?o.name==="type":o.value==="type")):!1}checkImportReflection(f){const{specifiers:o}=f,d=o.length===1?o[0].type:null;if(f.phase==="source")d!=="ImportDefaultSpecifier"&&this.raise(O.SourcePhaseImportRequiresDefault,o[0].loc.start);else if(f.phase==="defer")d!=="ImportNamespaceSpecifier"&&this.raise(O.DeferImportRequiresNamespace,o[0].loc.start);else if(f.module){var y;d!=="ImportDefaultSpecifier"&&this.raise(O.ImportReflectionNotBinding,o[0].loc.start),((y=f.assertions)==null?void 0:y.length)>0&&this.raise(O.ImportReflectionHasAssertion,o[0].loc.start)}}checkJSONModuleImport(f){if(this.isJSONModuleImport(f)&&f.type!=="ExportAllDeclaration"){const{specifiers:o}=f;if(o!=null){const d=o.find(y=>{let T;if(y.type==="ExportSpecifier"?T=y.local:y.type==="ImportSpecifier"&&(T=y.imported),T!==void 0)return T.type==="Identifier"?T.name!=="default":T.value!=="default"});d!==void 0&&this.raise(O.ImportJSONBindingNotDefault,d.loc.start)}}}isPotentialImportPhase(f){return f?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(f,o,d,y){o||(d==="module"?(this.expectPlugin("importReflection",y),f.module=!0):this.hasPlugin("importReflection")&&(f.module=!1),d==="source"?(this.expectPlugin("sourcePhaseImports",y),f.phase="source"):d==="defer"?(this.expectPlugin("deferredImportEvaluation",y),f.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(f.phase=null))}parseMaybeImportPhase(f,o){if(!this.isPotentialImportPhase(o))return this.applyImportPhase(f,o,null),null;const d=this.startNode(),y=this.parseIdentifierName(!0),{type:T}=this.state;return(ke(T)?T!==98||this.lookaheadCharCode()===102:T!==12)?(this.applyImportPhase(f,o,y,d.loc.start),null):(this.applyImportPhase(f,o,null),this.createIdentifier(d,y))}isPrecedingIdImportPhase(f){const{type:o}=this.state;return xe(o)?o!==98||this.lookaheadCharCode()===102:o!==12}parseImport(f){return this.match(134)?this.parseImportSourceAndAttributes(f):this.parseImportSpecifiersAndAfter(f,this.parseMaybeImportPhase(f,!1))}parseImportSpecifiersAndAfter(f,o){f.specifiers=[];const y=!this.maybeParseDefaultImportSpecifier(f,o)||this.eat(12),T=y&&this.maybeParseStarImportSpecifier(f);return y&&!T&&this.parseNamedImportSpecifiers(f),this.expectContextual(98),this.parseImportSourceAndAttributes(f)}parseImportSourceAndAttributes(f){var o;return(o=f.specifiers)!=null||(f.specifiers=[]),f.source=this.parseImportSource(),this.maybeParseImportAttributes(f),this.checkImportReflection(f),this.checkJSONModuleImport(f),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(f,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(f,o,d){o.local=this.parseIdentifier(),f.specifiers.push(this.finishImportSpecifier(o,d))}finishImportSpecifier(f,o,d=8201){return this.checkLVal(f.local,{type:o},d),this.finishNode(f,o)}parseImportAttributes(){this.expect(5);const f=[],o=new Set;do{if(this.match(8))break;const d=this.startNode(),y=this.state.value;if(o.has(y)&&this.raise(O.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:y}),o.add(y),this.match(134)?d.key=this.parseStringLiteral(y):d.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(O.ModuleAttributeInvalidValue,this.state.startLoc);d.value=this.parseStringLiteral(this.state.value),f.push(this.finishNode(d,"ImportAttribute"))}while(this.eat(12));return this.expect(8),f}parseModuleAttributes(){const f=[],o=new Set;do{const d=this.startNode();if(d.key=this.parseIdentifier(!0),d.key.name!=="type"&&this.raise(O.ModuleAttributeDifferentFromType,d.key),o.has(d.key.name)&&this.raise(O.ModuleAttributesWithDuplicateKeys,d.key,{key:d.key.name}),o.add(d.key.name),this.expect(14),!this.match(134))throw this.raise(O.ModuleAttributeInvalidValue,this.state.startLoc);d.value=this.parseStringLiteral(this.state.value),f.push(this.finishNode(d,"ImportAttribute"))}while(this.eat(12));return f}maybeParseImportAttributes(f){let o;var d=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(o=this.parseModuleAttributes(),this.addExtra(f,"deprecatedWithLegacySyntax",!0)):o=this.parseImportAttributes(),d=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(O.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(f,"deprecatedAssertSyntax",!0),this.next(),o=this.parseImportAttributes()):o=[];!d&&this.hasPlugin("importAssertions")?f.assertions=o:f.attributes=o}maybeParseDefaultImportSpecifier(f,o){if(o){const d=this.startNodeAtNode(o);return d.local=o,f.specifiers.push(this.finishImportSpecifier(d,"ImportDefaultSpecifier")),!0}else if(ke(this.state.type))return this.parseImportSpecifierLocal(f,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(f){if(this.match(55)){const o=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(f,o,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(f){let o=!0;for(this.expect(5);!this.eat(8);){if(o)o=!1;else{if(this.eat(14))throw this.raise(O.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}const d=this.startNode(),y=this.match(134),T=this.isContextual(130);d.imported=this.parseModuleExportName();const N=this.parseImportSpecifier(d,y,f.importKind==="type"||f.importKind==="typeof",T,void 0);f.specifiers.push(N)}}parseImportSpecifier(f,o,d,y,T){if(this.eatContextual(93))f.local=this.parseIdentifier();else{const{imported:N}=f;if(o)throw this.raise(O.ImportBindingIsString,f,{importName:N.value});this.checkReservedWord(N.name,f.loc.start,!0,!0),f.local||(f.local=this.cloneIdentifier(N))}return this.finishImportSpecifier(f,"ImportSpecifier",T)}isThisParam(f){return f.type==="Identifier"&&f.name==="this"}}class Pm extends UP{constructor(f,o,d){const y=S(f);super(y,o),this.options=y,this.initializeScopes(),this.plugins=d,this.filename=y.sourceFilename,this.startIndex=y.startIndex;let T=0;y.allowAwaitOutsideFunction&&(T|=1),y.allowReturnOutsideFunction&&(T|=2),y.allowImportExportEverywhere&&(T|=8),y.allowSuperOutsideMethod&&(T|=16),y.allowUndeclaredExports&&(T|=64),y.allowNewTargetOutsideFunction&&(T|=4),y.allowYieldOutsideFunction&&(T|=32),y.ranges&&(T|=128),y.tokens&&(T|=256),y.createImportExpressions&&(T|=512),y.createParenthesizedExpressions&&(T|=1024),y.errorRecovery&&(T|=2048),y.attachComment&&(T|=4096),y.annexB&&(T|=8192),this.optionFlags=T}getScopeHandler(){return Ws}parse(){this.enterInitialScopes();const f=this.startNode(),o=this.startNode();this.nextToken(),f.errors=null;const d=this.parseTopLevel(f,o);return d.errors=this.state.errors,d.comments.length=this.state.commentsLen,d}}function qP(_,f){var o;if(((o=f)==null?void 0:o.sourceType)==="unambiguous"){f=Object.assign({},f);try{f.sourceType="module";const d=ta(f,_),y=d.parse();if(d.sawUnambiguousESM)return y;if(d.ambiguousScriptDifferentAst)try{return f.sourceType="script",ta(f,_).parse()}catch{}else y.program.sourceType="script";return y}catch(d){try{return f.sourceType="script",ta(f,_).parse()}catch{}throw d}}else return ta(f,_).parse()}function WP(_,f){const o=ta(f,_);return o.options.strictMode&&(o.state.strict=!0),o.getExpression()}function YP(_){const f={};for(const o of Object.keys(_))f[o]=Je(_[o]);return f}const GP=YP(Q);function ta(_,f){let o=Pm;const d=new Map;if(_!=null&&_.plugins){for(const y of _.plugins){let T,N;typeof y=="string"?T=y:[T,N]=y,d.has(T)||d.set(T,N||{})}RP(d),o=HP(d)}return new o(_,f,d)}const Tm=new Map;function HP(_){const f=[];for(const y of zP)_.has(y)&&f.push(y);const o=f.join("|");let d=Tm.get(o);if(!d){d=Pm;for(const y of f)d=wm[y](d);Tm.set(o,d)}return d}return ns.parse=qP,ns.parseExpression=WP,ns.tokTypes=GP,ns}var F$=Q$();let g0=0;function y0(){g0++;const t=Math.random().toString(36).slice(2,6);return`t${g0}_${t}`}function R$(t){const e=[],i=[];if(!t.trim())return{tools:e,warnings:i};let n;try{n=Do.parse(t,{parser:{parse(s){return F$.parse(s,{sourceType:"module",plugins:["typescript"],allowAwaitOutsideFunction:!0,tokens:!0})}}})}catch(s){const a=s instanceof Error?s.message:String(s);return i.push(`Parse error: ${a}`),{tools:e,warnings:i}}const r=n.program?.body??[];for(const s of r){if(s.type==="ExportNamedDeclaration"&&s.declaration){const l=s.declaration;if(l.type==="FunctionDeclaration"){e.push(v0(l));continue}}if(s.type==="FunctionDeclaration"){e.push(v0(s));continue}if(s.type==="ExportNamedDeclaration"&&s.declaration?.type==="VariableDeclaration"){const l=s.declaration.declarations[0];if(l?.init?.type==="ArrowFunctionExpression"||l?.init?.type==="FunctionExpression"){e.push(O0(l));continue}}if(s.type==="VariableDeclaration"){const l=s.declarations[0];if(l?.init?.type==="ArrowFunctionExpression"||l?.init?.type==="FunctionExpression"){e.push(O0(l));continue}}const a=Do.print(s).code;a.trim()&&i.push(`Skipped non-tool code: ${a.slice(0,80)}${a.length>80?"...":""}`)}return{tools:e,warnings:i}}function v0(t){const e=t.id?.name??"unnamed",i=Kb(t.params),n=Do.print(t.body).code,{description:r,uid:s}=t1(t,e);return{uid:s,name:e,description:r,parameters:i,body:n}}function O0(t){const e=t.id?.name??"unnamed",i=t.init,n=Kb(i.params),r=i.body.type==="BlockStatement"?Do.print(i.body).code:`{ return ${Do.print(i.body).code} }`,{description:s,uid:a}=t1(t,e);return{uid:a,name:e,description:s,parameters:n,body:r}}function Kb(t){return t.map(e=>{let i="unknown",n="any",r=null;e.type==="Identifier"?(i=e.name,r=e.typeAnnotation?.typeAnnotation,r&&(n=gs(r))):e.type==="AssignmentPattern"&&e.left?.type==="Identifier"?(i=e.left.name,r=e.left.typeAnnotation?.typeAnnotation,r&&(n=gs(r))):e.type==="ObjectPattern"&&(i="params",r=e.typeAnnotation?.typeAnnotation,r&&(n=gs(r)));const s={name:i,type:n};if(r?.type==="TSTypeLiteral"&&(s.members=e1(r)),r?.type==="TSUnionType"){const a=gp(r);a&&(s.enumValues=a)}return s})}function e1(t){return t.members?t.members.filter(e=>e.type==="TSPropertySignature").map(e=>{const i=e.key?.name??e.key?.value??"unknown",n=e.typeAnnotation?.typeAnnotation,r=gs(n),s={name:i,type:r};if(n?.type==="TSTypeLiteral"&&(s.members=e1(n)),n?.type==="TSUnionType"){const a=gp(n);a&&(s.enumValues=a)}return s}):[]}function gp(t){const e=t.types??[];if(!(!e.every(n=>n.type==="TSLiteralType"&&typeof n.literal?.value=="string")||e.length===0))return e.map(n=>n.literal.value)}function gs(t){if(!t)return"any";switch(t.type){case"TSStringKeyword":return"string";case"TSNumberKeyword":return"number";case"TSBooleanKeyword":return"boolean";case"TSAnyKeyword":return"any";case"TSObjectKeyword":return"object";case"TSTypeLiteral":return"object";case"TSTypeReference":return t.typeName?.name??"any";case"TSArrayType":return`${gs(t.elementType)}[]`;case"TSUnionType":return gp(t)?"string":t.types?.map(i=>gs(i)).join(" | ")??"any";case"TSLiteralType":{const e=t.literal?.value;return typeof e=="string"?"string":typeof e=="number"?"number":"any"}default:return"any"}}function t1(t,e){const i=t.leadingComments;if(!i||i.length===0)return{description:`Tool: ${e}`,uid:y0()};let r=i[i.length-1].value?.trim()??"";r=r.replace(/^\*+\s*/gm,"").replace(/\s*\*+$/gm,"").replace(/^\/\*+\s*/,"").replace(/\s*\*+\/$/,"").trim();const s=r.match(/@id\s+(\S+)/),a=s?s[1]:y0();return{description:r.replace(/@id\s+\S+/,"").trim()||`Tool: ${e}`,uid:a}}function z$(t){return t.map(e=>{const i=e.parameters.map(a=>a.type&&a.type!=="any"?`${a.name}: ${a.type}`:a.name).join(", "),n=e.description&&e.description!==`Tool: ${e.name}`?e.description:"",r=e.uid?` @id ${e.uid}`:"";return`${n||r?`/** ${n}${r} */
|
|
152
|
+
`:""}export async function ${e.name}(${i}) ${e.body}`}).join(`
|
|
153
|
+
|
|
154
|
+
`)}function X$(t){const e=t.toLowerCase();return e==="number"||e==="integer"?"number":e==="boolean"?"boolean":e.endsWith("[]")?"array":e==="object"?"object":"string"}function x0(t){const e={type:X$(t.type)};return t.description&&(e.description=t.description),t.enumValues&&(e.enum=t.enumValues),e}function b0(t){return t.map(e=>{const i={},n=[];for(const r of e.parameters)if(r.members&&r.members.length>0)for(const s of r.members)i[s.name]=x0(s),n.push(s.name);else i[r.name]=x0(r),n.push(r.name);return{type:"function",function:{name:e.name,description:e.description,parameters:{type:"object",properties:i,required:n},...e.returnSchema?{returns:e.returnSchema}:{}}}})}function j$(){const t=Ud(),e=mT(),i=gT(),n=ze([]),r=ze([]),s=ze(null),a=ze(new Map),l=ze(""),u=ze([]),h=ze("synced"),c=ze([]);function p(){if(s.value==="canvas")return;s.value="store";const S=t.allTools,w=[],C=[];S.forEach((k,A)=>{const $=kh(k),F=a.value.get(k.id),I=k.canvasMeta?.position??{x:80+A%3*480,y:60+Math.floor(A/3)*400};w.push({id:k.id,type:"tool-function",position:I,data:{...$,executionStatus:F?.status??"idle",lastResult:F?.result,lastDurationMs:F?.durationMs,onUpdate:(B,j)=>v(k.id,B,j)}})});for(let k=1;k<w.length;k++){const A=w[k-1],$=w[k];C.push({id:`e-${A.id}-${$.id}`,source:A.id,target:$.id,animated:!0,style:{stroke:"var(--color-accent)",strokeWidth:2}})}n.value=w,r.value=C;const E=S.map(k=>kh(k));l.value=z$(E),c.value=b0(E),h.value="synced",vi(()=>{s.value=null})}Ge(()=>t.allTools,p,{deep:!0}),p();function v(S,w,C){const E=t.getById(S);if(!E)return;s.value="canvas";const A={...kh(E),[w]:C};if(w==="mappings"||w==="probeConfig"||w==="returnSchema"){const $={...E.canvasMeta,[w]:C};t.updateTool(S,{canvasMeta:$})}else{const $=fy(A,E);t.updateTool(S,$)}vi(()=>{s.value=null})}function g(S){for(const w of S)t.removeTool(w.id)}function b(S){const w=S.node.id,C=t.getById(w);if(!C)return;const E={...C.canvasMeta,position:{x:S.node.position.x,y:S.node.position.y}};t.updateTool(w,{canvasMeta:E})}function m(){return t.addTool({definition:{type:"function",function:{name:"new_tool",description:"A new tool",parameters:{type:"object",properties:{},required:[]}}}})}let x=null;function O(S){l.value=S,h.value="dirty",x&&clearTimeout(x),x=setTimeout(()=>{P(S)},500)}function P(S){const{tools:w,warnings:C}=R$(S);if(u.value=C,w.length===0&&C.length>0)return;s.value="canvas";const E=t.allTools,k=new Set;for(const A of w){let $=E.find(F=>F.id===A.uid);if($||($=E.find(F=>F.definition.function.name===A.name&&!k.has(F.id))),$){k.add($.id);const F=fy(A,$);t.updateTool($.id,F)}else t.addTool({definition:{type:"function",function:{name:A.name,description:A.description,parameters:{type:"object",properties:{},required:[]}}},implementation:{mode:"code",blocks:[],code:A.body}})}c.value=b0(w),h.value="synced",vi(()=>{s.value=null})}return Ge(()=>{const S=i.activeSessionId;return S?e.getToolCalls(S):null},S=>{if(!S){a.value=new Map;return}const w=new Map;for(const C of S){const E=t.findByFunctionName(C.functionName);if(!E)continue;const k=w.get(E.id);(!k||C.startedAt>(S.find(A=>A.functionName===k.status)?.startedAt??0))&&(C.status==="pending"||C.status==="executing"?w.set(E.id,{status:"executing"}):C.status==="completed"?w.set(E.id,{status:"completed",result:C.result,durationMs:C.durationMs}):C.status==="failed"&&w.set(E.id,{status:"failed",result:C.error,durationMs:C.durationMs,callArguments:C.arguments,callError:C.error}))}a.value=w;for(const C of n.value){const E=w.get(C.id),k=C.data;E?(k.executionStatus=E.status,k.lastResult=E.result,k.lastDurationMs=E.durationMs,k.lastCallArguments=E.callArguments,k.lastCallError=E.callError):k.executionStatus!=="idle"&&(k.executionStatus="idle",k.lastResult=void 0,k.lastDurationMs=void 0,k.lastCallArguments=void 0,k.lastCallError=void 0)}},{deep:!0}),Ge(()=>a.value,S=>{for(const[w,C]of S)(C.status==="completed"||C.status==="failed")&&setTimeout(()=>{if(a.value.get(w)===C){a.value.delete(w);const k=n.value.find(A=>A.id===w);k&&(k.data.executionStatus="idle")}},5e3)},{deep:!0}),{flowNodes:n,flowEdges:r,executionOverlays:a,combinedCode:l,codeWarnings:u,codeSyncStatus:h,schemas:c,onNodeDragStop:b,onNodesDelete:g,onCodeEdit:O,addNewTool:m,handleBlockUpdate:v}}const i1="llmxray-canvas-ai-intents",Fh="llmxray-canvas-ai-model";function Z$(){try{const t=localStorage.getItem(i1);if(t)return new Map(JSON.parse(t))}catch{}return new Map}function V$(t){localStorage.setItem(i1,JSON.stringify([...t.entries()]))}const n1=lT("canvas-ai",()=>{const t=ze(new Map),e=ze(new Map),i=ze(new Map),n=ze(Z$()),r=ze(localStorage.getItem(Fh)??null),s=ze(new Map),a=kO(),l=Fe(()=>r.value??a.chatModelNames[0]??"");function u(w){r.value=w,w?localStorage.setItem(Fh,w):localStorage.removeItem(Fh)}function h(w,C){t.value=new Map(t.value).set(w,C)}function c(w){const C=new Map(t.value);C.delete(w),t.value=C}function p(w,C){e.value=new Map(e.value).set(w,C)}function v(w){const C=new Map(e.value);C.delete(w),e.value=C}function g(w,C){i.value=new Map(i.value).set(w,C)}function b(w){const C=new Map(i.value);C.delete(w),i.value=C}function m(w,C){n.value=new Map(n.value).set(w,C),V$(n.value)}function x(w){return n.value.get(w)}function O(w){P(w);const C=new AbortController;return s.value=new Map(s.value).set(w,C),C}function P(w){const C=s.value.get(w);if(C){C.abort();const E=new Map(s.value);E.delete(w),s.value=E}}function S(w){const C=new Map(s.value);C.delete(w),s.value=C}return{drafts:t,insights:e,autoMapSuggestions:i,intentMemory:n,canvasAiModel:r,activeRequests:s,effectiveModel:l,setCanvasAiModel:u,setDraft:h,clearDraft:c,setInsights:p,clearInsights:v,setAutoMapSuggestion:g,clearAutoMapSuggestion:b,setIntent:m,getIntent:x,startRequest:O,cancelRequest:P,finishRequest:S}});function Xc(){return"You are a code generator for LLMxRay, a local LLM observatory.\nYou generate the BODY of an `async function(args)` that runs in a browser environment (Vite/Vue app).\n\nAvailable in scope:\n- `args` — typed parameter object (described per-tool)\n- `fetch()` — standard browser fetch\n- `getGoogleToken()` — returns a Bearer token for Google OAuth2 APIs\n\nCoding standards (MUST follow):\n- Always wrap logic in try/catch with descriptive error messages: throw new Error('Failed to fetch X: ' + e.message)\n- Use `await fetch(url, options)` — never XMLHttpRequest, axios, or other patterns\n- Always set a timeout: `signal: AbortSignal.timeout(10000)`\n- Return structured data (object or array), never raw strings\n- Never use `import` or `require` — all dependencies are pre-available\n- Prefer `const` over `let`; never use `var`\n- Use template literals for URL construction\n\nForbidden:\n- console.log (throw for errors instead)\n- Hardcoded API keys or secrets\n- eval(), document.write()\n\nOutput ONLY the function body (no function signature, no wrapping)."}function yp(t,e,i){const n=i.map(r=>` - ${r.name}: ${r.type}${r.description?` — ${r.description}`:""}`);return[`Tool name: ${t}`,`Description: ${e}`,n.length>0?`Parameters (via args object):
|
|
155
|
+
${n.join(`
|
|
156
|
+
`)}`:"No parameters."].join(`
|
|
157
|
+
`)}function U$(t,e=2048){const i=JSON.stringify(t,null,2);return i.length<=e?i:i.slice(0,e)+`
|
|
158
|
+
... (truncated)`}function jc(t,e=0,i=4){return e>=i?'"..."':t===null?"null":Array.isArray(t)?t.length===0?"[]":`[${jc(t[0],e+1,i)}]`:typeof t=="object"?`{
|
|
159
|
+
${Object.entries(t).slice(0,20).map(([s,a])=>` "${" ".repeat(e)}${s}": ${r1(a,e+1,i)}`).join(`,
|
|
160
|
+
`)}
|
|
161
|
+
}`:`"${typeof t}"`}function r1(t,e,i){return t===null?'"null"':Array.isArray(t)?t.length===0?'"array"':`[${r1(t[0],e+1,i)}]`:typeof t=="object"?e>=i?'"{object}"':jc(t,e,i):`"${typeof t}"`}function Zc(t){const e=t.replace(/```(?:json)?\s*/g,"").replace(/```/g,"").trim();try{return JSON.parse(e)}catch{}const i=e.match(/\{[\s\S]*\}/);if(i)try{return JSON.parse(i[0])}catch{}return null}function q$(t){let e=t;e=e.replace(/\\n/g,`
|
|
162
|
+
`).replace(/\\t/g," "),e=e.replace(/^```(?:typescript|javascript|ts|js)?\s*\n?/gm,"").replace(/```\s*$/gm,"");const i=e.match(/^(?:async\s+)?function\s+\w+\s*\([^)]*\)\s*\{\n?([\s\S]*)\}\s*$/);if(i){e=i[1];const n=e.split(`
|
|
163
|
+
`),r=n.find(s=>s.trim())?.match(/^(\s+)/)?.[1]?.length??0;r>0&&(e=n.map(s=>s.startsWith(" ".repeat(r))?s.slice(r):s).join(`
|
|
164
|
+
`))}return e.trim()}function s1(t){return t.split(`
|
|
165
|
+
`).filter(e=>!e.match(/^\s*(import|require)\b/)).join(`
|
|
166
|
+
`)}function W$(t){const e=t.match(/<think>([\s\S]*?)<\/think>/);return e?{reasoning:e[1].trim(),cleanResponse:t.replace(/<think>[\s\S]*?<\/think>/g,"").trim()}:{reasoning:"",cleanResponse:t}}async function Vc(t,e,i,n,r,s){const{reasoning:a,cleanResponse:l}=W$(r),u={id:uT(),timestamp:Date.now(),phase:t,model:e,systemPrompt:i,userPrompt:n,response:l,accepted:!1,toolName:s,reasoning:a||void 0};return await qd.savePair(u),u.id}async function Y$(t){const e=Xc()+`
|
|
167
|
+
|
|
168
|
+
Respond with JSON: {"code": "<function body>", "explanation": "<brief explanation>"}`,i=[`Intent: ${t.intent}`,"",yp(t.toolName,t.description,t.parameters)];t.probeResponseSample&&i.push("","API response structure:",jc(t.probeResponseSample),"","Sample (truncated):",U$(t.probeResponseSample));const n=i.join(`
|
|
169
|
+
`),r=[{role:"system",content:e},{role:"user",content:n}];try{const s=await Tc.chat({model:t.model,messages:r,format:"json",stream:!1}),a=Zc(s.message.content),l=await Vc("draft",t.model,e,n,s.message.content,t.toolName);return!a||!a.code?{code:"",explanation:"",trainingPairId:l,error:"AI could not generate a valid response"}:{code:s1(a.code),explanation:a.explanation??"",trainingPairId:l}}catch(s){return{code:"",explanation:"",trainingPairId:"",error:s instanceof Error?s.message:String(s)}}}async function G$(t){const e=Xc()+`
|
|
170
|
+
|
|
171
|
+
You are a precise code reviewer. Analyze the tool code below and report ONLY issues you can directly verify in the code.
|
|
172
|
+
|
|
173
|
+
RULES:
|
|
174
|
+
- ONLY report an issue if you can point to a specific line or pattern in the code that proves it.
|
|
175
|
+
- Do NOT guess or assume. If the code does not contain fetch() calls, do NOT flag "no timeout on fetch".
|
|
176
|
+
- If the code does not contain URLs, do NOT flag "hardcoded URL".
|
|
177
|
+
- If the code does not contain API keys/tokens/secrets, do NOT flag "secret leaks".
|
|
178
|
+
- If all declared parameters are used in the code, do NOT flag "unused parameters".
|
|
179
|
+
- If the code already has try/catch, do NOT flag "missing try/catch".
|
|
180
|
+
- If you find zero issues, return {"insights": []}.
|
|
181
|
+
- When providing suggestedCode, include the COMPLETE function body (all lines), not just the changed part. Do NOT wrap it in a function declaration — just the body code that goes inside the function.
|
|
182
|
+
|
|
183
|
+
Respond with JSON: {"insights": [{"severity": "info|warning|error", "title": "<short>", "description": "<explain what specific code causes this issue>", "suggestedCode": "<complete fixed function body>"}]}`,i=t.parameters.map(s=>s.name),n=[yp(t.toolName,"",t.parameters),"",`Declared parameters: ${i.length>0?i.join(", "):"(none)"}`,"","Current code:","```",t.code,"```"].join(`
|
|
184
|
+
`),r=[{role:"system",content:e},{role:"user",content:n}];try{const s=await Tc.chat({model:t.model,messages:r,format:"json",stream:!1}),a=Zc(s.message.content),l=await Vc("insights",t.model,e,n,s.message.content,t.toolName);if(!a||!Array.isArray(a.insights))return{insights:[],trainingPairId:l,error:"AI could not generate a valid response"};for(const c of a.insights)c.suggestedCode&&(c.suggestedCode=q$(c.suggestedCode));const u=t.code.toLowerCase();return{insights:a.insights.filter(c=>{const p=c.title.toLowerCase();return!((p.includes("fetch")||p.includes("timeout"))&&!u.includes("fetch(")&&!u.includes("fetch (")||p.includes("url")&&!u.includes("http://")&&!u.includes("https://")&&!u.includes("://")||(p.includes("secret")||p.includes("key")||p.includes("leak"))&&!u.includes("key")&&!u.includes("token")&&!u.includes("secret")&&!u.includes("password")&&!u.includes("api_")||p.includes("unused param")&&i.every(g=>u.includes(g.toLowerCase()))||p.includes("try")&&p.includes("catch")&&u.includes("try")&&u.includes("catch"))}),trainingPairId:l}}catch(s){return{insights:[],trainingPairId:"",error:s instanceof Error?s.message:String(s)}}}async function H$(t){const e=Xc()+`
|
|
185
|
+
|
|
186
|
+
Given an API response structure and the tool's purpose, suggest the most relevant JSON dot-paths to extract.
|
|
187
|
+
Respond with JSON: {"paths": ["path.to.field", ...], "reasoning": "<why these fields>"}`,i=[`Tool: ${t.toolName}`,`Purpose: ${t.description}`,"","API response structure (keys + types):",jc(t.probeResponseSample)].join(`
|
|
188
|
+
`),n=[{role:"system",content:e},{role:"user",content:i}];try{const r=await Tc.chat({model:t.model,messages:n,format:"json",stream:!1}),s=Zc(r.message.content),a=await Vc("automap",t.model,e,i,r.message.content,t.toolName);return!s||!Array.isArray(s.paths)?{paths:[],reasoning:"",trainingPairId:a,error:"AI could not generate a valid response"}:{paths:s.paths,reasoning:s.reasoning??"",trainingPairId:a}}catch(r){return{paths:[],reasoning:"",trainingPairId:"",error:r instanceof Error?r.message:String(r)}}}async function J$(t){const e=Xc()+`
|
|
189
|
+
|
|
190
|
+
The tool failed during execution. Fix the code while preserving the original intent.
|
|
191
|
+
Respond with JSON: {"fixedCode": "<corrected function body>", "explanation": "<what was wrong and what you fixed>"}`,i=[yp(t.toolName,"",t.parameters)];t.originalIntent&&i.push("",`Original intent: ${t.originalIntent}`),i.push("","Current code:",t.code,"",`Error: ${t.error}`,"","Arguments passed:",JSON.stringify(t.arguments,null,2));const n=i.join(`
|
|
192
|
+
`),r=[{role:"system",content:e},{role:"user",content:n}];try{const s=await Tc.chat({model:t.model,messages:r,format:"json",stream:!1}),a=Zc(s.message.content),l=await Vc("fix",t.model,e,n,s.message.content,t.toolName);return!a||!a.fixedCode?{fixedCode:"",explanation:"",trainingPairId:l,error:"AI could not generate a valid response"}:{fixedCode:s1(a.fixedCode),explanation:a.explanation??"",trainingPairId:l}}catch(s){return{fixedCode:"",explanation:"",trainingPairId:"",error:s instanceof Error?s.message:String(s)}}}async function K$(t=!0){await qd.exportAsJsonl(t)}const e3=["get","post","put","delete","patch"];function t3(t){if(!t||typeof t!="object")return null;const e=t,i=typeof e.openapi=="string"&&e.openapi.startsWith("3"),n=typeof e.swagger=="string"&&e.swagger.startsWith("2");if(!i&&!n)return null;const r={title:e.info?.title??"Unknown API",version:e.info?.version??"?",description:e.info?.description,baseUrl:i?e.servers?.[0]?.url:i3(e)},s=[],a=e.paths??{},l=i?e.components?.schemas:e.definitions;for(const[u,h]of Object.entries(a)){if(!h||typeof h!="object")continue;const c=h,p=c.parameters??[];for(const v of e3){const g=c[v];if(!g)continue;const b=g.parameters??[],x=[...p,...b].map(S=>({name:S.name??"unknown",in:S.in??"query",type:i?S0(S.schema?.type,S.schema?.format):S0(S.type,S.format),required:S.required??!1,description:S.description}));let O;const P=g.responses?.["200"]??g.responses?.["201"];if(P){const S=i?P.content?.["application/json"]?.schema:P.schema;S&&(O=n3(S,l))}s.push({path:u,method:v.toUpperCase(),operationId:g.operationId,summary:g.summary,description:g.description,parameters:x,responseFields:O})}}return{info:r,endpoints:s}}function i3(t){if(!t.host)return;const e=t.schemes?.[0]??"https",i=t.basePath??"";return`${e}://${t.host}${i}`}function S0(t,e){if(!t)return"any";switch(t){case"string":return"string";case"integer":case"number":return"number";case"boolean":return"boolean";case"array":return"any[]";case"object":return"object";default:return"any"}}function n3(t,e){let i=t;if(t.$ref&&e){const n=t.$ref.split("/"),r=n[n.length-1];r&&e[r]&&(i=e[r])}if(i.properties)return Object.keys(i.properties);if(i.type==="array"&&i.items){const n=i.items.$ref,r=n&&e?e[n.split("/").pop()]??i.items:i.items;if(r.properties)return Object.keys(r.properties).map(s=>`[].${s}`)}return[]}function r3(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.openapi=="string"||typeof e.swagger=="string"}async function s3(t,e){const n=await(await fetch("/api-probe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t,method:e?.method??"GET",headers:e?.headers,body:e?.body})})).json();if(n.error)return{ok:!1,status:n.status??502,data:null,headers:n.headers??{},error:n.error};let r=null,s,a;try{r=JSON.parse(n.body)}catch{s=n.body,a="Response is not valid JSON"}const l=n.status>=200&&n.status<300;let u;return(n.status===401||n.status===403)&&(u=a3(n.headers,n.body)),{ok:l,status:n.status,data:r,headers:n.headers,authHint:u,error:a??(l?void 0:`HTTP ${n.status}`),rawText:s}}function a3(t,e){const i=(t["www-authenticate"]??"").toLowerCase(),n=e.toLowerCase();return i.includes("bearer")||n.includes("bearer")?{type:"bearer",message:"Bearer token required"}:i.includes("basic")?{type:"basic",message:"Basic authentication required"}:n.includes("api key")||n.includes("apikey")||n.includes("api_key")?{type:"apikey",message:"API key required"}:{type:"unknown",message:"Authentication required"}}const o3=["/openapi.json","/swagger.json","/api-docs","/v1/openapi.json","/v2/openapi.json","/v3/openapi.json","/.well-known/openapi","/docs/openapi.json","/api/v3/openapi.json","/api/openapi.json"];async function l3(t){let e;try{e=new URL(t).origin}catch{return{specUrl:null,spec:null,endpointCount:0}}const i=o3.map(n=>`${e}${n}`);try{const n=await fetch("/api-probe-multi",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({urls:i})}),{results:r}=await n.json();for(const s of r)if(!(s.status!==200||!s.body))try{const a=JSON.parse(s.body);if(r3(a)){const l=a.paths?Object.keys(a.paths):[];let u=0;for(const h of l){const c=a.paths[h];c&&typeof c=="object"&&(u+=["get","post","put","delete","patch"].filter(p=>p in c).length)}return{specUrl:s.url,spec:a,endpointCount:u}}}catch{}}catch{}return{specUrl:null,spec:null,endpointCount:0}}let qf=[],a1=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,i=0;e<t.length;e++)(e%2?a1:qf).push(i=i+t[e])})();function u3(t){if(t<768)return!1;for(let e=0,i=qf.length;;){let n=e+i>>1;if(t<qf[n])i=n;else if(t>=a1[n])e=n+1;else return!0;if(e==i)return!1}}function w0(t){return t>=127462&&t<=127487}const P0=8205;function c3(t,e,i=!0,n=!0){return(i?o1:h3)(t,e,n)}function o1(t,e,i){if(e==t.length)return e;e&&l1(t.charCodeAt(e))&&u1(t.charCodeAt(e-1))&&e--;let n=Rh(t,e);for(e+=T0(n);e<t.length;){let r=Rh(t,e);if(n==P0||r==P0||i&&u3(r))e+=T0(r),n=r;else if(w0(r)){let s=0,a=e-2;for(;a>=0&&w0(Rh(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function h3(t,e,i){for(;e>0;){let n=o1(t,e-2,i);if(n<e)return n;e--}return 0}function Rh(t,e){let i=t.charCodeAt(e);if(!u1(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return l1(n)?(i-55296<<10)+(n-56320)+65536:i}function l1(t){return t>=56320&&t<57344}function u1(t){return t>=55296&&t<56320}function T0(t){return t<65536?1:2}class at{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,i,n){[e,i]=Is(this,e,i);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(i,this.length,r,1),tn.from(r,this.length-(i-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=Is(this,e,i);let n=[];return this.decompose(e,i,n,0),tn.from(n,i-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let i=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new ao(this),s=new ao(e);for(let a=i,l=i;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new ao(this,e)}iterRange(e,i=this.length){return new c1(this,e,i)}iterLines(e,i){let n;if(e==null)n=this.iter();else{i==null&&(i=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new h1(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?at.empty:e.length<=32?new Dt(e):tn.from(Dt.split(e,[]))}}class Dt extends at{constructor(e,i=f3(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,r){for(let s=0;;s++){let a=this.text[s],l=r+a.length;if((i?n:l)>=e)return new d3(r,l,n,a);r=l+1,n++}}decompose(e,i,n,r){let s=e<=0&&i>=this.length?this:new Dt(C0(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(r&1){let a=n.pop(),l=Tu(s.text,a.text.slice(),0,s.length);if(l.length<=32)n.push(new Dt(l,a.length+s.length));else{let u=l.length>>1;n.push(new Dt(l.slice(0,u)),new Dt(l.slice(u)))}}else n.push(s)}replace(e,i,n){if(!(n instanceof Dt))return super.replace(e,i,n);[e,i]=Is(this,e,i);let r=Tu(this.text,Tu(n.text,C0(this.text,0,e)),i),s=this.length+n.length-(i-e);return r.length<=32?new Dt(r,s):tn.from(Dt.split(r,[]),s)}sliceString(e,i=this.length,n=`
|
|
193
|
+
`){[e,i]=Is(this,e,i);let r="";for(let s=0,a=0;s<=i&&a<this.text.length;a++){let l=this.text[a],u=s+l.length;s>e&&a&&(r+=n),e<u&&i>s&&(r+=l.slice(Math.max(0,e-s),i-s)),s=u+1}return r}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(i.push(new Dt(n,r)),n=[],r=-1);return r>-1&&i.push(new Dt(n,r)),i}}class tn extends at{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,i,n,r){for(let s=0;;s++){let a=this.children[s],l=r+a.length,u=n+a.lines-1;if((i?u:l)>=e)return a.lineInner(e,i,n,r);r=l+1,n=u+1}}decompose(e,i,n,r){for(let s=0,a=0;a<=i&&s<this.children.length;s++){let l=this.children[s],u=a+l.length;if(e<=u&&i>=a){let h=r&((a<=e?1:0)|(u>=i?2:0));a>=e&&u<=i&&!h?n.push(l):l.decompose(e-a,i-a,n,h)}a=u+1}}replace(e,i,n){if([e,i]=Is(this,e,i),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let a=this.children[r],l=s+a.length;if(e>=s&&i<=l){let u=a.replace(e-s,i-s,n),h=this.lines-a.lines+u.lines;if(u.lines<h>>4&&u.lines>h>>6){let c=this.children.slice();return c[r]=u,new tn(c,this.length-(i-e)+n.length)}return super.replace(s,l,u)}s=l+1}return super.replace(e,i,n)}sliceString(e,i=this.length,n=`
|
|
194
|
+
`){[e,i]=Is(this,e,i);let r="";for(let s=0,a=0;s<this.children.length&&a<=i;s++){let l=this.children[s],u=a+l.length;a>e&&s&&(r+=n),e<u&&i>a&&(r+=l.sliceString(e-a,i-a,n)),a=u+1}return r}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof tn))return 0;let n=0,[r,s,a,l]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=i,s+=i){if(r==a||s==l)return n;let u=this.children[r],h=e.children[s];if(u!=h)return n+u.scanIdentical(h,i);n+=u.length+1}}static from(e,i=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let g of e)n+=g.lines;if(n<32){let g=[];for(let b of e)b.flatten(g);return new Dt(g,i)}let r=Math.max(32,n>>5),s=r<<1,a=r>>1,l=[],u=0,h=-1,c=[];function p(g){let b;if(g.lines>s&&g instanceof tn)for(let m of g.children)p(m);else g.lines>a&&(u>a||!u)?(v(),l.push(g)):g instanceof Dt&&u&&(b=c[c.length-1])instanceof Dt&&g.lines+b.lines<=32?(u+=g.lines,h+=g.length+1,c[c.length-1]=new Dt(b.text.concat(g.text),b.length+1+g.length)):(u+g.lines>r&&v(),u+=g.lines,h+=g.length+1,c.push(g))}function v(){u!=0&&(l.push(c.length==1?c[0]:tn.from(c,h)),h=-1,u=c.length=0)}for(let g of e)p(g);return v(),l.length==1?l[0]:new tn(l,i)}}at.empty=new Dt([""],0);function f3(t){let e=-1;for(let i of t)e+=i.length+1;return e}function Tu(t,e,i=0,n=1e9){for(let r=0,s=0,a=!0;s<t.length&&r<=n;s++){let l=t[s],u=r+l.length;u>=i&&(u>n&&(l=l.slice(0,n-r)),r<i&&(l=l.slice(i-r)),a?(e[e.length-1]+=l,a=!1):e.push(l)),r=u+1}return e}function C0(t,e,i){return Tu(t,[""],e,i)}class ao{constructor(e,i=1){this.dir=i,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[i>0?1:(e instanceof Dt?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],a=s>>1,l=r instanceof Dt?r.text.length:r.children.length;if(a==(i>0?l:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=`
|
|
195
|
+
`,this;e--}else if(r instanceof Dt){let u=r.text[a+(i<0?-1:0)];if(this.offsets[n]+=i,u.length>Math.max(0,e))return this.value=e==0?u:i>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=r.children[a+(i<0?-1:0)];e>u.length?(e-=u.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(u),this.offsets.push(i>0?1:(u instanceof Dt?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class c1{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new ao(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*i,this.value=r.length<=n?r:i<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class h1{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:r}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(at.prototype[Symbol.iterator]=function(){return this.iter()},ao.prototype[Symbol.iterator]=c1.prototype[Symbol.iterator]=h1.prototype[Symbol.iterator]=function(){return this});class d3{constructor(e,i,n,r){this.from=e,this.to=i,this.number=n,this.text=r}get length(){return this.to-this.from}}function Is(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function Rt(t,e,i=!0,n=!0){return c3(t,e,i,n)}function p3(t){return t>=56320&&t<57344}function m3(t){return t>=55296&&t<56320}function ni(t,e){let i=t.charCodeAt(e);if(!m3(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return p3(n)?(i-55296<<10)+(n-56320)+65536:i}function vp(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function nn(t){return t<65536?1:2}const Wf=/\r\n?|\n/;var Zt=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Zt||(Zt={}));class hn{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;i<this.sections.length;i+=2)e+=this.sections[i];return e}get newLength(){let e=0;for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i+1];e+=n<0?this.sections[i]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,n=0,r=0;i<this.sections.length;){let s=this.sections[i++],a=this.sections[i++];a<0?(e(n,r,s),r+=s):r+=a,n+=s}}iterChangedRanges(e,i=!1){Yf(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];r<0?e.push(n,r):e.push(r,n)}return new hn(e)}composeDesc(e){return this.empty?e:e.empty?this:f1(this,e)}mapDesc(e,i=!1){return e.empty?this:Gf(this,e,i)}mapPos(e,i=-1,n=Zt.Simple){let r=0,s=0;for(let a=0;a<this.sections.length;){let l=this.sections[a++],u=this.sections[a++],h=r+l;if(u<0){if(h>e)return s+(e-r);s+=l}else{if(n!=Zt.Simple&&h>=e&&(n==Zt.TrackDel&&r<e&&h>e||n==Zt.TrackBefore&&r<e||n==Zt.TrackAfter&&h>e))return null;if(h>e||h==e&&i<0&&!l)return e==r||i<0?s:s+u;s+=u}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,i=e){for(let n=0,r=0;n<this.sections.length&&r<=i;){let s=this.sections[n++],a=this.sections[n++],l=r+s;if(a>=0&&r<=i&&l>=e)return r<e&&l>i?"cover":!0;r=l}return!1}toString(){let e="";for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new hn(e)}static create(e){return new hn(e)}}class Lt extends hn{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Yf(this,(i,n,r,s,a)=>e=e.replace(r,r+(n-i),a),!1),e}mapDesc(e,i=!1){return Gf(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let r=0,s=0;r<i.length;r+=2){let a=i[r],l=i[r+1];if(l>=0){i[r]=l,i[r+1]=a;let u=r>>1;for(;n.length<u;)n.push(at.empty);n.push(a?e.slice(s,s+a):at.empty)}s+=a}return new Lt(i,n)}compose(e){return this.empty?e:e.empty?this:f1(this,e,!0)}map(e,i=!1){return e.empty?this:Gf(this,e,i,!0)}iterChanges(e,i=!1){Yf(this,e,i)}get desc(){return hn.create(this.sections)}filter(e){let i=[],n=[],r=[],s=new _o(this);e:for(let a=0,l=0;;){let u=a==e.length?1e9:e[a++];for(;l<u||l==u&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,u-l);Wt(r,c,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;Wt(i,c,p),p>0&&Jn(n,i,s.text),s.forward(c),l+=c}let h=e[a++];for(;l<h;){if(s.done)break e;let c=Math.min(s.len,h-l);Wt(i,c,-1),Wt(r,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),l+=c}}return{changes:new Lt(i,n),filtered:hn.create(r)}}toJSON(){let e=[];for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i],r=this.sections[i+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[i>>1].toJSON()))}return e}static of(e,i,n){let r=[],s=[],a=0,l=null;function u(c=!1){if(!c&&!r.length)return;a<i&&Wt(r,i-a,-1);let p=new Lt(r,s);l=l?l.compose(p.map(l)):p,r=[],s=[],a=0}function h(c){if(Array.isArray(c))for(let p of c)h(p);else if(c instanceof Lt){if(c.length!=i)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${i})`);u(),l=l?l.compose(c.map(l)):c}else{let{from:p,to:v=p,insert:g}=c;if(p>v||p<0||v>i)throw new RangeError(`Invalid change range ${p} to ${v} (in doc of length ${i})`);let b=g?typeof g=="string"?at.of(g.split(n||Wf)):g:at.empty,m=b.length;if(p==v&&m==0)return;p<a&&u(),p>a&&Wt(r,p-a,-1),Wt(r,v-p,m),Jn(s,r,b),a=v}}return h(e),u(!l),l}static empty(e){return new Lt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let i=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")i.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,l)=>l&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)i.push(s[0],0);else{for(;n.length<r;)n.push(at.empty);n[r]=at.of(s.slice(1)),i.push(s[0],n[r].length)}}}return new Lt(i,n)}static createSet(e,i){return new Lt(e,i)}}function Wt(t,e,i,n=!1){if(e==0&&i<=0)return;let r=t.length-2;r>=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=i:n?(t[r]+=e,t[r+1]+=i):t.push(e,i)}function Jn(t,e,i){if(i.length==0)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(at.empty);t.push(i)}}function Yf(t,e,i){let n=t.inserted;for(let r=0,s=0,a=0;a<t.sections.length;){let l=t.sections[a++],u=t.sections[a++];if(u<0)r+=l,s+=l;else{let h=r,c=s,p=at.empty;for(;h+=l,c+=u,u&&n&&(p=p.append(n[a-2>>1])),!(i||a==t.sections.length||t.sections[a+1]<0);)l=t.sections[a++],u=t.sections[a++];e(r,h,s,c,p),r=h,s=c}}}function Gf(t,e,i,n=!1){let r=[],s=n?[]:null,a=new _o(t),l=new _o(e);for(let u=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let h=Math.min(a.len,l.len);Wt(r,h,-1),a.forward(h),l.forward(h)}else if(l.ins>=0&&(a.ins<0||u==a.i||a.off==0&&(l.len<a.len||l.len==a.len&&!i))){let h=l.len;for(Wt(r,l.ins,-1);h;){let c=Math.min(a.len,h);a.ins>=0&&u<a.i&&a.len<=c&&(Wt(r,0,a.ins),s&&Jn(s,r,a.text),u=a.i),a.forward(c),h-=c}l.next()}else if(a.ins>=0){let h=0,c=a.len;for(;c;)if(l.ins==-1){let p=Math.min(c,l.len);h+=p,c-=p,l.forward(p)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;Wt(r,h,u<a.i?a.ins:0),s&&u<a.i&&Jn(s,r,a.text),u=a.i,a.forward(a.len-c)}else{if(a.done&&l.done)return s?Lt.createSet(r,s):hn.create(r);throw new Error("Mismatched change set lengths")}}}function f1(t,e,i=!1){let n=[],r=i?[]:null,s=new _o(t),a=new _o(e);for(let l=!1;;){if(s.done&&a.done)return r?Lt.createSet(n,r):hn.create(n);if(s.ins==0)Wt(n,s.len,0,l),s.next();else if(a.len==0&&!a.done)Wt(n,0,a.ins,l),r&&Jn(r,n,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,a.len),h=n.length;if(s.ins==-1){let c=a.ins==-1?-1:a.off?0:a.ins;Wt(n,u,c,l),r&&c&&Jn(r,n,a.text)}else a.ins==-1?(Wt(n,s.off?0:s.len,u,l),r&&Jn(r,n,s.textBit(u))):(Wt(n,s.off?0:s.len,a.off?0:a.ins,l),r&&!a.off&&Jn(r,n,a.text));l=(s.ins>u||a.ins>=0&&a.len>u)&&(l||n.length>h),s.forward2(u),a.forward(u)}}}}class _o{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length?at.empty:e[i]}textBit(e){let{inserted:i}=this.set,n=this.i-2>>1;return n>=i.length&&!e?at.empty:i[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ir{constructor(e,i,n){this.from=e,this.to=i,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,i=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,i):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new Ir(n,r,this.flags)}extend(e,i=e,n=0){if(e<=this.anchor&&i>=this.anchor)return Oe.range(e,i,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(i-this.anchor)?e:i;return Oe.range(this.anchor,r,void 0,void 0,n)}eq(e,i=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!i||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Oe.range(e.anchor,e.head)}static create(e,i,n){return new Ir(e,i,n)}}class Oe{constructor(e,i){this.ranges=e,this.mainIndex=i}map(e,i=-1){return e.empty?this:Oe.create(this.ranges.map(n=>n.map(e,i)),this.mainIndex)}eq(e,i=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],i))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Oe([this.main],0)}addRange(e,i=!0){return Oe.create([e].concat(this.ranges),i?0:this.mainIndex+1)}replaceRange(e,i=this.mainIndex){let n=this.ranges.slice();return n[i]=e,Oe.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Oe(e.ranges.map(i=>Ir.fromJSON(i)),e.main)}static single(e,i=e){return new Oe([Oe.range(e,i)],0)}static create(e,i=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=n:s.from<n)return Oe.normalized(e.slice(),i);n=s.to}return new Oe(e,i)}static cursor(e,i=0,n,r){return Ir.create(e,e,(i==0?0:i<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,i,n,r,s){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!s&&e!=i&&(s=i<e?1:-1),i<e?Ir.create(i,e,48|a):Ir.create(e,i,(s?s<0?8:16:0)|a)}static normalized(e,i=0){let n=e[i];e.sort((r,s)=>r.from-s.from),i=e.indexOf(n);for(let r=1;r<e.length;r++){let s=e[r],a=e[r-1];if(s.empty?s.from<=a.to:s.from<a.to){let l=a.from,u=Math.max(s.to,a.to);r<=i&&i--,e.splice(--r,2,s.anchor>s.head?Oe.range(u,l):Oe.range(l,u))}}return new Oe(e,i)}}function d1(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let Op=0;class Me{constructor(e,i,n,r,s){this.combine=e,this.compareInput=i,this.compare=n,this.isStatic=r,this.id=Op++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Me(e.combine||(i=>i),e.compareInput||((i,n)=>i===n),e.compare||(e.combine?(i,n)=>i===n:xp),!!e.static,e.enables)}of(e){return new Cu([],this,0,e)}compute(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Cu(e,this,1,i)}computeN(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Cu(e,this,2,i)}from(e,i){return i||(i=n=>n),this.compute([e],n=>i(n.field(e)))}}function xp(t,e){return t==e||t.length==e.length&&t.every((i,n)=>i===e[n])}class Cu{constructor(e,i,n,r){this.dependencies=e,this.facet=i,this.type=n,this.value=r,this.id=Op++}dynamicSlot(e){var i;let n=this.value,r=this.facet.compareInput,s=this.id,a=e[s]>>1,l=this.type==2,u=!1,h=!1,c=[];for(let p of this.dependencies)p=="doc"?u=!0:p=="selection"?h=!0:(((i=e[p.id])!==null&&i!==void 0?i:1)&1)==0&&c.push(e[p.id]);return{create(p){return p.values[a]=n(p),1},update(p,v){if(u&&v.docChanged||h&&(v.docChanged||v.selection)||Hf(p,c)){let g=n(p);if(l?!k0(g,p.values[a],r):!r(g,p.values[a]))return p.values[a]=g,1}return 0},reconfigure:(p,v)=>{let g,b=v.config.address[s];if(b!=null){let m=ec(v,b);if(this.dependencies.every(x=>x instanceof Me?v.facet(x)===p.facet(x):x instanceof Ut?v.field(x,!1)==p.field(x,!1):!0)||(l?k0(g=n(p),m,r):r(g=n(p),m)))return p.values[a]=m,0}else g=n(p);return p.values[a]=g,1}}}}function k0(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function Hf(t,e){let i=!1;for(let n of e)oo(t,n)&1&&(i=!0);return i}function g3(t,e,i){let n=i.map(u=>t[u.id]),r=i.map(u=>u.type),s=n.filter(u=>!(u&1)),a=t[e.id]>>1;function l(u){let h=[];for(let c=0;c<n.length;c++){let p=ec(u,n[c]);if(r[c]==2)for(let v of p)h.push(v);else h.push(p)}return e.combine(h)}return{create(u){for(let h of n)oo(u,h);return u.values[a]=l(u),1},update(u,h){if(!Hf(u,s))return 0;let c=l(u);return e.compare(c,u.values[a])?0:(u.values[a]=c,1)},reconfigure(u,h){let c=Hf(u,n),p=h.config.facets[e.id],v=h.facet(e);if(p&&!c&&xp(i,p))return u.values[a]=v,0;let g=l(u);return e.compare(g,v)?(u.values[a]=v,0):(u.values[a]=g,1)}}}const Zl=Me.define({static:!0});class Ut{constructor(e,i,n,r,s){this.id=e,this.createF=i,this.updateF=n,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let i=new Ut(Op++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(i.provides=e.provide(i)),i}create(e){let i=e.facet(Zl).find(n=>n.field==this);return(i?.create||this.createF)(e)}slot(e){let i=e[this.id]>>1;return{create:n=>(n.values[i]=this.create(n),1),update:(n,r)=>{let s=n.values[i],a=this.updateF(s,r);return this.compareF(s,a)?0:(n.values[i]=a,1)},reconfigure:(n,r)=>{let s=n.facet(Zl),a=r.facet(Zl),l;return(l=s.find(u=>u.field==this))&&l!=a.find(u=>u.field==this)?(n.values[i]=l.create(n),1):r.config.address[this.id]!=null?(n.values[i]=r.field(this),0):(n.values[i]=this.create(n),1)}}}init(e){return[this,Zl.of({field:this,create:e})]}get extension(){return this}}const kr={lowest:4,low:3,default:2,high:1,highest:0};function da(t){return e=>new p1(e,t)}const fr={highest:da(kr.highest),high:da(kr.high),default:da(kr.default),low:da(kr.low),lowest:da(kr.lowest)};class p1{constructor(e,i){this.inner=e,this.prec=i}}class nl{of(e){return new Jf(this,e)}reconfigure(e){return nl.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Jf{constructor(e,i){this.compartment=e,this.inner=i}}class Ku{constructor(e,i,n,r,s,a){for(this.base=e,this.compartments=i,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let i=this.address[e.id];return i==null?e.default:this.staticValues[i>>1]}static resolve(e,i,n){let r=[],s=Object.create(null),a=new Map;for(let v of y3(e,i,a))v instanceof Ut?r.push(v):(s[v.facet.id]||(s[v.facet.id]=[])).push(v);let l=Object.create(null),u=[],h=[];for(let v of r)l[v.id]=h.length<<1,h.push(g=>v.slot(g));let c=n?.config.facets;for(let v in s){let g=s[v],b=g[0].facet,m=c&&c[v]||[];if(g.every(x=>x.type==0))if(l[b.id]=u.length<<1|1,xp(m,g))u.push(n.facet(b));else{let x=b.combine(g.map(O=>O.value));u.push(n&&b.compare(x,n.facet(b))?n.facet(b):x)}else{for(let x of g)x.type==0?(l[x.id]=u.length<<1|1,u.push(x.value)):(l[x.id]=h.length<<1,h.push(O=>x.dynamicSlot(O)));l[b.id]=h.length<<1,h.push(x=>g3(x,b,g))}}let p=h.map(v=>v(l));return new Ku(e,a,p,l,u,s)}}function y3(t,e,i){let n=[[],[],[],[],[]],r=new Map;function s(a,l){let u=r.get(a);if(u!=null){if(u<=l)return;let h=n[u].indexOf(a);h>-1&&n[u].splice(h,1),a instanceof Jf&&i.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let h of a)s(h,l);else if(a instanceof Jf){if(i.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(a.compartment)||a.inner;i.set(a.compartment,h),s(h,l)}else if(a instanceof p1)s(a.inner,a.prec);else if(a instanceof Ut)n[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof Cu)n[l].push(a),a.facet.extensions&&s(a.facet.extensions,kr.default);else{let h=a.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(t,kr.default),n.reduce((a,l)=>a.concat(l))}function oo(t,e){if(e&1)return 2;let i=e>>1,n=t.status[i];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[i]=4;let r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r}function ec(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const m1=Me.define(),Kf=Me.define({combine:t=>t.some(e=>e),static:!0}),g1=Me.define({combine:t=>t.length?t[0]:void 0,static:!0}),y1=Me.define(),v1=Me.define(),O1=Me.define(),x1=Me.define({combine:t=>t.length?t[0]:!1});class Ln{constructor(e,i){this.type=e,this.value=i}static define(){return new v3}}class v3{of(e){return new Ln(this,e)}}class O3{constructor(e){this.map=e}of(e){return new We(this,e)}}class We{constructor(e,i){this.type=e,this.value=i}map(e){let i=this.type.map(this.value,e);return i===void 0?void 0:i==this.value?this:new We(this.type,i)}is(e){return this.type==e}static define(e={}){return new O3(e.map||(i=>i))}static mapEffects(e,i){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(i);s&&n.push(s)}return n}}We.reconfigure=We.define();We.appendConfig=We.define();class Mt{constructor(e,i,n,r,s,a){this.startState=e,this.changes=i,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,n&&d1(n,i.newLength),s.some(l=>l.type==Mt.time)||(this.annotations=s.concat(Mt.time.of(Date.now())))}static create(e,i,n,r,s,a){return new Mt(e,i,n,r,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let i of this.annotations)if(i.type==e)return i.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let i=this.annotation(Mt.userEvent);return!!(i&&(i==e||i.length>e.length&&i.slice(0,e.length)==e&&i[e.length]=="."))}}Mt.time=Ln.define();Mt.userEvent=Ln.define();Mt.addToHistory=Ln.define();Mt.remote=Ln.define();function x3(t,e){let i=[];for(let n=0,r=0;;){let s,a;if(n<t.length&&(r==e.length||e[r]>=t[n]))s=t[n++],a=t[n++];else if(r<e.length)s=e[r++],a=e[r++];else return i;!i.length||i[i.length-1]<s?i.push(s,a):i[i.length-1]<a&&(i[i.length-1]=a)}}function b1(t,e,i){var n;let r,s,a;return i?(r=e.changes,s=Lt.empty(e.changes.length),a=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(r)),{changes:a,selection:e.selection?e.selection.map(s):(n=t.selection)===null||n===void 0?void 0:n.map(r),effects:We.mapEffects(t.effects,r).concat(We.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function ed(t,e,i){let n=e.selection,r=ys(e.annotations);return e.userEvent&&(r=r.concat(Mt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Lt?e.changes:Lt.of(e.changes||[],i,t.facet(g1)),selection:n&&(n instanceof Oe?n:Oe.single(n.anchor,n.head)),effects:ys(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function S1(t,e,i){let n=ed(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(i=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(i=!1);let a=!!e[s].sequential;n=b1(n,ed(t,e[s],a?n.changes.newLength:t.doc.length),a)}let r=Mt.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return S3(i?b3(r):r)}function b3(t){let e=t.startState,i=!0;for(let r of e.facet(y1)){let s=r(t);if(s===!1){i=!1;break}Array.isArray(s)&&(i=i===!0?s:x3(i,s))}if(i!==!0){let r,s;if(i===!1)s=t.changes.invertedDesc,r=Lt.empty(e.doc.length);else{let a=t.changes.filter(i);r=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=Mt.create(e,r,t.selection&&t.selection.map(s),We.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let n=e.facet(v1);for(let r=n.length-1;r>=0;r--){let s=n[r](t);s instanceof Mt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Mt?t=s[0]:t=S1(e,ys(s),!1)}return t}function S3(t){let e=t.startState,i=e.facet(O1),n=t;for(let r=i.length-1;r>=0;r--){let s=i[r](t);s&&Object.keys(s).length&&(n=b1(n,ed(e,s,t.changes.newLength),!0))}return n==t?t:Mt.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const w3=[];function ys(t){return t==null?w3:Array.isArray(t)?t:[t]}var St=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(St||(St={}));const P3=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let td;try{td=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function T3(t){if(td)return td.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>""&&(i.toUpperCase()!=i.toLowerCase()||P3.test(i)))return!0}return!1}function C3(t){return e=>{if(!/\S/.test(e))return St.Space;if(T3(e))return St.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return St.Word;return St.Other}}class rt{constructor(e,i,n,r,s,a){this.config=e,this.doc=i,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)oo(this,l<<1);this.computeSlot=null}field(e,i=!0){let n=this.config.address[e.id];if(n==null){if(i)throw new RangeError("Field is not present in this state");return}return oo(this,n),ec(this,n)}update(...e){return S1(this,e,!0)}applyTransaction(e){let i=this.config,{base:n,compartments:r}=i;for(let l of e.effects)l.is(nl.reconfigure)?(i&&(r=new Map,i.compartments.forEach((u,h)=>r.set(h,u)),i=null),r.set(l.value.compartment,l.value.extension)):l.is(We.reconfigure)?(i=null,n=l.value):l.is(We.appendConfig)&&(i=null,n=ys(n).concat(l.value));let s;i?s=e.startState.values.slice():(i=Ku.resolve(n,r,this),s=new rt(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(u,h)=>h.reconfigure(u,this),null).values);let a=e.startState.facet(Kf)?e.newSelection:e.newSelection.asSingle();new rt(i,e.newDoc,a,s,(l,u)=>u.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:e},range:Oe.cursor(i.from+e.length)}))}changeByRange(e){let i=this.selection,n=e(i.ranges[0]),r=this.changes(n.changes),s=[n.range],a=ys(n.effects);for(let l=1;l<i.ranges.length;l++){let u=e(i.ranges[l]),h=this.changes(u.changes),c=h.map(r);for(let v=0;v<l;v++)s[v]=s[v].map(c);let p=r.mapDesc(h,!0);s.push(u.range.map(p)),r=r.compose(c),a=We.mapEffects(a,c).concat(We.mapEffects(ys(u.effects),p))}return{changes:r,selection:Oe.create(s,i.mainIndex),effects:a}}changes(e=[]){return e instanceof Lt?e:Lt.of(e,this.doc.length,this.facet(rt.lineSeparator))}toText(e){return at.of(e.split(this.facet(rt.lineSeparator)||Wf))}sliceDoc(e=0,i=this.doc.length){return this.doc.sliceString(e,i,this.lineBreak)}facet(e){let i=this.config.address[e.id];return i==null?e.default:(oo(this,i),ec(this,i))}toJSON(e){let i={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Ut&&this.config.address[r.id]!=null&&(i[n]=r.spec.toJSON(this.field(e[n]),this))}return i}static fromJSON(e,i={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let a=n[s],l=e[s];r.push(a.init(u=>a.spec.fromJSON(l,u)))}}return rt.create({doc:e.doc,selection:Oe.fromJSON(e.selection),extensions:i.extensions?r.concat([i.extensions]):r})}static create(e={}){let i=Ku.resolve(e.extensions||[],new Map),n=e.doc instanceof at?e.doc:at.of((e.doc||"").split(i.staticFacet(rt.lineSeparator)||Wf)),r=e.selection?e.selection instanceof Oe?e.selection:Oe.single(e.selection.anchor,e.selection.head):Oe.single(0);return d1(r,n.length),i.staticFacet(Kf)||(r=r.asSingle()),new rt(i,n,r,i.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(rt.tabSize)}get lineBreak(){return this.facet(rt.lineSeparator)||`
|
|
196
|
+
`}get readOnly(){return this.facet(x1)}phrase(e,...i){for(let n of this.facet(rt.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>i.length?n:i[s-1]})),e}languageDataAt(e,i,n=-1){let r=[];for(let s of this.facet(m1))for(let a of s(this,i,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let i=this.languageDataAt("wordChars",e);return C3(i.length?i[0]:"")}wordAt(e){let{text:i,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-n,l=e-n;for(;a>0;){let u=Rt(i,a,!1);if(s(i.slice(u,a))!=St.Word)break;a=u}for(;l<r;){let u=Rt(i,l);if(s(i.slice(l,u))!=St.Word)break;l=u}return a==l?null:Oe.range(a+n,l+n)}}rt.allowMultipleSelections=Kf;rt.tabSize=Me.define({combine:t=>t.length?t[0]:4});rt.lineSeparator=g1;rt.readOnly=x1;rt.phrases=Me.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(r=>t[r]==e[r])}});rt.languageData=m1;rt.changeFilter=y1;rt.transactionFilter=v1;rt.transactionExtender=O1;nl.reconfigure=We.define();function mn(t,e,i={}){let n={};for(let r of t)for(let s of Object.keys(r)){let a=r[s],l=n[s];if(l===void 0)n[s]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(i,s))n[s]=i[s](l,a);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class nr{eq(e){return this==e}range(e,i=e){return id.create(e,i,this)}}nr.prototype.startSide=nr.prototype.endSide=0;nr.prototype.point=!1;nr.prototype.mapMode=Zt.TrackDel;function bp(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let id=class w1{constructor(e,i,n){this.from=e,this.to=i,this.value=n}static create(e,i,n){return new w1(e,i,n)}};function nd(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Sp{constructor(e,i,n,r){this.from=e,this.to=i,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,i,n,r=0){let s=n?this.to:this.from;for(let a=r,l=s.length;;){if(a==l)return a;let u=a+l>>1,h=s[u]-e||(n?this.value[u].endSide:this.value[u].startSide)-i;if(u==a)return h>=0?a:l;h>=0?l=u:a=u+1}}between(e,i,n,r){for(let s=this.findIndex(i,-1e9,!0),a=this.findIndex(n,1e9,!1,s);s<a;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,i){let n=[],r=[],s=[],a=-1,l=-1;for(let u=0;u<this.value.length;u++){let h=this.value[u],c=this.from[u]+e,p=this.to[u]+e,v,g;if(c==p){let b=i.mapPos(c,h.startSide,h.mapMode);if(b==null||(v=g=b,h.startSide!=h.endSide&&(g=i.mapPos(c,h.endSide),g<v)))continue}else if(v=i.mapPos(c,h.startSide),g=i.mapPos(p,h.endSide),v>g||v==g&&h.startSide>0&&h.endSide<=0)continue;(g-v||h.endSide-h.startSide)<0||(a<0&&(a=v),h.point&&(l=Math.max(l,g-v)),n.push(h),r.push(v-a),s.push(g-a))}return{mapped:n.length?new Sp(r,s,n,l):null,pos:a}}}class tt{constructor(e,i,n,r){this.chunkPos=e,this.chunk=i,this.nextLayer=n,this.maxPoint=r}static create(e,i,n,r){return new tt(e,i,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let i of this.chunk)e+=i.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:i=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,a=e.filter;if(i.length==0&&!a)return this;if(n&&(i=i.slice().sort(nd)),this.isEmpty)return i.length?tt.of(i):this;let l=new P1(this,null,-1).goto(0),u=0,h=[],c=new In;for(;l.value||u<i.length;)if(u<i.length&&(l.from-i[u].from||l.startSide-i[u].value.startSide)>=0){let p=i[u++];c.addInner(p.from,p.to,p.value)||h.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(u==i.length||this.chunkEnd(l.chunkIndex)<i[u].from)&&(!a||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!a||r>l.to||s<l.from||a(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(id.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?tt.empty:this.nextLayer.update({add:h,filter:a,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let i=[],n=[],r=-1;for(let a=0;a<this.chunk.length;a++){let l=this.chunkPos[a],u=this.chunk[a],h=e.touchesRange(l,l+u.length);if(h===!1)r=Math.max(r,u.maxPoint),i.push(u),n.push(e.mapPos(l));else if(h===!0){let{mapped:c,pos:p}=u.map(l,e);c&&(r=Math.max(r,c.maxPoint),i.push(c),n.push(p))}}let s=this.nextLayer.map(e);return i.length==0?s:new tt(n,i,s||tt.empty,r)}between(e,i,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],a=this.chunk[r];if(i>=s&&e<=s+a.length&&a.between(s,e-s,i-s,n)===!1)return}this.nextLayer.between(e,i,n)}}iter(e=0){return Io.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return Io.from(e).goto(i)}static compare(e,i,n,r,s=-1){let a=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),l=i.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),u=E0(a,l,n),h=new pa(a,u,s),c=new pa(l,u,s);n.iterGaps((p,v,g)=>A0(h,p,c,v,g,r)),n.empty&&n.length==0&&A0(h,0,c,0,0,r)}static eq(e,i,n=0,r){r==null&&(r=999999999);let s=e.filter(c=>!c.isEmpty&&i.indexOf(c)<0),a=i.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let l=E0(s,a),u=new pa(s,l,0).goto(n),h=new pa(a,l,0).goto(n);for(;;){if(u.to!=h.to||!rd(u.active,h.active)||u.point&&(!h.point||!bp(u.point,h.point)))return!1;if(u.to>r)return!0;u.next(),h.next()}}static spans(e,i,n,r,s=-1){let a=new pa(e,null,s).goto(i),l=i,u=a.openStart;for(;;){let h=Math.min(a.to,n);if(a.point){let c=a.activeForPoint(a.to),p=a.pointFrom<i?c.length+1:a.point.startSide<0?c.length:Math.min(c.length,u);r.point(l,h,a.point,c,p,a.pointRank),u=Math.min(a.openEnd(h),c.length)}else h>l&&(r.span(l,h,a.active,u),u=a.openEnd(h));if(a.to>n)return u+(a.point&&a.to>n?1:0);l=a.to,a.next()}}static of(e,i=!1){let n=new In;for(let r of e instanceof id?[e]:i?k3(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return tt.empty;let i=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=tt.empty;r=r.nextLayer)i=new tt(r.chunkPos,r.chunk,i,Math.max(r.maxPoint,i.maxPoint));return i}}tt.empty=new tt([],[],null,-1);function k3(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let n=t[i];if(nd(e,n)>0)return t.slice().sort(nd);e=n}return t}tt.empty.nextLayer=tt.empty;class In{finishChunk(e){this.chunks.push(new Sp(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,i,n){this.addInner(e,i,n)||(this.nextLayer||(this.nextLayer=new In)).add(e,i,n)}addInner(e,i,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(i-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=i,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,i-e)),!0)}addChunk(e,i){if((e-this.lastTo||i.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,i.maxPoint),this.chunks.push(i),this.chunkPos.push(e);let n=i.value.length-1;return this.last=i.value[n],this.lastFrom=i.from[n]+e,this.lastTo=i.to[n]+e,!0}finish(){return this.finishInner(tt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let i=tt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,i}}function E0(t,e,i){let n=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&n.set(s.chunk[a],s.chunkPos[a]);let r=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let l=n.get(s.chunk[a]);l!=null&&(i?i.mapPos(l):l)==s.chunkPos[a]&&!i?.touchesRange(l,l+s.chunk[a].length)&&r.add(s.chunk[a])}return r}class P1{constructor(e,i,n,r=0){this.layer=e,this.skip=i,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,i=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,i,!1),this}gotoInner(e,i,n){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],i,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,i){(this.to-e||this.endSide-i)<0&&this.gotoInner(e,i,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],i=this.layer.chunk[this.chunkIndex],n=e+i.from[this.rangeIndex];if(this.from=n,this.to=e+i.to[this.rangeIndex],this.value=i.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Io{constructor(e){this.heap=e}static from(e,i=null,n=-1){let r=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=n&&r.push(new P1(a,i,n,s));return r.length==1?r[0]:new Io(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,i=-1e9){for(let n of this.heap)n.goto(e,i);for(let n=this.heap.length>>1;n>=0;n--)zh(this.heap,n);return this.next(),this}forward(e,i){for(let n of this.heap)n.forward(e,i);for(let n=this.heap.length>>1;n>=0;n--)zh(this.heap,n);(this.to-e||this.value.endSide-i)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),zh(this.heap,0)}}}function zh(t,e){for(let i=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let r=t[n];if(n+1<t.length&&r.compare(t[n+1])>=0&&(r=t[n+1],n++),i.compare(r)<0)break;t[n]=i,t[e]=r,e=n}}class pa{constructor(e,i,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Io.from(e,i,n)}goto(e,i=-1e9){return this.cursor.goto(e,i),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=i,this.openStart=-1,this.next(),this}forward(e,i){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-i)<0;)this.removeActive(this.minActive);this.cursor.forward(e,i)}removeActive(e){Vl(this.active,e),Vl(this.activeTo,e),Vl(this.activeRank,e),this.minActive=D0(this.active,this.activeTo)}addActive(e){let i=0,{value:n,to:r,rank:s}=this.cursor;for(;i<this.activeRank.length&&(s-this.activeRank[i]||r-this.activeTo[i])>0;)i++;Ul(this.active,i,n),Ul(this.activeTo,i,r),Ul(this.activeRank,i,s),e&&Ul(e,i,this.cursor.from),this.minActive=D0(this.active,this.activeTo)}next(){let e=this.to,i=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Vl(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(i&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let r=n.length-1;r>=0&&n[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let i=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&i.push(this.active[n]);return i.reverse()}openEnd(e){let i=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)i++;return i}}function A0(t,e,i,n,r,s){t.goto(e),i.goto(n);let a=n+r,l=n,u=n-e,h=!!s.boundChange;for(let c=!1;;){let p=t.to+u-i.to,v=p||t.endSide-i.endSide,g=v<0?t.to+u:i.to,b=Math.min(g,a);if(t.point||i.point?(t.point&&i.point&&bp(t.point,i.point)&&rd(t.activeForPoint(t.to),i.activeForPoint(i.to))||s.comparePoint(l,b,t.point,i.point),c=!1):(c&&s.boundChange(l),b>l&&!rd(t.active,i.active)&&s.compareRange(l,b,t.active,i.active),h&&b<a&&(p||t.openEnd(g)!=i.openEnd(g))&&(c=!0)),g>a)break;l=g,v<=0&&t.next(),v>=0&&i.next()}}function rd(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!bp(t[i],e[i]))return!1;return!0}function Vl(t,e){for(let i=e,n=t.length-1;i<n;i++)t[i]=t[i+1];t.pop()}function Ul(t,e,i){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=i}function D0(t,e){let i=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||t[r].endSide-t[i].endSide)<0&&(i=r,n=e[r]);return i}function Rs(t,e,i=t.length){let n=0;for(let r=0;r<i&&r<t.length;)t.charCodeAt(r)==9?(n+=e-n%e,r++):(n++,r=Rt(t,r));return n}function sd(t,e,i,n){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?i-s%i:1,r=Rt(t,r)}return n===!0?-1:t.length}const ad="ͼ",_0=typeof Symbol>"u"?"__"+ad:Symbol.for(ad),od=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),I0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class rr{constructor(e,i){this.rules=[];let{finish:n}=i||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,l,u,h){let c=[],p=/^@(\w+)\b/.exec(a[0]),v=p&&p[1]=="keyframes";if(p&&l==null)return u.push(a[0]+";");for(let g in l){let b=l[g];if(/&/.test(g))s(g.split(/,\s*/).map(m=>a.map(x=>m.replace(/&/,x))).reduce((m,x)=>m.concat(x)),b,u);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),b,c,v)}else b!=null&&c.push(g.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+b+";")}(c.length||v)&&u.push((n&&!p&&!h?a.map(n):a).join(", ")+" {"+c.join(" ")+"}")}for(let a in e)s(r(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
|
197
|
+
`)}static newName(){let e=I0[_0]||1;return I0[_0]=e+1,ad+e.toString(36)}static mount(e,i,n){let r=e[od],s=n&&n.nonce;r?s&&r.setNonce(s):r=new E3(e,s),r.mount(Array.isArray(i)?i:[i],e)}}let N0=new Map;class E3{constructor(e,i){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=N0.get(n);if(s)return e[od]=s;this.sheet=new r.CSSStyleSheet,N0.set(n,this)}else this.styleTag=n.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[od]=this}mount(e,i){let n=this.sheet,r=0,s=0;for(let a=0;a<e.length;a++){let l=e[a],u=this.modules.indexOf(l);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,l),n)for(let h=0;h<l.rules.length;h++)n.insertRule(l.rules[h],r++)}else{for(;s<u;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)i.adoptedStyleSheets.indexOf(this.sheet)<0&&(i.adoptedStyleSheets=[this.sheet,...i.adoptedStyleSheets]);else{let a="";for(let u=0;u<this.modules.length;u++)a+=this.modules[u].getRules()+`
|
|
198
|
+
`;this.styleTag.textContent=a;let l=i.head||i;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var sr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},No={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},A3=typeof navigator<"u"&&/Mac/.test(navigator.platform),D3=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var jt=0;jt<10;jt++)sr[48+jt]=sr[96+jt]=String(jt);for(var jt=1;jt<=24;jt++)sr[jt+111]="F"+jt;for(var jt=65;jt<=90;jt++)sr[jt]=String.fromCharCode(jt+32),No[jt]=String.fromCharCode(jt);for(var Xh in sr)No.hasOwnProperty(Xh)||(No[Xh]=sr[Xh]);function _3(t){var e=A3&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||D3&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?No:sr)[t.keyCode]||t.key||"Unidentified";return i=="Esc"&&(i="Escape"),i=="Del"&&(i="Delete"),i=="Left"&&(i="ArrowLeft"),i=="Up"&&(i="ArrowUp"),i=="Right"&&(i="ArrowRight"),i=="Down"&&(i="ArrowDown"),i}function ct(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];typeof r=="string"?t.setAttribute(n,r):r!=null&&(t[n]=r)}e++}for(;e<arguments.length;e++)T1(t,arguments[e]);return t}function T1(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var i=0;i<e.length;i++)T1(t,e[i]);else throw new RangeError("Unsupported child node: "+e)}let Gt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ld=typeof document<"u"?document:{documentElement:{style:{}}};const ud=/Edge\/(\d+)/.exec(Gt.userAgent),C1=/MSIE \d/.test(Gt.userAgent),cd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gt.userAgent),Uc=!!(C1||cd||ud),M0=!Uc&&/gecko\/(\d+)/i.test(Gt.userAgent),jh=!Uc&&/Chrome\/(\d+)/.exec(Gt.userAgent),I3="webkitFontSmoothing"in ld.documentElement.style,hd=!Uc&&/Apple Computer/.test(Gt.vendor),$0=hd&&(/Mobile\/\w+/.test(Gt.userAgent)||Gt.maxTouchPoints>2);var Ie={mac:$0||/Mac/.test(Gt.platform),windows:/Win/.test(Gt.platform),linux:/Linux|X11/.test(Gt.platform),ie:Uc,ie_version:C1?ld.documentMode||6:cd?+cd[1]:ud?+ud[1]:0,gecko:M0,gecko_version:M0?+(/Firefox\/(\d+)/.exec(Gt.userAgent)||[0,0])[1]:0,chrome:!!jh,chrome_version:jh?+jh[1]:0,ios:$0,android:/Android\b/.test(Gt.userAgent),webkit_version:I3?+(/\bAppleWebKit\/(\d+)/.exec(Gt.userAgent)||[0,0])[1]:0,safari:hd,safari_version:hd?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Gt.userAgent)||[0,0])[1]:0,tabSize:ld.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function wp(t,e){for(let i in t)i=="class"&&e.class?e.class+=" "+t.class:i=="style"&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}const tc=Object.create(null);function Pp(t,e,i){if(t==e)return!0;t||(t=tc),e||(e=tc);let n=Object.keys(t),r=Object.keys(e);if(n.length-0!=r.length-0)return!1;for(let s of n)if(s!=i&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function N3(t,e){for(let i=t.attributes.length-1;i>=0;i--){let n=t.attributes[i].name;e[n]==null&&t.removeAttribute(n)}for(let i in e){let n=e[i];i=="style"?t.style.cssText=n:t.getAttribute(i)!=n&&t.setAttribute(i,n)}}function L0(t,e,i){let n=!1;if(e)for(let r in e)i&&r in i||(n=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(i)for(let r in i)e&&e[r]==i[r]||(n=!0,r=="style"?t.style.cssText=i[r]:t.setAttribute(r,i[r]));return n}function M3(t){let e=Object.create(null);for(let i=0;i<t.attributes.length;i++){let n=t.attributes[i];e[n.name]=n.value}return e}class Ri{eq(e){return!1}updateDOM(e,i,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,i,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Vt=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Vt||(Vt={}));class Ze extends nr{constructor(e,i,n,r){super(),this.startSide=e,this.endSide=i,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new rl(e)}static widget(e){let i=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return i+=n&&!e.inlineOrder?i>0?3e8:-4e8:i>0?1e8:-1e8,new qr(e,i,i,n,e.widget||null,!1)}static replace(e){let i=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:a}=k1(e,i);n=(s?i?-3e8:-1:5e8)-1,r=(a?i?2e8:1:-6e8)+1}return new qr(e,n,r,i,e.widget||null,!0)}static line(e){return new sl(e)}static set(e,i=!1){return tt.of(e,i)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ze.none=tt.empty;class rl extends Ze{constructor(e){let{start:i,end:n}=k1(e);super(i?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?wp(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||tc}eq(e){return this==e||e instanceof rl&&this.tagName==e.tagName&&Pp(this.attrs,e.attrs)}range(e,i=e){if(e>=i)throw new RangeError("Mark decorations may not be empty");return super.range(e,i)}}rl.prototype.point=!1;class sl extends Ze{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof sl&&this.spec.class==e.spec.class&&Pp(this.spec.attributes,e.spec.attributes)}range(e,i=e){if(i!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,i)}}sl.prototype.mapMode=Zt.TrackBefore;sl.prototype.point=!0;class qr extends Ze{constructor(e,i,n,r,s,a){super(i,n,s,e),this.block=r,this.isReplace=a,this.mapMode=r?i<=0?Zt.TrackBefore:Zt.TrackAfter:Zt.TrackDel}get type(){return this.startSide!=this.endSide?Vt.WidgetRange:this.startSide<=0?Vt.WidgetBefore:Vt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof qr&&$3(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,i=e){if(this.isReplace&&(e>i||e==i&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&i!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,i)}}qr.prototype.point=!0;function k1(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return i==null&&(i=t.inclusive),n==null&&(n=t.inclusive),{start:i??e,end:n??e}}function $3(t,e){return t==e||!!(t&&e&&t.compare(e))}function vs(t,e,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=t?i[r]=Math.max(i[r],e):i.push(t,e)}class Mo extends nr{constructor(e,i){super(),this.tagName=e,this.attributes=i}eq(e){return e==this||e instanceof Mo&&this.tagName==e.tagName&&Pp(this.attributes,e.attributes)}static create(e){return new Mo(e.tagName,e.attributes||tc)}static set(e,i=!1){return tt.of(e,i)}}Mo.prototype.startSide=Mo.prototype.endSide=-1;function $o(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function fd(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function lo(t,e){if(!e.anchorNode)return!1;try{return fd(t,e.anchorNode)}catch{return!1}}function uo(t){return t.nodeType==3?Bo(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function co(t,e,i,n){return i?B0(t,e,i,n,-1)||B0(t,e,i,n,1):!1}function ar(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function ic(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function B0(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:Nn(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=ar(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?Nn(t):0}else return!1}}function Nn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Lo(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function L3(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function E1(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function B3(t,e,i,n,r,s,a,l){let u=t.ownerDocument,h=u.defaultView||window;for(let c=t,p=!1;c&&!p;)if(c.nodeType==1){let v,g=c==u.body,b=1,m=1;if(g)v=L3(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(p=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let P=c.getBoundingClientRect();({scaleX:b,scaleY:m}=E1(c,P)),v={left:P.left,right:P.left+c.clientWidth*b,top:P.top,bottom:P.top+c.clientHeight*m}}let x=0,O=0;if(r=="nearest")e.top<v.top?(O=e.top-(v.top+a),i>0&&e.bottom>v.bottom+O&&(O=e.bottom-v.bottom+a)):e.bottom>v.bottom&&(O=e.bottom-v.bottom+a,i<0&&e.top-O<v.top&&(O=e.top-(v.top+a)));else{let P=e.bottom-e.top,S=v.bottom-v.top;O=(r=="center"&&P<=S?e.top+P/2-S/2:r=="start"||r=="center"&&i<0?e.top-a:e.bottom-S+a)-v.top}if(n=="nearest"?e.left<v.left?(x=e.left-(v.left+s),i>0&&e.right>v.right+x&&(x=e.right-v.right+s)):e.right>v.right&&(x=e.right-v.right+s,i<0&&e.left<v.left+x&&(x=e.left-(v.left+s))):x=(n=="center"?e.left+(e.right-e.left)/2-(v.right-v.left)/2:n=="start"==l?e.left-s:e.right-(v.right-v.left)+s)-v.left,x||O)if(g)h.scrollBy(x,O);else{let P=0,S=0;if(O){let w=c.scrollTop;c.scrollTop+=O/m,S=(c.scrollTop-w)*m}if(x){let w=c.scrollLeft;c.scrollLeft+=x/b,P=(c.scrollLeft-w)*b}e={left:e.left-P,top:e.top-S,right:e.right-P,bottom:e.bottom-S},P&&Math.abs(P-x)<1&&(n="nearest"),S&&Math.abs(S-O)<1&&(r="nearest")}if(g)break;(e.top<v.top||e.bottom>v.bottom||e.left<v.left||e.right>v.right)&&(e={left:Math.max(e.left,v.left),right:Math.min(e.right,v.right),top:Math.max(e.top,v.top),bottom:Math.min(e.bottom,v.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function A1(t,e=!0){let i=t.ownerDocument,n=null,r=null;for(let s=t.parentNode;s&&!(s==i.body||(!e||n)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class Q3{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:i,focusNode:n}=e;this.set(i,Math.min(e.anchorOffset,i?Nn(i):0),n,Math.min(e.focusOffset,n?Nn(n):0))}set(e,i,n,r){this.anchorNode=e,this.anchorOffset=i,this.focusNode=n,this.focusOffset=r}}let Sr=null;Ie.safari&&Ie.safari_version>=26&&(Sr=!1);function D1(t){if(t.setActive)return t.setActive();if(Sr)return t.focus(Sr);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(Sr==null?{get preventScroll(){return Sr={preventScroll:!0},!0}}:void 0),!Sr){Sr=!1;for(let i=0;i<e.length;){let n=e[i++],r=e[i++],s=e[i++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let Q0;function Bo(t,e,i=e){let n=Q0||(Q0=document.createRange());return n.setEnd(t,i),n.setStart(t,e),n}function Os(t,e,i,n){let r={key:e,code:e,keyCode:i,which:i,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",r);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function F3(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function R3(t,e){let i=e.focusNode,n=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=n)return!1;for(n=Math.min(n,Nn(i));;)if(n){if(i.nodeType!=1)return!1;let r=i.childNodes[n-1];r.contentEditable=="false"?n--:(i=r,n=Nn(i))}else{if(i==t)return!0;n=ar(i),i=i.parentNode}}function _1(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function I1(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n>0)return{node:i,offset:n};if(i.nodeType==1&&n>0){if(i.contentEditable=="false")return null;i=i.childNodes[n-1],n=Nn(i)}else if(i.parentNode&&!ic(i))n=ar(i),i=i.parentNode;else return null}}function N1(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n<i.nodeValue.length)return{node:i,offset:n};if(i.nodeType==1&&n<i.childNodes.length){if(i.contentEditable=="false")return null;i=i.childNodes[n],n=0}else if(i.parentNode&&!ic(i))n=ar(i)+1,i=i.parentNode;else return null}}class $i{constructor(e,i,n=!0){this.node=e,this.offset=i,this.precise=n}static before(e,i){return new $i(e.parentNode,ar(e),i)}static after(e,i){return new $i(e.parentNode,ar(e)+1,i)}}var yt=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(yt||(yt={}));const Wr=yt.LTR,Tp=yt.RTL;function M1(t){let e=[];for(let i=0;i<t.length;i++)e.push(1<<+t[i]);return e}const z3=M1("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),X3=M1("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),dd=Object.create(null),Ui=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),i=t.charCodeAt(1);dd[e]=i,dd[i]=-e}function $1(t){return t<=247?z3[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?X3[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const j3=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class sn{get dir(){return this.level%2?Tp:Wr}constructor(e,i,n){this.from=e,this.to=i,this.level=n}side(e,i){return this.dir==i==e?this.to:this.from}forward(e,i){return e==(this.dir==i)}static find(e,i,n,r){let s=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.from<=i&&l.to>=i){if(l.level==n)return a;(s<0||(r!=0?r<0?l.from<i:l.to>i:e[s].level>l.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function L1(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],r=e[i];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!L1(n.inner,r.inner))return!1}return!0}const mt=[];function Z3(t,e,i,n,r){for(let s=0;s<=n.length;s++){let a=s?n[s-1].to:e,l=s<n.length?n[s].from:i,u=s?256:r;for(let h=a,c=u,p=u;h<l;h++){let v=$1(t.charCodeAt(h));v==512?v=c:v==8&&p==4&&(v=16),mt[h]=v==4?2:v,v&7&&(p=v),c=v}for(let h=a,c=u,p=u;h<l;h++){let v=mt[h];if(v==128)h<l-1&&c==mt[h+1]&&c&24?v=mt[h]=c:mt[h]=256;else if(v==64){let g=h+1;for(;g<l&&mt[g]==64;)g++;let b=h&&c==8||g<i&&mt[g]==8?p==1?1:8:256;for(let m=h;m<g;m++)mt[m]=b;h=g-1}else v==8&&p==1&&(mt[h]=1);c=v,v&7&&(p=v)}}}function V3(t,e,i,n,r){let s=r==1?2:1;for(let a=0,l=0,u=0;a<=n.length;a++){let h=a?n[a-1].to:e,c=a<n.length?n[a].from:i;for(let p=h,v,g,b;p<c;p++)if(g=dd[v=t.charCodeAt(p)])if(g<0){for(let m=l-3;m>=0;m-=3)if(Ui[m+1]==-g){let x=Ui[m+2],O=x&2?r:x&4?x&1?s:r:0;O&&(mt[p]=mt[Ui[m]]=O),l=m;break}}else{if(Ui.length==189)break;Ui[l++]=p,Ui[l++]=v,Ui[l++]=u}else if((b=mt[p])==2||b==1){let m=b==r;u=m?0:1;for(let x=l-3;x>=0;x-=3){let O=Ui[x+2];if(O&2)break;if(m)Ui[x+2]|=2;else{if(O&4)break;Ui[x+2]|=4}}}}}function U3(t,e,i,n){for(let r=0,s=n;r<=i.length;r++){let a=r?i[r-1].to:t,l=r<i.length?i[r].from:e;for(let u=a;u<l;){let h=mt[u];if(h==256){let c=u+1;for(;;)if(c==l){if(r==i.length)break;c=i[r++].to,l=r<i.length?i[r].from:e}else if(mt[c]==256)c++;else break;let p=s==1,v=(c<e?mt[c]:n)==1,g=p==v?p?1:2:n;for(let b=c,m=r,x=m?i[m-1].to:t;b>u;)b==x&&(b=i[--m].from,x=m?i[m-1].to:t),mt[--b]=g;u=c}else s=h,u++}}}function pd(t,e,i,n,r,s,a){let l=n%2?2:1;if(n%2==r%2)for(let u=e,h=0;u<i;){let c=!0,p=!1;if(h==s.length||u<s[h].from){let m=mt[u];m!=l&&(c=!1,p=m==16)}let v=!c&&l==1?[]:null,g=c?n:n+1,b=u;e:for(;;)if(h<s.length&&b==s[h].from){if(p)break e;let m=s[h];if(!c)for(let x=m.to,O=h+1;;){if(x==i)break e;if(O<s.length&&s[O].from==x)x=s[O++].to;else{if(mt[x]==l)break e;break}}if(h++,v)v.push(m);else{m.from>u&&a.push(new sn(u,m.from,g));let x=m.direction==Wr!=!(g%2);md(t,x?n+1:n,r,m.inner,m.from,m.to,a),u=m.to}b=m.to}else{if(b==i||(c?mt[b]!=l:mt[b]==l))break;b++}v?pd(t,u,b,n+1,r,v,a):u<b&&a.push(new sn(u,b,g)),u=b}else for(let u=i,h=s.length;u>e;){let c=!0,p=!1;if(!h||u>s[h-1].to){let m=mt[u-1];m!=l&&(c=!1,p=m==16)}let v=!c&&l==1?[]:null,g=c?n:n+1,b=u;e:for(;;)if(h&&b==s[h-1].to){if(p)break e;let m=s[--h];if(!c)for(let x=m.from,O=h;;){if(x==e)break e;if(O&&s[O-1].to==x)x=s[--O].from;else{if(mt[x-1]==l)break e;break}}if(v)v.push(m);else{m.to<u&&a.push(new sn(m.to,u,g));let x=m.direction==Wr!=!(g%2);md(t,x?n+1:n,r,m.inner,m.from,m.to,a),u=m.from}b=m.from}else{if(b==e||(c?mt[b-1]!=l:mt[b-1]==l))break;b--}v?pd(t,b,u,n+1,r,v,a):b<u&&a.push(new sn(b,u,g)),u=b}}function md(t,e,i,n,r,s,a){let l=e%2?2:1;Z3(t,r,s,n,l),V3(t,r,s,n,l),U3(r,s,n,l),pd(t,r,s,e,i,n,a)}function q3(t,e,i){if(!t)return[new sn(0,0,e==Tp?1:0)];if(e==Wr&&!i.length&&!j3.test(t))return B1(t.length);if(i.length)for(;t.length>mt.length;)mt[mt.length]=256;let n=[],r=e==Wr?0:1;return md(t,r,r,i,0,t.length,n),n}function B1(t){return[new sn(0,t,0)]}let Q1="";function W3(t,e,i,n,r){var s;let a=n.head-t.from,l=sn.find(e,a,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),u=e[l],h=u.side(r,i);if(a==h){let v=l+=r?1:-1;if(v<0||v>=e.length)return null;u=e[l=v],a=u.side(!r,i),h=u.side(r,i)}let c=Rt(t.text,a,u.forward(r,i));(c<u.from||c>u.to)&&(c=h),Q1=t.text.slice(Math.min(a,c),Math.max(a,c));let p=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return p&&c==h&&p.level+(r?0:1)<u.level?Oe.cursor(p.side(!r,i)+t.from,p.forward(r,i)?1:-1,p.level):Oe.cursor(c+t.from,u.forward(r,i)?-1:1,u.level)}function Y3(t,e,i){for(let n=e;n<i;n++){let r=$1(t.charCodeAt(n));if(r==1)return Wr;if(r==2||r==4)return Tp}return Wr}const F1=Me.define(),R1=Me.define(),z1=Me.define(),X1=Me.define(),gd=Me.define(),j1=Me.define(),Z1=Me.define(),Cp=Me.define(),kp=Me.define(),V1=Me.define({combine:t=>t.some(e=>e)}),U1=Me.define({combine:t=>t.some(e=>e)}),q1=Me.define();class xs{constructor(e,i="nearest",n="nearest",r=5,s=5,a=!1){this.range=e,this.y=i,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new xs(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new xs(Oe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ql=We.define({map:(t,e)=>t.map(e)}),W1=We.define();function li(t,e,i){let n=t.facet(X1);n.length?n[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const Tn=Me.define({combine:t=>t.length?t[0]:!0});let G3=0;const ls=Me.define({combine(t){return t.filter((e,i)=>{for(let n=0;n<i;n++)if(t[n].plugin==e.plugin)return!1;return!0})}});class Et{constructor(e,i,n,r,s){this.id=e,this.create=i,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(ls.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(ls.of({plugin:this,arg:e}))}static define(e,i){const{eventHandlers:n,eventObservers:r,provide:s,decorations:a}=i||{};return new Et(G3++,e,n,r,l=>{let u=[];return a&&u.push(qc.of(h=>{let c=h.plugin(l);return c?a(c):Ze.none})),s&&u.push(s(l)),u})}static fromClass(e,i){return Et.define((n,r)=>new e(n,r),i)}}class Zh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let i=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(i)}catch(n){if(li(i.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(i){li(e.state,i,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var i;if(!((i=this.value)===null||i===void 0)&&i.destroy)try{this.value.destroy()}catch(n){li(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Y1=Me.define(),Ep=Me.define(),qc=Me.define(),G1=Me.define(),Ap=Me.define(),al=Me.define(),H1=Me.define();function F0(t,e){let i=t.state.facet(H1);if(!i.length)return i;let n=i.map(s=>s instanceof Function?s(t):s),r=[];return tt.spans(n,e.from,e.to,{point(){},span(s,a,l,u){let h=s-e.from,c=a-e.from,p=r;for(let v=l.length-1;v>=0;v--,u--){let g=l[v].spec.bidiIsolate,b;if(g==null&&(g=Y3(e.text,h,c)),u>0&&p.length&&(b=p[p.length-1]).to==h&&b.direction==g)b.to=c,p=b.inner;else{let m={from:h,to:c,direction:g,inner:[]};p.push(m),p=m.inner}}}}),r}const J1=Me.define();function Dp(t){let e=0,i=0,n=0,r=0;for(let s of t.state.facet(J1)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(i=Math.max(i,a.right)),a.top!=null&&(n=Math.max(n,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:e,right:i,top:n,bottom:r}}const Ja=Me.define();class wi{constructor(e,i,n,r){this.fromA=e,this.toA=i,this.fromB=n,this.toB=r}join(e){return new wi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let i=e.length,n=this;for(;i>0;i--){let r=e[i-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(i-1,1)}}return e.splice(i,0,n),e}static extendWithRanges(e,i){if(i.length==0)return e;let n=[];for(let r=0,s=0,a=0;;){let l=r<e.length?e[r].fromB:1e9,u=s<i.length?i[s]:1e9,h=Math.min(l,u);if(h==1e9)break;let c=h+a,p=h,v=c;for(;;)if(s<i.length&&i[s]<=p){let g=i[s+1];s+=2,p=Math.max(p,g);for(let b=r;b<e.length&&e[b].fromB<=p;b++)a=e[b].toA-e[b].toB;v=Math.max(v,g+a)}else if(r<e.length&&e[r].fromB<=p){let g=e[r++];p=Math.max(p,g.toB),v=Math.max(v,g.toA),a=g.toA-g.toB}else break;n.push(new wi(c,v,h,p))}return n}}class nc{constructor(e,i,n){this.view=e,this.state=i,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Lt.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,a,l,u)=>r.push(new wi(s,a,l,u))),this.changedRanges=r}static create(e,i,n){return new nc(e,i,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const H3=[];class kt{constructor(e,i,n=0){this.dom=e,this.length=i,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return H3}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let i=this.domAttrs;i&&N3(this.dom,i)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,i=this.posAtStart){let n=i;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,i){return null}domPosFor(e,i){let n=ar(this.dom),r=this.length?e>0:i>0;return new $i(this.parent.dom,n+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Yc)return e;return null}static get(e){return e.cmTile}}class Wc extends kt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let i=this.dom,n=null,r,s=e?.node==i?e:null,a=0;for(let l of this.children){if(l.sync(e),a+=l.length+l.breakAfter,r=n?n.nextSibling:i.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==i)for(;r&&r!=l.dom;)r=R0(r);else i.insertBefore(l.dom,r);n=l.dom}for(r=n?n.nextSibling:i.firstChild,s&&r&&(s.written=!0);r;)r=R0(r);this.length=a}}function R0(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Yc extends Wc{constructor(e,i){super(i),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let i=kt.get(e);if(i&&this.owns(i))return i;e=e.parentNode}}blockTiles(e){for(let i=[],n=this,r=0,s=0;;)if(r==n.children.length){if(!i.length)return;n=n.parent,n.breakAfter&&s++,r=i.pop()}else{let a=n.children[r++];if(a instanceof An)i.push(r),n=a,r=0;else{let l=s+a.length,u=e(a,s);if(u!==void 0)return u;s=l+a.breakAfter}}}resolveBlock(e,i){let n,r=-1,s,a=-1;if(this.blockTiles((l,u)=>{let h=u+l.length;if(e>=u&&e<=h){if(l.isWidget()&&i>=-1&&i<=1){if(l.flags&32)return!0;l.flags&16&&(n=void 0)}(u<e||e==h&&(i<-1?l.length:l.covers(1)))&&(!n||!l.isWidget()&&n.isWidget())&&(n=l,r=e-u),(h>e||e==u&&(i>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,a=e-u)}}),!n&&!s)throw new Error("No tile at position "+e);return n&&i<0||!s?{tile:n,offset:r}:{tile:s,offset:a}}}class An extends Wc{constructor(e,i){super(e),this.wrapper=i}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,i){let n=new An(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class Ns extends Wc{constructor(e,i){super(e),this.attrs=i}isLine(){return!0}static start(e,i,n){let r=new Ns(i||document.createElement("div"),e);return(!i||!n)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,i,n){let r=null,s=-1,a=null,l=-1;function u(c,p){for(let v=0,g=0;v<c.children.length&&g<=p;v++){let b=c.children[v],m=g+b.length;m>=p&&(b.isComposite()?u(b,p-g):(!a||a.isHidden&&(i>0||n&&K3(a,b)))&&(m>p||b.flags&32)?(a=b,l=p-g):(g<p||b.flags&16&&!b.isHidden)&&(r=b,s=p-g)),g=m}}u(this,e);let h=(i<0?r:a)||r||a;return h?{tile:h,offset:h==r?s:l}:null}coordsIn(e,i){let n=this.resolveInline(e,i,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),i):J3(this)}domIn(e,i){let n=this.resolveInline(e,i);if(n){let{tile:r,offset:s}=n;if(this.dom.contains(r.dom))return r.isText()?new $i(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:i);let a=n.tile.parent,l=!1;for(let u of a.children){if(l)return new $i(u.dom,0);u==n.tile&&(l=!0)}}return new $i(this.dom,0)}}function J3(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=uo(e);return i[i.length-1]||null}function K3(t,e){let i=t.coordsIn(0,1),n=e.coordsIn(0,1);return i&&n&&n.top<i.bottom}class si extends Wc{constructor(e,i){super(e),this.mark=i}get domAttrs(){return this.mark.attrs}static of(e,i){let n=new si(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class Nr extends kt{constructor(e,i){super(e,i.length),this.text=i}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,i){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,s=e,a=0;e==0&&i<0||e==n&&i>=0?Ie.chrome||Ie.gecko||(e?(r--,a=1):s<n&&(s++,a=-1)):i<0?r--:s<n&&s++;let l=Bo(this.dom,r,s).getClientRects();if(!l.length)return null;let u=l[(a?a<0:i>=0)?0:l.length-1];return Ie.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(l,h=>h.width)||u),a?Lo(u,a<0):u||null}static of(e,i){let n=new Nr(i||document.createTextNode(e),e);return i||(n.flags|=2),n}}class Yr extends kt{constructor(e,i,n,r){super(e,i,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,i){return this.coordsInWidget(e,i,!1)}coordsInWidget(e,i,n){let r=this.widget.coordsAt(this.dom,e,i);if(r)return r;if(n)return Lo(this.dom.getBoundingClientRect(),this.length?e==0:i<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=l?s.length-1:0;a=s[u],!(e>0?u==0:u==s.length-1||a.top<a.bottom);u+=l?-1:1);return Lo(a,!l)}}get overrideDOMText(){if(!this.length)return at.empty;let{root:e}=this;if(!e)return at.empty;let i=this.posAtStart;return e.view.state.doc.slice(i,i+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,i,n,r,s){return s||(s=e.toDOM(i),e.editable||(s.contentEditable="false")),new Yr(s,n,e,r)}}class rc extends kt{constructor(e){let i=document.createElement("img");i.className="cm-widgetBuffer",i.setAttribute("aria-hidden","true"),super(i,0,e)}get isHidden(){return!0}get overrideDOMText(){return at.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class e5{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,i,n){let{tile:r,index:s,beforeBreak:a,parents:l}=this;for(;e||i>0;)if(r.isComposite())if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(s==r.children.length){if(!e&&!l.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let u=r.children[s],h=u.breakAfter;(i>0?u.length<=e:u.length<e)&&(!n||n.skip(u,0,u.length)!==!1||!u.isComposite)?(a=!!h,s++,e-=u.length):(l.push({tile:r,index:s}),r=u,s=0,n&&u.isComposite()&&n.enter(u))}else if(s==r.length)a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let u=Math.min(e,r.length-s);n&&n.skip(r,s,s+u),e-=u,s+=u}else break;return this.tile=r,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class t5{constructor(e,i,n,r){this.from=e,this.to=i,this.wrapper=n,this.rank=r}}class i5{constructor(e,i,n){this.cache=e,this.root=i,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,i,n,r){var s;this.flushBuffer();let a=this.ensureMarks(i,n),l=a.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let u=a.children[a.children.length-1]=new Nr(l.dom,l.text+e);u.parent=a}else a.append(r||Nr.of(e,(s=this.cache.find(Nr))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,i){let n=this.curLine;n.dom!=i.line.dom&&(n.setDOM(this.cache.reused.has(i.line)?Vh(i.line.dom):i.line.dom),this.cache.reused.set(i.line,2));let r=n;for(let l=i.marks.length-1;l>=0;l--){let u=i.marks[l],h=r.lastChild;if(h instanceof si&&h.mark.eq(u.mark))h.dom!=u.dom&&h.setDOM(Vh(u.dom)),r=h;else{if(this.cache.reused.get(u)){let p=kt.get(u.dom);p&&p.setDOM(Vh(u.dom))}let c=si.of(u.mark,u.dom);r.append(c),r=c}this.cache.reused.set(u,2)}let s=kt.get(e.text);s&&this.cache.reused.set(s,2);let a=new Nr(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,i,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(i,n);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,i,n){this.flushBuffer(),this.ensureMarks(i,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let i=this.afterWidget||this.lastBlock;i.length+=e,this.pos+=e}addLineStart(e,i){var n;e||(e=K1);let r=Ns.start(e,i||((n=this.cache.find(Ns))===null||n===void 0?void 0:n.dom),!!i);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,i){var n;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],l;if(i>0&&(l=r.lastChild)&&l instanceof si&&l.mark.eq(a))r=l,i--;else{let u=si.of(a,(n=this.cache.find(si,h=>h.mark.eq(a)))===null||n===void 0?void 0:n.dom);r.append(u),r=u,i=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!z0(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ie.ios&&z0(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Uh,0,32)||new Yr(Uh.toDOM(),0,Uh,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let i=new t5(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let i=this.root;for(let n of this.wrappers){let r=i.lastChild;if(n.from<this.pos&&r instanceof An&&r.wrapper.eq(n.wrapper))i=r;else{let s=An.of(n.wrapper,(e=this.cache.find(An,a=>a.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);i.append(s),i=s}}return i}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let i=2|(e<0?16:32),n=this.cache.find(rc,void 0,1);return n&&(n.flags=i),n||new rc(i)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class n5{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let i=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,i);return this.textOff=i,n}}const sc=[Yr,Ns,Nr,si,rc,An,Yc];for(let t=0;t<sc.length;t++)sc[t].bucket=t;class r5{constructor(e){this.view=e,this.buckets=sc.map(()=>[]),this.index=sc.map(()=>0),this.reused=new Map}add(e){let i=e.constructor.bucket,n=this.buckets[i];n.length<6?n.push(e):n[this.index[i]=(this.index[i]+1)%6]=e}find(e,i,n=2){let r=e.bucket,s=this.buckets[r],a=this.index[r];for(let l=s.length-1;l>=0;l--){let u=(l+a)%s.length,h=s[u];if((!i||i(h))&&!this.reused.has(h))return s.splice(u,1),u<a&&this.index[r]--,this.reused.set(h,n),h}return null}findWidget(e,i,n){let r=this.buckets[0];if(r.length)for(let s=0,a=0;;s++){if(s==r.length){if(a)return null;a=1,s=0}let l=r[s];if(!this.reused.has(l)&&(a==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==i&&(l.flags&497)==n?(this.reused.set(l,1),l):(this.reused.set(l,2),new Yr(l.dom,i,e,l.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,i=2){if(!this.reused.has(e))return this.reused.set(e,i),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class s5{constructor(e,i,n,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new r5(e),this.text=new n5(e.state.doc),this.builder=new i5(this.cache,new Yc(e,e.contentDOM),tt.iter(n)),this.cache.reused.set(i,2),this.old=new e5(i),this.reuseWalker={skip:(a,l,u)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,i){let n=i&&this.getCompositionContext(i.text);for(let r=0,s=0,a=0;;){let l=a<e.length?e[a++]:null,u=l?l.fromA:this.old.root.length;if(u>r){let h=u-r;this.preserve(h,!a,!l),r=u,s+=h}if(!l)break;i&&l.fromA<=i.range.fromA&&l.toA>=i.range.toA?(this.forward(l.fromA,i.range.fromA,i.range.fromA<i.range.toA?1:-1),this.emit(s,i.range.fromB),this.cache.clear(),this.builder.addComposition(i,n),this.text.skip(i.range.toB-i.range.fromB),this.forward(i.range.fromA,l.toA),this.emit(i.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,i,n){let r=l5(this.old),s=this.openMarks;this.old.advance(e,n?1:-1,{skip:(a,l,u)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(u-l);else{let h=u>0||l<a.length?Yr.of(a.widget,this.view,u-l,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,r,s),s=r.length)}else if(a.isText())this.builder.ensureLine(null),!l&&u==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,r,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(l,u),r,s)),s=r.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof rc)this.cache.add(a);else if(a instanceof si)this.builder.ensureLine(null),this.builder.addMark(a,r,s),this.cache.reused.set(a,1),s=r.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof si&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof si&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,i){let n=null,r=this.builder,s=0,a=tt.spans(this.decorations,e,i,{point:(l,u,h,c,p,v)=>{if(h instanceof qr){if(this.disallowBlockEffectsFor[v]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=c.length,p>c.length)r.continueWidget(u-l);else{let g=h.widget||(h.block?Ms.block:Ms.inline),b=a5(h),m=this.cache.findWidget(g,u-l,b)||Yr.of(g,this.view,u-l,b);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(m)):(r.ensureLine(n),r.addInlineWidget(m,c,p))}n=null}else n=o5(n,h);u>l&&this.text.skip(u-l)},span:(l,u,h,c)=>{for(let p=l;p<u;){let v=this.text.next(Math.min(512,u-p));v==null?(r.addLineStartIfNotCovered(n),r.addBreak(),p++):(r.ensureLine(n),r.addText(v,h,p==l?c:h.length),p+=v.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>s,this.openMarks=a}forward(e,i,n=1){i-e<=10?this.old.advance(i-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(i-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let i=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let s=kt.get(r);if(r==this.view.contentDOM)break;s instanceof si?i.push(s):s?.isLine()?n=s:s instanceof An||(r.nodeName=="DIV"&&!n&&r!=this.view.contentDOM?n=new Ns(r,K1):n||i.push(si.of(new rl({tagName:r.nodeName.toLowerCase(),attributes:M3(r)}),r)))}return{line:n,marks:i}}}function z0(t,e){let i=n=>{for(let r of n.children)if((e?r.isText():r.length)||i(r))return!0;return!1};return i(t)}function a5(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const K1={class:"cm-line"};function o5(t,e){let i=e.spec.attributes,n=e.spec.class;return!i&&!n||(t||(t={class:"cm-line"}),i&&wp(i,t),n&&(t.class+=" "+n)),t}function l5(t){let e=[];for(let i=t.parents.length;i>1;i--){let n=i==t.parents.length?t.tile:t.parents[i].tile;n instanceof si&&e.push(n.mark)}return e}function Vh(t){let e=kt.get(t);return e&&e.setDOM(t.cloneNode()),t}class Ms extends Ri{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ms.inline=new Ms("span");Ms.block=new Ms("div");const Uh=new class extends Ri{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class X0{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ze.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Yc(e,e.contentDOM),this.updateInner([new wi(0,0,0,e.state.doc.length)],null)}update(e){var i;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:p})=>p<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((i=this.domChanged)===null||i===void 0)&&i.newSel?r=this.domChanged.newSel.head:!y5(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?c5(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:p}=this.hasComposition;n=new wi(c,p,e.changes.mapPos(c,-1),e.changes.mapPos(p,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Ie.ie||Ie.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.blockWrappers;this.updateDeco();let u=d5(a,this.decorations,e.changes);u.length&&(n=wi.extendWithRanges(n,u));let h=m5(l,this.blockWrappers,e.changes);return h.length&&(n=wi.extendWithRanges(n,h)),s&&!n.some(c=>c.fromA<=s.range.fromA&&c.toA>=s.range.toA)&&(n=s.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,i){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(i||e.length){let a=this.tile,l=new s5(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);i&&kt.get(i.text)&&l.cache.reused.set(kt.get(i.text),2),this.tile=l.run(e,i),yd(a,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Ie.chrome||Ie.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||n.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof qh&&r.push(s.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let i of e.transactions)for(let n of i.effects)n.is(W1)&&(this.editContextFormatting=n.value)}updateSelection(e=!1,i=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,s=r==n,a=!s&&!(this.view.state.facet(Tn)||n.tabIndex>-1)&&lo(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(s||i||a))return;let l=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,h,c;if(u.empty?c=h=this.inlineDOMNearPos(u.anchor,u.assoc||1):(c=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),h=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),Ie.gecko&&u.empty&&!this.hasComposition&&u5(h)){let v=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(v,h.node.childNodes[h.offset]||null)),h=c=new $i(v,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!co(h.node,h.offset,p.anchorNode,p.anchorOffset)||!co(c.node,c.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,u))&&(this.view.observer.ignore(()=>{Ie.android&&Ie.chrome&&n.contains(p.focusNode)&&g5(p.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let v=$o(this.view.root);if(v)if(u.empty){if(Ie.gecko){let g=h5(h.node,h.offset);if(g&&g!=3){let b=(g==1?I1:N1)(h.node,h.offset);b&&(h=new $i(b.node,b.offset))}}v.collapse(h.node,h.offset),u.bidiLevel!=null&&v.caretBidiLevel!==void 0&&(v.caretBidiLevel=u.bidiLevel)}else if(v.extend){v.collapse(h.node,h.offset);try{v.extend(c.node,c.offset)}catch{}}else{let g=document.createRange();u.anchor>u.head&&([h,c]=[c,h]),g.setEnd(c.node,c.offset),g.setStart(h.node,h.offset),v.removeAllRanges(),v.addRange(g)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,c)),this.impreciseAnchor=h.precise?null:new $i(p.anchorNode,p.anchorOffset),this.impreciseHead=c.precise?null:new $i(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,i){return this.hasComposition&&i.empty&&co(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==i.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,i=e.state.selection.main,n=$o(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!i.empty||!i.assoc||!n.modify)return;let a=this.lineAt(i.head,i.assoc);if(!a)return;let l=a.posAtStart;if(i.head==l||i.head==l+a.length)return;let u=this.coordsAt(i.head,-1),h=this.coordsAt(i.head,1);if(!u||!h||u.bottom>h.top)return;let c=this.domAtPos(i.head+i.assoc,i.assoc);n.collapse(c.node,c.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=i.from&&n.collapse(r,s)}posFromDOM(e,i){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let s;if(e==n.dom)s=n.dom.childNodes[i];else{let a=Nn(e)==0?0:i==0?-1:1;for(;;){let l=e.parentNode;if(l==n.dom)break;a==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?a=-1:a=1),e=l}a<0?s=e:s=e.nextSibling}if(s==n.dom.firstChild)return r;for(;s&&!kt.get(s);)s=s.nextSibling;if(!s)return r+n.length;for(let a=0,l=r;;a++){let u=n.children[a];if(u.dom==s)return l;l+=u.length+u.breakAfter}}else return n.isText()?e==n.dom?r+i:r+(i?n.length:0):r}domAtPos(e,i){let{tile:n,offset:r}=this.tile.resolveBlock(e,i);return n.isWidget()?n.domPosFor(e,i):n.domIn(r,i)}inlineDOMNearPos(e,i){let n,r=-1,s=!1,a,l=-1,u=!1;return this.tile.blockTiles((h,c)=>{if(h.isWidget()){if(h.flags&32&&c>=e)return!0;h.flags&16&&(s=!0)}else{let p=c+h.length;if(c<=e&&(n=h,r=e-c,s=p<e),p>=e&&!a&&(a=h,l=e-c,u=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,i):(s&&a?n=null:u&&n&&(a=null),n&&i<0||!a?n.domIn(r,i):a.domIn(l,i))}coordsAt(e,i){let{tile:n,offset:r}=this.tile.resolveBlock(e,i);return n.isWidget()?n.widget instanceof qh?null:n.coordsInWidget(r,i,!0):n.coordsIn(r,i)}lineAt(e,i){let{tile:n}=this.tile.resolveBlock(e,i);return n.isLine()?n:null}coordsForChar(e){let{tile:i,offset:n}=this.tile.resolveBlock(e,1);if(!i.isLine())return null;function r(s,a){if(s.isComposite())for(let l of s.children){if(l.length>=a){let u=r(l,a);if(u)return u}if(a-=l.length,a<0)break}else if(s.isText()&&a<s.length){let l=Rt(s.text,a);if(l==a)return null;let u=Bo(s.dom,a,l).getClientRects();for(let h=0;h<u.length;h++){let c=u[h];if(h==u.length-1||c.top<c.bottom&&c.left<c.right)return c}}return null}return r(i,n)}measureVisibleLineHeights(e){let i=[],{from:n,to:r}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,u=this.view.textDirection==yt.LTR,h=0,c=(p,v,g)=>{for(let b=0;b<p.children.length&&!(v>r);b++){let m=p.children[b],x=v+m.length,O=m.dom.getBoundingClientRect(),{height:P}=O;if(g&&!b&&(h+=O.top-g.top),m instanceof An)x>n&&c(m,v,O);else if(v>=n&&(h>0&&i.push(-h),i.push(P+h),h=0,a)){let S=m.dom.lastChild,w=S?uo(S):[];if(w.length){let C=w[w.length-1],E=u?C.right-O.left:O.right-C.left;E>l&&(l=E,this.minWidth=s,this.minWidthFrom=v,this.minWidthTo=x)}}g&&b==p.children.length-1&&(h+=g.bottom-O.bottom),v=x+m.breakAfter}};return c(this.tile,0,null),i}textDirectionAt(e){let{tile:i}=this.tile.resolveBlock(e,1);return getComputedStyle(i.dom).direction=="rtl"?yt.RTL:yt.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let l=0,u;for(let h of a.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let c=uo(h.dom);if(c.length!=1)return;l+=c[0].width,u=c[0].height}if(l)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:l/a.length,textHeight:u}}});if(e)return e;let i=document.createElement("div"),n,r,s;return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(i);let a=uo(i.firstChild)[0];n=i.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,s=a&&a.height?a.height:n,i.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],i=this.view.viewState;for(let n=0,r=0;;r++){let s=r==i.viewports.length?null:i.viewports[r],a=s?s.from-1:this.view.state.doc.length;if(a>n){let l=(i.lineBlockAt(a).bottom-i.lineBlockAt(n).top)/this.view.scaleY;e.push(Ze.replace({widget:new qh(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!s)break;n=s.to+1}return Ze.set(e)}updateDeco(){let e=1,i=this.view.state.facet(qc).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(Ap).map((s,a)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,i.push(tt.join(r))),this.decorations=[this.editContextFormatting,...i,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(G1).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var i;if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(q1))try{if(c(this.view,e.range,e))return!0}catch(p){li(this.view.state,p,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,(i=n.assoc)!==null&&i!==void 0?i:n.empty?0:n.head>n.anchor?-1:1),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let a=Dp(this.view),l={left:r.left-a.left,top:r.top-a.top,right:r.right+a.right,bottom:r.bottom+a.bottom},{offsetWidth:u,offsetHeight:h}=this.view.scrollDOM;if(B3(this.view.scrollDOM,l,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==yt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let i=n=>n.isWidget()||n.children.some(i);return i(this.tile.resolveBlock(e,1).tile)}destroy(){yd(this.tile)}}function yd(t,e){let i=e?.get(t);if(i!=1){i==null&&t.destroy();for(let n of t.children)yd(n,e)}}function u5(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function eS(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let n=I1(i.focusNode,i.focusOffset),r=N1(i.focusNode,i.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=kt.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let u=kt.get(n.node);!u||u.isText()&&u.text!=n.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=n,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function c5(t,e,i){let n=eS(t,i);if(!n)return null;let{node:r,from:s,to:a}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(n.from,n.to)!=l)return null;let u=e.invertedDesc;return{range:new wi(u.mapPos(s),u.mapPos(a),s,a),text:r}}function h5(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let f5=class{constructor(){this.changes=[]}compareRange(e,i){vs(e,i,this.changes)}comparePoint(e,i){vs(e,i,this.changes)}boundChange(e){vs(e,e,this.changes)}};function d5(t,e,i){let n=new f5;return tt.compare(t,e,i,n),n.changes}class p5{constructor(){this.changes=[]}compareRange(e,i){vs(e,i,this.changes)}comparePoint(){}boundChange(e){vs(e,e,this.changes)}}function m5(t,e,i){let n=new p5;return tt.compare(t,e,i,n),n.changes}function g5(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(i.nodeType==1&&i.contentEditable=="false")return!0;return!1}function y5(t,e){let i=!1;return e&&t.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(i=!0)}),i}class qh extends Ri{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function v5(t,e,i=1){let n=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return Oe.cursor(e);s==0?i=1:s==r.length&&(i=-1);let a=s,l=s;i<0?a=Rt(r.text,s,!1):l=Rt(r.text,s);let u=n(r.text.slice(a,l));for(;a>0;){let h=Rt(r.text,a,!1);if(n(r.text.slice(h,a))!=u)break;a=h}for(;l<r.length;){let h=Rt(r.text,l);if(n(r.text.slice(l,h))!=u)break;l=h}return Oe.range(a+r.from,l+r.from)}function O5(t,e,i,n,r){let s=Math.round((n-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,u=Math.floor((r-i.top-(t.defaultLineHeight-l)*.5)/l);s+=u*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(i.from,i.to);return i.from+sd(a,s,t.state.tabSize)}function vd(t,e,i){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==Vt.Text&&(r.type!=s.type||(i<0?s.from<e:s.to>e)))&&(r=s)}}return r||n}return n}function x5(t,e,i,n){let r=vd(t,e.head,e.assoc||-1),s=!n||r.type!=Vt.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),u=t.posAtCoords({x:i==(l==yt.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(u!=null)return Oe.cursor(u,i?-1:1)}return Oe.cursor(i?r.to:r.from,i?-1:1)}function j0(t,e,i,n){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),a=t.textDirectionAt(r.from);for(let l=e,u=null;;){let h=W3(r,s,a,l,i),c=Q1;if(!h){if(r.number==(i?t.state.doc.lines:1))return l;c=`
|
|
199
|
+
`,r=t.state.doc.line(r.number+(i?1:-1)),s=t.bidiSpans(r),h=t.visualLineSide(r,!i)}if(u){if(!u(c))return l}else{if(!n)return h;u=n(c)}l=h}}function b5(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return s=>{let a=n(s);return r==St.Space&&(r=a),r==a}}function S5(t,e,i,n){let r=e.head,s=i?1:-1;if(r==(i?t.state.doc.length:0))return Oe.cursor(r,e.assoc);let a=e.goalColumn,l,u=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(r,e.assoc||((e.empty?i:e.head==e.from)?1:-1)),c=t.documentTop;if(h)a==null&&(a=h.left-u.left),l=s<0?h.top:h.bottom;else{let b=t.viewState.lineBlockAt(r);a==null&&(a=Math.min(u.right-u.left,t.defaultCharacterWidth*(r-b.from))),l=(s<0?b.top:b.bottom)+c}let p=u.left+a,v=t.viewState.heightOracle.textHeight>>1,g=n??v;for(let b=0;;b+=v){let m=l+(g+b)*s,x=Od(t,{x:p,y:m},!1,s);if(i?m>u.bottom:m<u.top)return Oe.cursor(x.pos,x.assoc);let O=t.coordsAtPos(x.pos,x.assoc),P=O?(O.top+O.bottom)/2:0;if(!O||(i?P>l:P<l))return Oe.cursor(x.pos,x.assoc,void 0,a)}}function ho(t,e,i){for(;;){let n=0;for(let r of t)r.between(e-1,e+1,(s,a,l)=>{if(e>s&&e<a){let u=n||i||(e-s<a-e?-1:1);e=u<0?s:a,n=u}});if(!n)return e}}function tS(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let a=ho(t,r.from,0);a!=r.from&&(s=Oe.cursor(a,-1))}else{let a=ho(t,r.from,-1),l=ho(t,r.to,1);(a!=r.from||l!=r.to)&&(s=Oe.range(r.from==r.anchor?a:l,r.from==r.head?a:l))}s&&(i||(i=e.ranges.slice()),i[n]=s)}return i?Oe.create(i,e.mainIndex):e}function Wh(t,e,i){let n=ho(t.state.facet(al).map(r=>r(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:Oe.cursor(n,n<i.from?1:-1)}class rn{constructor(e,i){this.pos=e,this.assoc=i}}function Od(t,e,i,n){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:a,y:l}=e,u=l-s,h;for(;;){if(u<0)return new rn(0,1);if(u>t.viewState.docHeight)return new rn(t.state.doc.length,-1);if(h=t.elementAtHeight(u),n==null)break;if(h.type==Vt.Text){if(n<0?h.to<t.viewport.from:h.from>t.viewport.to)break;let v=t.docView.coordsAt(n<0?h.from:h.to,n>0?-1:1);if(v&&(n<0?v.top<=u+s:v.bottom>=u+s))break}let p=t.viewState.heightOracle.textHeight/2;u=n>0?h.bottom+p:h.top-p}if(t.viewport.from>=h.to||t.viewport.to<=h.from){if(i)return null;if(h.type==Vt.Text){let p=O5(t,r,h,a,l);return new rn(p,p==h.from?1:-1)}}if(h.type!=Vt.Text)return u<(h.top+h.bottom)/2?new rn(h.from,1):new rn(h.to,-1);let c=t.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=t.docView.lineAt(h.from,-2)),new w5(t,a,l,t.textDirectionAt(h.from)).scanTile(c,h.from)}class w5{constructor(e,i,n,r){this.view=e,this.x=i,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,i){let{line:n,spans:r}=this.bidiSpansAt(e);return r[sn.find(r,e-n.from,-1,i)].level==this.baseDir}dirAt(e,i){let{line:n,spans:r}=this.bidiSpansAt(e);return r[sn.find(r,e-n.from,-1,i)].dir}bidiIn(e,i){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<i)}scan(e,i){let n=0,r=e.length-1,s=new Set,a=this.bidiIn(e[0],e[r]),l,u,h=-1,c=1e9,p;e:for(;n<r;){let g=r-n,b=n+r>>1;t:if(s.has(b)){let x=n+Math.floor(Math.random()*g);for(let O=0;O<g;O++){if(!s.has(x)){b=x;break t}x++,x==r&&(x=n)}break e}s.add(b);let m=i(b);if(m)for(let x=0;x<m.length;x++){let O=m[x],P=0;if(!(O.width==0&&m.length>1)){if(O.bottom<this.y)(!l||l.bottom<O.bottom)&&(l=O),P=1;else if(O.top>this.y)(!u||u.top>O.top)&&(u=O),P=-1;else{let S=O.left>this.x?this.x-O.left:O.right<this.x?this.x-O.right:0,w=Math.abs(S);w<c&&(h=b,c=w,p=O),S&&(P=S<0==(this.baseDir==yt.LTR)?-1:1)}P==-1&&(!a||this.baseDirAt(e[b],1))?r=b:P==1&&(!a||this.baseDirAt(e[b+1],-1))&&(n=b+1)}}}if(!p){let g=l&&(!u||this.y-l.bottom<u.top-this.y)?l:u;return this.y=(g.top+g.bottom)/2,this.scan(e,i)}let v=(a?this.dirAt(e[h],1):this.baseDir)==yt.LTR;return{i:h,after:this.x>(p.left+p.right)/2==v}}scanText(e,i){let n=[];for(let s=0;s<e.length;s=Rt(e.text,s))n.push(i+s);n.push(i+e.length);let r=this.scan(n,s=>{let a=n[s]-i,l=n[s+1]-i;return Bo(e.dom,a,l).getClientRects()});return r.after?new rn(n[r.i+1],-1):new rn(n[r.i],1)}scanTile(e,i){if(!e.length)return new rn(i,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,i);if(l.isComposite())return this.scanTile(l,i)}let n=[i];for(let l=0,u=i;l<e.children.length;l++)n.push(u+=e.children[l].length);let r=this.scan(n,l=>{let u=e.children[l];return u.flags&48?null:(u.dom.nodeType==1?u.dom:Bo(u.dom,0,u.length)).getClientRects()}),s=e.children[r.i],a=n[r.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):r.after?new rn(n[r.i+1],-1):new rn(a,1)}}const rs="";class P5{constructor(e,i){this.points=e,this.view=i,this.text="",this.lineSeparator=i.state.facet(rt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=rs}readRange(e,i){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let a=kt.get(r),l=r.nextSibling;if(l==i){a?.breakAfter&&!l&&n!=this.view.contentDOM&&this.lineBreak();break}let u=kt.get(l);(a&&u?a.breakAfter:(a?a.breakAfter:ic(r))||ic(l)&&(r.nodeName!="BR"||a?.isWidget())&&this.text.length>s)&&!C5(l,i)&&this.lineBreak(),r=l}return this.findPointBefore(n,i),this}readTextNode(e){let i=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,i.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,l;if(this.lineSeparator?(s=i.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(l=r.exec(i))&&(s=l.index,a=l[0].length),this.append(i.slice(n,s<0?i.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=a-1);n=s+a}}readNode(e){let i=kt.get(e),n=i&&i.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,i){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==i&&(n.pos=this.text.length)}findPointInside(e,i){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(T5(e,n.node,n.offset)?i:0))}}function T5(t,e,i){for(;;){if(!e||i<Nn(e))return!1;if(e==t)return!0;i=ar(e)+1,e=e.parentNode}}function C5(t,e){let i;for(;!(t==e||!t);t=t.nextSibling){let n=kt.get(t);if(!n?.isWidget())return!1;n&&(i||(i=[])).push(n)}if(i)for(let n of i){let r=n.overrideDOMText;if(r?.length)return!1}return!0}class Z0{constructor(e,i){this.node=e,this.offset=i,this.pos=-1}}class k5{constructor(e,i,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=i>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView,l=e.state.selection;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=iS(e.docView.tile,i,n,0))){let u=s||a?[]:A5(e),h=new P5(u,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=D5(u,this.bounds.from)}else{let u=e.observer.selectionRange,h=s&&s.node==u.focusNode&&s.offset==u.focusOffset||!fd(e.contentDOM,u.focusNode)?l.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),c=a&&a.node==u.anchorNode&&a.offset==u.anchorOffset||!fd(e.contentDOM,u.anchorNode)?l.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),p=e.viewport;if((Ie.ios||Ie.chrome)&&l.main.empty&&h!=c&&(p.from>0||p.to<e.state.doc.length)){let v=Math.min(h,c),g=Math.max(h,c),b=p.from-v,m=p.to-g;(b==0||b==1||v==0)&&(m==0||m==-1||g==e.state.doc.length)&&(h=0,c=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(Oe.range(c,h));else if(e.lineWrapping&&c==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let v=e.coordsAtPos(h,-1),g=0;v&&(g=e.inputState.lastTouchY<=v.bottom?-1:1),this.newSel=Oe.create([Oe.cursor(h,g)])}else this.newSel=Oe.single(c,h)}}}function iS(t,e,i,n){if(t.isComposite()){let r=-1,s=-1,a=-1,l=-1;for(let u=0,h=n,c=n;u<t.children.length;u++){let p=t.children[u],v=h+p.length;if(h<e&&v>i)return iS(p,e,i,h);if(v>=e&&r==-1&&(r=u,s=h),h>i&&p.dom.parentNode==t.dom){a=u,l=c;break}c=v,h=v+p.breakAfter}return{from:s,to:l<0?n+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function nS(t,e){let i,{newSel:n}=e,{state:r}=t,s=r.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:u}=e.bounds,h=s.from,c=null;(a===8||Ie.android&&e.text.length<u-l)&&(h=s.to,c="end");let p=r.doc.sliceString(l,u,rs),v,g;!s.empty&&s.from>=l&&s.to<=u&&(e.typeOver||p!=e.text)&&p.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&p.slice(s.to-l)==e.text.slice(v=e.text.length-(p.length-(s.to-l)))?i={from:s.from,to:s.to,insert:at.of(e.text.slice(s.from-l,v).split(rs))}:(g=rS(p,e.text,h-l,c))&&(Ie.chrome&&a==13&&g.toB==g.from+2&&e.text.slice(g.from,g.toB)==rs+rs&&g.toB--,i={from:l+g.from,to:l+g.toA,insert:at.of(e.text.slice(g.from,g.toB).split(rs))})}else n&&(!t.hasFocus&&r.facet(Tn)||ac(n,s))&&(n=null);if(!i&&!n)return!1;if((Ie.mac||Ie.android)&&i&&i.from==i.to&&i.from==s.head-1&&/^\. ?$/.test(i.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&i.insert.length==2&&(n=Oe.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:at.of([i.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?i={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:Ie.chrome&&i&&i.from==i.to&&i.from==s.head&&i.insert.toString()==`
|
|
200
|
+
`&&t.lineWrapping&&(n&&(n=Oe.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:at.of([" "])}),i)return _p(t,i,n,a);if(n&&!ac(n,s)){let l=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(n=tS(r.facet(al).map(h=>h(t)),n))),t.dispatch({selection:n,scrollIntoView:l,userEvent:u}),!0}else return!1}function _p(t,e,i,n=-1){if(Ie.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(Ie.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Os(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Os(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Os(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=E5(t,e,i));return t.state.facet(j1).some(u=>u(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function E5(t,e,i){let n,r=t.state,s=r.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,h=u<0?s.from:s.to,c=ho(r.facet(al).map(p=>p(t)),h,u);e.from==c&&(a=c)}if(a>-1)n={changes:e,selection:Oe.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=s.from<e.from?r.sliceDoc(s.from,e.from):"",h=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let u=r.changes(e),h=i&&i.main.to<=u.newLength?i.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=t.state.sliceDoc(e.from,e.to),p,v=i&&eS(t,i.main.head);if(v){let b=e.insert.length-(e.to-e.from);p={from:v.from,to:v.to-b}}else p=t.state.doc.lineAt(s.head);let g=s.to-e.to;n=r.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:u,range:h||b.map(u)};let m=b.to-g,x=m-c.length;if(t.state.sliceDoc(x,m)!=c||m>=p.from&&x<=p.to)return{range:b};let O=r.changes({from:x,to:m,insert:e.insert}),P=b.to-s.to;return{changes:O,range:h?Oe.range(Math.max(0,h.anchor+P),Math.max(0,h.head+P)):b.map(O)}})}else n={changes:u,selection:h&&r.selection.replaceRange(h)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:l,scrollIntoView:!0})}function rS(t,e,i,n){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let a=t.length,l=e.length;for(;a>0&&l>0&&t.charCodeAt(a-1)==e.charCodeAt(l-1);)a--,l--;if(n=="end"){let u=Math.max(0,s-Math.min(a,l));i-=a+u-s}if(a<s&&t.length<e.length){let u=i<=s&&i>=a?s-i:0;s-=u,l=s+(l-a),a=s}else if(l<s){let u=i<=s&&i>=l?s-i:0;s-=u,a=s+(a-l),l=s}return{from:s,toA:a,toB:l}}function A5(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=t.observer.selectionRange;return i&&(e.push(new Z0(i,n)),(r!=i||s!=n)&&e.push(new Z0(r,s))),e}function D5(t,e){if(t.length==0)return null;let i=t[0].pos,n=t.length==2?t[1].pos:i;return i>-1&&n>-1?Oe.single(i+e,n+e):null}function ac(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class _5{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ie.safari&&e.contentDOM.addEventListener("input",()=>null),Ie.gecko&&U5(e.contentDOM.ownerDocument)}handleEvent(e){!F5(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,i){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,i);for(let r of n.handlers){if(i.defaultPrevented)break;if(r(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=I5(e),n=this.handlers,r=this.view.contentDOM;for(let s in i)if(s!="scroll"){let a=!i[s].handlers.length,l=n[s];l&&a!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:a})}for(let s in n)s!="scroll"&&!i[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=i}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&aS.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ie.android&&Ie.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let i;return Ie.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((i=sS.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||N5.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=i||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let i=this.pendingIOSKey;return!i||i.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Os(this.view.contentDOM,i.key,i.keyCode,i instanceof KeyboardEvent?i:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Ie.safari&&!Ie.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function V0(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(r){li(i.state,r)}}}function I5(t){let e=Object.create(null);function i(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let r=n.spec,s=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(s)for(let l in s){let u=s[l];u&&i(l).handlers.push(V0(n.value,u))}if(a)for(let l in a){let u=a[l];u&&i(l).observers.push(V0(n.value,u))}}for(let n in Bi)i(n).handlers.push(Bi[n]);for(let n in fi)i(n).observers.push(fi[n]);return e}const sS=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],N5="dthko",aS=[16,17,18,20,91,92,224,225],Wl=6;function Yl(t){return Math.max(0,t)*.7+8}function M5(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class $5{constructor(e,i,n,r){this.view=e,this.startEvent=i,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=i,this.scrollParents=A1(e.contentDOM),this.atoms=e.state.facet(al).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=i.shiftKey,this.multiple=e.state.facet(rt.allowMultipleSelections)&&L5(e,i),this.dragging=Q5(e,i)&&uS(i)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&M5(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,n=0,r=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let u=Dp(this.view);e.clientX-u.left<=r+Wl?i=-Yl(r-e.clientX):e.clientX+u.right>=a-Wl&&(i=Yl(e.clientX-a)),e.clientY-u.top<=s+Wl?n=-Yl(s-e.clientY):e.clientY+u.bottom>=l-Wl&&(n=Yl(e.clientY-l)),this.setScrollSpeed(i,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,i){this.scrollSpeed={x:e,y:i},e||i?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:i}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),i&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=i,i=0),(e||i)&&this.view.win.scrollBy(e,i),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:i}=this,n=tS(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(i.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(i=>i.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function L5(t,e){let i=t.state.facet(F1);return i.length?i[0](e):Ie.mac?e.metaKey:e.ctrlKey}function B5(t,e){let i=t.state.facet(R1);return i.length?i[0](e):Ie.mac?!e.altKey:!e.ctrlKey}function Q5(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=$o(t.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let a=r[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function F5(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,n;i!=t.contentDOM;i=i.parentNode)if(!i||i.nodeType==11||(n=kt.get(i))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const Bi=Object.create(null),fi=Object.create(null),oS=Ie.ie&&Ie.ie_version<15||Ie.ios&&Ie.webkit_version<604;function R5(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),lS(t,i.value)},50)}function Gc(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function lS(t,e){e=Gc(t.state,Cp,e);let{state:i}=t,n,r=1,s=i.toText(e),a=s.lines==i.selection.ranges.length;if(xd!=null&&i.selection.ranges.every(u=>u.empty)&&xd==s.toString()){let u=-1;n=i.changeByRange(h=>{let c=i.doc.lineAt(h.from);if(c.from==u)return{range:h};u=c.from;let p=i.toText((a?s.line(r++).text:e)+i.lineBreak);return{changes:{from:c.from,insert:p},range:Oe.cursor(h.from+p.length)}})}else a?n=i.changeByRange(u=>{let h=s.line(r++);return{changes:{from:u.from,to:u.to,insert:h.text},range:Oe.cursor(u.from+h.length)}}):n=i.replaceSelection(s);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}fi.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};fi.wheel=fi.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Bi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);fi.touchstart=(t,e)=>{let i=t.inputState,n=e.targetTouches[0];i.lastTouchTime=Date.now(),n&&(i.lastTouchX=n.clientX,i.lastTouchY=n.clientY),i.setSelectionOrigin("select.pointer")};fi.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Bi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(z1))if(i=n(t,e),i)break;if(!i&&e.button==0&&(i=X5(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new $5(t,e,i,n)),n&&t.observer.ignore(()=>{D1(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function U0(t,e,i,n){if(n==1)return Oe.cursor(e,i);if(n==2)return v5(t.state,e,i);{let r=t.docView.lineAt(e,i),s=t.state.doc.lineAt(r?r.posAtEnd:e),a=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,Oe.range(a,l)}}const z5=Ie.ie&&Ie.ie_version<=11;let q0=null,W0=0,Y0=0;function uS(t){if(!z5)return t.detail;let e=q0,i=Y0;return q0=t,Y0=Date.now(),W0=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(W0+1)%3:1}function X5(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=uS(e),r=t.state.selection;return{update(s){s.docChanged&&(i.pos=s.changes.mapPos(i.pos),r=r.map(s.changes))},get(s,a,l){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,c=U0(t,u.pos,u.assoc,n);if(i.pos!=u.pos&&!a){let p=U0(t,i.pos,i.assoc,n),v=Math.min(p.from,c.from),g=Math.max(p.to,c.to);c=v<c.from?Oe.range(v,g,c.assoc):Oe.range(g,v,c.assoc)}return a?r.replaceRange(r.main.extend(c.from,c.to,c.assoc)):l&&n==1&&r.ranges.length>1&&(h=j5(r,u.pos))?h:l?r.addRange(c):Oe.create([c])}}}function j5(t,e){for(let i=0;i<t.ranges.length;i++){let{from:n,to:r}=t.ranges[i];if(n<=e&&r>=e)return Oe.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}Bi.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,a=s+r.length;(s>=i.to||a<=i.from)&&(i=Oe.range(s,a))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",Gc(t.state,kp,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Bi.dragend=t=>(t.inputState.draggedContent=null,!1);function G0(t,e,i,n){if(i=Gc(t.state,Cp,i),!i)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=n&&s&&B5(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:i},u=t.state.changes(a?[a,l]:l);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(r,-1),head:u.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Bi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),r=0,s=()=>{++r==i.length&&G0(t,e,n.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<i.length;a++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[a]=l.result),s()},l.readAsText(i[a])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return G0(t,e,n,!0),!0}return!1};Bi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=oS?null:e.clipboardData;return i?(lS(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(R5(t),!1)};function Z5(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function V5(t){let e=[],i=[],n=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),i.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>r&&(e.push(a.text),i.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),r=a.number}n=!0}return{text:Gc(t,kp,e.join(t.lineBreak)),ranges:i,linewise:n}}let xd=null;Bi.copy=Bi.cut=(t,e)=>{if(!lo(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:n,linewise:r}=V5(t.state);if(!i&&!r)return!1;xd=r?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=oS?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",i),!0):(Z5(t,i),!1)};const cS=Ln.define();function hS(t,e){let i=[];for(let n of t.facet(Z1)){let r=n(t,e);r&&i.push(r)}return i.length?t.update({effects:i,annotations:cS.of(!0)}):null}function fS(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=hS(t.state,e);i?t.dispatch(i):t.update([])}},10)}fi.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),fS(t)};fi.blur=t=>{t.observer.clearSelectionRange(),fS(t)};fi.compositionstart=fi.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};fi.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ie.chrome&&Ie.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};fi.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Bi.beforeinput=(t,e)=>{var i,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(i=e.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let l=a[0],u=t.posAtDOM(l.startContainer,l.startOffset),h=t.posAtDOM(l.endContainer,l.endOffset);return _p(t,{from:u,to:h,insert:t.state.toText(s)},null),!0}}let r;if(Ie.chrome&&Ie.android&&(r=sS.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ie.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ie.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>fi.compositionend(t,e),20),!1};const H0=new Set;function U5(t){H0.has(t)||(H0.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const J0=["pre-wrap","normal","pre-line","break-spaces"];let $s=!1;function K0(){$s=!1}class q5{constructor(e){this.lineWrapping=e,this.doc=at.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,i){let n=this.doc.lineAt(i).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((i-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return J0.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let i=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(i=!0,this.heightSamples[Math.floor(r*10)]=!0)}return i}refresh(e,i,n,r,s,a){let l=J0.indexOf(e)>-1,u=Math.abs(i-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=i,this.charWidth=n,this.textHeight=r,this.lineLength=s,u){this.heightSamples={};for(let h=0;h<a.length;h++){let c=a[h];c<0?h++:this.heightSamples[Math.floor(c*10)]=!0}}return u}}class W5{constructor(e,i){this.from=e,this.heights=i,this.index=0}get more(){return this.index<this.heights.length}}class Ni{constructor(e,i,n,r,s){this.from=e,this.length=i,this.top=n,this.height=r,this._content=s}get type(){return typeof this._content=="number"?Vt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof qr?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let i=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ni(this.from,this.length+e.length,this.top,this.height+e.height,i)}}var xt=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(xt||(xt={}));const ku=.001;class Kt{constructor(e,i,n=2){this.length=e,this.height=i,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ku&&($s=!0),this.height=e)}replace(e,i,n){return Kt.of(n)}decomposeLeft(e,i){i.push(this)}decomposeRight(e,i){i.push(this)}applyChanges(e,i,n,r){let s=this,a=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:u,toA:h,fromB:c,toB:p}=r[l],v=s.lineAt(u,xt.ByPosNoHeight,n.setDoc(i),0,0),g=v.to>=h?v:s.lineAt(h,xt.ByPosNoHeight,n,0,0);for(p+=g.to-h,h=g.to;l>0&&v.from<=r[l-1].toA;)u=r[l-1].fromA,c=r[l-1].fromB,l--,u<v.from&&(v=s.lineAt(u,xt.ByPosNoHeight,n,0,0));c+=v.from-u,u=v.from;let b=Ip.build(n.setDoc(a),e,c,p);s=oc(s,s.replace(u,h,b))}return s.updateHeight(n,0)}static empty(){return new gi(0,0,0)}static of(e){if(e.length==1)return e[0];let i=0,n=e.length,r=0,s=0;for(;;)if(i==n)if(r>s*2){let l=e[i-1];l.break?e.splice(--i,1,l.left,null,l.right):e.splice(--i,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[i++];l&&(r+=l.size)}else{let l=e[--n];l&&(s+=l.size)}let a=0;return e[i-1]==null?(a=1,i--):e[i]==null&&(a=1,n++),new G5(Kt.of(e.slice(0,i)),a,Kt.of(e.slice(n)))}}function oc(t,e){return t==e?t:(t.constructor!=e.constructor&&($s=!0),e)}Kt.prototype.size=1;const Y5=Ze.replace({});class dS extends Kt{constructor(e,i,n){super(e,i),this.deco=n,this.spaceAbove=0}mainBlock(e,i){return new Ni(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,i,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Ni(r,0,n,this.spaceAbove,Y5):this.mainBlock(n,r)}lineAt(e,i,n,r,s){let a=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,n,r,s).join(a):a}forEachLine(e,i,n,r,s,a){e<=s+this.length&&i>=s&&a(this.lineAt(0,xt.ByPos,n,r,s))}setMeasuredHeight(e){let i=e.heights[e.index++];i<0?(this.spaceAbove=-i,i=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(i)}updateHeight(e,i=0,n=!1,r){return r&&r.from<=i&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class gi extends dS{constructor(e,i,n){super(e,i,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,i){return new Ni(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,i,n){let r=n[0];return n.length==1&&(r instanceof gi||r instanceof Xt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Xt?r=new gi(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Kt.of(n)}updateHeight(e,i=0,n=!1,r){return r&&r.from<=i&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Xt extends Kt{constructor(e){super(e,0)}heightMetrics(e,i){let n=e.doc.lineAt(i).number,r=e.doc.lineAt(i+this.length).number,s=r-n+1,a,l=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);a=u/s,this.length>s+1&&(l=(this.height-u)/(this.length-s-1))}else a=this.height/s;return{firstLine:n,lastLine:r,perLine:a,perChar:l}}blockAt(e,i,n,r){let{firstLine:s,lastLine:a,perLine:l,perChar:u}=this.heightMetrics(i,r);if(i.lineWrapping){let h=r+(e<i.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),c=i.doc.lineAt(h),p=l+c.length*u,v=Math.max(n,e-p/2);return new Ni(c.from,c.length,v,p,0)}else{let h=Math.max(0,Math.min(a-s,Math.floor((e-n)/l))),{from:c,length:p}=i.doc.line(s+h);return new Ni(c,p,n+l*h,l,0)}}lineAt(e,i,n,r,s){if(i==xt.ByHeight)return this.blockAt(e,n,r,s);if(i==xt.ByPosNoHeight){let{from:g,to:b}=n.doc.lineAt(e);return new Ni(g,b-g,0,0,0)}let{firstLine:a,perLine:l,perChar:u}=this.heightMetrics(n,s),h=n.doc.lineAt(e),c=l+h.length*u,p=h.number-a,v=r+l*p+u*(h.from-s-p);return new Ni(h.from,h.length,Math.max(r,Math.min(v,r+this.height-c)),c,0)}forEachLine(e,i,n,r,s,a){e=Math.max(e,s),i=Math.min(i,s+this.length);let{firstLine:l,perLine:u,perChar:h}=this.heightMetrics(n,s);for(let c=e,p=r;c<=i;){let v=n.doc.lineAt(c);if(c==e){let b=v.number-l;p+=u*b+h*(e-s-b)}let g=u+h*v.length;a(new Ni(v.from,v.length,p,g,0)),p+=g,c=v.to+1}}replace(e,i,n){let r=this.length-i;if(r>0){let s=n[n.length-1];s instanceof Xt?n[n.length-1]=new Xt(s.length+r):n.push(null,new Xt(r-1))}if(e>0){let s=n[0];s instanceof Xt?n[0]=new Xt(e+s.length):n.unshift(new Xt(e-1),null)}return Kt.of(n)}decomposeLeft(e,i){i.push(new Xt(e-1),null)}decomposeRight(e,i){i.push(null,new Xt(this.length-e-1))}updateHeight(e,i=0,n=!1,r){let s=i+this.length;if(r&&r.from<=i+this.length&&r.more){let a=[],l=Math.max(i,r.from),u=-1;for(r.from>i&&a.push(new Xt(r.from-i-1).updateHeight(e,i));l<=s&&r.more;){let c=e.doc.lineAt(l).length;a.length&&a.push(null);let p=r.heights[r.index++],v=0;p<0&&(v=-p,p=r.heights[r.index++]),u==-1?u=p:Math.abs(p-u)>=ku&&(u=-2);let g=new gi(c,p,v);g.outdated=!1,a.push(g),l+=c+1}l<=s&&a.push(null,new Xt(s-l).updateHeight(e,l));let h=Kt.of(a);return(u<0||Math.abs(h.height-this.height)>=ku||Math.abs(u-this.heightMetrics(e,i).perLine)>=ku)&&($s=!0),oc(this,h)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(i,i+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class G5 extends Kt{constructor(e,i,n){super(e.length+i+n.length,e.height+n.height,i|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,i,n,r){let s=n+this.left.height;return e<s?this.left.blockAt(e,i,n,r):this.right.blockAt(e,i,s,r+this.left.length+this.break)}lineAt(e,i,n,r,s){let a=r+this.left.height,l=s+this.left.length+this.break,u=i==xt.ByHeight?e<a:e<l,h=u?this.left.lineAt(e,i,n,r,s):this.right.lineAt(e,i,n,a,l);if(this.break||(u?h.to<l:h.from>l))return h;let c=i==xt.ByPosNoHeight?xt.ByPosNoHeight:xt.ByPos;return u?h.join(this.right.lineAt(l,c,n,a,l)):this.left.lineAt(l,c,n,r,s).join(h)}forEachLine(e,i,n,r,s,a){let l=r+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,i,n,r,s,a),i>=u&&this.right.forEachLine(e,i,n,l,u,a);else{let h=this.lineAt(u,xt.ByPos,n,r,s);e<h.from&&this.left.forEachLine(e,h.from-1,n,r,s,a),h.to>=e&&h.from<=i&&a(h),i>h.to&&this.right.forEachLine(h.to+1,i,n,l,u,a)}}replace(e,i,n){let r=this.left.length+this.break;if(i<r)return this.balanced(this.left.replace(e,i,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,i-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let l of n)s.push(l);if(e>0&&ev(s,a-1),i<this.length){let l=s.length;this.decomposeRight(i,s),ev(s,l)}return Kt.of(s)}decomposeLeft(e,i){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,i);i.push(this.left),this.break&&(n++,e>=n&&i.push(null)),e>n&&this.right.decomposeLeft(e-n,i)}decomposeRight(e,i){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,i);e<n&&this.left.decomposeRight(e,i),this.break&&e<r&&i.push(null),i.push(this.right)}balanced(e,i){return e.size>2*i.size||i.size>2*e.size?Kt.of(this.break?[e,null,i]:[e,i]):(this.left=oc(this.left,e),this.right=oc(this.right,i),this.setHeight(e.height+i.height),this.outdated=e.outdated||i.outdated,this.size=e.size+i.size,this.length=e.length+this.break+i.length,this)}updateHeight(e,i=0,n=!1,r){let{left:s,right:a}=this,l=i+s.length+this.break,u=null;return r&&r.from<=i+s.length&&r.more?u=s=s.updateHeight(e,i,n,r):s.updateHeight(e,i,n),r&&r.from<=l+a.length&&r.more?u=a=a.updateHeight(e,l,n,r):a.updateHeight(e,l,n),u?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ev(t,e){let i,n;t[e]==null&&(i=t[e-1])instanceof Xt&&(n=t[e+1])instanceof Xt&&t.splice(e-1,3,new Xt(i.length+1+n.length))}const H5=5;class Ip{constructor(e,i){this.pos=e,this.oracle=i,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,i){if(this.lineStart>-1){let n=Math.min(i,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof gi?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new gi(n-this.pos,-1,0)),this.writtenTo=n,i>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=i}point(e,i,n){if(e<i||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=i-e;n.block?this.addBlock(new dS(a,r,n)):(a||s||r>=H5)&&this.addLineDeco(r,s,a)}else i>e&&this.span(e,i);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:i}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=i,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new gi(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,i){let n=new Xt(i-e);return this.oracle.doc.lineAt(e).to==i&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof gi)return e;let i=new gi(0,-1,0);return this.nodes.push(i),i}addBlock(e){this.enterLine();let i=e.deco;i&&i.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i&&i.endSide>0&&(this.covering=e)}addLineDeco(e,i,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=i,this.writtenTo=this.pos=this.pos+n}finish(e){let i=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(i instanceof gi)&&!this.isCovered?this.nodes.push(new gi(0,-1,0)):(this.writtenTo<this.pos||i==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let r of this.nodes)r instanceof gi&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,i,n,r){let s=new Ip(n,e);return tt.spans(i,n,r,s,0),s.finish(n)}}function J5(t,e,i){let n=new K5;return tt.compare(t,e,i,n,0),n.changes}class K5{constructor(){this.changes=[]}compareRange(){}comparePoint(e,i,n,r){(e<i||n&&n.heightRelevant||r&&r.heightRelevant)&&vs(e,i,this.changes,5)}}function eL(t,e){let i=t.getBoundingClientRect(),n=t.ownerDocument,r=n.defaultView||window,s=Math.max(0,i.left),a=Math.min(r.innerWidth,i.right),l=Math.max(0,i.top),u=Math.min(r.innerHeight,i.bottom);for(let h=t.parentNode;h&&h!=n.body;)if(h.nodeType==1){let c=h,p=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&p.overflow!="visible"){let v=c.getBoundingClientRect();s=Math.max(s,v.left),a=Math.min(a,v.right),l=Math.max(l,v.top),u=Math.min(h==t.parentNode?r.innerHeight:u,v.bottom)}h=p.position=="absolute"||p.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-i.left,right:Math.max(s,a)-i.left,top:l-(i.top+e),bottom:Math.max(l,u)-(i.top+e)}}function tL(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0}function iL(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class Yh{constructor(e,i,n,r){this.from=e,this.to=i,this.size=n,this.displaySize=r}static same(e,i){if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=i[n];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,i){return Ze.replace({widget:new nL(this.displaySize*(i?e.scaleY:e.scaleX),i)}).range(this.from,this.to)}}class nL extends Ri{constructor(e,i){super(),this.size=e,this.vertical=i}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class tv{constructor(e,i){this.view=e,this.state=i,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=iv,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=yt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=i.facet(Ep).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new q5(n),this.stateDeco=nv(i),this.heightMap=Kt.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle.setDoc(i.doc),[new wi(0,0,0,i.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ze.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:i}=this.state.selection;for(let n=0;n<=1;n++){let r=n?i.head:i.anchor;if(!e.some(({from:s,to:a})=>r>=s&&r<=a)){let{from:s,to:a}=this.lineBlockAt(r);e.push(new Gl(s,a))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?iv:new Np(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ka(e,this.scaler))})}update(e,i=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=nv(this.state);let r=e.changedRanges,s=wi.extendWithRanges(r,J5(n,this.stateDeco,e?e.changes:Lt.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);K0(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||$s)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(i&&(i.range.head<u.from||i.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,i));let h=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),i&&(this.scrollTarget=i),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(U1)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,i=e.contentDOM,n=window.getComputedStyle(i),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?yt.RTL:yt.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=i.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:C,scaleY:E}=E1(i,l);(C>.005&&Math.abs(this.scaleX-C)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=C,this.scaleY=E,h|=16,a=u=!0)}let p=(parseInt(n.paddingTop)||0)*this.scaleY,v=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=v)&&(this.paddingTop=p,this.paddingBottom=v,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let g=A1(this.view.contentDOM,!1).y;g!=this.scrollParent&&(this.scrollParent=g,this.scrollAnchorHeight=-1,this.scrollOffset=0);let b=this.getScrollOffset();this.scrollOffset!=b&&(this.scrollAnchorHeight=-1,this.scrollOffset=b),this.scrolledToBottom=_1(this.scrollParent||e.win);let m=(this.printing?iL:eL)(i,this.paddingTop),x=m.top-this.pixelViewport.top,O=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let P=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(P!=this.inView&&(this.inView=P,P&&(u=!0)),!this.inView&&!this.scrollTarget&&!tL(e.dom))return 0;let S=l.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),u){let C=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(C)&&(a=!0),a||r.lineWrapping&&Math.abs(S-this.contentDOMWidth)>r.charWidth){let{lineHeight:E,charWidth:k,textHeight:A}=e.docView.measureTextSize();a=E>0&&r.refresh(s,E,k,A,Math.max(5,S/k),C),a&&(e.docView.minWidth=0,h|=16)}x>0&&O>0?c=Math.max(x,O):x<0&&O<0&&(c=Math.min(x,O)),K0();for(let E of this.viewports){let k=E.from==this.viewport.from?C:e.docView.measureVisibleLineHeights(E);this.heightMap=(a?Kt.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle,[new wi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new W5(E.from,k))}$s&&(h|=2)}let w=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return w&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,i){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,u=new Gl(r.lineAt(a-n*1e3,xt.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,xt.ByHeight,s,0,0).to);if(i){let{head:h}=i.range;if(h<u.from||h>u.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(h,xt.ByPos,s,0,0),v;i.y=="center"?v=(p.top+p.bottom)/2-c/2:i.y=="start"||i.y=="nearest"&&h<u.from?v=p.top:v=p.bottom-c,u=new Gl(r.lineAt(v-1e3/2,xt.ByHeight,s,0,0).from,r.lineAt(v+c+1e3/2,xt.ByHeight,s,0,0).to)}}return u}mapViewport(e,i){let n=i.mapPos(e.from,-1),r=i.mapPos(e.to,1);return new Gl(this.heightMap.lineAt(n,xt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,xt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:i},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,xt.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(i,xt.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:l}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(i==this.state.doc.length||s>=l+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&s<l+2*1e3}mapLineGaps(e,i){if(!e.length||i.empty)return e;let n=[];for(let r of e)i.touchesRange(r.from,r.to)||n.push(new Yh(i.mapPos(r.from),i.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,i){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,s=r>>1,a=r<<1;if(this.defaultTextDirection!=yt.LTR&&!n)return[];let l=[],u=(c,p,v,g)=>{if(p-c<s)return;let b=this.state.selection.main,m=[b.from];b.empty||m.push(b.to);for(let O of m)if(O>c&&O<p){u(c,O-10,v,g),u(O+10,p,v,g);return}let x=sL(e,O=>O.from>=v.from&&O.to<=v.to&&Math.abs(O.from-c)<s&&Math.abs(O.to-p)<s&&!m.some(P=>O.from<P&&O.to>P));if(!x){if(p<v.to&&i&&n&&i.visibleRanges.some(S=>S.from<=p&&S.to>=p)){let S=i.moveToLineBoundary(Oe.cursor(p),!1,!0).head;S>c&&(p=S)}let O=this.gapSize(v,c,p,g),P=n||O<2e6?O:2e6;x=new Yh(c,p,O,P)}l.push(x)},h=c=>{if(c.length<a||c.type!=Vt.Text)return;let p=rL(c.from,c.to,this.stateDeco);if(p.total<a)return;let v=this.scrollTarget?this.scrollTarget.range.head:null,g,b;if(n){let m=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,x,O;if(v!=null){let P=Jl(p,v),S=((this.visibleBottom-this.visibleTop)/2+m)/c.height;x=P-S,O=P+S}else x=(this.visibleTop-c.top-m)/c.height,O=(this.visibleBottom-c.top+m)/c.height;g=Hl(p,x),b=Hl(p,O)}else{let m=p.total*this.heightOracle.charWidth,x=r*this.heightOracle.charWidth,O=0;if(m>2e6)for(let E of e)E.from>=c.from&&E.from<c.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+O<this.pixelViewport.left&&(O=E.size-E.displaySize);let P=this.pixelViewport.left+O,S=this.pixelViewport.right+O,w,C;if(v!=null){let E=Jl(p,v),k=((S-P)/2+x)/m;w=E-k,C=E+k}else w=(P-x)/m,C=(S+x)/m;g=Hl(p,w),b=Hl(p,C)}g>c.from&&u(c.from,g,c,p),b<c.to&&u(b,c.to,c,p)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(h):h(c);return l}gapSize(e,i,n,r){let s=Jl(r,n)-Jl(r,i);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Yh.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ze.set(e.map(i=>i.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let i=this.stateDeco;this.lineGaps.length&&(i=i.concat(this.lineGapDeco));let n=[];tt.spans(i,this.viewport.from,this.viewport.to,{span(s,a){n.push({from:s,to:a})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s<n.length&&!(r&8);s++){let a=this.visibleRanges[s],l=n[s];(a.from!=l.from||a.to!=l.to)&&(r|=4,e&&e.mapPos(a.from,-1)==l.from&&e.mapPos(a.to,1)==l.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(i=>i.from<=e&&i.to>=e)||Ka(this.heightMap.lineAt(e,xt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(i=>i.top<=e&&i.bottom>=e)||Ka(this.heightMap.lineAt(this.scaler.fromDOM(e),xt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let i=this.lineBlockAtHeight(e+8);return i.from>=this.viewport.from||this.viewportLines[0].top-e>200?i:this.viewportLines[0]}elementAtHeight(e){return Ka(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Gl{constructor(e,i){this.from=e,this.to=i}}function rL(t,e,i){let n=[],r=t,s=0;return tt.spans(i,t,e,{span(){},point(a,l){a>r&&(n.push({from:r,to:a}),s+=a-r),r=l}},20),r<e&&(n.push({from:r,to:e}),s+=e-r),{total:s,ranges:n}}function Hl({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let r=0;;r++){let{from:s,to:a}=e[r],l=a-s;if(n<=l)return s+n;n-=l}}function Jl(t,e){let i=0;for(let{from:n,to:r}of t.ranges){if(e<=r){i+=e-n;break}i+=r-n}return i/t.total}function sL(t,e){for(let i of t)if(e(i))return i}const iv={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function nv(t){let e=t.facet(qc).filter(n=>typeof n!="function"),i=t.facet(Ap).filter(n=>typeof n!="function");return i.length&&e.push(tt.join(i)),e}class Np{constructor(e,i,n){let r=0,s=0,a=0;this.viewports=n.map(({from:l,to:u})=>{let h=i.lineAt(l,xt.ByPos,e,0,0).top,c=i.lineAt(u,xt.ByPos,e,0,0).bottom;return r+=c-h,{from:l,to:u,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(i.height-r);for(let l of this.viewports)l.domTop=a+(l.top-s)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let i=0,n=0,r=0;;i++){let s=i<this.viewports.length?this.viewports[i]:null;if(!s||e<s.top)return r+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,r=s.domBottom}}fromDOM(e){for(let i=0,n=0,r=0;;i++){let s=i<this.viewports.length?this.viewports[i]:null;if(!s||e<s.domTop)return n+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,r=s.domBottom}}eq(e){return e instanceof Np?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((i,n)=>i.from==e.viewports[n].from&&i.to==e.viewports[n].to):!1}}function Ka(t,e){if(e.scale==1)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Ni(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map(r=>Ka(r,e)):t._content)}const Kl=Me.define({combine:t=>t.join(" ")}),bd=Me.define({combine:t=>t.indexOf(!0)>-1}),Sd=rr.newName(),pS=rr.newName(),mS=rr.newName(),gS={"&light":"."+pS,"&dark":"."+mS};function wd(t,e,i){return new rr(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return t;if(!i||!i[r])throw new RangeError(`Unsupported selector: ${r}`);return i[r]}):t+" "+n}})}const aL=wd("."+Sd,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},gS),oL={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Gh=Ie.ie&&Ie.ie_version<=11;class lL{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Q3,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(i=>{for(let n of i)this.queue.push(n);(Ie.ie&&Ie.ie_version<=11||Ie.ios&&e.composing)&&i.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ie.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ie.chrome&&Ie.chrome_version<126)&&(this.editContext=new cL(e),e.state.facet(Tn)&&(e.contentDOM.editContext=this.editContext.editContext)),Gh&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var i;((i=this.view.docView)===null||i===void 0?void 0:i.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(i=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),i.length>0&&i[i.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(i=>{i.length>0&&i[i.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((i,n)=>i!=e[n]))){this.gapIntersection.disconnect();for(let i of e)this.gapIntersection.observe(i);this.gaps=e}}onSelectionChange(e){let i=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Tn)?n.root.activeElement!=this.dom:!lo(this.dom,r))return;let s=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){i||(this.selectionChanged=!1);return}(Ie.ie&&Ie.ie_version<=11||Ie.android&&Ie.chrome)&&!n.state.selection.main.empty&&r.focusNode&&co(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,i=$o(e.root);if(!i)return!1;let n=Ie.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&uL(this.view,i)||i;if(!n||this.selectionRange.eq(n))return!1;let r=lo(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&R3(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,i){this.selectionRange.set(e.node,e.offset,i.node,i.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,i=null;for(let n=this.dom;n;)if(n.nodeType==1)!i&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:i||(i=this.scrollTargets.slice(0,e)),i&&i.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!i&&(i=this.scrollTargets.slice(0,e)),i){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=i)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,oL),Gh&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Gh&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,i){var n;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Os(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:i,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let i=-1,n=-1,r=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(r=!0),i==-1?{from:i,to:n}=a:(i=Math.min(a.from,i),n=Math.max(a.to,n)))}return{from:i,to:n,typeOver:r}}readChange(){let{from:e,to:i,typeOver:n}=this.processRecords(),r=this.selectionChanged&&lo(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new k5(this.view,e,i,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let n=this.view.state,r=nS(this.view,i);return this.view.state==n&&(i.domChanged||i.newSel&&!ac(this.view.state.selection,i.newSel.main))&&this.view.update([]),r}readMutation(e){let i=this.view.docView.tile.nearest(e.target);if(!i||i.isWidget())return null;if(i.markDirty(e.type=="attributes"),e.type=="childList"){let n=rv(i,e.previousSibling||e.target.previousSibling,-1),r=rv(i,e.nextSibling||e.target.nextSibling,1);return{from:n?i.posAfter(n):i.posAtStart,to:r?i.posBefore(r):i.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Tn)!=e.state.facet(Tn)&&(e.view.contentDOM.editContext=e.state.facet(Tn)?this.editContext.editContext:null))}destroy(){var e,i,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(i=this.gapIntersection)===null||i===void 0||i.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function rv(t,e,i){for(;e;){let n=kt.get(e);if(n&&n.parent==t)return n;let r=e.parentNode;e=r!=t.dom?r:i>0?e.nextSibling:e.previousSibling}return null}function sv(t,e){let i=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return co(a.node,a.offset,r,s)&&([i,n,r,s]=[r,s,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}}function uL(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return sv(t,r)}let i=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),i=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?sv(t,i):null}class cL{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let i=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:a}=r,l=this.toEditorPos(n.updateRangeStart),u=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let h=u-l>n.text.length;l==this.from&&s<this.from?l=s:u==this.to&&s>this.to&&(u=s);let c=rS(e.state.sliceDoc(l,u),n.text,(h?r.from:r.to)-l,h?"end":null);if(!c){let v=Oe.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));ac(v,r)||e.dispatch({selection:v,userEvent:"select"});return}let p={from:c.from+l,to:c.toA+l,insert:at.of(n.text.slice(c.from,c.toB).split(`
|
|
201
|
+
`))};if((Ie.mac||Ie.android)&&p.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:u,insert:at.of([n.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let v=this.to-this.from+(p.to-p.from+p.insert.length);_p(e,p,Oe.single(this.toEditorPos(n.selectionStart,v),this.toEditorPos(n.selectionEnd,v)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(i.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let a=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);a<l;a++){let u=e.coordsForChar(a);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,r.push(s)}i.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let a=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let u=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(u<h){let c=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(Ze.mark({attributes:{style:c}}).range(u,h))}}}e.dispatch({effects:W1.of(Ze.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)i.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=$o(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,a,l,u,h)=>{if(n)return;let c=h.length-(a-s);if(r&&a>=r.to)if(r.from==s&&r.to==a&&r.insert.eq(h)){r=this.pendingContextChange=null,i+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(s+=i,a+=i,a<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+h.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),h.toString()),this.to+=c}i+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){let i=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||i)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:i}=e.selection.main;this.from=Math.max(0,i-1e4),this.to=Math.min(e.doc.length,i+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let i=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(i.from),this.toContextPos(i.from+i.insert.length),e.doc.sliceString(i.from,i.to))}setSelection(e){let{main:i}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),r=this.toContextPos(i.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:i}=e.selection.main;return!(this.from>0&&i-this.from<500||this.to<e.doc.length&&this.to-i<500||this.to-this.from>1e4*3)}toEditorPos(e,i=this.to-this.from){e=Math.min(e,i);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let i=this.composing;return i&&i.drifted?i.contextBase+(e-i.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class _e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var i;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||F3(e.parent)||document,this.viewState=new tv(this,e.state||rt.create(e)),e.scrollTo&&e.scrollTo.is(ql)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ls).map(r=>new Zh(r));for(let r of this.plugins)r.update(this);this.observer=new lL(this),this.inputState=new _5(this),this.inputState.ensureHandlers(this.plugins),this.docView=new X0(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((i=document.fonts)===null||i===void 0)&&i.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let i=e.length==1&&e[0]instanceof Mt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(i,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let i=!1,n=!1,r,s=this.state;for(let v of e){if(v.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=v.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,l=0,u=null;e.some(v=>v.annotation(cS))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,u=hS(s,a),u||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(rt.phrases)!=this.state.facet(rt.phrases))return this.setState(s);r=nc.create(this,s,e),r.flags|=l;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let v of e){if(p&&(p=p.map(v.changes)),v.scrollIntoView){let{main:g}=v.state.selection;p=new xs(g.empty?g:Oe.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of v.effects)g.is(ql)&&(p=g.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=lc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),i=this.docView.update(r),this.state.facet(Ja)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some(v=>v.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Kl)!=r.state.facet(Kl)&&(this.viewState.mustMeasureContent=!0),(i||n||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!r.empty)for(let v of this.state.facet(gd))try{v(r)}catch(g){li(this.state,g,"update listener")}(u||c)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),c&&!nS(this,c)&&h.force&&Os(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let i=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new tv(this,e),this.plugins=e.facet(ls).map(n=>new Zh(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new X0(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}i&&this.focus(),this.requestMeasure()}updatePlugins(e){let i=e.startState.facet(ls),n=e.state.facet(ls);if(i!=n){let r=[];for(let s of n){let a=i.indexOf(s);if(a<0)r.push(new Zh(s));else{let l=this.plugins[a];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);i!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let i=e.value;if(i&&i.docViewUpdate)try{i.docViewUpdate(this)}catch(n){li(this.state,n,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let i=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(_1(n||this.win))s=-1,a=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,a=g.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];u&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(g=>{try{return g.read(this)}catch(b){return li(this.state,b),av}}),p=nc.create(this,this.state,[]),v=!1;p.flags|=u,i?i.flags|=u:i=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),v=this.docView.update(p),v&&this.docViewUpdate());for(let g=0;g<h.length;g++)if(c[g]!=av)try{let b=h[g];b.write&&b.write(c[g],this)}catch(b){li(this.state,b)}if(v&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let b=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((b>1||b<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+b,n?n.scrollTop+=b:this.win.scrollBy(0,b),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(i&&!i.empty)for(let l of this.state.facet(gd))l(i)}get themeClasses(){return Sd+" "+(this.state.facet(bd)?mS:pS)+" "+this.state.facet(Kl)}updateAttrs(){let e=ov(this,Y1,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),i={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Tn)?"true":"false",class:"cm-content",style:`${Ie.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(i["aria-readonly"]="true"),ov(this,Ep,i);let n=this.observer.ignore(()=>{let r=L0(this.contentDOM,this.contentAttrs,i),s=L0(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=i,n}showAnnouncements(e){let i=!0;for(let n of e)for(let r of n.effects)if(r.is(_e.announce)){i&&(this.announceDOM.textContent=""),i=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Ja);let e=this.state.facet(_e.cspNonce);rr.mount(this.root,this.styleModules.concat(aL).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let i=0;i<this.measureRequests.length;i++)if(this.measureRequests[i].key===e.key){this.measureRequests[i]=e;return}}this.measureRequests.push(e)}}plugin(e){let i=this.pluginMap.get(e);return(i===void 0||i&&i.plugin!=e)&&this.pluginMap.set(e,i=this.plugins.find(n=>n.plugin==e)||null),i&&i.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,i,n){return Wh(this,e,j0(this,e,i,n))}moveByGroup(e,i){return Wh(this,e,j0(this,e,i,n=>b5(this,e.head,n)))}visualLineSide(e,i){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[i?n.length-1:0];return Oe.cursor(s.side(i,r)+e.from,s.forward(!i,r)?1:-1)}moveToLineBoundary(e,i,n=!0){return x5(this,e,i,n)}moveVertically(e,i,n){return Wh(this,e,S5(this,e,i,n))}domAtPos(e,i=1){return this.docView.domAtPos(e,i)}posAtDOM(e,i=0){return this.docView.posFromDOM(e,i)}posAtCoords(e,i=!0){this.readMeasured();let n=Od(this,e,i);return n&&n.pos}posAndSideAtCoords(e,i=!0){return this.readMeasured(),Od(this,e,i)}coordsAtPos(e,i=1){this.readMeasured();let n=this.docView.coordsAt(e,i);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),a=s[sn.find(s,e-r.from,-1,i)];return Lo(n,a.dir==yt.LTR==i>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(V1)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>hL)return B1(e.length);let i=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==i&&(s.fresh||L1(s.isolates,n=F0(this,e))))return s.order;n||(n=F0(this,e));let r=q3(e.text,i,n);return this.bidiCache.push(new lc(e.from,e.to,i,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ie.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{D1(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,i={}){return ql.of(new xs(typeof e=="number"?Oe.cursor(e):e,i.y,i.x,i.yMargin,i.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:i}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return ql.of(new xs(Oe.cursor(n.from),"start","start",n.top-e,i,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Et.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Et.define(()=>({}),{eventObservers:e})}static theme(e,i){let n=rr.newName(),r=[Kl.of(n),Ja.of(wd(`.${n}`,e))];return i&&i.dark&&r.push(bd.of(!0)),r}static baseTheme(e){return fr.lowest(Ja.of(wd("."+Sd,e,gS)))}static findFromDOM(e){var i;let n=e.querySelector(".cm-content"),r=n&&kt.get(n)||kt.get(e);return((i=r?.root)===null||i===void 0?void 0:i.view)||null}}_e.styleModule=Ja;_e.inputHandler=j1;_e.clipboardInputFilter=Cp;_e.clipboardOutputFilter=kp;_e.scrollHandler=q1;_e.focusChangeEffect=Z1;_e.perLineTextDirection=V1;_e.exceptionSink=X1;_e.updateListener=gd;_e.editable=Tn;_e.mouseSelectionStyle=z1;_e.dragMovesSelection=R1;_e.clickAddsSelectionRange=F1;_e.decorations=qc;_e.blockWrappers=G1;_e.outerDecorations=Ap;_e.atomicRanges=al;_e.bidiIsolatedRanges=H1;_e.scrollMargins=J1;_e.darkTheme=bd;_e.cspNonce=Me.define({combine:t=>t.length?t[0]:""});_e.contentAttributes=Ep;_e.editorAttributes=Y1;_e.lineWrapping=_e.contentAttributes.of({class:"cm-lineWrapping"});_e.announce=We.define();const hL=4096,av={};class lc{constructor(e,i,n,r,s,a){this.from=e,this.to=i,this.dir=n,this.isolates=r,this.fresh=s,this.order=a}static update(e,i){if(i.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:yt.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==r&&!i.touchesRange(a.from,a.to)&&n.push(new lc(i.mapPos(a.from,1),i.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return n}}function ov(t,e,i){for(let n=t.state.facet(e),r=n.length-1;r>=0;r--){let s=n[r],a=typeof s=="function"?s(t):s;a&&wp(a,i)}return i}const fL=Ie.mac?"mac":Ie.windows?"win":Ie.linux?"linux":"key";function dL(t,e){const i=t.split(/-(?!$)/);let n=i[i.length-1];n=="Space"&&(n=" ");let r,s,a,l;for(let u=0;u<i.length-1;++u){const h=i[u];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))r=!0;else if(/^(c|ctrl|control)$/i.test(h))s=!0;else if(/^s(hift)?$/i.test(h))a=!0;else if(/^mod$/i.test(h))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+h)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),l&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function eu(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),i!==!1&&e.shiftKey&&(t="Shift-"+t),t}const pL=fr.default(_e.domEventHandlers({keydown(t,e){return vS(yS(e.state),t,e,"editor")}})),ol=Me.define({enables:pL}),lv=new WeakMap;function yS(t){let e=t.facet(ol),i=lv.get(e);return i||lv.set(e,i=yL(e.reduce((n,r)=>n.concat(r),[]))),i}function mL(t,e,i){return vS(yS(t.state),e,t,i)}let Hn=null;const gL=4e3;function yL(t,e=fL){let i=Object.create(null),n=Object.create(null),r=(a,l)=>{let u=n[a];if(u==null)n[a]=l;else if(u!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,l,u,h,c)=>{var p,v;let g=i[a]||(i[a]=Object.create(null)),b=l.split(/ (?!$)/).map(O=>dL(O,e));for(let O=1;O<b.length;O++){let P=b.slice(0,O).join(" ");r(P,!0),g[P]||(g[P]={preventDefault:!0,stopPropagation:!1,run:[S=>{let w=Hn={view:S,prefix:P,scope:a};return setTimeout(()=>{Hn==w&&(Hn=null)},gL),!0}]})}let m=b.join(" ");r(m,!1);let x=g[m]||(g[m]={preventDefault:!1,stopPropagation:!1,run:((v=(p=g._any)===null||p===void 0?void 0:p.run)===null||v===void 0?void 0:v.slice())||[]});u&&x.run.push(u),h&&(x.preventDefault=!0),c&&(x.stopPropagation=!0)};for(let a of t){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let h of l){let c=i[h]||(i[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=a;for(let v in c)c[v].run.push(g=>p(g,Pd))}let u=a[e]||a.key;if(u)for(let h of l)s(h,u,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(h,"Shift-"+u,a.shift,a.preventDefault,a.stopPropagation)}return i}let Pd=null;function vS(t,e,i,n){Pd=e;let r=_3(e),s=ni(r,0),a=nn(s)==r.length&&r!=" ",l="",u=!1,h=!1,c=!1;Hn&&Hn.view==i&&Hn.scope==n&&(l=Hn.prefix+" ",aS.indexOf(e.keyCode)<0&&(h=!0,Hn=null));let p=new Set,v=x=>{if(x){for(let O of x.run)if(!p.has(O)&&(p.add(O),O(i)))return x.stopPropagation&&(c=!0),!0;x.preventDefault&&(x.stopPropagation&&(c=!0),h=!0)}return!1},g=t[n],b,m;return g&&(v(g[l+eu(r,e,!a)])?u=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ie.windows&&e.ctrlKey&&e.altKey)&&!(Ie.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=sr[e.keyCode])&&b!=r?(v(g[l+eu(b,e,!0)])||e.shiftKey&&(m=No[e.keyCode])!=r&&m!=b&&v(g[l+eu(m,e,!1)]))&&(u=!0):a&&e.shiftKey&&v(g[l+eu(r,e,!0)])&&(u=!0),!u&&v(g._any)&&(u=!0)),h&&(u=!0),u&&c&&e.stopPropagation(),Pd=null,u}class Qr{constructor(e,i,n,r,s){this.className=e,this.left=i,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,i){return i.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,i,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=OS(e);return[new Qr(i,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return vL(e,i,n)}}function OS(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==yt.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function uv(t,e,i,n){let r=t.coordsAtPos(e,i*2);if(!r)return n;let s=t.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,l=t.posAtCoords({x:s.left+1,y:a}),u=t.posAtCoords({x:s.right-1,y:a});return l==null||u==null?n:{from:Math.max(n.from,Math.min(l,u)),to:Math.min(n.to,Math.max(l,u))}}function vL(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),r=Math.min(i.to,t.viewport.to),s=t.textDirection==yt.LTR,a=t.contentDOM,l=a.getBoundingClientRect(),u=OS(t),h=a.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),p=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),v=l.right-(c?parseInt(c.paddingRight):0),g=vd(t,n,1),b=vd(t,r,-1),m=g.type==Vt.Text?g:null,x=b.type==Vt.Text?b:null;if(m&&(t.lineWrapping||g.widgetLineBreaks)&&(m=uv(t,n,1,m)),x&&(t.lineWrapping||b.widgetLineBreaks)&&(x=uv(t,r,-1,x)),m&&x&&m.from==x.from&&m.to==x.to)return P(S(i.from,i.to,m));{let C=m?S(i.from,null,m):w(g,!1),E=x?S(null,i.to,x):w(b,!0),k=[];return(m||g).to<(x||b).from-(m&&x?1:0)||g.widgetLineBreaks>1&&C.bottom+t.defaultLineHeight/2<E.top?k.push(O(p,C.bottom,v,E.top)):C.bottom<E.top&&t.elementAtHeight((C.bottom+E.top)/2).type==Vt.Text&&(C.bottom=E.top=(C.bottom+E.top)/2),P(C).concat(k).concat(P(E))}function O(C,E,k,A){return new Qr(e,C-u.left,E-u.top,Math.max(0,k-C),A-E)}function P({top:C,bottom:E,horizontal:k}){let A=[];for(let $=0;$<k.length;$+=2)A.push(O(k[$],C,k[$+1],E));return A}function S(C,E,k){let A=1e9,$=-1e9,F=[];function I(M,q,X,Y,V){let oe=t.coordsAtPos(M,M==k.to?-2:2),ae=t.coordsAtPos(X,X==k.from?2:-2);!oe||!ae||(A=Math.min(oe.top,ae.top,A),$=Math.max(oe.bottom,ae.bottom,$),V==yt.LTR?F.push(s&&q?p:oe.left,s&&Y?v:ae.right):F.push(!s&&Y?p:ae.left,!s&&q?v:oe.right))}let B=C??k.from,j=E??k.to;for(let M of t.visibleRanges)if(M.to>B&&M.from<j)for(let q=Math.max(M.from,B),X=Math.min(M.to,j);;){let Y=t.state.doc.lineAt(q);for(let V of t.bidiSpans(Y)){let oe=V.from+Y.from,ae=V.to+Y.from;if(oe>=X)break;ae>q&&I(Math.max(oe,q),C==null&&oe<=B,Math.min(ae,X),E==null&&ae>=j,V.dir)}if(q=Y.to+1,q>=X)break}return F.length==0&&I(B,C==null,j,E==null,t.textDirection),{top:A,bottom:$,horizontal:F}}function w(C,E){let k=l.top+(E?C.top:C.bottom);return{top:k,bottom:k,horizontal:[]}}}function OL(t,e){return t.constructor==e.constructor&&t.eq(e)}class xL{constructor(e,i){this.view=e,this.layer=i,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),i.above&&this.dom.classList.add("cm-layer-above"),i.class&&this.dom.classList.add(i.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),i.mount&&i.mount(this.dom,e)}update(e){e.startState.facet(Eu)!=e.state.facet(Eu)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let i=0,n=e.facet(Eu);for(;i<n.length&&n[i]!=this.layer;)i++;this.dom.style.zIndex=String((this.layer.above?150:-1)-i)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:i}=this.view;(e!=this.scaleX||i!=this.scaleY)&&(this.scaleX=e,this.scaleY=i,this.dom.style.transform=`scale(${1/e}, ${1/i})`)}draw(e){if(e.length!=this.drawn.length||e.some((i,n)=>!OL(i,this.drawn[n]))){let i=this.dom.firstChild,n=0;for(let r of e)r.update&&i&&r.constructor&&this.drawn[n].constructor&&r.update(i,this.drawn[n])?(i=i.nextSibling,n++):this.dom.insertBefore(r.draw(),i);for(;i;){let r=i.nextSibling;i.remove(),i=r}this.drawn=e,Ie.safari&&Ie.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Eu=Me.define();function xS(t){return[Et.define(e=>new xL(e,t)),Eu.of(t)]}const Ls=Me.define({combine(t){return mn(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,i)=>Math.min(e,i),drawRangeCursor:(e,i)=>e||i})}});function bL(t={}){return[Ls.of(t),SL,wL,PL,U1.of(!0)]}function bS(t){return t.startState.facet(Ls)!=t.state.facet(Ls)}const SL=xS({above:!0,markers(t){let{state:e}=t,i=e.facet(Ls),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||i.drawRangeCursor&&!(s&&Ie.ios&&i.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:Oe.cursor(r.head,r.assoc);for(let u of Qr.forRange(t,a,l))n.push(u)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let i=bS(t);return i&&cv(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){cv(e.state,t)},class:"cm-cursorLayer"});function cv(t,e){e.style.animationDuration=t.facet(Ls).cursorBlinkRate+"ms"}const wL=xS({above:!1,markers(t){let e=[],{main:i,ranges:n}=t.state.selection;for(let r of n)if(!r.empty)for(let s of Qr.forRange(t,"cm-selectionBackground",r))e.push(s);if(Ie.ios&&!i.empty&&t.state.facet(Ls).iosSelectionHandles){for(let r of Qr.forRange(t,"cm-selectionHandle cm-selectionHandle-start",Oe.cursor(i.from,1)))e.push(r);for(let r of Qr.forRange(t,"cm-selectionHandle cm-selectionHandle-end",Oe.cursor(i.to,1)))e.push(r)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||bS(t)},class:"cm-selectionLayer"}),PL=fr.highest(_e.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),SS=We.define({map(t,e){return t==null?null:e.mapPos(t)}}),eo=Ut.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((i,n)=>n.is(SS)?n.value:i,t)}}),TL=Et.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(eo);i==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(eo)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(eo),i=e!=null&&t.coordsAtPos(e);if(!i)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(eo)!=t&&this.view.dispatch({effects:SS.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function CL(){return[eo,TL]}function hv(t,e,i,n,r){e.lastIndex=0;for(let s=t.iterRange(i,n),a=i,l;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(a+l.index,l)}function kL(t,e){let i=t.visibleRanges;if(i.length==1&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:r,to:s}of i)r=Math.max(t.state.doc.lineAt(r).from,r-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=s:n.push({from:r,to:s});return n}class EL{constructor(e){const{regexp:i,decoration:n,decorate:r,boundary:s,maxLength:a=1e3}=e;if(!i.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=i,r)this.addMatch=(l,u,h,c)=>r(c,h,h+l[0].length,l,u);else if(typeof n=="function")this.addMatch=(l,u,h,c)=>{let p=n(l,u,h);p&&c(h,h+l[0].length,p)};else if(n)this.addMatch=(l,u,h,c)=>c(h,h+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=a}createDeco(e){let i=new In,n=i.add.bind(i);for(let{from:r,to:s}of kL(e,this.maxLength))hv(e.state.doc,this.regexp,r,s,(a,l)=>this.addMatch(l,e,a,n));return i.finish()}updateDeco(e,i){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,a,l,u)=>{u>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),r=Math.max(u,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,i.map(e.changes),n,r):i}updateRange(e,i,n,r){for(let s of e.visibleRanges){let a=Math.max(s.from,n),l=Math.min(s.to,r);if(l>=a){let u=e.state.doc.lineAt(a),h=u.to<l?e.state.doc.lineAt(l):u,c=Math.max(s.from,u.from),p=Math.min(s.to,h.to);if(this.boundary){for(;a>u.from;a--)if(this.boundary.test(u.text[a-1-u.from])){c=a;break}for(;l<h.to;l++)if(this.boundary.test(h.text[l-h.from])){p=l;break}}let v=[],g,b=(m,x,O)=>v.push(O.range(m,x));if(u==h)for(this.regexp.lastIndex=c-u.from;(g=this.regexp.exec(u.text))&&g.index<p-u.from;)this.addMatch(g,e,g.index+u.from,b);else hv(e.state.doc,this.regexp,c,p,(m,x)=>this.addMatch(x,e,m,b));i=i.update({filterFrom:c,filterTo:p,filter:(m,x)=>m<c||x>p,add:v})}}return i}}const Td=/x/.unicode!=null?"gu":"g",AL=new RegExp(`[\0-\b
|
|
202
|
+
--\u2028\u2029\uFEFF-]`,Td),DL={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Hh=null;function _L(){var t;if(Hh==null&&typeof document<"u"&&document.body){let e=document.body.style;Hh=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Hh||!1}const Au=Me.define({combine(t){let e=mn(t,{render:null,specialChars:AL,addSpecialChars:null});return(e.replaceTabs=!_L())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Td)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Td)),e}});function IL(t={}){return[Au.of(t),NL()]}let fv=null;function NL(){return fv||(fv=Et.fromClass(class{constructor(t){this.view=t,this.decorations=Ze.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Au)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new EL({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:r}=i.state,s=ni(e[0],0);if(s==9){let a=r.lineAt(n),l=i.state.tabSize,u=Rs(a.text,l,n-a.from);return Ze.replace({widget:new BL((l-u%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Ze.replace({widget:new LL(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Au);t.startState.facet(Au)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const ML="•";function $L(t){return t>=32?ML:t==10?"":String.fromCharCode(9216+t)}class LL extends Ri{constructor(e,i){super(),this.options=e,this.code=i}eq(e){return e.code==this.code}toDOM(e){let i=$L(this.code),n=e.state.phrase("Control character")+" "+(DL[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,i);if(r)return r;let s=document.createElement("span");return s.textContent=i,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class BL extends Ri{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function QL(){return RL}const FL=Ze.line({class:"cm-activeLine"}),RL=Et.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let r=t.lineBlockAt(n.head);r.from>e&&(i.push(FL.range(r.from)),e=r.from)}return Ze.set(i)}},{decorations:t=>t.decorations});class zL extends Ri{constructor(e){super(),this.content=e}toDOM(e){let i=document.createElement("span");return i.className="cm-placeholder",i.style.pointerEvents="none",i.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),i.setAttribute("aria-hidden","true"),i}coordsAt(e){let i=e.firstChild?uo(e.firstChild):[];if(!i.length)return null;let n=window.getComputedStyle(e.parentNode),r=Lo(i[0],n.direction!="rtl"),s=parseInt(n.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function XL(t){let e=Et.fromClass(class{constructor(i){this.view=i,this.placeholder=t?Ze.set([Ze.widget({widget:new zL(t),side:1}).range(0)]):Ze.none}get decorations(){return this.view.state.doc.length?Ze.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,_e.contentAttributes.of({"aria-placeholder":t})]:e}const Cd=2e3;function jL(t,e,i){let n=Math.min(e.line,i.line),r=Math.max(e.line,i.line),s=[];if(e.off>Cd||i.off>Cd||e.col<0||i.col<0){let a=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let u=n;u<=r;u++){let h=t.doc.line(u);h.length<=l&&s.push(Oe.range(h.from+a,h.to+l))}}else{let a=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let u=n;u<=r;u++){let h=t.doc.line(u),c=sd(h.text,a,t.tabSize,!0);if(c<0)s.push(Oe.cursor(h.to));else{let p=sd(h.text,l,t.tabSize);s.push(Oe.range(h.from+c,h.from+p))}}}return s}function ZL(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function dv(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),r=i-n.from,s=r>Cd?-1:r==n.length?ZL(t,e.clientX):Rs(n.text,t.state.tabSize,i-n.from);return{line:n.number,col:s,off:r}}function VL(t,e){let i=dv(t,e),n=t.state.selection;return i?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(i.line).from),a=r.state.doc.lineAt(s);i={line:a.number,col:i.col,off:Math.min(i.off,a.length)},n=n.map(r.changes)}},get(r,s,a){let l=dv(t,r);if(!l)return n;let u=jL(t.state,i,l);return u.length?a?Oe.create(u.concat(n.ranges)):Oe.create(u):n}}:null}function UL(t){let e=(i=>i.altKey&&i.button==0);return _e.mouseSelectionStyle.of((i,n)=>e(n)?VL(i,n):null)}const qL={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},WL={style:"cursor: crosshair"};function YL(t={}){let[e,i]=qL[t.key||"Alt"],n=Et.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||i(r))},keyup(r){(r.keyCode==e||!i(r))&&this.set(!1)},mousemove(r){this.set(i(r))}}});return[n,_e.contentAttributes.of(r=>{var s;return!((s=r.plugin(n))===null||s===void 0)&&s.isDown?WL:null})]}const tu="-10000px";class wS{constructor(e,i,n,r){this.facet=i,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(i),this.tooltips=this.input.filter(a=>a);let s=null;this.tooltipViews=this.tooltips.map(a=>s=n(a,s))}update(e,i){var n;let r=e.state.facet(this.facet),s=r.filter(u=>u);if(r===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let a=[],l=i?[]:null;for(let u=0;u<s.length;u++){let h=s[u],c=-1;if(h){for(let p=0;p<this.tooltips.length;p++){let v=this.tooltips[p];v&&v.create==h.create&&(c=p)}if(c<0)a[u]=this.createTooltipView(h,u?a[u-1]:null),l&&(l[u]=!!h.above);else{let p=a[u]=this.tooltipViews[c];l&&(l[u]=i[c]),p.update&&p.update(e)}}}for(let u of this.tooltipViews)a.indexOf(u)<0&&(this.removeTooltipView(u),(n=u.destroy)===null||n===void 0||n.call(u));return i&&(l.forEach((u,h)=>i[h]=u),i.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=a,!0}}function GL(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Jh=Me.define({combine:t=>{var e,i,n;return{position:Ie.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((i=t.find(r=>r.parent))===null||i===void 0?void 0:i.parent)||null,tooltipSpace:((n=t.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||GL}}}),pv=new WeakMap,Mp=Et.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Jh);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new wS(t,$p,(i,n)=>this.createTooltip(i,n),i=>{this.resizeObserver&&this.resizeObserver.unobserve(i.dom),i.dom.remove()}),this.above=this.manager.tooltips.map(i=>!!i.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(i=>{Date.now()>this.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(Jh);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",i.dom.appendChild(r)}return i.dom.style.position=this.position,i.dom.style.top=tu,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(i=this.intersectionObserver)===null||i===void 0||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Ie.safari){let a=s.getBoundingClientRect();i=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else i=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=Dp(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Jh).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:i,space:n,scaleX:r,scaleY:s}=t,a=[];for(let l=0;l<this.manager.tooltips.length;l++){let u=this.manager.tooltips[l],h=this.manager.tooltipViews[l],{dom:c}=h,p=t.pos[l],v=t.size[l];if(!p||u.clip!==!1&&(p.bottom<=Math.max(i.top,n.top)||p.top>=Math.min(i.bottom,n.bottom)||p.right<Math.max(i.left,n.left)-.1||p.left>Math.min(i.right,n.right)+.1)){c.style.top=tu;continue}let g=u.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,b=g?7:0,m=v.right-v.left,x=(e=pv.get(h))!==null&&e!==void 0?e:v.bottom-v.top,O=h.offset||JL,P=this.view.textDirection==yt.LTR,S=v.width>n.right-n.left?P?n.left:n.right-v.width:P?Math.max(n.left,Math.min(p.left-(g?14:0)+O.x,n.right-m)):Math.min(Math.max(n.left,p.left-m+(g?14:0)-O.x),n.right-m),w=this.above[l];!u.strictSide&&(w?p.top-x-b-O.y<n.top:p.bottom+x+b+O.y>n.bottom)&&w==n.bottom-p.bottom>p.top-n.top&&(w=this.above[l]=!w);let C=(w?p.top-n.top:n.bottom-p.bottom)-b;if(C<x&&h.resize!==!1){if(C<this.view.defaultLineHeight){c.style.top=tu;continue}pv.set(h,x),c.style.height=(x=C)/s+"px"}else c.style.height&&(c.style.height="");let E=w?p.top-x-b-O.y:p.bottom+b+O.y,k=S+m;if(h.overlap!==!0)for(let A of a)A.left<k&&A.right>S&&A.top<E+x&&A.bottom>E&&(E=w?A.top-x-2-b:A.bottom+b+2);if(this.position=="absolute"?(c.style.top=(E-t.parent.top)/s+"px",mv(c,(S-t.parent.left)/r)):(c.style.top=E/s+"px",mv(c,S/r)),g){let A=p.left+(P?O.x:-O.x)-(S+14-7);g.style.left=A/r+"px"}h.overlap!==!0&&a.push({left:S,top:E,right:k,bottom:E+x}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),h.positioned&&h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=tu}},{eventObservers:{scroll(){this.maybeMeasure()}}});function mv(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const HL=_e.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),JL={x:0,y:0},$p=Me.define({enables:[Mp,HL]}),uc=Me.define({combine:t=>t.reduce((e,i)=>e.concat(i),[])});class Hc{static create(e){return new Hc(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new wS(e,uc,(i,n)=>this.createHostedView(i,n),i=>i.dom.remove())}createHostedView(e,i){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,i?i.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let i of this.manager.tooltipViews)i.mount&&i.mount(e);this.mounted=!0}positioned(e){for(let i of this.manager.tooltipViews)i.positioned&&i.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let i of this.manager.tooltipViews)(e=i.destroy)===null||e===void 0||e.call(i)}passProp(e){let i;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(i===void 0)i=r;else if(i!==r)return}}return i}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const KL=$p.compute([uc],t=>{let e=t.facet(uc);return e.length===0?null:{pos:Math.min(...e.map(i=>i.pos)),end:Math.max(...e.map(i=>{var n;return(n=i.end)!==null&&n!==void 0?n:i.pos})),create:Hc.create,above:e[0].above,arrow:e.some(i=>i.arrow)}});class eB{constructor(e,i,n,r,s){this.view=e,this.source=i,this.field=n,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:i}=this,n=e.docView.tile.nearest(i.target);if(!n)return;let r,s=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(i),r==null)return;let l=e.coordsAtPos(r);if(!l||i.y<l.top||i.y>l.bottom||i.x<l.left-e.defaultCharacterWidth||i.x>l.right+e.defaultCharacterWidth)return;let u=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),h=u&&u.dir==yt.RTL?-1:1;s=i.x<l.left?-h:h}let a=this.source(e,r,s);if(a?.then){let l=this.pending={pos:r};a.then(u=>{this.pending==l&&(this.pending=null,u&&!(Array.isArray(u)&&!u.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(u)?u:[u])}))},u=>li(e.state,u,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(Mp),i=e?e.manager.tooltips.findIndex(n=>n.create==Hc.create):-1;return i>-1?e.manager.tooltipViews[i]:null}mousemove(e){var i,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!tB(s.dom,e)||this.pending){let{pos:a}=r[0]||this.pending,l=(n=(i=r[0])===null||i===void 0?void 0:i.end)!==null&&n!==void 0?n:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!iB(this.view,a,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:i}=this;if(i.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let i=n=>{e.removeEventListener("mouseleave",i),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",i)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const iu=4;function tB(t,e){let{left:i,right:n,top:r,bottom:s}=t.getBoundingClientRect(),a;if(a=t.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=i-iu&&e.clientX<=n+iu&&e.clientY>=r-iu&&e.clientY<=s+iu}function iB(t,e,i,n,r,s){let a=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>n||a.right<n||a.top>r||Math.min(a.bottom,l)<r)return!1;let u=t.posAtCoords({x:n,y:r},!1);return u>=e&&u<=i}function nB(t,e={}){let i=We.define(),n=Ut.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(a=>!e.hideOn(s,a))),s.docChanged)){let a=[];for(let l of r){let u=s.changes.mapPos(l.pos,-1,Zt.TrackDel);if(u!=null){let h=Object.assign(Object.create(null),l);h.pos=u,h.end!=null&&(h.end=s.changes.mapPos(h.end)),a.push(h)}}r=a}for(let a of s.effects)a.is(i)&&(r=a.value),a.is(rB)&&(r=[]);return r},provide:r=>uc.from(r)});return{active:n,extension:[n,Et.define(r=>new eB(r,t,n,i,e.hoverTime||300)),KL]}}function PS(t,e){let i=t.plugin(Mp);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}const rB=We.define(),gv=Me.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}});function Lp(t,e){let i=t.plugin(TS),n=i?i.specs.indexOf(e):-1;return n>-1?i.panels[n]:null}const TS=Et.fromClass(class{constructor(t){this.input=t.state.facet(Qo),this.specs=this.input.filter(i=>i),this.panels=this.specs.map(i=>i(t));let e=t.state.facet(gv);this.top=new nu(t,!0,e.topContainer),this.bottom=new nu(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(i=>i.top)),this.bottom.sync(this.panels.filter(i=>!i.top));for(let i of this.panels)i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(t){let e=t.state.facet(gv);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new nu(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new nu(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(Qo);if(i!=this.input){let n=i.filter(u=>u),r=[],s=[],a=[],l=[];for(let u of n){let h=this.specs.indexOf(u),c;h<0?(c=u(t.view),l.push(c)):(c=this.panels[h],c.update&&c.update(t)),r.push(c),(c.top?s:a).push(c)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(a);for(let u of l)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>_e.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class nu{constructor(e,i,n){this.view=e,this.top=i,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let i of this.panels)i.destroy&&e.indexOf(i)<0&&i.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let i=this.container||this.view.dom;i.insertBefore(this.dom,this.top?i.firstChild:null)}let e=this.dom.firstChild;for(let i of this.panels)if(i.dom.parentNode==this.dom){for(;e!=i.dom;)e=yv(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=yv(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function yv(t){let e=t.nextSibling;return t.remove(),e}const Qo=Me.define({enables:TS});function sB(t,e){let i,n=new Promise(a=>i=a),r=a=>aB(a,e,i);t.state.field(Kh,!1)?t.dispatch({effects:CS.of(r)}):t.dispatch({effects:We.appendConfig.of(Kh.init(()=>[r]))});let s=kS.of(r);return{close:s,result:n.then(a=>((t.win.queueMicrotask||(u=>t.win.setTimeout(u,10)))(()=>{t.state.field(Kh).indexOf(r)>-1&&t.dispatch({effects:s})}),a))}}const Kh=Ut.define({create(){return[]},update(t,e){for(let i of e.effects)i.is(CS)?t=[i.value].concat(t):i.is(kS)&&(t=t.filter(n=>n!=i.value));return t},provide:t=>Qo.computeN([t],e=>e.field(t))}),CS=We.define(),kS=We.define();function aB(t,e,i){let n=e.content?e.content(t,()=>a(null)):null;if(!n){if(n=ct("form"),e.input){let l=ct("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),n.appendChild(ct("label",(e.label||"")+": ",l))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(ct("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let l=0;l<r.length;l++){let u=r[l];u.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),a(null)):h.keyCode==13&&(h.preventDefault(),a(u))}),u.addEventListener("submit",h=>{h.preventDefault(),a(u)})}let s=ct("div",n,ct("button",{onclick:()=>a(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function a(l){s.contains(s.ownerDocument.activeElement)&&t.focus(),i(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=n.querySelector(e.focus):l=n.querySelector("input")||n.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Mn extends nr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Mn.prototype.elementClass="";Mn.prototype.toDOM=void 0;Mn.prototype.mapMode=Zt.TrackBefore;Mn.prototype.startSide=Mn.prototype.endSide=-1;Mn.prototype.point=!0;const Du=Me.define(),oB=Me.define(),lB={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>tt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},fo=Me.define();function uB(t){return[ES(),fo.of({...lB,...t})]}const vv=Me.define({combine:t=>t.some(e=>e)});function ES(t){return[cB]}const cB=Et.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(fo).map(e=>new xv(t,e)),this.fixed=!t.state.facet(vv);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<(i.to-i.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(vv)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=tt.iter(this.view.state.facet(Du),this.view.viewport.from),n=[],r=this.gutters.map(s=>new hB(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let a=!0;for(let l of s.type)if(l.type==Vt.Text&&a){kd(i,n,l.from);for(let u of r)u.line(this.view,l,n);a=!1}else if(l.widget)for(let u of r)u.widget(this.view,l)}else if(s.type==Vt.Text){kd(i,n,s.from);for(let a of r)a.line(this.view,s,n)}else if(s.widget)for(let a of r)a.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(fo),i=t.state.facet(fo),n=t.docChanged||t.heightChanged||t.viewportChanged||!tt.eq(t.startState.facet(Du),t.state.facet(Du),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let r of this.gutters)r.update(t)&&(n=!0);else{n=!0;let r=[];for(let s of i){let a=e.indexOf(s);a<0?r.push(new xv(this.view,s)):(this.gutters[a].update(t),r.push(this.gutters[a]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>_e.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||i.gutters.length==0||!i.fixed)return null;let n=i.dom.offsetWidth*e.scaleX,r=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==yt.LTR?{left:n,right:r}:{right:n,left:r}})});function Ov(t){return Array.isArray(t)?t:[t]}function kd(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class hB{constructor(e,i,n){this.gutter=e,this.height=n,this.i=0,this.cursor=tt.iter(e.markers,i.from)}addElement(e,i,n){let{gutter:r}=this,s=(i.top-this.height)/e.scaleY,a=i.height/e.scaleY;if(this.i==r.elements.length){let l=new AS(e,a,s,n);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,a,s,n);this.height=i.bottom,this.i++}line(e,i,n){let r=[];kd(this.cursor,r,i.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,i,r);s&&r.unshift(s);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,i,r)}widget(e,i){let n=this.gutter.config.widgetMarker(e,i.widget,i),r=n?[n]:null;for(let s of e.state.facet(oB)){let a=s(e,i.widget,i);a&&(r||(r=[])).push(a)}r&&this.addElement(e,i,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let i=e.elements.pop();e.dom.removeChild(i.dom),i.destroy()}}}class xv{constructor(e,i){this.view=e,this.config=i,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in i.domEventHandlers)this.dom.addEventListener(n,r=>{let s=r.target,a;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let u=s.getBoundingClientRect();a=(u.top+u.bottom)/2}else a=r.clientY;let l=e.lineBlockAtHeight(a-e.documentTop);i.domEventHandlers[n](e,l,r)&&r.preventDefault()});this.markers=Ov(i.markers(e)),i.initialSpacer&&(this.spacer=new AS(e,0,0,[i.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let i=this.markers;if(this.markers=Ov(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!tt.eq(this.markers,i,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class AS{constructor(e,i,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,i,n,r)}update(e,i,n,r){this.height!=i&&(this.height=i,this.dom.style.height=i+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),fB(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,i){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,a=0;;){let l=a,u=s<i.length?i[s++]:null,h=!1;if(u){let c=u.elementClass;c&&(n+=" "+c);for(let p=a;p<this.markers.length;p++)if(this.markers[p].compare(u)){l=p,h=!0;break}}else l=this.markers.length;for(;a<l;){let c=this.markers[a++];if(c.toDOM){c.destroy(r);let p=r.nextSibling;r.remove(),r=p}}if(!u)break;u.toDOM&&(h?r=r.nextSibling:this.dom.insertBefore(u.toDOM(e),r)),h&&a++}this.dom.className=n,this.markers=i}destroy(){this.setMarkers(null,[])}}function fB(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].compare(e[i]))return!1;return!0}const dB=Me.define(),pB=Me.define(),us=Me.define({combine(t){return mn(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,i){let n=Object.assign({},e);for(let r in i){let s=n[r],a=i[r];n[r]=s?(l,u,h)=>s(l,u,h)||a(l,u,h):a}return n}})}});class ef extends Mn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function tf(t,e){return t.state.facet(us).formatNumber(e,t.state)}const mB=fo.compute([us],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(dB)},lineMarker(e,i,n){return n.some(r=>r.toDOM)?null:new ef(tf(e,e.state.doc.lineAt(i.from).number))},widgetMarker:(e,i,n)=>{for(let r of e.state.facet(pB)){let s=r(e,i,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(us)!=e.state.facet(us),initialSpacer(e){return new ef(tf(e,bv(e.state.doc.lines)))},updateSpacer(e,i){let n=tf(i.view,bv(i.view.state.doc.lines));return n==e.number?e:new ef(n)},domEventHandlers:t.facet(us).domEventHandlers,side:"before"}));function gB(t={}){return[us.of(t),ES(),mB]}function bv(t){let e=9;for(;e<t;)e=e*10+9;return e}const yB=new class extends Mn{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},vB=Du.compute(["selection"],t=>{let e=[],i=-1;for(let n of t.selection.ranges){let r=t.doc.lineAt(n.head).from;r>i&&(i=r,e.push(yB.range(r)))}return tt.of(e)});function OB(){return vB}const DS=1024;let xB=0;class nf{constructor(e,i){this.from=e,this.to=i}}class Ke{constructor(e={}){this.id=xB++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=di.match(e)),i=>{let n=e(i);return n===void 0?null:[this,n]}}}Ke.closedBy=new Ke({deserialize:t=>t.split(" ")});Ke.openedBy=new Ke({deserialize:t=>t.split(" ")});Ke.group=new Ke({deserialize:t=>t.split(" ")});Ke.isolate=new Ke({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Ke.contextHash=new Ke({perNode:!0});Ke.lookAhead=new Ke({perNode:!0});Ke.mounted=new Ke({perNode:!0});class po{constructor(e,i,n,r=!1){this.tree=e,this.overlay=i,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Ke.mounted.id]}}const bB=Object.create(null);class di{constructor(e,i,n,r=0){this.name=e,this.props=i,this.id=n,this.flags=r}static define(e){let i=e.props&&e.props.length?Object.create(null):bB,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new di(e.name||"",i,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let i=this.prop(Ke.group);return i?i.indexOf(e)>-1:!1}return this.id==e}static match(e){let i=Object.create(null);for(let n in e)for(let r of n.split(" "))i[r]=e[n];return n=>{for(let r=n.prop(Ke.group),s=-1;s<(r?r.length:0);s++){let a=i[s<0?n.name:r[s]];if(a)return a}}}}di.none=new di("",Object.create(null),0,8);class Bp{constructor(e){this.types=e;for(let i=0;i<e.length;i++)if(e[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let i=[];for(let n of this.types){let r=null;for(let s of e){let a=s(n);if(a){r||(r=Object.assign({},n.props));let l=a[1],u=a[0];u.combine&&u.id in r&&(l=u.combine(r[u.id],l)),r[u.id]=l}}i.push(r?new di(n.name,r,n.id,n.flags):n)}return new Bp(i)}}const ru=new WeakMap,Sv=new WeakMap;var Pt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Pt||(Pt={}));class _t{constructor(e,i,n,r,s){if(this.type=e,this.children=i,this.positions=n,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,l]of s)this.props[typeof a=="number"?a:a.id]=l}}toString(){let e=po.get(this);if(e&&!e.overlay)return e.tree.toString();let i="";for(let n of this.children){let r=n.toString();r&&(i&&(i+=","),i+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(e=0){return new Ad(this.topNode,e)}cursorAt(e,i=0,n=0){let r=ru.get(this)||this.topNode,s=new Ad(r);return s.moveTo(e,i),ru.set(this,s._tree),s}get topNode(){return new ci(this,0,0,null)}resolve(e,i=0){let n=Fo(ru.get(this)||this.topNode,e,i,!1);return ru.set(this,n),n}resolveInner(e,i=0){let n=Fo(Sv.get(this)||this.topNode,e,i,!0);return Sv.set(this,n),n}resolveStack(e,i=0){return PB(this,e,i)}iterate(e){let{enter:i,leave:n,from:r=0,to:s=this.length}=e,a=e.mode||0,l=(a&Pt.IncludeAnonymous)>0;for(let u=this.cursor(a|Pt.IncludeAnonymous);;){let h=!1;if(u.from<=s&&u.to>=r&&(!l&&u.type.isAnonymous||i(u)!==!1)){if(u.firstChild())continue;h=!0}for(;h&&n&&(l||!u.type.isAnonymous)&&n(u),!u.nextSibling();){if(!u.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let i in this.props)e.push([+i,this.props[i]]);return e}balance(e={}){return this.children.length<=8?this:Rp(di.none,this.children,this.positions,0,this.children.length,0,this.length,(i,n,r)=>new _t(this.type,i,n,r,this.propValues),e.makeTree||((i,n,r)=>new _t(di.none,i,n,r)))}static build(e){return TB(e)}}_t.empty=new _t(di.none,[],[],0);class Qp{constructor(e,i){this.buffer=e,this.index=i}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Qp(this.buffer,this.index)}}class or{constructor(e,i,n){this.buffer=e,this.length=i,this.set=n}get type(){return di.none}toString(){let e=[];for(let i=0;i<this.buffer.length;)e.push(this.childString(i)),i=this.buffer[i+3];return e.join(",")}childString(e){let i=this.buffer[e],n=this.buffer[e+3],r=this.set.types[i],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,i,n,r,s){let{buffer:a}=this,l=-1;for(let u=e;u!=i&&!(_S(s,r,a[u+1],a[u+2])&&(l=u,n>0));u=a[u+3]);return l}slice(e,i,n){let r=this.buffer,s=new Uint16Array(i-e),a=0;for(let l=e,u=0;l<i;){s[u++]=r[l++],s[u++]=r[l++]-n;let h=s[u++]=r[l++]-n;s[u++]=r[l++]-e,a=Math.max(a,h)}return new or(s,a,this.set)}}function _S(t,e,i,n){switch(t){case-2:return i<e;case-1:return n>=e&&i<e;case 0:return i<e&&n>e;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function Fo(t,e,i,n){for(var r;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){let a=!n&&t instanceof ci&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=n?0:Pt.IgnoreOverlays;if(n)for(let a=t,l=a.parent;l;a=l,l=a.parent)a instanceof ci&&a.index<0&&((r=l.enter(e,i,s))===null||r===void 0?void 0:r.from)!=a.from&&(t=l);for(;;){let a=t.enter(e,i,s);if(!a)return t;t=a}}class IS{cursor(e=0){return new Ad(this,e)}getChild(e,i=null,n=null){let r=wv(this,e,i,n);return r.length?r[0]:null}getChildren(e,i=null,n=null){return wv(this,e,i,n)}resolve(e,i=0){return Fo(this,e,i,!1)}resolveInner(e,i=0){return Fo(this,e,i,!0)}matchContext(e){return Ed(this.parent,e)}enterUnfinishedNodesBefore(e){let i=this.childBefore(e),n=this;for(;i;){let r=i.lastChild;if(!r||r.to!=i.to)break;r.type.isError&&r.from==r.to?(n=i,i=r.prevSibling):i=r}return n}get node(){return this}get next(){return this.parent}}class ci extends IS{constructor(e,i,n,r){super(),this._tree=e,this.from=i,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,i,n,r,s=0){for(let a=this;;){for(let{children:l,positions:u}=a._tree,h=i>0?l.length:-1;e!=h;e+=i){let c=l[e],p=u[e]+a.from,v;if(!(!(s&Pt.EnterBracketed&&c instanceof _t&&(v=po.get(c))&&!v.overlay&&v.bracketed&&n>=p&&n<=p+c.length)&&!_S(r,n,p,p+c.length))){if(c instanceof or){if(s&Pt.ExcludeBuffers)continue;let g=c.findChild(0,c.buffer.length,i,n-p,r);if(g>-1)return new an(new SB(a,c,e,p),null,g)}else if(s&Pt.IncludeAnonymous||!c.type.isAnonymous||Fp(c)){let g;if(!(s&Pt.IgnoreMounts)&&(g=po.get(c))&&!g.overlay)return new ci(g.tree,p,e,a);let b=new ci(c,p,e,a);return s&Pt.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(i<0?c.children.length-1:0,i,n,r,s)}}}if(s&Pt.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+i:e=i<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,i,n=0){let r;if(!(n&Pt.IgnoreOverlays)&&(r=po.get(this._tree))&&r.overlay){let s=e-this.from,a=n&Pt.EnterBracketed&&r.bracketed;for(let{from:l,to:u}of r.overlay)if((i>0||a?l<=s:l<s)&&(i<0||a?u>=s:u>s))return new ci(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,i,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function wv(t,e,i,n){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(i!=null){for(let a=!1;!a;)if(a=r.type.is(i),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Ed(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class SB{constructor(e,i,n,r){this.parent=e,this.buffer=i,this.index=n,this.start=r}}class an extends IS{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,i,n){super(),this.context=e,this._parent=i,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,i,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.context.start,n);return s<0?null:new an(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,i,n=0){if(n&Pt.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],i>0?1:-1,e-this.context.start,i);return s<0?null:new an(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,i=e.buffer[this.index+3];return i<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new an(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new an(this.context,this._parent,e.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],i=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let a=n.buffer[this.index+1];e.push(n.slice(r,s,a)),i.push(0)}return new _t(this.type,e,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function NS(t){if(!t.length)return null;let e=0,i=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>i.from||a.to<i.to)&&(i=a,e=s)}let n=i instanceof ci&&i.index<0?null:i.parent,r=t.slice();return n?r[e]=n:r.splice(e,1),new wB(r,i)}class wB{constructor(e,i){this.heads=e,this.node=i}get next(){return NS(this.heads)}}function PB(t,e,i){let n=t.resolveInner(e,i),r=null;for(let s=n instanceof ci?n:n.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(r||(r=[n])).push(a.resolve(e,i)),s=a}else{let a=po.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let l=new ci(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(Fo(l,e,i,!1))}}return r?NS(r):n}class Ad{get name(){return this.type.name}constructor(e,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~Pt.EnterBracketed,e instanceof ci)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,i){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=i||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof ci?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,i,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,i,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,i,n=this.mode){return this.buffer?n&Pt.ExcludeBuffers?!1:this.enterChild(1,e,i):this.yield(this._tree.enter(e,i,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Pt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Pt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:i}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(i.findChild(r,this.index,-1,0,4))}else{let r=i.buffer[this.index+3];if(r<(n<0?i.buffer.length:i.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let i,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:i,parent:n}=r)}else({index:i,_parent:n}=this._tree);for(;n;{index:i,_parent:n}=n)if(i>-1)for(let s=i+e,a=e<0?-1:n._tree.children.length;s!=a;s+=e){let l=n._tree.children[s];if(this.mode&Pt.IncludeAnonymous||l instanceof or||!l.type.isAnonymous||Fp(l))return!1}return!0}move(e,i){if(i&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,i=0){for(;(this.from==this.to||(i<1?this.from>=e:this.from>e)||(i>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,i););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,i=null,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;i=a,n=s+1;break e}r=this.stack[--s]}for(let r=n;r<this.stack.length;r++)i=new an(this.buffer,i,this.stack[r]);return this.bufferNode=new an(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,i){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&i&&i(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Ed(this.node.parent,e);let{buffer:i}=this.buffer,{types:n}=i.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Ed(this._tree,e,r);let a=n[i.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}}function Fp(t){return t.children.some(e=>e instanceof or||!e.type.isAnonymous||Fp(e))}function TB(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:r=DS,reused:s=[],minRepeatType:a=n.types.length}=t,l=Array.isArray(i)?new Qp(i,i.length):i,u=n.types,h=0,c=0;function p(C,E,k,A,$,F){let{id:I,start:B,end:j,size:M}=l,q=c,X=h;if(M<0)if(l.next(),M==-1){let fe=s[I];k.push(fe),A.push(B-C);return}else if(M==-3){h=I;return}else if(M==-4){c=I;return}else throw new RangeError(`Unrecognized record size: ${M}`);let Y=u[I],V,oe,ae=B-C;if(j-B<=r&&(oe=x(l.pos-E,$))){let fe=new Uint16Array(oe.size-oe.skip),D=l.pos-oe.size,Z=fe.length;for(;l.pos>D;)Z=O(oe.start,fe,Z);V=new or(fe,j-oe.start,n),ae=oe.start-C}else{let fe=l.pos-M;l.next();let D=[],Z=[],L=I>=a?I:-1,se=0,de=j;for(;l.pos>fe;)L>=0&&l.id==L&&l.size>=0?(l.end<=de-r&&(b(D,Z,B,se,l.end,de,L,q,X),se=D.length,de=l.end),l.next()):F>2500?v(B,fe,D,Z):p(B,fe,D,Z,L,F+1);if(L>=0&&se>0&&se<D.length&&b(D,Z,B,se,B,de,L,q,X),D.reverse(),Z.reverse(),L>-1&&se>0){let ie=g(Y,X);V=Rp(Y,D,Z,0,D.length,0,j-B,ie,ie)}else V=m(Y,D,Z,j-B,q-j,X)}k.push(V),A.push(ae)}function v(C,E,k,A){let $=[],F=0,I=-1;for(;l.pos>E;){let{id:B,start:j,end:M,size:q}=l;if(q>4)l.next();else{if(I>-1&&j<I)break;I<0&&(I=M-r),$.push(B,j,M),F++,l.next()}}if(F){let B=new Uint16Array(F*4),j=$[$.length-2];for(let M=$.length-3,q=0;M>=0;M-=3)B[q++]=$[M],B[q++]=$[M+1]-j,B[q++]=$[M+2]-j,B[q++]=q;k.push(new or(B,$[2]-j,n)),A.push(j-C)}}function g(C,E){return(k,A,$)=>{let F=0,I=k.length-1,B,j;if(I>=0&&(B=k[I])instanceof _t){if(!I&&B.type==C&&B.length==$)return B;(j=B.prop(Ke.lookAhead))&&(F=A[I]+B.length+j)}return m(C,k,A,$,F,E)}}function b(C,E,k,A,$,F,I,B,j){let M=[],q=[];for(;C.length>A;)M.push(C.pop()),q.push(E.pop()+k-$);C.push(m(n.types[I],M,q,F-$,B-F,j)),E.push($-k)}function m(C,E,k,A,$,F,I){if(F){let B=[Ke.contextHash,F];I=I?[B].concat(I):[B]}if($>25){let B=[Ke.lookAhead,$];I=I?[B].concat(I):[B]}return new _t(C,E,k,A,I)}function x(C,E){let k=l.fork(),A=0,$=0,F=0,I=k.end-r,B={size:0,start:0,skip:0};e:for(let j=k.pos-C;k.pos>j;){let M=k.size;if(k.id==E&&M>=0){B.size=A,B.start=$,B.skip=F,F+=4,A+=4,k.next();continue}let q=k.pos-M;if(M<0||q<j||k.start<I)break;let X=k.id>=a?4:0,Y=k.start;for(k.next();k.pos>q;){if(k.size<0)if(k.size==-3||k.size==-4)X+=4;else break e;else k.id>=a&&(X+=4);k.next()}$=Y,A+=M,F+=X}return(E<0||A==C)&&(B.size=A,B.start=$,B.skip=F),B.size>4?B:void 0}function O(C,E,k){let{id:A,start:$,end:F,size:I}=l;if(l.next(),I>=0&&A<a){let B=k;if(I>4){let j=l.pos-(I-4);for(;l.pos>j;)k=O(C,E,k)}E[--k]=B,E[--k]=F-C,E[--k]=$-C,E[--k]=A}else I==-3?h=A:I==-4&&(c=A);return k}let P=[],S=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,P,S,-1,0);let w=(e=t.length)!==null&&e!==void 0?e:P.length?S[0]+P[0].length:0;return new _t(u[t.topID],P.reverse(),S.reverse(),w)}const Pv=new WeakMap;function _u(t,e){if(!t.isAnonymous||e instanceof or||e.type!=t)return 1;let i=Pv.get(e);if(i==null){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof _t)){i=1;break}i+=_u(t,n)}Pv.set(e,i)}return i}function Rp(t,e,i,n,r,s,a,l,u){let h=0;for(let b=n;b<r;b++)h+=_u(t,e[b]);let c=Math.ceil(h*1.5/8),p=[],v=[];function g(b,m,x,O,P){for(let S=x;S<O;){let w=S,C=m[S],E=_u(t,b[S]);for(S++;S<O;S++){let k=_u(t,b[S]);if(E+k>=c)break;E+=k}if(S==w+1){if(E>c){let k=b[w];g(k.children,k.positions,0,k.children.length,m[w]+P);continue}p.push(b[w])}else{let k=m[S-1]+b[S-1].length-C;p.push(Rp(t,b,m,w,S,C,k,null,u))}v.push(C+P-s)}}return g(e,i,n,r,0),(l||u)(p,v,a)}class CB{constructor(){this.map=new WeakMap}setBuffer(e,i,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(i,n)}getBuffer(e,i){let n=this.map.get(e);return n&&n.get(i)}set(e,i){e instanceof an?this.setBuffer(e.context.buffer,e.index,i):e instanceof ci&&this.map.set(e.tree,i)}get(e){return e instanceof an?this.getBuffer(e.context.buffer,e.index):e instanceof ci?this.map.get(e.tree):void 0}cursorSet(e,i){e.buffer?this.setBuffer(e.buffer.buffer,e.index,i):this.map.set(e.tree,i)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Fr{constructor(e,i,n,r,s=!1,a=!1){this.from=e,this.to=i,this.tree=n,this.offset=r,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,i=[],n=!1){let r=[new Fr(0,e.length,e,0,!1,n)];for(let s of i)s.to>e.length&&r.push(s);return r}static applyChanges(e,i,n=128){if(!i.length)return e;let r=[],s=1,a=e.length?e[0]:null;for(let l=0,u=0,h=0;;l++){let c=l<i.length?i[l]:null,p=c?c.fromA:1e9;if(p-u>=n)for(;a&&a.from<p;){let v=a;if(u>=v.from||p<=v.to||h){let g=Math.max(v.from,u)-h,b=Math.min(v.to,p)-h;v=g>=b?null:new Fr(g,b,v.tree,v.offset+h,l>0,!!c)}if(v&&r.push(v),a.to>p)break;a=s<e.length?e[s++]:null}if(!c)break;u=c.toA,h=c.toA-c.toB}return r}}class MS{startParse(e,i,n){return typeof e=="string"&&(e=new kB(e)),n=n?n.length?n.map(r=>new nf(r.from,r.to)):[new nf(0,0)]:[new nf(0,e.length)],this.createParse(e,i||[],n)}parse(e,i,n){let r=this.startParse(e,i,n);for(;;){let s=r.advance();if(s)return s}}}class kB{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,i){return this.string.slice(e,i)}}new Ke({perNode:!0});let EB=0;class Si{constructor(e,i,n,r){this.name=e,this.set=i,this.base=n,this.modified=r,this.id=EB++}toString(){let{name:e}=this;for(let i of this.modified)i.name&&(e=`${i.name}(${e})`);return e}static define(e,i){let n=typeof e=="string"?e:"?";if(e instanceof Si&&(i=e),i?.base)throw new Error("Can not derive from a modified tag");let r=new Si(n,[],null,[]);if(r.set.push(r),i)for(let s of i.set)r.set.push(s);return r}static defineModifier(e){let i=new cc(e);return n=>n.modified.indexOf(i)>-1?n:cc.get(n.base||n,n.modified.concat(i).sort((r,s)=>r.id-s.id))}}let AB=0;class cc{constructor(e){this.name=e,this.instances=[],this.id=AB++}static get(e,i){if(!i.length)return e;let n=i[0].instances.find(l=>l.base==e&&DB(i,l.modified));if(n)return n;let r=[],s=new Si(e.name,r,e,i);for(let l of i)l.instances.push(s);let a=_B(i);for(let l of e.set)if(!l.modified.length)for(let u of a)r.push(cc.get(l,u));return s}}function DB(t,e){return t.length==e.length&&t.every((i,n)=>i==e[n])}function _B(t){let e=[[]];for(let i=0;i<t.length;i++)for(let n=0,r=e.length;n<r;n++)e.push(e[n].concat(t[i]));return e.sort((i,n)=>n.length-i.length)}function zp(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let r of i.split(" "))if(r){let s=[],a=2,l=r;for(let p=0;;){if(l=="..."&&p>0&&p+3==r.length){a=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!v)throw new RangeError("Invalid path: "+r);if(s.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),p+=v[0].length,p==r.length)break;let g=r[p++];if(p==r.length&&g=="!"){a=0;break}if(g!="/")throw new RangeError("Invalid path: "+r);l=r.slice(p)}let u=s.length-1,h=s[u];if(!h)throw new RangeError("Invalid path: "+r);let c=new Ro(n,a,u>0?s.slice(0,u):null);e[h]=c.sort(e[h])}}return $S.add(e)}const $S=new Ke({combine(t,e){let i,n,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),i&&i.mode==r.mode&&!r.context&&!i.context)continue;let s=new Ro(r.tags,r.mode,r.context);i?i.next=s:n=s,i=s}return n}});class Ro{constructor(e,i,n,r){this.tags=e,this.mode=i,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ro.empty=new Ro([],2,null);function LS(t,e){let i=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))i[s.tag.id]=s.class;else for(let a of s.tag)i[a.id]=s.class;let{scope:n,all:r=null}=e||{};return{style:s=>{let a=r;for(let l of s)for(let u of l.set){let h=i[u.id];if(h){a=a?a+" "+h:h;break}}return a},scope:n}}function IB(t,e){let i=null;for(let n of t){let r=n.style(e);r&&(i=i?i+" "+r:r)}return i}function NB(t,e,i,n=0,r=t.length){let s=new MB(n,Array.isArray(e)?e:[e],i);s.highlightRange(t.cursor(),n,r,"",s.highlighters),s.flush(r)}class MB{constructor(e,i,n){this.at=e,this.highlighters=i,this.span=n,this.class=""}startSpan(e,i){i!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=i)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,i,n,r,s){let{type:a,from:l,to:u}=e;if(l>=n||u<=i)return;a.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(a)));let h=r,c=$B(e)||Ro.empty,p=IB(s,c.tags);if(p&&(h&&(h+=" "),h+=p,c.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(i,l),h),c.opaque)return;let v=e.tree&&e.tree.prop(Ke.mounted);if(v&&v.overlay){let g=e.node.enter(v.overlay[0].from+l,1),b=this.highlighters.filter(x=>!x.scope||x.scope(v.tree.type)),m=e.firstChild();for(let x=0,O=l;;x++){let P=x<v.overlay.length?v.overlay[x]:null,S=P?P.from+l:u,w=Math.max(i,O),C=Math.min(n,S);if(w<C&&m)for(;e.from<C&&(this.highlightRange(e,w,C,r,s),this.startSpan(Math.min(C,e.to),h),!(e.to>=S||!e.nextSibling())););if(!P||S>n)break;O=P.to+l,O>i&&(this.highlightRange(g.cursor(),Math.max(i,P.from+l),Math.min(n,O),"",b),this.startSpan(Math.min(n,O),h))}m&&e.parent()}else if(e.firstChild()){v&&(r="");do if(!(e.to<=i)){if(e.from>=n)break;this.highlightRange(e,i,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function $B(t){let e=t.type.prop($S);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const De=Si.define,su=De(),Wn=De(),Tv=De(Wn),Cv=De(Wn),Yn=De(),au=De(Yn),rf=De(Yn),Gi=De(),br=De(Gi),qi=De(),Wi=De(),Dd=De(),ma=De(Dd),ou=De(),ne={comment:su,lineComment:De(su),blockComment:De(su),docComment:De(su),name:Wn,variableName:De(Wn),typeName:Tv,tagName:De(Tv),propertyName:Cv,attributeName:De(Cv),className:De(Wn),labelName:De(Wn),namespace:De(Wn),macroName:De(Wn),literal:Yn,string:au,docString:De(au),character:De(au),attributeValue:De(au),number:rf,integer:De(rf),float:De(rf),bool:De(Yn),regexp:De(Yn),escape:De(Yn),color:De(Yn),url:De(Yn),keyword:qi,self:De(qi),null:De(qi),atom:De(qi),unit:De(qi),modifier:De(qi),operatorKeyword:De(qi),controlKeyword:De(qi),definitionKeyword:De(qi),moduleKeyword:De(qi),operator:Wi,derefOperator:De(Wi),arithmeticOperator:De(Wi),logicOperator:De(Wi),bitwiseOperator:De(Wi),compareOperator:De(Wi),updateOperator:De(Wi),definitionOperator:De(Wi),typeOperator:De(Wi),controlOperator:De(Wi),punctuation:Dd,separator:De(Dd),bracket:ma,angleBracket:De(ma),squareBracket:De(ma),paren:De(ma),brace:De(ma),content:Gi,heading:br,heading1:De(br),heading2:De(br),heading3:De(br),heading4:De(br),heading5:De(br),heading6:De(br),contentSeparator:De(Gi),list:De(Gi),quote:De(Gi),emphasis:De(Gi),strong:De(Gi),link:De(Gi),monospace:De(Gi),strikethrough:De(Gi),inserted:De(),deleted:De(),changed:De(),invalid:De(),meta:ou,documentMeta:De(ou),annotation:De(ou),processingInstruction:De(ou),definition:Si.defineModifier("definition"),constant:Si.defineModifier("constant"),function:Si.defineModifier("function"),standard:Si.defineModifier("standard"),local:Si.defineModifier("local"),special:Si.defineModifier("special")};for(let t in ne){let e=ne[t];e instanceof Si&&(e.name=t)}LS([{tag:ne.link,class:"tok-link"},{tag:ne.heading,class:"tok-heading"},{tag:ne.emphasis,class:"tok-emphasis"},{tag:ne.strong,class:"tok-strong"},{tag:ne.keyword,class:"tok-keyword"},{tag:ne.atom,class:"tok-atom"},{tag:ne.bool,class:"tok-bool"},{tag:ne.url,class:"tok-url"},{tag:ne.labelName,class:"tok-labelName"},{tag:ne.inserted,class:"tok-inserted"},{tag:ne.deleted,class:"tok-deleted"},{tag:ne.literal,class:"tok-literal"},{tag:ne.string,class:"tok-string"},{tag:ne.number,class:"tok-number"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],class:"tok-string2"},{tag:ne.variableName,class:"tok-variableName"},{tag:ne.local(ne.variableName),class:"tok-variableName tok-local"},{tag:ne.definition(ne.variableName),class:"tok-variableName tok-definition"},{tag:ne.special(ne.variableName),class:"tok-variableName2"},{tag:ne.definition(ne.propertyName),class:"tok-propertyName tok-definition"},{tag:ne.typeName,class:"tok-typeName"},{tag:ne.namespace,class:"tok-namespace"},{tag:ne.className,class:"tok-className"},{tag:ne.macroName,class:"tok-macroName"},{tag:ne.propertyName,class:"tok-propertyName"},{tag:ne.operator,class:"tok-operator"},{tag:ne.comment,class:"tok-comment"},{tag:ne.meta,class:"tok-meta"},{tag:ne.invalid,class:"tok-invalid"},{tag:ne.punctuation,class:"tok-punctuation"}]);var sf;const cs=new Ke;function BS(t){return Me.define({combine:t?e=>e.concat(t):void 0})}const Xp=new Ke;class Li{constructor(e,i,n=[],r=""){this.data=e,this.name=r,rt.prototype.hasOwnProperty("tree")||Object.defineProperty(rt.prototype,"tree",{get(){return Qt(this)}}),this.parser=i,this.extension=[lr.of(this),rt.languageData.of((s,a,l)=>{let u=kv(s,a,l),h=u.type.prop(cs);if(!h)return[];let c=s.facet(h),p=u.type.prop(Xp);if(p){let v=u.resolve(a-u.from,l);for(let g of p)if(g.test(v,s)){let b=s.facet(g.facet);return g.type=="replace"?b:b.concat(c)}}return c})].concat(n)}isActiveAt(e,i,n=-1){return kv(e,i,n).type.prop(cs)==this.data}findRegions(e){let i=e.facet(lr);if(i?.data==this.data)return[{from:0,to:e.doc.length}];if(!i||!i.allowsNesting)return[];let n=[],r=(s,a)=>{if(s.prop(cs)==this.data){n.push({from:a,to:a+s.length});return}let l=s.prop(Ke.mounted);if(l){if(l.tree.prop(cs)==this.data){if(l.overlay)for(let u of l.overlay)n.push({from:u.from+a,to:u.to+a});else n.push({from:a,to:a+s.length});return}else if(l.overlay){let u=n.length;if(r(l.tree,l.overlay[0].from+a),n.length>u)return}}for(let u=0;u<s.children.length;u++){let h=s.children[u];h instanceof _t&&r(h,s.positions[u]+a)}};return r(Qt(e),0),n}get allowsNesting(){return!0}}Li.setState=We.define();function kv(t,e,i){let n=t.facet(lr),r=Qt(t).topNode;if(!n||n.allowsNesting)for(let s=r;s;s=s.enter(e,i,Pt.ExcludeBuffers|Pt.EnterBracketed))s.type.isTop&&(r=s);return r}class zo extends Li{constructor(e,i,n){super(e,i,[],n),this.parser=i}static define(e){let i=BS(e.languageData);return new zo(i,e.parser.configure({props:[cs.add(n=>n.isTop?i:void 0)]}),e.name)}configure(e,i){return new zo(this.data,this.parser.configure(e),i||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Qt(t){let e=t.field(Li.state,!1);return e?e.tree:_t.empty}class LB{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,i){let n=this.cursorPos-this.string.length;return e<n||i>=this.cursorPos?this.doc.sliceString(e,i):this.string.slice(e-n,i-n)}}let ga=null;class hc{constructor(e,i,n=[],r,s,a,l,u){this.parser=e,this.state=i,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=a,this.skipped=l,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,i,n){return new hc(e,i,[],_t.empty,0,n,[],null)}startParse(){return this.parser.startParse(new LB(this.state.doc),this.fragments)}work(e,i){return i!=null&&i>=this.state.doc.length&&(i=void 0),this.tree!=_t.empty&&this.isDone(i??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),i!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>i)&&i<this.state.doc.length&&this.parse.stopAt(i);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Fr.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(i??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,i;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(i=this.parse.advance()););}),this.treeLen=e,this.tree=i,this.fragments=this.withoutTempSkipped(Fr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let i=ga;ga=this;try{return e()}finally{ga=i}}withoutTempSkipped(e){for(let i;i=this.tempSkipped.pop();)e=Ev(e,i.from,i.to);return e}changes(e,i){let{fragments:n,tree:r,treeLen:s,viewport:a,skipped:l}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((h,c,p,v)=>u.push({fromA:h,toA:c,fromB:p,toB:v})),n=Fr.applyChanges(n,u),r=_t.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);c<p&&l.push({from:c,to:p})}}}return new hc(this.parser,i,n,r,s,a,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let i=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:r,to:s}=this.skipped[n];r<e.to&&s>e.from&&(this.fragments=Ev(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=i?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,i){this.skipped.push({from:e,to:i})}static getSkippingParser(e){return new class extends MS{createParse(i,n,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let u=ga;if(u){for(let h of r)u.tempSkipped.push(h);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=a,new _t(di.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let i=this.fragments;return this.treeLen>=e&&i.length&&i[0].from==0&&i[0].to>=e}static get(){return ga}}function Ev(t,e,i){return Fr.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class Bs{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let i=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),i.viewport.to);return i.work(20,n)||i.takeTree(),new Bs(i)}static init(e){let i=Math.min(3e3,e.doc.length),n=hc.create(e.facet(lr).parser,e,{from:0,to:i});return n.work(20,i)||n.takeTree(),new Bs(n)}}Li.state=Ut.define({create:Bs.init,update(t,e){for(let i of e.effects)if(i.is(Li.setState))return i.value;return e.startState.facet(lr)!=e.state.facet(lr)?Bs.init(e.state):t.apply(e)}});let QS=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(QS=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const af=typeof navigator<"u"&&(!((sf=navigator.scheduling)===null||sf===void 0)&&sf.isInputPending)?()=>navigator.scheduling.isInputPending():null,BB=Et.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let i=this.view.state.field(Li.state).context;(i.updateViewport(e.view.viewport)||this.view.viewport.to>i.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(i)}scheduleWork(){if(this.working)return;let{state:e}=this.view,i=e.field(Li.state);(i.tree!=i.context.tree||!i.context.isDone(e.doc.length))&&(this.working=QS(this.work))}work(e){this.working=null;let i=Date.now();if(this.chunkEnd<i&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=i+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,s=n.field(Li.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!af?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&n.doc.length>r+1e3,u=s.context.work(()=>af&&af()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-i,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Li.setState.of(new Bs(s.context))})),this.chunkBudget>0&&!(u&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(i=>li(this.view.state,i)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),lr=Me.define({combine(t){return t.length?t[0]:null},enables:t=>[Li.state,BB,_e.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class FS{constructor(e,i=[]){this.language=e,this.support=i,this.extension=[e,i]}}const QB=Me.define(),ll=Me.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(i=>i!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function fc(t){let e=t.facet(ll);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Xo(t,e){let i="",n=t.tabSize,r=t.facet(ll)[0];if(r==" "){for(;e>=n;)i+=" ",e-=n;r=" "}for(let s=0;s<e;s++)i+=r;return i}function jp(t,e){t instanceof rt&&(t=new Jc(t));for(let n of t.state.facet(QB)){let r=n(t,e);if(r!==void 0)return r}let i=Qt(t.state);return i.length>=e?FB(t,i,e):null}class Jc{constructor(e,i={}){this.state=e,this.options=i,this.unit=fc(e)}lineAt(e,i=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(i<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,i=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,i);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,i=1){let{text:n,from:r}=this.lineAt(e,i),s=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(s+=a-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,i=e.length){return Rs(e,this.state.tabSize,i)}lineIndent(e,i=1){let{text:n,from:r}=this.lineAt(e,i),s=this.options.overrideIndentation;if(s){let a=s(r);if(a>-1)return a}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Zp=new Ke;function FB(t,e,i){let n=e.resolveStack(i),r=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=n.node){let s=[];for(let a=r;a&&!(a.from<n.node.from||a.to>n.node.to||a.from==n.node.from&&a.type==n.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)n={node:s[a],next:n}}return RS(n,t,i)}function RS(t,e,i){for(let n=t;n;n=n.next){let r=zB(n.node);if(r)return r(Vp.create(e,i,n))}return 0}function RB(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function zB(t){let e=t.type.prop(Zp);if(e)return e;let i=t.firstChild,n;if(i&&(n=i.type.prop(Ke.closedBy))){let r=t.lastChild,s=r&&n.indexOf(r.name)>-1;return a=>zS(a,!0,1,void 0,s&&!RB(a)?r.from:void 0)}return t.parent==null?XB:null}function XB(){return 0}class Vp extends Jc{constructor(e,i,n){super(e.state,e.options),this.base=e,this.pos=i,this.context=n}get node(){return this.context.node}static create(e,i,n){return new Vp(e,i,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let i=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(i.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(jB(n,e))break;i=this.state.doc.lineAt(n.from)}return this.lineIndent(i.from)}continue(){return RS(this.context.next,this.base,this.pos)}}function jB(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function ZB(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(i.from),a=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=i.to;;){let u=e.childAfter(l);if(!u||u==n)return null;if(!u.type.isSkipped){if(u.from>=a)return null;let h=/^ */.exec(s.text.slice(i.to-s.from))[0].length;return{from:i.from,to:i.to+h}}l=u.to}}function VB({closing:t,align:e=!0,units:i=1}){return n=>zS(n,e,i,t)}function zS(t,e,i,n,r){let s=t.textAfter,a=s.match(/^\s*/)[0].length,l=n&&s.slice(a,a+n.length)==n||r==t.pos+a,u=e?ZB(t):null;return u?l?t.column(u.from):t.column(u.to):t.baseIndent+(l?0:t.unit*i)}const UB=t=>t.baseIndent;function mo({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}const qB=200;function WB(){return rt.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,r=i.lineAt(n);if(n>r.from+qB)return t;let s=i.sliceString(r.from,n);if(!e.some(h=>h.test(s)))return t;let{state:a}=t,l=-1,u=[];for(let{head:h}of a.selection.ranges){let c=a.doc.lineAt(h);if(c.from==l)continue;l=c.from;let p=jp(a,c.from);if(p==null)continue;let v=/^\s*/.exec(c.text)[0],g=Xo(a,p);v!=g&&u.push({from:c.from,to:c.from+v.length,insert:g})}return u.length?[t,{changes:u,sequential:!0}]:t})}const YB=Me.define(),Up=new Ke;function XS(t){let e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null}function GB(t,e,i){let n=Qt(t);if(n.length<i)return null;let r=n.resolveStack(i,1),s=null;for(let a=r;a;a=a.next){let l=a.node;if(l.to<=i||l.from>i)continue;if(s&&l.from<e)break;let u=l.type.prop(Up);if(u&&(l.to<n.length-50||n.length==t.doc.length||!HB(l))){let h=u(l,t);h&&h.from<=i&&h.from>=e&&h.to>i&&(s=h)}}return s}function HB(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function dc(t,e,i){for(let n of t.facet(YB)){let r=n(t,e,i);if(r)return r}return GB(t,e,i)}function jS(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const Kc=We.define({map:jS}),ul=We.define({map:jS});function ZS(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(n=>n.from<=i&&n.to>=i)||e.push(t.lineBlockAt(i));return e}const Gr=Ut.define({create(){return Ze.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,n)=>t=Av(t,i,n)),t=t.map(e.changes);for(let i of e.effects)if(i.is(Kc)&&!JB(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(qS),r=n?Ze.replace({widget:new sQ(n(e.state,i.value))}):Dv;t=t.update({add:[r.range(i.value.from,i.value.to)]})}else i.is(ul)&&(t=t.update({filter:(n,r)=>i.value.from!=n||i.value.to!=r,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=Av(t,e.selection.main.head)),t},provide:t=>_e.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(n,r)=>{i.push(n,r)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i<t.length;){let n=t[i++],r=t[i++];if(typeof n!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(Dv.range(n,r))}return Ze.set(e,!0)}});function Av(t,e,i=e){let n=!1;return t.between(e,i,(r,s)=>{r<i&&s>e&&(n=!0)}),n?t.update({filterFrom:e,filterTo:i,filter:(r,s)=>r>=i||s<=e}):t}function pc(t,e,i){var n;let r=null;return(n=t.field(Gr,!1))===null||n===void 0||n.between(e,i,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function JB(t,e,i){let n=!1;return t.between(e,e,(r,s)=>{r==e&&s==i&&(n=!0)}),n}function VS(t,e){return t.field(Gr,!1)?e:e.concat(We.appendConfig.of(WS()))}const KB=t=>{for(let e of ZS(t)){let i=dc(t.state,e.from,e.to);if(i)return t.dispatch({effects:VS(t.state,[Kc.of(i),US(t,i)])}),!0}return!1},eQ=t=>{if(!t.state.field(Gr,!1))return!1;let e=[];for(let i of ZS(t)){let n=pc(t.state,i.from,i.to);n&&e.push(ul.of(n),US(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function US(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return _e.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${r}.`)}const tQ=t=>{let{state:e}=t,i=[];for(let n=0;n<e.doc.length;){let r=t.lineBlockAt(n),s=dc(e,r.from,r.to);s&&i.push(Kc.of(s)),n=(s?t.lineBlockAt(s.to):r).to+1}return i.length&&t.dispatch({effects:VS(t.state,i)}),!!i.length},iQ=t=>{let e=t.state.field(Gr,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(n,r)=>{i.push(ul.of({from:n,to:r}))}),t.dispatch({effects:i}),!0},nQ=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:KB},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:eQ},{key:"Ctrl-Alt-[",run:tQ},{key:"Ctrl-Alt-]",run:iQ}],rQ={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},qS=Me.define({combine(t){return mn(t,rQ)}});function WS(t){return[Gr,lQ]}function YS(t,e){let{state:i}=t,n=i.facet(qS),r=a=>{let l=t.lineBlockAt(t.posAtDOM(a.target)),u=pc(t.state,l.from,l.to);u&&t.dispatch({effects:ul.of(u)}),a.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,r,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",i.phrase("folded code")),s.title=i.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const Dv=Ze.replace({widget:new class extends Ri{toDOM(t){return YS(t,null)}}});class sQ extends Ri{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return YS(e,this.value)}}const aQ={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class of extends Mn{constructor(e,i){super(),this.config=e,this.open=i}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let i=document.createElement("span");return i.textContent=this.open?this.config.openText:this.config.closedText,i.title=e.state.phrase(this.open?"Fold line":"Unfold line"),i}}function oQ(t={}){let e={...aQ,...t},i=new of(e,!0),n=new of(e,!1),r=Et.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(lr)!=a.state.facet(lr)||a.startState.field(Gr,!1)!=a.state.field(Gr,!1)||Qt(a.startState)!=Qt(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new In;for(let u of a.viewportLineBlocks){let h=pc(a.state,u.from,u.to)?n:dc(a.state,u.from,u.to)?i:null;h&&l.add(u.from,u.from,h)}return l.finish()}}),{domEventHandlers:s}=e;return[r,uB({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||tt.empty},initialSpacer(){return new of(e,!1)},domEventHandlers:{...s,click:(a,l,u)=>{if(s.click&&s.click(a,l,u))return!0;let h=pc(a.state,l.from,l.to);if(h)return a.dispatch({effects:ul.of(h)}),!0;let c=dc(a.state,l.from,l.to);return c?(a.dispatch({effects:Kc.of(c)}),!0):!1}}}),WS()]}const lQ=_e.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class cl{constructor(e,i){this.specs=e;let n;function r(l){let u=rr.newName();return(n||(n=Object.create(null)))["."+u]=l,u}const s=typeof i.all=="string"?i.all:i.all?r(i.all):void 0,a=i.scope;this.scope=a instanceof Li?l=>l.prop(cs)==a.data:a?l=>l==a:void 0,this.style=LS(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=n?new rr(n):null,this.themeType=i.themeType}static define(e,i){return new cl(e,i||{})}}const _d=Me.define(),GS=Me.define({combine(t){return t.length?[t[0]]:null}});function lf(t){let e=t.facet(_d);return e.length?e:t.facet(GS)}function HS(t,e){let i=[cQ],n;return t instanceof cl&&(t.module&&i.push(_e.styleModule.of(t.module)),n=t.themeType),e?.fallback?i.push(GS.of(t)):n?i.push(_d.computeN([_e.darkTheme],r=>r.facet(_e.darkTheme)==(n=="dark")?[t]:[])):i.push(_d.of(t)),i}class uQ{constructor(e){this.markCache=Object.create(null),this.tree=Qt(e.state),this.decorations=this.buildDeco(e,lf(e.state)),this.decoratedTo=e.viewport.to}update(e){let i=Qt(e.state),n=lf(e.state),r=n!=lf(e.startState),{viewport:s}=e.view,a=e.changes.mapPos(this.decoratedTo,1);i.length<s.to&&!r&&i.type==this.tree.type&&a>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(i!=this.tree||e.viewportChanged||r)&&(this.tree=i,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,i){if(!i||!this.tree.length)return Ze.none;let n=new In;for(let{from:r,to:s}of e.visibleRanges)NB(this.tree,i,(a,l,u)=>{n.add(a,l,this.markCache[u]||(this.markCache[u]=Ze.mark({class:u})))},r,s);return n.finish()}}const cQ=fr.high(Et.fromClass(uQ,{decorations:t=>t.decorations})),hQ=cl.define([{tag:ne.meta,color:"#404740"},{tag:ne.link,textDecoration:"underline"},{tag:ne.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strong,fontWeight:"bold"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.keyword,color:"#708"},{tag:[ne.atom,ne.bool,ne.url,ne.contentSeparator,ne.labelName],color:"#219"},{tag:[ne.literal,ne.inserted],color:"#164"},{tag:[ne.string,ne.deleted],color:"#a11"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],color:"#e40"},{tag:ne.definition(ne.variableName),color:"#00f"},{tag:ne.local(ne.variableName),color:"#30a"},{tag:[ne.typeName,ne.namespace],color:"#085"},{tag:ne.className,color:"#167"},{tag:[ne.special(ne.variableName),ne.macroName],color:"#256"},{tag:ne.definition(ne.propertyName),color:"#00c"},{tag:ne.comment,color:"#940"},{tag:ne.invalid,color:"#f00"}]),fQ=_e.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),JS=1e4,KS="()[]{}",ew=Me.define({combine(t){return mn(t,{afterCursor:!0,brackets:KS,maxScanDistance:JS,renderMatch:mQ})}}),dQ=Ze.mark({class:"cm-matchingBracket"}),pQ=Ze.mark({class:"cm-nonmatchingBracket"});function mQ(t){let e=[],i=t.matched?dQ:pQ;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}function _v(t){let e=[],i=t.facet(ew);for(let n of t.selection.ranges){if(!n.empty)continue;let r=on(t,n.head,-1,i)||n.head>0&&on(t,n.head-1,1,i)||i.afterCursor&&(on(t,n.head,1,i)||n.head<t.doc.length&&on(t,n.head+1,-1,i));r&&(e=e.concat(i.renderMatch(r,t)))}return Ze.set(e,!0)}const gQ=Et.fromClass(class{constructor(t){this.paused=!1,this.decorations=_v(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=_v(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),yQ=[gQ,fQ];function vQ(t={}){return[ew.of(t),yQ]}const OQ=new Ke;function Id(t,e,i){let n=t.prop(e<0?Ke.openedBy:Ke.closedBy);if(n)return n;if(t.name.length==1){let r=i.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[i[r+e]]}return null}function Nd(t){let e=t.type.prop(OQ);return e?e(t.node):t}function on(t,e,i,n={}){let r=n.maxScanDistance||JS,s=n.brackets||KS,a=Qt(t),l=a.resolveInner(e,i);for(let u=l;u;u=u.parent){let h=Id(u.type,i,s);if(h&&u.from<u.to){let c=Nd(u);if(c&&(i>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return xQ(t,e,i,u,c,h,s)}}return bQ(t,e,i,a,l.type,r,s)}function xQ(t,e,i,n,r,s,a){let l=n.parent,u={from:r.from,to:r.to},h=0,c=l?.cursor();if(c&&(i<0?c.childBefore(n.from):c.childAfter(n.to)))do if(i<0?c.to<=n.from:c.from>=n.to){if(h==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let p=Nd(c);return{start:u,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(Id(c.type,i,a))h++;else if(Id(c.type,-i,a)){if(h==0){let p=Nd(c);return{start:u,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(i<0?c.prevSibling():c.nextSibling());return{start:u,matched:!1}}function bQ(t,e,i,n,r,s,a){let l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(l);if(u<0||u%2==0!=i>0)return null;let h={from:i<0?e-1:e,to:i>0?e+1:e},c=t.doc.iterRange(e,i>0?t.doc.length:0),p=0;for(let v=0;!c.next().done&&v<=s;){let g=c.value;i<0&&(v+=g.length);let b=e+v*i;for(let m=i>0?0:g.length-1,x=i>0?g.length:-1;m!=x;m+=i){let O=a.indexOf(g[m]);if(!(O<0||n.resolveInner(b+m,1).type!=r))if(O%2==0==i>0)p++;else{if(p==1)return{start:h,end:{from:b+m,to:b+m+1},matched:O>>1==u>>1};p--}}i>0&&(v+=g.length)}return c.done?{start:h,matched:!1}:null}const SQ=Object.create(null),Iv=[di.none],Nv=[],Mv=Object.create(null),wQ=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])wQ[t]=PQ(SQ,e);function uf(t,e){Nv.indexOf(t)>-1||(Nv.push(t),console.warn(e))}function PQ(t,e){let i=[];for(let l of e.split(" ")){let u=[];for(let h of l.split(".")){let c=t[h]||ne[h];c?typeof c=="function"?u.length?u=u.map(c):uf(h,`Modifier ${h} used at start of tag`):u.length?uf(h,`Tag ${h} used as modifier`):u=Array.isArray(c)?c:[c]:uf(h,`Unknown highlighting tag ${h}`)}for(let h of u)i.push(h)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+i.map(l=>l.id),s=Mv[r];if(s)return s.id;let a=Mv[r]=di.define({id:Iv.length,name:n,props:[zp({[n]:i})]});return Iv.push(a),a.id}yt.RTL,yt.LTR;const TQ=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=Wp(t.state,i.from);return n.line?CQ(t):n.block?EQ(t):!1};function qp(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=t(e,i);return r?(n(i.update(r)),!0):!1}}const CQ=qp(_Q,0),kQ=qp(tw,0),EQ=qp((t,e)=>tw(t,e,DQ(e)),0);function Wp(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const ya=50;function AQ(t,{open:e,close:i},n,r){let s=t.sliceDoc(n-ya,n),a=t.sliceDoc(r,r+ya),l=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(a)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&a.slice(u,u+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:r+u,margin:u&&1}};let c,p;r-n<=2*ya?c=p=t.sliceDoc(n,r):(c=t.sliceDoc(n,n+ya),p=t.sliceDoc(r-ya,r));let v=/^\s*/.exec(c)[0].length,g=/\s*$/.exec(p)[0].length,b=p.length-g-i.length;return c.slice(v,v+e.length)==e&&p.slice(b,b+i.length)==i?{open:{pos:n+v+e.length,margin:/\s/.test(c.charAt(v+e.length))?1:0},close:{pos:r-g-i.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function DQ(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),r=i.to<=n.to?n:t.doc.lineAt(i.to);r.from>n.from&&r.from==i.to&&(r=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function tw(t,e,i=e.selection.ranges){let n=i.map(s=>Wp(e,s.from).block);if(!n.every(s=>s))return null;let r=i.map((s,a)=>AQ(e,n[a],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(i.map((s,a)=>r[a]?[]:[{from:s.from,insert:n[a].open+" "},{from:s.to,insert:" "+n[a].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let a=0,l;a<r.length;a++)if(l=r[a]){let u=n[a],{open:h,close:c}=l;s.push({from:h.pos-u.open.length,to:h.pos+h.margin},{from:c.pos-c.margin,to:c.pos+u.close.length})}return{changes:s}}return null}function _Q(t,e,i=e.selection.ranges){let n=[],r=-1;e:for(let{from:s,to:a}of i){let l=n.length,u=1e9,h;for(let c=s;c<=a;){let p=e.doc.lineAt(c);if(h==null&&(h=Wp(e,p.from).line,!h))continue e;if(p.from>r&&(s==a||a>p.from)){r=p.from;let v=/^\s*/.exec(p.text)[0].length,g=v==p.length,b=p.text.slice(v,v+h.length)==h?v:-1;v<p.text.length&&v<u&&(u=v),n.push({line:p,comment:b,token:h,indent:v,empty:g,single:!1})}c=p.to+1}if(u<1e9)for(let c=l;c<n.length;c++)n[c].indent<n[c].line.text.length&&(n[c].indent=u);n.length==l+1&&(n[l].single=!0)}if(t!=2&&n.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:u,indent:h,empty:c,single:p}of n)(p||!c)&&s.push({from:l.from+h,insert:u+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:l,token:u}of n)if(l>=0){let h=a.from+l,c=h+u.length;a.text[c-a.from]==" "&&c++,s.push({from:h,to:c})}return{changes:s}}return null}const Md=Ln.define(),IQ=Ln.define(),NQ=Me.define(),iw=Me.define({combine(t){return mn(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,i)=>i},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,i)=>(n,r)=>e(n,r)||i(n,r)})}}),nw=Ut.define({create(){return ln.empty},update(t,e){let i=e.state.facet(iw),n=e.annotation(Md);if(n){let u=ui.fromTransaction(e,n.selection),h=n.side,c=h==0?t.undone:t.done;return u?c=mc(c,c.length,i.minDepth,u):c=aw(c,e.startState.selection),new ln(h==0?n.rest:c,h==0?c:n.rest)}let r=e.annotation(IQ);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Mt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=ui.fromTransaction(e),a=e.annotation(Mt.time),l=e.annotation(Mt.userEvent);return s?t=t.addChanges(s,a,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,a,l,i.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new ln(t.done.map(ui.fromJSON),t.undone.map(ui.fromJSON))}});function MQ(t={}){return[nw,iw.of(t),_e.domEventHandlers({beforeinput(e,i){let n=e.inputType=="historyUndo"?rw:e.inputType=="historyRedo"?$d:null;return n?(e.preventDefault(),n(i)):!1}})]}function eh(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let r=i.field(nw,!1);if(!r)return!1;let s=r.pop(t,i,e);return s?(n(s),!0):!1}}const rw=eh(0,!1),$d=eh(1,!1),$Q=eh(0,!0),LQ=eh(1,!0);class ui{constructor(e,i,n,r,s){this.changes=e,this.effects=i,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new ui(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,i,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(i=this.mapped)===null||i===void 0?void 0:i.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new ui(e.changes&&Lt.fromJSON(e.changes),[],e.mapped&&hn.fromJSON(e.mapped),e.startSelection&&Oe.fromJSON(e.startSelection),e.selectionsAfter.map(Oe.fromJSON))}static fromTransaction(e,i){let n=Pi;for(let r of e.startState.facet(NQ)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new ui(e.changes.invert(e.startState.doc),n,void 0,i||e.startState.selection,Pi)}static selection(e){return new ui(void 0,Pi,void 0,void 0,e)}}function mc(t,e,i,n){let r=e+1>i+20?e-i-1:0,s=t.slice(r,e);return s.push(n),s}function BQ(t,e){let i=[],n=!1;return t.iterChangedRanges((r,s)=>i.push(r,s)),e.iterChangedRanges((r,s,a,l)=>{for(let u=0;u<i.length;){let h=i[u++],c=i[u++];l>=h&&a<=c&&(n=!0)}}),n}function QQ(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((i,n)=>i.empty!=e.ranges[n].empty).length===0}function sw(t,e){return t.length?e.length?t.concat(e):t:e}const Pi=[],FQ=200;function aw(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-FQ));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),mc(t,t.length-1,1e9,i.setSelAfter(n)))}else return[ui.selection([e])]}function RQ(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function cf(t,e){if(!t.length)return t;let i=t.length,n=Pi;for(;i;){let r=zQ(t[i-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,i);return s[i-1]=r,s}else e=r.mapped,i--,n=r.selectionsAfter}return n.length?[ui.selection(n)]:Pi}function zQ(t,e,i){let n=sw(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Pi,i);if(!t.changes)return ui.selection(n);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(s):s;return new ui(r,We.mapEffects(t.effects,e),a,t.startSelection.map(s),n)}const XQ=/^(input\.type|delete)($|\.)/;class ln{constructor(e,i,n=0,r=void 0){this.done=e,this.undone=i,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new ln(this.done,this.undone):this}addChanges(e,i,n,r,s){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||XQ.test(n))&&(!l.selectionsAfter.length&&i-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,BQ(l.changes,e.changes))||n=="input.type.compose")?a=mc(a,a.length-1,r.minDepth,new ui(e.changes.compose(l.changes),sw(We.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Pi)):a=mc(a,a.length,r.minDepth,e),new ln(a,Pi,i,n)}addSelection(e,i,n,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Pi;return s.length>0&&i-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&QQ(s[s.length-1],e)?this:new ln(aw(this.done,e),this.undone,i,n)}addMapping(e){return new ln(cf(this.done,e),cf(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,i,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):i.selection);if(n&&s.selectionsAfter.length)return i.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Md.of({side:e,rest:RQ(r),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Pi:r.slice(0,r.length-1);return s.mapped&&(l=cf(l,s.mapped)),i.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Md.of({side:e,rest:l,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}ln.empty=new ln(Pi,Pi);const jQ=[{key:"Mod-z",run:rw,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:$d,preventDefault:!0},{linux:"Ctrl-Shift-z",run:$d,preventDefault:!0},{key:"Mod-u",run:$Q,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:LQ,preventDefault:!0}];function zs(t,e){return Oe.create(t.ranges.map(e),t.mainIndex)}function zi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Xi({state:t,dispatch:e},i){let n=zs(t.selection,i);return n.eq(t.selection,!0)?!1:(e(zi(t,n)),!0)}function th(t,e){return Oe.cursor(e?t.to:t.from)}function ow(t,e){return Xi(t,i=>i.empty?t.moveByChar(i,e):th(i,e))}function Yt(t){return t.textDirectionAt(t.state.selection.main.head)==yt.LTR}const lw=t=>ow(t,!Yt(t)),uw=t=>ow(t,Yt(t));function cw(t,e){return Xi(t,i=>i.empty?t.moveByGroup(i,e):th(i,e))}const ZQ=t=>cw(t,!Yt(t)),VQ=t=>cw(t,Yt(t));function UQ(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function ih(t,e,i){let n=Qt(t).resolveInner(e.head),r=i?Ke.closedBy:Ke.openedBy;for(let u=e.head;;){let h=i?n.childAfter(u):n.childBefore(u);if(!h)break;UQ(t,h,r)?n=h:u=i?h.to:h.from}let s=n.type.prop(r),a,l;return s&&(a=i?on(t,n.from,1):on(t,n.to,-1))&&a.matched?l=i?a.end.to:a.end.from:l=i?n.to:n.from,Oe.cursor(l,i?-1:1)}const qQ=t=>Xi(t,e=>ih(t.state,e,!Yt(t))),WQ=t=>Xi(t,e=>ih(t.state,e,Yt(t)));function hw(t,e){return Xi(t,i=>{if(!i.empty)return th(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)})}const fw=t=>hw(t,!1),dw=t=>hw(t,!0);function pw(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,i=0,n=0,r;if(e){for(let s of t.state.facet(_e.scrollMargins)){let a=s(t);a?.top&&(i=Math.max(a?.top,i)),a?.bottom&&(n=Math.max(a?.bottom,n))}r=t.scrollDOM.clientHeight-i-n}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:n,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function mw(t,e){let i=pw(t),{state:n}=t,r=zs(n.selection,a=>a.empty?t.moveVertically(a,e,i.height):th(a,e));if(r.eq(n.selection))return!1;let s;if(i.selfScroll){let a=t.coordsAtPos(n.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),u=l.top+i.marginTop,h=l.bottom-i.marginBottom;a&&a.top>u&&a.bottom<h&&(s=_e.scrollIntoView(r.main.head,{y:"start",yMargin:a.top-u}))}return t.dispatch(zi(n,r),{effects:s}),!0}const $v=t=>mw(t,!1),Ld=t=>mw(t,!0);function dr(t,e,i){let n=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,i);if(r.head==e.head&&r.head!=(i?n.to:n.from)&&(r=t.moveToLineBoundary(e,i,!1)),!i&&r.head==n.from&&n.length){let s=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=Oe.cursor(n.from+s))}return r}const YQ=t=>Xi(t,e=>dr(t,e,!0)),GQ=t=>Xi(t,e=>dr(t,e,!1)),HQ=t=>Xi(t,e=>dr(t,e,!Yt(t))),JQ=t=>Xi(t,e=>dr(t,e,Yt(t))),KQ=t=>Xi(t,e=>Oe.cursor(t.lineBlockAt(e.head).from,1)),eF=t=>Xi(t,e=>Oe.cursor(t.lineBlockAt(e.head).to,-1));function tF(t,e,i){let n=!1,r=zs(t.selection,s=>{let a=on(t,s.head,-1)||on(t,s.head,1)||s.head>0&&on(t,s.head-1,1)||s.head<t.doc.length&&on(t,s.head+1,-1);if(!a||!a.end)return s;n=!0;let l=a.start.from==s.head?a.end.to:a.end.from;return Oe.cursor(l)});return n?(e(zi(t,r)),!0):!1}const iF=({state:t,dispatch:e})=>tF(t,e);function Ci(t,e){let i=zs(t.state.selection,n=>{let r=e(n);return Oe.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(zi(t.state,i)),!0)}function gw(t,e){return Ci(t,i=>t.moveByChar(i,e))}const yw=t=>gw(t,!Yt(t)),vw=t=>gw(t,Yt(t));function Ow(t,e){return Ci(t,i=>t.moveByGroup(i,e))}const nF=t=>Ow(t,!Yt(t)),rF=t=>Ow(t,Yt(t)),sF=t=>Ci(t,e=>ih(t.state,e,!Yt(t))),aF=t=>Ci(t,e=>ih(t.state,e,Yt(t)));function xw(t,e){return Ci(t,i=>t.moveVertically(i,e))}const bw=t=>xw(t,!1),Sw=t=>xw(t,!0);function ww(t,e){return Ci(t,i=>t.moveVertically(i,e,pw(t).height))}const Lv=t=>ww(t,!1),Bv=t=>ww(t,!0),oF=t=>Ci(t,e=>dr(t,e,!0)),lF=t=>Ci(t,e=>dr(t,e,!1)),uF=t=>Ci(t,e=>dr(t,e,!Yt(t))),cF=t=>Ci(t,e=>dr(t,e,Yt(t))),hF=t=>Ci(t,e=>Oe.cursor(t.lineBlockAt(e.head).from)),fF=t=>Ci(t,e=>Oe.cursor(t.lineBlockAt(e.head).to)),Qv=({state:t,dispatch:e})=>(e(zi(t,{anchor:0})),!0),Fv=({state:t,dispatch:e})=>(e(zi(t,{anchor:t.doc.length})),!0),Rv=({state:t,dispatch:e})=>(e(zi(t,{anchor:t.selection.main.anchor,head:0})),!0),zv=({state:t,dispatch:e})=>(e(zi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),dF=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),pF=({state:t,dispatch:e})=>{let i=nh(t).map(({from:n,to:r})=>Oe.range(n,Math.min(r+1,t.doc.length)));return e(t.update({selection:Oe.create(i),userEvent:"select"})),!0},mF=({state:t,dispatch:e})=>{let i=zs(t.selection,n=>{let r=Qt(t),s=r.resolveStack(n.from,1);if(n.empty){let a=r.resolveStack(n.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:l}=a;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&a.next)return Oe.range(l.to,l.from)}return n});return i.eq(t.selection)?!1:(e(zi(t,i)),!0)};function Pw(t,e){let{state:i}=t,n=i.selection,r=i.selection.ranges.slice();for(let s of i.selection.ranges){let a=i.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let l=s;;){let u=t.moveVertically(l,e);if(u.head<a.from||u.head>a.to){r.some(h=>h.head==u.head)||r.push(u);break}else{if(u.head==l.head)break;l=u}}}return r.length==n.ranges.length?!1:(t.dispatch(zi(i,Oe.create(r,r.length-1))),!0)}const gF=t=>Pw(t,!1),yF=t=>Pw(t,!0),vF=({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=Oe.create([i.main]):i.main.empty||(n=Oe.create([Oe.cursor(i.main.head)])),n?(e(zi(t,n)),!0):!1};function hl(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,r=n.changeByRange(s=>{let{from:a,to:l}=s;if(a==l){let u=e(s);u<a?(i="delete.backward",u=lu(t,u,!1)):u>a&&(i="delete.forward",u=lu(t,u,!0)),a=Math.min(a,u),l=Math.max(l,u)}else a=lu(t,a,!1),l=lu(t,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:Oe.cursor(a,a<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(n.update(r,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?_e.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function lu(t,e,i){if(t instanceof _e)for(let n of t.state.facet(_e.atomicRanges).map(r=>r(t)))n.between(e,e,(r,s)=>{r<e&&s>e&&(e=i?s:r)});return e}const Tw=(t,e,i)=>hl(t,n=>{let r=n.from,{state:s}=t,a=s.doc.lineAt(r),l,u;if(i&&!e&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(l=a.text.slice(0,r-a.from))){if(l[l.length-1]==" ")return r-1;let h=Rs(l,s.tabSize),c=h%fc(s)||fc(s);for(let p=0;p<c&&l[l.length-1-p]==" ";p++)r--;u=r}else u=Rt(a.text,r-a.from,e,e)+a.from,u==r&&a.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(u-a.from,r-a.from))&&(u=Rt(a.text,u-a.from,!1,!1)+a.from);return u}),Bd=t=>Tw(t,!1,!0),Cw=t=>Tw(t,!0,!1),kw=(t,e)=>hl(t,i=>{let n=i.head,{state:r}=t,s=r.doc.lineAt(n),a=r.charCategorizer(n);for(let l=null;;){if(n==(e?s.to:s.from)){n==i.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let u=Rt(s.text,n-s.from,e)+s.from,h=s.text.slice(Math.min(n,u)-s.from,Math.max(n,u)-s.from),c=a(h);if(l!=null&&c!=l)break;(h!=" "||n!=i.head)&&(l=c),n=u}return n}),Ew=t=>kw(t,!1),OF=t=>kw(t,!0),xF=t=>hl(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),bF=t=>hl(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),SF=t=>hl(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),wF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:at.of(["",""])},range:Oe.cursor(n.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0},PF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let r=n.from,s=t.doc.lineAt(r),a=r==s.from?r-1:Rt(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Rt(s.text,r-s.from,!0)+s.from;return{changes:{from:a,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(a,r))},range:Oe.cursor(l)}});return i.changes.empty?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function nh(t){let e=[],i=-1;for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=t.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=t.doc.lineAt(n.to-1)),i>=r.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});i=s.number+1}return e}function Aw(t,e,i){if(t.readOnly)return!1;let n=[],r=[];for(let s of nh(t)){if(i?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(i?s.to+1:s.from-1),l=a.length+1;if(i){n.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let u of s.ranges)r.push(Oe.range(Math.min(t.doc.length,u.anchor+l),Math.min(t.doc.length,u.head+l)))}else{n.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let u of s.ranges)r.push(Oe.range(u.anchor-l,u.head-l))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:Oe.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const TF=({state:t,dispatch:e})=>Aw(t,e,!1),CF=({state:t,dispatch:e})=>Aw(t,e,!0);function Dw(t,e,i){if(t.readOnly)return!1;let n=[];for(let s of nh(t))i?n.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):n.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(n);return e(t.update({changes:r,selection:t.selection.map(r,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const kF=({state:t,dispatch:e})=>Dw(t,e,!1),EF=({state:t,dispatch:e})=>Dw(t,e,!0),AF=t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(nh(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),n=zs(e.selection,r=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=a.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function DF(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=Qt(t).resolveInner(e),n=i.childBefore(e),r=i.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(Ke.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}const Xv=_w(!1),_F=_w(!0);function _w(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:a}=r,l=e.doc.lineAt(s),u=!t&&s==a&&DF(e,s);t&&(s=a=(a<=l.to?l:e.doc.lineAt(a)).to);let h=new Jc(e,{simulateBreak:s,simulateDoubleBreak:!!u}),c=jp(h,s);for(c==null&&(c=Rs(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<l.to&&/\s/.test(l.text[a-l.from]);)a++;u?{from:s,to:a}=u:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let p=["",Xo(e,c)];return u&&p.push(Xo(e,h.lineIndent(l.from,-1))),{changes:{from:s,to:a,insert:at.of(p)},range:Oe.cursor(s+1+p[1].length)}});return i(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yp(t,e){let i=-1;return t.changeByRange(n=>{let r=[];for(let a=n.from;a<=n.to;){let l=t.doc.lineAt(a);l.number>i&&(n.empty||n.to>l.from)&&(e(l,r,n),i=l.number),a=l.to+1}let s=t.changes(r);return{changes:r,range:Oe.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const IF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new Jc(t,{overrideIndentation:s=>{let a=i[s];return a??-1}}),r=Yp(t,(s,a,l)=>{let u=jp(n,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let h=/^\s*/.exec(s.text)[0],c=Xo(t,u);(h!=c||l.from<s.from+h.length)&&(i[s.from]=u,a.push({from:s.from,to:s.from+h.length,insert:c}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},Iw=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Yp(t,(i,n)=>{n.push({from:i.from,insert:t.facet(ll)})}),{userEvent:"input.indent"})),!0),Nw=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Yp(t,(i,n)=>{let r=/^\s*/.exec(i.text)[0];if(!r)return;let s=Rs(r,t.tabSize),a=0,l=Xo(t,Math.max(0,s-fc(t)));for(;a<r.length&&a<l.length&&r.charCodeAt(a)==l.charCodeAt(a);)a++;n.push({from:i.from+a,to:i.from+r.length,insert:l.slice(a)})}),{userEvent:"delete.dedent"})),!0),NF=t=>(t.setTabFocusMode(),!0),MF=[{key:"Ctrl-b",run:lw,shift:yw,preventDefault:!0},{key:"Ctrl-f",run:uw,shift:vw},{key:"Ctrl-p",run:fw,shift:bw},{key:"Ctrl-n",run:dw,shift:Sw},{key:"Ctrl-a",run:KQ,shift:hF},{key:"Ctrl-e",run:eF,shift:fF},{key:"Ctrl-d",run:Cw},{key:"Ctrl-h",run:Bd},{key:"Ctrl-k",run:xF},{key:"Ctrl-Alt-h",run:Ew},{key:"Ctrl-o",run:wF},{key:"Ctrl-t",run:PF},{key:"Ctrl-v",run:Ld}],$F=[{key:"ArrowLeft",run:lw,shift:yw,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ZQ,shift:nF,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:HQ,shift:uF,preventDefault:!0},{key:"ArrowRight",run:uw,shift:vw,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:VQ,shift:rF,preventDefault:!0},{mac:"Cmd-ArrowRight",run:JQ,shift:cF,preventDefault:!0},{key:"ArrowUp",run:fw,shift:bw,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Qv,shift:Rv},{mac:"Ctrl-ArrowUp",run:$v,shift:Lv},{key:"ArrowDown",run:dw,shift:Sw,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Fv,shift:zv},{mac:"Ctrl-ArrowDown",run:Ld,shift:Bv},{key:"PageUp",run:$v,shift:Lv},{key:"PageDown",run:Ld,shift:Bv},{key:"Home",run:GQ,shift:lF,preventDefault:!0},{key:"Mod-Home",run:Qv,shift:Rv},{key:"End",run:YQ,shift:oF,preventDefault:!0},{key:"Mod-End",run:Fv,shift:zv},{key:"Enter",run:Xv,shift:Xv},{key:"Mod-a",run:dF},{key:"Backspace",run:Bd,shift:Bd,preventDefault:!0},{key:"Delete",run:Cw,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ew,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:OF,preventDefault:!0},{mac:"Mod-Backspace",run:bF,preventDefault:!0},{mac:"Mod-Delete",run:SF,preventDefault:!0}].concat(MF.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),LF=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:qQ,shift:sF},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:WQ,shift:aF},{key:"Alt-ArrowUp",run:TF},{key:"Shift-Alt-ArrowUp",run:kF},{key:"Alt-ArrowDown",run:CF},{key:"Shift-Alt-ArrowDown",run:EF},{key:"Mod-Alt-ArrowUp",run:gF},{key:"Mod-Alt-ArrowDown",run:yF},{key:"Escape",run:vF},{key:"Mod-Enter",run:_F},{key:"Alt-l",mac:"Ctrl-l",run:pF},{key:"Mod-i",run:mF,preventDefault:!0},{key:"Mod-[",run:Nw},{key:"Mod-]",run:Iw},{key:"Mod-Alt-\\",run:IF},{key:"Shift-Mod-k",run:AF},{key:"Shift-Mod-\\",run:iF},{key:"Mod-/",run:TQ},{key:"Alt-A",run:kQ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:NF}].concat($F),BF={key:"Tab",run:Iw,shift:Nw},jv=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Qs{constructor(e,i,n=0,r=e.length,s,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?l=>s(jv(l)):jv,this.query=this.normalize(i)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ni(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let i=vp(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=nn(e);let r=this.normalize(i);if(r.length)for(let s=0,a=n;;s++){let l=r.charCodeAt(s),u=this.match(l,a,this.bufferPos+this.bufferStart);if(s==r.length-1){if(u)return this.value=u,this;break}a==n&&s<i.length&&i.charCodeAt(s)==l&&a++}}}match(e,i,n){let r=null;for(let s=0;s<this.matches.length;s+=2){let a=this.matches[s],l=!1;this.query.charCodeAt(a)==e&&(a==this.query.length-1?r={from:this.matches[s+1],to:n}:(this.matches[s]++,l=!0)),l||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:i,to:n}:this.matches.push(1,i)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(Qs.prototype[Symbol.iterator]=function(){return this});const Mw={from:-1,to:-1,match:/.*/.exec("")},Gp="gm"+(/x/.unicode==null?"":"u");class $w{constructor(e,i,n,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=Mw,/\\[sWDnr]|\n|\r|\[\^/.test(i))return new Lw(e,i,n,r,s);this.re=new RegExp(i,Gp+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=gc(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let i=this.matchPos<=this.to&&this.re.exec(this.curLine);if(i){let n=this.curLineStart+i.index,r=n+i[0].length;if(this.matchPos=gc(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,i)))return this.value={from:n,to:r,match:i},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const hf=new WeakMap;class bs{constructor(e,i){this.from=e,this.text=i}get to(){return this.from+this.text.length}static get(e,i,n){let r=hf.get(e);if(!r||r.from>=n||r.to<=i){let l=new bs(i,e.sliceString(i,n));return hf.set(e,l),l}if(r.from==i&&r.to==n)return r;let{text:s,from:a}=r;return a>i&&(s=e.sliceString(i,a)+s,a=i),r.to<n&&(s+=e.sliceString(r.to,n)),hf.set(e,new bs(a,s)),new bs(i,s.slice(i-a,n-a))}}class Lw{constructor(e,i,n,r,s){this.text=e,this.to=s,this.done=!1,this.value=Mw,this.matchPos=gc(e,r),this.re=new RegExp(i,Gp+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=bs.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,i=this.re.exec(this.flat.text);if(i&&!i[0]&&i.index==e&&(this.re.lastIndex=e+1,i=this.re.exec(this.flat.text)),i){let n=this.flat.from+i.index,r=n+i[0].length;if((this.flat.to>=this.to||i.index+i[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,i)))return this.value={from:n,to:r,match:i},this.matchPos=gc(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bs.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&($w.prototype[Symbol.iterator]=Lw.prototype[Symbol.iterator]=function(){return this});function QF(t){try{return new RegExp(t,Gp),!0}catch{return!1}}function gc(t,e){if(e>=t.length)return e;let i=t.lineAt(e),n;for(;e<i.to&&(n=i.text.charCodeAt(e-i.from))>=56320&&n<57344;)e++;return e}const FF=t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:r}=sB(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let a=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!a){t.dispatch({effects:n});return}let l=e.doc.lineAt(e.selection.main.head),[,u,h,c,p]=a,v=c?+c.slice(1):0,g=h?+h:l.number;if(h&&p){let x=g/100;u&&(x=x*(u=="-"?-1:1)+l.number/e.doc.lines),g=Math.round(e.doc.lines*x)}else h&&u&&(g=g*(u=="-"?-1:1)+l.number);let b=e.doc.line(Math.max(1,Math.min(e.doc.lines,g))),m=Oe.cursor(b.from+Math.max(0,Math.min(v,b.length)));t.dispatch({effects:[n,_e.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},RF={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zF=Me.define({combine(t){return mn(t,RF,{highlightWordAroundCursor:(e,i)=>e||i,minSelectionLength:Math.min,maxMatches:Math.min})}});function XF(t){return[qF,UF]}const jF=Ze.mark({class:"cm-selectionMatch"}),ZF=Ze.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Zv(t,e,i,n){return(i==0||t(e.sliceDoc(i-1,i))!=St.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=St.Word)}function VF(t,e,i,n){return t(e.sliceDoc(i,i+1))==St.Word&&t(e.sliceDoc(n-1,n))==St.Word}const UF=Et.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(zF),{state:i}=t,n=i.selection;if(n.ranges.length>1)return Ze.none;let r=n.main,s,a=null;if(r.empty){if(!e.highlightWordAroundCursor)return Ze.none;let u=i.wordAt(r.head);if(!u)return Ze.none;a=i.charCategorizer(r.head),s=i.sliceDoc(u.from,u.to)}else{let u=r.to-r.from;if(u<e.minSelectionLength||u>200)return Ze.none;if(e.wholeWords){if(s=i.sliceDoc(r.from,r.to),a=i.charCategorizer(r.head),!(Zv(a,i,r.from,r.to)&&VF(a,i,r.from,r.to)))return Ze.none}else if(s=i.sliceDoc(r.from,r.to),!s)return Ze.none}let l=[];for(let u of t.visibleRanges){let h=new Qs(i.doc,s,u.from,u.to);for(;!h.next().done;){let{from:c,to:p}=h.value;if((!a||Zv(a,i,c,p))&&(r.empty&&c<=r.from&&p>=r.to?l.push(ZF.range(c,p)):(c>=r.to||p<=r.from)&&l.push(jF.range(c,p)),l.length>e.maxMatches))return Ze.none}}return Ze.set(l)}},{decorations:t=>t.decorations}),qF=_e.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),WF=({state:t,dispatch:e})=>{let{selection:i}=t,n=Oe.create(i.ranges.map(r=>t.wordAt(r.head)||Oe.cursor(r.head)),i.mainIndex);return n.eq(i)?!1:(e(t.update({selection:n})),!0)};function YF(t,e){let{main:i,ranges:n}=t.selection,r=t.wordAt(i.head),s=r&&r.from==i.from&&r.to==i.to;for(let a=!1,l=new Qs(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new Qs(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),a=!0}else{if(a&&n.some(u=>u.from==l.value.from))continue;if(s){let u=t.wordAt(l.value.from);if(!u||u.from!=l.value.from||u.to!=l.value.to)continue}return l.value}}const GF=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(s=>s.from===s.to))return WF({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=n))return!1;let r=YF(t,n);return r?(e(t.update({selection:t.selection.addRange(Oe.range(r.from,r.to),!1),effects:_e.scrollIntoView(r.to)})),!0):!1},Xs=Me.define({combine(t){return mn(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new c4(e),scrollToMatch:e=>_e.scrollIntoView(e)})}});class Bw{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||QF(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(i,n)=>n=="n"?`
|
|
203
|
+
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new i4(this):new KF(this)}getCursor(e,i=0,n){let r=e.doc?e:rt.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?as(this,r,i,n):ss(this,r,i,n)}}class Qw{constructor(e){this.spec=e}}function HF(t,e,i){return(n,r,s,a)=>{if(i&&!i(n,r,s,a))return!1;let l=n>=a&&r<=a+s.length?s.slice(n-a,r-a):e.doc.sliceString(n,r);return t(l,e,n,r)}}function ss(t,e,i,n){let r;return t.wholeWord&&(r=JF(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(r=HF(t.test,e,r)),new Qs(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:s=>s.toLowerCase(),r)}function JF(t,e){return(i,n,r,s)=>((s>i||s+r.length<n)&&(s=Math.max(0,i-2),r=t.sliceString(s,Math.min(t.length,n+2))),(e(yc(r,i-s))!=St.Word||e(vc(r,i-s))!=St.Word)&&(e(vc(r,n-s))!=St.Word||e(yc(r,n-s))!=St.Word))}class KF extends Qw{constructor(e){super(e)}nextMatch(e,i,n){let r=ss(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,i+this.spec.unquoted.length);r=ss(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==i&&r.value.to==n?null:r.value}prevMatchInRange(e,i,n){for(let r=n;;){let s=Math.max(i,r-1e4-this.spec.unquoted.length),a=ss(this.spec,e,s,r),l=null;for(;!a.nextOverlapping().done;)l=a.value;if(l)return l;if(s==i)return null;r-=1e4}}prevMatch(e,i,n){let r=this.prevMatchInRange(e,0,i);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=i||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,i){let n=ss(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=ss(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function e4(t,e,i){return(n,r,s)=>(!i||i(n,r,s))&&t(s[0],e,n,r)}function as(t,e,i,n){let r;return t.wholeWord&&(r=t4(e.charCategorizer(e.selection.main.head))),t.test&&(r=e4(t.test,e,r)),new $w(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:r},i,n)}function yc(t,e){return t.slice(Rt(t,e,!1),e)}function vc(t,e){return t.slice(e,Rt(t,e))}function t4(t){return(e,i,n)=>!n[0].length||(t(yc(n.input,n.index))!=St.Word||t(vc(n.input,n.index))!=St.Word)&&(t(vc(n.input,n.index+n[0].length))!=St.Word||t(yc(n.input,n.index+n[0].length))!=St.Word)}class i4 extends Qw{nextMatch(e,i,n){let r=as(this.spec,e,n,e.doc.length).next();return r.done&&(r=as(this.spec,e,0,i).next()),r.done?null:r.value}prevMatchInRange(e,i,n){for(let r=1;;r++){let s=Math.max(i,n-r*1e4),a=as(this.spec,e,s,n),l=null;for(;!a.next().done;)l=a.value;if(l&&(s==i||l.from>s+10))return l;if(s==i)return null}}prevMatch(e,i,n){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(i,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let s=+n.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+n.slice(r)}return i})}matchAll(e,i){let n=as(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=as(this.spec,e,Math.max(0,i-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const jo=We.define(),Hp=We.define(),Kn=Ut.define({create(t){return new ff(Qd(t).create(),null)},update(t,e){for(let i of e.effects)i.is(jo)?t=new ff(i.value.create(),t.panel):i.is(Hp)&&(t=new ff(t.query,i.value?Jp:null));return t},provide:t=>Qo.from(t,e=>e.panel)});class ff{constructor(e,i){this.query=e,this.panel=i}}const n4=Ze.mark({class:"cm-searchMatch"}),r4=Ze.mark({class:"cm-searchMatch cm-searchMatch-selected"}),s4=Et.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Kn))}update(t){let e=t.state.field(Kn);(e!=t.startState.field(Kn)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Ze.none;let{view:i}=this,n=new In;for(let r=0,s=i.visibleRanges,a=s.length;r<a;r++){let{from:l,to:u}=s[r];for(;r<a-1&&u>s[r+1].from-500;)u=s[++r].to;t.highlight(i.state,l,u,(h,c)=>{let p=i.state.selection.ranges.some(v=>v.from==h&&v.to==c);n.add(h,c,p?r4:n4)})}return n.finish()}},{decorations:t=>t.decorations});function fl(t){return e=>{let i=e.state.field(Kn,!1);return i&&i.query.spec.valid?t(e,i):zw(e)}}const Oc=fl((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let r=Oe.single(n.from,n.to),s=t.state.facet(Xs);return t.dispatch({selection:r,effects:[Kp(t,n),s.scrollToMatch(r.main,t)],userEvent:"select.search"}),Rw(t),!0}),xc=fl((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,r=e.prevMatch(i,n,n);if(!r)return!1;let s=Oe.single(r.from,r.to),a=t.state.facet(Xs);return t.dispatch({selection:s,effects:[Kp(t,r),a.scrollToMatch(s.main,t)],userEvent:"select.search"}),Rw(t),!0}),a4=fl((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:Oe.create(i.map(n=>Oe.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),o4=({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:r}=i.main,s=[],a=0;for(let l=new Qs(t.doc,t.sliceDoc(n,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==n&&(a=s.length),s.push(Oe.range(l.value.from,l.value.to))}return e(t.update({selection:Oe.create(s,a),userEvent:"select.search.matches"})),!0},Vv=fl((t,{query:e})=>{let{state:i}=t,{from:n,to:r}=i.selection.main;if(i.readOnly)return!1;let s=e.nextMatch(i,n,n);if(!s)return!1;let a=s,l=[],u,h,c=[];a.from==n&&a.to==r&&(h=i.toText(e.getReplacement(a)),l.push({from:a.from,to:a.to,insert:h}),a=e.nextMatch(i,a.from,a.to),c.push(_e.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+".")));let p=t.state.changes(l);return a&&(u=Oe.single(a.from,a.to).map(p),c.push(Kp(t,a)),c.push(i.facet(Xs).scrollToMatch(u.main,t))),t.dispatch({changes:p,selection:u,effects:c,userEvent:"input.replace"}),!0}),l4=fl((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map(r=>{let{from:s,to:a}=r;return{from:s,to:a,insert:e.getReplacement(r)}});if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:_e.announce.of(n),userEvent:"input.replace.all"}),!0});function Jp(t){return t.state.facet(Xs).createPanel(t)}function Qd(t,e){var i,n,r,s,a;let l=t.selection.main,u=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!u)return e;let h=t.facet(Xs);return new Bw({search:((i=e?.literal)!==null&&i!==void 0?i:h.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:h.caseSensitive,literal:(r=e?.literal)!==null&&r!==void 0?r:h.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:h.wholeWord})}function Fw(t){let e=Lp(t,Jp);return e&&e.dom.querySelector("[main-field]")}function Rw(t){let e=Fw(t);e&&e==t.root.activeElement&&e.select()}const zw=t=>{let e=t.state.field(Kn,!1);if(e&&e.panel){let i=Fw(t);if(i&&i!=t.root.activeElement){let n=Qd(t.state,e.query.spec);n.valid&&t.dispatch({effects:jo.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[Hp.of(!0),e?jo.of(Qd(t.state,e.query.spec)):We.appendConfig.of(f4)]});return!0},Xw=t=>{let e=t.state.field(Kn,!1);if(!e||!e.panel)return!1;let i=Lp(t,Jp);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Hp.of(!1)}),!0},u4=[{key:"Mod-f",run:zw,scope:"editor search-panel"},{key:"F3",run:Oc,shift:xc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Oc,shift:xc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Xw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:o4},{key:"Mod-Alt-g",run:FF},{key:"Mod-d",run:GF,preventDefault:!0}];class c4{constructor(e){this.view=e;let i=this.query=e.state.field(Kn).query.spec;this.commit=this.commit.bind(this),this.searchField=ct("input",{value:i.search,placeholder:pi(e,"Find"),"aria-label":pi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ct("input",{value:i.replace,placeholder:pi(e,"Replace"),"aria-label":pi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ct("input",{type:"checkbox",name:"case",form:"",checked:i.caseSensitive,onchange:this.commit}),this.reField=ct("input",{type:"checkbox",name:"re",form:"",checked:i.regexp,onchange:this.commit}),this.wordField=ct("input",{type:"checkbox",name:"word",form:"",checked:i.wholeWord,onchange:this.commit});function n(r,s,a){return ct("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=ct("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>Oc(e),[pi(e,"next")]),n("prev",()=>xc(e),[pi(e,"previous")]),n("select",()=>a4(e),[pi(e,"all")]),ct("label",null,[this.caseField,pi(e,"match case")]),ct("label",null,[this.reField,pi(e,"regexp")]),ct("label",null,[this.wordField,pi(e,"by word")]),...e.state.readOnly?[]:[ct("br"),this.replaceField,n("replace",()=>Vv(e),[pi(e,"replace")]),n("replaceAll",()=>l4(e),[pi(e,"replace all")])],ct("button",{name:"close",onclick:()=>Xw(e),"aria-label":pi(e,"close"),type:"button"},["×"])])}commit(){let e=new Bw({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:jo.of(e)}))}keydown(e){mL(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?xc:Oc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Vv(this.view))}update(e){for(let i of e.transactions)for(let n of i.effects)n.is(jo)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Xs).top}}function pi(t,e){return t.state.phrase(e)}const uu=30,cu=/[\s\.,:;?!]/;function Kp(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),r=t.state.doc.lineAt(i).to,s=Math.max(n.from,e-uu),a=Math.min(r,i+uu),l=t.state.sliceDoc(s,a);if(s!=n.from){for(let u=0;u<uu;u++)if(!cu.test(l[u+1])&&cu.test(l[u])){l=l.slice(u);break}}if(a!=r){for(let u=l.length-1;u>l.length-uu;u--)if(!cu.test(l[u-1])&&cu.test(l[u])){l=l.slice(0,u);break}}return _e.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const h4=_e.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),f4=[Kn,fr.low(s4),h4];class jw{constructor(e,i,n,r){this.state=e,this.pos=i,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let i=Qt(this.state).resolveInner(this.pos,-1);for(;i&&e.indexOf(i.name)<0;)i=i.parent;return i?{from:i.from,to:this.pos,text:this.state.sliceDoc(i.from,this.pos),type:i.type}:null}matchBefore(e){let i=this.state.doc.lineAt(this.pos),n=Math.max(i.from,this.pos-250),r=i.text.slice(n-i.from,this.pos-i.from),s=r.search(Vw(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,i,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(i),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function Uv(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function d4(t){let e=Object.create(null),i=Object.create(null);for(let{label:r}of t){e[r[0]]=!0;for(let s=1;s<r.length;s++)i[r[s]]=!0}let n=Uv(e)+Uv(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function Zw(t){let e=t.map(r=>typeof r=="string"?{label:r}:r),[i,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:d4(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:i}:null}}function p4(t,e){return i=>{for(let n=Qt(i.state).resolveInner(i.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(i)}}class qv{constructor(e,i,n,r){this.completion=e,this.source=i,this.match=n,this.score=r}}function Rr(t){return t.selection.main.from}function Vw(t,e){var i;let{source:n}=t,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?t:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}const em=Ln.define();function m4(t,e,i,n){let{main:r}=t.selection,s=i-r.from,a=n-r.from;return{...t.changeByRange(l=>{if(l!=r&&i!=n&&t.sliceDoc(l.from+s,l.from+a)!=t.sliceDoc(i,n))return{range:l};let u=t.toText(e);return{changes:{from:l.from+s,to:n==r.from?l.to:l.from+a,insert:u},range:Oe.cursor(l.from+s+u.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Wv=new WeakMap;function g4(t){if(!Array.isArray(t))return t;let e=Wv.get(t);return e||Wv.set(t,e=Zw(t)),e}const bc=We.define(),Zo=We.define();class y4{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let i=0;i<e.length;){let n=ni(e,i),r=nn(n);this.chars.push(n);let s=e.slice(i,i+r),a=s.toUpperCase();this.folded.push(ni(a==s?s.toLowerCase():a,0)),i+=r}this.astral=e.length!=this.chars.length}ret(e,i){return this.score=e,this.matched=i,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:i,folded:n,any:r,precise:s,byWord:a}=this;if(i.length==1){let P=ni(e,0),S=nn(P),w=S==e.length?0:-100;if(P!=i[0])if(P==n[0])w+=-200;else return null;return this.ret(w,[0,S])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let u=i.length,h=0;if(l<0){for(let P=0,S=Math.min(e.length,200);P<S&&h<u;){let w=ni(e,P);(w==i[h]||w==n[h])&&(r[h++]=P),P+=nn(w)}if(h<u)return null}let c=0,p=0,v=!1,g=0,b=-1,m=-1,x=/[a-z]/.test(e),O=!0;for(let P=0,S=Math.min(e.length,200),w=0;P<S&&p<u;){let C=ni(e,P);l<0&&(c<u&&C==i[c]&&(s[c++]=P),g<u&&(C==i[g]||C==n[g]?(g==0&&(b=P),m=P+1,g++):g=0));let E,k=C<255?C>=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(E=vp(C))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!P||k==1&&x||w==0&&k!=0)&&(i[p]==C||n[p]==C&&(v=!0)?a[p++]=P:a.length&&(O=!1)),w=k,P+=nn(C)}return p==u&&a[0]==0&&O?this.result(-100+(v?-200:0),a,e):g==u&&b==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):g==u?this.ret(-900-e.length,[b,m]):p==u?this.result(-100+(v?-200:0)+-700+(O?0:-1100),a,e):i.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,i,n){let r=[],s=0;for(let a of i){let l=a+(this.astral?nn(ni(n,a)):1);s&&r[s-1]==a?r[s-1]=l:(r[s++]=a,r[s++]=l)}return this.ret(e-n.length,r)}}class v4{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let i=e.slice(0,this.pattern.length),n=i==this.pattern?0:i.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,i.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const Ft=Me.define({combine(t){return mn(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:O4,filterStrict:!1,compareCompletions:(e,i)=>(e.sortText||e.label).localeCompare(i.sortText||i.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,i)=>e&&i,closeOnBlur:(e,i)=>e&&i,icons:(e,i)=>e&&i,tooltipClass:(e,i)=>n=>Yv(e(n),i(n)),optionClass:(e,i)=>n=>Yv(e(n),i(n)),addToOptions:(e,i)=>e.concat(i),filterStrict:(e,i)=>e||i})}});function Yv(t,e){return t?e?t+" "+e:t:e}function O4(t,e,i,n,r,s){let a=t.textDirection==yt.RTL,l=a,u=!1,h="top",c,p,v=e.left-r.left,g=r.right-e.right,b=n.right-n.left,m=n.bottom-n.top;if(l&&v<Math.min(b,g)?l=!1:!l&&g<Math.min(b,v)&&(l=!0),b<=(l?v:g))c=Math.max(r.top,Math.min(i.top,r.bottom-m))-e.top,p=Math.min(400,l?v:g);else{u=!0,p=Math.min(400,(a?e.right:r.right-e.left)-30);let P=r.bottom-e.bottom;P>=m||P>e.top?c=i.bottom-e.top:(h="bottom",c=e.bottom-i.top)}let x=(e.bottom-e.top)/s.offsetHeight,O=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${c/x}px; max-width: ${p/O}px`,class:"cm-completionInfo-"+(u?a?"left-narrow":"right-narrow":l?"left":"right")}}const tm=We.define();function x4(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(i){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),i.type&&n.classList.add(...i.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(i,n,r,s){let a=document.createElement("span");a.className="cm-completionLabel";let l=i.displayLabel||i.label,u=0;for(let h=0;h<s.length;){let c=s[h++],p=s[h++];c>u&&a.appendChild(document.createTextNode(l.slice(u,c)));let v=a.appendChild(document.createElement("span"));v.appendChild(document.createTextNode(l.slice(c,p))),v.className="cm-completionMatchedText",u=p}return u<l.length&&a.appendChild(document.createTextNode(l.slice(u))),a},position:50},{render(i){if(!i.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=i.detail,n},position:80}),e.sort((i,n)=>i.position-n.position).map(i=>i.render)}function df(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let r=Math.floor(e/i);return{from:r*i,to:(r+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class b4{constructor(e,i,n){this.view=e,this.stateField=i,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:u=>this.placeInfo(u),key:this},this.space=null,this.currentClass="";let r=e.state.field(i),{options:s,selected:a}=r.open,l=e.state.facet(Ft);this.optionContent=x4(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=df(s.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",u=>{let{options:h}=e.state.field(i).open;for(let c=u.target,p;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(p=/-(\d+)$/.exec(c.id))&&+p[1]<h.length){this.applyCompletion(e,h[+p[1]]),u.preventDefault();return}if(u.target==this.list){let c=this.list.classList.contains("cm-completionListIncompleteTop")&&u.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&u.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:tm.of(c)}),u.preventDefault())}}),this.dom.addEventListener("focusout",u=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(Ft).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:Zo.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,i){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,i,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var i;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:a,disabled:l}=n.open;(!r.open||r.open.options!=s)&&(this.range=df(s.length,a,e.state.facet(Ft).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),l!=((i=r.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let i=this.tooltipClass(e);if(i!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of i.split(" "))n&&this.dom.classList.add(n);this.currentClass=i}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),i=e.open;(i.selected>-1&&i.selected<this.range.from||i.selected>=this.range.to)&&(this.range=df(i.options.length,i.selected,this.view.state.facet(Ft).maxRenderedOptions),this.showOptions(i.options,e.id));let n=this.updateSelectedOption(i.selected);if(n){this.destroyInfo();let{completion:r}=i.options[i.selected],{info:s}=r;if(!s)return;let a=typeof s=="string"?document.createTextNode(s):s(r);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>li(this.view.state,l,"completion info")):(this.addInfoPane(a,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,i){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let i=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),i=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return i&&w4(this.list,i),i}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let i=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let a=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return r.top>Math.min(s.bottom,i.bottom)-10||r.bottom<Math.max(s.top,i.top)+10?null:this.view.state.facet(Ft).positionInfo(this.view,i,r,n,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,i,n){const r=document.createElement("ul");r.id=i,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",a=>{a.target==r&&a.preventDefault()});let s=null;for(let a=n.from;a<n.to;a++){let{completion:l,match:u}=e[a],{section:h}=l;if(h){let v=typeof h=="string"?h:h.name;if(v!=s&&(a>n.from||n.from==0))if(s=v,typeof h!="string"&&h.header)r.appendChild(h.header(h));else{let g=r.appendChild(document.createElement("completion-section"));g.textContent=v}}const c=r.appendChild(document.createElement("li"));c.id=i+"-"+a,c.setAttribute("role","option");let p=this.optionClass(l);p&&(c.className=p);for(let v of this.optionContent){let g=v(l,this.view.state,this.view,u);g&&c.appendChild(g)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function S4(t,e){return i=>new b4(i,t,e)}function w4(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=i.height/t.offsetHeight;n.top<i.top?t.scrollTop-=(i.top-n.top)/r:n.bottom>i.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/r)}function Gv(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function P4(t,e){let i=[],n=null,r=null,s=c=>{i.push(c);let{section:p}=c.completion;if(p){n||(n=[]);let v=typeof p=="string"?p:p.name;n.some(g=>g.name==v)||n.push(typeof p=="string"?{name:v}:p)}},a=e.facet(Ft);for(let c of t)if(c.hasResult()){let p=c.result.getMatch;if(c.result.filter===!1)for(let v of c.result.options)s(new qv(v,c.source,p?p(v):[],1e9-i.length));else{let v=e.sliceDoc(c.from,c.to),g,b=a.filterStrict?new v4(v):new y4(v);for(let m of c.result.options)if(g=b.match(m.label)){let x=m.displayLabel?p?p(m,g.matched):[]:g.matched,O=g.score+(m.boost||0);if(s(new qv(m,c.source,x,O)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:P}=m.section;r||(r=Object.create(null)),r[P]=Math.max(O,r[P]||-1e9)}}}}if(n){let c=Object.create(null),p=0,v=(g,b)=>(g.rank==="dynamic"&&b.rank==="dynamic"?r[b.name]-r[g.name]:0)||(typeof g.rank=="number"?g.rank:1e9)-(typeof b.rank=="number"?b.rank:1e9)||(g.name<b.name?-1:1);for(let g of n.sort(v))p-=1e5,c[g.name]=p;for(let g of i){let{section:b}=g.completion;b&&(g.score+=c[typeof b=="string"?b:b.name])}}let l=[],u=null,h=a.compareCompletions;for(let c of i.sort((p,v)=>v.score-p.score||h(p.completion,v.completion))){let p=c.completion;!u||u.label!=p.label||u.detail!=p.detail||u.type!=null&&p.type!=null&&u.type!=p.type||u.apply!=p.apply||u.boost!=p.boost?l.push(c):Gv(c.completion)>Gv(u)&&(l[l.length-1]=c),u=c.completion}return l}class hs{constructor(e,i,n,r,s,a){this.options=e,this.attrs=i,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=a}setSelected(e,i){return e==this.selected||e>=this.options.length?this:new hs(this.options,Hv(i,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,i,n,r,s,a){if(r&&!a&&e.some(h=>h.isPending))return r.setDisabled();let l=P4(e,i);if(!l.length)return r&&e.some(h=>h.isPending)?r.setDisabled():null;let u=i.facet(Ft).selectOnOpen?0:-1;if(r&&r.selected!=u&&r.selected!=-1){let h=r.options[r.selected].completion;for(let c=0;c<l.length;c++)if(l[c].completion==h){u=c;break}}return new hs(l,Hv(n,u),{pos:e.reduce((h,c)=>c.hasResult()?Math.min(h,c.from):h,1e8),create:D4,above:s.aboveCursor},r?r.timestamp:Date.now(),u,!1)}map(e){return new hs(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new hs(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Sc{constructor(e,i,n){this.active=e,this.id=i,this.open=n}static start(){return new Sc(E4,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:i}=e,n=i.facet(Ft),s=(n.override||i.languageDataAt("autocomplete",Rr(i)).map(g4)).map(u=>(this.active.find(c=>c.source==u)||new Ti(u,this.active.some(c=>c.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((u,h)=>u==this.active[h])&&(s=this.active);let a=this.open,l=e.effects.some(u=>u.is(im));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||s.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!T4(s,this.active)||l?a=hs.build(s,i,this.id,a,n,l):a&&a.disabled&&!s.some(u=>u.isPending)&&(a=null),!a&&s.every(u=>!u.isPending)&&s.some(u=>u.hasResult())&&(s=s.map(u=>u.hasResult()?new Ti(u.source,0):u));for(let u of e.effects)u.is(tm)&&(a=a&&a.setSelected(u.value,this.id));return s==this.active&&a==this.open?this:new Sc(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?C4:k4}}function T4(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;n<e.length&&!e[n].hasResult();)n++;let r=i==t.length,s=n==e.length;if(r||s)return r==s;if(t[i++].result!=e[n++].result)return!1}}const C4={"aria-autocomplete":"list"},k4={};function Hv(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const E4=[];function Uw(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(em);if(n&&e.activateOnCompletion(n))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Ti{constructor(e,i,n=!1){this.source=e,this.state=i,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,i){let n=Uw(e,i),r=this;(n&8||n&16&&this.touches(e))&&(r=new Ti(r.source,0)),n&4&&r.state==0&&(r=new Ti(this.source,1)),r=r.updateFor(e,n);for(let s of e.effects)if(s.is(bc))r=new Ti(r.source,1,s.value);else if(s.is(Zo))r=new Ti(r.source,0);else if(s.is(im))for(let a of s.value)a.source==r.source&&(r=a);return r}updateFor(e,i){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Rr(e.state))}}class Ss extends Ti{constructor(e,i,n,r,s,a){super(e,3,i),this.limit=n,this.result=r,this.from=s,this.to=a}hasResult(){return!0}updateFor(e,i){var n;if(!(i&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=Rr(e.state);if(l>a||!r||i&2&&(Rr(e.startState)==this.from||l<this.limit))return new Ti(this.source,i&4?1:0);let u=e.changes.mapPos(this.limit);return A4(r.validFor,e.state,s,a)?new Ss(this.source,this.explicit,u,r,s,a):r.update&&(r=r.update(r,s,a,new jw(e.state,l,!1)))?new Ss(this.source,this.explicit,u,r,r.from,(n=r.to)!==null&&n!==void 0?n:Rr(e.state)):new Ti(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Ss(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ti(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function A4(t,e,i,n){if(!t)return!1;let r=e.sliceDoc(i,n);return typeof t=="function"?t(r,i,n,e):Vw(t,!0).test(r)}const im=We.define({map(t,e){return t.map(i=>i.map(e))}}),ri=Ut.define({create(){return Sc.start()},update(t,e){return t.update(e)},provide:t=>[$p.from(t,e=>e.tooltip),_e.contentAttributes.from(t,e=>e.attrs)]});function nm(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(ri).active.find(r=>r.source==e.source);return n instanceof Ss?(typeof i=="string"?t.dispatch({...m4(t.state,i,n.from,n.to),annotations:em.of(e.completion)}):i(t,e.completion,n.from,n.to),!0):!1}const D4=S4(ri,nm);function hu(t,e="option"){return i=>{let n=i.state.field(ri,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(Ft).interactionDelay)return!1;let r=1,s;e=="page"&&(s=PS(i,n.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:a}=n.open.options,l=n.open.selected>-1?n.open.selected+r*(t?1:-1):t?0:a-1;return l<0?l=e=="page"?0:a-1:l>=a&&(l=e=="page"?a-1:0),i.dispatch({effects:tm.of(l)}),!0}}const _4=t=>{let e=t.state.field(ri,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Ft).interactionDelay?!1:nm(t,e.open.options[e.open.selected])},pf=t=>t.state.field(ri,!1)?(t.dispatch({effects:bc.of(!0)}),!0):!1,I4=t=>{let e=t.state.field(ri,!1);return!e||!e.active.some(i=>i.state!=0)?!1:(t.dispatch({effects:Zo.of(null)}),!0)};class N4{constructor(e,i){this.active=e,this.context=i,this.time=Date.now(),this.updates=[],this.done=void 0}}const M4=50,$4=1e3,L4=Et.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(ri).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(ri),i=t.state.facet(Ft);if(!t.selectionSet&&!t.docChanged&&t.startState.field(ri)==e)return;let n=t.transactions.some(s=>{let a=Uw(s,i);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;s<this.running.length;s++){let a=this.running[s];if(n||a.context.abortOnDocChange&&t.docChanged||a.updates.length+t.transactions.length>M4&&Date.now()-a.time>$4){for(let l of a.context.abortListeners)try{l()}catch(u){li(this.view.state,u)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(a=>a.is(bc)))&&(this.pendingStart=!0);let r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(ri);for(let i of e.active)i.isPending&&!this.running.some(n=>n.active.source==i.source)&&this.startQuery(i);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ft).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=Rr(e),n=new jw(e,i,t.explicit,this.view),r=new N4(t,n);this.running.push(r),Promise.resolve(t.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Zo.of(null)}),li(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ft).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Ft),n=this.view.state.field(ri);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(s.done===void 0)continue;if(this.running.splice(r--,1),s.done){let l=Rr(s.updates.length?s.updates[0].startState:this.view.state),u=Math.min(l,s.done.from+(s.active.explicit?0:1)),h=new Ss(s.active.source,s.active.explicit,u,s.done,s.done.from,(t=s.done.to)!==null&&t!==void 0?t:l);for(let c of s.updates)h=h.update(c,i);if(h.hasResult()){e.push(h);continue}}let a=n.active.find(l=>l.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new Ti(s.active.source,0);for(let u of s.updates)l=l.update(u,i);l.isPending||e.push(l)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:im.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(ri,!1);if(e&&e.tooltip&&this.view.state.facet(Ft).closeOnBlur){let i=e.open&&PS(this.view,e.open.tooltip);(!i||!i.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Zo.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:bc.of(!1)}),20),this.composing=0}}}),B4=typeof navigator=="object"&&/Win/.test(navigator.platform),Q4=fr.highest(_e.domEventHandlers({keydown(t,e){let i=e.state.field(ri,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&!(B4&&t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],r=i.active.find(a=>a.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&nm(e,n),!1}})),qw=_e.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class F4{constructor(e,i,n,r){this.field=e,this.line=i,this.from=n,this.to=r}}class rm{constructor(e,i,n){this.field=e,this.from=i,this.to=n}map(e){let i=e.mapPos(this.from,-1,Zt.TrackDel),n=e.mapPos(this.to,1,Zt.TrackDel);return i==null||n==null?null:new rm(this.field,i,n)}}class sm{constructor(e,i){this.lines=e,this.fieldPositions=i}instantiate(e,i){let n=[],r=[i],s=e.doc.lineAt(i),a=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(n.length){let h=a,c=/^\t*/.exec(u)[0].length;for(let p=0;p<c;p++)h+=e.facet(ll);r.push(i+h.length-c),u=h+u.slice(c)}n.push(u),i+=u.length+1}let l=this.fieldPositions.map(u=>new rm(u.field,r[u.line]+u.from,r[u.line]+u.to));return{text:n,ranges:l}}static parse(e){let i=[],n=[],r=[],s;for(let a of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=s[1]?+s[1]:null,u=s[2]||s[3]||"",h=-1,c=u.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<i.length;p++)(l!=null?i[p].seq==l:c&&i[p].name==c)&&(h=p);if(h<0){let p=0;for(;p<i.length&&(l==null||i[p].seq!=null&&i[p].seq<l);)p++;i.splice(p,0,{seq:l,name:c}),h=p;for(let v of r)v.field>=h&&v.field++}for(let p of r)if(p.line==n.length&&p.from>s.index){let v=s[2]?3+(s[1]||"").length:2;p.from-=v,p.to-=v}r.push(new F4(h,n.length,s.index,s.index+c.length)),a=a.slice(0,s.index)+u+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(l,u,h)=>{for(let c of r)c.line==n.length&&c.from>h&&(c.from--,c.to--);return u}),n.push(a)}return new sm(n,r)}}let R4=Ze.widget({widget:new class extends Ri{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),z4=Ze.mark({class:"cm-snippetField"});class js{constructor(e,i){this.ranges=e,this.active=i,this.deco=Ze.set(e.map(n=>(n.from==n.to?R4:z4).range(n.from,n.to)),!0)}map(e){let i=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;i.push(r)}return new js(i,this.active)}selectionInsideField(e){return e.ranges.every(i=>this.ranges.some(n=>n.field==this.active&&n.from<=i.from&&n.to>=i.to))}}const dl=We.define({map(t,e){return t&&t.map(e)}}),X4=We.define(),Vo=Ut.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(dl))return i.value;if(i.is(X4)&&t)return new js(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>_e.decorations.from(t,e=>e?e.deco:Ze.none)});function am(t,e){return Oe.create(t.filter(i=>i.field==e).map(i=>Oe.range(i.from,i.to)))}function j4(t){let e=sm.parse(t);return(i,n,r,s)=>{let{text:a,ranges:l}=e.instantiate(i.state,r),{main:u}=i.state.selection,h={changes:{from:r,to:s==u.from?u.to:s,insert:at.of(a)},scrollIntoView:!0,annotations:n?[em.of(n),Mt.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=am(l,0)),l.some(c=>c.field>0)){let c=new js(l,0),p=h.effects=[dl.of(c)];i.state.field(Vo,!1)===void 0&&p.push(We.appendConfig.of([Vo,W4,Y4,qw]))}i.dispatch(i.state.update(h))}}function Ww(t){return({state:e,dispatch:i})=>{let n=e.field(Vo,!1);if(!n||t<0&&n.active==0)return!1;let r=n.active+t,s=t>0&&!n.ranges.some(a=>a.field==r+t);return i(e.update({selection:am(n.ranges,r),effects:dl.of(s?null:new js(n.ranges,r)),scrollIntoView:!0})),!0}}const Z4=({state:t,dispatch:e})=>t.field(Vo,!1)?(e(t.update({effects:dl.of(null)})),!0):!1,V4=Ww(1),U4=Ww(-1),q4=[{key:"Tab",run:V4,shift:U4},{key:"Escape",run:Z4}],Jv=Me.define({combine(t){return t.length?t[0]:q4}}),W4=fr.highest(ol.compute([Jv],t=>t.facet(Jv)));function ii(t,e){return{...e,apply:j4(t)}}const Y4=_e.domEventHandlers({mousedown(t,e){let i=e.state.field(Vo,!1),n;if(!i||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let r=i.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==i.active?!1:(e.dispatch({selection:am(i.ranges,r.field),effects:dl.of(i.ranges.some(s=>s.field>r.field)?new js(i.ranges,r.field):null),scrollIntoView:!0}),!0)}}),Uo={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Mr=We.define({map(t,e){let i=e.mapPos(t,-1,Zt.TrackAfter);return i??void 0}}),om=new class extends nr{};om.startSide=1;om.endSide=-1;const Yw=Ut.define({create(){return tt.empty},update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:n=>n>=i.from&&n<=i.to})}for(let i of e.effects)i.is(Mr)&&(t=t.update({add:[om.range(i.value,i.value+1)]}));return t}});function G4(){return[J4,Yw]}const mf="()[]{}<>«»»«[]{}";function Gw(t){for(let e=0;e<mf.length;e+=2)if(mf.charCodeAt(e)==t)return mf.charAt(e+1);return vp(t<128?t:t+1)}function Hw(t,e){return t.languageDataAt("closeBrackets",e)[0]||Uo}const H4=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),J4=_e.inputHandler.of((t,e,i,n)=>{if((H4?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let r=t.state.selection.main;if(n.length>2||n.length==2&&nn(ni(n,0))==1||e!=r.from||i!=r.to)return!1;let s=tR(t.state,n);return s?(t.dispatch(s),!0):!1}),K4=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Hw(t,t.selection.main.head).brackets||Uo.brackets,r=null,s=t.changeByRange(a=>{if(a.empty){let l=iR(t.doc,a.head);for(let u of n)if(u==l&&rh(t.doc,a.head)==Gw(ni(u,0)))return{changes:{from:a.head-u.length,to:a.head+u.length},range:Oe.cursor(a.head-u.length)}}return{range:r=a}});return r||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},eR=[{key:"Backspace",run:K4}];function tR(t,e){let i=Hw(t,t.selection.main.head),n=i.brackets||Uo.brackets;for(let r of n){let s=Gw(ni(r,0));if(e==r)return s==r?sR(t,r,n.indexOf(r+r+r)>-1,i):nR(t,r,s,i.before||Uo.before);if(e==s&&Jw(t,t.selection.main.from))return rR(t,r,s)}return null}function Jw(t,e){let i=!1;return t.field(Yw).between(0,t.doc.length,n=>{n==e&&(i=!0)}),i}function rh(t,e){let i=t.sliceString(e,e+2);return i.slice(0,nn(ni(i,0)))}function iR(t,e){let i=t.sliceString(e-2,e);return nn(ni(i,0))==i.length?i:i.slice(1)}function nR(t,e,i,n){let r=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:i,from:a.to}],effects:Mr.of(a.to+e.length),range:Oe.range(a.anchor+e.length,a.head+e.length)};let l=rh(t.doc,a.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+i,from:a.head},effects:Mr.of(a.head+e.length),range:Oe.cursor(a.head+e.length)}:{range:r=a}});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function rR(t,e,i){let n=null,r=t.changeByRange(s=>s.empty&&rh(t.doc,s.head)==i?{changes:{from:s.head,to:s.head+i.length,insert:i},range:Oe.cursor(s.head+i.length)}:n={range:s});return n?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function sR(t,e,i,n){let r=n.stringPrefixes||Uo.stringPrefixes,s=null,a=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Mr.of(l.to+e.length),range:Oe.range(l.anchor+e.length,l.head+e.length)};let u=l.head,h=rh(t.doc,u),c;if(h==e){if(Kv(t,u))return{changes:{insert:e+e,from:u},effects:Mr.of(u+e.length),range:Oe.cursor(u+e.length)};if(Jw(t,u)){let v=i&&t.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+v.length,insert:v},range:Oe.cursor(u+v.length)}}}else{if(i&&t.sliceDoc(u-2*e.length,u)==e+e&&(c=eO(t,u-2*e.length,r))>-1&&Kv(t,c))return{changes:{insert:e+e+e+e,from:u},effects:Mr.of(u+e.length),range:Oe.cursor(u+e.length)};if(t.charCategorizer(u)(h)!=St.Word&&eO(t,u,r)>-1&&!aR(t,u,e,r))return{changes:{insert:e+e,from:u},effects:Mr.of(u+e.length),range:Oe.cursor(u+e.length)}}return{range:s=l}});return s?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function Kv(t,e){let i=Qt(t).resolveInner(e+1);return i.parent&&i.from==e}function aR(t,e,i,n){let r=Qt(t).resolveInner(e,-1),s=n.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=t.sliceDoc(r.from,Math.min(r.to,r.from+i.length+s)),u=l.indexOf(i);if(!u||u>-1&&n.indexOf(l.slice(0,u))>-1){let c=r.firstChild;for(;c&&c.from==r.from&&c.to-c.from>i.length+u;){if(t.sliceDoc(c.to-i.length,c.to)==i)return!1;c=c.firstChild}return!0}let h=r.to==e&&r.parent;if(!h)break;r=h}return!1}function eO(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=St.Word)return e;for(let r of i){let s=e-r.length;if(t.sliceDoc(s,e)==r&&n(t.sliceDoc(s-1,s))!=St.Word)return s}return-1}function oR(t={}){return[Q4,ri,Ft.of(t),L4,lR,qw]}const Kw=[{key:"Ctrl-Space",run:pf},{mac:"Alt-`",run:pf},{mac:"Alt-i",run:pf},{key:"Escape",run:I4},{key:"ArrowDown",run:hu(!0)},{key:"ArrowUp",run:hu(!1)},{key:"PageDown",run:hu(!0,"page")},{key:"PageUp",run:hu(!1,"page")},{key:"Enter",run:_4}],lR=fr.highest(ol.computeN([Ft],t=>t.facet(Ft).defaultKeymap?[Kw]:[]));class tO{constructor(e,i,n){this.from=e,this.to=i,this.diagnostic=n}}class Er{constructor(e,i,n){this.diagnostics=e,this.panel=i,this.selected=n}static init(e,i,n){let r=n.facet(qo).markerFilter;r&&(e=r(e,n));let s=e.slice().sort((g,b)=>g.from-b.from||g.to-b.to),a=new In,l=[],u=0,h=n.doc.iter(),c=0,p=n.doc.length;for(let g=0;;){let b=g==s.length?null:s[g];if(!b&&!l.length)break;let m,x;if(l.length)m=u,x=l.reduce((S,w)=>Math.min(S,w.to),b&&b.from>m?b.from:1e8);else{if(m=b.from,m>p)break;x=b.to,l.push(b),g++}for(;g<s.length;){let S=s[g];if(S.from==m&&(S.to>S.from||S.to==m))l.push(S),g++,x=Math.min(S.to,x);else{x=Math.min(S.from,x);break}}x=Math.min(x,p);let O=!1;if(l.some(S=>S.from==m&&(S.to==x||x==p))&&(O=m==x,!O&&x-m<10)){let S=m-(c+h.value.length);S>0&&(h.next(S),c=m);for(let w=m;;){if(w>=x){O=!0;break}if(!h.lineBreak&&c+h.value.length>w)break;w=c+h.value.length,c+=h.value.length,h.next()}}let P=bR(l);if(O)a.add(m,m,Ze.widget({widget:new yR(P),diagnostics:l.slice()}));else{let S=l.reduce((w,C)=>C.markClass?w+" "+C.markClass:w,"");a.add(m,x,Ze.mark({class:"cm-lintRange cm-lintRange-"+P+S,diagnostics:l.slice(),inclusiveEnd:l.some(w=>w.to>x)}))}if(u=x,u==p)break;for(let S=0;S<l.length;S++)l[S].to<=u&&l.splice(S--,1)}let v=a.finish();return new Er(v,i,ur(v))}}function ur(t,e=null,i=0){let n=null;return t.between(i,1e9,(r,s,{spec:a})=>{if(!(e&&a.diagnostics.indexOf(e)<0))if(!n)n=new tO(r,s,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new tO(n.from,s,n.diagnostic)}}),n}function uR(t,e){let i=e.pos,n=e.end||i,r=t.state.facet(qo).hideOn(t,i,n);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(eP))||t.changes.touchesRange(s.from,Math.max(s.to,n)))}function cR(t,e){return t.field(yi,!1)?e:e.concat(We.appendConfig.of(SR))}const eP=We.define(),lm=We.define(),tP=We.define(),yi=Ut.define({create(){return new Er(Ze.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),n=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);n=ur(i,t.selected.diagnostic,s)||ur(i,null,s)}!i.size&&r&&e.state.facet(qo).autoPanel&&(r=null),t=new Er(i,r,n)}for(let i of e.effects)if(i.is(eP)){let n=e.state.facet(qo).autoPanel?i.value.length?Wo.open:null:t.panel;t=Er.init(i.value,n,e.state)}else i.is(lm)?t=new Er(t.diagnostics,i.value?Wo.open:null,t.selected):i.is(tP)&&(t=new Er(t.diagnostics,t.panel,i.value));return t},provide:t=>[Qo.from(t,e=>e.panel),_e.decorations.from(t,e=>e.diagnostics)]}),hR=Ze.mark({class:"cm-lintRange cm-lintRange-active"});function fR(t,e,i){let{diagnostics:n}=t.state.field(yi),r,s=-1,a=-1;n.between(e-(i<0?1:0),e+(i>0?1:0),(u,h,{spec:c})=>{if(e>=u&&e<=h&&(u==h||(e>u||i>0)&&(e<h||i<0)))return r=c.diagnostics,s=u,a=h,!1});let l=t.state.facet(qo).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:a,above:t.state.doc.lineAt(s).to<a,create(){return{dom:dR(t,r)}}}:null}function dR(t,e){return ct("ul",{class:"cm-tooltip-lint"},e.map(i=>nP(t,i,!1)))}const pR=t=>{let e=t.state.field(yi,!1);(!e||!e.panel)&&t.dispatch({effects:cR(t.state,[lm.of(!0)])});let i=Lp(t,Wo.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},iO=t=>{let e=t.state.field(yi,!1);return!e||!e.panel?!1:(t.dispatch({effects:lm.of(!1)}),!0)},mR=t=>{let e=t.state.field(yi,!1);if(!e)return!1;let i=t.state.selection.main,n=ur(e.diagnostics,null,i.to+1);return!n&&(n=ur(e.diagnostics,null,0),!n||n.from==i.from&&n.to==i.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},gR=[{key:"Mod-Shift-m",run:pR,preventDefault:!0},{key:"F8",run:mR}],qo=Me.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...mn(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:nO,tooltipFilter:nO,needsRefresh:(e,i)=>e?i?n=>e(n)||i(n):e:i,hideOn:(e,i)=>e?i?(n,r,s)=>e(n,r,s)||i(n,r,s):e:i,autoPanel:(e,i)=>e||i})}}});function nO(t,e){return t?e?(i,n)=>e(t(i,n),n):t:e}function iP(t){let e=[];if(t)e:for(let{name:i}of t){for(let n=0;n<i.length;n++){let r=i[n];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function nP(t,e,i){var n;let r=i?iP(e.actions):[];return ct("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},ct("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,a)=>{let l=!1,u=g=>{if(g.preventDefault(),l)return;l=!0;let b=ur(t.state.field(yi).diagnostics,e);b&&s.apply(t,b.from,b.to)},{name:h}=s,c=r[a]?h.indexOf(r[a]):-1,p=c<0?h:[h.slice(0,c),ct("u",h.slice(c,c+1)),h.slice(c+1)],v=s.markClass?" "+s.markClass:"";return ct("button",{type:"button",class:"cm-diagnosticAction"+v,onclick:u,onmousedown:u,"aria-label":` Action: ${h}${c<0?"":` (access key "${r[a]})"`}.`},p)}),e.source&&ct("div",{class:"cm-diagnosticSource"},e.source))}class yR extends Ri{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ct("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class rO{constructor(e,i){this.diagnostic=i,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=nP(e,i,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Wo{constructor(e){this.view=e,this.items=[];let i=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)iO(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],a=iP(s.actions);for(let l=0;l<a.length;l++)if(a[l].toUpperCase().charCodeAt(0)==r.keyCode){let u=ur(this.view.state.field(yi).diagnostics,s);u&&s.actions[l].apply(e,u.from,u.to)}}else return;r.preventDefault()}},n=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=ct("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:i,onclick:n}),this.dom=ct("div",{class:"cm-panel-lint"},this.list,ct("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>iO(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(yi).selected;if(!e)return-1;for(let i=0;i<this.items.length;i++)if(this.items[i].diagnostic==e.diagnostic)return i;return-1}update(){let{diagnostics:e,selected:i}=this.view.state.field(yi),n=0,r=!1,s=null,a=new Set;for(e.between(0,this.view.state.doc.length,(l,u,{spec:h})=>{for(let c of h.diagnostics){if(a.has(c))continue;a.add(c);let p=-1,v;for(let g=n;g<this.items.length;g++)if(this.items[g].diagnostic==c){p=g;break}p<0?(v=new rO(this.view,c),this.items.splice(n,0,v),r=!0):(v=this.items[p],p>n&&(this.items.splice(n,p-n),r=!0)),i&&v.diagnostic==i.diagnostic?v.dom.hasAttribute("aria-selected")||(v.dom.setAttribute("aria-selected","true"),s=v):v.dom.hasAttribute("aria-selected")&&v.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new rO(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:u})=>{let h=u.height/this.list.offsetHeight;l.top<u.top?this.list.scrollTop-=(u.top-l.top)/h:l.bottom>u.bottom&&(this.list.scrollTop+=(l.bottom-u.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function i(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)i();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)i()}moveSelection(e){if(this.selectedIndex<0)return;let i=this.view.state.field(yi),n=ur(i.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:tP.of(n)})}static open(e){return new Wo(e)}}function vR(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function fu(t){return vR(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const OR=_e.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:fu("#d11")},".cm-lintRange-warning":{backgroundImage:fu("orange")},".cm-lintRange-info":{backgroundImage:fu("#999")},".cm-lintRange-hint":{backgroundImage:fu("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function xR(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function bR(t){let e="hint",i=1;for(let n of t){let r=xR(n.severity);r>i&&(i=r,e=n.severity)}return e}const SR=[yi,_e.decorations.compute([yi],t=>{let{selected:e,panel:i}=t.field(yi);return!e||!i||e.from==e.to?Ze.none:Ze.set([hR.range(e.from,e.to)])}),nB(fR,{hideOn:uR}),OR],wR=[gB(),OB(),IL(),MQ(),oQ(),bL(),CL(),rt.allowMultipleSelections.of(!0),WB(),HS(hQ,{fallback:!0}),vQ(),G4(),oR(),UL(),YL(),QL(),XF(),ol.of([...eR,...LF,...u4,...jQ,...nQ,...Kw,...gR])];var PR=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[wR]}),TR=Symbol("vue-codemirror-global-config"),Ht,CR=function(t){var e=t.onUpdate,i=t.onChange,n=t.onFocus,r=t.onBlur,s=(function(a,l){var u={};for(var h in a)Object.prototype.hasOwnProperty.call(a,h)&&l.indexOf(h)<0&&(u[h]=a[h]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function"){var c=0;for(h=Object.getOwnPropertySymbols(a);c<h.length;c++)l.indexOf(h[c])<0&&Object.prototype.propertyIsEnumerable.call(a,h[c])&&(u[h[c]]=a[h[c]])}return u})(t,["onUpdate","onChange","onFocus","onBlur"]);return rt.create({doc:s.doc,selection:s.selection,extensions:(Array.isArray(s.extensions)?s.extensions:[s.extensions]).concat([_e.updateListener.of((function(a){e(a),a.docChanged&&i(a.state.doc.toString(),a),a.focusChanged&&(a.view.hasFocus?n(a):r(a))}))])})},os=function(t){var e=new nl;return{compartment:e,run:function(i){e.get(t.state)?t.dispatch({effects:e.reconfigure(i)}):t.dispatch({effects:We.appendConfig.of(e.of(i))})}}},sO=function(t,e){var i=os(t),n=i.compartment,r=i.run;return function(s){var a=n.get(t.state);r(s??a!==e?e:[])}},du={type:Boolean,default:void 0},kR={autofocus:du,disabled:du,indentWithTab:du,tabSize:Number,placeholder:String,style:Object,autoDestroy:du,phrases:Object,root:Object,extensions:Array,selection:Object},ER={modelValue:{type:String,default:""}},AR=Object.assign(Object.assign({},kR),ER);(function(t){t.Change="change",t.Update="update",t.Focus="focus",t.Blur="blur",t.Ready="ready",t.ModelUpdate="update:modelValue"})(Ht||(Ht={}));var Ar={};Ar[Ht.Change]=function(t,e){return!0},Ar[Ht.Update]=function(t){return!0},Ar[Ht.Focus]=function(t){return!0},Ar[Ht.Blur]=function(t){return!0},Ar[Ht.Ready]=function(t){return!0};var rP={};rP[Ht.ModelUpdate]=Ar[Ht.Change];var DR=Object.assign(Object.assign({},Ar),rP),_R=ot({name:"VueCodemirror",props:Object.assign({},AR),emits:Object.assign({},DR),setup:function(t,e){var i=Mi(),n=Mi(),r=Mi(),s=Object.assign(Object.assign({},PR),cr(TR,{})),a=Fe((function(){var l={};return Object.keys(cT(t)).forEach((function(u){var h;u!=="modelValue"&&(l[u]=(h=t[u])!==null&&h!==void 0?h:s[u])})),l}));return fn((function(){var l;n.value=CR({doc:t.modelValue,selection:a.value.selection,extensions:(l=s.extensions)!==null&&l!==void 0?l:[],onFocus:function(h){return e.emit(Ht.Focus,h)},onBlur:function(h){return e.emit(Ht.Blur,h)},onUpdate:function(h){return e.emit(Ht.Update,h)},onChange:function(h,c){h!==t.modelValue&&(e.emit(Ht.Change,h,c),e.emit(Ht.ModelUpdate,h,c))}}),r.value=(function(h){return new _e(Object.assign({},h))})({state:n.value,parent:i.value,root:a.value.root});var u=(function(h){var c=function(){return h.state.doc.toString()},p=os(h).run,v=sO(h,[_e.editable.of(!1),rt.readOnly.of(!0)]),g=sO(h,ol.of([BF])),b=os(h).run,m=os(h).run,x=os(h).run,O=os(h).run;return{focus:function(){return h.focus()},getDoc:c,setDoc:function(P){P!==c()&&h.dispatch({changes:{from:0,to:h.state.doc.length,insert:P}})},reExtensions:p,toggleDisabled:v,toggleIndentWithTab:g,setTabSize:function(P){b([rt.tabSize.of(P),ll.of(" ".repeat(P))])},setPhrases:function(P){m([rt.phrases.of(P)])},setPlaceholder:function(P){x(XL(P))},setStyle:function(P){P===void 0&&(P={}),O(_e.theme({"&":Object.assign({},P)}))}}})(r.value);Ge((function(){return t.modelValue}),(function(h){h!==u.getDoc()&&u.setDoc(h)})),Ge((function(){return t.extensions}),(function(h){return u.reExtensions(h||[])}),{immediate:!0}),Ge((function(){return a.value.disabled}),(function(h){return u.toggleDisabled(h)}),{immediate:!0}),Ge((function(){return a.value.indentWithTab}),(function(h){return u.toggleIndentWithTab(h)}),{immediate:!0}),Ge((function(){return a.value.tabSize}),(function(h){return u.setTabSize(h)}),{immediate:!0}),Ge((function(){return a.value.phrases}),(function(h){return u.setPhrases(h||{})}),{immediate:!0}),Ge((function(){return a.value.placeholder}),(function(h){return u.setPlaceholder(h)}),{immediate:!0}),Ge((function(){return a.value.style}),(function(h){return u.setStyle(h)}),{immediate:!0}),a.value.autofocus&&u.focus(),e.emit(Ht.Ready,{state:n.value,view:r.value,container:i.value})})),jd((function(){a.value.autoDestroy&&r.value&&(function(l){l.destroy()})(r.value)})),function(){return ut("div",{class:"v-codemirror",style:{display:"contents"},ref:i})}}}),IR=_R,aO={};class wc{constructor(e,i,n,r,s,a,l,u,h,c=0,p){this.p=e,this.stack=i,this.state=n,this.reducePos=r,this.pos=s,this.score=a,this.buffer=l,this.bufferBase=u,this.curContext=h,this.lookAhead=c,this.parent=p}toString(){return`[${this.stack.filter((e,i)=>i%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,i,n=0){let r=e.parser.context;return new wc(e,[],i,n,n,0,[],0,r?new oO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,i){this.stack.push(this.state,i,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var i;let n=e>>19,r=e&65535,{parser:s}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),n==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(r,this.reducePos);return}let u=this.stack.length-(n-1)*3-(e&262144?6:0),h=u?this.stack[u-2]:this.p.ranges[0].from,c=this.reducePos-h;c>=2e3&&!(!((i=this.p.parser.nodeSet.types[r])===null||i===void 0)&&i.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=c));let p=u?this.stack[u-1]:0,v=this.bufferBase+this.buffer.length-p;if(r<s.minRepeatTerm||e&131072){let g=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,h,g,v+4,!0)}if(e&262144)this.state=this.stack[u];else{let g=this.stack[u-3];this.state=s.getGoto(g,r,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,i,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,l=this.buffer.length;if(l==0&&a.parent&&(l=a.bufferBase-a.parent.bufferBase,a=a.parent),l>0&&a.buffer[l-4]==0&&a.buffer[l-1]>-1){if(i==n)return;if(a.buffer[l-2]>=i){a.buffer[l-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,i,n,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let u=a;u>0&&this.buffer[u-2]>n;u-=4)if(this.buffer[u-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>n;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=e,this.buffer[a+1]=i,this.buffer[a+2]=n,this.buffer[a+3]=r}}shift(e,i,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:a}=this.p;this.pos=r;let l=a.stateFlag(s,1);!l&&(r>n||i<=a.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(i,n),i<=a.maxNode&&this.buffer.push(i,n,r,4)}else this.pos=r,this.shiftContext(i,n),i<=this.p.parser.maxNode&&this.buffer.push(i,n,r,4)}apply(e,i,n,r){e&65536?this.reduce(e):this.shift(e,i,n,r)}useNode(e,i){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(i,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,i=e.buffer.length;for(;i>0&&e.buffer[i-2]>e.reducePos;)i-=4;let n=e.buffer.slice(i),r=e.bufferBase+i;for(;e&&r==e.bufferBase;)e=e.parent;return new wc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,i){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,i,4),this.storeNode(0,this.pos,i,n?8:4),this.pos=this.reducePos=i,this.score-=190}canShift(e){for(let i=new NR(this);;){let n=this.p.parser.stateSlot(i.state,4)||this.p.parser.hasAction(i.state,e);if(n==0)return!1;if((n&65536)==0)return!0;i.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let i=this.p.parser.nextStates(this.state);if(i.length>8||this.stack.length>=120){let r=[];for(let s=0,a;s<i.length;s+=2)(a=i[s+1])!=this.state&&this.p.parser.hasAction(a,e)&&r.push(i[s],a);if(this.stack.length<120)for(let s=0;r.length<8&&s<i.length;s+=2){let a=i[s+1];r.some((l,u)=>u&1&&l==a)||r.push(i[s],a)}i=r}let n=[];for(let r=0;r<i.length&&n.length<4;r+=2){let s=i[r+1];if(s==this.state)continue;let a=this.split();a.pushState(s,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(i[r],this.pos),a.reducePos=this.pos,a.score-=200,n.push(a)}return n}forceReduce(){let{parser:e}=this.p,i=e.stateSlot(this.state,5);if((i&65536)==0)return!1;if(!e.validAction(this.state,i)){let n=i>>19,r=i&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;i=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(i),!0}findForcedReduction(){let{parser:e}=this.p,i=[],n=(r,s)=>{if(!i.includes(r))return i.push(r),e.allActions(r,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-s;if(l>1){let u=a&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],u,!1)>=0)return l<<19|65536|u}}else{let l=n(a,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let i=0;i<this.stack.length;i+=3)if(this.stack[i]!=e.stack[i])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(i)))}reduceContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(i)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let i=new oO(this.curContext.tracker,e);i.hash!=this.curContext.hash&&this.emitContext(),this.curContext=i}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class oO{constructor(e,i){this.tracker=e,this.context=i,this.hash=e.strict?e.hash(i):0}}class NR{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let i=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],i,!0);this.state=r}}class Pc{constructor(e,i,n){this.stack=e,this.pos=i,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,i=e.bufferBase+e.buffer.length){return new Pc(e,i,i-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Pc(this.stack,this.pos,this.index)}}function to(t,e=Uint16Array){if(typeof t!="string")return t;let i=null;for(let n=0,r=0;n<t.length;){let s=0;for(;;){let a=t.charCodeAt(n++),l=!1;if(a==126){s=65535;break}a>=92&&a--,a>=34&&a--;let u=a-32;if(u>=46&&(u-=46,l=!0),s+=u,l)break;s*=46}i?i[r++]=s:i=new e(s)}return i}class Iu{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const lO=new Iu;class MR{constructor(e,i){this.input=e,this.ranges=i,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=lO,this.rangeIndex=0,this.pos=this.chunkPos=i[0].from,this.range=i[0],this.end=i[i.length-1].to,this.readNext()}resolveOffset(e,i){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<n.from;){if(!r)return null;let a=this.ranges[--r];s-=n.from-a.to,n=a}for(;i<0?s>n.to:s>=n.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];s+=a.from-n.to,n=a}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let i of this.ranges)if(i.to>e)return Math.max(e,i.from);return this.end}peek(e){let i=this.chunkOff+e,n,r;if(i>=0&&i<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(i);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let a=this.rangeIndex,l=this.range;for(;l.to<=n;)l=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,i=0){let n=i?this.resolveOffset(i,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,i){this.token.value=e,this.token.end=i}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:i}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=i,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),i=this.pos+e.length;this.chunk=i>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,i){if(i?(this.token=i,i.start=e,i.lookAhead=e+1,i.value=i.extended=-1):this.token=lO,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,i){if(e>=this.chunkPos&&i<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,i-this.chunkPos);if(e>=this.chunk2Pos&&i<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,i-this.chunk2Pos);if(e>=this.range.from&&i<=this.range.to)return this.input.read(e,i);let n="";for(let r of this.ranges){if(r.from>=i)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,i)))}return n}}class ws{constructor(e,i){this.data=e,this.id=i}token(e,i){let{parser:n}=i.p;sP(this.data,e,i,this.id,n.data,n.tokenPrecTable)}}ws.prototype.contextual=ws.prototype.fallback=ws.prototype.extend=!1;class Fd{constructor(e,i,n){this.precTable=i,this.elseToken=n,this.data=typeof e=="string"?to(e):e}token(e,i){let n=e.pos,r=0;for(;;){let s=e.next<0,a=e.resolveOffset(1,1);if(sP(this.data,e,i,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,a==null)break;e.reset(a,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Fd.prototype.contextual=ws.prototype.fallback=ws.prototype.extend=!1;class pl{constructor(e,i={}){this.token=e,this.contextual=!!i.contextual,this.fallback=!!i.fallback,this.extend=!!i.extend}}function sP(t,e,i,n,r,s){let a=0,l=1<<n,{dialect:u}=i.p.parser;e:for(;(l&t[a])!=0;){let h=t[a+1];for(let g=a+3;g<h;g+=2)if((t[g+1]&l)>0){let b=t[g];if(u.allows(b)&&(e.token.value==-1||e.token.value==b||$R(b,e.token.value,r,s))){e.acceptToken(b);break}}let c=e.next,p=0,v=t[a+2];if(e.next<0&&v>p&&t[h+v*3-3]==65535){a=t[h+v*3-1];continue e}for(;p<v;){let g=p+v>>1,b=h+g+(g<<1),m=t[b],x=t[b+1]||65536;if(c<m)v=g;else if(c>=x)p=g+1;else{a=t[b+2],e.advance();continue e}}break}}function uO(t,e,i){for(let n=e,r;(r=t[n])!=65535;n++)if(r==i)return n-e;return-1}function $R(t,e,i,n){let r=uO(i,n,e);return r<0||uO(i,n,t)<r}const mi=typeof process<"u"&&aO&&/\bparse\b/.test(aO.LOG);let gf=null;function cO(t,e,i){let n=t.cursor(Pt.IncludeAnonymous);for(n.moveTo(e);;)if(!(i<0?n.childBefore(e):n.childAfter(e)))for(;;){if((i<0?n.to<e:n.from>e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class LR{constructor(e,i){this.fragments=e,this.nodeSet=i,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?cO(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?cO(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let i=this.trees.length-1;if(i<0)return this.nextFragment(),null;let n=this.trees[i],r=this.index[i];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[r],a=this.start[i]+n.positions[r];if(a>e)return this.nextStart=a,null;if(s instanceof _t){if(a==e){if(a<this.safeFrom)return null;let l=a+s.length;if(l<=this.safeTo){let u=s.prop(Ke.lookAhead);if(!u||l+u<this.fragment.to)return s}}this.index[i]++,a+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[i]++,this.nextStart=a+s.length}}}class BR{constructor(e,i){this.stream=i,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Iu)}getActions(e){let i=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,a=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,u=0;for(let h=0;h<s.length;h++){if((1<<h&a)==0)continue;let c=s[h],p=this.tokens[h];if(!(n&&!c.fallback)&&((c.contextual||p.start!=e.pos||p.mask!=a||p.context!=l)&&(this.updateCachedToken(p,c,e),p.mask=a,p.context=l),p.lookAhead>p.end+25&&(u=Math.max(p.lookAhead,u)),p.value!=0)){let v=i;if(p.extended>-1&&(i=this.addActions(e,p.extended,p.end,i)),i=this.addActions(e,p.value,p.end,i),!c.extend&&(n=p,i>v))break}}for(;this.actions.length>i;)this.actions.pop();return u&&e.setLookAhead(u),!n&&e.pos==this.stream.end&&(n=new Iu,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,i=this.addActions(e,n.value,n.end,i)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let i=new Iu,{pos:n,p:r}=e;return i.start=n,i.end=Math.min(n+1,r.stream.end),i.value=n==r.stream.end?r.parser.eofTerm:0,i}updateCachedToken(e,i,n){let r=this.stream.clipPos(n.pos);if(i.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let a=0;a<s.specialized.length;a++)if(s.specialized[a]==e.value){let l=s.specializers[a](this.stream.read(e.start,e.end),n);if(l>=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,i,n,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=i,this.actions[r++]=n,r}addActions(e,i,n,r){let{state:s}=e,{parser:a}=e.p,{data:l}=a;for(let u=0;u<2;u++)for(let h=a.stateSlot(s,u?2:1);;h+=3){if(l[h]==65535)if(l[h+1]==1)h=wn(l,h+2);else{r==0&&l[h+1]==2&&(r=this.putAction(wn(l,h+2),i,n,r));break}l[h]==i&&(r=this.putAction(wn(l,h+1),i,n,r))}return r}}class QR{constructor(e,i,n,r){this.parser=e,this.input=i,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new MR(i,r),this.tokens=new BR(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[wc.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new LR(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,i=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let l=e[a];for(;;){if(this.tokens.mainToken=null,l.pos>i)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let u=this.tokens.getMainToken(l);s.push(u.value,u.end)}}break}}if(!n.length){let a=r&&zR(r);if(a)return mi&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw mi&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(a)return mi&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(n.length>a)for(n.sort((l,u)=>u.score-l.score);n.length>a;)n.pop();n.some(l=>l.reducePos>i)&&this.recovering--}else if(n.length>1){e:for(let a=0;a<n.length-1;a++){let l=n[a];for(let u=a+1;u<n.length;u++){let h=n[u];if(l.sameState(h)||l.buffer.length>500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(u--,1);else{n.splice(a--,1);continue e}}}n.length>12&&(n.sort((a,l)=>l.score-a.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let a=1;a<n.length;a++)n[a].pos<this.minStackPos&&(this.minStackPos=n[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,i,n){let r=e.pos,{parser:s}=this,a=mi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let p=this.fragments.nodeAt(r);p;){let v=this.parser.nodeSet.types[p.type.id]==p.type?s.getGoto(e.state,p.type.id):-1;if(v>-1&&p.length&&(!h||(p.prop(Ke.contextHash)||0)==c))return e.useNode(p,v),mi&&console.log(a+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof _t)||p.children.length==0||p.positions[0]>0)break;let g=p.children[0];if(g instanceof _t&&p.positions[0]==0)p=g;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),mi&&console.log(a+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let h=0;h<u.length;){let c=u[h++],p=u[h++],v=u[h++],g=h==u.length||!n,b=g?e:e.split(),m=this.tokens.mainToken;if(b.apply(c,p,m?m.start:b.pos,v),mi&&console.log(a+this.stackID(b)+` (via ${(c&65536)==0?"shift":`reduce of ${s.getName(c&65535)}`} for ${s.getName(p)} @ ${r}${b==e?"":", split"})`),g)return!0;b.pos>r?i.push(b):n.push(b)}return!1}advanceFully(e,i){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return hO(e,i),!0}}runRecovery(e,i,n){let r=null,s=!1;for(let a=0;a<e.length;a++){let l=e[a],u=i[a<<1],h=i[(a<<1)+1],c=mi?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),mi&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let p=l.split(),v=c;for(let g=0;g<10&&p.forceReduce()&&(mi&&console.log(v+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,n));g++)mi&&(v=this.stackID(p)+" -> ");for(let g of l.recoverByInsert(u))mi&&console.log(c+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,n);this.stream.end>l.pos?(h==l.pos&&(h++,u=0),l.recoverByDelete(u,h),mi&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(u)})`),hO(l,n)):(!r||r.score<p.score)&&(r=p)}return r}stackToTree(e){return e.close(),_t.build({buffer:Pc.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let i=(gf||(gf=new WeakMap)).get(e);return i||gf.set(e,i=String.fromCodePoint(this.nextStackID++)),i+e}}function hO(t,e){for(let i=0;i<e.length;i++){let n=e[i];if(n.pos==t.pos&&n.sameState(t)){e[i].score<t.score&&(e[i]=t);return}}e.push(t)}class FR{constructor(e,i,n){this.source=e,this.flags=i,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const yf=t=>t;class RR{constructor(e){this.start=e.start,this.shift=e.shift||yf,this.reduce=e.reduce||yf,this.reuse=e.reuse||yf,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Yo extends MS{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let i=e.nodeNames.split(" ");this.minRepeatTerm=i.length;for(let l=0;l<e.repeatNodeCount;l++)i.push("");let n=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<i.length;l++)r.push([]);function s(l,u,h){r[l].push([u,u.deserialize(String(h))])}if(e.nodeProps)for(let l of e.nodeProps){let u=l[0];typeof u=="string"&&(u=Ke[u]);for(let h=1;h<l.length;){let c=l[h++];if(c>=0)s(c,u,l[h++]);else{let p=l[h+-c];for(let v=-c;v>0;v--)s(l[h++],u,p);h++}}}this.nodeSet=new Bp(i.map((l,u)=>di.define({name:u>=this.minRepeatTerm?void 0:l,id:u,props:r[u],top:n.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=DS;let a=to(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(fO),this.states=to(e.states,Uint32Array),this.data=to(e.stateData),this.goto=to(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new ws(a,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,i,n){let r=new QR(this,e,i,n);for(let s of this.wrappers)r=s(r,e,i,n);return r}getGoto(e,i,n=!1){let r=this.goto;if(i>=r[0])return-1;for(let s=r[i+1];;){let a=r[s++],l=a&1,u=r[s++];if(l&&n)return u;for(let h=s+(a>>1);s<h;s++)if(r[s]==e)return u;if(l)return-1}}hasAction(e,i){let n=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),a;;s+=3){if((a=n[s])==65535)if(n[s+1]==1)a=n[s=wn(n,s+2)];else{if(n[s+1]==2)return wn(n,s+2);break}if(a==i||a==0)return wn(n,s+1)}return 0}stateSlot(e,i){return this.states[e*6+i]}stateFlag(e,i){return(this.stateSlot(e,0)&i)>0}validAction(e,i){return!!this.allActions(e,n=>n==i?!0:null)}allActions(e,i){let n=this.stateSlot(e,4),r=n?i(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=wn(this.data,s+2);else break;r=i(wn(this.data,s+1))}return r}nextStates(e){let i=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=wn(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];i.some((s,a)=>a&1&&s==r)||i.push(this.data[n],r)}}return i}configure(e){let i=Object.assign(Object.create(Yo.prototype),this);if(e.props&&(i.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);i.top=n}return e.tokenizers&&(i.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(i.specializers=this.specializers.slice(),i.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let a=Object.assign(Object.assign({},n),{external:s.to});return i.specializers[r]=fO(a),a})),e.contextTracker&&(i.context=e.contextTracker),e.dialect&&(i.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(i.strict=e.strict),e.wrap&&(i.wrappers=i.wrappers.concat(e.wrap)),e.bufferLength!=null&&(i.bufferLength=e.bufferLength),i}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let i=this.dynamicPrecedences;return i==null?0:i[e]||0}parseDialect(e){let i=Object.keys(this.dialects),n=i.map(()=>!1);if(e)for(let s of e.split(" ")){let a=i.indexOf(s);a>=0&&(n[a]=!0)}let r=null;for(let s=0;s<i.length;s++)if(!n[s])for(let a=this.dialects[i[s]],l;(l=this.data[a++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new FR(e,n,r)}static deserialize(e){return new Yo(e)}}function wn(t,e){return t[e]|t[e+1]<<16}function zR(t){let e=null;for(let i of t){let n=i.p.stoppedAt;(i.pos==i.p.stream.end||n!=null&&i.pos>n)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.score<i.score)&&(e=i)}return e}function fO(t){if(t.external){let e=t.extend?1:0;return(i,n)=>t.external(i,n)<<1|e}return t.get}const XR=316,jR=317,dO=1,ZR=2,VR=3,UR=4,qR=318,WR=320,YR=321,GR=5,HR=6,JR=0,Rd=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],aP=125,KR=59,zd=47,e8=42,t8=43,i8=45,n8=60,r8=44,s8=63,a8=46,o8=91,l8=new RR({start:!1,shift(t,e){return e==GR||e==HR||e==WR?t:e==YR},strict:!1}),u8=new pl((t,e)=>{let{next:i}=t;(i==aP||i==-1||e.context)&&t.acceptToken(qR)},{contextual:!0,fallback:!0}),c8=new pl((t,e)=>{let{next:i}=t,n;Rd.indexOf(i)>-1||i==zd&&((n=t.peek(1))==zd||n==e8)||i!=aP&&i!=KR&&i!=-1&&!e.context&&t.acceptToken(XR)},{contextual:!0}),h8=new pl((t,e)=>{t.next==o8&&!e.context&&t.acceptToken(jR)},{contextual:!0}),f8=new pl((t,e)=>{let{next:i}=t;if(i==t8||i==i8){if(t.advance(),i==t.next){t.advance();let n=!e.context&&e.canShift(dO);t.acceptToken(n?dO:ZR)}}else i==s8&&t.peek(1)==a8&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(VR))},{contextual:!0});function vf(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const d8=new pl((t,e)=>{if(t.next!=n8||!e.dialectEnabled(JR)||(t.advance(),t.next==zd))return;let i=0;for(;Rd.indexOf(t.next)>-1;)t.advance(),i++;if(vf(t.next,!0)){for(t.advance(),i++;vf(t.next,!1);)t.advance(),i++;for(;Rd.indexOf(t.next)>-1;)t.advance(),i++;if(t.next==r8)return;for(let n=0;;n++){if(n==7){if(!vf(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),i++}}t.acceptToken(UR,-i)}),p8=zp({"get set async static":ne.modifier,"for while do if else switch try catch finally return throw break continue default case defer":ne.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":ne.operatorKeyword,"let var const using function class extends":ne.definitionKeyword,"import export from":ne.moduleKeyword,"with debugger new":ne.keyword,TemplateString:ne.special(ne.string),super:ne.atom,BooleanLiteral:ne.bool,this:ne.self,null:ne.null,Star:ne.modifier,VariableName:ne.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ne.function(ne.variableName),VariableDefinition:ne.definition(ne.variableName),Label:ne.labelName,PropertyName:ne.propertyName,PrivatePropertyName:ne.special(ne.propertyName),"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),"FunctionDeclaration/VariableDefinition":ne.function(ne.definition(ne.variableName)),"ClassDeclaration/VariableDefinition":ne.definition(ne.className),"NewExpression/VariableName":ne.className,PropertyDefinition:ne.definition(ne.propertyName),PrivatePropertyDefinition:ne.definition(ne.special(ne.propertyName)),UpdateOp:ne.updateOperator,"LineComment Hashbang":ne.lineComment,BlockComment:ne.blockComment,Number:ne.number,String:ne.string,Escape:ne.escape,ArithOp:ne.arithmeticOperator,LogicOp:ne.logicOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,RegExp:ne.regexp,Equals:ne.definitionOperator,Arrow:ne.function(ne.punctuation),": Spread":ne.punctuation,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,"InterpolationStart InterpolationEnd":ne.special(ne.brace),".":ne.derefOperator,", ;":ne.separator,"@":ne.meta,TypeName:ne.typeName,TypeDefinition:ne.definition(ne.typeName),"type enum interface implements namespace module declare":ne.definitionKeyword,"abstract global Privacy readonly override":ne.modifier,"is keyof unique infer asserts":ne.operatorKeyword,JSXAttributeValue:ne.attributeValue,JSXText:ne.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ne.angleBracket,"JSXIdentifier JSXNameSpacedName":ne.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ne.attributeName,"JSXBuiltin/JSXIdentifier":ne.standard(ne.tagName)}),m8={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},g8={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},y8={__proto__:null,"<":193},v8=Yo.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hOTX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WOPP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:l8,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[p8],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[c8,h8,f8,d8,2,3,4,5,6,7,8,9,10,11,12,13,14,u8,new Fd("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Fd("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>m8[t]||-1},{term:343,get:t=>g8[t]||-1},{term:95,get:t=>y8[t]||-1}],tokenPrec:15201}),oP=[ii("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ii("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ii("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ii("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ii("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ii(`try {
|
|
204
|
+
\${}
|
|
205
|
+
} catch (\${error}) {
|
|
206
|
+
\${}
|
|
207
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),ii("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),ii(`if (\${}) {
|
|
208
|
+
\${}
|
|
209
|
+
} else {
|
|
210
|
+
\${}
|
|
211
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),ii(`class \${name} {
|
|
212
|
+
constructor(\${params}) {
|
|
213
|
+
\${}
|
|
214
|
+
}
|
|
215
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),ii('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ii('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],O8=oP.concat([ii("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ii("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ii("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),pO=new CB,lP=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function va(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const x8=["FunctionDeclaration"],b8={FunctionDeclaration:va("function"),ClassDeclaration:va("class"),ClassExpression:()=>!0,EnumDeclaration:va("constant"),TypeAliasDeclaration:va("type"),NamespaceDeclaration:va("namespace"),VariableDefinition(t,e){t.matchContext(x8)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function uP(t,e){let i=pO.get(e);if(i)return i;let n=[],r=!0;function s(a,l){let u=t.sliceString(a.from,a.to);n.push({label:u,type:l})}return e.cursor(Pt.IncludeAnonymous).iterate(a=>{if(r)r=!1;else if(a.name){let l=b8[a.name];if(l&&l(a,s)||lP.has(a.name))return!1}else if(a.to-a.from>8192){for(let l of uP(t,a.node))n.push(l);return!1}}),pO.set(e,n),n}const mO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,cP=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function S8(t){let e=Qt(t.state).resolveInner(t.pos,-1);if(cP.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&mO.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let r=e;r;r=r.parent)lP.has(r.name)&&(n=n.concat(uP(t.state.doc,r)));return{options:n,from:i?e.from:t.pos,validFor:mO}}const zr=zo.define({name:"javascript",parser:v8.configure({props:[Zp.add({IfStatement:mo({except:/^\s*({|else\b)/}),TryStatement:mo({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:UB,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:VB({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":mo({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Up.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":XS,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let i=t.lastChild;return{from:e.to,to:i.type.isError?t.to:i.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let i=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,n=t.lastChild;return!i||i.type.isError?null:{from:i.to,to:n.type.isError?t.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),hP={test:t=>/^JSX/.test(t.name),facet:BS({commentTokens:{block:{open:"{/*",close:"*/}"}}})},w8=zr.configure({dialect:"ts"},"typescript"),P8=zr.configure({dialect:"jsx",props:[Xp.add(t=>t.isTop?[hP]:void 0)]}),T8=zr.configure({dialect:"jsx ts",props:[Xp.add(t=>t.isTop?[hP]:void 0)]},"typescript");let fP=t=>({label:t,type:"keyword"});const dP="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(fP),C8=dP.concat(["declare","implements","private","protected","public"].map(fP));function k8(t={}){let e=t.jsx?t.typescript?T8:P8:t.typescript?w8:zr,i=t.typescript?O8.concat(C8):oP.concat(dP);return new FS(e,[zr.data.of({autocomplete:p4(cP,Zw(i))}),zr.data.of({autocomplete:S8}),t.jsx?D8:[]])}function E8(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function gO(t,e,i=t.length){for(let n=e?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,i));return""}const A8=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),D8=_e.inputHandler.of((t,e,i,n,r)=>{if((A8?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||n!=">"&&n!="/"||!zr.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(u=>{var h;let{head:c}=u,p=Qt(a).resolveInner(c-1,-1),v;if(p.name=="JSXStartTag"&&(p=p.parent),!(a.doc.sliceString(c-1,c)!=n||p.name=="JSXAttributeValue"&&p.to>c)){if(n==">"&&p.name=="JSXFragmentTag")return{range:u,changes:{from:c,insert:"</>"}};if(n=="/"&&p.name=="JSXStartCloseTag"){let g=p.parent,b=g.parent;if(b&&g.from==c-2&&((v=gO(a.doc,b.firstChild,c))||((h=b.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let m=`${v}>`;return{range:Oe.cursor(c+m.length,-1),changes:{from:c,insert:m}}}}else if(n==">"){let g=E8(p);if(g&&g.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(c,c+2))&&(v=gO(a.doc,g,c)))return{range:u,changes:{from:c,insert:`</${v}>`}}}}return{range:u}});return l.changes.empty?!1:(t.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),_8=zp({String:ne.string,Number:ne.number,"True False":ne.bool,PropertyName:ne.propertyName,Null:ne.null,", :":ne.separator,"[ ]":ne.squareBracket,"{ }":ne.brace}),I8=Yo.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[_8],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),N8=zo.define({name:"json",parser:I8.configure({props:[Zp.add({Object:mo({except:/^\s*\}/}),Array:mo({except:/^\s*\]/})}),Up.add({"Object Array":XS})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function M8(){return new FS(N8)}const $8="#e5c07b",yO="#e06c75",L8="#56b6c2",B8="#ffffff",Nu="#abb2bf",Xd="#7d8799",Q8="#61afef",F8="#98c379",vO="#d19a66",R8="#c678dd",z8="#21252b",OO="#2c313a",xO="#282c34",Of="#353a42",X8="#3E4451",bO="#528bff",j8=_e.theme({"&":{color:Nu,backgroundColor:xO},".cm-content":{caretColor:bO},".cm-cursor, .cm-dropCursor":{borderLeftColor:bO},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:X8},".cm-panels":{backgroundColor:z8,color:Nu},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:xO,color:Xd,border:"none"},".cm-activeLineGutter":{backgroundColor:OO},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Of},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Of,borderBottomColor:Of},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:OO,color:Nu}}},{dark:!0}),Z8=cl.define([{tag:ne.keyword,color:R8},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:yO},{tag:[ne.function(ne.variableName),ne.labelName],color:Q8},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:vO},{tag:[ne.definition(ne.name),ne.separator],color:Nu},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:$8},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:L8},{tag:[ne.meta,ne.comment],color:Xd},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:Xd,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:yO},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:vO},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:F8},{tag:ne.invalid,color:B8}]),V8=[j8,HS(Z8)],go=ot({__name:"CodeEditor",props:{modelValue:{},language:{default:"typescript"},readonly:{type:Boolean,default:!1},placeholder:{default:""},minHeight:{default:"100px"}},emits:["update:modelValue"],setup(t,{emit:e}){const i=t,n=e,r=Fe(()=>{const a=[i.language==="json"?M8():k8({typescript:!0}),V8,_e.theme({"&":{backgroundColor:"var(--color-surface-base, #0f172a)",minHeight:i.minHeight},".cm-gutters":{backgroundColor:"var(--color-surface-base, #0f172a)",borderRight:"1px solid var(--color-border-default)",color:"var(--color-text-muted)"},".cm-activeLineGutter":{backgroundColor:"color-mix(in srgb, var(--color-accent) 10%, transparent)"},".cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--color-accent) 5%, transparent)"},"&.cm-focused":{outline:"none"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:"color-mix(in srgb, var(--color-accent) 20%, transparent) !important"},".cm-content":{caretColor:"var(--color-accent)"}}),_e.lineWrapping];return i.readonly&&a.push(_e.editable.of(!1)),a});function s(a){n("update:modelValue",a)}return(a,l)=>(ye(),Ct(Se(IR),{"model-value":t.modelValue,extensions:r.value,placeholder:t.placeholder,style:hi({minHeight:t.minHeight,fontSize:"12px",borderRadius:"6px",overflow:"hidden",border:"1px solid var(--color-border-default)"}),"onUpdate:modelValue":s},null,8,["model-value","extensions","placeholder","style"]))}}),U8={class:"ai-diff"},q8={key:0,class:"diff-explanation"},W8={class:"diff-code"},Y8={class:"diff-actions"},G8=ot({__name:"AiDiffView",props:{oldCode:{},newCode:{},explanation:{}},emits:["accept","dismiss"],setup(t){const e=t,i=Fe(()=>PT(e.oldCode,e.newCode));return(n,r)=>(ye(),be("div",U8,[t.explanation?(ye(),be("div",q8,Te(t.explanation),1)):Qe("",!0),he("div",W8,[(ye(!0),be(gt,null,Jt(i.value,(s,a)=>(ye(),be("div",{key:a,class:bt(["diff-line",{added:s.added,removed:s.removed}])},Te(s.value),3))),128))]),he("div",Y8,[he("button",{class:"diff-accept",onClick:r[0]||(r[0]=s=>n.$emit("accept"))},Te(n.$t("tools.aiDiff.accept")),1),he("button",{class:"diff-dismiss",onClick:r[1]||(r[1]=s=>n.$emit("dismiss"))},Te(n.$t("tools.aiDiff.dismiss")),1)])]))}}),H8=AO(G8,[["__scopeId","data-v-01c9471b"]]),J8={class:"block-header"},K8={class:"block-badge"},e6=["value","placeholder"],t6=["disabled","title"],i6=["disabled","title"],n6={key:0,class:"thinking-bar nodrag"},r6={class:"thinking-text"},s6={key:1,class:"insights-row"},a6={key:2,class:"insights-row"},o6=["onClick"],l6={key:3,class:"insight-detail nodrag nowheel"},u6={class:"insight-desc"},c6={class:"insight-suggestion-label"},h6={key:4,class:"exec-badge-row"},f6={key:0,class:"exec-badge exec-executing"},d6={key:2,class:"exec-badge exec-failed"},p6=["disabled"],m6={key:5,class:"exec-result-panel nodrag nowheel"},g6={class:"block-section"},y6=["value","placeholder"],v6={key:6,class:"block-section nodrag nowheel"},O6=["placeholder"],x6={class:"intent-actions"},b6=["disabled"],S6={key:0,class:"intent-error"},w6={class:"block-section"},P6={class:"param-header"},T6=["value","onChange","placeholder"],C6=["value","onChange","placeholder"],k6=["onClick"],E6={key:0,class:"param-empty"},A6={class:"block-section probe-section"},D6={class:"probe-badge"},_6={key:0,class:"probe-panel nodrag nowheel"},I6={class:"probe-url-row"},N6=["placeholder"],M6=["disabled"],$6={class:"diag-row"},L6={key:0,class:"diag-tag"},B6={key:1,class:"diag-tag"},Q6={key:2,class:"diag-tag diag-openapi"},F6={key:0,class:"diag-auth"},R6={class:"config-section"},z6={class:"config-header"},X6={class:"config-label"},j6=["onUpdate:modelValue","placeholder"],Z6=["onUpdate:modelValue","placeholder"],V6=["onClick","title"],U6=["onClick"],q6={key:1,class:"config-section"},W6={class:"config-label"},Y6={key:2,class:"ep-section"},G6={class:"config-label"},H6=["placeholder"],J6={class:"ep-list"},K6=["onClick"],e7={class:"ep-path"},t7={key:0,class:"ep-summary"},i7={key:0,class:"param-empty"},n7={class:"probe-ai-row"},r7=["disabled"],s7={key:0,class:"auto-map-reasoning"},a7={class:"probe-tree"},o7={key:1,class:"probe-footer"},l7={class:"probe-count"},u7={key:4,class:"probe-error"},c7={key:5,class:"probe-raw"},h7={key:7,class:"block-section mappings-section"},f7={class:"mappings-header"},d7={key:0,class:"stale-badge",title:"Some mapped fields are missing from the function body"},p7={class:"mappings-list"},m7=["title"],g7={class:"block-section nodrag nowheel"},y7=ot({__name:"ToolFunctionNode",props:{data:{}},setup(t){const e=n1(),i=t;function n(K,ue){i.data.onUpdate?.(K,ue)}function r(K,ue,me){const Pe=i.data.parameters.map((Ve,He)=>He===K?{...Ve,[ue]:me}:{...Ve});n("parameters",Pe)}function s(){n("parameters",[...i.data.parameters,{name:"arg",type:"string"}])}function a(K){n("parameters",i.data.parameters.filter((ue,me)=>me!==K))}const l=Fe(()=>{const K=i.data.mappings;if(!K||K.length===0)return[];const ue=i.data.body;return K.filter(me=>!ue.includes(me.returnKey))}),u=Fe(()=>l.value.length>0),h=ze(!1),c=ze(!1),p=ze(e.getIntent(i.data.uid)??""),v=Fe(()=>e.drafts.get(i.data.uid)),g=Fe(()=>v.value?.loading??!1);async function b(){if(!p.value.trim()||!e.effectiveModel)return;e.setIntent(i.data.uid,p.value),e.setDraft(i.data.uid,{toolId:i.data.uid,phase:"draft",code:"",explanation:"",loading:!0,intentText:p.value});const K=await Y$({model:e.effectiveModel,toolName:i.data.name,description:i.data.description,parameters:i.data.parameters,probeResponseSample:Q.value??void 0,intent:p.value});K.error?e.setDraft(i.data.uid,{toolId:i.data.uid,phase:"draft",code:"",explanation:"",loading:!1,error:K.error,intentText:p.value}):e.setDraft(i.data.uid,{toolId:i.data.uid,phase:"draft",code:K.code,explanation:K.explanation,loading:!1,trainingPairId:K.trainingPairId,intentText:p.value})}function m(){const K=v.value;!K||!K.code||(n("body",K.code),K.trainingPairId&&qd.updateAccepted(K.trainingPairId),e.clearDraft(i.data.uid))}function x(){e.clearDraft(i.data.uid)}const O=Fe(()=>e.insights.get(i.data.uid)),P=ze(null),S=ze(!1);Ge(()=>i.data.body,()=>{e.insights.get(i.data.uid)&&(e.clearInsights(i.data.uid),P.value=null)});const w=ze(null),C=["Thinking","Cogitating","Analyzing","Flexing","Scrutinizing","Neuroticizing","Polarizing","Rasterizing","Criticizing","Parameterizing","Inspecting","Evaluating","Dissecting","Probing","Examining","Parsing","Reviewing","Synthesizing"],E=ze(0);let k=null;const A=Fe(()=>C[E.value%C.length]);function $(){E.value=0,k=setInterval(()=>{E.value++},1500)}function F(){k&&(clearInterval(k),k=null)}function I(){if(!P.value?.suggestedCode){console.warn("[Insight] No suggestedCode to apply");return}const K=P.value.suggestedCode;console.log("[Insight] Applying fix, code length:",K.length),n("body",K),P.value=null}async function B(){if(!e.effectiveModel){w.value="No AI model selected. Choose one in the Canvas AI model selector.";return}S.value=!0,w.value=null,P.value=null,$();const K=await G$({model:e.effectiveModel,toolName:i.data.name,code:i.data.body,parameters:i.data.parameters});S.value=!1,F(),K.error?w.value=K.error:e.setInsights(i.data.uid,{toolId:i.data.uid,insights:K.insights,codeHash:i.data.body})}const j=ze(!1),M=ze("");async function q(){if(!e.effectiveModel||!Q.value)return;j.value=!0,M.value="";const K=await H$({model:e.effectiveModel,toolName:i.data.name,description:i.data.description,probeResponseSample:Q.value});j.value=!1,!K.error&&K.paths.length>0&&(M.value=K.reasoning,xe.value=new Set(K.paths))}const X=ze(!1);async function Y(){if(!e.effectiveModel)return;X.value=!0;const K=e.getIntent(i.data.uid),ue=await J$({model:e.effectiveModel,toolName:i.data.name,code:i.data.body,parameters:i.data.parameters,error:i.data.lastCallError??"Unknown error",arguments:i.data.lastCallArguments??{},originalIntent:K});X.value=!1,!ue.error&&ue.fixedCode&&e.setDraft(i.data.uid,{toolId:i.data.uid,phase:"fix",code:ue.fixedCode,explanation:ue.explanation,loading:!1,trainingPairId:ue.trainingPairId})}const V=ze(!1),oe=ze("idle"),ae=ze(i.data.probeConfig?.url??""),fe=ze(i.data.probeConfig?.method??"GET"),D=ze(null),Z=ze(null),L=ze(null),se=ze(i.data.probeConfig?.headers?Object.entries(i.data.probeConfig.headers).map(([K,ue])=>({key:K,value:ue})):[]),de=ze(new Set(i.data.probeConfig?.secretHeaders??[]));function ie(K){const ue=se.value[K].key.trim();if(!ue)return;const me=new Set(de.value);me.has(ue)?me.delete(ue):me.add(ue),de.value=me}const R=ze(""),Q=ze(null),xe=ze(new Set),Re=ze(""),ke=ze(null),$e=Fe(()=>{if(!L.value)return[];const K=Re.value.toLowerCase();return K?L.value.endpoints.filter(ue=>ue.path.toLowerCase().includes(K)||ue.summary?.toLowerCase().includes(K)||ue.operationId?.toLowerCase().includes(K)):L.value.endpoints});function te(K){return K>=200&&K<300?"var(--color-success)":K>=300&&K<400?"var(--color-warning, #f9e2af)":"var(--color-error)"}function H(K){switch(K){case"GET":return"var(--color-accent)";case"POST":return"var(--color-success)";case"PUT":return"var(--color-warning, #f9e2af)";case"DELETE":return"var(--color-error)";case"PATCH":return"#cba6f7";default:return"var(--color-text-muted)"}}async function re(){const K=ae.value.trim();if(!K)return;oe.value="discovering",D.value=null,Z.value=null,L.value=null,Q.value=null,xe.value=new Set,ke.value=null;const ue={};for(const Ve of se.value)Ve.key.trim()&&(ue[Ve.key.trim()]=Ve.value);const[me,Pe]=await Promise.allSettled([s3(K,{method:fe.value,headers:Object.keys(ue).length>0?ue:void 0,body:(fe.value==="POST"||fe.value==="PUT")&&R.value||void 0}),l3(K)]);me.status==="fulfilled"&&(D.value=me.value,me.value.data&&(Q.value=me.value.data),me.value.authHint&&se.value.length===0&&(me.value.authHint.type==="bearer"?se.value=[{key:"Authorization",value:"Bearer "}]:me.value.authHint.type==="apikey"?se.value=[{key:"X-API-Key",value:""}]:me.value.authHint.type==="basic"&&(se.value=[{key:"Authorization",value:"Basic "}]))),Pe.status==="fulfilled"&&Pe.value.spec&&(Z.value=Pe.value,L.value=t3(Pe.value.spec)),oe.value="diagnosed"}function G(K){ke.value=K;const ue=L.value?.info.baseUrl??"",me=ue?`${ue.replace(/\/$/,"")}${K.path}`:K.path;ae.value=me,fe.value=K.method;const Pe=K.operationId??K.path.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"");n("name",Pe),(K.summary||K.description)&&n("description",K.summary??K.description??"");const Ve=K.parameters.filter(He=>He.in==="query"||He.in==="path").map(He=>({name:He.name,type:He.type}));Ve.length>0&&n("parameters",Ve)}function J(){se.value=[...se.value,{key:"",value:""}]}function le(K){se.value=se.value.filter((ue,me)=>me!==K)}function ve(K){const ue=new Set(xe.value);ue.has(K)?ue.delete(K):ue.add(K),xe.value=ue}function we(){const K=Array.from(xe.value);if(K.length===0)return;const ue={};for(const Je of se.value)Je.key.trim()&&(ue[Je.key.trim()]=Je.value);const me=Array.from(de.value),{body:Pe,addedParams:Ve}=yT(ae.value.trim(),K,{method:fe.value!=="GET"?fe.value:void 0,headers:Object.keys(ue).length>0?ue:void 0,body:(fe.value==="POST"||fe.value==="PUT")&&R.value||void 0,secretHeaders:me.length>0?me:void 0});n("body",Pe);const He=vT(K);if(n("mappings",He),Q.value){const Je=OT(He,Q.value);n("returnSchema",Je)}const Tt={url:ae.value.trim(),method:fe.value,headers:ue,...me.length>0?{secretHeaders:me}:{}};if(n("probeConfig",Tt),Ve.length>0){const Je=i.data.parameters.map(qt=>qt.name),ei=Ve.filter(qt=>!Je.includes(qt.name));ei.length>0&&n("parameters",[...i.data.parameters,...ei])}oe.value="picked"}return(K,ue)=>(ye(),be("div",{class:bt(["tool-block",{executing:t.data.executionStatus==="executing",completed:t.data.executionStatus==="completed",failed:t.data.executionStatus==="failed"}])},[ht(Se(Es),{type:"target",position:Se(Xe).Top},null,8,["position"]),he("div",J8,[he("span",K8,Te(K.$t("tools.node.badge")),1),he("input",{class:"block-name-input",value:t.data.name,onChange:ue[0]||(ue[0]=me=>n("name",me.target.value)),placeholder:K.$t("tools.node.functionNamePlaceholder")},null,40,e6),he("button",{class:bt(["ai-header-btn",{active:c.value}]),disabled:g.value,title:K.$t("tools.node.draftWithAi"),onClick:ue[1]||(ue[1]=Yi(me=>c.value=!c.value,["stop"]))},Te(g.value?"...":"✨"),11,t6),he("button",{class:"ai-header-btn ai-analyze",disabled:S.value||!t.data.body.trim(),title:K.$t("tools.node.aiInsights"),onClick:Yi(B,["stop"])},Te(S.value?"...":"🔍"),9,i6)]),S.value?(ye(),be("div",n6,[ue[14]||(ue[14]=he("span",{class:"thinking-dot"},null,-1)),he("span",r6,Te(A.value)+"...",1)])):Qe("",!0),w.value?(ye(),be("div",s6,[he("span",{class:"insight-badge error",onClick:ue[2]||(ue[2]=Yi(me=>w.value=null,["stop"]))},Te(w.value),1)])):Qe("",!0),O.value?.insights.length?(ye(),be("div",a6,[(ye(!0),be(gt,null,Jt(O.value.insights,(me,Pe)=>(ye(),be("span",{key:Pe,class:bt(["insight-badge",me.severity]),onClick:Yi(Ve=>P.value=P.value===me?null:me,["stop"])},Te(me.title),11,o6))),128))])):Qe("",!0),P.value?(ye(),be("div",l6,[he("p",u6,Te(P.value.description),1),P.value.suggestedCode?(ye(),be(gt,{key:0},[he("p",c6,Te(K.$t("tools.node.insightSuggestionLabel")),1),ht(go,{"model-value":P.value.suggestedCode,language:"typescript",readonly:!0,"min-height":"60px"},null,8,["model-value"])],64)):Qe("",!0),he("div",{class:"insight-actions",onMousedown:ue[4]||(ue[4]=Yi(()=>{},["stop"]))},[P.value.suggestedCode?(ye(),be("button",{key:0,class:"insight-apply",onClick:Yi(I,["stop","prevent"])},Te(K.$t("tools.node.applyFix")),1)):Qe("",!0),he("button",{class:"insight-close",onClick:ue[3]||(ue[3]=Yi(me=>P.value=null,["stop"]))},"× "+Te(K.$t("tools.node.closeInsight")),1)],32)])):Qe("",!0),t.data.executionStatus&&t.data.executionStatus!=="idle"?(ye(),be("div",h6,[t.data.executionStatus==="executing"?(ye(),be("span",f6,Te(K.$t("tools.node.running")),1)):t.data.executionStatus==="completed"?(ye(),be("button",{key:1,class:"exec-badge exec-completed",onClick:ue[5]||(ue[5]=Yi(me=>h.value=!h.value,["stop"]))}," ✓ "+Te(t.data.lastDurationMs!=null?`${t.data.lastDurationMs}ms`:K.$t("tools.node.done")),1)):t.data.executionStatus==="failed"?(ye(),be("span",d6," ✗ "+Te(K.$t("tools.node.failed")),1)):Qe("",!0),t.data.executionStatus==="failed"?(ye(),be("button",{key:3,class:"ai-fix-btn",disabled:X.value,onClick:Yi(Y,["stop"])},Te(X.value?"...":K.$t("tools.node.aiFix")),9,p6)):Qe("",!0)])):Qe("",!0),h.value&&t.data.lastResult!==void 0?(ye(),be("div",m6,[ht(rg,{label:"result",value:t.data.lastResult,path:"","selected-paths":new Set,depth:0,onTogglePath:()=>{}},null,8,["value","selected-paths"])])):Qe("",!0),he("div",g6,[he("label",null,Te(K.$t("tools.node.description")),1),he("input",{class:"block-input",value:t.data.description,onChange:ue[6]||(ue[6]=me=>n("description",me.target.value)),placeholder:K.$t("tools.node.descriptionPlaceholder")},null,40,y6)]),c.value?(ye(),be("div",v6,[he("label",null,Te(K.$t("tools.node.intent")),1),Vn(he("textarea",{"onUpdate:modelValue":ue[7]||(ue[7]=me=>p.value=me),class:"intent-textarea",placeholder:K.$t("tools.node.intentPlaceholder"),rows:"2"},null,8,O6),[[ia,p.value]]),he("div",x6,[he("button",{class:"intent-generate-btn",disabled:g.value||!p.value.trim(),onClick:b},Te(g.value?K.$t("tools.node.generating"):K.$t("tools.node.generate")),9,b6)]),v.value?.error?(ye(),be("div",S6,Te(v.value.error),1)):Qe("",!0)])):Qe("",!0),he("div",w6,[he("div",P6,[he("label",null,Te(K.$t("tools.node.parameters")),1),he("button",{class:"param-add-btn",onClick:s},Te(K.$t("tools.node.addParam")),1)]),(ye(!0),be(gt,null,Jt(t.data.parameters,(me,Pe)=>(ye(),be("div",{key:Pe,class:"param-row"},[he("input",{class:"param-name",value:me.name,onChange:Ve=>r(Pe,"name",Ve.target.value),placeholder:K.$t("tools.node.paramNamePlaceholder")},null,40,T6),he("input",{class:"param-type",value:me.type,onChange:Ve=>r(Pe,"type",Ve.target.value),placeholder:K.$t("tools.node.paramTypePlaceholder")},null,40,C6),he("button",{class:"param-remove-btn",onClick:Ve=>a(Pe)},"×",8,k6)]))),128)),t.data.parameters.length===0?(ye(),be("div",E6,Te(K.$t("tools.node.noParameters")),1)):Qe("",!0)]),he("div",A6,[he("div",{class:"probe-toggle",onClick:ue[8]||(ue[8]=me=>V.value=!V.value)},[he("span",{class:bt(["toggle-arrow",{open:V.value}])},"▶",2),he("label",null,Te(K.$t("tools.node.probeAndPick")),1),he("span",D6,Te(K.$t("tools.node.apiBadge")),1)]),V.value?(ye(),be("div",_6,[he("div",I6,[Vn(he("select",{"onUpdate:modelValue":ue[9]||(ue[9]=me=>fe.value=me),class:"method-select"},[...ue[15]||(ue[15]=[he("option",null,"GET",-1),he("option",null,"POST",-1),he("option",null,"PUT",-1),he("option",null,"DELETE",-1)])],512),[[hT,fe.value]]),Vn(he("input",{"onUpdate:modelValue":ue[10]||(ue[10]=me=>ae.value=me),class:"block-input probe-url",placeholder:K.$t("tools.node.urlPlaceholder"),onKeydown:fT(re,["enter"])},null,40,N6),[[ia,ae.value]]),he("button",{class:"probe-btn",disabled:oe.value==="discovering"||!ae.value.trim(),onClick:re},Te(oe.value==="discovering"?"...":K.$t("tools.node.probe")),9,M6)]),D.value&&oe.value!=="idle"?(ye(),be(gt,{key:0},[he("div",$6,[he("span",{class:"diag-status",style:hi({background:te(D.value.status)})},Te(D.value.status),5),D.value.headers["content-type"]?(ye(),be("span",L6,Te(D.value.headers["content-type"].split(";")[0]),1)):Qe("",!0),D.value.headers.server?(ye(),be("span",B6,Te(D.value.headers.server),1)):Qe("",!0),L.value?(ye(),be("span",Q6," OpenAPI · "+Te(L.value.endpoints.length)+" endpoints ",1)):Qe("",!0)]),D.value.authHint?(ye(),be("div",F6,[ue[16]||(ue[16]=he("span",{class:"diag-auth-icon"},"🔒",-1)),he("span",null,Te(D.value.authHint.message),1)])):Qe("",!0)],64)):Qe("",!0),he("div",R6,[he("div",z6,[he("span",X6,Te(K.$t("tools.node.headers")),1),he("button",{class:"param-add-btn",onClick:J},Te(K.$t("tools.node.addHeader")),1)]),(ye(!0),be(gt,null,Jt(se.value,(me,Pe)=>(ye(),be("div",{key:Pe,class:"param-row"},[Vn(he("input",{class:"param-name","onUpdate:modelValue":Ve=>se.value[Pe].key=Ve,placeholder:K.$t("tools.node.headerNamePlaceholder")},null,8,j6),[[ia,se.value[Pe].key]]),Vn(he("input",{class:bt(["param-type",{"secret-masked":de.value.has(se.value[Pe].key.trim())}]),"onUpdate:modelValue":Ve=>se.value[Pe].value=Ve,placeholder:K.$t("tools.node.headerValuePlaceholder")},null,10,Z6),[[ia,se.value[Pe].value]]),he("button",{class:bt(["secret-toggle-btn",{active:de.value.has(se.value[Pe].key.trim())}]),onClick:Ve=>ie(Pe),title:K.$t("tools.node.markAsSecret")}," 🔒 ",10,V6),he("button",{class:"param-remove-btn",onClick:Ve=>le(Pe)},"×",8,U6)]))),128))]),fe.value==="POST"||fe.value==="PUT"?(ye(),be("div",q6,[he("span",W6,Te(K.$t("tools.node.requestBody")),1),ht(go,{modelValue:R.value,"onUpdate:modelValue":ue[11]||(ue[11]=me=>R.value=me),language:"json","min-height":"60px",placeholder:'{"key": "value"}'},null,8,["modelValue"])])):Qe("",!0),L.value&&L.value.endpoints.length>0?(ye(),be("div",Y6,[he("span",G6,Te(K.$t("tools.node.endpoints")),1),Vn(he("input",{"onUpdate:modelValue":ue[12]||(ue[12]=me=>Re.value=me),class:"block-input ep-search",placeholder:K.$t("tools.node.searchEndpoints")},null,8,H6),[[ia,Re.value]]),he("div",J6,[(ye(!0),be(gt,null,Jt($e.value,me=>(ye(),be("div",{key:me.method+me.path,class:bt(["ep-row",{selected:ke.value===me}]),onClick:Pe=>G(me)},[he("span",{class:"ep-method",style:hi({background:H(me.method)})},Te(me.method),5),he("span",e7,Te(me.path),1),me.summary?(ye(),be("span",t7,Te(me.summary),1)):Qe("",!0)],10,K6))),128)),$e.value.length===0?(ye(),be("div",i7,Te(K.$t("tools.node.noMatchingEndpoints")),1)):Qe("",!0)])])):Qe("",!0),Q.value&&D.value&&D.value.ok?(ye(),be(gt,{key:3},[he("div",n7,[he("button",{class:"ai-suggest-btn",disabled:j.value,onClick:q},Te(j.value?K.$t("tools.node.thinking"):K.$t("tools.node.aiSuggest")),9,r7)]),M.value?(ye(),be("div",s7,Te(M.value),1)):Qe("",!0),he("div",a7,[ht(rg,{label:"response",value:Q.value,path:"","selected-paths":xe.value,depth:0,onTogglePath:ve},null,8,["value","selected-paths"])]),xe.value.size>0?(ye(),be("div",o7,[he("span",l7,Te(xe.value.size)+" "+Te(xe.value.size!==1?K.$t("tools.node.fields"):K.$t("tools.node.field")),1),he("button",{class:"probe-apply-btn",onClick:we},Te(K.$t("tools.node.apply")),1)])):Qe("",!0)],64)):Qe("",!0),D.value&&D.value.error&&!D.value.data?(ye(),be("div",u7,Te(D.value.error),1)):Qe("",!0),D.value?.rawText?(ye(),be("pre",c7,Te(D.value.rawText),1)):Qe("",!0)])):Qe("",!0)]),t.data.mappings&&t.data.mappings.length>0?(ye(),be("div",h7,[he("div",f7,[he("label",null,Te(K.$t("tools.node.mappings")),1),u.value?(ye(),be("span",d7,Te(K.$t("tools.node.outOfSync")),1)):Qe("",!0)]),he("div",p7,[(ye(!0),be(gt,null,Jt(t.data.mappings,me=>(ye(),be("span",{key:me.jsonPath,class:bt(["mapping-tag",{stale:l.value.some(Pe=>Pe.jsonPath===me.jsonPath)}]),title:me.jsonPath},Te(me.returnKey),11,m7))),128))])])):Qe("",!0),he("div",g7,[he("label",null,Te(K.$t("tools.node.bodyLabel")),1),v.value&&!v.value.loading&&v.value.code?(ye(),Ct(H8,{key:0,"old-code":t.data.body,"new-code":v.value.code,explanation:v.value.explanation,onAccept:m,onDismiss:x},null,8,["old-code","new-code","explanation"])):(ye(),Ct(go,{key:1,"model-value":t.data.body,language:"typescript","min-height":"100px",placeholder:K.$t("tools.node.bodyPlaceholder"),"onUpdate:modelValue":ue[13]||(ue[13]=me=>n("body",me))},null,8,["model-value","placeholder"]))]),ht(Se(Es),{type:"source",position:Se(Xe).Bottom},null,8,["position"])],2))}}),v7=AO(y7,[["__scopeId","data-v-655b6640"]]),O7={class:"flex h-full w-full relative"},x7={key:0,class:"w-[440px] flex flex-col border-e border-border-default bg-surface-base shrink-0"},b7={class:"p-3 border-b border-border-default flex items-center justify-between"},S7={class:"flex items-center gap-2"},w7={class:"text-sm font-semibold text-text-primary"},P7={class:"flex border-b border-border-default"},T7={class:"flex-1 flex flex-col p-3 gap-2 min-h-0 overflow-auto"},C7={class:"flex-1 flex flex-col p-3 gap-2 min-h-0"},k7={class:"flex items-center justify-between"},E7={class:"text-xs text-text-muted"},A7={class:"flex-1 overflow-auto"},D7={key:0,class:"p-3 border-t border-border-default"},_7={class:"text-xs text-warning uppercase tracking-wider"},I7={class:"mt-1 text-xs text-warning/80 list-disc ps-4 space-y-0.5"},N7={class:"p-3 border-t border-border-default text-xs text-text-muted"},M7={class:"flex-1 relative min-h-0 overflow-hidden"},$7={key:0,class:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none"},L7={class:"text-center pointer-events-auto"},B7={class:"text-text-muted text-sm mb-4"},Q7={class:"flex items-center gap-3"},F7={class:"absolute top-3 right-3 z-10 flex items-center gap-2"},R7=["value"],z7={value:""},X7=["value"],j7={class:"relative"},Z7={key:1,class:"absolute end-0 top-full z-20 mt-1 w-56 rounded-lg border border-border-default bg-surface-raised shadow-lg py-1"},V7=["title"],U7={key:1,class:"absolute inset-0 z-50 flex items-center justify-center bg-black/40"},q7={class:"rounded-xl bg-surface-raised border border-border-default p-6 shadow-2xl max-w-xs text-center"},W7={class:"text-sm text-text-primary mb-1 font-semibold"},Y7={class:"text-xs text-text-muted mb-4"},G7={class:"flex items-center justify-center gap-3"},H7={key:1,class:"w-[280px] flex flex-col border-s border-border-default bg-surface-base shrink-0"},J7={class:"p-3 border-b border-border-default flex items-center justify-between"},K7={class:"text-sm font-semibold text-text-primary"},e9={class:"flex-1 overflow-y-auto p-2 space-y-1"},t9=["title","onClick"],i9={class:"min-w-0 flex-1"},n9={class:"truncate text-[10px] text-text-muted"},r9=["title","onClick"],s9=["title","onClick"],a9={key:0,class:"px-3 py-4 text-xs text-text-muted text-center"},o9={class:"p-3 border-t border-border-default text-xs text-text-muted"},l9=ot({__name:"ToolCanvasView",emits:["add-template"],setup(t,{emit:e}){const i=e,n={"tool-function":io(v7)},r=Ud(),s=n1(),a=kO(),{flowNodes:l,flowEdges:u,combinedCode:h,codeWarnings:c,codeSyncStatus:p,schemas:v,onNodeDragStop:g,onNodesDelete:b,onCodeEdit:m,addNewTool:x}=j$(),{fitView:O}=vt();fn(()=>{a.models.length===0&&a.fetchModels()});const P=ze(!1),S=ze("code");Ge(P,()=>{l.value.length>0&&setTimeout(()=>{O({padding:.3,duration:300})},50)});const w=ze(!1);Ge(w,()=>{l.value.length>0&&setTimeout(()=>{O({padding:.3,duration:300})},50)});function C(X){r.removeTool(X)}const E=ze(!1);function k(){r.clearAll(),E.value=!1}const A=Fe(()=>JSON.stringify(v.value,null,2));function $(X){g({node:X.node})}function F(X){for(const Y of X)Y.type==="remove"&&b([{id:Y.id}])}function I(){const X=x();vi(()=>{O({nodes:[X],padding:.5,duration:300})})}async function B(){try{await navigator.clipboard.writeText(A.value)}catch{}}const j=ze(!1);function M(){const X=r.allTools.map(Y=>Y.definition);ng(X,"llmxray-tools.json"),j.value=!1}function q(X){const Y=r.allTools.find(V=>V.id===X);Y&&ng(Y.definition,`tool-${Y.definition.function.name}.json`)}return(X,Y)=>(ye(),be("div",O7,[P.value?(ye(),be("div",x7,[he("div",b7,[he("div",S7,[he("span",w7,Te(X.$t("tools.canvas.codePanel")),1),he("span",{class:bt(["sync-dot",Se(p)])},null,2)]),he("button",{class:"text-xs text-text-muted hover:text-text-primary transition-colors bg-transparent border-none cursor-pointer",onClick:Y[0]||(Y[0]=V=>P.value=!1)},Te(X.$t("tools.canvas.close")),1)]),he("div",P7,[he("button",{onClick:Y[1]||(Y[1]=V=>S.value="code"),class:bt(["flex-1 px-3 py-2 text-xs uppercase tracking-wider border-none cursor-pointer transition-colors",S.value==="code"?"bg-surface-raised text-accent font-bold":"bg-transparent text-text-muted"])},Te(X.$t("tools.canvas.source")),3),he("button",{onClick:Y[2]||(Y[2]=V=>S.value="schema"),class:bt(["flex-1 px-3 py-2 text-xs uppercase tracking-wider border-none cursor-pointer transition-colors",S.value==="schema"?"bg-surface-raised text-success font-bold":"bg-transparent text-text-muted"])},Te(X.$t("tools.canvas.schema")),3)]),Vn(he("div",T7,[ht(go,{"model-value":Se(h),language:"typescript",placeholder:"Combined tool source...","min-height":"200px","onUpdate:modelValue":Se(m)},null,8,["model-value","onUpdate:modelValue"])],512),[[ig,S.value==="code"]]),Vn(he("div",C7,[he("div",k7,[he("span",E7,Te(X.$t("tools.canvas.schemaManifest")),1),he("button",{onClick:B,class:"px-2 py-1 text-xs rounded bg-surface-overlay text-text-secondary hover:bg-surface-raised transition-colors cursor-pointer border-none"},Te(X.$t("tools.canvas.copy")),1)]),he("div",A7,[ht(go,{"model-value":A.value,language:"json",readonly:!0,"min-height":"200px"},null,8,["model-value"])])],512),[[ig,S.value==="schema"]]),Se(c).length>0?(ye(),be("div",D7,[he("label",_7,Te(X.$t("tools.canvas.warnings")),1),he("ul",I7,[(ye(!0),be(gt,null,Jt(Se(c),(V,oe)=>(ye(),be("li",{key:oe},Te(V),1))),128))])])):Qe("",!0),he("div",N7,Te(Se(l).length)+" tool"+Te(Se(l).length!==1?"s":"")+" · "+Te(Se(v).length)+" schema"+Te(Se(v).length!==1?"s":""),1)])):Qe("",!0),he("div",M7,[ht(Se(_D),{nodes:Se(l),edges:Se(u),"node-types":n,"default-viewport":{x:40,y:40,zoom:1},"min-zoom":.3,"max-zoom":2,"fit-view-on-init":Se(l).length>0,"fit-view-on-init-options":{padding:.3,minZoom:.6,maxZoom:1.2},class:"canvas-flow",onNodeDragStop:$,onNodesChange:F},{default:Ki(()=>[ht(Se(FD),{gap:24,size:1,"pattern-color":"var(--color-border-default)"}),ht(Se(g_)),ht(Se(JM))]),_:1},8,["nodes","edges","fit-view-on-init"]),Se(l).length===0?(ye(),be("div",$7,[he("div",L7,[he("div",B7,Te(X.$t("tools.canvas.emptyState")),1),he("div",Q7,[he("button",{onClick:I,class:"px-4 py-2 rounded-lg bg-accent text-surface-base font-semibold text-sm hover:opacity-90 transition-opacity cursor-pointer border-none"},Te(X.$t("tools.canvas.newTool")),1),he("button",{onClick:Y[3]||(Y[3]=V=>i("add-template")),class:"px-4 py-2 rounded-lg border border-dashed border-border-default text-text-muted text-sm font-medium hover:border-accent hover:text-text-primary transition-colors cursor-pointer bg-transparent"},Te(X.$t("tools.canvas.fromTemplate")),1)])])])):Qe("",!0),he("div",F7,[Se(a).chatModelNames.length>0?(ye(),be("select",{key:0,value:Se(s).canvasAiModel??"",onChange:Y[4]||(Y[4]=V=>Se(s).setCanvasAiModel(V.target.value||null)),class:"canvas-ai-model-select px-2 py-1.5 rounded-lg bg-surface-overlay/90 text-text-secondary text-xs border border-border-default shadow-lg cursor-pointer"},[he("option",z7,"AI: "+Te(Se(a).chatModelNames[0]??"none"),1),(ye(!0),be(gt,null,Jt(Se(a).chatModelNames,V=>(ye(),be("option",{key:V,value:V}," AI: "+Te(V)+" "+Te(Se(a).capabilityIcons(V)),9,X7))),128))],40,R7)):Qe("",!0),he("div",j7,[he("button",{class:"flex items-center gap-1 px-3 py-1.5 rounded-lg bg-surface-overlay/90 text-text-secondary text-xs font-medium hover:bg-surface-overlay transition-colors cursor-pointer border border-border-default shadow-lg",onClick:Y[5]||(Y[5]=V=>j.value=!j.value)},[ht(Se(sg),{class:"h-3.5 w-3.5"}),CO(" "+Te(X.$t("tools.canvas.export")),1)]),j.value?(ye(),be("div",{key:0,class:"fixed inset-0 z-10",onClick:Y[6]||(Y[6]=V=>j.value=!1)})):Qe("",!0),j.value?(ye(),be("div",Z7,[he("button",{class:"w-full px-3 py-2 text-start text-xs text-text-secondary hover:bg-surface-overlay",onClick:Y[7]||(Y[7]=V=>{Se(K$)(),j.value=!1})},Te(X.$t("tools.canvas.exportTitle")),1),he("button",{class:"w-full px-3 py-2 text-start text-xs text-text-secondary hover:bg-surface-overlay",onClick:M},Te(X.$t("tools.canvas.exportAllJson")),1)])):Qe("",!0)]),P.value?Qe("",!0):(ye(),be("button",{key:1,onClick:Y[8]||(Y[8]=V=>P.value=!0),class:"px-3 py-1.5 rounded-lg bg-surface-overlay/90 text-text-secondary text-xs font-medium hover:bg-surface-overlay transition-colors cursor-pointer border border-border-default shadow-lg"},Te(X.$t("tools.canvas.codePanel")),1)),he("button",{onClick:Y[9]||(Y[9]=V=>w.value=!w.value),class:bt(["px-3 py-1.5 rounded-lg bg-surface-overlay/90 text-xs font-medium hover:bg-surface-overlay transition-colors cursor-pointer border border-border-default shadow-lg",w.value?"text-accent":"text-text-secondary"])},Te(X.$t("tools.canvas.toolLibrary")),3),Se(l).length>0?(ye(),be("button",{key:2,onClick:Y[10]||(Y[10]=V=>E.value=!0),class:"px-3 py-1.5 rounded-lg bg-surface-overlay/90 text-text-secondary text-xs font-medium hover:bg-surface-overlay hover:text-error transition-colors cursor-pointer border border-border-default shadow-lg",title:X.$t("tools.canvas.clearAllTitle")},Te(X.$t("tools.canvas.clearAll")),9,V7)):Qe("",!0),he("button",{onClick:Y[11]||(Y[11]=V=>i("add-template")),class:"px-3 py-1.5 rounded-lg bg-surface-overlay/90 text-text-secondary text-xs font-medium hover:bg-surface-overlay transition-colors cursor-pointer border border-dashed border-border-default shadow-lg"},Te(X.$t("tools.canvas.fromTemplate")),1),Se(l).length>0?(ye(),be("button",{key:3,onClick:I,class:"px-3 py-1.5 rounded-lg bg-accent/90 text-surface-base font-semibold text-xs hover:bg-accent transition-colors cursor-pointer border-none shadow-lg"},Te(X.$t("tools.canvas.newTool")),1)):Qe("",!0)]),E.value?(ye(),be("div",U7,[he("div",q7,[he("p",W7,Te(X.$t("tools.canvas.clearAllConfirm")),1),he("p",Y7,Te(X.$t("tools.canvas.clearAllWarning",{count:Se(l).length})),1),he("div",G7,[he("button",{onClick:Y[12]||(Y[12]=V=>E.value=!1),class:"px-4 py-1.5 rounded-lg text-xs text-text-secondary bg-surface-overlay hover:bg-surface-raised transition-colors cursor-pointer border border-border-default"},Te(X.$t("tools.canvas.cancel")),1),he("button",{onClick:k,class:"px-4 py-1.5 rounded-lg text-xs text-white bg-error hover:opacity-90 transition-opacity cursor-pointer border-none"},Te(X.$t("tools.canvas.deleteAll")),1)])])])):Qe("",!0)]),w.value?(ye(),be("div",H7,[he("div",J7,[he("span",K7,Te(X.$t("tools.canvas.toolLibrary")),1),he("button",{class:"text-xs text-text-muted hover:text-text-primary transition-colors bg-transparent border-none cursor-pointer",onClick:Y[13]||(Y[13]=V=>w.value=!1)},Te(X.$t("tools.canvas.close")),1)]),he("div",e9,[(ye(!0),be(gt,null,Jt(Se(r).allTools,V=>(ye(),be("div",{key:V.id,class:"flex items-center gap-2 rounded-lg px-3 py-2 text-xs hover:bg-surface-overlay transition-colors"},[he("button",{class:bt(["h-4 w-7 shrink-0 rounded-full transition-colors",V.enabled?"bg-accent":"bg-surface-overlay"]),title:V.enabled?X.$t("tools.canvas.disableForChat"):X.$t("tools.canvas.enableForChat"),onClick:oe=>Se(r).toggleEnabled(V.id)},[he("span",{class:bt(["block h-3 w-3 rounded-full bg-white transition-transform",V.enabled?"translate-x-3.5":"translate-x-0.5"])},null,2)],10,t9),he("div",i9,[he("span",{class:bt(["font-mono block",V.enabled?"text-text-primary":"text-text-muted"])},Te(V.definition.function.name),3),he("p",n9,Te(V.definition.function.description),1)]),he("button",{class:"shrink-0 text-text-muted hover:text-accent transition-colors bg-transparent border-none cursor-pointer",title:X.$t("tools.canvas.exportToolJson"),onClick:oe=>q(V.id)},[ht(Se(sg),{class:"h-3.5 w-3.5"})],8,r9),he("button",{class:"shrink-0 text-text-muted hover:text-error transition-colors bg-transparent border-none cursor-pointer",title:X.$t("tools.canvas.deleteToolTitle"),onClick:oe=>C(V.id)},[ht(Se(bT),{class:"h-3.5 w-3.5"})],8,s9)]))),128)),Se(r).allTools.length===0?(ye(),be("p",a9,Te(X.$t("tools.canvas.noToolsYet")),1)):Qe("",!0)]),he("div",o9,Te(Se(r).enabledTools.length)+"/"+Te(Se(r).allTools.length)+" "+Te(X.$t("tools.canvas.enabledForChat")),1)])):Qe("",!0)]))}}),u9={class:"flex h-full overflow-hidden flex-col"},c9={class:"bg-surface-raised rounded-xl border border-border-default shadow-xl w-[480px] max-h-[70vh] overflow-hidden"},h9={class:"p-4 border-b border-border-default"},f9={class:"text-sm font-medium text-text-primary"},d9={class:"text-[10px] text-text-muted mt-0.5"},p9={class:"p-3 space-y-4 overflow-y-auto max-h-[50vh]"},m9={class:"text-[10px] font-semibold text-text-muted uppercase tracking-wider mb-2 px-1"},g9={class:"space-y-1.5"},y9=["onClick"],v9={class:"flex items-center justify-between"},O9={class:"text-xs font-medium text-text-primary"},x9={class:"text-[10px] text-text-muted mt-1"},b9={class:"p-3 border-t border-border-default"},z9=ot({__name:"ToolWorkshopPage",setup(t){const e=Ud(),{t:i}=dT(),n=ze(!1),r=[{name:"Current Time",description:"Returns the current date and time",category:"utility",definition:{type:"function",function:{name:"get_current_time",description:"Get the current date and time in ISO format",parameters:{type:"object",properties:{},required:[]}}},code:"return new Date().toISOString()"},{name:"Web Fetch",description:"Fetch readable text or JSON from a URL",category:"api",definition:{type:"function",function:{name:"fetch_url",description:"Fetch the content of a web page or API endpoint. Returns extracted text for HTML pages, or raw JSON for API responses.",parameters:{type:"object",properties:{url:{type:"string",description:"The URL to fetch"}},required:["url"]}}},code:`const res = await fetch(args.url)
|
|
216
|
+
const contentType = res.headers.get('content-type') || ''
|
|
217
|
+
if (contentType.includes('application/json')) {
|
|
218
|
+
return await res.json()
|
|
219
|
+
}
|
|
220
|
+
const text = await res.text()
|
|
221
|
+
// Extract readable text from HTML
|
|
222
|
+
if (contentType.includes('text/html') || text.trimStart().startsWith('<')) {
|
|
223
|
+
const doc = new DOMParser().parseFromString(text, 'text/html')
|
|
224
|
+
// Remove non-content elements
|
|
225
|
+
doc.querySelectorAll('script,style,nav,footer,header,aside,iframe,noscript,svg').forEach(el => el.remove())
|
|
226
|
+
const title = doc.querySelector('title')?.textContent?.trim() || ''
|
|
227
|
+
const body = doc.body?.textContent?.replace(/\\s+/g, ' ')?.trim() || ''
|
|
228
|
+
return (title ? title + '\\n\\n' : '') + body.slice(0, 8000)
|
|
229
|
+
}
|
|
230
|
+
return text`},{name:"Calculator",description:"Evaluate a math expression",category:"utility",definition:{type:"function",function:{name:"calculate",description:"Evaluate a mathematical expression and return the result",parameters:{type:"object",properties:{expression:{type:"string",description:'The math expression to evaluate (e.g., "2 + 3 * 4")'}},required:["expression"]}}},code:`// Safe math evaluation (no eval)
|
|
231
|
+
const expr = String(args.expression)
|
|
232
|
+
const fn = new Function('return ' + expr.replace(/[^0-9+\\-*/().\\s]/g, ''))
|
|
233
|
+
return fn()`},{name:"JSON Formatter",description:"Pretty-print a JSON string",category:"data",definition:{type:"function",function:{name:"format_json",description:"Format a JSON string with proper indentation for readability",parameters:{type:"object",properties:{json_string:{type:"string",description:"The JSON string to format"}},required:["json_string"]}}},code:"return JSON.stringify(JSON.parse(String(args.json_string)), null, 2)"},{name:"Password Generator",description:"Generate a secure random password",category:"utility",definition:{type:"function",function:{name:"generate_password",description:"Generate a cryptographically secure random password with configurable length and character types",parameters:{type:"object",properties:{length:{type:"number",description:"Password length (default 16)"},include_symbols:{type:"boolean",description:"Include special characters like !@#$% (default true)"}},required:[]}}},code:`const len = Number(args.length) || 16
|
|
234
|
+
const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
235
|
+
const lower = 'abcdefghijklmnopqrstuvwxyz'
|
|
236
|
+
const digits = '0123456789'
|
|
237
|
+
const symbols = '!@#$%^&*()_+-=[]{}|;:,.<>?'
|
|
238
|
+
const chars = upper + lower + digits + (args.include_symbols !== false ? symbols : '')
|
|
239
|
+
const arr = new Uint32Array(len)
|
|
240
|
+
crypto.getRandomValues(arr)
|
|
241
|
+
return Array.from(arr, v => chars[v % chars.length]).join('')`},{name:"UUID Generator",description:"Generate one or more random UUIDs (v4)",category:"utility",definition:{type:"function",function:{name:"generate_uuid",description:"Generate random UUID v4 identifiers",parameters:{type:"object",properties:{count:{type:"number",description:"Number of UUIDs to generate (default 1)"}},required:[]}}},code:`const n = Math.min(Number(args.count) || 1, 100)
|
|
242
|
+
const uuids = Array.from({ length: n }, () => crypto.randomUUID())
|
|
243
|
+
return n === 1 ? uuids[0] : uuids`},{name:"Base64 Encode/Decode",description:"Encode text to Base64 or decode Base64 to text",category:"data",definition:{type:"function",function:{name:"base64",description:"Encode a string to Base64 or decode a Base64 string back to text",parameters:{type:"object",properties:{text:{type:"string",description:"The text to encode or decode"},action:{type:"string",description:'"encode" or "decode" (default "encode")'}},required:["text"]}}},code:`if (args.action === 'decode') {
|
|
244
|
+
return atob(String(args.text))
|
|
245
|
+
}
|
|
246
|
+
return btoa(String(args.text))`},{name:"Hash Text (SHA-256)",description:"Compute the SHA-256 hash of a text string",category:"utility",definition:{type:"function",function:{name:"hash_sha256",description:"Compute the SHA-256 cryptographic hash of the given text, returned as a hex string",parameters:{type:"object",properties:{text:{type:"string",description:"The text to hash"}},required:["text"]}}},code:`const data = new TextEncoder().encode(String(args.text))
|
|
247
|
+
const hash = await crypto.subtle.digest('SHA-256', data)
|
|
248
|
+
return Array.from(new Uint8Array(hash), b => b.toString(16).padStart(2, '0')).join('')`},{name:"Timestamp Converter",description:"Convert between Unix timestamps and human-readable dates",category:"data",definition:{type:"function",function:{name:"convert_timestamp",description:"Convert a Unix timestamp (seconds or milliseconds) to a human-readable date, or convert a date string to a Unix timestamp",parameters:{type:"object",properties:{value:{type:"string",description:'A Unix timestamp (e.g. "1710000000") or a date string (e.g. "2024-03-09T16:00:00Z")'}},required:["value"]}}},code:`const v = String(args.value).trim()
|
|
249
|
+
const num = Number(v)
|
|
250
|
+
if (!isNaN(num) && v.length > 0) {
|
|
251
|
+
// It's a number — treat as timestamp
|
|
252
|
+
const ms = num > 1e12 ? num : num * 1000
|
|
253
|
+
const d = new Date(ms)
|
|
254
|
+
return { iso: d.toISOString(), local: d.toLocaleString(), unix_s: Math.floor(ms / 1000), unix_ms: ms }
|
|
255
|
+
}
|
|
256
|
+
// It's a date string
|
|
257
|
+
const d = new Date(v)
|
|
258
|
+
if (isNaN(d.getTime())) return { error: 'Could not parse date: ' + v }
|
|
259
|
+
return { iso: d.toISOString(), local: d.toLocaleString(), unix_s: Math.floor(d.getTime() / 1000), unix_ms: d.getTime() }`},{name:"Word & Character Counter",description:"Count words, characters, sentences, and lines in text",category:"data",definition:{type:"function",function:{name:"count_text",description:"Analyze text and return counts of characters, words, sentences, lines, and paragraphs",parameters:{type:"object",properties:{text:{type:"string",description:"The text to analyze"}},required:["text"]}}},code:`const t = String(args.text)
|
|
260
|
+
const words = t.trim() ? t.trim().split(/\\s+/).length : 0
|
|
261
|
+
const chars = t.length
|
|
262
|
+
const chars_no_spaces = t.replace(/\\s/g, '').length
|
|
263
|
+
const sentences = (t.match(/[.!?]+(?=\\s|$)/g) || []).length
|
|
264
|
+
const lines = t.split(/\\r?\\n/).length
|
|
265
|
+
const paragraphs = t.split(/\\n\\s*\\n/).filter(p => p.trim()).length || (t.trim() ? 1 : 0)
|
|
266
|
+
return { words, characters: chars, characters_no_spaces: chars_no_spaces, sentences, lines, paragraphs }`},{name:"Text Transform",description:"Transform text: uppercase, lowercase, title case, slug, reverse",category:"utility",definition:{type:"function",function:{name:"transform_text",description:"Transform text using a specified operation: uppercase, lowercase, title_case, slug, reverse, trim, or remove_duplicates",parameters:{type:"object",properties:{text:{type:"string",description:"The text to transform"},operation:{type:"string",description:"One of: uppercase, lowercase, title_case, slug, reverse, trim, remove_duplicates"}},required:["text","operation"]}}},code:`const t = String(args.text)
|
|
267
|
+
switch (String(args.operation)) {
|
|
268
|
+
case 'uppercase': return t.toUpperCase()
|
|
269
|
+
case 'lowercase': return t.toLowerCase()
|
|
270
|
+
case 'title_case': return t.replace(/\\b\\w/g, c => c.toUpperCase())
|
|
271
|
+
case 'slug': return t.toLowerCase().trim().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')
|
|
272
|
+
case 'reverse': return t.split('').reverse().join('')
|
|
273
|
+
case 'trim': return t.replace(/\\s+/g, ' ').trim()
|
|
274
|
+
case 'remove_duplicates': return [...new Set(t.split(/\\n/))].join('\\n')
|
|
275
|
+
default: return 'Unknown operation: ' + args.operation
|
|
276
|
+
}`},{name:"Regex Tester",description:"Test a regex pattern against text and return matches",category:"data",definition:{type:"function",function:{name:"test_regex",description:"Test a regular expression pattern against text. Returns all matches with their positions.",parameters:{type:"object",properties:{pattern:{type:"string",description:"The regex pattern (without delimiters)"},text:{type:"string",description:"The text to search"},flags:{type:"string",description:'Regex flags like "gi" (default "g")'}},required:["pattern","text"]}}},code:`const re = new RegExp(String(args.pattern), String(args.flags || 'g'))
|
|
277
|
+
const matches = []
|
|
278
|
+
let m
|
|
279
|
+
while ((m = re.exec(String(args.text))) !== null) {
|
|
280
|
+
matches.push({ match: m[0], index: m.index, groups: m.slice(1) })
|
|
281
|
+
if (!re.global) break
|
|
282
|
+
}
|
|
283
|
+
return { pattern: String(args.pattern), flags: re.flags, match_count: matches.length, matches }`},{name:"List Calendar Events",description:"List upcoming events from Google Calendar",category:"google",definition:{type:"function",function:{name:"list_calendar_events",description:"List upcoming events from the user's Google Calendar. Returns event titles, times, descriptions, and locations.",parameters:{type:"object",properties:{days_ahead:{type:"number",description:"Number of days ahead to look (default 7)"},max_results:{type:"number",description:"Maximum number of events to return (default 10)"}},required:[]}}},code:`const token = await getGoogleToken()
|
|
284
|
+
const now = new Date()
|
|
285
|
+
const future = new Date(now.getTime() + (Number(args.days_ahead) || 7) * 86400000)
|
|
286
|
+
const params = new URLSearchParams({
|
|
287
|
+
timeMin: now.toISOString(),
|
|
288
|
+
timeMax: future.toISOString(),
|
|
289
|
+
maxResults: String(Number(args.max_results) || 10),
|
|
290
|
+
singleEvents: 'true',
|
|
291
|
+
orderBy: 'startTime',
|
|
292
|
+
})
|
|
293
|
+
const res = await fetch('https://www.googleapis.com/calendar/v3/calendars/primary/events?' + params, {
|
|
294
|
+
headers: { Authorization: 'Bearer ' + token }
|
|
295
|
+
})
|
|
296
|
+
if (!res.ok) throw new Error('Calendar API error: ' + res.status)
|
|
297
|
+
const data = await res.json()
|
|
298
|
+
return (data.items || []).map(e => ({
|
|
299
|
+
title: e.summary || '(no title)',
|
|
300
|
+
start: e.start?.dateTime || e.start?.date,
|
|
301
|
+
end: e.end?.dateTime || e.end?.date,
|
|
302
|
+
description: e.description || '',
|
|
303
|
+
location: e.location || '',
|
|
304
|
+
id: e.id,
|
|
305
|
+
}))`},{name:"Create Calendar Event",description:"Create a new event on Google Calendar",category:"google",definition:{type:"function",function:{name:"create_calendar_event",description:"Create a new event on the user's Google Calendar. Returns the created event details and a link to view it.",parameters:{type:"object",properties:{title:{type:"string",description:"Event title/summary"},start_time:{type:"string",description:'Start time in ISO 8601 format (e.g. "2025-03-15T14:00:00+01:00")'},end_time:{type:"string",description:'End time in ISO 8601 format (e.g. "2025-03-15T15:00:00+01:00")'},description:{type:"string",description:"Event description (optional)"},location:{type:"string",description:"Event location (optional)"}},required:["title","start_time","end_time"]}}},code:`const token = await getGoogleToken()
|
|
306
|
+
const event = {
|
|
307
|
+
summary: args.title,
|
|
308
|
+
start: { dateTime: args.start_time },
|
|
309
|
+
end: { dateTime: args.end_time },
|
|
310
|
+
description: args.description || '',
|
|
311
|
+
location: args.location || '',
|
|
312
|
+
}
|
|
313
|
+
const res = await fetch('https://www.googleapis.com/calendar/v3/calendars/primary/events', {
|
|
314
|
+
method: 'POST',
|
|
315
|
+
headers: { Authorization: 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
316
|
+
body: JSON.stringify(event),
|
|
317
|
+
})
|
|
318
|
+
if (!res.ok) throw new Error('Failed to create event: ' + (await res.text()))
|
|
319
|
+
const created = await res.json()
|
|
320
|
+
return { id: created.id, title: created.summary, start: created.start, end: created.end, link: created.htmlLink }`},{name:"Delete Calendar Event",description:"Delete an event from Google Calendar by its ID",category:"google",definition:{type:"function",function:{name:"delete_calendar_event",description:"Delete an event from the user's Google Calendar. Use list_calendar_events first to get event IDs.",parameters:{type:"object",properties:{event_id:{type:"string",description:"The ID of the event to delete"}},required:["event_id"]}}},code:`const token = await getGoogleToken()
|
|
321
|
+
const res = await fetch('https://www.googleapis.com/calendar/v3/calendars/primary/events/' + encodeURIComponent(String(args.event_id)), {
|
|
322
|
+
method: 'DELETE',
|
|
323
|
+
headers: { Authorization: 'Bearer ' + token },
|
|
324
|
+
})
|
|
325
|
+
if (!res.ok && res.status !== 204) throw new Error('Failed to delete event: ' + res.status)
|
|
326
|
+
return { success: true, deleted_event_id: args.event_id }`},{name:"List Recent Emails",description:"List recent emails from Gmail with subject, sender, and snippet",category:"google",definition:{type:"function",function:{name:"list_emails",description:"List recent emails from the user's Gmail inbox. Returns subject, sender, date, and a short snippet for each email.",parameters:{type:"object",properties:{query:{type:"string",description:'Gmail search query (e.g. "is:unread", "from:amazon.com", "subject:invoice"). Default: "is:unread"'},max_results:{type:"number",description:"Maximum number of emails to return (default 10)"}},required:[]}}},code:`const token = await getGoogleToken()
|
|
327
|
+
const q = String(args.query || 'is:unread')
|
|
328
|
+
const max = Math.min(Number(args.max_results) || 10, 20)
|
|
329
|
+
const listRes = await fetch('https://gmail.googleapis.com/gmail/v1/users/me/messages?' + new URLSearchParams({ q, maxResults: String(max) }), {
|
|
330
|
+
headers: { Authorization: 'Bearer ' + token }
|
|
331
|
+
})
|
|
332
|
+
if (!listRes.ok) throw new Error('Gmail API error: ' + listRes.status)
|
|
333
|
+
const list = await listRes.json()
|
|
334
|
+
if (!list.messages || list.messages.length === 0) return { count: 0, emails: [] }
|
|
335
|
+
const emails = []
|
|
336
|
+
for (const msg of list.messages.slice(0, max)) {
|
|
337
|
+
const r = await fetch('https://gmail.googleapis.com/gmail/v1/users/me/messages/' + msg.id + '?format=metadata&metadataHeaders=Subject&metadataHeaders=From&metadataHeaders=Date', {
|
|
338
|
+
headers: { Authorization: 'Bearer ' + token }
|
|
339
|
+
})
|
|
340
|
+
if (!r.ok) continue
|
|
341
|
+
const detail = await r.json()
|
|
342
|
+
const headers = detail.payload?.headers || []
|
|
343
|
+
emails.push({
|
|
344
|
+
id: detail.id,
|
|
345
|
+
subject: headers.find(h => h.name === 'Subject')?.value || '(no subject)',
|
|
346
|
+
from: headers.find(h => h.name === 'From')?.value || '',
|
|
347
|
+
date: headers.find(h => h.name === 'Date')?.value || '',
|
|
348
|
+
snippet: detail.snippet || '',
|
|
349
|
+
labels: detail.labelIds || [],
|
|
350
|
+
})
|
|
351
|
+
}
|
|
352
|
+
return { count: emails.length, emails }`},{name:"Send Email",description:"Send an email via Gmail",category:"google",definition:{type:"function",function:{name:"send_email",description:"Send an email from the user's Gmail account.",parameters:{type:"object",properties:{to:{type:"string",description:"Recipient email address"},subject:{type:"string",description:"Email subject line"},body:{type:"string",description:"Email body text (plain text)"}},required:["to","subject","body"]}}},code:`const token = await getGoogleToken()
|
|
353
|
+
// Build RFC 2822 message
|
|
354
|
+
const message = [
|
|
355
|
+
'To: ' + args.to,
|
|
356
|
+
'Subject: ' + args.subject,
|
|
357
|
+
'Content-Type: text/plain; charset=utf-8',
|
|
358
|
+
'',
|
|
359
|
+
args.body,
|
|
360
|
+
].join('\\r\\n')
|
|
361
|
+
// Base64url encode
|
|
362
|
+
const encoded = btoa(unescape(encodeURIComponent(message))).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '')
|
|
363
|
+
const res = await fetch('https://gmail.googleapis.com/gmail/v1/users/me/messages/send', {
|
|
364
|
+
method: 'POST',
|
|
365
|
+
headers: { Authorization: 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
366
|
+
body: JSON.stringify({ raw: encoded }),
|
|
367
|
+
})
|
|
368
|
+
if (!res.ok) throw new Error('Failed to send email: ' + (await res.text()))
|
|
369
|
+
const sent = await res.json()
|
|
370
|
+
return { success: true, message_id: sent.id, to: args.to, subject: args.subject }`},{name:"Trash Email",description:"Move an email to trash by its ID",category:"google",definition:{type:"function",function:{name:"trash_email",description:"Move an email to the trash in Gmail. Use list_emails first to get message IDs.",parameters:{type:"object",properties:{message_id:{type:"string",description:"The ID of the email to trash"}},required:["message_id"]}}},code:`const token = await getGoogleToken()
|
|
371
|
+
const res = await fetch('https://gmail.googleapis.com/gmail/v1/users/me/messages/' + encodeURIComponent(String(args.message_id)) + '/trash', {
|
|
372
|
+
method: 'POST',
|
|
373
|
+
headers: { Authorization: 'Bearer ' + token },
|
|
374
|
+
})
|
|
375
|
+
if (!res.ok) throw new Error('Failed to trash email: ' + res.status)
|
|
376
|
+
return { success: true, trashed_message_id: args.message_id }`}],s=["utility","api","data","google","custom"],a=Fe(()=>{const u=[],h=new Map;for(const c of r){const p=c.category;h.has(p)||h.set(p,[]),h.get(p).push(c)}for(const c of s){const p=h.get(c);p&&p.length>0&&u.push({category:c,label:i(`tools.templates.categories.${c}`),items:p})}return u});function l(u){const h=e.addTool({definition:structuredClone(u.definition),implementation:{mode:"code",blocks:[],code:u.code},category:u.category});e.selectTool(h),n.value=!1}return(u,h)=>(ye(),be("div",u9,[ht(l9,{class:"flex-1",onAddTemplate:h[0]||(h[0]=c=>n.value=!0)}),(ye(),Ct(pT,{to:"body"},[n.value?(ye(),be("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:h[2]||(h[2]=Yi(c=>n.value=!1,["self"]))},[he("div",c9,[he("div",h9,[he("h3",f9,Te(u.$t("tools.templates.title")),1),he("p",d9,Te(u.$t("tools.templates.subtitle")),1)]),he("div",p9,[(ye(!0),be(gt,null,Jt(a.value,c=>(ye(),be("div",{key:c.category},[he("h4",m9,Te(c.label),1),he("div",g9,[(ye(!0),be(gt,null,Jt(c.items,p=>(ye(),be("button",{key:p.name,class:"w-full text-left rounded-lg border border-border-default hover:border-accent/50 p-3 transition-colors",onClick:v=>l(p)},[he("div",v9,[he("span",O9,Te(p.name),1)]),he("p",x9,Te(p.description),1)],8,y9))),128))])]))),128))]),he("div",b9,[he("button",{class:"w-full rounded-lg border border-border-default px-3 py-1.5 text-xs text-text-muted hover:text-text-primary transition-colors",onClick:h[1]||(h[1]=c=>n.value=!1)},Te(u.$t("common.actions.cancel")),1)])])])):Qe("",!0)]))]))}});export{z9 as default};
|