@vtj/renderer 0.18.26 → 0.18.28

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/index.cjs CHANGED
@@ -1,28 +1,37 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("@vtj/core"),d=require("@vtj/utils"),j=require("vue"),as=require("vue-router");function xi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const be=xi(j);/**!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("@vtj/core"),d=require("@vtj/utils"),O=require("vue"),ss=require("vue-router");function fr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const ye=fr(O);/**!
2
2
  * Copyright (c) 2026, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/renderer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.18.26
5
+ * @version 0.18.28
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const ye="0.18.26";var P=(t=>(t.Runtime="Runtime",t.Design="Design",t.Raw="Raw",t.VNode="VNode",t))(P||{});const gt=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],bi=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],yi=["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onErrorCaptured","onRenderTracked","onRenderTriggered","onActivated","onDeactivated"],os=["vIf","vElseIf","vElse","vShow","vModel","vFor","vBind","vHtml"],us={String,Number,Boolean,Array,Object,Function,Date},_e="VtjPage",Te="VtjHomepage",wt="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(","),cs="component,slot".split(","),_i=["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o"].join(""),Si={auth:["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o","/","a","u","t","h",".","h","t","m","l"].join(""),storageKey:["R","R","O","_","I","D","E","_","A","C","C","E","S","S","_","S","T","O","R","A","G","E","_","_"].join(""),privateKey:"MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"};function Ae(t,e){return t.map(s=>d.isUrl(s)||s.startsWith("/")?s:`${e}${s}`)}function je(t){return/\.css$/.test(t)}function Me(t){return/\.js$/.test(t)}function ls(t){return/\.json$/.test(t)}function Ci(t){return t.map(e=>`<script src="${d.url.append(e,{v:ye})}"><\/script>`).join("")}function wi(t=[]){return t.map(e=>`<link rel="stylesheet" href="${d.url.append(e,{v:ye})}" />`).join("")}function hs(t,e=!1){return e&&t.endsWith(".prod.js")?t.replace(".prod.js",".js"):t}function ps(t,e,s=!1){const i=t.filter(m=>!!m.enabled),r=[],n=[],a=[],u=[],c={},l={},h=[],p={};return i.forEach(({urls:m,assetsUrl:f,library:g,assetsLibrary:b,localeLibrary:v})=>{m?.forEach(x=>{Me(x)&&r.push(hs(x,s)),je(x)&&n.push(x)}),g&&(u.push(g),c[g]=Ae(m||[],e),v&&(l[g]=v)),f&&a.push(f),b&&h.push(b),g&&b&&(p[b]=g)}),{scripts:Ae(r,e),css:Ae(n,e),materials:Ae(a,e),libraryExports:u,materialExports:d.dedupArray(h),materialMapLibrary:p,libraryMap:c,libraryLocaleMap:l}}function fs(t,e){const{name:s,parent:i,alias:r}=t;return i?e[i]?.[r||s]:e[r||s]}function ds(t=[]){const e=t.filter(i=>je(i)),s=t.filter(i=>Me(i));return{css:e,js:s}}function ms(t,e){const s=l=>{const h=[];let p=0;for(;p<l.length;){if(/\s/.test(l[p])){p++;continue}if(l.substring(p,p+2)==="/*"){const x=l.indexOf("*/",p+2);if(x!==-1){p=x+2;continue}}if(l[p]==="@"){const x=p;for(;p<l.length&&l[p]!=="{"&&l[p]!==";";)p++;const I=l.substring(x,p).trim(),O=I.includes("@keyframes");if(l[p]===";")h.push({type:"simple-at-rule",content:l.substring(x,p+1)}),p++;else if(l[p]==="{"){const w=p+1;let H=1;for(p++;p<l.length&&H>0;)l[p]==="{"?H++:l[p]==="}"&&H--,p++;const de=l.substring(x,p),ke=l.substring(w,p-1);h.push({type:O?"keyframes":"at-rule",rule:I,content:de,inner:ke})}continue}const m=p;for(;p<l.length&&l[p]!=="{";)p++;if(p>=l.length)break;const f=l.substring(m,p).trim();if(!f){p++;continue}const g=p+1;let b=1;for(p++;p<l.length&&b>0;)l[p]==="{"?b++:l[p]==="}"&&b--,p++;const v=l.substring(g,p-1);h.push({type:"rule",selector:f,content:v.trim()})}return h},i=l=>{const h=l.trim();return/^(from|to|\d+(\.\d+)?%)$/.test(h)},r=l=>l.replace(/::v-deep\(/g,":deep(").replace(/::v-deep\s+/g,":deep(").replace(/\/deep\//g," ").replace(/>>>/g," ").replace(/(.*?):deep\(([^)]+)\)/g,(h,p,m)=>{const f=p.trim(),g=m.trim();return f?`${f}[${e}] ${g}`:g}),n=l=>{const h=l.trim();if(!h||h.includes(`[${e}]`)||/^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(h)||i(h))return h;const p=h.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);if(p){const[,m,f=""]=p,g=m.trim();return g?`${g}[${e}]${f}`:h}return`${h}[${e}]`},a=l=>r(l).split(",").map(p=>n(p)).filter(p=>p.trim()).join(", "),u=l=>l.map(h=>{switch(h.type){case"simple-at-rule":return h.content;case"keyframes":return h.content;case"at-rule":try{const m=s(h.inner),f=u(m);return`${h.rule} { ${f} }`}catch{return h.content}case"rule":if(!h.selector||!h.content)return"";const p=a(h.selector);return p.trim()?`${p} { ${h.content} }`:"";default:return""}}).filter(h=>h.trim()).join(" "),c=l=>l.replace(/\s*{\s*/g," { ").replace(/\s*}\s*/g," } ").replace(/\s*;\s*/g,"; ").replace(/\s*,\s*/g,", ").replace(/\s+/g," ").replace(/^\s+|\s+$/g,"").replace(/\s*}\s*}/g," } }").trim();try{const l=t.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g,"").replace(/^\s+|\s+$/gm,"").replace(/\n\s*\n/g,`
8
- `),h=s(l),p=u(h);return c(p)}catch(l){return console.error("CSS scoping failed:",l),console.error("Input CSS:",t),t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,h=>h).replace(/([^{}@]+)(?=\s*{)/g,h=>{const p=h.trim();return!p||p.startsWith("@")||p.includes(`[${e}]`)||i(p)?h:`${p}[${e}]`})}}const Ei=750;function gs(t,e,s){let i;typeof t<"u"?i=t.innerWidth||t.document.documentElement.clientWidth:(console.warn("无法获取屏幕宽度,使用默认值375"),i=375);const r=s||Ei;return e*i/r}function vs(t,e){let s=!1,i=!1,r=!1,n="";for(let a=0;a<e.length;a++){const u=e[a];if(u==="'"&&!i&&!r?s=!s:u==='"'&&!s&&!r?i=!i:e.substr(a,4).toLowerCase()==="url("&&!s&&!i?r=!0:u===")"&&r&&(r=!1),!s&&!i&&!r){const c=e.substr(a).match(/^(-?\d+(?:\.\d+)?)\s*rpx/);if(c){const l=c[1],h=parseFloat(l),m=`${gs(t,h).toFixed(6).replace(/\.?0+$/,"")}px`;n+=m,a+=c[0].length-1;continue}}n+=u}return n}function Et(t){return d.isString(t)?t:JSON.stringify(t)}function Qe(t,e,s,i=!1){const r=t.CSSStyleSheet,n=i?`data-v-${e}`:e,a=t.__uniConfig?vs(t,s):s,u=i?ms(a,n):a,c=!!t.__uniConfig;if(r.prototype.replaceSync&&!c){const l=new r;l.id=e,l.replaceSync(u);const h=t.document,p=h.adoptedStyleSheets,m=Array.from(p).filter(f=>f.id!==e);h.adoptedStyleSheets=[...m,l]}else{const l=t.document;let h=l.getElementById(e);h?h.innerHTML=u:(h=l.createElement("style"),h.id=e,h.innerHTML=u,l.head.appendChild(h))}}function ki(t){const e=t.adoptedStyleSheets||[];let s="";if(e.forEach(i=>{try{for(const r of i.cssRules)s+=r.cssText+`
9
- `}catch(r){console.error("Failed to read cssRules from adopted stylesheet:",r)}}),s){const i=t.createElement("style");i.textContent=s,t.head.appendChild(i)}}async function xs(t,e){const s=await globalThis.fetch(e).then(i=>i.text()).catch(()=>"");s&&Qe(globalThis,t,s)}function kt(t,e=globalThis){const s=e.document,i=e.document.head;for(const r of t)if(!s.getElementById(r)){const a=s.createElement("link");a.rel="stylesheet",a.id=r,a.href=r,i.appendChild(a)}}async function It(t,e,s=globalThis){const i=s.document,r=s.document.head;let n=s[e];return n?n.default||n:new Promise((a,u)=>{for(const c of t){const l=i.createElement("script");l.src=c,l.onload=()=>{n=s[e],n?a(n.default||n):u(null)},l.onerror=h=>{u(h)},r.appendChild(l)}})}function bs(t){return d.isFunction(t)&&Object.getOwnPropertyNames(t.prototype||{}).length===0||d.isFunction(t?.install)}function ys(t){return cs.includes(t)}function _s(t){return wt.includes(t)}function Se(t=globalThis){const e=globalThis?.Mock;if(e)return e;const s=t?.Mock;if(s&&globalThis)return globalThis.Mock=s,s}function Ii(t,e,s){Object.assign(e.meta,s.meta);const i=t?._container;s?.type==="page"&&i.classList.add("is-page"),s?.pure&&i.classList.add("is-pure")}function Ss(t){return/^\([\s\S]*\)/.test(t.trim())}function Cs(t){return/\w+\([\s\S]*\)$/.test(t.trim())}function ws(t){return t.includes("=")}var ct={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},lt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Ai={5:lt,"5module":lt+" export import",6:lt+" const class extends export import super"},Pi=/^in(stanceof)?$/,At="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Es="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",Ti=new RegExp("["+At+"]"),Ri=new RegExp("["+At+Es+"]");At=Es=null;var ks=[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,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,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,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],Ni=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function vt(t,e){for(var s=65536,i=0;i<e.length;i+=2){if(s+=e[i],s>t)return!1;if(s+=e[i+1],s>=t)return!0}}function ae(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&Ti.test(String.fromCharCode(t)):e===!1?!1:vt(t,ks)}function Ce(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&Ri.test(String.fromCharCode(t)):e===!1?!1:vt(t,ks)||vt(t,Ni)}var k=function(e,s){s===void 0&&(s={}),this.label=e,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop||null,this.updateContext=null};function $(t,e){return new k(t,{beforeExpr:!0,binop:e})}var G={beforeExpr:!0},U={startsExpr:!0},Pt={};function E(t,e){return e===void 0&&(e={}),e.keyword=t,Pt[t]=new k(t,e)}var o={num:new k("num",U),regexp:new k("regexp",U),string:new k("string",U),name:new k("name",U),eof:new k("eof"),bracketL:new k("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:!0,startsExpr:!0}),braceR:new k("}"),parenL:new k("(",{beforeExpr:!0,startsExpr:!0}),parenR:new k(")"),comma:new k(",",G),semi:new k(";",G),colon:new k(":",G),dot:new k("."),question:new k("?",G),questionDot:new k("?."),arrow:new k("=>",G),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",G),backQuote:new k("`",U),dollarBraceL:new k("${",{beforeExpr:!0,startsExpr:!0}),eq:new k("=",{beforeExpr:!0,isAssign:!0}),assign:new k("_=",{beforeExpr:!0,isAssign:!0}),incDec:new k("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new k("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:$("||",1),logicalAND:$("&&",2),bitwiseOR:$("|",3),bitwiseXOR:$("^",4),bitwiseAND:$("&",5),equality:$("==/!=/===/!==",6),relational:$("</>/<=/>=",7),bitShift:$("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:$("%",10),star:$("*",10),slash:$("/",10),starstar:new k("**",{beforeExpr:!0}),coalesce:$("??",1),_break:E("break"),_case:E("case",G),_catch:E("catch"),_continue:E("continue"),_debugger:E("debugger"),_default:E("default",G),_do:E("do",{isLoop:!0,beforeExpr:!0}),_else:E("else",G),_finally:E("finally"),_for:E("for",{isLoop:!0}),_function:E("function",U),_if:E("if"),_return:E("return",G),_switch:E("switch"),_throw:E("throw",G),_try:E("try"),_var:E("var"),_const:E("const"),_while:E("while",{isLoop:!0}),_with:E("with"),_new:E("new",{beforeExpr:!0,startsExpr:!0}),_this:E("this",U),_super:E("super",U),_class:E("class",U),_extends:E("extends",G),_export:E("export"),_import:E("import",U),_null:E("null",U),_true:E("true",U),_false:E("false",U),_in:E("in",{beforeExpr:!0,binop:7}),_instanceof:E("instanceof",{beforeExpr:!0,binop:7}),_typeof:E("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:E("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:E("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},K=/\r\n?|\n|\u2028|\u2029/,Ne=new RegExp(K.source,"g");function De(t,e){return t===10||t===13||!e&&(t===8232||t===8233)}var Is=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,q=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,As=Object.prototype,Oi=As.hasOwnProperty,Vi=As.toString;function Ye(t,e){return Oi.call(t,e)}var Qt=Array.isArray||(function(t){return Vi.call(t)==="[object Array]"});function he(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var Oe=function(e,s){this.line=e,this.column=s};Oe.prototype.offset=function(e){return new Oe(this.line,this.column+e)};var Xe=function(e,s,i){this.start=s,this.end=i,e.sourceFile!==null&&(this.source=e.sourceFile)};function Ps(t,e){for(var s=1,i=0;;){Ne.lastIndex=i;var r=Ne.exec(t);if(r&&r.index<e)++s,i=r.index+r[0].length;else return new Oe(s,e-i)}}var xt={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function Fi(t){var e={};for(var s in xt)e[s]=t&&Ye(t,s)?t[s]:xt[s];if(e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),Qt(e.onToken)){var i=e.onToken;e.onToken=function(r){return i.push(r)}}return Qt(e.onComment)&&(e.onComment=Li(e,e.onComment)),e}function Li(t,e){return function(s,i,r,n,a,u){var c={type:s?"Block":"Line",value:i,start:r,end:n};t.locations&&(c.loc=new Xe(this,a,u)),t.ranges&&(c.range=[r,n]),e.push(c)}}var Ve=1,Be=2,Tt=Ve|Be,Ts=4,Rs=8,Ns=16,Os=32,Vs=64,Fs=128;function Rt(t,e){return Be|(t?Ts:0)|(e?Rs:0)}var Yt=0,Nt=1,ee=2,Ls=3,js=4,Ms=5,T=function(e,s,i){this.options=e=Fi(e),this.sourceFile=e.sourceFile,this.keywords=he(Ai[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var r="";if(e.allowReserved!==!0){for(var n=e.ecmaVersion;!(r=ct[n]);n--);e.sourceType==="module"&&(r+=" await")}this.reservedWords=he(r);var a=(r?r+" ":"")+ct.strict;this.reservedWordsStrict=he(a),this.reservedWordsStrictBind=he(a+" "+ct.strictBind),this.input=String(s),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf(`
10
- `,i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(K).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=o.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ve),this.regexpState=null},fe={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};T.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};fe.inFunction.get=function(){return(this.currentVarScope().flags&Be)>0};fe.inGenerator.get=function(){return(this.currentVarScope().flags&Rs)>0};fe.inAsync.get=function(){return(this.currentVarScope().flags&Ts)>0};fe.allowSuper.get=function(){return(this.currentThisScope().flags&Vs)>0};fe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Fs)>0};fe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};T.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&Be)>0};T.extend=function(){for(var e=[],s=arguments.length;s--;)e[s]=arguments[s];for(var i=this,r=0;r<e.length;r++)i=e[r](i);return i};T.parse=function(e,s){return new this(s,e).parse()};T.parseExpressionAt=function(e,s,i){var r=new this(i,e,s);return r.nextToken(),r.parseExpression()};T.tokenizer=function(e,s){return new this(s,e)};Object.defineProperties(T.prototype,fe);var M=T.prototype,ji=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;M.strictDirective=function(t){for(;;){q.lastIndex=t,t+=q.exec(this.input)[0].length;var e=ji.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){q.lastIndex=t+e[0].length;var s=q.exec(this.input),i=s.index+s[0].length,r=this.input.charAt(i);return r===";"||r==="}"||K.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(i+1)==="=")}t+=e[0].length,q.lastIndex=t,t+=q.exec(this.input)[0].length,this.input[t]===";"&&t++}};M.eat=function(t){return this.type===t?(this.next(),!0):!1};M.isContextual=function(t){return this.type===o.name&&this.value===t&&!this.containsEsc};M.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};M.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};M.canInsertSemicolon=function(){return this.type===o.eof||this.type===o.braceR||K.test(this.input.slice(this.lastTokEnd,this.start))};M.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};M.semicolon=function(){!this.eat(o.semi)&&!this.insertSemicolon()&&this.unexpected()};M.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};M.expect=function(t){this.eat(t)||this.unexpected()};M.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};function Ze(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}M.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var s=e?t.parenthesizedAssign:t.parenthesizedBind;s>-1&&this.raiseRecoverable(s,"Parenthesized pattern")}};M.checkExpressionErrors=function(t,e){if(!t)return!1;var s=t.shorthandAssign,i=t.doubleProto;if(!e)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")};M.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};M.isSimpleAssignTarget=function(t){return t.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(t.expression):t.type==="Identifier"||t.type==="MemberExpression"};var _=T.prototype;_.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==o.eof;){var s=this.parseStatement(null,!0,e);t.body.push(s)}if(this.inModule)for(var i=0,r=Object.keys(this.undefinedExports);i<r.length;i+=1){var n=r[i];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")};var Ot={kind:"loop"},Mi={kind:"switch"};_.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;q.lastIndex=this.pos;var e=q.exec(this.input),s=this.pos+e[0].length,i=this.input.charCodeAt(s);if(i===91)return!0;if(t)return!1;if(i===123)return!0;if(ae(i,!0)){for(var r=s+1;Ce(this.input.charCodeAt(r),!0);)++r;var n=this.input.slice(s,r);if(!Pi.test(n))return!0}return!1};_.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;q.lastIndex=this.pos;var t=q.exec(this.input),e=this.pos+t[0].length;return!K.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!Ce(this.input.charAt(e+8)))};_.parseStatement=function(t,e,s){var i=this.type,r=this.startNode(),n;switch(this.isLet(t)&&(i=o._var,n="let"),i){case o._break:case o._continue:return this.parseBreakContinueStatement(r,i.keyword);case o._debugger:return this.parseDebuggerStatement(r);case o._do:return this.parseDoStatement(r);case o._for:return this.parseForStatement(r);case o._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case o._class:return t&&this.unexpected(),this.parseClass(r,!0);case o._if:return this.parseIfStatement(r);case o._return:return this.parseReturnStatement(r);case o._switch:return this.parseSwitchStatement(r);case o._throw:return this.parseThrowStatement(r);case o._try:return this.parseTryStatement(r);case o._const:case o._var:return n=n||this.value,t&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case o._while:return this.parseWhileStatement(r);case o._with:return this.parseWithStatement(r);case o.braceL:return this.parseBlock(!0,r);case o.semi:return this.parseEmptyStatement(r);case o._export:case o._import:if(this.options.ecmaVersion>10&&i===o._import){q.lastIndex=this.pos;var a=q.exec(this.input),u=this.pos+a[0].length,c=this.input.charCodeAt(u);if(c===40||c===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===o._import?this.parseImport(r):this.parseExport(r,s);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);var l=this.value,h=this.parseExpression();return i===o.name&&h.type==="Identifier"&&this.eat(o.colon)?this.parseLabeledStatement(r,l,h,t):this.parseExpressionStatement(r,h)}};_.parseBreakContinueStatement=function(t,e){var s=e==="break";this.next(),this.eat(o.semi)||this.insertSemicolon()?t.label=null:this.type!==o.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var r=this.labels[i];if((t.label==null||r.name===t.label.name)&&(r.kind!=null&&(s||r.kind==="loop")||t.label&&s))break}return i===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,s?"BreakStatement":"ContinueStatement")};_.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};_.parseDoStatement=function(t){return this.next(),this.labels.push(Ot),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(o._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(o.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};_.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ot),this.enterScope(0),this.expect(o.parenL),this.type===o.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var s=this.isLet();if(this.type===o._var||this.type===o._const||s){var i=this.startNode(),r=s?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&i.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===o._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,i)):(e>-1&&this.unexpected(e),this.parseFor(t,i))}var n=new Ze,a=this.parseExpression(!0,n);return this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===o._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(a,!1,n),this.checkLVal(a),this.parseForIn(t,a)):(this.checkExpressionErrors(n,!0),e>-1&&this.unexpected(e),this.parseFor(t,a))};_.parseFunctionStatement=function(t,e,s){return this.next(),this.parseFunction(t,Re|(s?0:bt),!1,e)};_.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(o._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};_.parseReturnStatement=function(t){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(o.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};_.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(o.braceL),this.labels.push(Mi),this.enterScope(0);for(var e,s=!1;this.type!==o.braceR;)if(this.type===o._case||this.type===o._default){var i=this.type===o._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),i?e.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,e.test=null),this.expect(o.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};_.parseThrowStatement=function(t){return this.next(),K.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Di=[];_.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===o._catch){var e=this.startNode();if(this.next(),this.eat(o.parenL)){e.param=this.parseBindingAtom();var s=e.param.type==="Identifier";this.enterScope(s?Os:0),this.checkLVal(e.param,s?js:ee),this.expect(o.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(o._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};_.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")};_.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(Ot),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};_.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};_.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};_.parseLabeledStatement=function(t,e,s,i){for(var r=0,n=this.labels;r<n.length;r+=1){var a=n[r];a.name===e&&this.raise(s.start,"Label '"+e+"' is already declared")}for(var u=this.type.isLoop?"loop":this.type===o._switch?"switch":null,c=this.labels.length-1;c>=0;c--){var l=this.labels[c];if(l.statementStart===t.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:e,kind:u,statementStart:this.start}),t.body=this.parseStatement(i?i.indexOf("label")===-1?i+"label":i:"label"),this.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")};_.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};_.parseBlock=function(t,e,s){for(t===void 0&&(t=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(o.braceL),t&&this.enterScope(0);this.type!==o.braceR;){var i=this.parseStatement(null);e.body.push(i)}return s&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};_.parseFor=function(t,e){return t.init=e,this.expect(o.semi),t.test=this.type===o.semi?null:this.parseExpression(),this.expect(o.semi),t.update=this.type===o.parenR?null:this.parseExpression(),this.expect(o.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};_.parseForIn=function(t,e){var s=this.type===o._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!s||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")?this.raise(e.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"):e.type==="AssignmentPattern"&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(o.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,s?"ForInStatement":"ForOfStatement")};_.parseVar=function(t,e,s){for(t.declarations=[],t.kind=s;;){var i=this.startNode();if(this.parseVarId(i,s),this.eat(o.eq)?i.init=this.parseMaybeAssign(e):s==="const"&&!(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():i.id.type!=="Identifier"&&!(e&&(this.type===o._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,t.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(o.comma))break}return t};_.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,e==="var"?Nt:ee,!1)};var Re=1,bt=2,Ds=4;_.parseFunction=function(t,e,s,i){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===o.star&&e&bt&&this.unexpected(),t.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(t.async=!!i),e&Re&&(t.id=e&Ds&&this.type!==o.name?null:this.parseIdent(),t.id&&!(e&bt)&&this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?Nt:ee:Ls));var r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Rt(t.async,t.generator)),e&Re||(t.id=this.type===o.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,s,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(t,e&Re?"FunctionDeclaration":"FunctionExpression")};_.parseFunctionParams=function(t){this.expect(o.parenL),t.params=this.parseBindingList(o.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};_.parseClass=function(t,e){this.next();var s=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var i=this.startNode(),r=!1;for(i.body=[],this.expect(o.braceL);this.type!==o.braceR;){var n=this.parseClassElement(t.superClass!==null);n&&(i.body.push(n),n.type==="MethodDefinition"&&n.kind==="constructor"&&(r&&this.raise(n.start,"Duplicate constructor in the same class"),r=!0))}return this.strict=s,this.next(),t.body=this.finishNode(i,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};_.parseClassElement=function(t){var e=this;if(this.eat(o.semi))return null;var s=this.startNode(),i=function(c,l){l===void 0&&(l=!1);var h=e.start,p=e.startLoc;return e.eatContextual(c)?e.type!==o.parenL&&(!l||!e.canInsertSemicolon())?!0:(s.key&&e.unexpected(),s.computed=!1,s.key=e.startNodeAt(h,p),s.key.name=c,e.finishNode(s.key,"Identifier"),!1):!1};s.kind="method",s.static=i("static");var r=this.eat(o.star),n=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(o.star)):i("get")?s.kind="get":i("set")&&(s.kind="set")),s.key||this.parsePropertyName(s);var a=s.key,u=!1;return!s.computed&&!s.static&&(a.type==="Identifier"&&a.name==="constructor"||a.type==="Literal"&&a.value==="constructor")?(s.kind!=="method"&&this.raise(a.start,"Constructor can't have get/set modifier"),r&&this.raise(a.start,"Constructor can't be a generator"),n&&this.raise(a.start,"Constructor can't be an async method"),s.kind="constructor",u=t):s.static&&a.type==="Identifier"&&a.name==="prototype"&&this.raise(a.start,"Classes may not have a static property named prototype"),this.parseClassMethod(s,r,n,u),s.kind==="get"&&s.value.params.length!==0&&this.raiseRecoverable(s.value.start,"getter should have no params"),s.kind==="set"&&s.value.params.length!==1&&this.raiseRecoverable(s.value.start,"setter should have exactly one param"),s.kind==="set"&&s.value.params[0].type==="RestElement"&&this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params"),s};_.parseClassMethod=function(t,e,s,i){return t.value=this.parseMethod(e,s,i),this.finishNode(t,"MethodDefinition")};_.parseClassId=function(t,e){this.type===o.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,ee,!1)):(e===!0&&this.unexpected(),t.id=null)};_.parseClassSuper=function(t){t.superClass=this.eat(o._extends)?this.parseExprSubscripts():null};_.parseExport=function(t,e){if(this.next(),this.eat(o.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseIdent(!0),this.checkExport(e,t.exported.name,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==o.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(o._default)){this.checkExport(e,"default",this.lastTokStart);var s;if(this.type===o._function||(s=this.isAsyncFunction())){var i=this.startNode();this.next(),s&&this.next(),t.declaration=this.parseFunction(i,Re|Ds,!1,s)}else if(this.type===o._class){var r=this.startNode();t.declaration=this.parseClass(r,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==o.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var n=0,a=t.specifiers;n<a.length;n+=1){var u=a[n];this.checkUnreserved(u.local),this.checkLocalExport(u.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};_.checkExport=function(t,e,s){t&&(Ye(t,e)&&this.raiseRecoverable(s,"Duplicate export '"+e+"'"),t[e]=!0)};_.checkPatternExport=function(t,e){var s=e.type;if(s==="Identifier")this.checkExport(t,e.name,e.start);else if(s==="ObjectPattern")for(var i=0,r=e.properties;i<r.length;i+=1){var n=r[i];this.checkPatternExport(t,n)}else if(s==="ArrayPattern")for(var a=0,u=e.elements;a<u.length;a+=1){var c=u[a];c&&this.checkPatternExport(t,c)}else s==="Property"?this.checkPatternExport(t,e.value):s==="AssignmentPattern"?this.checkPatternExport(t,e.left):s==="RestElement"?this.checkPatternExport(t,e.argument):s==="ParenthesizedExpression"&&this.checkPatternExport(t,e.expression)};_.checkVariableExport=function(t,e){if(t)for(var s=0,i=e;s<i.length;s+=1){var r=i[s];this.checkPatternExport(t,r.id)}};_.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};_.parseExportSpecifiers=function(t){var e=[],s=!0;for(this.expect(o.braceL);!this.eat(o.braceR);){if(s)s=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;var i=this.startNode();i.local=this.parseIdent(!0),i.exported=this.eatContextual("as")?this.parseIdent(!0):i.local,this.checkExport(t,i.exported.name,i.exported.start),e.push(this.finishNode(i,"ExportSpecifier"))}return e};_.parseImport=function(t){return this.next(),this.type===o.string?(t.specifiers=Di,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===o.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")};_.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===o.name){var s=this.startNode();if(s.local=this.parseIdent(),this.checkLVal(s.local,ee),t.push(this.finishNode(s,"ImportDefaultSpecifier")),!this.eat(o.comma))return t}if(this.type===o.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLVal(i.local,ee),t.push(this.finishNode(i,"ImportNamespaceSpecifier")),t}for(this.expect(o.braceL);!this.eat(o.braceR);){if(e)e=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;var r=this.startNode();r.imported=this.parseIdent(!0),this.eatContextual("as")?r.local=this.parseIdent():(this.checkUnreserved(r.imported),r.local=r.imported),this.checkLVal(r.local,ee),t.push(this.finishNode(r,"ImportSpecifier"))}return t};_.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};_.isDirectiveCandidate=function(t){return t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var te=T.prototype;te.toAssignable=function(t,e,s){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,r=t.properties;i<r.length;i+=1){var n=r[i];this.toAssignable(n,e),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":t.kind!=="init"&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern"&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":t.operator!=="="&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,s);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return t};te.toAssignableList=function(t,e){for(var s=t.length,i=0;i<s;i++){var r=t[i];r&&this.toAssignable(r,e)}if(s){var n=t[s-1];this.options.ecmaVersion===6&&e&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return t};te.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};te.parseRestBinding=function(){var t=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==o.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};te.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case o.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(o.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case o.braceL:return this.parseObj(!0)}return this.parseIdent()};te.parseBindingList=function(t,e,s){for(var i=[],r=!0;!this.eat(t);)if(r?r=!1:this.expect(o.comma),e&&this.type===o.comma)i.push(null);else{if(s&&this.afterTrailingComma(t))break;if(this.type===o.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),i.push(n),this.type===o.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}else{var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),i.push(a)}}return i};te.parseBindingListItem=function(t){return t};te.parseMaybeDefault=function(t,e,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(o.eq))return s;var i=this.startNodeAt(t,e);return i.left=s,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")};te.checkLVal=function(t,e,s){switch(e===void 0&&(e=Yt),t.type){case"Identifier":e===ee&&t.name==="let"&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),s&&(Ye(s,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),s[t.name]=!0),e!==Yt&&e!==Ms&&this.declareName(t.name,e,t.start);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var i=0,r=t.properties;i<r.length;i+=1){var n=r[i];this.checkLVal(n,e,s)}break;case"Property":this.checkLVal(t.value,e,s);break;case"ArrayPattern":for(var a=0,u=t.elements;a<u.length;a+=1){var c=u[a];c&&this.checkLVal(c,e,s)}break;case"AssignmentPattern":this.checkLVal(t.left,e,s);break;case"RestElement":this.checkLVal(t.argument,e,s);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,s);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}};var S=T.prototype;S.checkPropClash=function(t,e,s){if(!(this.options.ecmaVersion>=9&&t.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var i=t.key,r;switch(i.type){case"Identifier":r=i.name;break;case"Literal":r=String(i.value);break;default:return}var n=t.kind;if(this.options.ecmaVersion>=6){r==="__proto__"&&n==="init"&&(e.proto&&(s?s.doubleProto<0&&(s.doubleProto=i.start):this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),e.proto=!0);return}r="$"+r;var a=e[r];if(a){var u;n==="init"?u=this.strict&&a.init||a.get||a.set:u=a.init||a[n],u&&this.raiseRecoverable(i.start,"Redefinition of property")}else a=e[r]={init:!1,get:!1,set:!1};a[n]=!0}};S.parseExpression=function(t,e){var s=this.start,i=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type===o.comma){var n=this.startNodeAt(s,i);for(n.expressions=[r];this.eat(o.comma);)n.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(n,"SequenceExpression")}return r};S.parseMaybeAssign=function(t,e,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var i=!1,r=-1,n=-1;e?(r=e.parenthesizedAssign,n=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new Ze,i=!0);var a=this.start,u=this.startLoc;(this.type===o.parenL||this.type===o.name)&&(this.potentialArrowAt=this.start);var c=this.parseMaybeConditional(t,e);if(s&&(c=s.call(this,c,a,u)),this.type.isAssign){var l=this.startNodeAt(a,u);return l.operator=this.value,l.left=this.type===o.eq?this.toAssignable(c,!1,e):c,i||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=l.left.start&&(e.shorthandAssign=-1),this.checkLVal(c),this.next(),l.right=this.parseMaybeAssign(t),this.finishNode(l,"AssignmentExpression")}else i&&this.checkExpressionErrors(e,!0);return r>-1&&(e.parenthesizedAssign=r),n>-1&&(e.trailingComma=n),c};S.parseMaybeConditional=function(t,e){var s=this.start,i=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(this.eat(o.question)){var n=this.startNodeAt(s,i);return n.test=r,n.consequent=this.parseMaybeAssign(),this.expect(o.colon),n.alternate=this.parseMaybeAssign(t),this.finishNode(n,"ConditionalExpression")}return r};S.parseExprOps=function(t,e){var s=this.start,i=this.startLoc,r=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)||r.start===s&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,s,i,-1,t)};S.parseExprOp=function(t,e,s,i,r){var n=this.type.binop;if(n!=null&&(!r||this.type!==o._in)&&n>i){var a=this.type===o.logicalOR||this.type===o.logicalAND,u=this.type===o.coalesce;u&&(n=o.logicalAND.binop);var c=this.value;this.next();var l=this.start,h=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1),l,h,n,r),m=this.buildBinary(e,s,t,p,c,a||u);return(a&&this.type===o.coalesce||u&&(this.type===o.logicalOR||this.type===o.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(m,e,s,i,r)}return t};S.buildBinary=function(t,e,s,i,r,n){var a=this.startNodeAt(t,e);return a.left=s,a.operator=r,a.right=i,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};S.parseMaybeUnary=function(t,e){var s=this.start,i=this.startLoc,r;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))r=this.parseAwait(),e=!0;else if(this.type.prefix){var n=this.startNode(),a=this.type===o.incDec;n.operator=this.value,n.prefix=!0,this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),a?this.checkLVal(n.argument):this.strict&&n.operator==="delete"&&n.argument.type==="Identifier"?this.raiseRecoverable(n.start,"Deleting local variable in strict mode"):e=!0,r=this.finishNode(n,a?"UpdateExpression":"UnaryExpression")}else{if(r=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=this.startNodeAt(s,i);u.operator=this.value,u.prefix=!1,u.argument=r,this.checkLVal(r),this.next(),r=this.finishNode(u,"UpdateExpression")}}return!e&&this.eat(o.starstar)?this.buildBinary(s,i,r,this.parseMaybeUnary(null,!1),"**",!1):r};S.parseExprSubscripts=function(t){var e=this.start,s=this.startLoc,i=this.parseExprAtom(t);if(i.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return i;var r=this.parseSubscripts(i,e,s);return t&&r.type==="MemberExpression"&&(t.parenthesizedAssign>=r.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=r.start&&(t.parenthesizedBind=-1)),r};S.parseSubscripts=function(t,e,s,i){for(var r=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.potentialArrowAt===t.start,n=!1;;){var a=this.parseSubscript(t,e,s,i,r,n);if(a.optional&&(n=!0),a===t||a.type==="ArrowFunctionExpression"){if(n){var u=this.startNodeAt(e,s);u.expression=a,a=this.finishNode(u,"ChainExpression")}return a}t=a}};S.parseSubscript=function(t,e,s,i,r,n){var a=this.options.ecmaVersion>=11,u=a&&this.eat(o.questionDot);i&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(o.bracketL);if(c||u&&this.type!==o.parenL&&this.type!==o.backQuote||this.eat(o.dot)){var l=this.startNodeAt(e,s);l.object=t,l.property=c?this.parseExpression():this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!c,c&&this.expect(o.bracketR),a&&(l.optional=u),t=this.finishNode(l,"MemberExpression")}else if(!i&&this.eat(o.parenL)){var h=new Ze,p=this.yieldPos,m=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var g=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,!1,h);if(r&&!u&&!this.canInsertSemicolon()&&this.eat(o.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=p,this.awaitPos=m,this.awaitIdentPos=f,this.parseArrowExpression(this.startNodeAt(e,s),g,!0);this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;var b=this.startNodeAt(e,s);b.callee=t,b.arguments=g,a&&(b.optional=u),t=this.finishNode(b,"CallExpression")}else if(this.type===o.backQuote){(u||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var v=this.startNodeAt(e,s);v.tag=t,v.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(v,"TaggedTemplateExpression")}return t};S.parseExprAtom=function(t){this.type===o.slash&&this.readRegexp();var e,s=this.potentialArrowAt===this.start;switch(this.type){case o._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),e=this.startNode(),this.next(),this.type===o.parenL&&!this.allowDirectSuper&&this.raise(e.start,"super() call outside constructor of a subclass"),this.type!==o.dot&&this.type!==o.bracketL&&this.type!==o.parenL&&this.unexpected(),this.finishNode(e,"Super");case o._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case o.name:var i=this.start,r=this.startLoc,n=this.containsEsc,a=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!n&&a.name==="async"&&!this.canInsertSemicolon()&&this.eat(o._function))return this.parseFunction(this.startNodeAt(i,r),0,!1,!0);if(s&&!this.canInsertSemicolon()){if(this.eat(o.arrow))return this.parseArrowExpression(this.startNodeAt(i,r),[a],!1);if(this.options.ecmaVersion>=8&&a.name==="async"&&this.type===o.name&&!n)return a=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,r),[a],!0)}return a;case o.regexp:var u=this.value;return e=this.parseLiteral(u.value),e.regex={pattern:u.pattern,flags:u.flags},e;case o.num:case o.string:return this.parseLiteral(this.value);case o._null:case o._true:case o._false:return e=this.startNode(),e.value=this.type===o._null?null:this.type===o._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case o.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(s);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(t.parenthesizedAssign=c),t.parenthesizedBind<0&&(t.parenthesizedBind=c)),l;case o.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(o.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case o.braceL:return this.parseObj(!1,t);case o._function:return e=this.startNode(),this.next(),this.parseFunction(e,0);case o._class:return this.parseClass(this.startNode(),!1);case o._new:return this.parseNew();case o.backQuote:return this.parseTemplate();case o._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};S.parseExprImport=function(){var t=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var e=this.parseIdent(!0);switch(this.type){case o.parenL:return this.parseDynamicImport(t);case o.dot:return t.meta=e,this.parseImportMeta(t);default:this.unexpected()}};S.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(o.parenR)){var e=this.start;this.eat(o.comma)&&this.eat(o.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")};S.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};S.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};S.parseParenExpression=function(){this.expect(o.parenL);var t=this.parseExpression();return this.expect(o.parenR),t};S.parseParenAndDistinguishExpression=function(t){var e=this.start,s=this.startLoc,i,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var n=this.start,a=this.startLoc,u=[],c=!0,l=!1,h=new Ze,p=this.yieldPos,m=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==o.parenR;)if(c?c=!1:this.expect(o.comma),r&&this.afterTrailingComma(o.parenR,!0)){l=!0;break}else if(this.type===o.ellipsis){f=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===o.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,h,this.parseParenItem));var g=this.start,b=this.startLoc;if(this.expect(o.parenR),t&&!this.canInsertSemicolon()&&this.eat(o.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=m,this.parseParenArrowList(e,s,u);(!u.length||l)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,u.length>1?(i=this.startNodeAt(n,a),i.expressions=u,this.finishNodeAt(i,"SequenceExpression",g,b)):i=u[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(e,s);return v.expression=i,this.finishNode(v,"ParenthesizedExpression")}else return i};S.parseParenItem=function(t){return t};S.parseParenArrowList=function(t,e,s){return this.parseArrowExpression(this.startNodeAt(t,e),s)};var Bi=[];S.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(o.dot)){t.meta=e;var s=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(t.start,"'new.target' can only be used in functions"),this.finishNode(t,"MetaProperty")}var i=this.start,r=this.startLoc,n=this.type===o._import;return t.callee=this.parseSubscripts(this.parseExprAtom(),i,r,!0),n&&t.callee.type==="ImportExpression"&&this.raise(i,"Cannot use new with import()"),this.eat(o.parenL)?t.arguments=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,!1):t.arguments=Bi,this.finishNode(t,"NewExpression")};S.parseTemplateElement=function(t){var e=t.isTagged,s=this.startNode();return this.type===o.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value,cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
11
- `),cooked:this.value},this.next(),s.tail=this.type===o.backQuote,this.finishNode(s,"TemplateElement")};S.parseTemplate=function(t){t===void 0&&(t={});var e=t.isTagged;e===void 0&&(e=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:e});for(s.quasis=[i];!i.tail;)this.type===o.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(o.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(o.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(s,"TemplateLiteral")};S.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===o.name||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===o.star)&&!K.test(this.input.slice(this.lastTokEnd,this.start))};S.parseObj=function(t,e){var s=this.startNode(),i=!0,r={};for(s.properties=[],this.next();!this.eat(o.braceR);){if(i)i=!1;else if(this.expect(o.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(o.braceR))break;var n=this.parseProperty(t,e);t||this.checkPropClash(n,r,e),s.properties.push(n)}return this.finishNode(s,t?"ObjectPattern":"ObjectExpression")};S.parseProperty=function(t,e){var s=this.startNode(),i,r,n,a;if(this.options.ecmaVersion>=9&&this.eat(o.ellipsis))return t?(s.argument=this.parseIdent(!1),this.type===o.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(s,"RestElement")):(this.type===o.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),s.argument=this.parseMaybeAssign(!1,e),this.type===o.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(s,"SpreadElement"));this.options.ecmaVersion>=6&&(s.method=!1,s.shorthand=!1,(t||e)&&(n=this.start,a=this.startLoc),t||(i=this.eat(o.star)));var u=this.containsEsc;return this.parsePropertyName(s),!t&&!u&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(s)?(r=!0,i=this.options.ecmaVersion>=9&&this.eat(o.star),this.parsePropertyName(s,e)):r=!1,this.parsePropertyValue(s,t,i,r,n,a,e,u),this.finishNode(s,"Property")};S.parsePropertyValue=function(t,e,s,i,r,n,a,u){if((s||i)&&this.type===o.colon&&this.unexpected(),this.eat(o.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===o.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(s,i);else if(!e&&!u&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==o.comma&&this.type!==o.braceR&&this.type!==o.eq){(s||i)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var c=t.kind==="get"?0:1;if(t.value.params.length!==c){var l=t.value.start;t.kind==="get"?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((s||i)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),t.kind="init",e?t.value=this.parseMaybeDefault(r,n,t.key):this.type===o.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,n,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected()};S.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(o.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(o.bracketR),t.key;t.computed=!1}return t.key=this.type===o.num||this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};S.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};S.parseMethod=function(t,e,s){var i=this.startNode(),r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=t),this.options.ecmaVersion>=8&&(i.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Rt(e,i.generator)|Vs|(s?Fs:0)),this.expect(o.parenL),i.params=this.parseBindingList(o.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")};S.parseArrowExpression=function(t,e,s){var i=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.enterScope(Rt(s,!1)|Ns),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=i,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(t,"ArrowFunctionExpression")};S.parseFunctionBody=function(t,e,s){var i=e&&this.type!==o.braceL,r=this.strict,n=!1;if(i)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!r||a)&&(n=this.strictDirective(this.end),n&&a&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],n&&(this.strict=!0),this.checkParams(t,!r&&!n&&!e&&!s&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLVal(t.id,Ms),t.body=this.parseBlock(!1,void 0,n&&!r),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=u}this.exitScope()};S.isSimpleParamList=function(t){for(var e=0,s=t;e<s.length;e+=1){var i=s[e];if(i.type!=="Identifier")return!1}return!0};S.checkParams=function(t,e){for(var s={},i=0,r=t.params;i<r.length;i+=1){var n=r[i];this.checkLVal(n,Nt,e?null:s)}};S.parseExprList=function(t,e,s,i){for(var r=[],n=!0;!this.eat(t);){if(n)n=!1;else if(this.expect(o.comma),e&&this.afterTrailingComma(t))break;var a=void 0;s&&this.type===o.comma?a=null:this.type===o.ellipsis?(a=this.parseSpread(i),i&&this.type===o.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):a=this.parseMaybeAssign(!1,i),r.push(a)}return r};S.checkUnreserved=function(t){var e=t.start,s=t.end,i=t.name;if(this.inGenerator&&i==="yield"&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(i)&&this.raise(e,"Unexpected keyword '"+i+"'"),!(this.options.ecmaVersion<6&&this.input.slice(e,s).indexOf("\\")!==-1)){var r=this.strict?this.reservedWordsStrict:this.reservedWords;r.test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+i+"' is reserved"))}};S.parseIdent=function(t,e){var s=this.startNode();return this.type===o.name?s.name=this.value:this.type.keyword?(s.name=this.type.keyword,(s.name==="class"||s.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!t),this.finishNode(s,"Identifier"),t||(this.checkUnreserved(s),s.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s.start)),s};S.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===o.semi||this.canInsertSemicolon()||this.type!==o.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(o.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")};S.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!1),this.finishNode(t,"AwaitExpression")};var We=T.prototype;We.raise=function(t,e){var s=Ps(this.input,t);e+=" ("+s.line+":"+s.column+")";var i=new SyntaxError(e);throw i.pos=t,i.loc=s,i.raisedAt=this.pos,i};We.raiseRecoverable=We.raise;We.curPosition=function(){if(this.options.locations)return new Oe(this.curLine,this.pos-this.lineStart)};var oe=T.prototype,Hi=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};oe.enterScope=function(t){this.scopeStack.push(new Hi(t))};oe.exitScope=function(){this.scopeStack.pop()};oe.treatFunctionsAsVarInScope=function(t){return t.flags&Be||!this.inModule&&t.flags&Ve};oe.declareName=function(t,e,s){var i=!1;if(e===ee){var r=this.currentScope();i=r.lexical.indexOf(t)>-1||r.functions.indexOf(t)>-1||r.var.indexOf(t)>-1,r.lexical.push(t),this.inModule&&r.flags&Ve&&delete this.undefinedExports[t]}else if(e===js){var n=this.currentScope();n.lexical.push(t)}else if(e===Ls){var a=this.currentScope();this.treatFunctionsAsVar?i=a.lexical.indexOf(t)>-1:i=a.lexical.indexOf(t)>-1||a.var.indexOf(t)>-1,a.functions.push(t)}else for(var u=this.scopeStack.length-1;u>=0;--u){var c=this.scopeStack[u];if(c.lexical.indexOf(t)>-1&&!(c.flags&Os&&c.lexical[0]===t)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(t)>-1){i=!0;break}if(c.var.push(t),this.inModule&&c.flags&Ve&&delete this.undefinedExports[t],c.flags&Tt)break}i&&this.raiseRecoverable(s,"Identifier '"+t+"' has already been declared")};oe.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};oe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};oe.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&Tt)return e}};oe.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&Tt&&!(e.flags&Ns))return e}};var Vt=function(e,s,i){this.type="",this.start=s,this.end=0,e.options.locations&&(this.loc=new Xe(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[s,0])},et=T.prototype;et.startNode=function(){return new Vt(this,this.start,this.startLoc)};et.startNodeAt=function(t,e){return new Vt(this,t,e)};function Bs(t,e,s,i){return t.type=e,t.end=s,this.options.locations&&(t.loc.end=i),this.options.ranges&&(t.range[1]=s),t}et.finishNode=function(t,e){return Bs.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};et.finishNodeAt=function(t,e,s,i){return Bs.call(this,t,e,s,i)};var z=function(e,s,i,r,n){this.token=e,this.isExpr=!!s,this.preserveSpace=!!i,this.override=r,this.generator=!!n},A={b_stat:new z("{",!1),b_expr:new z("{",!0),b_tmpl:new z("${",!1),p_stat:new z("(",!1),p_expr:new z("(",!0),q_tmpl:new z("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new z("function",!1),f_expr:new z("function",!0),f_expr_gen:new z("function",!0,!1,null,!0),f_gen:new z("function",!1,!1,null,!0)},tt=T.prototype;tt.initialContext=function(){return[A.b_stat]};tt.braceIsBlock=function(t){var e=this.curContext();return e===A.f_expr||e===A.f_stat?!0:t===o.colon&&(e===A.b_stat||e===A.b_expr)?!e.isExpr:t===o._return||t===o.name&&this.exprAllowed?K.test(this.input.slice(this.lastTokEnd,this.start)):t===o._else||t===o.semi||t===o.eof||t===o.parenR||t===o.arrow?!0:t===o.braceL?e===A.b_stat:t===o._var||t===o._const||t===o.name?!1:!this.exprAllowed};tt.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if(e.token==="function")return e.generator}return!1};tt.updateContext=function(t){var e,s=this.type;s.keyword&&t===o.dot?this.exprAllowed=!1:(e=s.updateContext)?e.call(this,t):this.exprAllowed=s.beforeExpr};o.parenR.updateContext=o.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var t=this.context.pop();t===A.b_stat&&this.curContext().token==="function"&&(t=this.context.pop()),this.exprAllowed=!t.isExpr};o.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?A.b_stat:A.b_expr),this.exprAllowed=!0};o.dollarBraceL.updateContext=function(){this.context.push(A.b_tmpl),this.exprAllowed=!0};o.parenL.updateContext=function(t){var e=t===o._if||t===o._for||t===o._with||t===o._while;this.context.push(e?A.p_stat:A.p_expr),this.exprAllowed=!0};o.incDec.updateContext=function(){};o._function.updateContext=o._class.updateContext=function(t){t.beforeExpr&&t!==o.semi&&t!==o._else&&!(t===o._return&&K.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===o.colon||t===o.braceL)&&this.curContext()===A.b_stat)?this.context.push(A.f_expr):this.context.push(A.f_stat),this.exprAllowed=!1};o.backQuote.updateContext=function(){this.curContext()===A.q_tmpl?this.context.pop():this.context.push(A.q_tmpl),this.exprAllowed=!1};o.star.updateContext=function(t){if(t===o._function){var e=this.context.length-1;this.context[e]===A.f_expr?this.context[e]=A.f_expr_gen:this.context[e]=A.f_gen}this.exprAllowed=!0};o.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==o.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var Hs="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Us=Hs+" Extended_Pictographic",Ui=Us,$i={9:Hs,10:Us,11:Ui},Xt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",$s="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Gs=$s+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Gi=Gs+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",qi={9:$s,10:Gs,11:Gi},qs={};function Ft(t){var e=qs[t]={binary:he($i[t]+" "+Xt),nonBinary:{General_Category:he(Xt),Script:he(qi[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}Ft(9);Ft(10);Ft(11);var y=T.prototype,se=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=qs[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};se.prototype.reset=function(e,s,i){var r=i.indexOf("u")!==-1;this.start=e|0,this.source=s+"",this.flags=i,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9};se.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)};se.prototype.at=function(e,s){s===void 0&&(s=!1);var i=this.source,r=i.length;if(e>=r)return-1;var n=i.charCodeAt(e);if(!(s||this.switchU)||n<=55295||n>=57344||e+1>=r)return n;var a=i.charCodeAt(e+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};se.prototype.nextIndex=function(e,s){s===void 0&&(s=!1);var i=this.source,r=i.length;if(e>=r)return r;var n=i.charCodeAt(e),a;return!(s||this.switchU)||n<=55295||n>=57344||e+1>=r||(a=i.charCodeAt(e+1))<56320||a>57343?e+1:e+2};se.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)};se.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)};se.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)};se.prototype.eat=function(e,s){return s===void 0&&(s=!1),this.current(s)===e?(this.advance(s),!0):!1};function Ke(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}y.validateRegExpFlags=function(t){for(var e=t.validFlags,s=t.flags,i=0;i<s.length;i++){var r=s.charAt(i);e.indexOf(r)===-1&&this.raise(t.start,"Invalid regular expression flag"),s.indexOf(r,i+1)>-1&&this.raise(t.start,"Duplicate regular expression flag")}};y.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))};y.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,s=t.backReferenceNames;e<s.length;e+=1){var i=s[e];t.groupNames.indexOf(i)===-1&&t.raise("Invalid named capture referenced")}};y.regexp_disjunction=function(t){for(this.regexp_alternative(t);t.eat(124);)this.regexp_alternative(t);this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};y.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););};y.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))?(this.regexp_eatQuantifier(t),!0):!1};y.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var s=!1;if(this.options.ecmaVersion>=9&&(s=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!s,!0}return t.pos=e,!1};y.regexp_eatQuantifier=function(t,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};y.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};y.regexp_eatBracedQuantifier=function(t,e){var s=t.pos;if(t.eat(123)){var i=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(i=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return r!==-1&&r<i&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=s}return!1};y.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)};y.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1};y.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)&&t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}t.pos=e}return!1};y.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};y.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};y.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};y.regexp_eatSyntaxCharacter=function(t){var e=t.current();return Ws(e)?(t.lastIntValue=e,t.advance(),!0):!1};function Ws(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}y.regexp_eatPatternCharacters=function(t){for(var e=t.pos,s=0;(s=t.current())!==-1&&!Ws(s);)t.advance();return t.pos!==e};y.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};y.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t)){t.groupNames.indexOf(t.lastStringValue)!==-1&&t.raise("Duplicate capture group name"),t.groupNames.push(t.lastStringValue);return}t.raise("Invalid group")}};y.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1};y.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Ke(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Ke(t.lastIntValue);return!0}return!1};y.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,s=this.options.ecmaVersion>=11,i=t.current(s);return t.advance(s),i===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,s)&&(i=t.lastIntValue),Wi(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)};function Wi(t){return ae(t,!0)||t===36||t===95}y.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,s=this.options.ecmaVersion>=11,i=t.current(s);return t.advance(s),i===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,s)&&(i=t.lastIntValue),Ki(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)};function Ki(t){return Ce(t,!0)||t===36||t===95||t===8204||t===8205}y.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};y.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var s=t.lastIntValue;if(t.switchU)return s>t.maxBackReference&&(t.maxBackReference=s),!0;if(s<=t.numCapturingParens)return!0;t.pos=e}return!1};y.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};y.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};y.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};y.regexp_eatZero=function(t){return t.current()===48&&!st(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};y.regexp_eatControlEscape=function(t){var e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};y.regexp_eatControlLetter=function(t){var e=t.current();return Ks(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};function Ks(t){return t>=65&&t<=90||t>=97&&t<=122}y.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){e===void 0&&(e=!1);var s=t.pos,i=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var r=t.lastIntValue;if(i&&r>=55296&&r<=56319){var n=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var a=t.lastIntValue;if(a>=56320&&a<=57343)return t.lastIntValue=(r-55296)*1024+(a-56320)+65536,!0}t.pos=n,t.lastIntValue=r}return!0}if(i&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&zi(t.lastIntValue))return!0;i&&t.raise("Invalid unicode escape"),t.pos=s}return!1};function zi(t){return t>=0&&t<=1114111}y.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;var e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};y.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1};y.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(Ji(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(e===80||e===112)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1};function Ji(t){return t===100||t===68||t===115||t===83||t===119||t===87}y.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var s=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,s,i),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var r=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,r),!0}return!1};y.regexp_validateUnicodePropertyNameAndValue=function(t,e,s){Ye(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(s)||t.raise("Invalid property value")};y.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")};y.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";zs(e=t.current());)t.lastStringValue+=Ke(e),t.advance();return t.lastStringValue!==""};function zs(t){return Ks(t)||t===95}y.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Qi(e=t.current());)t.lastStringValue+=Ke(e),t.advance();return t.lastStringValue!==""};function Qi(t){return zs(t)||st(t)}y.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};y.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1};y.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var s=t.lastIntValue;t.switchU&&(e===-1||s===-1)&&t.raise("Invalid character class"),e!==-1&&s!==-1&&e>s&&t.raise("Range out of order in character class")}}};y.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var s=t.current();(s===99||Ys(s))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var i=t.current();return i!==93?(t.lastIntValue=i,t.advance(),!0):!1};y.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};y.regexp_eatClassControlLetter=function(t){var e=t.current();return st(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};y.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};y.regexp_eatDecimalDigits=function(t){var e=t.pos,s=0;for(t.lastIntValue=0;st(s=t.current());)t.lastIntValue=10*t.lastIntValue+(s-48),t.advance();return t.pos!==e};function st(t){return t>=48&&t<=57}y.regexp_eatHexDigits=function(t){var e=t.pos,s=0;for(t.lastIntValue=0;Js(s=t.current());)t.lastIntValue=16*t.lastIntValue+Qs(s),t.advance();return t.pos!==e};function Js(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Qs(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}y.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var s=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+s*8+t.lastIntValue:t.lastIntValue=e*8+s}else t.lastIntValue=e;return!0}return!1};y.regexp_eatOctalDigit=function(t){var e=t.current();return Ys(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function Ys(t){return t>=48&&t<=55}y.regexp_eatFixedHexDigits=function(t,e){var s=t.pos;t.lastIntValue=0;for(var i=0;i<e;++i){var r=t.current();if(!Js(r))return t.pos=s,!1;t.lastIntValue=16*t.lastIntValue+Qs(r),t.advance()}return!0};var Lt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Xe(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},C=T.prototype;C.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Lt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};C.getToken=function(){return this.next(),new Lt(this)};typeof Symbol<"u"&&(C[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===o.eof,value:e}}}});C.curContext=function(){return this.context[this.context.length-1]};C.nextToken=function(){var t=this.curContext();if((!t||!t.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(o.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};C.readToken=function(t){return ae(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};C.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);if(t<=55295||t>=57344)return t;var e=this.input.charCodeAt(this.pos+1);return(t<<10)+e-56613888};C.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(s===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations){Ne.lastIndex=e;for(var i;(i=Ne.exec(this.input))&&i.index<this.pos;)++this.curLine,this.lineStart=i.index+i[0].length}this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,s),e,this.pos,t,this.curPosition())};C.skipLineComment=function(t){for(var e=this.pos,s=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!De(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,s,this.curPosition())};C.skipSpace=function(){e:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(t>8&&t<14||t>=5760&&Is.test(String.fromCharCode(t)))++this.pos;else break e}}};C.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=t,this.value=e,this.updateContext(s)};C.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(o.ellipsis)):(++this.pos,this.finishToken(o.dot))};C.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(o.assign,2):this.finishOp(o.slash,1)};C.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),s=1,i=t===42?o.star:o.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++s,i=o.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(o.assign,s+1):this.finishOp(i,s)};C.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(o.assign,3)}return this.finishOp(t===124?o.logicalOR:o.logicalAND,2)}return e===61?this.finishOp(o.assign,2):this.finishOp(t===124?o.bitwiseOR:o.bitwiseAND,1)};C.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(o.assign,2):this.finishOp(o.bitwiseXOR,1)};C.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||K.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(o.incDec,2):e===61?this.finishOp(o.assign,2):this.finishOp(o.plusMin,1)};C.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),s=1;return e===t?(s=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+s)===61?this.finishOp(o.assign,s+1):this.finishOp(o.bitShift,s)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(s=2),this.finishOp(o.relational,s))};C.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(o.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(o.arrow)):this.finishOp(t===61?o.eq:o.prefix,1)};C.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(o.questionDot,2)}if(e===63){if(t>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(o.assign,3)}return this.finishOp(o.coalesce,2)}}return this.finishOp(o.question,1)};C.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(o.parenL);case 41:return++this.pos,this.finishToken(o.parenR);case 59:return++this.pos,this.finishToken(o.semi);case 44:return++this.pos,this.finishToken(o.comma);case 91:return++this.pos,this.finishToken(o.bracketL);case 93:return++this.pos,this.finishToken(o.bracketR);case 123:return++this.pos,this.finishToken(o.braceL);case 125:return++this.pos,this.finishToken(o.braceR);case 58:return++this.pos,this.finishToken(o.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(o.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(o.prefix,1)}this.raise(this.pos,"Unexpected character '"+jt(t)+"'")};C.finishOp=function(t,e){var s=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,s)};C.readRegexp=function(){for(var t,e,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(K.test(i)&&this.raise(s,"Unterminated regular expression"),t)t=!1;else{if(i==="[")e=!0;else if(i==="]"&&e)e=!1;else if(i==="/"&&!e)break;t=i==="\\"}++this.pos}var r=this.input.slice(s,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new se(this));u.reset(s,r,a),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var c=null;try{c=new RegExp(r,a)}catch{}return this.finishToken(o.regexp,{pattern:r,flags:a,value:c})};C.readInt=function(t,e,s){for(var i=this.options.ecmaVersion>=12&&e===void 0,r=s&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,u=0,c=0,l=e??1/0;c<l;++c,++this.pos){var h=this.input.charCodeAt(this.pos),p=void 0;if(i&&h===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),c===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=h;continue}if(h>=97?p=h-97+10:h>=65?p=h-65+10:h>=48&&h<=57?p=h-48:p=1/0,p>=t)break;u=h,a=a*t+p}return i&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||e!=null&&this.pos-n!==e?null:a};function Yi(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}function Xs(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}C.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var s=this.readInt(t);return s==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(s=Xs(this.input.slice(e,this.pos)),++this.pos):ae(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,s)};C.readNumber=function(t){var e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");var s=this.pos-e>=2&&this.input.charCodeAt(e)===48;s&&this.strict&&this.raise(e,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!t&&this.options.ecmaVersion>=11&&i===110){var r=Xs(this.input.slice(e,this.pos));return++this.pos,ae(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,r)}s&&/[89]/.test(this.input.slice(e,this.pos))&&(s=!1),i===46&&!s&&(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),(i===69||i===101)&&!s&&(i=this.input.charCodeAt(++this.pos),(i===43||i===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),ae(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Yi(this.input.slice(e,this.pos),s);return this.finishToken(o.num,n)};C.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();var s=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(s,"Code point out of bounds")}else e=this.readHexChar(4);return e};function jt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}C.readString=function(t){for(var e="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===t)break;i===92?(e+=this.input.slice(s,this.pos),e+=this.readEscapedChar(!1),s=this.pos):(De(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(s,this.pos++),this.finishToken(o.string,e)};var Zs={};C.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===Zs)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};C.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Zs;this.raise(t,e)};C.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(s===96||s===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===o.template||this.type===o.invalidTemplate)?s===36?(this.pos+=2,this.finishToken(o.dollarBraceL)):(++this.pos,this.finishToken(o.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(o.template,t));if(s===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(De(s)){switch(t+=this.input.slice(e,this.pos),++this.pos,s){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=`
12
- `;break;default:t+=String.fromCharCode(s);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};C.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(o.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};C.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`
13
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return jt(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(t){var s=this.pos-1;return this.invalidStringToken(s,"Invalid escape sequence in template string"),null}default:if(e>=48&&e<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(i,8);return r>255&&(i=i.slice(0,-1),r=parseInt(i,8)),this.pos+=i.length-1,e=this.input.charCodeAt(this.pos),(i!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-i.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return De(e)?"":String.fromCharCode(e)}};C.readHexChar=function(t){var e=this.pos,s=this.readInt(16,t);return s===null&&this.invalidStringToken(e,"Bad character escape sequence"),s};C.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(Ce(r,i))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,t+=this.input.slice(s,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(e?ae:Ce)(a,i)||this.invalidStringToken(n,"Invalid Unicode escape"),t+=jt(a),s=this.pos}else break;e=!1}return t+this.input.slice(s,this.pos)};C.readWord=function(){var t=this.readWord1(),e=o.name;return this.keywords.test(t)&&(e=Pt[t]),this.finishToken(e,t)};var Xi="7.4.1";T.acorn={Parser:T,version:Xi,defaultOptions:xt,Position:Oe,SourceLocation:Xe,getLineInfo:Ps,Node:Vt,TokenType:k,tokTypes:o,keywordTypes:Pt,TokContext:z,tokContexts:A,isIdentifierChar:Ce,isIdentifierStart:ae,Token:Lt,isNewLine:De,lineBreak:K,lineBreakG:Ne,nonASCIIwhitespace:Is};function Zi(t,e){return T.parse(t,e)}class er extends Error{}class tr extends SyntaxError{}class yt extends ReferenceError{}class sr extends TypeError{}class ei extends er{}class ir extends tr{}class J extends yt{}const F={ExecutionTimeOutError:[3002,"Script execution timed out after %0ms",ei],NodeTypeSyntaxError:[1001,"Unknown node type: %0",J],BinaryOperatorSyntaxError:[1002,"Unknown binary operator: %0",J],LogicalOperatorSyntaxError:[1003,"Unknown logical operator: %0",J],UnaryOperatorSyntaxError:[1004,"Unknown unary operator: %0",J],UpdateOperatorSyntaxError:[1005,"Unknown update operator: %0",J],ObjectStructureSyntaxError:[1006,"Unknown object structure: %0",J],AssignmentExpressionSyntaxError:[1007,"Unknown assignment expression: %0",J],VariableTypeSyntaxError:[1008,"Unknown variable type: %0",J],ParamTypeSyntaxError:[1009,"Unknown param type: %0",J],AssignmentTypeSyntaxError:[1010,"Unknown assignment type: %0",J],FunctionUndefinedReferenceError:[2001,"%0 is not a function",yt],VariableUndefinedReferenceError:[2002,"%0 is not defined",yt],IsNotConstructor:[2003,"%0 is not a constructor",sr]},rr="1.4.8";function Zt(t,e){Object.defineProperty(t,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}const nr=Object.prototype.hasOwnProperty,me=Symbol("Break"),ge=Symbol("Continue"),es=Symbol("DefaultCase"),V=Symbol("EmptyStatementReturn"),ts=Symbol("WithScopeName"),ss=Symbol("SuperScopeName"),is=Symbol("RootScopeName"),rs=Symbol("GlobalScopeName");function ht(t){return typeof t=="function"}class re{constructor(e){this.interpreter=e}generator(){const e=this.interpreter;function s(){return this.getCurrentScope()}function i(){return this.getGlobalScope()}function r(){return this.getCurrentContext()}return{getOptions:e.getOptions.bind(e),getCurrentScope:s.bind(e),getGlobalScope:i.bind(e),getCurrentContext:r.bind(e),getExecStartTime:e.getExecStartTime.bind(e)}}}function Mt(t,e,s=!0){if(!(t instanceof re))throw new Error("Illegal call");if(typeof e!="string")return e;if(!e)return;const i=t.generator(),n={timeout:i.getOptions().timeout,_initEnv:function(){s||this.setCurrentContext(i.getCurrentContext()),this.execStartTime=i.getExecStartTime(),this.execEndTime=this.execStartTime}},a=s?i.getGlobalScope():i.getCurrentScope();return new B(a,n).evaluate(e)}Object.defineProperty(Mt,"__IS_EVAL_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});function Dt(t,...e){if(!(t instanceof re))throw new Error("Illegal call");const s=t.generator(),i=e.pop(),r=new B(s.getGlobalScope(),s.getOptions()),n=`
7
+ */const _e="0.18.28";var T=(t=>(t.Runtime="Runtime",t.Design="Design",t.Raw="Raw",t.VNode="VNode",t))(T||{});const pt=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],dr=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],mr=["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onErrorCaptured","onRenderTracked","onRenderTriggered","onActivated","onDeactivated"],rs=["vIf","vElseIf","vElse","vShow","vModel","vFor","vBind","vHtml"],is={String,Number,Boolean,Array,Object,Function,Date},Se="VtjPage",Ae="VtjHomepage",yt="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(","),ns="component,slot".split(","),gr=["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o"].join(""),vr={auth:["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o","/","a","u","t","h",".","h","t","m","l"].join(""),storageKey:["R","R","O","_","I","D","E","_","A","C","C","E","S","S","_","S","T","O","R","A","G","E","_","_"].join(""),privateKey:"MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"};function Ie(t,e){return t.map(s=>d.isUrl(s)||s.startsWith("/")?s:`${e}${s}`)}function Le(t){return/\.css$/.test(t)}function Fe(t){return/\.js$/.test(t)}function as(t){return/\.json$/.test(t)}function xr(t){return t.map(e=>`<script src="${d.url.append(e,{v:_e})}"><\/script>`).join("")}function br(t=[]){return t.map(e=>`<link rel="stylesheet" href="${d.url.append(e,{v:_e})}" />`).join("")}function os(t,e=!1){return e&&t.endsWith(".prod.js")?t.replace(".prod.js",".js"):t}function us(t,e,s=!1){const r=t.filter(m=>!!m.enabled),i=[],n=[],a=[],o=[],c={},h={},l=[],p={};return r.forEach(({urls:m,assetsUrl:f,library:g,assetsLibrary:v,localeLibrary:x})=>{m?.forEach(b=>{Fe(b)&&i.push(os(b,s)),Le(b)&&n.push(b)}),g&&(o.push(g),c[g]=Ie(m||[],e),x&&(h[g]=x)),f&&a.push(f),v&&l.push(v),g&&v&&(p[v]=g)}),{scripts:Ie(i,e),css:Ie(n,e),materials:Ie(a,e),libraryExports:o,materialExports:d.dedupArray(l),materialMapLibrary:p,libraryMap:c,libraryLocaleMap:h}}function cs(t,e){const{name:s,parent:r,alias:i}=t;return r?e[r]?.[i||s]:e[i||s]}function ls(t=[]){const e=t.filter(r=>Le(r)),s=t.filter(r=>Fe(r));return{css:e,js:s}}function hs(t,e){const s=h=>{const l=[];let p=0;for(;p<h.length;){if(/\s/.test(h[p])){p++;continue}if(h.substring(p,p+2)==="/*"){const b=h.indexOf("*/",p+2);if(b!==-1){p=b+2;continue}}if(h[p]==="@"){const b=p;for(;p<h.length&&h[p]!=="{"&&h[p]!==";";)p++;const I=h.substring(b,p).trim(),P=I.includes("@keyframes");if(h[p]===";")l.push({type:"simple-at-rule",content:h.substring(b,p+1)}),p++;else if(h[p]==="{"){const S=p+1;let U=1;for(p++;p<h.length&&U>0;)h[p]==="{"?U++:h[p]==="}"&&U--,p++;const me=h.substring(b,p),ge=h.substring(S,p-1);l.push({type:P?"keyframes":"at-rule",rule:I,content:me,inner:ge})}continue}const m=p;for(;p<h.length&&h[p]!=="{";)p++;if(p>=h.length)break;const f=h.substring(m,p).trim();if(!f){p++;continue}const g=p+1;let v=1;for(p++;p<h.length&&v>0;)h[p]==="{"?v++:h[p]==="}"&&v--,p++;const x=h.substring(g,p-1);l.push({type:"rule",selector:f,content:x.trim()})}return l},r=h=>{const l=h.trim();return/^(from|to|\d+(\.\d+)?%)$/.test(l)},i=h=>h.replace(/::v-deep\(/g,":deep(").replace(/::v-deep\s+/g,":deep(").replace(/\/deep\//g," ").replace(/>>>/g," ").replace(/(.*?):deep\(([^)]+)\)/g,(l,p,m)=>{const f=p.trim(),g=m.trim();return f?`${f}[${e}] ${g}`:g}),n=h=>{const l=h.trim();if(!l||l.includes(`[${e}]`)||/^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(l)||r(l))return l;const p=l.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);if(p){const[,m,f=""]=p,g=m.trim();return g?`${g}[${e}]${f}`:l}return`${l}[${e}]`},a=h=>i(h).split(",").map(p=>n(p)).filter(p=>p.trim()).join(", "),o=h=>h.map(l=>{switch(l.type){case"simple-at-rule":return l.content;case"keyframes":return l.content;case"at-rule":try{const m=s(l.inner),f=o(m);return`${l.rule} { ${f} }`}catch{return l.content}case"rule":if(!l.selector||!l.content)return"";const p=a(l.selector);return p.trim()?`${p} { ${l.content} }`:"";default:return""}}).filter(l=>l.trim()).join(" "),c=h=>h.replace(/\s*{\s*/g," { ").replace(/\s*}\s*/g," } ").replace(/\s*;\s*/g,"; ").replace(/\s*,\s*/g,", ").replace(/\s+/g," ").replace(/^\s+|\s+$/g,"").replace(/\s*}\s*}/g," } }").trim();try{const h=t.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g,"").replace(/^\s+|\s+$/gm,"").replace(/\n\s*\n/g,`
8
+ `),l=s(h),p=o(l);return c(p)}catch(h){return console.error("CSS scoping failed:",h),console.error("Input CSS:",t),t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,l=>l).replace(/([^{}@]+)(?=\s*{)/g,l=>{const p=l.trim();return!p||p.startsWith("@")||p.includes(`[${e}]`)||r(p)?l:`${p}[${e}]`})}}const yr=750;function ps(t,e,s){let r;typeof t<"u"?r=t.innerWidth||t.document.documentElement.clientWidth:(console.warn("无法获取屏幕宽度,使用默认值375"),r=375);const i=s||yr;return e*r/i}function fs(t,e){let s=!1,r=!1,i=!1,n="";for(let a=0;a<e.length;a++){const o=e[a];if(o==="'"&&!r&&!i?s=!s:o==='"'&&!s&&!i?r=!r:e.substr(a,4).toLowerCase()==="url("&&!s&&!r?i=!0:o===")"&&i&&(i=!1),!s&&!r&&!i){const c=e.substr(a).match(/^(-?\d+(?:\.\d+)?)\s*rpx/);if(c){const h=c[1],l=parseFloat(h),m=`${ps(t,l).toFixed(6).replace(/\.?0+$/,"")}px`;n+=m,a+=c[0].length-1;continue}}n+=o}return n}function _t(t){return d.isString(t)?t:JSON.stringify(t)}function We(t,e,s,r=!1){const i=t.CSSStyleSheet,n=r?`data-v-${e}`:e,a=t.__uniConfig?fs(t,s):s,o=!!t.__uniConfig,c=t.document,h=!!i?.prototype?.replaceSync&&!o,l=h?Array.from(c.adoptedStyleSheets||[]).find(f=>f.id===e):c.getElementById(e),p=`${n}
9
+ ${a}`;if(l?.__vtjSource===p)return;const m=r?hs(a,n):a;if(h){const f=new i;f.id=e,f.__vtjSource=p,f.replaceSync(m);const g=c.adoptedStyleSheets||[],v=Array.from(g).filter(x=>x.id!==e);c.adoptedStyleSheets=[...v,f]}else{let f=l;f?f.innerHTML=m:(f=c.createElement("style"),f.id=e,f.innerHTML=m,c.head.appendChild(f)),f.__vtjSource=p}}function _r(t){const e=t.adoptedStyleSheets||[];let s="";if(e.forEach(r=>{try{for(const i of r.cssRules)s+=i.cssText+`
10
+ `}catch(i){console.error("Failed to read cssRules from adopted stylesheet:",i)}}),s){const r=t.createElement("style");r.textContent=s,t.head.appendChild(r)}}async function ds(t,e){const s=await globalThis.fetch(e).then(r=>r.text()).catch(()=>"");s&&We(globalThis,t,s)}function St(t,e=globalThis){const s=e.document,r=e.document.head;for(const i of t)if(!s.getElementById(i)){const a=s.createElement("link");a.rel="stylesheet",a.id=i,a.href=i,r.appendChild(a)}}async function Ct(t,e,s=globalThis){const r=s.document,i=s.document.head;let n=s[e];if(n)return n.default||n;for(const a of t){const o=r.getElementById?.(a);if(o?.__vtjLoading){await o.__vtjLoading;continue}if(o)continue;const c=r.createElement("script");c.id=a,c.src=a,c.__vtjLoading=new Promise((h,l)=>{c.onload=()=>h(),c.onerror=p=>{c.remove?.(),l(p)}}),i.appendChild(c),await c.__vtjLoading}return n=s[e],n?n.default||n:Promise.reject(null)}function ms(t){return d.isFunction(t)&&Object.getOwnPropertyNames(t.prototype||{}).length===0||d.isFunction(t?.install)}function gs(t){return ns.includes(t)}function vs(t){return yt.includes(t)}function Ce(t=globalThis){const e=globalThis?.Mock;if(e)return e;const s=t?.Mock;if(s&&globalThis)return globalThis.Mock=s,s}function Sr(t,e,s){Object.assign(e.meta,s.meta);const r=t?._container;s?.type==="page"&&r.classList.add("is-page"),s?.pure&&r.classList.add("is-pure")}function xs(t){return/^\([\s\S]*\)/.test(t.trim())}function bs(t){return/\w+\([\s\S]*\)$/.test(t.trim())}function ys(t){return t.includes("=")}var at={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ot="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Cr={5:ot,"5module":ot+" export import",6:ot+" const class extends export import super"},wr=/^in(stanceof)?$/,wt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-Ᶎꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭧꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",_s="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",Er=new RegExp("["+wt+"]"),kr=new RegExp("["+wt+_s+"]");wt=_s=null;var Ss=[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,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,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,42710,42,4148,12,221,3,5761,15,7472,3104,541],Ir=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];function ft(t,e){for(var s=65536,r=0;r<e.length;r+=2){if(s+=e[r],s>t)return!1;if(s+=e[r+1],s>=t)return!0}}function oe(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&Er.test(String.fromCharCode(t)):e===!1?!1:ft(t,Ss)}function we(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&kr.test(String.fromCharCode(t)):e===!1?!1:ft(t,Ss)||ft(t,Ir)}var k=function(e,s){s===void 0&&(s={}),this.label=e,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop||null,this.updateContext=null};function W(t,e){return new k(t,{beforeExpr:!0,binop:e})}var G={beforeExpr:!0},H={startsExpr:!0},Et={};function w(t,e){return e===void 0&&(e={}),e.keyword=t,Et[t]=new k(t,e)}var u={num:new k("num",H),regexp:new k("regexp",H),string:new k("string",H),name:new k("name",H),eof:new k("eof"),bracketL:new k("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:!0,startsExpr:!0}),braceR:new k("}"),parenL:new k("(",{beforeExpr:!0,startsExpr:!0}),parenR:new k(")"),comma:new k(",",G),semi:new k(";",G),colon:new k(":",G),dot:new k("."),question:new k("?",G),arrow:new k("=>",G),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",G),backQuote:new k("`",H),dollarBraceL:new k("${",{beforeExpr:!0,startsExpr:!0}),eq:new k("=",{beforeExpr:!0,isAssign:!0}),assign:new k("_=",{beforeExpr:!0,isAssign:!0}),incDec:new k("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new k("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:W("||",1),logicalAND:W("&&",2),bitwiseOR:W("|",3),bitwiseXOR:W("^",4),bitwiseAND:W("&",5),equality:W("==/!=/===/!==",6),relational:W("</>/<=/>=",7),bitShift:W("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:W("%",10),star:W("*",10),slash:W("/",10),starstar:new k("**",{beforeExpr:!0}),_break:w("break"),_case:w("case",G),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",G),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",G),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",H),_if:w("if"),_return:w("return",G),_switch:w("switch"),_throw:w("throw",G),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",H),_super:w("super",H),_class:w("class",H),_extends:w("extends",G),_export:w("export"),_import:w("import",H),_null:w("null",H),_true:w("true",H),_false:w("false",H),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},J=/\r\n?|\n|\u2028|\u2029/,Te=new RegExp(J.source,"g");function je(t,e){return t===10||t===13||!e&&(t===8232||t===8233)}var Cs=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Y=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ws=Object.prototype,Ar=ws.hasOwnProperty,Pr=ws.toString;function Ke(t,e){return Ar.call(t,e)}var Wt=Array.isArray||function(t){return Pr.call(t)==="[object Array]"};function he(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var Ne=function(e,s){this.line=e,this.column=s};Ne.prototype.offset=function(e){return new Ne(this.line,this.column+e)};var ze=function(e,s,r){this.start=s,this.end=r,e.sourceFile!==null&&(this.source=e.sourceFile)};function Es(t,e){for(var s=1,r=0;;){Te.lastIndex=r;var i=Te.exec(t);if(i&&i.index<e)++s,r=i.index+i[0].length;else return new Ne(s,e-r)}}var dt={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function Tr(t){var e={};for(var s in dt)e[s]=t&&Ke(t,s)?t[s]:dt[s];if(e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),Wt(e.onToken)){var r=e.onToken;e.onToken=function(i){return r.push(i)}}return Wt(e.onComment)&&(e.onComment=Nr(e,e.onComment)),e}function Nr(t,e){return function(s,r,i,n,a,o){var c={type:s?"Block":"Line",value:r,start:i,end:n};t.locations&&(c.loc=new ze(this,a,o)),t.ranges&&(c.range=[i,n]),e.push(c)}}var Re=1,Me=2,kt=Re|Me,ks=4,Is=8,As=16,Ps=32,Ts=64,Ns=128;function It(t,e){return Me|(t?ks:0)|(e?Is:0)}var Kt=0,At=1,ee=2,Rs=3,Os=4,Vs=5,N=function(e,s,r){this.options=e=Tr(e),this.sourceFile=e.sourceFile,this.keywords=he(Cr[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var i="";if(e.allowReserved!==!0){for(var n=e.ecmaVersion;!(i=at[n]);n--);e.sourceType==="module"&&(i+=" await")}this.reservedWords=he(i);var a=(i?i+" ":"")+at.strict;this.reservedWordsStrict=he(a),this.reservedWordsStrictBind=he(a+" "+at.strictBind),this.input=String(s),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
11
+ `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(J).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=u.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Re),this.regexpState=null},de={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};N.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};de.inFunction.get=function(){return(this.currentVarScope().flags&Me)>0};de.inGenerator.get=function(){return(this.currentVarScope().flags&Is)>0};de.inAsync.get=function(){return(this.currentVarScope().flags&ks)>0};de.allowSuper.get=function(){return(this.currentThisScope().flags&Ts)>0};de.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ns)>0};de.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};N.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&Me)>0};N.extend=function(){for(var e=[],s=arguments.length;s--;)e[s]=arguments[s];for(var r=this,i=0;i<e.length;i++)r=e[i](r);return r};N.parse=function(e,s){return new this(s,e).parse()};N.parseExpressionAt=function(e,s,r){var i=new this(r,e,s);return i.nextToken(),i.parseExpression()};N.tokenizer=function(e,s){return new this(s,e)};Object.defineProperties(N.prototype,de);var M=N.prototype,Rr=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)")/;M.strictDirective=function(t){for(;;){Y.lastIndex=t,t+=Y.exec(this.input)[0].length;var e=Rr.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict")return!0;t+=e[0].length,Y.lastIndex=t,t+=Y.exec(this.input)[0].length,this.input[t]===";"&&t++}};M.eat=function(t){return this.type===t?(this.next(),!0):!1};M.isContextual=function(t){return this.type===u.name&&this.value===t&&!this.containsEsc};M.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};M.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};M.canInsertSemicolon=function(){return this.type===u.eof||this.type===u.braceR||J.test(this.input.slice(this.lastTokEnd,this.start))};M.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};M.semicolon=function(){!this.eat(u.semi)&&!this.insertSemicolon()&&this.unexpected()};M.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};M.expect=function(t){this.eat(t)||this.unexpected()};M.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};function Oe(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}M.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var s=e?t.parenthesizedAssign:t.parenthesizedBind;s>-1&&this.raiseRecoverable(s,"Parenthesized pattern")}};M.checkExpressionErrors=function(t,e){if(!t)return!1;var s=t.shorthandAssign,r=t.doubleProto;if(!e)return s>=0||r>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};M.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};M.isSimpleAssignTarget=function(t){return t.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(t.expression):t.type==="Identifier"||t.type==="MemberExpression"};var _=N.prototype;_.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==u.eof;){var s=this.parseStatement(null,!0,e);t.body.push(s)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var n=i[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")};var Pt={kind:"loop"},Or={kind:"switch"};_.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Y.lastIndex=this.pos;var e=Y.exec(this.input),s=this.pos+e[0].length,r=this.input.charCodeAt(s);if(r===91)return!0;if(t)return!1;if(r===123)return!0;if(oe(r,!0)){for(var i=s+1;we(this.input.charCodeAt(i),!0);)++i;var n=this.input.slice(s,i);if(!wr.test(n))return!0}return!1};_.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Y.lastIndex=this.pos;var t=Y.exec(this.input),e=this.pos+t[0].length;return!J.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!we(this.input.charAt(e+8)))};_.parseStatement=function(t,e,s){var r=this.type,i=this.startNode(),n;switch(this.isLet(t)&&(r=u._var,n="let"),r){case u._break:case u._continue:return this.parseBreakContinueStatement(i,r.keyword);case u._debugger:return this.parseDebuggerStatement(i);case u._do:return this.parseDoStatement(i);case u._for:return this.parseForStatement(i);case u._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!t);case u._class:return t&&this.unexpected(),this.parseClass(i,!0);case u._if:return this.parseIfStatement(i);case u._return:return this.parseReturnStatement(i);case u._switch:return this.parseSwitchStatement(i);case u._throw:return this.parseThrowStatement(i);case u._try:return this.parseTryStatement(i);case u._const:case u._var:return n=n||this.value,t&&n!=="var"&&this.unexpected(),this.parseVarStatement(i,n);case u._while:return this.parseWhileStatement(i);case u._with:return this.parseWithStatement(i);case u.braceL:return this.parseBlock(!0,i);case u.semi:return this.parseEmptyStatement(i);case u._export:case u._import:if(this.options.ecmaVersion>10&&r===u._import){Y.lastIndex=this.pos;var a=Y.exec(this.input),o=this.pos+a[0].length,c=this.input.charCodeAt(o);if(c===40)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===u._import?this.parseImport(i):this.parseExport(i,s);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!t);var h=this.value,l=this.parseExpression();return r===u.name&&l.type==="Identifier"&&this.eat(u.colon)?this.parseLabeledStatement(i,h,l,t):this.parseExpressionStatement(i,l)}};_.parseBreakContinueStatement=function(t,e){var s=e==="break";this.next(),this.eat(u.semi)||this.insertSemicolon()?t.label=null:this.type!==u.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((t.label==null||i.name===t.label.name)&&(i.kind!=null&&(s||i.kind==="loop")||t.label&&s))break}return r===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,s?"BreakStatement":"ContinueStatement")};_.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};_.parseDoStatement=function(t){return this.next(),this.labels.push(Pt),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(u._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(u.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};_.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Pt),this.enterScope(0),this.expect(u.parenL),this.type===u.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var s=this.isLet();if(this.type===u._var||this.type===u._const||s){var r=this.startNode(),i=s?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===u._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,r)):(e>-1&&this.unexpected(e),this.parseFor(t,r))}var n=new Oe,a=this.parseExpression(!0,n);return this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===u._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(a,!1,n),this.checkLVal(a),this.parseForIn(t,a)):(this.checkExpressionErrors(n,!0),e>-1&&this.unexpected(e),this.parseFor(t,a))};_.parseFunctionStatement=function(t,e,s){return this.next(),this.parseFunction(t,Pe|(s?0:mt),!1,e)};_.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(u._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};_.parseReturnStatement=function(t){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(u.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};_.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(u.braceL),this.labels.push(Or),this.enterScope(0);for(var e,s=!1;this.type!==u.braceR;)if(this.type===u._case||this.type===u._default){var r=this.type===u._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),r?e.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,e.test=null),this.expect(u.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};_.parseThrowStatement=function(t){return this.next(),J.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Vr=[];_.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===u._catch){var e=this.startNode();if(this.next(),this.eat(u.parenL)){e.param=this.parseBindingAtom();var s=e.param.type==="Identifier";this.enterScope(s?Ps:0),this.checkLVal(e.param,s?Os:ee),this.expect(u.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(u._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};_.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")};_.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(Pt),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};_.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};_.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};_.parseLabeledStatement=function(t,e,s,r){for(var i=0,n=this.labels;i<n.length;i+=1){var a=n[i];a.name===e&&this.raise(s.start,"Label '"+e+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===u._switch?"switch":null,c=this.labels.length-1;c>=0;c--){var h=this.labels[c];if(h.statementStart===t.start)h.statementStart=this.start,h.kind=o;else break}return this.labels.push({name:e,kind:o,statementStart:this.start}),t.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")};_.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};_.parseBlock=function(t,e){for(t===void 0&&(t=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(u.braceL),t&&this.enterScope(0);!this.eat(u.braceR);){var s=this.parseStatement(null);e.body.push(s)}return t&&this.exitScope(),this.finishNode(e,"BlockStatement")};_.parseFor=function(t,e){return t.init=e,this.expect(u.semi),t.test=this.type===u.semi?null:this.parseExpression(),this.expect(u.semi),t.update=this.type===u.parenR?null:this.parseExpression(),this.expect(u.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};_.parseForIn=function(t,e){var s=this.type===u._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!s||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")?this.raise(e.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"):e.type==="AssignmentPattern"&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(u.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,s?"ForInStatement":"ForOfStatement")};_.parseVar=function(t,e,s){for(t.declarations=[],t.kind=s;;){var r=this.startNode();if(this.parseVarId(r,s),this.eat(u.eq)?r.init=this.parseMaybeAssign(e):s==="const"&&!(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(e&&(this.type===u._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(u.comma))break}return t};_.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,e==="var"?At:ee,!1)};var Pe=1,mt=2,Ls=4;_.parseFunction=function(t,e,s,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===u.star&&e&mt&&this.unexpected(),t.generator=this.eat(u.star)),this.options.ecmaVersion>=8&&(t.async=!!r),e&Pe&&(t.id=e&Ls&&this.type!==u.name?null:this.parseIdent(),t.id&&!(e&mt)&&this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?At:ee:Rs));var i=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(It(t.async,t.generator)),e&Pe||(t.id=this.type===u.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,s,!1),this.yieldPos=i,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(t,e&Pe?"FunctionDeclaration":"FunctionExpression")};_.parseFunctionParams=function(t){this.expect(u.parenL),t.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};_.parseClass=function(t,e){this.next();var s=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var r=this.startNode(),i=!1;for(r.body=[],this.expect(u.braceL);!this.eat(u.braceR);){var n=this.parseClassElement(t.superClass!==null);n&&(r.body.push(n),n.type==="MethodDefinition"&&n.kind==="constructor"&&(i&&this.raise(n.start,"Duplicate constructor in the same class"),i=!0))}return t.body=this.finishNode(r,"ClassBody"),this.strict=s,this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};_.parseClassElement=function(t){var e=this;if(this.eat(u.semi))return null;var s=this.startNode(),r=function(c,h){h===void 0&&(h=!1);var l=e.start,p=e.startLoc;return e.eatContextual(c)?e.type!==u.parenL&&(!h||!e.canInsertSemicolon())?!0:(s.key&&e.unexpected(),s.computed=!1,s.key=e.startNodeAt(l,p),s.key.name=c,e.finishNode(s.key,"Identifier"),!1):!1};s.kind="method",s.static=r("static");var i=this.eat(u.star),n=!1;i||(this.options.ecmaVersion>=8&&r("async",!0)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(u.star)):r("get")?s.kind="get":r("set")&&(s.kind="set")),s.key||this.parsePropertyName(s);var a=s.key,o=!1;return!s.computed&&!s.static&&(a.type==="Identifier"&&a.name==="constructor"||a.type==="Literal"&&a.value==="constructor")?(s.kind!=="method"&&this.raise(a.start,"Constructor can't have get/set modifier"),i&&this.raise(a.start,"Constructor can't be a generator"),n&&this.raise(a.start,"Constructor can't be an async method"),s.kind="constructor",o=t):s.static&&a.type==="Identifier"&&a.name==="prototype"&&this.raise(a.start,"Classes may not have a static property named prototype"),this.parseClassMethod(s,i,n,o),s.kind==="get"&&s.value.params.length!==0&&this.raiseRecoverable(s.value.start,"getter should have no params"),s.kind==="set"&&s.value.params.length!==1&&this.raiseRecoverable(s.value.start,"setter should have exactly one param"),s.kind==="set"&&s.value.params[0].type==="RestElement"&&this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params"),s};_.parseClassMethod=function(t,e,s,r){return t.value=this.parseMethod(e,s,r),this.finishNode(t,"MethodDefinition")};_.parseClassId=function(t,e){this.type===u.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,ee,!1)):(e===!0&&this.unexpected(),t.id=null)};_.parseClassSuper=function(t){t.superClass=this.eat(u._extends)?this.parseExprSubscripts():null};_.parseExport=function(t,e){if(this.next(),this.eat(u.star))return this.expectContextual("from"),this.type!==u.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(u._default)){this.checkExport(e,"default",this.lastTokStart);var s;if(this.type===u._function||(s=this.isAsyncFunction())){var r=this.startNode();this.next(),s&&this.next(),t.declaration=this.parseFunction(r,Pe|Ls,!1,s)}else if(this.type===u._class){var i=this.startNode();t.declaration=this.parseClass(i,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==u.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var n=0,a=t.specifiers;n<a.length;n+=1){var o=a[n];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};_.checkExport=function(t,e,s){t&&(Ke(t,e)&&this.raiseRecoverable(s,"Duplicate export '"+e+"'"),t[e]=!0)};_.checkPatternExport=function(t,e){var s=e.type;if(s==="Identifier")this.checkExport(t,e.name,e.start);else if(s==="ObjectPattern")for(var r=0,i=e.properties;r<i.length;r+=1){var n=i[r];this.checkPatternExport(t,n)}else if(s==="ArrayPattern")for(var a=0,o=e.elements;a<o.length;a+=1){var c=o[a];c&&this.checkPatternExport(t,c)}else s==="Property"?this.checkPatternExport(t,e.value):s==="AssignmentPattern"?this.checkPatternExport(t,e.left):s==="RestElement"?this.checkPatternExport(t,e.argument):s==="ParenthesizedExpression"&&this.checkPatternExport(t,e.expression)};_.checkVariableExport=function(t,e){if(t)for(var s=0,r=e;s<r.length;s+=1){var i=r[s];this.checkPatternExport(t,i.id)}};_.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};_.parseExportSpecifiers=function(t){var e=[],s=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;var r=this.startNode();r.local=this.parseIdent(!0),r.exported=this.eatContextual("as")?this.parseIdent(!0):r.local,this.checkExport(t,r.exported.name,r.exported.start),e.push(this.finishNode(r,"ExportSpecifier"))}return e};_.parseImport=function(t){return this.next(),this.type===u.string?(t.specifiers=Vr,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===u.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")};_.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===u.name){var s=this.startNode();if(s.local=this.parseIdent(),this.checkLVal(s.local,ee),t.push(this.finishNode(s,"ImportDefaultSpecifier")),!this.eat(u.comma))return t}if(this.type===u.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLVal(r.local,ee),t.push(this.finishNode(r,"ImportNamespaceSpecifier")),t}for(this.expect(u.braceL);!this.eat(u.braceR);){if(e)e=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;var i=this.startNode();i.imported=this.parseIdent(!0),this.eatContextual("as")?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLVal(i.local,ee),t.push(this.finishNode(i,"ImportSpecifier"))}return t};_.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};_.isDirectiveCandidate=function(t){return t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var te=N.prototype;te.toAssignable=function(t,e,s){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var r=0,i=t.properties;r<i.length;r+=1){var n=i[r];this.toAssignable(n,e),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":t.kind!=="init"&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern"&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":t.operator!=="="&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,s);break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return t};te.toAssignableList=function(t,e){for(var s=t.length,r=0;r<s;r++){var i=t[r];i&&this.toAssignable(i,e)}if(s){var n=t[s-1];this.options.ecmaVersion===6&&e&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return t};te.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};te.parseRestBinding=function(){var t=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==u.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};te.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case u.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(u.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case u.braceL:return this.parseObj(!0)}return this.parseIdent()};te.parseBindingList=function(t,e,s){for(var r=[],i=!0;!this.eat(t);)if(i?i=!1:this.expect(u.comma),e&&this.type===u.comma)r.push(null);else{if(s&&this.afterTrailingComma(t))break;if(this.type===u.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),r.push(n),this.type===u.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}else{var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),r.push(a)}}return r};te.parseBindingListItem=function(t){return t};te.parseMaybeDefault=function(t,e,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(u.eq))return s;var r=this.startNodeAt(t,e);return r.left=s,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};te.checkLVal=function(t,e,s){switch(e===void 0&&(e=Kt),t.type){case"Identifier":e===ee&&t.name==="let"&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),s&&(Ke(s,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),s[t.name]=!0),e!==Kt&&e!==Vs&&this.declareName(t.name,e,t.start);break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var r=0,i=t.properties;r<i.length;r+=1){var n=i[r];this.checkLVal(n,e,s)}break;case"Property":this.checkLVal(t.value,e,s);break;case"ArrayPattern":for(var a=0,o=t.elements;a<o.length;a+=1){var c=o[a];c&&this.checkLVal(c,e,s)}break;case"AssignmentPattern":this.checkLVal(t.left,e,s);break;case"RestElement":this.checkLVal(t.argument,e,s);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,s);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}};var C=N.prototype;C.checkPropClash=function(t,e,s){if(!(this.options.ecmaVersion>=9&&t.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var r=t.key,i;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var n=t.kind;if(this.options.ecmaVersion>=6){i==="__proto__"&&n==="init"&&(e.proto&&(s&&s.doubleProto<0?s.doubleProto=r.start:this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),e.proto=!0);return}i="$"+i;var a=e[i];if(a){var o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=e[i]={init:!1,get:!1,set:!1};a[n]=!0}};C.parseExpression=function(t,e){var s=this.start,r=this.startLoc,i=this.parseMaybeAssign(t,e);if(this.type===u.comma){var n=this.startNodeAt(s,r);for(n.expressions=[i];this.eat(u.comma);)n.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(n,"SequenceExpression")}return i};C.parseMaybeAssign=function(t,e,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var r=!1,i=-1,n=-1,a=-1;e?(i=e.parenthesizedAssign,n=e.trailingComma,a=e.shorthandAssign,e.parenthesizedAssign=e.trailingComma=e.shorthandAssign=-1):(e=new Oe,r=!0);var o=this.start,c=this.startLoc;(this.type===u.parenL||this.type===u.name)&&(this.potentialArrowAt=this.start);var h=this.parseMaybeConditional(t,e);if(s&&(h=s.call(this,h,o,c)),this.type.isAssign){var l=this.startNodeAt(o,c);return l.operator=this.value,l.left=this.type===u.eq?this.toAssignable(h,!1,e):h,r||Oe.call(e),e.shorthandAssign=-1,this.checkLVal(h),this.next(),l.right=this.parseMaybeAssign(t),this.finishNode(l,"AssignmentExpression")}else r&&this.checkExpressionErrors(e,!0);return i>-1&&(e.parenthesizedAssign=i),n>-1&&(e.trailingComma=n),a>-1&&(e.shorthandAssign=a),h};C.parseMaybeConditional=function(t,e){var s=this.start,r=this.startLoc,i=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return i;if(this.eat(u.question)){var n=this.startNodeAt(s,r);return n.test=i,n.consequent=this.parseMaybeAssign(),this.expect(u.colon),n.alternate=this.parseMaybeAssign(t),this.finishNode(n,"ConditionalExpression")}return i};C.parseExprOps=function(t,e){var s=this.start,r=this.startLoc,i=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)||i.start===s&&i.type==="ArrowFunctionExpression"?i:this.parseExprOp(i,s,r,-1,t)};C.parseExprOp=function(t,e,s,r,i){var n=this.type.binop;if(n!=null&&(!i||this.type!==u._in)&&n>r){var a=this.type===u.logicalOR||this.type===u.logicalAND,o=this.value;this.next();var c=this.start,h=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1),c,h,n,i),p=this.buildBinary(e,s,t,l,o,a);return this.parseExprOp(p,e,s,r,i)}return t};C.buildBinary=function(t,e,s,r,i,n){var a=this.startNodeAt(t,e);return a.left=s,a.operator=i,a.right=r,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};C.parseMaybeUnary=function(t,e){var s=this.start,r=this.startLoc,i;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),e=!0;else if(this.type.prefix){var n=this.startNode(),a=this.type===u.incDec;n.operator=this.value,n.prefix=!0,this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),a?this.checkLVal(n.argument):this.strict&&n.operator==="delete"&&n.argument.type==="Identifier"?this.raiseRecoverable(n.start,"Deleting local variable in strict mode"):e=!0,i=this.finishNode(n,a?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(s,r);o.operator=this.value,o.prefix=!1,o.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(o,"UpdateExpression")}}return!e&&this.eat(u.starstar)?this.buildBinary(s,r,i,this.parseMaybeUnary(null,!1),"**",!1):i};C.parseExprSubscripts=function(t){var e=this.start,s=this.startLoc,r=this.parseExprAtom(t),i=r.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")";if(this.checkExpressionErrors(t)||i)return r;var n=this.parseSubscripts(r,e,s);return t&&n.type==="MemberExpression"&&(t.parenthesizedAssign>=n.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=n.start&&(t.parenthesizedBind=-1)),n};C.parseSubscripts=function(t,e,s,r){for(var i=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&this.input.slice(t.start,t.end)==="async";;){var n=this.parseSubscript(t,e,s,r,i);if(n===t||n.type==="ArrowFunctionExpression")return n;t=n}};C.parseSubscript=function(t,e,s,r,i){var n=this.eat(u.bracketL);if(n||this.eat(u.dot)){var a=this.startNodeAt(e,s);a.object=t,a.property=n?this.parseExpression():this.parseIdent(this.options.allowReserved!=="never"),a.computed=!!n,n&&this.expect(u.bracketR),t=this.finishNode(a,"MemberExpression")}else if(!r&&this.eat(u.parenL)){var o=new Oe,c=this.yieldPos,h=this.awaitPos,l=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var p=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1,o);if(i&&!this.canInsertSemicolon()&&this.eat(u.arrow))return this.checkPatternErrors(o,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=c,this.awaitPos=h,this.awaitIdentPos=l,this.parseArrowExpression(this.startNodeAt(e,s),p,!0);this.checkExpressionErrors(o,!0),this.yieldPos=c||this.yieldPos,this.awaitPos=h||this.awaitPos,this.awaitIdentPos=l||this.awaitIdentPos;var m=this.startNodeAt(e,s);m.callee=t,m.arguments=p,t=this.finishNode(m,"CallExpression")}else if(this.type===u.backQuote){var f=this.startNodeAt(e,s);f.tag=t,f.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(f,"TaggedTemplateExpression")}return t};C.parseExprAtom=function(t){this.type===u.slash&&this.readRegexp();var e,s=this.potentialArrowAt===this.start;switch(this.type){case u._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),e=this.startNode(),this.next(),this.type===u.parenL&&!this.allowDirectSuper&&this.raise(e.start,"super() call outside constructor of a subclass"),this.type!==u.dot&&this.type!==u.bracketL&&this.type!==u.parenL&&this.unexpected(),this.finishNode(e,"Super");case u._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case u.name:var r=this.start,i=this.startLoc,n=this.containsEsc,a=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!n&&a.name==="async"&&!this.canInsertSemicolon()&&this.eat(u._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(s&&!this.canInsertSemicolon()){if(this.eat(u.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[a],!1);if(this.options.ecmaVersion>=8&&a.name==="async"&&this.type===u.name&&!n)return a=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(u.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[a],!0)}return a;case u.regexp:var o=this.value;return e=this.parseLiteral(o.value),e.regex={pattern:o.pattern,flags:o.flags},e;case u.num:case u.string:return this.parseLiteral(this.value);case u._null:case u._true:case u._false:return e=this.startNode(),e.value=this.type===u._null?null:this.type===u._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case u.parenL:var c=this.start,h=this.parseParenAndDistinguishExpression(s);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(t.parenthesizedAssign=c),t.parenthesizedBind<0&&(t.parenthesizedBind=c)),h;case u.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(u.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case u.braceL:return this.parseObj(!1,t);case u._function:return e=this.startNode(),this.next(),this.parseFunction(e,0);case u._class:return this.parseClass(this.startNode(),!1);case u._new:return this.parseNew();case u.backQuote:return this.parseTemplate();case u._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};C.parseExprImport=function(){var t=this.startNode();switch(this.next(),this.type){case u.parenL:return this.parseDynamicImport(t);default:this.unexpected()}};C.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(u.parenR)){var e=this.start;this.eat(u.comma)&&this.eat(u.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")};C.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.raw.slice(0,-1)),this.next(),this.finishNode(e,"Literal")};C.parseParenExpression=function(){this.expect(u.parenL);var t=this.parseExpression();return this.expect(u.parenR),t};C.parseParenAndDistinguishExpression=function(t){var e=this.start,s=this.startLoc,r,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var n=this.start,a=this.startLoc,o=[],c=!0,h=!1,l=new Oe,p=this.yieldPos,m=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==u.parenR;)if(c?c=!1:this.expect(u.comma),i&&this.afterTrailingComma(u.parenR,!0)){h=!0;break}else if(this.type===u.ellipsis){f=this.start,o.push(this.parseParenItem(this.parseRestBinding())),this.type===u.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else o.push(this.parseMaybeAssign(!1,l,this.parseParenItem));var g=this.start,v=this.startLoc;if(this.expect(u.parenR),t&&!this.canInsertSemicolon()&&this.eat(u.arrow))return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=m,this.parseParenArrowList(e,s,o);(!o.length||h)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(l,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,o.length>1?(r=this.startNodeAt(n,a),r.expressions=o,this.finishNodeAt(r,"SequenceExpression",g,v)):r=o[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var x=this.startNodeAt(e,s);return x.expression=r,this.finishNode(x,"ParenthesizedExpression")}else return r};C.parseParenItem=function(t){return t};C.parseParenArrowList=function(t,e,s){return this.parseArrowExpression(this.startNodeAt(t,e),s)};var Lr=[];C.parseNew=function(){var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(u.dot)){t.meta=e;var s=this.containsEsc;return t.property=this.parseIdent(!0),(t.property.name!=="target"||s)&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var r=this.start,i=this.startLoc,n=this.type===u._import;return t.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),n&&t.callee.type==="ImportExpression"&&this.raise(r,"Cannot use new with import()"),this.eat(u.parenL)?t.arguments=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1):t.arguments=Lr,this.finishNode(t,"NewExpression")};C.parseTemplateElement=function(t){var e=t.isTagged,s=this.startNode();return this.type===u.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value,cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
12
+ `),cooked:this.value},this.next(),s.tail=this.type===u.backQuote,this.finishNode(s,"TemplateElement")};C.parseTemplate=function(t){t===void 0&&(t={});var e=t.isTagged;e===void 0&&(e=!1);var s=this.startNode();this.next(),s.expressions=[];var r=this.parseTemplateElement({isTagged:e});for(s.quasis=[r];!r.tail;)this.type===u.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(u.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(u.braceR),s.quasis.push(r=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(s,"TemplateLiteral")};C.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===u.name||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===u.star)&&!J.test(this.input.slice(this.lastTokEnd,this.start))};C.parseObj=function(t,e){var s=this.startNode(),r=!0,i={};for(s.properties=[],this.next();!this.eat(u.braceR);){if(r)r=!1;else if(this.expect(u.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(u.braceR))break;var n=this.parseProperty(t,e);t||this.checkPropClash(n,i,e),s.properties.push(n)}return this.finishNode(s,t?"ObjectPattern":"ObjectExpression")};C.parseProperty=function(t,e){var s=this.startNode(),r,i,n,a;if(this.options.ecmaVersion>=9&&this.eat(u.ellipsis))return t?(s.argument=this.parseIdent(!1),this.type===u.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(s,"RestElement")):(this.type===u.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),s.argument=this.parseMaybeAssign(!1,e),this.type===u.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(s,"SpreadElement"));this.options.ecmaVersion>=6&&(s.method=!1,s.shorthand=!1,(t||e)&&(n=this.start,a=this.startLoc),t||(r=this.eat(u.star)));var o=this.containsEsc;return this.parsePropertyName(s),!t&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(s)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(u.star),this.parsePropertyName(s,e)):i=!1,this.parsePropertyValue(s,t,r,i,n,a,e,o),this.finishNode(s,"Property")};C.parsePropertyValue=function(t,e,s,r,i,n,a,o){if((s||r)&&this.type===u.colon&&this.unexpected(),this.eat(u.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===u.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(s,r);else if(!e&&!o&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==u.comma&&this.type!==u.braceR){(s||r)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var c=t.kind==="get"?0:1;if(t.value.params.length!==c){var h=t.value.start;t.kind==="get"?this.raiseRecoverable(h,"getter should have no params"):this.raiseRecoverable(h,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((s||r)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t.kind="init",e?t.value=this.parseMaybeDefault(i,n,t.key):this.type===u.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(i,n,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected()};C.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(u.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(u.bracketR),t.key;t.computed=!1}return t.key=this.type===u.num||this.type===u.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};C.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};C.parseMethod=function(t,e,s){var r=this.startNode(),i=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=t),this.options.ecmaVersion>=8&&(r.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(It(e,r.generator)|Ts|(s?Ns:0)),this.expect(u.parenL),r.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")};C.parseArrowExpression=function(t,e,s){var r=this.yieldPos,i=this.awaitPos,n=this.awaitIdentPos;return this.enterScope(It(s,!1)|As),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=n,this.finishNode(t,"ArrowFunctionExpression")};C.parseFunctionBody=function(t,e,s){var r=e&&this.type!==u.braceL,i=this.strict,n=!1;if(r)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!i||a)&&(n=this.strictDirective(this.end),n&&a&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var o=this.labels;this.labels=[],n&&(this.strict=!0),this.checkParams(t,!i&&!n&&!e&&!s&&this.isSimpleParamList(t.params)),t.body=this.parseBlock(!1),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=o}this.exitScope(),this.strict&&t.id&&this.checkLVal(t.id,Vs),this.strict=i};C.isSimpleParamList=function(t){for(var e=0,s=t;e<s.length;e+=1){var r=s[e];if(r.type!=="Identifier")return!1}return!0};C.checkParams=function(t,e){for(var s={},r=0,i=t.params;r<i.length;r+=1){var n=i[r];this.checkLVal(n,At,e?null:s)}};C.parseExprList=function(t,e,s,r){for(var i=[],n=!0;!this.eat(t);){if(n)n=!1;else if(this.expect(u.comma),e&&this.afterTrailingComma(t))break;var a=void 0;s&&this.type===u.comma?a=null:this.type===u.ellipsis?(a=this.parseSpread(r),r&&this.type===u.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),i.push(a)}return i};C.checkUnreserved=function(t){var e=t.start,s=t.end,r=t.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(r)&&this.raise(e,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(e,s).indexOf("\\")!==-1)){var i=this.strict?this.reservedWordsStrict:this.reservedWords;i.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+r+"' is reserved"))}};C.parseIdent=function(t,e){var s=this.startNode();return this.type===u.name?s.name=this.value:this.type.keyword?(s.name=this.type.keyword,(s.name==="class"||s.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(),this.finishNode(s,"Identifier"),t||(this.checkUnreserved(s),s.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s.start)),s};C.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===u.semi||this.canInsertSemicolon()||this.type!==u.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(u.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")};C.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0),this.finishNode(t,"AwaitExpression")};var He=N.prototype;He.raise=function(t,e){var s=Es(this.input,t);e+=" ("+s.line+":"+s.column+")";var r=new SyntaxError(e);throw r.pos=t,r.loc=s,r.raisedAt=this.pos,r};He.raiseRecoverable=He.raise;He.curPosition=function(){if(this.options.locations)return new Ne(this.curLine,this.pos-this.lineStart)};var ue=N.prototype,Fr=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};ue.enterScope=function(t){this.scopeStack.push(new Fr(t))};ue.exitScope=function(){this.scopeStack.pop()};ue.treatFunctionsAsVarInScope=function(t){return t.flags&Me||!this.inModule&&t.flags&Re};ue.declareName=function(t,e,s){var r=!1;if(e===ee){var i=this.currentScope();r=i.lexical.indexOf(t)>-1||i.functions.indexOf(t)>-1||i.var.indexOf(t)>-1,i.lexical.push(t),this.inModule&&i.flags&Re&&delete this.undefinedExports[t]}else if(e===Os){var n=this.currentScope();n.lexical.push(t)}else if(e===Rs){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(t)>-1:r=a.lexical.indexOf(t)>-1||a.var.indexOf(t)>-1,a.functions.push(t)}else for(var o=this.scopeStack.length-1;o>=0;--o){var c=this.scopeStack[o];if(c.lexical.indexOf(t)>-1&&!(c.flags&Ps&&c.lexical[0]===t)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(t)>-1){r=!0;break}if(c.var.push(t),this.inModule&&c.flags&Re&&delete this.undefinedExports[t],c.flags&kt)break}r&&this.raiseRecoverable(s,"Identifier '"+t+"' has already been declared")};ue.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};ue.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};ue.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&kt)return e}};ue.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&kt&&!(e.flags&As))return e}};var Tt=function(e,s,r){this.type="",this.start=s,this.end=0,e.options.locations&&(this.loc=new ze(e,r)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[s,0])},Je=N.prototype;Je.startNode=function(){return new Tt(this,this.start,this.startLoc)};Je.startNodeAt=function(t,e){return new Tt(this,t,e)};function Fs(t,e,s,r){return t.type=e,t.end=s,this.options.locations&&(t.loc.end=r),this.options.ranges&&(t.range[1]=s),t}Je.finishNode=function(t,e){return Fs.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Je.finishNodeAt=function(t,e,s,r){return Fs.call(this,t,e,s,r)};var K=function(e,s,r,i,n){this.token=e,this.isExpr=!!s,this.preserveSpace=!!r,this.override=i,this.generator=!!n},A={b_stat:new K("{",!1),b_expr:new K("{",!0),b_tmpl:new K("${",!1),p_stat:new K("(",!1),p_expr:new K("(",!0),q_tmpl:new K("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new K("function",!1),f_expr:new K("function",!0),f_expr_gen:new K("function",!0,!1,null,!0),f_gen:new K("function",!1,!1,null,!0)},Qe=N.prototype;Qe.initialContext=function(){return[A.b_stat]};Qe.braceIsBlock=function(t){var e=this.curContext();return e===A.f_expr||e===A.f_stat?!0:t===u.colon&&(e===A.b_stat||e===A.b_expr)?!e.isExpr:t===u._return||t===u.name&&this.exprAllowed?J.test(this.input.slice(this.lastTokEnd,this.start)):t===u._else||t===u.semi||t===u.eof||t===u.parenR||t===u.arrow?!0:t===u.braceL?e===A.b_stat:t===u._var||t===u._const||t===u.name?!1:!this.exprAllowed};Qe.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if(e.token==="function")return e.generator}return!1};Qe.updateContext=function(t){var e,s=this.type;s.keyword&&t===u.dot?this.exprAllowed=!1:(e=s.updateContext)?e.call(this,t):this.exprAllowed=s.beforeExpr};u.parenR.updateContext=u.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var t=this.context.pop();t===A.b_stat&&this.curContext().token==="function"&&(t=this.context.pop()),this.exprAllowed=!t.isExpr};u.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?A.b_stat:A.b_expr),this.exprAllowed=!0};u.dollarBraceL.updateContext=function(){this.context.push(A.b_tmpl),this.exprAllowed=!0};u.parenL.updateContext=function(t){var e=t===u._if||t===u._for||t===u._with||t===u._while;this.context.push(e?A.p_stat:A.p_expr),this.exprAllowed=!0};u.incDec.updateContext=function(){};u._function.updateContext=u._class.updateContext=function(t){t.beforeExpr&&t!==u.semi&&t!==u._else&&!(t===u._return&&J.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===u.colon||t===u.braceL)&&this.curContext()===A.b_stat)?this.context.push(A.f_expr):this.context.push(A.f_stat),this.exprAllowed=!1};u.backQuote.updateContext=function(){this.curContext()===A.q_tmpl?this.context.pop():this.context.push(A.q_tmpl),this.exprAllowed=!1};u.star.updateContext=function(t){if(t===u._function){var e=this.context.length-1;this.context[e]===A.f_expr?this.context[e]=A.f_expr_gen:this.context[e]=A.f_gen}this.exprAllowed=!0};u.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==u.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var js="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ms=js+" Extended_Pictographic",jr=Ms,Mr={9:js,10:Ms,11:jr},zt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ds="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Bs=Ds+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Dr=Bs+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Br={9:Ds,10:Bs,11:Dr},Us={};function Nt(t){var e=Us[t]={binary:he(Mr[t]+" "+zt),nonBinary:{General_Category:he(zt),Script:he(Br[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}Nt(9);Nt(10);Nt(11);var y=N.prototype,se=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=Us[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};se.prototype.reset=function(e,s,r){var i=r.indexOf("u")!==-1;this.start=e|0,this.source=s+"",this.flags=r,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9};se.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)};se.prototype.at=function(e){var s=this.source,r=s.length;if(e>=r)return-1;var i=s.charCodeAt(e);return!this.switchU||i<=55295||i>=57344||e+1>=r?i:(i<<10)+s.charCodeAt(e+1)-56613888};se.prototype.nextIndex=function(e){var s=this.source,r=s.length;if(e>=r)return r;var i=s.charCodeAt(e);return!this.switchU||i<=55295||i>=57344||e+1>=r?e+1:e+2};se.prototype.current=function(){return this.at(this.pos)};se.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))};se.prototype.advance=function(){this.pos=this.nextIndex(this.pos)};se.prototype.eat=function(e){return this.current()===e?(this.advance(),!0):!1};function Ge(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}y.validateRegExpFlags=function(t){for(var e=t.validFlags,s=t.flags,r=0;r<s.length;r++){var i=s.charAt(r);e.indexOf(i)===-1&&this.raise(t.start,"Invalid regular expression flag"),s.indexOf(i,r+1)>-1&&this.raise(t.start,"Duplicate regular expression flag")}};y.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))};y.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,s=t.backReferenceNames;e<s.length;e+=1){var r=s[e];t.groupNames.indexOf(r)===-1&&t.raise("Invalid named capture referenced")}};y.regexp_disjunction=function(t){for(this.regexp_alternative(t);t.eat(124);)this.regexp_alternative(t);this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};y.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););};y.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))?(this.regexp_eatQuantifier(t),!0):!1};y.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var s=!1;if(this.options.ecmaVersion>=9&&(s=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!s,!0}return t.pos=e,!1};y.regexp_eatQuantifier=function(t,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};y.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};y.regexp_eatBracedQuantifier=function(t,e){var s=t.pos;if(t.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(i=t.lastIntValue),t.eat(125)))return i!==-1&&i<r&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=s}return!1};y.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)};y.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1};y.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)&&t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}t.pos=e}return!1};y.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};y.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};y.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};y.regexp_eatSyntaxCharacter=function(t){var e=t.current();return $s(e)?(t.lastIntValue=e,t.advance(),!0):!1};function $s(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}y.regexp_eatPatternCharacters=function(t){for(var e=t.pos,s=0;(s=t.current())!==-1&&!$s(s);)t.advance();return t.pos!==e};y.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};y.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t)){t.groupNames.indexOf(t.lastStringValue)!==-1&&t.raise("Duplicate capture group name"),t.groupNames.push(t.lastStringValue);return}t.raise("Invalid group")}};y.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1};y.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Ge(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Ge(t.lastIntValue);return!0}return!1};y.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,s=t.current();return t.advance(),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(s=t.lastIntValue),Ur(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function Ur(t){return oe(t,!0)||t===36||t===95}y.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,s=t.current();return t.advance(),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(s=t.lastIntValue),$r(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function $r(t){return we(t,!0)||t===36||t===95||t===8204||t===8205}y.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};y.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var s=t.lastIntValue;if(t.switchU)return s>t.maxBackReference&&(t.maxBackReference=s),!0;if(s<=t.numCapturingParens)return!0;t.pos=e}return!1};y.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};y.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};y.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};y.regexp_eatZero=function(t){return t.current()===48&&!Ye(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};y.regexp_eatControlEscape=function(t){var e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};y.regexp_eatControlLetter=function(t){var e=t.current();return Hs(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};function Hs(t){return t>=65&&t<=90||t>=97&&t<=122}y.regexp_eatRegExpUnicodeEscapeSequence=function(t){var e=t.pos;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var s=t.lastIntValue;if(t.switchU&&s>=55296&&s<=56319){var r=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var i=t.lastIntValue;if(i>=56320&&i<=57343)return t.lastIntValue=(s-55296)*1024+(i-56320)+65536,!0}t.pos=r,t.lastIntValue=s}return!0}if(t.switchU&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&Hr(t.lastIntValue))return!0;t.switchU&&t.raise("Invalid unicode escape"),t.pos=e}return!1};function Hr(t){return t>=0&&t<=1114111}y.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;var e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};y.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1};y.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(Gr(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(e===80||e===112)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1};function Gr(t){return t===100||t===68||t===115||t===83||t===119||t===87}y.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var s=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var r=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,s,r),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,i),!0}return!1};y.regexp_validateUnicodePropertyNameAndValue=function(t,e,s){Ke(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(s)||t.raise("Invalid property value")};y.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")};y.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";Gs(e=t.current());)t.lastStringValue+=Ge(e),t.advance();return t.lastStringValue!==""};function Gs(t){return Hs(t)||t===95}y.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";qr(e=t.current());)t.lastStringValue+=Ge(e),t.advance();return t.lastStringValue!==""};function qr(t){return Gs(t)||Ye(t)}y.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};y.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1};y.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var s=t.lastIntValue;t.switchU&&(e===-1||s===-1)&&t.raise("Invalid character class"),e!==-1&&s!==-1&&e>s&&t.raise("Range out of order in character class")}}};y.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var s=t.current();(s===99||Ks(s))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var r=t.current();return r!==93?(t.lastIntValue=r,t.advance(),!0):!1};y.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};y.regexp_eatClassControlLetter=function(t){var e=t.current();return Ye(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};y.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};y.regexp_eatDecimalDigits=function(t){var e=t.pos,s=0;for(t.lastIntValue=0;Ye(s=t.current());)t.lastIntValue=10*t.lastIntValue+(s-48),t.advance();return t.pos!==e};function Ye(t){return t>=48&&t<=57}y.regexp_eatHexDigits=function(t){var e=t.pos,s=0;for(t.lastIntValue=0;qs(s=t.current());)t.lastIntValue=16*t.lastIntValue+Ws(s),t.advance();return t.pos!==e};function qs(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Ws(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}y.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var s=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+s*8+t.lastIntValue:t.lastIntValue=e*8+s}else t.lastIntValue=e;return!0}return!1};y.regexp_eatOctalDigit=function(t){var e=t.current();return Ks(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function Ks(t){return t>=48&&t<=55}y.regexp_eatFixedHexDigits=function(t,e){var s=t.pos;t.lastIntValue=0;for(var r=0;r<e;++r){var i=t.current();if(!qs(i))return t.pos=s,!1;t.lastIntValue=16*t.lastIntValue+Ws(i),t.advance()}return!0};var Rt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new ze(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},E=N.prototype;E.next=function(){this.options.onToken&&this.options.onToken(new Rt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};E.getToken=function(){return this.next(),new Rt(this)};typeof Symbol<"u"&&(E[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===u.eof,value:e}}}});E.curContext=function(){return this.context[this.context.length-1]};E.nextToken=function(){var t=this.curContext();if((!t||!t.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(u.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};E.readToken=function(t){return oe(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};E.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);if(t<=55295||t>=57344)return t;var e=this.input.charCodeAt(this.pos+1);return(t<<10)+e-56613888};E.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(s===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations){Te.lastIndex=e;for(var r;(r=Te.exec(this.input))&&r.index<this.pos;)++this.curLine,this.lineStart=r.index+r[0].length}this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,s),e,this.pos,t,this.curPosition())};E.skipLineComment=function(t){for(var e=this.pos,s=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!je(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,s,this.curPosition())};E.skipSpace=function(){e:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(t>8&&t<14||t>=5760&&Cs.test(String.fromCharCode(t)))++this.pos;else break e}}};E.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=t,this.value=e,this.updateContext(s)};E.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(u.ellipsis)):(++this.pos,this.finishToken(u.dot))};E.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(u.assign,2):this.finishOp(u.slash,1)};E.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),s=1,r=t===42?u.star:u.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++s,r=u.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(u.assign,s+1):this.finishOp(r,s)};E.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(t===124?u.logicalOR:u.logicalAND,2):e===61?this.finishOp(u.assign,2):this.finishOp(t===124?u.bitwiseOR:u.bitwiseAND,1)};E.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(u.assign,2):this.finishOp(u.bitwiseXOR,1)};E.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||J.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(u.incDec,2):e===61?this.finishOp(u.assign,2):this.finishOp(u.plusMin,1)};E.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),s=1;return e===t?(s=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+s)===61?this.finishOp(u.assign,s+1):this.finishOp(u.bitShift,s)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(s=2),this.finishOp(u.relational,s))};E.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(u.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(u.arrow)):this.finishOp(t===61?u.eq:u.prefix,1)};E.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(u.parenL);case 41:return++this.pos,this.finishToken(u.parenR);case 59:return++this.pos,this.finishToken(u.semi);case 44:return++this.pos,this.finishToken(u.comma);case 91:return++this.pos,this.finishToken(u.bracketL);case 93:return++this.pos,this.finishToken(u.bracketR);case 123:return++this.pos,this.finishToken(u.braceL);case 125:return++this.pos,this.finishToken(u.braceR);case 58:return++this.pos,this.finishToken(u.colon);case 63:return++this.pos,this.finishToken(u.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(u.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:return this.finishOp(u.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ot(t)+"'")};E.finishOp=function(t,e){var s=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,s)};E.readRegexp=function(){for(var t,e,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(J.test(r)&&this.raise(s,"Unterminated regular expression"),t)t=!1;else{if(r==="[")e=!0;else if(r==="]"&&e)e=!1;else if(r==="/"&&!e)break;t=r==="\\"}++this.pos}var i=this.input.slice(s,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new se(this));o.reset(s,i,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(i,a)}catch{}return this.finishToken(u.regexp,{pattern:i,flags:a,value:c})};E.readInt=function(t,e){for(var s=this.pos,r=0,i=0,n=e??1/0;i<n;++i){var a=this.input.charCodeAt(this.pos),o=void 0;if(a>=97?o=a-97+10:a>=65?o=a-65+10:a>=48&&a<=57?o=a-48:o=1/0,o>=t)break;++this.pos,r=r*t+o}return this.pos===s||e!=null&&this.pos-s!==e?null:r};E.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var s=this.readInt(t);return s==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(s=typeof BigInt<"u"?BigInt(this.input.slice(e,this.pos)):null,++this.pos):oe(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,s)};E.readNumber=function(t){var e=this.pos;!t&&this.readInt(10)===null&&this.raise(e,"Invalid number");var s=this.pos-e>=2&&this.input.charCodeAt(e)===48;s&&this.strict&&this.raise(e,"Invalid number"),s&&/[89]/.test(this.input.slice(e,this.pos))&&(s=!1);var r=this.input.charCodeAt(this.pos);if(!s&&!t&&this.options.ecmaVersion>=11&&r===110){var i=this.input.slice(e,this.pos),n=typeof BigInt<"u"?BigInt(i):null;return++this.pos,oe(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,n)}r===46&&!s&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!s&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),oe(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=this.input.slice(e,this.pos),o=s?parseInt(a,8):parseFloat(a);return this.finishToken(u.num,o)};E.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();var s=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(s,"Code point out of bounds")}else e=this.readHexChar(4);return e};function Ot(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}E.readString=function(t){for(var e="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===t)break;r===92?(e+=this.input.slice(s,this.pos),e+=this.readEscapedChar(!1),s=this.pos):(je(r,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(s,this.pos++),this.finishToken(u.string,e)};var zs={};E.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===zs)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};E.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw zs;this.raise(t,e)};E.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(s===96||s===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===u.template||this.type===u.invalidTemplate)?s===36?(this.pos+=2,this.finishToken(u.dollarBraceL)):(++this.pos,this.finishToken(u.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(u.template,t));if(s===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(je(s)){switch(t+=this.input.slice(e,this.pos),++this.pos,s){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=`
13
+ `;break;default:t+=String.fromCharCode(s);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};E.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(u.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};E.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`
14
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ot(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(e>=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),(s!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return je(e)?"":String.fromCharCode(e)}};E.readHexChar=function(t){var e=this.pos,s=this.readInt(16,t);return s===null&&this.invalidStringToken(e,"Bad character escape sequence"),s};E.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,s=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(we(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,t+=this.input.slice(s,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(e?oe:we)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),t+=Ot(a),s=this.pos}else break;e=!1}return t+this.input.slice(s,this.pos)};E.readWord=function(){var t=this.readWord1(),e=u.name;return this.keywords.test(t)&&(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+t),e=Et[t]),this.finishToken(e,t)};var Wr="7.1.0";N.acorn={Parser:N,version:Wr,defaultOptions:dt,Position:Ne,SourceLocation:ze,getLineInfo:Es,Node:Tt,TokenType:k,tokTypes:u,keywordTypes:Et,TokContext:K,tokContexts:A,isIdentifierChar:we,isIdentifierStart:oe,Token:Rt,isNewLine:je,lineBreak:J,lineBreakG:Te,nonASCIIwhitespace:Cs};function Kr(t,e){return N.parse(t,e)}class zr extends Error{}class Jr extends SyntaxError{}class gt extends ReferenceError{}class Qr extends TypeError{}class Js extends zr{}class Yr extends Jr{}class z extends gt{}const F={ExecutionTimeOutError:[3002,"Script execution timed out after %0ms",Js],NodeTypeSyntaxError:[1001,"Unknown node type: %0",z],BinaryOperatorSyntaxError:[1002,"Unknown binary operator: %0",z],LogicalOperatorSyntaxError:[1003,"Unknown logical operator: %0",z],UnaryOperatorSyntaxError:[1004,"Unknown unary operator: %0",z],UpdateOperatorSyntaxError:[1005,"Unknown update operator: %0",z],ObjectStructureSyntaxError:[1006,"Unknown object structure: %0",z],AssignmentExpressionSyntaxError:[1007,"Unknown assignment expression: %0",z],VariableTypeSyntaxError:[1008,"Unknown variable type: %0",z],ParamTypeSyntaxError:[1009,"Unknown param type: %0",z],AssignmentTypeSyntaxError:[1010,"Unknown assignment type: %0",z],FunctionUndefinedReferenceError:[2001,"%0 is not a function",gt],VariableUndefinedReferenceError:[2002,"%0 is not defined",gt],IsNotConstructor:[2003,"%0 is not a constructor",Qr]},Xr="1.4.8";function Jt(t,e){Object.defineProperty(t,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}const Zr=Object.prototype.hasOwnProperty,ve=Symbol("Break"),xe=Symbol("Continue"),Qt=Symbol("DefaultCase"),L=Symbol("EmptyStatementReturn"),Yt=Symbol("WithScopeName"),Xt=Symbol("SuperScopeName"),Zt=Symbol("RootScopeName"),es=Symbol("GlobalScopeName");function ut(t){return typeof t=="function"}class ne{constructor(e){this.interpreter=e}generator(){const e=this.interpreter;function s(){return this.getCurrentScope()}function r(){return this.getGlobalScope()}function i(){return this.getCurrentContext()}return{getOptions:e.getOptions.bind(e),getCurrentScope:s.bind(e),getGlobalScope:r.bind(e),getCurrentContext:i.bind(e),getExecStartTime:e.getExecStartTime.bind(e)}}}function Vt(t,e,s=!0){if(!(t instanceof ne))throw new Error("Illegal call");if(typeof e!="string")return e;if(!e)return;const r=t.generator(),n={timeout:r.getOptions().timeout,_initEnv:function(){s||this.setCurrentContext(r.getCurrentContext()),this.execStartTime=r.getExecStartTime(),this.execEndTime=this.execStartTime}},a=s?r.getGlobalScope():r.getCurrentScope();return new B(a,n).evaluate(e)}Object.defineProperty(Vt,"__IS_EVAL_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});function Lt(t,...e){if(!(t instanceof ne))throw new Error("Illegal call");const s=t.generator(),r=e.pop(),i=new B(s.getGlobalScope(),s.getOptions()),n=`
14
15
  (function anonymous(${e.join(",")}){
15
- ${i}
16
+ ${r}
16
17
  });
17
- `;return r.evaluate(n)}Object.defineProperty(Dt,"__IS_FUNCTION_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});class X{constructor(e){this.value=e}}class ce{constructor(e){this.value=e}}class ie{constructor(e){this.value=e}}class ve{constructor(e,s=null,i){this.name=i,this.parent=s,this.data=e,this.labelStack=[]}}function Ge(){}function ar(t=null,e){return new ve(Object.create(null),t,e)}function or(t){return Object.create(t)}const Z={NaN:NaN,Infinity:1/0,undefined:void 0,Object,Array,String,Boolean,Number,Date,RegExp,Error,URIError,TypeError,RangeError,SyntaxError,ReferenceError,Math,parseInt,parseFloat,isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,unescape,eval:Mt,Function:Dt};typeof JSON<"u"&&(Z.JSON=JSON);typeof Promise<"u"&&(Z.Promise=Promise);typeof Set<"u"&&(Z.Set=Set);typeof Map<"u"&&(Z.Map=Map);typeof Symbol<"u"&&(Z.Symbol=Symbol);typeof Proxy<"u"&&(Z.Proxy=Proxy);typeof WeakMap<"u"&&(Z.WeakMap=WeakMap);typeof WeakSet<"u"&&(Z.WeakSet=WeakSet);typeof Reflect<"u"&&(Z.Reflect=Reflect);class B{constructor(e=B.global,s={}){this.sourceList=[],this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null),this.isVarDeclMode=!1,this.lastExecNode=null,this.isRunning=!1,this.options={ecmaVersion:s.ecmaVersion||B.ecmaVersion,timeout:s.timeout||0,rootContext:s.rootContext,globalContextInFunction:s.globalContextInFunction===void 0?B.globalContextInFunction:s.globalContextInFunction,_initEnv:s._initEnv},this.context=e||Object.create(null),this.callStack=[],this.initEnvironment(this.context)}initEnvironment(e){let s;if(e instanceof ve)s=e;else{let r=null;const n=this.createSuperScope(e);this.options.rootContext&&(r=new ve(or(this.options.rootContext),n,is)),s=new ve(e,r||n,rs)}this.globalScope=s,this.currentScope=this.globalScope,this.globalContext=s.data,this.currentContext=s.data,this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null),this.execStartTime=Date.now(),this.execEndTime=this.execStartTime;const i=this.options._initEnv;i&&i.call(this)}getExecStartTime(){return this.execStartTime}getExecutionTime(){return this.execEndTime-this.execStartTime}setExecTimeout(e=0){this.options.timeout=e}getOptions(){return this.options}getGlobalScope(){return this.globalScope}getCurrentScope(){return this.currentScope}getCurrentContext(){return this.currentContext}isInterruptThrow(e){return e instanceof ei||e instanceof J||e instanceof ir}createSuperScope(e){let s=Object.assign({},Z);return Object.keys(s).forEach(r=>{r in e&&delete s[r]}),new ve(s,null,ss)}setCurrentContext(e){this.currentContext=e}setCurrentScope(e){this.currentScope=e}evaluate(e=""){let s;if(e)return s=Zi(e,{ranges:!0,locations:!0,ecmaVersion:this.options.ecmaVersion||B.ecmaVersion}),this.evaluateNode(s,e)}appendCode(e){return this.evaluate(e)}evaluateNode(e,s=""){this.value=void 0,this.source=s,this.sourceList.push(s),this.isRunning=!0,this.execStartTime=Date.now(),this.execEndTime=this.execStartTime,this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null);const i=this.getCurrentScope(),r=this.getCurrentContext(),n=i.labelStack.concat([]),a=this.callStack.concat([]),u=()=>{this.setCurrentScope(i),this.setCurrentContext(r),i.labelStack=n,this.callStack=a};try{const c=this.createClosure(e);this.addDeclarationsToScope(this.collectDeclVars,this.collectDeclFuncs,this.getCurrentScope()),c()}catch(c){throw c}finally{u(),this.execEndTime=Date.now()}return this.isRunning=!1,this.getValue()}createErrorMessage(e,s,i){let r=e[1].replace("%0",String(s));return i!==null&&(r+=this.getNodePosition(i||this.lastExecNode)),r}createError(e,s){return new s(e)}createThrowError(e,s){return this.createError(e,s)}createInternalThrowError(e,s,i){return this.createError(this.createErrorMessage(e,s,i),e[2])}checkTimeout(){if(!this.isRunning)return!1;const e=this.options.timeout||0;return Date.now()-this.execStartTime>e}getNodePosition(e){return e&&e.loc?` [${e.loc.start.line}:${e.loc.start.column}]`:""}createClosure(e){let s;switch(e.type){case"BinaryExpression":s=this.binaryExpressionHandler(e);break;case"LogicalExpression":s=this.logicalExpressionHandler(e);break;case"UnaryExpression":s=this.unaryExpressionHandler(e);break;case"UpdateExpression":s=this.updateExpressionHandler(e);break;case"ObjectExpression":s=this.objectExpressionHandler(e);break;case"ArrayExpression":s=this.arrayExpressionHandler(e);break;case"CallExpression":s=this.callExpressionHandler(e);break;case"NewExpression":s=this.newExpressionHandler(e);break;case"MemberExpression":s=this.memberExpressionHandler(e);break;case"ThisExpression":s=this.thisExpressionHandler(e);break;case"SequenceExpression":s=this.sequenceExpressionHandler(e);break;case"Literal":s=this.literalHandler(e);break;case"Identifier":s=this.identifierHandler(e);break;case"AssignmentExpression":s=this.assignmentExpressionHandler(e);break;case"FunctionDeclaration":s=this.functionDeclarationHandler(e);break;case"VariableDeclaration":s=this.variableDeclarationHandler(e);break;case"BlockStatement":case"Program":s=this.programHandler(e);break;case"ExpressionStatement":s=this.expressionStatementHandler(e);break;case"EmptyStatement":s=this.emptyStatementHandler(e);break;case"ReturnStatement":s=this.returnStatementHandler(e);break;case"FunctionExpression":s=this.functionExpressionHandler(e);break;case"IfStatement":s=this.ifStatementHandler(e);break;case"ConditionalExpression":s=this.conditionalExpressionHandler(e);break;case"ForStatement":s=this.forStatementHandler(e);break;case"WhileStatement":s=this.whileStatementHandler(e);break;case"DoWhileStatement":s=this.doWhileStatementHandler(e);break;case"ForInStatement":s=this.forInStatementHandler(e);break;case"WithStatement":s=this.withStatementHandler(e);break;case"ThrowStatement":s=this.throwStatementHandler(e);break;case"TryStatement":s=this.tryStatementHandler(e);break;case"ContinueStatement":s=this.continueStatementHandler(e);break;case"BreakStatement":s=this.breakStatementHandler(e);break;case"SwitchStatement":s=this.switchStatementHandler(e);break;case"LabeledStatement":s=this.labeledStatementHandler(e);break;case"DebuggerStatement":s=this.debuggerStatementHandler(e);break;default:throw this.createInternalThrowError(F.NodeTypeSyntaxError,e.type,e)}return(...i)=>{const r=this.options.timeout;if(r&&r>0&&this.checkTimeout())throw this.createInternalThrowError(F.ExecutionTimeOutError,r,null);return this.lastExecNode=e,s(...i)}}binaryExpressionHandler(e){const s=this.createClosure(e.left),i=this.createClosure(e.right);return()=>{const r=s(),n=i();switch(e.operator){case"==":return r==n;case"!=":return r!=n;case"===":return r===n;case"!==":return r!==n;case"<":return r<n;case"<=":return r<=n;case">":return r>n;case">=":return r>=n;case"<<":return r<<n;case">>":return r>>n;case">>>":return r>>>n;case"+":return r+n;case"-":return r-n;case"*":return r*n;case"**":return Math.pow(r,n);case"/":return r/n;case"%":return r%n;case"|":return r|n;case"^":return r^n;case"&":return r&n;case"in":return r in n;case"instanceof":return r instanceof n;default:throw this.createInternalThrowError(F.BinaryOperatorSyntaxError,e.operator,e)}}}logicalExpressionHandler(e){const s=this.createClosure(e.left),i=this.createClosure(e.right);return()=>{switch(e.operator){case"||":return s()||i();case"&&":return s()&&i();default:throw this.createInternalThrowError(F.LogicalOperatorSyntaxError,e.operator,e)}}}unaryExpressionHandler(e){switch(e.operator){case"delete":const s=this.createObjectGetter(e.argument),i=this.createNameGetter(e.argument);return()=>{let n=s();const a=i();return delete n[a]};default:let r;if(e.operator==="typeof"&&e.argument.type==="Identifier"){const n=this.createObjectGetter(e.argument),a=this.createNameGetter(e.argument);r=()=>n()[a()]}else r=this.createClosure(e.argument);return()=>{const n=r();switch(e.operator){case"-":return-n;case"+":return+n;case"!":return!n;case"~":return~n;case"void":return;case"typeof":return typeof n;default:throw this.createInternalThrowError(F.UnaryOperatorSyntaxError,e.operator,e)}}}}updateExpressionHandler(e){const s=this.createObjectGetter(e.argument),i=this.createNameGetter(e.argument);return()=>{const r=s(),n=i();switch(this.assertVariable(r,n,e),e.operator){case"++":return e.prefix?++r[n]:r[n]++;case"--":return e.prefix?--r[n]:r[n]--;default:throw this.createInternalThrowError(F.UpdateOperatorSyntaxError,e.operator,e)}}}objectExpressionHandler(e){const s=[];function i(n){return n.type==="Identifier"?n.name:n.type==="Literal"?n.value:this.throwError(F.ObjectStructureSyntaxError,n.type,n)}const r=Object.create(null);return e.properties.forEach(n=>{const a=n.kind,u=i(n.key);(!r[u]||a==="init")&&(r[u]={}),r[u][a]=this.createClosure(n.value),s.push({key:u,property:n})}),()=>{const n={},a=s.length;for(let u=0;u<a;u++){const c=s[u],l=c.key,h=r[l],p=h.init?h.init():void 0,m=h.get?h.get():function(){},f=h.set?h.set():function(g){};if("set"in h||"get"in h)Object.defineProperty(n,l,{configurable:!0,enumerable:!0,get:m,set:f});else{const g=c.property,b=g.kind;g.key.type==="Identifier"&&g.value.type==="FunctionExpression"&&b==="init"&&!g.value.id&&Zt(p,g.key.name),n[l]=p}}return n}}arrayExpressionHandler(e){const s=e.elements.map(i=>i&&this.createClosure(i));return()=>{const i=s.length,r=Array(i);for(let n=0;n<i;n++){const a=s[n];a&&(r[n]=a())}return r}}safeObjectGet(e,s,i){return e[s]}createCallFunctionGetter(e){switch(e.type){case"MemberExpression":const s=this.createClosure(e.object),i=this.createMemberKeyGetter(e),r=this.source;return()=>{const a=s(),u=i(),c=this.safeObjectGet(a,u,e);if(!c||!ht(c)){const l=r.slice(e.start,e.end);throw this.createInternalThrowError(F.FunctionUndefinedReferenceError,l,e)}return c.__IS_EVAL_FUNC?l=>c(new re(this),l,!0):c.__IS_FUNCTION_FUNC?(...l)=>c(new re(this),...l):c.bind(a)};default:const n=this.createClosure(e);return()=>{let a="";e.type==="Identifier"&&(a=e.name);const u=n();if(!u||!ht(u))throw this.createInternalThrowError(F.FunctionUndefinedReferenceError,a,e);if(e.type==="Identifier"&&u.__IS_EVAL_FUNC&&a==="eval")return l=>{const h=this.getScopeFromName(a,this.getCurrentScope()),p=h.name===ss||h.name===rs||h.name===is;return u(new re(this),l,!p)};if(u.__IS_EVAL_FUNC)return l=>u(new re(this),l,!0);if(u.__IS_FUNCTION_FUNC)return(...l)=>u(new re(this),...l);let c=this.options.globalContextInFunction;if(e.type==="Identifier"){const l=this.getIdentifierScope(e);l.name===ts&&(c=l.data)}return u.bind(c)}}}callExpressionHandler(e){const s=this.createCallFunctionGetter(e.callee),i=e.arguments.map(r=>this.createClosure(r));return()=>s()(...i.map(r=>r()))}functionExpressionHandler(e){const s=this,i=this.source,r=this.collectDeclVars,n=this.collectDeclFuncs;this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null);const a=e.id?e.id.name:"",u=e.params.length,c=e.params.map(m=>this.createParamNameGetter(m)),l=this.createClosure(e.body),h=this.collectDeclVars,p=this.collectDeclFuncs;return this.collectDeclVars=r,this.collectDeclFuncs=n,()=>{const m=s.getCurrentScope(),f=function(...g){s.callStack.push(`${a}`);const b=s.getCurrentScope(),v=ar(m,`FunctionScope(${a})`);s.setCurrentScope(v),s.addDeclarationsToScope(h,p,v),a&&(v.data[a]=f),v.data.arguments=arguments,c.forEach((O,w)=>{v.data[O()]=g[w]});const x=s.getCurrentContext();s.setCurrentContext(this);const I=l();if(s.setCurrentContext(x),s.setCurrentScope(b),s.callStack.pop(),I instanceof X)return I.value};return Zt(f,a),Object.defineProperty(f,"length",{value:u,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(f,"toString",{value:()=>i.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(f,"valueOf",{value:()=>i.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),f}}newExpressionHandler(e){const s=this.source,i=this.createClosure(e.callee),r=e.arguments.map(n=>this.createClosure(n));return()=>{const n=i();if(!ht(n)||n.__IS_EVAL_FUNC){const a=e.callee,u=s.slice(a.start,a.end);throw this.createInternalThrowError(F.IsNotConstructor,u,e)}return n.__IS_FUNCTION_FUNC?n(new re(this),...r.map(a=>a())):new n(...r.map(a=>a()))}}memberExpressionHandler(e){const s=this.createClosure(e.object),i=this.createMemberKeyGetter(e);return()=>{const r=s();let n=i();return r[n]}}thisExpressionHandler(e){return()=>this.getCurrentContext()}sequenceExpressionHandler(e){const s=e.expressions.map(i=>this.createClosure(i));return()=>{let i;const r=s.length;for(let n=0;n<r;n++){const a=s[n];i=a()}return i}}literalHandler(e){return()=>e.regex?new RegExp(e.regex.pattern,e.regex.flags):e.value}identifierHandler(e){return()=>{const s=this.getCurrentScope(),i=this.getScopeDataFromName(e.name,s);return this.assertVariable(i,e.name,e),i[e.name]}}getIdentifierScope(e){const s=this.getCurrentScope();return this.getScopeFromName(e.name,s)}assignmentExpressionHandler(e){e.left.type==="Identifier"&&e.right.type==="FunctionExpression"&&!e.right.id&&(e.right.id={type:"Identifier",name:e.left.name});const s=this.createObjectGetter(e.left),i=this.createNameGetter(e.left),r=this.createClosure(e.right);return()=>{const n=s(),a=i(),u=r();switch(e.operator!=="="&&this.assertVariable(n,a,e),e.operator){case"=":return n[a]=u;case"+=":return n[a]+=u;case"-=":return n[a]-=u;case"*=":return n[a]*=u;case"**=":return n[a]=Math.pow(n[a],u);case"/=":return n[a]/=u;case"%=":return n[a]%=u;case"<<=":return n[a]<<=u;case">>=":return n[a]>>=u;case">>>=":return n[a]>>>=u;case"&=":return n[a]&=u;case"^=":return n[a]^=u;case"|=":return n[a]|=u;default:throw this.createInternalThrowError(F.AssignmentExpressionSyntaxError,e.type,e)}}}functionDeclarationHandler(e){if(e.id){const s=this.functionExpressionHandler(e);Object.defineProperty(s,"isFunctionDeclareClosure",{value:!0,writable:!1,configurable:!1,enumerable:!1}),this.funcDeclaration(e.id.name,s)}return()=>V}getVariableName(e){if(e.type==="Identifier")return e.name;throw this.createInternalThrowError(F.VariableTypeSyntaxError,e.type,e)}variableDeclarationHandler(e){let s;const i=[];for(let r=0;r<e.declarations.length;r++){const n=e.declarations[r];this.varDeclaration(this.getVariableName(n.id)),n.init&&i.push({type:"AssignmentExpression",operator:"=",left:n.id,right:n.init})}return i.length&&(s=this.createClosure({type:"BlockStatement",body:i})),()=>{if(s){const r=this.isVarDeclMode;this.isVarDeclMode=!0,s(),this.isVarDeclMode=r}return V}}assertVariable(e,s,i){if(e===this.globalScope.data&&!(s in e))throw this.createInternalThrowError(F.VariableUndefinedReferenceError,s,i)}programHandler(e){const s=e.body.map(i=>this.createClosure(i));return()=>{let i=V;for(let r=0;r<s.length;r++){const n=s[r],a=this.setValue(n());if(a!==V&&(i=a,i instanceof X||i instanceof ce||i instanceof ie||i===me||i===ge))break}return i}}expressionStatementHandler(e){return this.createClosure(e.expression)}emptyStatementHandler(e){return()=>V}returnStatementHandler(e){const s=e.argument?this.createClosure(e.argument):Ge;return()=>new X(s())}ifStatementHandler(e){const s=this.createClosure(e.test),i=this.createClosure(e.consequent),r=e.alternate?this.createClosure(e.alternate):()=>V;return()=>s()?i():r()}conditionalExpressionHandler(e){return this.ifStatementHandler(e)}forStatementHandler(e){let s=Ge,i=e.test?this.createClosure(e.test):()=>!0,r=Ge;const n=this.createClosure(e.body);return e.type==="ForStatement"&&(s=e.init?this.createClosure(e.init):s,r=e.update?this.createClosure(e.update):Ge),a=>{let u,c=V,l=e.type==="DoWhileStatement";for(a&&a.type==="LabeledStatement"&&(u=a.label.name),s();l||i();r()){l=!1;const h=this.setValue(n());if(!(h===V||h===ge)){if(h===me)break;if(c=h,c instanceof ie&&c.value===u){c=V;continue}if(c instanceof X||c instanceof ce||c instanceof ie)break}}return c}}whileStatementHandler(e){return this.forStatementHandler(e)}doWhileStatementHandler(e){return this.forStatementHandler(e)}forInStatementHandler(e){let s=e.left;const i=this.createClosure(e.right),r=this.createClosure(e.body);return e.left.type==="VariableDeclaration"&&(this.createClosure(e.left)(),s=e.left.declarations[0].id),n=>{let a,u=V,c;n&&n.type==="LabeledStatement"&&(a=n.label.name);const l=i();for(c in l){this.assignmentExpressionHandler({type:"AssignmentExpression",operator:"=",left:s,right:{type:"Literal",value:c}})();const h=this.setValue(r());if(!(h===V||h===ge)){if(h===me)break;if(u=h,u instanceof ie&&u.value===a){u=V;continue}if(u instanceof X||u instanceof ce||u instanceof ie)break}}return u}}withStatementHandler(e){const s=this.createClosure(e.object),i=this.createClosure(e.body);return()=>{const r=s(),n=this.getCurrentScope(),a=new ve(r,n,ts);this.setCurrentScope(a);const u=this.setValue(i());return this.setCurrentScope(n),u}}throwStatementHandler(e){const s=this.createClosure(e.argument);return()=>{throw this.setValue(void 0),s()}}tryStatementHandler(e){const s=this.createClosure(e.block),i=e.handler?this.catchClauseHandler(e.handler):null,r=e.finalizer?this.createClosure(e.finalizer):null;return()=>{const n=this.getCurrentScope(),a=this.getCurrentContext(),u=n.labelStack.concat([]),c=this.callStack.concat([]);let l=V,h,p;const m=()=>{this.setCurrentScope(n),this.setCurrentContext(a),n.labelStack=u,this.callStack=c};try{l=this.setValue(s()),l instanceof X&&(h=l)}catch(f){if(m(),this.isInterruptThrow(f))throw f;if(i)try{l=this.setValue(i(f)),l instanceof X&&(h=l)}catch(g){if(m(),this.isInterruptThrow(g))throw g;p=g}}if(r)try{l=r(),l instanceof X&&(h=l)}catch(f){if(m(),this.isInterruptThrow(f))throw f;p=f}if(p)throw p;return h||l}}catchClauseHandler(e){const s=this.createParamNameGetter(e.param),i=this.createClosure(e.body);return r=>{let n;const u=this.getCurrentScope().data,c=s(),l=nr.call(u,c),h=u[c];return u[c]=r,n=i(),l?u[c]=h:delete u[c],n}}continueStatementHandler(e){return()=>e.label?new ie(e.label.name):ge}breakStatementHandler(e){return()=>e.label?new ce(e.label.name):me}switchStatementHandler(e){const s=this.createClosure(e.discriminant),i=e.cases.map(r=>this.switchCaseHandler(r));return()=>{const r=s();let n=!1,a,u,c=0,l=!1;for(let h=0;h<2;h++){for(let p=c;p<i.length;p++){const m=i[p](),f=m.testClosure();if(!l&&f===es&&(l=!0,c=p),n||f===r){if(n=!0,u=this.setValue(m.bodyClosure()),u===V)continue;if(u===me||(a=u,a instanceof X||a instanceof ce||a instanceof ie||a===ge))break}}if(!n&&l)n=!0;else break}return a}}switchCaseHandler(e){const s=e.test?this.createClosure(e.test):()=>es,i=this.createClosure({type:"BlockStatement",body:e.consequent});return()=>({testClosure:s,bodyClosure:i})}labeledStatementHandler(e){const s=e.label.name,i=this.createClosure(e.body);return()=>{let r;const n=this.getCurrentScope();return n.labelStack.push(s),r=i(e),r instanceof ce&&r.value===s&&(r=V),n.labelStack.pop(),r}}debuggerStatementHandler(e){return()=>{debugger;return V}}createParamNameGetter(e){if(e.type==="Identifier")return()=>e.name;throw this.createInternalThrowError(F.ParamTypeSyntaxError,e.type,e)}createObjectKeyGetter(e){let s;return e.type==="Identifier"?s=()=>e.name:s=this.createClosure(e),function(){return s()}}createMemberKeyGetter(e){return e.computed?this.createClosure(e.property):this.createObjectKeyGetter(e.property)}createObjectGetter(e){switch(e.type){case"Identifier":return()=>this.getScopeDataFromName(e.name,this.getCurrentScope());case"MemberExpression":return this.createClosure(e.object);default:throw this.createInternalThrowError(F.AssignmentTypeSyntaxError,e.type,e)}}createNameGetter(e){switch(e.type){case"Identifier":return()=>e.name;case"MemberExpression":return this.createMemberKeyGetter(e);default:throw this.createInternalThrowError(F.AssignmentTypeSyntaxError,e.type,e)}}varDeclaration(e){const s=this.collectDeclVars;s[e]=void 0}funcDeclaration(e,s){const i=this.collectDeclFuncs;i[e]=s}addDeclarationsToScope(e,s,i){const r=i.data;for(let n in s){const a=s[n];r[n]=a&&a()}for(let n in e)n in r||(r[n]=void 0)}getScopeValue(e,s){return this.getScopeFromName(e,s).data[e]}getScopeDataFromName(e,s){return this.getScopeFromName(e,s).data}getScopeFromName(e,s){let i=s;do if(e in i.data)return i;while(i=i.parent);return this.globalScope}setValue(e){const s=this.callStack.length;return this.isVarDeclMode||s||e===V||e===me||e===ge||e instanceof ce||e instanceof ie||(this.value=e instanceof X?e.value:e),e}getValue(){return this.value}}B.version=rr;B.eval=Mt;B.Function=Dt;B.ecmaVersion=5;B.globalContextInFunction=void 0;B.global=Object.create(null);const ur=(()=>{try{return new Function("return 1")(),!0}catch{return!1}})();function Fe(t){if(typeof globalThis>"u")return;const e=globalThis[0]||globalThis;if(e.__simulator__)try{const s=e.__simulator__.engine.provider.errorHandler;s&&s(t)}catch{}}function cr(t,e){return new B(e,{rootContext:e,globalContextInFunction:e}).evaluate(`(function($scope){ ${t} }).call(this, this)`)}function we(t,e,s=!1,i=!1,r=!1){try{const n=['"use strict";',"var __self = $scope;"];n.push("return ");let a=(t.value||"").trim();r||(a=a.replace(/this(\W|$)/g,(c,l)=>`__self${l}`)),a=n.join(`
18
- `)+a;const u=r?`
18
+ `;return i.evaluate(n)}Object.defineProperty(Lt,"__IS_FUNCTION_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});class Q{constructor(e){this.value=e}}class le{constructor(e){this.value=e}}class ie{constructor(e){this.value=e}}class be{constructor(e,s=null,r){this.name=r,this.parent=s,this.data=e,this.labelStack=[]}}function Ue(){}function ei(t=null,e){return new be(Object.create(null),t,e)}function ti(t){return Object.create(t)}const X={NaN:NaN,Infinity:1/0,undefined:void 0,Object,Array,String,Boolean,Number,Date,RegExp,Error,URIError,TypeError,RangeError,SyntaxError,ReferenceError,Math,parseInt,parseFloat,isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,unescape,eval:Vt,Function:Lt};typeof JSON<"u"&&(X.JSON=JSON);typeof Promise<"u"&&(X.Promise=Promise);typeof Set<"u"&&(X.Set=Set);typeof Map<"u"&&(X.Map=Map);typeof Symbol<"u"&&(X.Symbol=Symbol);typeof Proxy<"u"&&(X.Proxy=Proxy);typeof WeakMap<"u"&&(X.WeakMap=WeakMap);typeof WeakSet<"u"&&(X.WeakSet=WeakSet);typeof Reflect<"u"&&(X.Reflect=Reflect);class B{constructor(e=B.global,s={}){this.sourceList=[],this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null),this.isVarDeclMode=!1,this.lastExecNode=null,this.isRunning=!1,this.options={ecmaVersion:s.ecmaVersion||B.ecmaVersion,timeout:s.timeout||0,rootContext:s.rootContext,globalContextInFunction:s.globalContextInFunction===void 0?B.globalContextInFunction:s.globalContextInFunction,_initEnv:s._initEnv},this.context=e||Object.create(null),this.callStack=[],this.initEnvironment(this.context)}initEnvironment(e){let s;if(e instanceof be)s=e;else{let i=null;const n=this.createSuperScope(e);this.options.rootContext&&(i=new be(ti(this.options.rootContext),n,Zt)),s=new be(e,i||n,es)}this.globalScope=s,this.currentScope=this.globalScope,this.globalContext=s.data,this.currentContext=s.data,this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null),this.execStartTime=Date.now(),this.execEndTime=this.execStartTime;const r=this.options._initEnv;r&&r.call(this)}getExecStartTime(){return this.execStartTime}getExecutionTime(){return this.execEndTime-this.execStartTime}setExecTimeout(e=0){this.options.timeout=e}getOptions(){return this.options}getGlobalScope(){return this.globalScope}getCurrentScope(){return this.currentScope}getCurrentContext(){return this.currentContext}isInterruptThrow(e){return e instanceof Js||e instanceof z||e instanceof Yr}createSuperScope(e){let s=Object.assign({},X);return Object.keys(s).forEach(i=>{i in e&&delete s[i]}),new be(s,null,Xt)}setCurrentContext(e){this.currentContext=e}setCurrentScope(e){this.currentScope=e}evaluate(e=""){let s;if(e)return s=Kr(e,{ranges:!0,locations:!0,ecmaVersion:this.options.ecmaVersion||B.ecmaVersion}),this.evaluateNode(s,e)}appendCode(e){return this.evaluate(e)}evaluateNode(e,s=""){this.value=void 0,this.source=s,this.sourceList.push(s),this.isRunning=!0,this.execStartTime=Date.now(),this.execEndTime=this.execStartTime,this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null);const r=this.getCurrentScope(),i=this.getCurrentContext(),n=r.labelStack.concat([]),a=this.callStack.concat([]),o=()=>{this.setCurrentScope(r),this.setCurrentContext(i),r.labelStack=n,this.callStack=a};try{const c=this.createClosure(e);this.addDeclarationsToScope(this.collectDeclVars,this.collectDeclFuncs,this.getCurrentScope()),c()}catch(c){throw c}finally{o(),this.execEndTime=Date.now()}return this.isRunning=!1,this.getValue()}createErrorMessage(e,s,r){let i=e[1].replace("%0",String(s));return r!==null&&(i+=this.getNodePosition(r||this.lastExecNode)),i}createError(e,s){return new s(e)}createThrowError(e,s){return this.createError(e,s)}createInternalThrowError(e,s,r){return this.createError(this.createErrorMessage(e,s,r),e[2])}checkTimeout(){if(!this.isRunning)return!1;const e=this.options.timeout||0;return Date.now()-this.execStartTime>e}getNodePosition(e){return e&&e.loc?` [${e.loc.start.line}:${e.loc.start.column}]`:""}createClosure(e){let s;switch(e.type){case"BinaryExpression":s=this.binaryExpressionHandler(e);break;case"LogicalExpression":s=this.logicalExpressionHandler(e);break;case"UnaryExpression":s=this.unaryExpressionHandler(e);break;case"UpdateExpression":s=this.updateExpressionHandler(e);break;case"ObjectExpression":s=this.objectExpressionHandler(e);break;case"ArrayExpression":s=this.arrayExpressionHandler(e);break;case"CallExpression":s=this.callExpressionHandler(e);break;case"NewExpression":s=this.newExpressionHandler(e);break;case"MemberExpression":s=this.memberExpressionHandler(e);break;case"ThisExpression":s=this.thisExpressionHandler(e);break;case"SequenceExpression":s=this.sequenceExpressionHandler(e);break;case"Literal":s=this.literalHandler(e);break;case"Identifier":s=this.identifierHandler(e);break;case"AssignmentExpression":s=this.assignmentExpressionHandler(e);break;case"FunctionDeclaration":s=this.functionDeclarationHandler(e);break;case"VariableDeclaration":s=this.variableDeclarationHandler(e);break;case"BlockStatement":case"Program":s=this.programHandler(e);break;case"ExpressionStatement":s=this.expressionStatementHandler(e);break;case"EmptyStatement":s=this.emptyStatementHandler(e);break;case"ReturnStatement":s=this.returnStatementHandler(e);break;case"FunctionExpression":s=this.functionExpressionHandler(e);break;case"IfStatement":s=this.ifStatementHandler(e);break;case"ConditionalExpression":s=this.conditionalExpressionHandler(e);break;case"ForStatement":s=this.forStatementHandler(e);break;case"WhileStatement":s=this.whileStatementHandler(e);break;case"DoWhileStatement":s=this.doWhileStatementHandler(e);break;case"ForInStatement":s=this.forInStatementHandler(e);break;case"WithStatement":s=this.withStatementHandler(e);break;case"ThrowStatement":s=this.throwStatementHandler(e);break;case"TryStatement":s=this.tryStatementHandler(e);break;case"ContinueStatement":s=this.continueStatementHandler(e);break;case"BreakStatement":s=this.breakStatementHandler(e);break;case"SwitchStatement":s=this.switchStatementHandler(e);break;case"LabeledStatement":s=this.labeledStatementHandler(e);break;case"DebuggerStatement":s=this.debuggerStatementHandler(e);break;default:throw this.createInternalThrowError(F.NodeTypeSyntaxError,e.type,e)}return(...r)=>{const i=this.options.timeout;if(i&&i>0&&this.checkTimeout())throw this.createInternalThrowError(F.ExecutionTimeOutError,i,null);return this.lastExecNode=e,s(...r)}}binaryExpressionHandler(e){const s=this.createClosure(e.left),r=this.createClosure(e.right);return()=>{const i=s(),n=r();switch(e.operator){case"==":return i==n;case"!=":return i!=n;case"===":return i===n;case"!==":return i!==n;case"<":return i<n;case"<=":return i<=n;case">":return i>n;case">=":return i>=n;case"<<":return i<<n;case">>":return i>>n;case">>>":return i>>>n;case"+":return i+n;case"-":return i-n;case"*":return i*n;case"**":return Math.pow(i,n);case"/":return i/n;case"%":return i%n;case"|":return i|n;case"^":return i^n;case"&":return i&n;case"in":return i in n;case"instanceof":return i instanceof n;default:throw this.createInternalThrowError(F.BinaryOperatorSyntaxError,e.operator,e)}}}logicalExpressionHandler(e){const s=this.createClosure(e.left),r=this.createClosure(e.right);return()=>{switch(e.operator){case"||":return s()||r();case"&&":return s()&&r();default:throw this.createInternalThrowError(F.LogicalOperatorSyntaxError,e.operator,e)}}}unaryExpressionHandler(e){switch(e.operator){case"delete":const s=this.createObjectGetter(e.argument),r=this.createNameGetter(e.argument);return()=>{let n=s();const a=r();return delete n[a]};default:let i;if(e.operator==="typeof"&&e.argument.type==="Identifier"){const n=this.createObjectGetter(e.argument),a=this.createNameGetter(e.argument);i=()=>n()[a()]}else i=this.createClosure(e.argument);return()=>{const n=i();switch(e.operator){case"-":return-n;case"+":return+n;case"!":return!n;case"~":return~n;case"void":return;case"typeof":return typeof n;default:throw this.createInternalThrowError(F.UnaryOperatorSyntaxError,e.operator,e)}}}}updateExpressionHandler(e){const s=this.createObjectGetter(e.argument),r=this.createNameGetter(e.argument);return()=>{const i=s(),n=r();switch(this.assertVariable(i,n,e),e.operator){case"++":return e.prefix?++i[n]:i[n]++;case"--":return e.prefix?--i[n]:i[n]--;default:throw this.createInternalThrowError(F.UpdateOperatorSyntaxError,e.operator,e)}}}objectExpressionHandler(e){const s=[];function r(n){return n.type==="Identifier"?n.name:n.type==="Literal"?n.value:this.throwError(F.ObjectStructureSyntaxError,n.type,n)}const i=Object.create(null);return e.properties.forEach(n=>{const a=n.kind,o=r(n.key);(!i[o]||a==="init")&&(i[o]={}),i[o][a]=this.createClosure(n.value),s.push({key:o,property:n})}),()=>{const n={},a=s.length;for(let o=0;o<a;o++){const c=s[o],h=c.key,l=i[h],p=l.init?l.init():void 0,m=l.get?l.get():function(){},f=l.set?l.set():function(g){};if("set"in l||"get"in l)Object.defineProperty(n,h,{configurable:!0,enumerable:!0,get:m,set:f});else{const g=c.property,v=g.kind;g.key.type==="Identifier"&&g.value.type==="FunctionExpression"&&v==="init"&&!g.value.id&&Jt(p,g.key.name),n[h]=p}}return n}}arrayExpressionHandler(e){const s=e.elements.map(r=>r&&this.createClosure(r));return()=>{const r=s.length,i=Array(r);for(let n=0;n<r;n++){const a=s[n];a&&(i[n]=a())}return i}}safeObjectGet(e,s,r){return e[s]}createCallFunctionGetter(e){switch(e.type){case"MemberExpression":const s=this.createClosure(e.object),r=this.createMemberKeyGetter(e),i=this.source;return()=>{const a=s(),o=r(),c=this.safeObjectGet(a,o,e);if(!c||!ut(c)){const h=i.slice(e.start,e.end);throw this.createInternalThrowError(F.FunctionUndefinedReferenceError,h,e)}return c.__IS_EVAL_FUNC?h=>c(new ne(this),h,!0):c.__IS_FUNCTION_FUNC?(...h)=>c(new ne(this),...h):c.bind(a)};default:const n=this.createClosure(e);return()=>{let a="";e.type==="Identifier"&&(a=e.name);const o=n();if(!o||!ut(o))throw this.createInternalThrowError(F.FunctionUndefinedReferenceError,a,e);if(e.type==="Identifier"&&o.__IS_EVAL_FUNC&&a==="eval")return h=>{const l=this.getScopeFromName(a,this.getCurrentScope()),p=l.name===Xt||l.name===es||l.name===Zt;return o(new ne(this),h,!p)};if(o.__IS_EVAL_FUNC)return h=>o(new ne(this),h,!0);if(o.__IS_FUNCTION_FUNC)return(...h)=>o(new ne(this),...h);let c=this.options.globalContextInFunction;if(e.type==="Identifier"){const h=this.getIdentifierScope(e);h.name===Yt&&(c=h.data)}return o.bind(c)}}}callExpressionHandler(e){const s=this.createCallFunctionGetter(e.callee),r=e.arguments.map(i=>this.createClosure(i));return()=>s()(...r.map(i=>i()))}functionExpressionHandler(e){const s=this,r=this.source,i=this.collectDeclVars,n=this.collectDeclFuncs;this.collectDeclVars=Object.create(null),this.collectDeclFuncs=Object.create(null);const a=e.id?e.id.name:"",o=e.params.length,c=e.params.map(m=>this.createParamNameGetter(m)),h=this.createClosure(e.body),l=this.collectDeclVars,p=this.collectDeclFuncs;return this.collectDeclVars=i,this.collectDeclFuncs=n,()=>{const m=s.getCurrentScope(),f=function(...g){s.callStack.push(`${a}`);const v=s.getCurrentScope(),x=ei(m,`FunctionScope(${a})`);s.setCurrentScope(x),s.addDeclarationsToScope(l,p,x),a&&(x.data[a]=f),x.data.arguments=arguments,c.forEach((P,S)=>{x.data[P()]=g[S]});const b=s.getCurrentContext();s.setCurrentContext(this);const I=h();if(s.setCurrentContext(b),s.setCurrentScope(v),s.callStack.pop(),I instanceof Q)return I.value};return Jt(f,a),Object.defineProperty(f,"length",{value:o,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(f,"toString",{value:()=>r.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(f,"valueOf",{value:()=>r.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),f}}newExpressionHandler(e){const s=this.source,r=this.createClosure(e.callee),i=e.arguments.map(n=>this.createClosure(n));return()=>{const n=r();if(!ut(n)||n.__IS_EVAL_FUNC){const a=e.callee,o=s.slice(a.start,a.end);throw this.createInternalThrowError(F.IsNotConstructor,o,e)}return n.__IS_FUNCTION_FUNC?n(new ne(this),...i.map(a=>a())):new n(...i.map(a=>a()))}}memberExpressionHandler(e){const s=this.createClosure(e.object),r=this.createMemberKeyGetter(e);return()=>{const i=s();let n=r();return i[n]}}thisExpressionHandler(e){return()=>this.getCurrentContext()}sequenceExpressionHandler(e){const s=e.expressions.map(r=>this.createClosure(r));return()=>{let r;const i=s.length;for(let n=0;n<i;n++){const a=s[n];r=a()}return r}}literalHandler(e){return()=>e.regex?new RegExp(e.regex.pattern,e.regex.flags):e.value}identifierHandler(e){return()=>{const s=this.getCurrentScope(),r=this.getScopeDataFromName(e.name,s);return this.assertVariable(r,e.name,e),r[e.name]}}getIdentifierScope(e){const s=this.getCurrentScope();return this.getScopeFromName(e.name,s)}assignmentExpressionHandler(e){e.left.type==="Identifier"&&e.right.type==="FunctionExpression"&&!e.right.id&&(e.right.id={type:"Identifier",name:e.left.name});const s=this.createObjectGetter(e.left),r=this.createNameGetter(e.left),i=this.createClosure(e.right);return()=>{const n=s(),a=r(),o=i();switch(e.operator!=="="&&this.assertVariable(n,a,e),e.operator){case"=":return n[a]=o;case"+=":return n[a]+=o;case"-=":return n[a]-=o;case"*=":return n[a]*=o;case"**=":return n[a]=Math.pow(n[a],o);case"/=":return n[a]/=o;case"%=":return n[a]%=o;case"<<=":return n[a]<<=o;case">>=":return n[a]>>=o;case">>>=":return n[a]>>>=o;case"&=":return n[a]&=o;case"^=":return n[a]^=o;case"|=":return n[a]|=o;default:throw this.createInternalThrowError(F.AssignmentExpressionSyntaxError,e.type,e)}}}functionDeclarationHandler(e){if(e.id){const s=this.functionExpressionHandler(e);Object.defineProperty(s,"isFunctionDeclareClosure",{value:!0,writable:!1,configurable:!1,enumerable:!1}),this.funcDeclaration(e.id.name,s)}return()=>L}getVariableName(e){if(e.type==="Identifier")return e.name;throw this.createInternalThrowError(F.VariableTypeSyntaxError,e.type,e)}variableDeclarationHandler(e){let s;const r=[];for(let i=0;i<e.declarations.length;i++){const n=e.declarations[i];this.varDeclaration(this.getVariableName(n.id)),n.init&&r.push({type:"AssignmentExpression",operator:"=",left:n.id,right:n.init})}return r.length&&(s=this.createClosure({type:"BlockStatement",body:r})),()=>{if(s){const i=this.isVarDeclMode;this.isVarDeclMode=!0,s(),this.isVarDeclMode=i}return L}}assertVariable(e,s,r){if(e===this.globalScope.data&&!(s in e))throw this.createInternalThrowError(F.VariableUndefinedReferenceError,s,r)}programHandler(e){const s=e.body.map(r=>this.createClosure(r));return()=>{let r=L;for(let i=0;i<s.length;i++){const n=s[i],a=this.setValue(n());if(a!==L&&(r=a,r instanceof Q||r instanceof le||r instanceof ie||r===ve||r===xe))break}return r}}expressionStatementHandler(e){return this.createClosure(e.expression)}emptyStatementHandler(e){return()=>L}returnStatementHandler(e){const s=e.argument?this.createClosure(e.argument):Ue;return()=>new Q(s())}ifStatementHandler(e){const s=this.createClosure(e.test),r=this.createClosure(e.consequent),i=e.alternate?this.createClosure(e.alternate):()=>L;return()=>s()?r():i()}conditionalExpressionHandler(e){return this.ifStatementHandler(e)}forStatementHandler(e){let s=Ue,r=e.test?this.createClosure(e.test):()=>!0,i=Ue;const n=this.createClosure(e.body);return e.type==="ForStatement"&&(s=e.init?this.createClosure(e.init):s,i=e.update?this.createClosure(e.update):Ue),a=>{let o,c=L,h=e.type==="DoWhileStatement";for(a&&a.type==="LabeledStatement"&&(o=a.label.name),s();h||r();i()){h=!1;const l=this.setValue(n());if(!(l===L||l===xe)){if(l===ve)break;if(c=l,c instanceof ie&&c.value===o){c=L;continue}if(c instanceof Q||c instanceof le||c instanceof ie)break}}return c}}whileStatementHandler(e){return this.forStatementHandler(e)}doWhileStatementHandler(e){return this.forStatementHandler(e)}forInStatementHandler(e){let s=e.left;const r=this.createClosure(e.right),i=this.createClosure(e.body);return e.left.type==="VariableDeclaration"&&(this.createClosure(e.left)(),s=e.left.declarations[0].id),n=>{let a,o=L,c;n&&n.type==="LabeledStatement"&&(a=n.label.name);const h=r();for(c in h){this.assignmentExpressionHandler({type:"AssignmentExpression",operator:"=",left:s,right:{type:"Literal",value:c}})();const l=this.setValue(i());if(!(l===L||l===xe)){if(l===ve)break;if(o=l,o instanceof ie&&o.value===a){o=L;continue}if(o instanceof Q||o instanceof le||o instanceof ie)break}}return o}}withStatementHandler(e){const s=this.createClosure(e.object),r=this.createClosure(e.body);return()=>{const i=s(),n=this.getCurrentScope(),a=new be(i,n,Yt);this.setCurrentScope(a);const o=this.setValue(r());return this.setCurrentScope(n),o}}throwStatementHandler(e){const s=this.createClosure(e.argument);return()=>{throw this.setValue(void 0),s()}}tryStatementHandler(e){const s=this.createClosure(e.block),r=e.handler?this.catchClauseHandler(e.handler):null,i=e.finalizer?this.createClosure(e.finalizer):null;return()=>{const n=this.getCurrentScope(),a=this.getCurrentContext(),o=n.labelStack.concat([]),c=this.callStack.concat([]);let h=L,l,p;const m=()=>{this.setCurrentScope(n),this.setCurrentContext(a),n.labelStack=o,this.callStack=c};try{h=this.setValue(s()),h instanceof Q&&(l=h)}catch(f){if(m(),this.isInterruptThrow(f))throw f;if(r)try{h=this.setValue(r(f)),h instanceof Q&&(l=h)}catch(g){if(m(),this.isInterruptThrow(g))throw g;p=g}}if(i)try{h=i(),h instanceof Q&&(l=h)}catch(f){if(m(),this.isInterruptThrow(f))throw f;p=f}if(p)throw p;return l||h}}catchClauseHandler(e){const s=this.createParamNameGetter(e.param),r=this.createClosure(e.body);return i=>{let n;const o=this.getCurrentScope().data,c=s(),h=Zr.call(o,c),l=o[c];return o[c]=i,n=r(),h?o[c]=l:delete o[c],n}}continueStatementHandler(e){return()=>e.label?new ie(e.label.name):xe}breakStatementHandler(e){return()=>e.label?new le(e.label.name):ve}switchStatementHandler(e){const s=this.createClosure(e.discriminant),r=e.cases.map(i=>this.switchCaseHandler(i));return()=>{const i=s();let n=!1,a,o,c=0,h=!1;for(let l=0;l<2;l++){for(let p=c;p<r.length;p++){const m=r[p](),f=m.testClosure();if(!h&&f===Qt&&(h=!0,c=p),n||f===i){if(n=!0,o=this.setValue(m.bodyClosure()),o===L)continue;if(o===ve||(a=o,a instanceof Q||a instanceof le||a instanceof ie||a===xe))break}}if(!n&&h)n=!0;else break}return a}}switchCaseHandler(e){const s=e.test?this.createClosure(e.test):()=>Qt,r=this.createClosure({type:"BlockStatement",body:e.consequent});return()=>({testClosure:s,bodyClosure:r})}labeledStatementHandler(e){const s=e.label.name,r=this.createClosure(e.body);return()=>{let i;const n=this.getCurrentScope();return n.labelStack.push(s),i=r(e),i instanceof le&&i.value===s&&(i=L),n.labelStack.pop(),i}}debuggerStatementHandler(e){return()=>{debugger;return L}}createParamNameGetter(e){if(e.type==="Identifier")return()=>e.name;throw this.createInternalThrowError(F.ParamTypeSyntaxError,e.type,e)}createObjectKeyGetter(e){let s;return e.type==="Identifier"?s=()=>e.name:s=this.createClosure(e),function(){return s()}}createMemberKeyGetter(e){return e.computed?this.createClosure(e.property):this.createObjectKeyGetter(e.property)}createObjectGetter(e){switch(e.type){case"Identifier":return()=>this.getScopeDataFromName(e.name,this.getCurrentScope());case"MemberExpression":return this.createClosure(e.object);default:throw this.createInternalThrowError(F.AssignmentTypeSyntaxError,e.type,e)}}createNameGetter(e){switch(e.type){case"Identifier":return()=>e.name;case"MemberExpression":return this.createMemberKeyGetter(e);default:throw this.createInternalThrowError(F.AssignmentTypeSyntaxError,e.type,e)}}varDeclaration(e){const s=this.collectDeclVars;s[e]=void 0}funcDeclaration(e,s){const r=this.collectDeclFuncs;r[e]=s}addDeclarationsToScope(e,s,r){const i=r.data;for(let n in s){const a=s[n];i[n]=a&&a()}for(let n in e)n in i||(i[n]=void 0)}getScopeValue(e,s){return this.getScopeFromName(e,s).data[e]}getScopeDataFromName(e,s){return this.getScopeFromName(e,s).data}getScopeFromName(e,s){let r=s;do if(e in r.data)return r;while(r=r.parent);return this.globalScope}setValue(e){const s=this.callStack.length;return this.isVarDeclMode||s||e===L||e===ve||e===xe||e instanceof le||e instanceof ie||(this.value=e instanceof Q?e.value:e),e}getValue(){return this.value}}B.version=Xr;B.eval=Vt;B.Function=Lt;B.ecmaVersion=5;B.globalContextInFunction=void 0;B.global=Object.create(null);const si=(()=>{try{return new Function("return 1")(),!0}catch{return!1}})();function pe(t){if(typeof globalThis>"u")return;const e=globalThis[0]||globalThis;if(e.__simulator__)try{const s=e.__simulator__.engine.provider.errorHandler;s&&s(t)}catch{}}function ri(t,e){return new B(e,{rootContext:e,globalContextInFunction:e}).evaluate(`(function($scope){ ${t} }).call(this, this)`)}function Ee(t,e,s=!1,r=!1,i=!1){try{const n=['"use strict";',"var __self = $scope;"];n.push("return ");let a=(t.value||"").trim();a=n.join(`
19
+ `)+a;const o=i?`
19
20
  ${a}
20
- `:`with(${s?"{}":"$scope || {}"}) { ${a} }`;return ur?new Function("$scope",u)(e):cr(u,e)}catch(n){if(d.logger.error("parseExpression.error",n,t,e?.__self??e),n&&(n.info=t.value),Fe(n),i)throw n}}function W(t,e,s=!1,i=!1,r=!1){const n=we(t,e,s,i,r);if(typeof n!="function"&&(d.logger.error("parseFunction.error","not a function",t,e?.__self??e),i))throw new Error(`"${t.value}" not a function`);return n}function N(t){return t&&t.type==="JSExpression"}function L(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function ti(t){return N(t)||L(t)}function lr(t){return ti(t)?t.value.startsWith("{")?`(${t.value})`:t.value:JSON.stringify(t)}const hr={session:!1,authKey:"Authorization",storageKey:"ACCESS_STORAGE",storagePrefix:"__VTJ_",unauthorized:void 0,auth:"/#/login",redirectParam:"r",unauthorizedCode:401,unauthorizedMessage:"登录已经失效,请重新登录!",noPermissionMessage:"无权限访问该页面",appName:"",statusKey:"code"},Bt=Symbol("access");class it{options;data=null;mode=P.Raw;interceptResponse=!0;isTipShowing=!1;constructor(e){this.options=Object.assign({},hr,e),this.loadData()}enableIntercept(){this.interceptResponse=!0}disableIntercept(){this.interceptResponse=!1}connect(e){const{mode:s,router:i,request:r}=e;this.mode=s,i&&this.mode!==P.Design&&this.setGuard(i),r&&this.setRequest(r)}login(e){const{storageKey:s,storagePrefix:i,session:r,authKey:n}=this.options;this.setData(e),this.data&&(d.storage.save(s,e,{type:"local",prefix:i}),r&&d.cookie.set(n,this.data.token))}clear(){const{storageKey:e,storagePrefix:s,session:i,authKey:r}=this.options;this.data=null,d.storage.remove(e,{type:"local",prefix:s}),i&&d.cookie.remove(r)}logout(){this.clear(),this.toLogin()}getData(){return this.data?this.data:(this.loadData(),this.data)}getToken(){return this.data||this.loadData(),this.data?.token}can(e){const{appName:s}=this.options,{permissions:i={}}=this.data||{};if(typeof e=="function")return e(i);const r=d.toArray(e);return Array.isArray(i)?r.every(n=>i.includes(n)||i.includes(s+"."+n)):r.every(n=>i[n]||i[s+"."+n])}some(e){const{appName:s}=this.options,{permissions:i={}}=this.data||{},r=d.toArray(e);return Array.isArray(i)?r.some(n=>i.includes(n)||i.includes(s+"."+n)):r.some(n=>i[n]||i[s+"."+n])}install(e){e.config.globalProperties.$access=this,e.provide(Bt,this)}isAuthPath(e){const{auth:s,isAuth:i}=this.options;if(i)return i(e);if(e.path&&typeof s=="string"){const r=s.split("#")[1]||s;return e.path===r}return!1}toLogin(){const{auth:e,redirectParam:s}=this.options;if(!e)return;const i=s?`?${s}=${encodeURIComponent(location.href)}`:"";typeof e=="function"?e(i):location.href=s?`${e}${i}`:e}setData(e){const{privateKey:s}=this.options;if(Array.isArray(e)&&s){const i=e.map(r=>d.unRSA(r,s));try{this.data=JSON.parse(i.join(""))}catch(r){console.warn(r)}return}if(typeof e=="string")try{const i=s?d.unRSA(e,s):e;i?this.data=JSON.parse(i):console.warn("RSA解密失败或登录信息缺失")}catch(i){console.warn(i)}else this.data=e}loadData(){const{storageKey:e,storagePrefix:s}=this.options,i=d.storage.get(e,{type:"local",prefix:s});this.setData(i||null)}isLogined(){const{session:e,authKey:s}=this.options;return e&&s?!!d.cookie.get(s):!!this.getToken()}hasRoutePermission(e){if(e.name===_e){const s=e.params.id;return s&&this.can(s)}return e.meta.__vtj__?this.can(e.meta.__vtj__):e.meta.permission?this.can(e.meta.permission):!0}setGuard(e){e.beforeEach((s,i,r)=>this.guard(s,r))}async guard(e,s){if(this.isWhiteList(e)||this.isAuthPath(e))return s();if(this.isLogined()){if(this.hasRoutePermission(e))return s();{const{noPermissionMessage:i="无权限访问",unauthorized:r=!1}=this.options;return await this.showTip(i),d.isFunction(r)?(r(),s(!1)):d.isString(r)?s(r):s(!1)}}s(!1),await d.delay(0),this.toLogin()}isWhiteList(e){const{whiteList:s}=this.options;return s?Array.isArray(s)?s.some(i=>e.fullPath.startsWith(i)):s(e):!1}isUnauthorized(e){const{unauthorizedCode:s=401,statusKey:i="code"}=this.options;return e.status===s||e.data?.[i]===s}async showUnauthorizedAlert(e){const{unauthorizedMessage:s="登录已失效"}=this.options;this.isUnauthorized(e)&&await this.showTip(s)&&this.toLogin()}async showTip(e){const{alert:s}=this.options;return this.isTipShowing?!1:s?(this.isTipShowing=!0,await d.delay(150),await s(e,{title:"提示",type:"warning"})?.catch(()=>!0)?.finally(()=>{this.isTipShowing=!1})):(globalThis.alert?.(e)??console.warn(e),!0)}setRequest(e){e.useRequest(s=>(this.data?.token&&(s.headers[this.options.authKey]=this.data?.token),s)),e.useResponse(async s=>(this.interceptResponse&&await this.showUnauthorizedAlert(s),s),async s=>{if(!this.interceptResponse)return Promise.reject(s);const i=s.response||s||{};return await this.showUnauthorizedAlert(i),Promise.reject(s)})}}function si(){return j.inject(Bt,null)}function pr(t={}){const{notify:e,loading:s,settings:i={},Startup:r,access:n,useTitle:a,alert:u}=t;let c=null;return{request:d.createRequest({adapter:t.axiosAdapter,settings:{type:"form",validSuccess:!1,originResponse:!0,loading:!0,validate:h=>h.data?.code===0||!!h.data?.success,failMessage:!0,showError:h=>{e&&e(h||"未知错误")},showLoading:()=>{c&&c.close(),s&&(c=s())},hideLoading:()=>{c&&(c.close(),c=null)},...i}}),jsonp:d.jsonp,notify:e,loading:s,useTitle:a,alert:u,startupComponent:r,access:n?new it({alert:u,...n}):void 0}}function fr(t={}){return new it(t)}function ii(t,e){const{jsonp:s,request:i}=e;if(t.method==="jsonp")return(r={})=>s(t.url,{...t.jsonpOptions,query:r});{const r=t.headers?we(t.headers,{},!0):void 0,n={url:t.url,method:t.method,settings:{...t.settings,headers:r}};return(a,u)=>(delete n.data,i.send(d.merge(n,u||{},{data:a})))}}function ri(t,e){const{metaQuery:s}=e;if(!s)return;const{code:i,queryCode:r}=t;return(n,a)=>{if(!s){console.warn("adapter.metaQuery is not defined!");return}return s(i,r,n,a)}}function ni(t=[],e=[],s){const i={};for(const r of t){const n=ii(r,s);i[r.id]=n,i[r.name]=n}for(const r of e)i[r.id]=ri(r,s);return i}async function ai(t=[],e=globalThis){const s=Se(e);s&&(Ht(e),t.forEach(i=>ui(s,i)))}function oi(t,e=globalThis){const s=L(t.mockTemplate)&&t.mockTemplate.value?W(t.mockTemplate,{},!0):void 0,i=Se(e);return async(...r)=>{let n={};if(s)try{n=await s.apply(s,r)}catch(a){d.logger.warn("模拟数据模版异常",a)}return i?.mock(n)}}function ui(t,e){if(!e.mock)return;const{url:s,mockTemplate:i,method:r="get",settings:n={}}=e;if(s&&i)try{const a=d.isUrl(s)?new URL(s).pathname:s,u=d.pathToRegexp(`(.*)${a}`,[],{end:!1}),c=new RegExp(u.source+"([?#].*)?$",u.flags),l=d.pathToRegexpMatch(a,{decode:decodeURIComponent}),h=we(i,{},!0);t.mock(c,r.toLowerCase(),p=>{const m=d.url.parse(p.url)||{},f=n.type||"form";let g=p.body instanceof FormData?d.formDataToJson(p.body):p.body;if(typeof g=="string")if(f==="json")try{g=JSON.parse(g)}catch(x){console.warn("[Mock.mock]",x)}else g=d.url.parse(g);const b=d.isUrl(p.url)?new URL(p.url).pathname:p.url.split("?")[0],v=l(b)?.params;Object.assign(p,{data:g,params:v,query:m});try{return t.mock(h(p))}catch(x){return console.warn("[mockApi]",c,p,x),null}})}catch(a){console.warn("mockApi",a)}}function Ht(t=globalThis){const e=Se(t);e&&(e._mocked={})}class _t{__id=null;__mode;__instance=null;__contextRefs={};__refs={};__refCaches={};__refGenerations={};context={};state={};props={};$props={};$state={};$refs={};$el=null;$emit=null;$nextTick=null;$parent=null;$root=null;$attrs=null;$slots=null;$watch=null;$options=null;$forceUpdate=null;$components={};$libs={};$apis={};$provider=null;$uni=null;$getApp=null;__transform={};constructor(e){const{mode:s,dsl:i,attrs:r}=e;this.__mode=s,i&&(this.__id=i.id||null,this.__transform=i.transform||{}),r&&Object.assign(this,r)}setup(e,s=be){const i=s.getCurrentInstance();if(!i)return;this.__refs={},this.__refCaches={},this.$refs={},this.context={},this.__contextRefs={},this.__instance=i.proxy;const{state:r}=this,n=i.appContext.config.globalProperties;Object.assign(this,n,e||{}),this.$uni=this.$libs.UniH5?.uni??null,this.$getApp=this.$libs.UniH5?.getApp??null,this.$state=this.state=r,this.__proxy(),s.onMounted(()=>{this.__proxy()}),s.onUnmounted(()=>{this.__cleanup()}),s.onBeforeUpdate(()=>{if(this.__proxy(),this.$props)for(const a of Object.keys(this.$props))this[a]=this.$props[a];this.__reset()})}__proxy(){if(!this.__instance)return;const e=this.__instance;gt.forEach(s=>{this[s]=e[s]||e._?.[s.replace("$","")]||null})}__cleanup(){gt.forEach(e=>{this[e]=null}),this.__reset(),this.__refGenerations={}}__reset(){this.__refs={},this.__refCaches={},this.$refs={},this.__contextRefs={},this.context={}}__parseFunction(e){if(e)if(this.__mode===P.Runtime){const{id:s,type:i}=e,r=s?this.__transform[s]??e.value:e.value;return W({type:i,value:r},this)}else return W(e,this)}__parseExpression(e){if(e)if(this.__mode===P.Runtime){const{id:s,type:i}=e,r=s?this.__transform[s]??e.value:e.value;return we({type:i,value:r},this)}else return we(e,this)}__ref(e=null,s){if(this.__mode===P.VNode)return;e&&e!==this.__id&&(this.__contextRefs[e]=this);let i=e?this.__refCaches[e]:null;if(i)return i;const r=e?(this.__refGenerations[e]||0)+1:0;return e&&(this.__refGenerations[e]=r),i=async n=>{if(await d.delay(0),e&&this.__refGenerations[e]!==r)return;let a=n?.$vtjEl||n?.$el||n?._?.vnode?.el||n;if(!a){typeof s=="string"&&(delete this.$refs[s],this[s]&&be.isRef(this[s])&&(this[s].value=null),e&&delete this.__refs[e]);return}return a.nodeType===3&&a.nextSibling&&(a=a.nextSibling),a.__vtj__=e,P.Design===this.__mode&&(a.__context__=this,a.draggable=!0),e&&(this.__refs[e]=this.__getRefEl(this.__refs,e,n)),typeof s=="function"?s(n):s&&(this.$refs[s]=this.__getRefEl(this.$refs,s,n),this[s]&&be.isRef(this[s])&&(this[s].value=this.$refs[s])),n},e&&(this.__refCaches[e]=i),i}__getRefEl(e,s,i){const r=e[s];if(r&&i!==r){const n=new Set([].concat(r,i));return Array.from(n)}else return i}__clone(e={}){const s={...this.context,...e},i={...s,context:s};return i.context.__proto__=this.context,i.__proto__=this,i}}const pt=Symbol("vtjBlockChain");function ze(t){const{Vue:e=be,UniApp:s={},mode:i=P.Runtime,components:r={},libs:n={},apis:a={},loader:u}=t,c=e.computed(()=>t.dsl),l={$components:r,$libs:n,$apis:a},h=new _t({mode:i,dsl:c.value,attrs:l}),p=e.defineComponent({name:c.value.name,__scopeId:c.value.id?`data-v-${c.value.id}`:void 0,props:{...mr(c.value.props??[],h)},async setup(m={}){const f=c.value.id,g=c.value.name,b=e.inject(pt,null);if(f&&b&&b.has(f)){const Y=`检测到区块循环引用: ${g}(${f})`;return console.warn(`[VTJ Renderer] ${Y},已中断渲染以防止浏览器崩溃`),Fe(new Error(Y)),e.provide(pt,b),{__vtjCircular:!0}}const v=new Set(b||[]);f&&v.add(f),e.provide(pt,v);const x=new _t({mode:i,dsl:c.value,attrs:l});x.$props=x.props=m,c.value.id&&Qe(t.window||globalThis,c.value.id,c.value.css||"",!0);const I=c.value.apiMode==="composition";x.$state=x.state=gr(e,c.value.state??{},x);const O=I?_r(e,c.value.refs??{},x):{},w=I?Sr(e,c.value.reactives??{},x):{},H=vr(e,c.value.computed??{},x),de=xr(c.value.methods??{},x),ke=br(e,c.value.inject,x),Q=ci(c.value.dataSources||{},x);let He={};I&&(He=Cr(c.value.composables??[],x));const at={...m,...O,...w,...ke,...H,...de,...Q,...He};if(x.setup(at,e),e.onMounted(()=>{ns(x,h)}),I&&c.value.props&&c.value.props.length>0){const Y=new Set([...Object.keys(O),...Object.keys(w),...Object.keys(H)]);for(const ue of c.value.props){const Ie=typeof ue=="string"?ue:ue.name;Y.has(Ie)||Object.defineProperty(x,Ie,{get(){return this.$props[Ie]},set(Wt){},configurable:!0,enumerable:!0})}}if(yr(e,c.value.watch??[],x),I){if(await Er(e,c.value.lifeCycles??{},x,s),c.value.setup){const Y=x.__parseFunction(c.value.setup);if(d.isFunction(Y))try{await Y()}catch(ue){console.warn("[VTJ] Composition setup 执行失败",ue)}}wr(e,c.value.provide??{},x)}return{vtj:x,state:x.$state,...m,...O,...w,...H,...de}},emits:dr(c.value.emits),expose:["vtj",...c.value.expose||[]],render(){if(this.__vtjCircular)return null;const m=this.vtj||h,f=c.value;if(f.refs)for(const v of Object.keys(f.refs))this[v];if(f.reactives)for(const v of Object.keys(f.reactives)){const x=this[v];if(x&&typeof x=="object")for(const I of Object.keys(x))x[I]}if(f.state){const v=this.state;for(const x of Object.keys(f.state))v[x]}if(f.computed)for(const v of Object.keys(f.computed))this[v];if(f.inject)for(const v of f.inject)this[v.name];if(f.props&&f.props.length>0)for(const v of f.props){const x=typeof v=="string"?v:v.name;this[x]}if(!f.nodes)return null;const g=f.nodes||[];let b;if(g.length===1)b=pe(g[0],m,e,u,g);else{const v=g.map(x=>pe(x,m,e,u,g)).flat();b=e.createVNode("div",{},v)}return ns(m,h),b},...c.value.apiMode!=="composition"?kr(c.value.lifeCycles??{},h):{}});return{renderer:e.markRaw(p),context:h}}function ns(t,e){t!==e&&(Object.assign(e,t),delete e.__refGenerations,delete e.__refCaches,delete e.__transform)}function dr(t=[]){return t.map(e=>d.isString(e)?e:e.name)}function mr(t=[],e){const s=i=>i?(Array.isArray(i)?i:[i]).map(n=>us[n]):void 0;return t.map(i=>d.isString(i)?{name:i}:{name:i.name,type:i.type,required:i.required,default:N(i.default)?e.__parseExpression(i.default):i.default}).reduce((i,r)=>(i[r.name]={type:s(r.type),required:r.required,default:r.default},i),{})}function gr(t,e,s){return t.reactive(Object.keys(e||{}).reduce((i,r)=>{let n=e[r];return N(n)?n=s.__parseExpression(n):L(n)&&(n=s.__parseFunction(n)),i[r]=n,i},{}))}function vr(t,e,s){return Object.entries(e??{}).reduce((i,[r,n])=>(L(n)?i[r]=t.computed(s.__parseFunction(n)):i[r]=t.computed(s.__parseExpression(n)),i),{})}function xr(t,e){return Object.entries(t??{}).reduce((s,[i,r])=>(s[i]=e.__parseFunction(r),s),{})}function br(t,e=[],s){return e.reduce((i,r)=>{const{name:n,from:a}=r||{},u=N(a)?s.__parseExpression(a)||n:a??n,c=N(r.default)?s.__parseExpression(r.default):r.default??null;return i[n]=t.inject(u,c),i},{})}function ci(t,e){return Object.keys(t).reduce((s,i)=>{const r=t[i];if(r.type==="mock")s[i]=oi(r);else if(r.ref){const n=e.$apis[r.ref],a=L(r.transform)?r.transform.value?e.__parseFunction(r.transform):void 0:r.transform;s[i]=async(...u)=>{const c=await n.apply(e,u);return a?a(c):c}}return s},{})}function yr(t,e=[],s){e.forEach(i=>{t.watch(s.__parseExpression(i.source),s.__parseFunction(i.handler),{deep:i.deep,immediate:i.immediate,flush:i.flush})})}function _r(t,e,s){return Object.entries(e).reduce((i,[r,n])=>{const a=N(n)?s.__parseExpression(n):n;return i[r]=t.ref(a),i},{})}function Sr(t,e,s){return Object.entries(e).reduce((i,[r,n])=>{const a=N(n)?s.__parseExpression(n):n;return i[r]=t.reactive(a??{}),i},{})}function Cr(t,e){return t.reduce((s,i)=>{try{let r;if(N(i.composable)?r=e.__parseExpression(i.composable):d.isString(i.composable)&&(r=e.$libs[i.composable]),d.isFunction(r)){const n=(i.args||[]).map(u=>N(u)?e.__parseExpression(u):u),a=r(...n);if(i.destructure&&i.destructure.length>0)for(const u of i.destructure)s[u]=a?.[u];else s[i.name]=a}}catch(r){e.__mode===P.Design&&(console.warn("[VTJ] composable 执行失败,已降级处理",r),s[i.name]={})}return s},{})}function wr(t,e,s){Object.entries(e).forEach(([i,r])=>{let n=r;N(r)?n=s.__parseExpression(r):L(r)&&(n=s.__parseFunction(r)),t.provide(i,n)})}async function Er(t,e,s,i={}){const r={beforeMount:"onBeforeMount",mounted:"onMounted",beforeUpdate:"onBeforeUpdate",updated:"onUpdated",beforeUnmount:"onBeforeUnmount",unmounted:"onUnmounted",errorCaptured:"onErrorCaptured",renderTracked:"onRenderTracked",renderTriggered:"onRenderTriggered",activated:"onActivated",deactivated:"onDeactivated"};for(const[n,a]of Object.entries(e)){if(n==="created"||n==="beforeCreate"){const l=s.__parseFunction(a);if(d.isFunction(l))try{await l()}catch(h){console.warn(`[VTJ] Composition 生命周期 "${n}" 执行失败`,h),Fe(h)}continue}const u=r[n]||n,c=t[u]||i[u];if(c&&d.isFunction(c)){const l=s.__parseFunction(a);d.isFunction(l)&&c(async()=>{try{await d.delay(0),await l()}catch(h){console.warn(`[VTJ] Composition 生命周期 "${n}" 执行失败`,h),Fe(h)}})}else console.warn(`[VTJ] 无效的 Composition 生命周期钩子 "${n}"`)}}function kr(t,e){return Object.entries(t??{}).reduce((s,[i,r])=>(s[i]=async function(){const a=(this?.vtj||e).__parseFunction(r);d.isFunction(a)&&(await d.delay(0),await a())},s),{})}class Ir{__props={};__events={};__nodes={};constructor(){}setProps(e,s){this.__props[e]=s}getProps(e){return this.__props[e]}loadProps(e,s){const i=e?this.getProps(e):null;return i||(e&&this.setProps(e,s),s)}setEvents(e,s){}getEvents(e){return this.__events[e]}loadEvents(e,s){const i=e?this.getEvents(e):null;return i||(e&&this.setEvents(e,s),s)}setNode(e,s){this.__nodes[e]=s}getNode(e){return this.__nodes[e]}loadNode(e,s){const i=e?this.getNode(e):null;return i||(e&&this.setNode(e,s),s)}isEqual(e,s){return d.isEqual(e,s)}isNodeEqual(e,s){if(e===s)return!0;if(!e||!s)return!1;const i=u=>!u||typeof u!="object"?[]:Object.keys(u).filter(c=>d.isFunction(u[c])),r=u=>{if(!u||typeof u!="object")return u;const c={};for(const l in u)if(Object.prototype.hasOwnProperty.call(u,l)){const h=u[l];d.isFunction(h)||(c[l]=h)}return c},n=i(e).sort(),a=i(s).sort();return d.isEqual(n,a)?d.isEqual(r(e),r(s)):!1}clear(){this.__props={},this.__events={},this.__nodes={}}}const xe=new Ir,li=new d.Queue;let ft=[],le={},Pe={};const hi=(t,e)=>e;async function Ut(t,e=globalThis){const{urls:s=[],library:i}=t,r=s.filter(u=>Me(u));if(r.length===0||!i)return null;const n=s.filter(u=>je(u));return n.length&&kt(n,e),await It(r,i,e).catch(u=>(console.warn("loadScriptUrl error",r,i,u),null))}function Je(t){const{getDsl:e,getDslByUrl:s,options:i}=t;return i.window&&(ft.forEach(r=>{delete i.window[r]}),ft=[]),(r,n,a,u=be)=>{if(!a||typeof a=="string")return n;let c="";if(a.type==="Schema"&&a.id)return c=a.id+"_"+r,Pe[c]||(Pe[c]=u.defineAsyncComponent(async()=>{const l=le[a.id]||await li.add(a.id,()=>e(a.id));return l&&(l.name=n,le[a.id]=l),l?ze({Vue:u,mode:P.Runtime,...i,dsl:d.cloneDeep(l),loader:Je(t)}).renderer:null}));if(a.type==="UrlSchema"&&a.url)return c=a.url+"_"+r,Pe[c]||(Pe[c]=u.defineAsyncComponent(async()=>{const l=le[a.url]||await s(a.url);return l&&(l.name=n,le[a.url]=l),l?ze({...i,Vue:u,dsl:d.cloneDeep(l),mode:P.Runtime,loader:Je(t)}).renderer:null}));if(a.type==="Plugin"){let l=a.library?le[a.library]:null;return l||(a.library&&ft.push(a.library),l=le[a.library||Symbol()]=u.defineAsyncComponent(async()=>{const h=await Ut(a,i.window);return h||(console.warn("getPlugin result is null",a),null)}),l)}return n}}function Ar(){le={},Pe={},li.clearAllCache(),xe.clear()}function pe(t,e,s=be,i=hi,r=[],n=!1,a=0){if(!t||!t.name||t.invisible)return null;const u=s.getCurrentInstance()?.appContext,{id:c=null,directives:l=[]}=t,{vIf:h,vElseIf:p,vElse:m,vFor:f,vShow:g,vModels:b,vBind:v,vHtml:x,others:I}=pi(l);if(!n&&(p||m))return null;if(h&&!Tr(h,e))return Lr(t,e,s,i,r);const O=(w,H=0)=>{const de=w.$components,ke=(()=>{if(t.name==="component")return Rr(w,t.props?.is);if(t.name==="slot")return t.name;const R=i(`${t.id}_${H}`,t.name,t.from,s);return d.isString(R)?ys(R)||_s(R)?R:de[R]??u?.app?.component(R)??R:R})(),Q=Nr(c,t.props??{},w),He=Fr(s,t.id,t.events??{},w);if(t.name==="slot")return jr(s,t,Q,w,i);v&&Object.assign(Q,w.__parseExpression(v.value)),g&&(Q.style=Object.assign(Q.style??{},Dr(g,w))),x&&Object.assign(Q,Br(x,w)),b.forEach(R=>{wt.includes(t.name)?Object.assign(Q,Hr(R,w)):Object.assign(Q,Ur(s,R,w))});const at=$r(s,t.children??[],w,i,t),Y=w?.__id?`data-v-${w.__id}`:void 0,ue=Y?{[Y]:""}:{},Ie=w.__mode===P.Design?{"data-vtj":c}:{},{ref:Wt,...Ue}=Q,vi=Object.keys(Ue).filter(R=>R.startsWith("on")),Kt={},zt={};for(const R of Object.keys(Ue))vi.includes(R)?Kt[R]=Ue[R]:zt[R]=Ue[R];const $e=`${c}_${H}`,ot={key:$e,...ue,...Ie,...zt};xe.isNodeEqual(ot,xe.getNode($e))||xe.setNode($e,ot);let ut=s.createVNode(ke,{...xe.getNode($e)||ot,ref:Wt,...Kt,...He},at);const Jt=u?Pr(u,I,w):[];return Jt.length&&(ut=s.withDirectives(ut,Jt)),ut};return f?Wr(f,O,e):O(e,a)}function Pr(t,e,s){const i=t.app;return e.map(r=>{const n=typeof r.name=="string"?i.directive(r.name):s.__parseExpression(r.name);if(!n)return null;const a=[n];return r.value&&a.push(s.__parseExpression(r.value)),r.arg&&a.push(r.arg),r.modifiers&&a.push(r.modifiers),a}).filter(r=>!!r)}function pi(t=[]){const e=t.find(h=>d.camelCase(h.name)==="vIf"),s=t.find(h=>d.camelCase(h.name)==="vElseIf"),i=t.find(h=>d.camelCase(h.name)==="vElse"),r=t.find(h=>d.camelCase(h.name)==="vFor"),n=t.find(h=>d.camelCase(h.name)==="vShow"),a=t.find(h=>d.camelCase(h.name)==="vBind"),u=t.find(h=>d.camelCase(h.name)==="vHtml"),c=t.filter(h=>d.camelCase(h.name)==="vModel"),l=t.filter(h=>!os.includes(d.camelCase(h.name)));return{vIf:e,vElseIf:s,vElse:i,vFor:r,vShow:n,vModels:c,vBind:a,others:l,vHtml:u}}function Tr(t,e){return!!e.__parseExpression(t.value)}function Rr(t,e){return e?N(e)?t.__parseExpression(e):e:"div"}function Nr(t,e,s){const i=St(e,s);return i.ref=s.__ref(t,i.ref),i}function St(t,e){return N(t)?e.__parseExpression(t):L(t)?e.__parseFunction(t):Array.isArray(t)?t.map(s=>St(s,e)):typeof t=="object"?Object.keys(t||{}).reduce((s,i)=>{let r=t[i];return s[i]=St(r,e),s},{}):t}function Or(t,e){return s=>{s?.key?.toLowerCase()===e.toLowerCase()&&t(s)}}function Vr(t){return Ss(t.value)?t:Cs(t.value)?{type:"JSFunction",value:`(...args) => (() => {
21
+ `:`with(${s?"{}":"$scope || {}"}) { ${a} }`;if(si){const c=new Function("$scope",o).call(e,e);return typeof c=="function"?c.bind(e):c}else{const c=ri(o,e);return typeof c=="function"?c.bind(e):c}}catch(n){if(d.logger.error("parseExpression.error",n,t,e?.__self??e),n&&(n.info=t.value),pe(n),r)throw n}}function q(t,e,s=!1,r=!1,i=!1){const n=Ee(t,e,s,r,i);if(typeof n!="function"&&(d.logger.error("parseFunction.error","not a function",t,e?.__self??e),r))throw new Error(`"${t.value}" not a function`);return n}function R(t){return t&&t.type==="JSExpression"}function j(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function Qs(t){return R(t)||j(t)}function ii(t){return Qs(t)?t.value.startsWith("{")?`(${t.value})`:t.value:JSON.stringify(t)}const ni={session:!1,authKey:"Authorization",storageKey:"ACCESS_STORAGE",storagePrefix:"__VTJ_",unauthorized:void 0,auth:"/#/login",redirectParam:"r",unauthorizedCode:401,unauthorizedMessage:"登录已经失效,请重新登录!",noPermissionMessage:"无权限访问该页面",appName:"",statusKey:"code"},Ft=Symbol("access");class Xe{options;data=null;mode=T.Raw;interceptResponse=!0;isTipShowing=!1;constructor(e){this.options=Object.assign({},ni,e),this.loadData()}enableIntercept(){this.interceptResponse=!0}disableIntercept(){this.interceptResponse=!1}connect(e){const{mode:s,router:r,request:i}=e;this.mode=s,r&&this.mode!==T.Design&&this.setGuard(r),i&&this.setRequest(i)}login(e){const{storageKey:s,storagePrefix:r,session:i,authKey:n}=this.options;this.setData(e),this.data&&(d.storage.save(s,e,{type:i?"session":"local",prefix:r}),i&&d.cookie.set(n,this.data.token))}clear(){const{storageKey:e,storagePrefix:s,session:r,authKey:i}=this.options;this.data=null,d.storage.remove(e,{type:r?"session":"local",prefix:s}),r&&d.cookie.remove(i)}logout(){this.clear(),this.toLogin()}getData(){return this.data?this.data:(this.loadData(),this.data)}getToken(){return this.data||this.loadData(),this.data?.token}can(e){const{appName:s}=this.options,{permissions:r={}}=this.data||{};if(typeof e=="function")return e(r);const i=d.toArray(e);return Array.isArray(r)?i.every(n=>r.includes(n)||r.includes(s+"."+n)):i.every(n=>r[n]||r[s+"."+n])}some(e){const{appName:s}=this.options,{permissions:r={}}=this.data||{},i=d.toArray(e);return Array.isArray(r)?i.some(n=>r.includes(n)||r.includes(s+"."+n)):i.some(n=>r[n]||r[s+"."+n])}install(e){e.config.globalProperties.$access=this,e.provide(Ft,this)}isAuthPath(e){const{auth:s,isAuth:r}=this.options;if(r)return r(e);if(e.path&&typeof s=="string"){const i=s.split("#")[1]||s;return e.path===i}return!1}toLogin(){const{auth:e,redirectParam:s}=this.options;if(!e)return;const r=s?`?${s}=${encodeURIComponent(location.href)}`:"";typeof e=="function"?e(r):location.href=s?`${e}${r}`:e}setData(e){const{privateKey:s}=this.options;if(Array.isArray(e)&&s){const r=e.map(i=>d.unRSA(i,s));try{this.data=JSON.parse(r.join(""))}catch(i){console.warn(i)}return}if(typeof e=="string")try{const r=s?d.unRSA(e,s):e;r?this.data=JSON.parse(r):console.warn("RSA解密失败或登录信息缺失")}catch(r){console.warn(r)}else this.data=e}loadData(){const{storageKey:e,storagePrefix:s,session:r}=this.options,i=d.storage.get(e,{type:r?"session":"local",prefix:s});this.setData(i||null)}isLogined(){const{session:e,authKey:s}=this.options;return e&&s?!!d.cookie.get(s):!!this.getToken()}hasRoutePermission(e){if(e.name===Se){const s=e.params.id;return s&&this.can(s)}return e.meta.__vtj__?this.can(e.meta.__vtj__):e.meta.permission?this.can(e.meta.permission):!0}setGuard(e){e.beforeEach((s,r,i)=>this.guard(s,i))}async guard(e,s){if(this.isWhiteList(e)||this.isAuthPath(e))return s();if(this.isLogined()){if(this.hasRoutePermission(e))return s();{const{noPermissionMessage:r="无权限访问",unauthorized:i=!1}=this.options;return await this.showTip(r),d.isFunction(i)?(i(),s(!1)):d.isString(i)?s(i):s(!1)}}s(!1),await d.delay(0),this.toLogin()}isWhiteList(e){const{whiteList:s}=this.options;return s?Array.isArray(s)?s.some(r=>e.fullPath.startsWith(r)):s(e):!1}isUnauthorized(e){const{unauthorizedCode:s=401,statusKey:r="code"}=this.options;return e.status===s||e.data?.[r]===s}async showUnauthorizedAlert(e){const{unauthorizedMessage:s="登录已失效"}=this.options;this.isUnauthorized(e)&&await this.showTip(s)&&this.toLogin()}async showTip(e){const{alert:s}=this.options;return this.isTipShowing?!1:s?(this.isTipShowing=!0,await d.delay(150),await s(e,{title:"提示",type:"warning"})?.catch(()=>!0)?.finally(()=>{this.isTipShowing=!1})):(globalThis.alert?.(e)??console.warn(e),!0)}setRequest(e){e.useRequest(s=>(this.data?.token&&(s.headers[this.options.authKey]=this.data?.token),s)),e.useResponse(async s=>(this.interceptResponse&&await this.showUnauthorizedAlert(s),s),async s=>{if(!this.interceptResponse)return Promise.reject(s);const r=s.response||s||{};return await this.showUnauthorizedAlert(r),Promise.reject(s)})}}function Ys(){return O.inject(Ft,null)}function ai(t={}){const{notify:e,loading:s,settings:r={},Startup:i,access:n,useTitle:a,alert:o}=t;let c=null;return{request:d.createRequest({adapter:t.axiosAdapter,settings:{type:"form",validSuccess:!1,originResponse:!0,loading:!0,validate:l=>l.data?.code===0||!!l.data?.success,failMessage:!0,showError:l=>{e&&e(l||"未知错误")},showLoading:()=>{c&&c.close(),s&&(c=s())},hideLoading:()=>{c&&(c.close(),c=null)},...r}}),jsonp:d.jsonp,notify:e,loading:s,useTitle:a,alert:o,startupComponent:i,access:n?new Xe({alert:o,...n}):void 0}}function oi(t={}){return new Xe(t)}function Xs(t,e){const{jsonp:s,request:r}=e;if(t.method==="jsonp")return(i={})=>s(t.url,{...t.jsonpOptions,query:i});{const i=t.headers?Ee(t.headers,{},!0):void 0,n={url:t.url,method:t.method,settings:{...t.settings,headers:i}};return(a,o)=>(delete n.data,r.send(d.merge(n,o||{},{data:a})))}}function Zs(t,e){const{metaQuery:s}=e;if(!s)return;const{code:r,queryCode:i}=t;return(n,a)=>{if(!s){console.warn("adapter.metaQuery is not defined!");return}return s(r,i,n,a)}}function er(t=[],e=[],s){const r={};for(const i of t){const n=Xs(i,s);r[i.id]=n,r[i.name]=n}for(const i of e)r[i.id]=Zs(i,s);return r}async function tr(t=[],e=globalThis){const s=Ce(e);s&&(jt(e),t.forEach(r=>rr(s,r)))}function sr(t,e=globalThis){const s=j(t.mockTemplate)&&t.mockTemplate.value?q(t.mockTemplate,{},!0):void 0,r=Ce(e);return async(...i)=>{let n={};if(s)try{n=await s.apply(s,i)}catch(a){d.logger.warn("模拟数据模版异常",a)}return r?.mock(n)}}function rr(t,e){if(!e.mock)return;const{url:s,mockTemplate:r,method:i="get",settings:n={}}=e;if(s&&r)try{const a=d.isUrl(s)?new URL(s).pathname:s,o=d.pathToRegexp(`(.*)${a}`,[],{end:!1}),c=new RegExp(o.source+"([?#].*)?$",o.flags),h=d.pathToRegexpMatch(a,{decode:decodeURIComponent}),l=Ee(r,{},!0);t.mock(c,i.toLowerCase(),p=>{const m=d.url.parse(p.url)||{},f=n.type||"form";let g=p.body instanceof FormData?d.formDataToJson(p.body):p.body;if(typeof g=="string")if(f==="json")try{g=JSON.parse(g)}catch(b){console.warn("[Mock.mock]",b)}else g=d.url.parse(g);const v=d.isUrl(p.url)?new URL(p.url).pathname:p.url.split("?")[0],x=h(v)?.params;Object.assign(p,{data:g,params:x,query:m});try{return t.mock(l(p))}catch(b){return console.warn("[mockApi]",c,p,b),null}})}catch(a){console.warn("mockApi",a)}}function jt(t=globalThis){const e=Ce(t);e&&(e._mocked={})}class Mt{__props={};__events={};__nodes={};constructor(){}setProps(e,s){this.__props[e]=s}getProps(e){return this.__props[e]}loadProps(e,s){const r=e?this.getProps(e):null;return r||(e&&this.setProps(e,s),s)}setEvents(e,s){}getEvents(e){return this.__events[e]}loadEvents(e,s){const r=e?this.getEvents(e):null;return r||(e&&this.setEvents(e,s),s)}setNode(e,s){this.__nodes[e]=s}getNode(e){return this.__nodes[e]}loadNode(e,s){const r=e?this.getNode(e):null;return r||(e&&this.setNode(e,s),s)}isEqual(e,s){return d.isEqual(e,s)}isNodeEqual(e,s){if(e===s)return!0;if(!e||!s)return!1;const r=o=>!o||typeof o!="object"?[]:Object.keys(o).filter(c=>d.isFunction(o[c])),i=o=>{if(!o||typeof o!="object")return o;const c={};for(const h in o)if(Object.prototype.hasOwnProperty.call(o,h)){const l=o[h];d.isFunction(l)||(c[h]=l)}return c},n=r(e).sort(),a=r(s).sort();return d.isEqual(n,a)?d.isEqual(i(e),i(s)):!1}clear(){this.__props={},this.__events={},this.__nodes={}}}const ir=new Mt;class vt{__cache=new Mt;__id=null;__mode;__instance=null;__contextRefs={};__refs={};__refCaches={};__refGenerations={};context={};state={};props={};$props={};$state={};$refs={};$el=null;$emit=null;$nextTick=null;$parent=null;$root=null;$attrs=null;$slots=null;$watch=null;$options=null;$forceUpdate=null;$components={};$libs={};$apis={};$provider=null;$uni=null;$getApp=null;__transform={};constructor(e){const{mode:s,dsl:r,attrs:i}=e;this.__mode=s,r&&(this.__id=r.id||null,this.__transform=r.transform||{}),i&&Object.assign(this,i)}setup(e,s=ye){const r=s.getCurrentInstance();if(!r)return;this.__refs={},this.__refCaches={},this.$refs={},this.context={},this.__contextRefs={},this.__instance=r.proxy;const{state:i}=this,n=r.appContext.config.globalProperties;Object.assign(this,n,e||{}),this.$uni=this.$libs.UniH5?.uni??null,this.$getApp=this.$libs.UniH5?.getApp??null,this.$state=this.state=i,this.__proxy(),s.onMounted(()=>{this.__proxy()}),s.onUnmounted(()=>{this.__cleanup()}),s.onBeforeUpdate(()=>{if(this.__proxy(),this.$props)for(const a of Object.keys(this.$props))this[a]=this.$props[a];this.__reset()})}__proxy(){if(!this.__instance)return;const e=this.__instance;pt.forEach(s=>{this[s]=e[s]||e._?.[s.replace("$","")]||null})}__cleanup(){pt.forEach(e=>{this[e]=null}),this.__reset(),this.__cache.clear(),this.__refGenerations={}}__reset(){this.__refs={},this.__refCaches={},this.$refs={},this.__contextRefs={},this.context={}}__parseFunction(e){if(e)if(this.__mode===T.Runtime){const{id:s,type:r}=e,i=s?this.__transform[s]??e.value:e.value;return q({type:r,value:i},this)}else return q(e,this)}__parseExpression(e){if(e)if(this.__mode===T.Runtime){const{id:s,type:r}=e,i=s?this.__transform[s]??e.value:e.value;return Ee({type:r,value:i},this)}else return Ee(e,this)}__ref(e=null,s){if(this.__mode===T.VNode)return;e&&e!==this.__id&&(this.__contextRefs[e]=this);let r=e?this.__refCaches[e]:null;if(r)return r;const i=e?(this.__refGenerations[e]||0)+1:0;return e&&(this.__refGenerations[e]=i),r=async n=>{if(await d.delay(0),e&&this.__refGenerations[e]!==i)return;let a=n?.$vtjEl||n?.$el||n?._?.vnode?.el||n;if(!a){typeof s=="string"&&(delete this.$refs[s],this[s]&&ye.isRef(this[s])&&(this[s].value=null),e&&delete this.__refs[e]);return}return a.nodeType===3&&a.nextSibling&&(a=a.nextSibling),a.__vtj__=e,T.Design===this.__mode&&(a.__context__=this,a.draggable=!0),e&&(this.__refs[e]=this.__getRefEl(this.__refs,e,n)),typeof s=="function"?s(n):s&&(this.$refs[s]=this.__getRefEl(this.$refs,s,n),this[s]&&ye.isRef(this[s])&&(this[s].value=this.$refs[s])),n},e&&(this.__refCaches[e]=r),r}__getRefEl(e,s,r){const i=e[s];if(i&&r!==i){const n=new Set([].concat(i,r));return Array.from(n)}else return r}__clone(e={}){const s={...this.context,...e},r={...s,context:s};return r.context.__proto__=this.context,r.__proto__=this,r}}const ct=Symbol("vtjBlockChain");function qe(t){const{Vue:e=ye,UniApp:s={},mode:r=T.Runtime,components:i={},libs:n={},apis:a={},loader:o}=t,c=e.computed(()=>t.dsl),h={$components:i,$libs:n,$apis:a},l=new vt({mode:r,dsl:c.value,attrs:h}),p=e.defineComponent({name:c.value.name,__scopeId:c.value.id?`data-v-${c.value.id}`:void 0,props:{...ci(c.value.props??[],l)},async setup(m={}){const f=c.value.id,g=c.value.name,v=e.inject(ct,null);if(f&&v&&v.has(f)){const Z=`检测到区块循环引用: ${g}(${f})`;return console.warn(`[VTJ Renderer] ${Z},已中断渲染以防止浏览器崩溃`),pe(new Error(Z)),e.provide(ct,v),{__vtjCircular:!0}}const x=new Set(v||[]);f&&x.add(f),e.provide(ct,x);const b=new vt({mode:r,dsl:c.value,attrs:h});b.$props=b.props=m,c.value.id&&We(t.window||globalThis,c.value.id,c.value.css||"",!0);const I=c.value.apiMode==="composition";b.$state=b.state=li(e,c.value.state??{},b);const P=I?mi(e,c.value.refs??{},b):{},S=I?gi(e,c.value.reactives??{},b):{},U=hi(e,c.value.computed??{},b),me=pi(c.value.methods??{},b),ge=fi(e,c.value.inject,b),$=nr(c.value.dataSources||{},b),st={...m,...P,...S,...ge,...U,...me,...$};b.setup(st,e);const De=I?vi(c.value.composables??[],b):{};if(Object.assign(b,De),e.onMounted(()=>{ts(b,l)}),I&&c.value.props&&c.value.props.length>0){const Z=new Set([...Object.keys(P),...Object.keys(S),...Object.keys(U)]);for(const re of c.value.props){const ce=typeof re=="string"?re:re.name;Z.has(ce)||Object.defineProperty(b,ce,{get(){return this.$props[ce]},set($t){},configurable:!0,enumerable:!0})}}if(di(e,c.value.watch??[],b),I){const Z=bi(e,c.value.lifeCycles??{},b,s);if(xi(e,c.value.provide??{},b),await Promise.all(Z),c.value.setup){const re=b.__parseFunction(c.value.setup);if(d.isFunction(re))try{await re()}catch(ce){console.warn("[VTJ] Composition setup 执行失败",ce)}}}return{vtj:b,state:b.$state,...m,...P,...S,...U,...me,...ge,...$,...De}},emits:ui(c.value.emits),expose:["vtj",...c.value.expose||[]],render(){if(this.__vtjCircular)return null;const m=this.vtj||l,f=c.value;if(!f.nodes)return null;const g=f.nodes||[];let v;if(g.length===1)v=fe(g[0],m,e,o,g);else{const x=g.map(b=>fe(b,m,e,o,g)).flat();v=e.createVNode("div",{},x)}return ts(m,l),v},...c.value.apiMode!=="composition"?yi(c.value.lifeCycles??{},l):{}});return{renderer:e.markRaw(p),context:l,loader:o}}function ts(t,e){t!==e&&Object.assign(e,t)}function ui(t=[]){return t.map(e=>d.isString(e)?e:e.name)}function ci(t=[],e){const s=r=>r?(Array.isArray(r)?r:[r]).map(n=>is[n]):void 0;return t.map(r=>d.isString(r)?{name:r}:{name:r.name,type:r.type,required:r.required,default:R(r.default)?e.__parseExpression(r.default):r.default}).reduce((r,i)=>{const n=i.default;return r[i.name]={type:s(i.type),required:i.required,default:n!==null&&typeof n=="object"?()=>d.cloneDeep(n):n},r},{})}function li(t,e,s){return t.reactive(Object.keys(e||{}).reduce((r,i)=>{let n=e[i];return R(n)?n=s.__parseExpression(n):j(n)&&(n=s.__parseFunction(n)),r[i]=n,r},{}))}function hi(t,e,s){return Object.entries(e??{}).reduce((r,[i,n])=>{if(j(n))r[i]=t.computed(s.__parseFunction(n));else{const a=s.__parseExpression(n);a&&typeof a=="object"&&(d.isFunction(a.get)&&(a.get=a.get.bind(s)),d.isFunction(a.set)&&(a.set=a.set.bind(s))),r[i]=t.computed(a)}return r},{})}function pi(t,e){return Object.entries(t??{}).reduce((s,[r,i])=>(s[r]=e.__parseFunction(i),s),{})}function fi(t,e=[],s){return e.reduce((r,i)=>{const{name:n,from:a}=i||{},o=R(a)?s.__parseExpression(a)||n:a??n,c=R(i.default)?s.__parseExpression(i.default):i.default??null;return r[n]=t.inject(o,c),r},{})}function nr(t,e){return Object.keys(t).reduce((s,r)=>{const i=t[r];if(i.type==="mock")s[r]=sr(i);else if(i.ref){const n=e.$apis[i.ref],a=j(i.transform)?i.transform.value?e.__parseFunction(i.transform):void 0:i.transform;s[r]=async(...o)=>{const c=await n.apply(e,o);return a?a(c):c}}return s},{})}function di(t,e=[],s){e.forEach(r=>{t.watch(s.__parseExpression(r.source),s.__parseFunction(r.handler),{deep:r.deep,immediate:r.immediate,flush:r.flush})})}function mi(t,e,s){return Object.entries(e).reduce((r,[i,n])=>{const a=R(n)?s.__parseExpression(n):n;return r[i]=t.ref(a),r},{})}function gi(t,e,s){return Object.entries(e).reduce((r,[i,n])=>{const a=R(n)?s.__parseExpression(n):n;return r[i]=t.reactive(a??{}),r},{})}function vi(t,e){return t.reduce((s,r)=>{try{let i;if(R(r.composable)?i=e.__parseExpression(r.composable):d.isString(r.composable)&&(i=e.$libs[r.composable]),d.isFunction(i)){const n=(r.args||[]).map(o=>R(o)?e.__parseExpression(o):o),a=i(...n);if(r.destructure&&r.destructure.length>0)for(const o of r.destructure)s[o]=a?.[o];else s[r.name]=a}}catch(i){if(e.__mode===T.Design)console.warn("[VTJ] composable 执行失败,已降级处理",i),s[r.name]={};else throw console.warn("[VTJ] composable 执行失败",i),pe(i),i}return s},{})}function xi(t,e,s){Object.entries(e).forEach(([r,i])=>{let n=i;R(i)?n=s.__parseExpression(i):j(i)&&(n=s.__parseFunction(i)),t.provide(r,n)})}function bi(t,e,s,r={}){const i=[],n={beforeMount:"onBeforeMount",mounted:"onMounted",beforeUpdate:"onBeforeUpdate",updated:"onUpdated",beforeUnmount:"onBeforeUnmount",unmounted:"onUnmounted",errorCaptured:"onErrorCaptured",renderTracked:"onRenderTracked",renderTriggered:"onRenderTriggered",activated:"onActivated",deactivated:"onDeactivated"};for(const[a,o]of Object.entries(e)){if(a==="created"||a==="beforeCreate"){const l=s.__parseFunction(o);if(d.isFunction(l))try{i.push(Promise.resolve(l()).catch(p=>{console.warn(`[VTJ] Composition 生命周期 "${a}" 执行失败`,p),pe(p)}))}catch(p){console.warn(`[VTJ] Composition 生命周期 "${a}" 执行失败`,p),pe(p)}continue}const c=n[a]||a,h=t[c]||r[c];if(h&&d.isFunction(h)){const l=s.__parseFunction(o);d.isFunction(l)&&h(async()=>{try{await d.delay(0),await l()}catch(p){console.warn(`[VTJ] Composition 生命周期 "${a}" 执行失败`,p),pe(p)}})}else console.warn(`[VTJ] 无效的 Composition 生命周期钩子 "${a}"`)}return i}function yi(t,e){return Object.entries(t??{}).reduce((s,[r,i])=>(s[r]=async function(){const a=(this?.vtj||e).__parseFunction(i);d.isFunction(a)&&(await d.delay(0),await a())},s),{})}const ar=Object.assign((t,e)=>e,{clear:()=>{}});async function Dt(t,e=globalThis){const{urls:s=[],library:r}=t,i=s.filter(o=>Fe(o));if(i.length===0||!r)return null;const n=s.filter(o=>Le(o));return n.length&&St(n,e),await Ct(i,r,e).catch(o=>(console.warn("loadScriptUrl error",i,r,o),null))}function or(t){const{getDsl:e,getDslByUrl:s,options:r}=t,i=new d.Queue,n={},a={},o=(c,h,l,p=ye)=>{if(!l||typeof l=="string")return h;let m="";if(l.type==="Schema"&&l.id)return m=l.id+"_"+c,a[m]||(a[m]=p.defineAsyncComponent(async()=>{const f=n[l.id]||await i.add(l.id,()=>e(l.id));return f&&(f.name=h,n[l.id]=f),f?qe({Vue:p,mode:T.Runtime,...r,dsl:d.cloneDeep(f),loader:o}).renderer:null}));if(l.type==="UrlSchema"&&l.url)return m=l.url+"_"+c,a[m]||(a[m]=p.defineAsyncComponent(async()=>{const f=n[l.url]||await s(l.url);return f&&(f.name=h,n[l.url]=f),f?qe({...r,Vue:p,dsl:d.cloneDeep(f),mode:T.Runtime,loader:o}).renderer:null}));if(l.type==="Plugin"){let f=l.library?n[l.library]:null;return f||(f=n[l.library||Symbol()]=p.defineAsyncComponent(async()=>{const g=await Dt(l,r.window);return g||(console.warn("getPlugin result is null",l),null)}),f)}return h};return Object.assign(o,{clear(){for(const c of Reflect.ownKeys(n))delete n[c];for(const c of Reflect.ownKeys(a))delete a[c];i.clearAllCache()}})}function _i(t){t?.clear(),ir.clear()}function fe(t,e,s=ye,r=ar,i=[],n=!1,a=0){if(!t||!t.name||t.invisible)return null;const o=s.getCurrentInstance()?.appContext,{id:c=null,directives:h=[]}=t,{vIf:l,vElseIf:p,vElse:m,vFor:f,vShow:g,vModels:v,vBind:x,vHtml:b,others:I}=ur(h);if(!n&&(p||m))return null;if(l&&!Ci(l,e))return Pi(t,e,s,r,i);const P=(S,U=0)=>{const me=S.$components,ge=(()=>{if(t.name==="component")return wi(S,t.props?.is);if(t.name==="slot")return t.name;const V=r(`${t.id}_${U}`,t.name,t.from,s);return d.isString(V)?gs(V)||vs(V)?V:me[V]??o?.app?.component(V)??V:V})(),$=Ei(c,t.props??{},S),st=Ai(s,t.id,t.events??{},S);if(t.name==="slot")return Ti(s,t,$,S,r);x&&Object.assign($,S.__parseExpression(x.value)),g&&($.style=Object.assign($.style??{},Ri(g,S))),b&&Object.assign($,Oi(b,S)),v.forEach(V=>{yt.includes(t.name)?Object.assign($,Vi(V,S,t.name,$.type,$.value)):Object.assign($,Li(V,S))});const De=Fi(s,t.children??[],S,r,t),Z=S?.__id?`data-v-${S.__id}`:void 0,re=Z?{[Z]:""}:{},ce=S.__mode===T.Design?{"data-vtj":c}:{},{ref:$t,...rt}=$,Ht={},Gt={};for(const V of Object.keys(rt))V.startsWith("on")?Ht[V]=rt[V]:Gt[V]=rt[V];const Be=`${c}_${U}`,it={key:Be,...re,...ce,...Gt};S.__cache.isNodeEqual(it,S.__cache.getNode(Be))||S.__cache.setNode(Be,it);let nt=s.createVNode(ge,{...S.__cache.getNode(Be)||it,ref:$t,...Ht,...st},De);const qt=o?Si(o,I,S):[];return qt.length&&(nt=s.withDirectives(nt,qt)),nt};return f?Di(f,P,e):P(e,a)}function Si(t,e,s){const r=t.app;return e.map(i=>{const n=typeof i.name=="string"?r.directive(i.name):s.__parseExpression(i.name);if(!n)return null;const a=[n];return i.value&&a.push(s.__parseExpression(i.value)),i.arg&&a.push(i.arg),i.modifiers&&a.push(i.modifiers),a}).filter(i=>!!i)}function ur(t=[]){const e=t.find(l=>d.camelCase(l.name)==="vIf"),s=t.find(l=>d.camelCase(l.name)==="vElseIf"),r=t.find(l=>d.camelCase(l.name)==="vElse"),i=t.find(l=>d.camelCase(l.name)==="vFor"),n=t.find(l=>d.camelCase(l.name)==="vShow"),a=t.find(l=>d.camelCase(l.name)==="vBind"),o=t.find(l=>d.camelCase(l.name)==="vHtml"),c=t.filter(l=>d.camelCase(l.name)==="vModel"),h=t.filter(l=>!rs.includes(d.camelCase(l.name)));return{vIf:e,vElseIf:s,vElse:r,vFor:i,vShow:n,vModels:c,vBind:a,others:h,vHtml:o}}function Ci(t,e){return!!e.__parseExpression(t.value)}function wi(t,e){return e?R(e)?t.__parseExpression(e):e:"div"}function Ei(t,e,s){const r=xt(e,s);return r.ref=s.__ref(t,r.ref),r}function xt(t,e){return t===null?null:R(t)?e.__parseExpression(t):j(t)?e.__parseFunction(t):Array.isArray(t)?t.map(s=>xt(s,e)):typeof t=="object"?Object.keys(t||{}).reduce((s,r)=>{let i=t[r];return s[r]=xt(i,e),s},{}):t}function ki(t,e){return s=>{s?.key?.toLowerCase()===e.toLowerCase()&&t(s)}}function Ii(t){return xs(t.value)?t:bs(t.value)?{type:"JSFunction",value:`(...args) => (() => {
21
22
  return (($event) => {
22
23
  ${t.value}
23
24
  }).apply(this, args);
24
- })()`}:ws(t.value)?{type:"JSFunction",value:`() => { ${t.value}}`}:t}function Fr(t,e,s,i){const r=["passive","capture","once"],n={capture:"Capture",once:"Once",passive:"OnceCapture"};return Object.keys(s||{}).reduce((u,c)=>{const l=s[c],h=$t(l.modifiers),p=h.find(g=>r.includes(g)),m="on"+d.upperFirstCamelCase(c)+(p&&n[p]||""),f=l.handler?i.__parseFunction(Vr(l.handler)):null;return f&&(u[m]=t.withModifiers(h.includes("enter")?Or(f,"enter"):f,h)),u},{})}function Lr(t,e,s,i,r=[]){let n=r.findIndex(a=>a.id===t.id);for(let a=++n;a<r.length;a++){const{directives:u=[]}=r[a],{vIf:c,vElseIf:l,vElse:h}=pi(u);if(c)break;if(l){if(e.__parseExpression(l.value))return pe(r[a],e,s,i,r,!0);continue}if(h)return pe(r[a],e,s,i,r,!0)}return null}function $t(t={},e=!1){const s=Object.keys(t);return e?s.map(i=>"."+i):s}function jr(t,e,s,i,r){const{children:n}=e,a=Mr(e,i),u=i.$slots?.[a.name];return u?u(s):n?d.isString(n)?t.createTextVNode(n):N(n)?t.createTextVNode(Et(i.__parseExpression(n))):Array.isArray(n)?n.map((c,l)=>pe(c,i,t,r,n,!1,l)):null:null}function Mr(t,e){const{props:s}=t,i=s?.name||"default";return{name:N(i)?e.__parseExpression(i):i,params:[]}}function Dr(t,e){return e.__parseExpression(t.value)?{}:{display:"none"}}function Br(t,e){return{innerHTML:e.__parseExpression(t.value)||""}}function Hr(t,e){const s={type:"JSFunction",value:t.value?.value?`(v) => {
25
- ${t.value.value} = v?.target.value;
26
- }`:"(v) => {}"};return{[N(t.arg)?e.__parseExpression(t.arg):t.arg||"value"]:e.__parseExpression(t.value),onInput:e.__parseFunction(s)}}function Ur(t,e,s){const i={type:"JSFunction",value:e.value?.value?`(v) => {
27
- ${e.value.value} = v;
28
- }`:"(v) => {}"},r=s.__parseFunction(i),n=$t(N(e.modifiers)?s.__parseExpression(e.modifiers):e.modifiers),a=N(e.arg)?s.__parseExpression(e.arg):e.arg||"modelValue";return{[a]:s.__parseExpression(e.value),[`onUpdate:${a}`]:n.length&&r?t.withModifiers(r,n):r}}function $r(t,e,s,i,r){if(!e)return null;if(d.isString(e))return{default:()=>e};if(N(e))return{default:()=>Et(s.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const n=Gr(e),a=(u,c)=>!u||!r?{}:r?.id&&Object.keys(u).length?c?{[c]:u}:{[`scope_${r.id}`]:u}:c?{[c]:Object.create(null)}:{};return Object.entries(n).reduce((u,[c,{nodes:l,params:h,scope:p}])=>(u[c]=m=>{const f=h.length?d.pick(m??{},h):a(m,p);return l.map((g,b)=>pe(g,s.__clone(f),t,i,l,!1,b))},u),{})}return null}function Gr(t){const e={};for(const s of t){const i=qr(s.slot),r=i.name;e[r]?(e[r].nodes.push(s),e[r].params=e[r].params.concat(i.params),e[r].scope=i.scope||""):e[r]={nodes:[s],params:i.params,scope:i.scope||""}}return e}function qr(t="default"){return d.isString(t)?{name:t,params:[],scope:""}:{params:[],scope:"",...t}}function Wr(t,e,s){const{value:i,iterator:r}=t,{item:n="item",index:a="index"}=r||{};let u=s.__parseExpression(i)||[];return Number.isInteger(u)&&(u=new Array(u).fill(!0).map((c,l)=>l+1)),Array.isArray(u)?u.map((c,l)=>e(s.__clone({[n]:c,[a]:l}),l)):(console.warn("[vForRender]:",`${i?.value} is not a Arrary`),[])}const dt=j.defineComponent({name:"VtjPageContainer",async setup(){const t=qt(),e=as.useRoute(),s=e.meta.__vtj__||e.params.id,i=s?t.getPage(s):t.getHomepage(),r=i?await t.getRenderComponent(i.id):null,n=j.ref(Symbol());if(i){Object.assign(e.meta,i.meta||{},{cache:i.cache});const{useTitle:a}=t?.adapter;if(a){const u=e.meta.title||i.title||"VTJ.PRO";a(u)}}return{provider:t,component:r,file:i,query:e.query,meta:e.meta,sid:n,route:e}},render(){const{component:t,query:e,sid:s}=this;return t?j.h(t,{...e,key:s}):j.h("div",{style:{padding:"10px"}},"找不到组件,组件不存在或未发布!")},activated(){this.meta.cache===!1&&(this.sid=Symbol())}}),Kr=j.defineComponent({name:"VtjStartupContainer",render(){return j.h("div","page not found!")}});function Le(t,e,s=[]){const i=[];for(const r of s){const{id:n,title:a,icon:u,children:c,hidden:l,layout:h}=r;if(h){const p=Le(t,e,c||[]);i.push(...p)}else{const p={id:n,title:a,icon:u,hidden:l,url:`${t}/${e}/${n}`,children:c&&c.length?Le(t,e,c):void 0};i.push(p)}}return i}function Gt(t,e){if(!e)return t;let s=[];for(const i of t)if(i.children&&i.children.length){const r=Gt(i.children,e);r.length&&(i.children=r,s.push(i))}else e.can(i.id.toString())&&s.push(i);return s}function zr(t){const{menuPathPrefix:e="",pageRouteName:s="page",disableMenusFilter:i=!1}=t||{},r=qt(),n=as.useRoute(),a=si(),u=j.ref(!1),c=j.ref(!1),l=r.project,h=(f,g)=>{u.value=!f?.mask,c.value=g?.pure??!!f?.pure};j.watchEffect(()=>{const{name:f,params:g,meta:b}=n;if(f===_e){const v=r.getPage(g.id);h(v,b)}else if(f===Te){const v=r.getHomepage();h(v,b)}else{const v=b.__vtj__;if(v){const x=r.getPage(v);h(x,b)}else u.value=!b.mask,c.value=!!b.pure}});const p=Le(e,s,l?.pages),m=l?.config;return{disabled:u,logo:m?.logo,themeSwitchable:m?.themeSwitchable,title:m?.title||l?.description||l?.name||"VTJ App",menus:i?p:Gt(p,a),pure:c}}function mt(t,e){const{id:s,title:i,meta:r}=t,{name:n="page",prefix:a="",component:u,routeMeta:c}=e;return{name:s,path:`${a}${n}/${s}`,component:u,meta:{title:i,...c,...r,__vtj__:s}}}function Ct(t){const{name:e="page",prefix:s="",pages:i=[],component:r,loader:n,routeMeta:a,homepage:u}=t,c=[];for(const l of i){const{id:h,title:p,dir:m,layout:f,children:g,meta:b}=l;if(m){const v=Ct({name:e,prefix:s,component:r,routeMeta:a,homepage:u,loader:n,pages:g||[]});c.push(...v)}else if(f){const v=Ct({name:e,prefix:s,component:r,routeMeta:a,homepage:u,loader:n,pages:g||[]}),x={name:`layout_${h}`,path:s,component:()=>n(h),meta:{title:p,...a,...b,__vtj__:h},children:v};c.push(x),c.push(mt(l,t))}else if(c.push(mt(l,t)),u===h){const v=mt(l,t);v.path="",v.name=`home_${h}`,c.push(v)}}return c}function Jr(t={},e){const{css:s,store:i,enhance:r}=t,{window:n,app:a,library:u={},adapter:c,mode:l}=e,{Pinia:h}=u;a.config.globalProperties.$libs=u,Qe(n,"global-css",s||""),h&&i&&Qr(i,a,h),Xr(a,c,t),!c.access&&t.access&&Yr(t.access,a,l,c),Zr(a,t),r&&en(r,a,u)}function Qr(t,e,s){if(!e.config.globalProperties.$pinia){const i=s.createPinia();e.use(i)}if(L(t)&&t.value){const i=W(t,{},!1,!1,!0),r=s.defineStore("$store",i(e)||{});e.config.globalProperties.$store=r()}}function Yr(t,e,s,i){if(L(t)&&t.value){const r=W(t,{},!1,!1,!0),{alert:n,request:a}=i,u=new it({alert:n,storagePrefix:"__VTJ_APP_",...r(e)}),c=e.config.globalProperties.$router;u.connect({mode:s,router:c,request:a}),e.use(u)}}function Xr(t,e,s){if(!e.request)return;const{axios:i,request:r,response:n}=s;if(i&&L(i)&&i.value){const a=W(i,{},!1,!1,!0);e.request.setConfig(a(t))}if(r&&L(r)&&r.value){const a=W(r,{},!1,!1,!0),u=e.request;u.__unReq&&u.__unReq(),u.__unReq=e.request.useRequest(c=>a(c,t))}if(n&&L(n)&&n.value){const a=W(n,{},!1,!1,!0),u=e.request;u.__unRes&&u.__unRes(),u.__unRes=e.request.useResponse(c=>a(c,t))}}function Zr(t,e){const{beforeEach:s,afterEach:i}=e,r=t.config.globalProperties.$router;if(s&&L(s)&&s.value){const n=W(s,{},!1,!1,!0);r&&r.beforeEach((a,u,c)=>n(a,u,c,t))}if(i&&L(i)&&i.value){const n=W(i,{},!1,!1,!0);r&&r.afterEach((a,u,c)=>n(a,u,c,t))}}function en(t,e,s={}){L(t)&&t.value&&W(t,{},!1,!1,!0)(e,s)}function tn(t,e,s){if(!t||!e||!s)return;const{VueI18n:i}=e;if(i){const{locale:r,fallbackLocale:n,messages:a=[]}=s,u={};for(let l of a){const h=Object.keys(l).filter(p=>p!=="key");for(const p of h)u[p]||(u[p]={}),u[p][l.key]=l[p]}const c=i.createI18n({legacy:!1,locale:r,fallbackLocale:n,messages:u});t.use(c)}}const rt=Symbol("Provider");var fi=(t=>(t.Production="production",t.Development="development",t))(fi||{});class di extends ne.Base{constructor(e){super(),this.options=e;const{service:s,mode:i=P.Raw,dependencies:r,materials:n,project:a={},adapter:u={},globals:c={},modules:l={},router:h=null,materialPath:p="./",nodeEnv:m="development"}=e;this.mode=i,this.modules=l,this.service=s,this.router=h,this.materialPath=p,this.nodeEnv=m,r&&(this.dependencies=r),n&&(this.materials=n),Object.assign(this.globals,c),Object.assign(this.adapter,u);const{access:f,request:g}=this.adapter;f&&f.connect({mode:i,router:h,request:g}),a&&i!==P.Design?this.load(a):this.project=a}mode;globals={};modules={};adapter={request:d.request,jsonp:d.jsonp};apis={};dependencies={};materials={};library={};libraryLocales={};libraryLocaleMap={};service;project=null;components={};nodeEnv="development";env={};router=null;materialPath="./";urlDslCaches={};errorHandler=null;createMock(e){return async(...s)=>{let i={};if(e)try{i=await e.apply(e,s)}catch(n){d.logger.warn("模拟数据模版异常",n)}const r=Se();return r||console.warn("[@vtj/renderer]","项目缺少mockjs, 你需要安装mockjs依赖,并在应用的 main.ts 中添加 mockjs 导入,确保 window.Mock 可用"),r?.mock(i)}}async load(e){const{vtjDir:s=".vtj"}=this.options,i=this.modules[`${s}/projects/${e.id}.json`]||this.modules[`/src/${s}/projects/${e.id}.json`];if(this.project=i?await i():await this.service.init(e),!this.project)throw new Error("project is null");const{apis:r=[],meta:n=[],env:a=[]}=this.project,u=globalThis;u&&(u.CKEDITOR_VERSION=void 0),this.initEnv(a),this.mode===P.Raw?await this.loadDependencies(u):await this.loadAssets(u),this.initMock(u),this.apis=ni(r,n,this.adapter),Ht(u),ai(r,u),e.platform!=="uniapp"&&this.initRouter(),this.triggerReady()}initMock(e){const s=Se(e);s&&s.setup({timeout:"50-500"})}async loadDependencies(e={}){const s=Object.entries(this.dependencies);for(const[i,r]of s)e[i]||(e[i]=this.library[i]=await r())}async loadAssets(e={}){const{dependencies:s=[]}=this.project,{dependencies:i,library:r,components:n,materialPath:a,nodeEnv:u,libraryLocales:c}=this,{libraryExports:l,libraryMap:h,materials:p,materialExports:m,materialMapLibrary:f,libraryLocaleMap:g}=ps(s,a,u==="development");Object.assign(this.libraryLocaleMap,g);for(const b of l){const v=i[b],x=e[b];if(x)r[b]=x;else if(v)e[b]=r[b]=await v();else{const O=h[b]||[];for(const w of O)je(w)&&await xs(w,d.url.append(w,{v:ye})),Me(w)&&await d.loadScript(d.url.append(w,{v:ye}));r[b]=e[b]}const I=g[b];if(I){const O=i[I];c[I]=O?await O():e[I]}}if(u==="development"){for(const v of p)await d.loadScript(d.url.append(v,{v:ye}));const b=this.materials||{};for(const v of m){const x=e[f[v]],I=x?.default||x,O=ne.BUILT_IN_COMPONENTS[v];if(O)I&&O.forEach(w=>{n[w]=I[w]});else{const w=b[v]?(await b[v]()).default:e[v];w&&I&&(w.components||[]).forEach(H=>{n[H.name]=fs(H,I)})}}}}initRouter(){const{router:e,project:s,options:i,adapter:r}=this;if(!e)return;const n=s?.platform==="uniapp"?"pages":"page",{routeAppendTo:a,pageRouteName:u=n,routeMeta:c}=i,l=a?"":"/",h={path:`${l}${u}/:id`,name:_e,component:dt},p=this.getHomepage(),m={path:l,name:Te,component:p?dt:r.startupComponent||Kr,meta:c};if(e.hasRoute(_e)&&e.removeRoute(_e),e.hasRoute(Te)&&e.removeRoute(Te),i.enableStaticRoute){const f=s?.pages||[];Ct({name:u,prefix:l,pages:f,component:dt,loader:this.getRenderComponent.bind(this),homepage:p?.id}).forEach(b=>{a?e.addRoute(a,b):e.addRoute(b)}),p||(a?e.addRoute(a,m):e.addRoute(m))}else a?(e.addRoute(a,h),e.addRoute(a,m)):(e.addRoute(h),e.addRoute(m))}setErrorHandler(e){e.config.errorHandler=d.debounce((s,i,r)=>{const n=i?.$options.name,a=typeof s=="string"?s:s?.message||s?.msg||"未知错误",u=`[ ${n} ] ${a} ${r}`;if(!["getComputedStyle","ResizeObserver"].some(l=>u.includes(l))){try{const l={message:u,err:s,instance:i,info:JSON.stringify(r),stack:s?.stack};console.error("[VTJ Error]:",l,s?.stack),this.errorHandler&&this.errorHandler(l)}catch(l){console.warn("[provider.setErrorHandler]",l)}this.adapter.notify&&this.adapter.notify(u,"组件渲染错误","error")}},200)}install(e){const{libraryLocaleMap:s,libraryLocales:i}=this,{libraryOptions:r={}}=this.options,n=e.config.globalProperties.installed||{};for(const[a,u]of Object.entries(this.library))if(!n[a]&&bs(u)){const l={locale:i[s[a]]},h=r[a]||{},p={...l,...h};e.use(u,p),n[a]=!0}e.provide(rt,this),e.config.globalProperties.$provider=this,e.config.globalProperties.$apis=this.apis,e.config.globalProperties.$request=this.adapter?.request,this.options.install&&e.use(this.options.install),this.adapter.access&&e.use(this.adapter.access),this.project?.platform!=="uniapp"&&this.mode!==P.Design&&this.initGlobals(this.project?.globals||{},{app:e,window:globalThis,adapter:this.adapter,library:this.library,mode:this.mode}),this.mode!==P.Design&&this.project?.i18n&&this.initI18n(e,this.library,this.project.i18n),this.options.enhance&&e.use(this.options.enhance,this),this.mode===P.Design&&this.setErrorHandler(e),e.config.globalProperties.installed=n,this.setGlobals(e.config.globalProperties)}setGlobals(e={}){for(const[s,i]of Object.entries(e))this.globals[s]=i}getFile(e){const{blocks:s=[]}=this.project||{};return this.getPage(e)||s.find(i=>i.id===e)||null}getPage(e){const{pages:s=[]}=this.project||{},i=(r,n=[])=>{for(const a of n){if(a.id===r)return a;if(a.children&&a.children.length){const u=i(r,a.children);if(u)return u}}};return i(e,s)||null}getFirstPage(){const{pages:e=[]}=this.project||{};if(!e.length)return null;const s=(i=[])=>{for(const r of i){if(r.type==="page"&&!r.dir&&!r.layout)return r;if(r.children&&r.children.length){const n=s(r.children);if(n)return n}}};return s(e)||null}getMenus(e="page",s=""){return Le(s,e,this.project?.pages||[])}getHomepage(){const{homepage:e}=this.project||{};return e?this.getPage(e):this.getFirstPage()}async getDsl(e){const{vtjDir:s=".vtj"}=this.options,i=this.modules[`${s}/files/${e}.json`]||this.modules[`/src/${s}/files/${e}.json`];return i?await i():this.service.getFile(e,this.project||void 0).catch(()=>null)}async getDslByUrl(e){const s=this.urlDslCaches[e];return s||(this.adapter.request?this.urlDslCaches[e]=this.adapter.request.send({url:e,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(i=>i.data).catch(()=>null):null)}createDslRenderer(e,s={}){const{library:i,components:r,mode:n,apis:a}=this,u={mode:n,Vue:i.Vue,UniApp:i.UniApp,components:r,libs:i,apis:a,window:globalThis,...s},c=Je({getDsl:async l=>await this.getDsl(l)||null,getDslByUrl:async l=>await this.getDslByUrl(l)||null,options:u});return ze({...u,dsl:e,loader:c})}async getRenderComponent(e,s){const i=this.getFile(e);if(!i)return d.logger.warn(`Can not find file: ${e}`),null;if(s&&s(i),this.mode===P.Raw){const{vtjRawDir:n=".vtj/vue"}=this.options,a=`${n}/${e}.vue`,u=this.modules[a]||this.modules[`/src/pages/${e}.vue`];return u?(await u())?.default:this.nodeEnv==="development"&&this.adapter.startupComponent||null}const r=await this.getDsl(i.id);return r?this.createDslRenderer(r).renderer:(d.logger.warn(`Can not find dsl: ${e}`),null)}defineUrlSchemaComponent(e,s){return j.defineAsyncComponent(async()=>{const i=await this.getDslByUrl(e);return i?(i.name=s||i.name,this.createDslRenderer(i).renderer):null})}definePluginComponent(e){return j.defineAsyncComponent(async()=>await Ut(e,globalThis))}initGlobals(e,s){const i=Object.assign({adapter:this.adapter,window:globalThis},s);Jr(e,i)}initI18n(e,s,i){tn(e,s,i)}initEnv(e=[]){this.env=e.reduce((s,i)=>(s[i.name]=i[this.nodeEnv],s),{})}}function sn(t){const e=new di(t);return{provider:e,onReady:i=>e.ready(i)}}function qt(t={}){const e=j.inject(rt,null);if(!e)throw new Error("Can not find provider");if(e.nodeEnv==="development"){const{id:s,version:i}=t;s&&i&&(async()=>{const r=await e.getDsl(s);r?.__VERSION__!==i&&e.adapter.notify&&e.adapter.notify(`[ ${r?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,"版本不一致","warning")})()}return e}function Ee(){return j.inject(rt,null)?.globals??{}}function rn(){return Ee().$store||{}}function nn(){return Ee().$pinia||{}}function an(){return Ee().$request}function on(){return Ee().$libs||{}}function un(){return Ee().$apis||{}}async function cn(t,e=""){const{name:s,urls:i=[]}=t||{},r=i.map(u=>e+u),{css:n,js:a}=ds(r);if(n.length&&kt(n),a.length)return await It(a,s).catch(()=>{})}const mi={type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:t=>t.data?.code===0},ln=(t,e="/__vtj__/api/:type.json")=>(s,i,r)=>t.send({url:e,method:"post",params:{type:s},query:r,data:{type:s,data:i},settings:mi}),hn=(t,e="/__vtj__/api/uploader.json")=>async(s,i)=>await t.send({url:e,method:"post",data:{files:s,projectId:i},settings:{...mi,type:"data"}}).then(r=>r&&r[0]?r[0]:null).catch(()=>null);function pn(t){return d.createRequest({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>e.data?.code===0,showError:e=>{t&&t(e||"未知错误")}}})}class nt{constructor(e=d.request){this.req=e,this.api=ln(e),this.uploader=hn(e)}api;pluginCaches={};uploader;async getExtension(){console.log("BaseService.getExtension")}async init(e){return console.log("BaseService.init",e),{}}async saveProject(e,s){return!!await this.api("saveProject",e,{type:s}).catch(()=>!1)}async saveMaterials(e,s){return console.log("BaseService.saveMaterials",e,s),!1}async saveFile(e){return console.log("BaseService.saveFile",e),!1}async getFile(e){return console.log("BaseService.getFile",e),{}}async removeFile(e){return console.log("BaseService.removeFile",e),!1}async saveHistory(e){return console.log("BaseService.saveHistory",e),!1}async removeHistory(e){return console.log("BaseService.removeHistory",e),!1}async getHistory(e){return console.log("BaseService.getHistory",e),{}}async getHistoryItem(e,s){return console.log("BaseService.getHistoryItem",e,s),{}}async saveHistoryItem(e,s){return console.log("BaseService.saveHistoryItem",e,s),!1}async removeHistoryItem(e,s){return console.log("BaseService.removeHistoryItem",e,s),!1}async publish(e){return!!await this.api("publish",e).catch(()=>!1)}async publishFile(e,s){return!!await this.api("publishFile",{project:e,file:s}).catch(()=>!1)}async genVueContent(e,s){return await this.api("genVueContent",{project:e,dsl:s}).catch(()=>"")}async parseVue(e,s){return await this.api("parseVue",{project:e,...s})}async createRawPage(e){return await this.api("createRawPage",e).catch(()=>"")}async removeRawPage(e){return await this.api("removeRawPage",e).catch(()=>"")}async uploadStaticFile(e,s){return await this.uploader(e,s).catch(()=>null)}async getStaticFiles(e){return await this.api("getStaticFiles",e).catch(()=>[])}async removeStaticFile(e,s){return await this.api("removeStaticFile",{name:e,projectId:s}).catch(()=>"")}async clearStaticFiles(e){return await this.api("clearStaticFiles",e).catch(()=>"")}async getPluginMaterial(e){const{urls:s=[]}=e,i=s.filter(n=>ls(n))[0];if(!i)return null;const r=this.pluginCaches[i];return r||(this.pluginCaches[i]=d.request.send({url:i,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(n=>n.data).catch(()=>null))}async genSource(e){return console.log("BaseService.genSource",e),""}}const D=new d.Storage({type:"local",expired:0,prefix:"__VTJ_"});class fn extends nt{init(e){const s=new ne.ProjectModel(e),i=D.get(`project_${s.id}`),r=Object.assign(s.toDsl(),i||{});return D.save(`project_${s.id}`,r),Promise.resolve(r)}saveProject(e){const s=new ne.ProjectModel(e);return D.save(`project_${s.id}`,s.toDsl()),Promise.resolve(!0)}saveMaterials(e,s){return D.save(`materials_${e.id}`,d.mapToObject(s)),Promise.resolve(!0)}saveFile(e){return D.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const s=D.get(`file_${e}`);return s?Promise.resolve(s):Promise.reject(null)}removeFile(e){return D.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return D.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const s=D.get(`history_${e}`);if(s){const r=(s.items||[]).map(n=>n.id);this.removeHistoryItem(e,r),D.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const s=D.get(`history_${e}`),i=new ne.HistoryModel(s||{id:e});return Promise.resolve(i.toDsl())}getHistoryItem(e,s){const i=D.get(`history_${e}_${s}`);return Promise.resolve(i)}saveHistoryItem(e,s){return D.save(`history_${e}_${s.id}`,s),Promise.resolve(!0)}removeHistoryItem(e,s){return s.forEach(i=>{D.remove(`history_${e}_${i}`)}),Promise.resolve(!0)}}class gi extends nt{projects={};materials={};files={};histories={};historyItems={};init(e){const s=new ne.ProjectModel(e),i=this.projects[s.id]||{},r=Object.assign(s.toDsl(),i);return this.projects[r.id]=r,Promise.resolve(r)}saveProject(e){const s=new ne.ProjectModel(e);return this.projects[s.id]=s.toDsl(),Promise.resolve(!0)}saveMaterials(e,s){return e.id&&(this.materials[e.id]=d.mapToObject(s)),Promise.resolve(!0)}saveFile(e){return this.files[e.id]=e,Promise.resolve(!0)}getFile(e){const s=this.files[e];return s?Promise.resolve(s):Promise.reject(null)}removeFile(e){return delete this.files[e],Promise.resolve(!0)}saveHistory(e){return this.histories[e.id]=e,Promise.resolve(!0)}removeHistory(e){const s=this.histories[e];if(s){const r=(s.items||[]).map(n=>n.id);this.removeHistoryItem(e,r),delete this.historyItems[e]}return Promise.resolve(!0)}getHistory(e){const s=this.histories[e],i=new ne.HistoryModel(s||{id:e});return Promise.resolve(i)}getHistoryItem(e,s){const i=`${e}_${s}`,r=this.historyItems[i]||{};return Promise.resolve(r)}saveHistoryItem(e,s){const i=`${e}_${s.id}`;return this.historyItems[i]=s,Promise.resolve(!0)}removeHistoryItem(e,s){return s.forEach(i=>{const r=`${e}_${i}`;delete this.historyItems[r]}),Promise.resolve(!0)}}let qe=null;function dn(){return qe||(qe=new gi,qe)}class mn extends nt{getFileCaches={};async getExtension(){return await this.api("getExtension",{}).catch(()=>{})}async init(e){return await this.api("init",e).catch(()=>null)||{}}async saveProject(e,s){return!!await this.api("saveProject",e,{type:s}).catch(()=>!1)}async saveMaterials(e,s){return!!await this.api("saveMaterials",{project:e,materials:d.mapToObject(s)}).catch(()=>!1)}async saveFile(e){return!!await this.api("saveFile",e).catch(()=>!1)}async getFile(e){const s=this.getFileCaches[e];return s||(this.getFileCaches[e]=this.api("getFile",e).catch(()=>null)).finally(()=>{delete this.getFileCaches[e]})}async removeFile(e){return!!await this.api("removeFile",e).catch(()=>!1)}async saveHistory(e){return!!await this.api("saveHistory",e).catch(()=>!1)}async removeHistory(e){return!!await this.api("removeHistory",e).catch(()=>!1)}async getHistory(e){return await this.api("getHistory",e).catch(()=>null)||{}}async getHistoryItem(e,s){return await this.api("getHistoryItem",{fId:e,id:s}).catch(()=>null)||{}}async saveHistoryItem(e,s){return!!await this.api("saveHistoryItem",{fId:e,item:s}).catch(()=>!1)}async removeHistoryItem(e,s){return!!await this.api("removeHistoryItem",{fId:e,ids:s}).catch(()=>!1)}}exports.ACCESS=Si;exports.ACCESS_KEY=Bt;exports.Access=it;exports.BUILD_IN_TAGS=cs;exports.BUILT_IN_DIRECTIVES=os;exports.BaseService=nt;exports.COMPOSITION_HOOKS_LIST=yi;exports.CONTEXT_HOST=gt;exports.Context=_t;exports.ContextMode=P;exports.DATA_TYPES=us;exports.HOMEPAGE_ROUTE_NAME=Te;exports.HTML_TAGS=wt;exports.JSCodeToString=lr;exports.LIFE_CYCLES_LIST=bi;exports.LocalService=mn;exports.MemoryService=gi;exports.NodeEnv=fi;exports.PAGE_ROUTE_NAME=_e;exports.Provider=di;exports.REMOTE=_i;exports.StorageService=fn;exports.VTJ_RENDERER_VERSION=ye;exports.adoptStylesToInline=ki;exports.adoptedStyleSheets=Qe;exports.clearLoaderCache=Ar;exports.compileScopedCSS=ms;exports.convertCssRpx=vs;exports.createAccess=fr;exports.createAdapter=pr;exports.createAssetScripts=Ci;exports.createAssetsCss=wi;exports.createDataSources=ci;exports.createLoader=Je;exports.createMemoryService=dn;exports.createMenus=Le;exports.createMetaApi=ri;exports.createMock=oi;exports.createProvider=sn;exports.createRenderer=ze;exports.createSchemaApi=ii;exports.createSchemaApis=ni;exports.createServiceRequest=pn;exports.defaultLoader=hi;exports.fillBasePath=Ae;exports.getMock=Se;exports.getModifiers=$t;exports.getPlugin=Ut;exports.getRawComponent=fs;exports.isArrowFunction=Ss;exports.isAssignment‌=ws;exports.isBuiltInTag=ys;exports.isCSSUrl=je;exports.isCallFunction=Cs;exports.isJSCode=ti;exports.isJSExpression=N;exports.isJSFunction=L;exports.isJSON=ls;exports.isJSUrl=Me;exports.isNativeTag=_s;exports.isVuePlugin=bs;exports.loadCss=xs;exports.loadCssUrl=kt;exports.loadEnhance=cn;exports.loadScriptUrl=It;exports.menusFilter=Gt;exports.mockApi=ui;exports.mockApis=ai;exports.mockCleanup=Ht;exports.nodeCache=xe;exports.nodeRender=pe;exports.parseDeps=ps;exports.parseExpression=we;exports.parseFunction=W;exports.parseUrls=ds;exports.providerKey=rt;exports.removeProdFlag=hs;exports.rpxToPx=gs;exports.setupPageSetting=Ii;exports.toString=Et;exports.triggerError=Fe;exports.useAccess=si;exports.useApis=un;exports.useGlobals=Ee;exports.useLibs=on;exports.useMask=zr;exports.usePinia=nn;exports.useProvider=qt;exports.useRequest=an;exports.useStore=rn;
25
+ })()`}:ys(t.value)?{type:"JSFunction",value:`() => { ${t.value}}`}:t}function Ai(t,e,s,r){const i=["once","capture","passive"],n={capture:"Capture",once:"Once",passive:"Passive"};return Object.keys(s||{}).reduce((o,c)=>{const h=s[c],l=Ze(h.modifiers),p=i.filter(v=>l.includes(v)).map(v=>n[v]).join(""),m=l.filter(v=>!i.includes(v)),f="on"+d.upperFirstCamelCase(c)+p,g=h.handler?r.__parseFunction(Ii(h.handler)):null;return g&&(o[f]=t.withModifiers(l.includes("enter")?ki(g,"enter"):g,m)),o},{})}function Pi(t,e,s,r,i=[]){let n=i.findIndex(a=>a.id===t.id);for(let a=++n;a<i.length;a++){const{directives:o=[]}=i[a],{vIf:c,vElseIf:h,vElse:l}=ur(o);if(c)break;if(h){if(e.__parseExpression(h.value))return fe(i[a],e,s,r,i,!0);continue}if(l)return fe(i[a],e,s,r,i,!0)}return null}function Ze(t={},e=!1){const s=Object.keys(t).filter(r=>t[r]);return e?s.map(r=>"."+r):s}function Ti(t,e,s,r,i){const{children:n}=e,a=Ni(e,r),o=r.$slots?.[a.name];return o?o(s):n?d.isString(n)?t.createTextVNode(n):R(n)?t.createTextVNode(_t(r.__parseExpression(n))):Array.isArray(n)?n.map((c,h)=>fe(c,r,t,i,n,!1,h)):null:null}function Ni(t,e){const{props:s}=t,r=s?.name||"default";return{name:R(r)?e.__parseExpression(r):r,params:[]}}function Ri(t,e){return e.__parseExpression(t.value)?{}:{display:"none"}}function Oi(t,e){return{innerHTML:e.__parseExpression(t.value)||""}}function Vi(t,e,s,r,i){const n=t.value?.value,a=Ze(R(t.modifiers)?e.__parseExpression(t.modifiers):t.modifiers),o=s==="input"&&r==="checkbox",c=s==="input"&&r==="radio",h=s==="select",l=a.includes("lazy")||o||c||h?"onChange":"onInput",p=I=>`((value) => value === '' ? value : (Number.isNaN(Number(value)) ? value : Number(value)))(${I})`,m=a.includes("number")?p("v?.target._value ?? v?.target.value"):"v?.target._value ?? v?.target.value";let f="v?.target.value";if(o)f=`Array.isArray(${n})
26
+ ? (v?.target.checked
27
+ ? (${n}.includes(${m})
28
+ ? ${n}
29
+ : [...${n}, ${m}])
30
+ : ${n}.filter((item) => item !== ${m}))
31
+ : v?.target.checked`;else if(c)f=m;else if(h){const I=a.includes("number")?p("option._value ?? option.value"):"option._value ?? option.value",P=a.includes("number")?p("v?.target.selectedOptions?.[0]?._value ?? v?.target.value"):"v?.target.selectedOptions?.[0]?._value ?? v?.target.value";f=`v?.target.multiple
32
+ ? Array.from(v.target.selectedOptions).map((option) => ${I})
33
+ : (${P})`}else a.includes("trim")&&(f=`(${f})?.trim()`),a.includes("number")&&(f=p(f));const g={type:"JSFunction",value:n?`(v) => {
34
+ ${n} = ${f};
35
+ }`:"(v) => {}"},v=R(t.arg)?e.__parseExpression(t.arg):t.arg||"value",x=e.__parseExpression(t.value),b=o?Array.isArray(x)?x.includes(i):!!x:c?x===i:x;return{[o||c?"checked":v]:b,[l]:e.__parseFunction(g)}}function Li(t,e){const s={type:"JSFunction",value:t.value?.value?`(v) => {
36
+ ${t.value.value} = v;
37
+ }`:"(v) => {}"},r=e.__parseFunction(s),i=Ze(R(t.modifiers)?e.__parseExpression(t.modifiers):t.modifiers),n=R(t.arg)?e.__parseExpression(t.arg):t.arg||"modelValue",a={[n]:e.__parseExpression(t.value),[`onUpdate:${n}`]:r};return i.length&&(a[n==="modelValue"?"modelModifiers":`${n}Modifiers`]=i.reduce((o,c)=>(o[c]=!0,o),{})),a}function Fi(t,e,s,r,i){if(!e)return null;if(d.isString(e))return{default:()=>e};if(R(e))return{default:()=>_t(s.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const n=ji(e),a=(o,c)=>!o||!i?{}:i?.id&&Object.keys(o).length?c?{[c]:o}:{[`scope_${i.id}`]:o}:c?{[c]:Object.create(null)}:{};return Object.entries(n).reduce((o,[c,{nodes:h,params:l,scope:p}])=>(o[c]=m=>{const f=l.length?d.pick(m??{},l):a(m,p);return h.map((g,v)=>fe(g,s.__clone(f),t,r,h,!1,v))},o),{})}return null}function ji(t){const e={};for(const s of t){const r=Mi(s.slot),i=r.name;e[i]?(e[i].nodes.push(s),e[i].params=e[i].params.concat(r.params),e[i].scope=r.scope||""):e[i]={nodes:[s],params:r.params,scope:r.scope||""}}return e}function Mi(t="default"){return d.isString(t)?{name:t,params:[],scope:""}:{params:[],scope:"",...t}}function Di(t,e,s){const{value:r,iterator:i}=t,{item:n="item",index:a="index"}=i||{};let o=s.__parseExpression(r)||[];return Number.isInteger(o)&&(o=new Array(o).fill(!0).map((c,h)=>h+1)),Array.isArray(o)?o.map((c,h)=>e(s.__clone({[n]:c,[a]:h}),h)):(console.warn("[vForRender]:",`${r?.value} is not a Arrary`),[])}const lt=O.defineComponent({name:"VtjPageContainer",async setup(){const t=Ut(),e=ss.useRoute(),s=O.shallowRef(),r=O.shallowRef(),i=O.ref(Symbol());let n=0;const a=async()=>{const c=++n,h=e.meta.__vtj__||e.params.id,l=h?t.getPage(h):t.getHomepage(),p=l?await t.getRenderComponent(l.id):null;if(c!==n||(s.value=l,r.value=p,i.value=Symbol(),!l))return;Object.assign(e.meta,l.meta||{},{cache:l.cache});const{useTitle:m}=t?.adapter;if(m){const f=e.meta.title||l.title||"VTJ.PRO";m(f)}},o=a();return O.watch(()=>[e.meta.__vtj__,e.params.id],()=>a()),await o,{provider:t,component:r,file:s,sid:i,route:e}},render(){const{component:t,sid:e,route:s}=this;return t?O.h(t,{...s.query,key:e}):O.h("div",{style:{padding:"10px"}},"找不到组件,组件不存在或未发布!")},activated(){this.route.meta.cache===!1&&(this.sid=Symbol())}}),Bi=O.defineComponent({name:"VtjStartupContainer",render(){return O.h("div","page not found!")}});function Ve(t,e,s=[]){const r=[];for(const i of s){const{id:n,title:a,icon:o,children:c,hidden:h,layout:l}=i;if(l){const p=Ve(t,e,c||[]);r.push(...p)}else{const p={id:n,title:a,icon:o,hidden:h,url:`${t}/${e}/${n}`,children:c&&c.length?Ve(t,e,c):void 0};r.push(p)}}return r}function Bt(t,e){if(!e)return t;let s=[];for(const r of t)if(r.children&&r.children.length){const i=Bt(r.children,e);i.length&&(r.children=i,s.push(r))}else e.can(r.id.toString())&&s.push(r);return s}function Ui(t){const{menuPathPrefix:e="",pageRouteName:s="page",disableMenusFilter:r=!1}=t||{},i=Ut(),n=ss.useRoute(),a=Ys(),o=O.ref(!1),c=O.ref(!1),h=i.project,l=(f,g)=>{o.value=!f?.mask,c.value=g?.pure??!!f?.pure};O.watchEffect(()=>{const{name:f,params:g,meta:v}=n;if(f===Se){const x=i.getPage(g.id);l(x,v)}else if(f===Ae){const x=i.getHomepage();l(x,v)}else{const x=v.__vtj__;if(x){const b=i.getPage(x);l(b,v)}else o.value=!v.mask,c.value=!!v.pure}});const p=Ve(e,s,h?.pages),m=h?.config;return{disabled:o,logo:m?.logo,themeSwitchable:m?.themeSwitchable,title:m?.title||h?.description||h?.name||"VTJ App",menus:r?p:Bt(p,a),pure:c}}function ht(t,e){const{id:s,title:r,meta:i}=t,{name:n="page",prefix:a="",component:o,routeMeta:c}=e;return{name:s,path:`${a}${n}/${s}`,component:o,meta:{title:r,...c,...i,__vtj__:s}}}function bt(t){const{name:e="page",prefix:s="",pages:r=[],component:i,loader:n,routeMeta:a,homepage:o}=t,c=[];for(const h of r){const{id:l,title:p,dir:m,layout:f,children:g,meta:v}=h;if(m){const x=bt({name:e,prefix:s,component:i,routeMeta:a,homepage:o,loader:n,pages:g||[]});c.push(...x)}else if(f){const x=bt({name:e,prefix:s,component:i,routeMeta:a,homepage:o,loader:n,pages:g||[]}),b={name:`layout_${l}`,path:s,component:()=>n(l),meta:{title:p,...a,...v,__vtj__:l},children:x};c.push(b),c.push(ht(h,t))}else if(c.push(ht(h,t)),o===l){const x=ht(h,t);x.path="",x.name=`home_${l}`,c.push(x)}}return c}function $i(t={},e){const{css:s,store:r,enhance:i}=t,{window:n,app:a,library:o={},adapter:c,mode:h}=e,{Pinia:l}=o;a.config.globalProperties.$libs=o,We(n,"global-css",s||""),l&&r&&Hi(r,a,l),qi(a,c,t),!c.access&&t.access&&Gi(t.access,a,h,c),Wi(a,t),i&&Ki(i,a,o)}function Hi(t,e,s){if(!e.config.globalProperties.$pinia){const r=s.createPinia();e.use(r)}if(j(t)&&t.value){const r=q(t,{},!1,!1,!0),i=s.defineStore("$store",r(e)||{});e.config.globalProperties.$store=i()}}function Gi(t,e,s,r){if(j(t)&&t.value){const i=q(t,{},!1,!1,!0),{alert:n,request:a}=r,o=new Xe({alert:n,storagePrefix:"__VTJ_APP_",...i(e)}),c=e.config.globalProperties.$router;o.connect({mode:s,router:c,request:a}),e.use(o)}}function qi(t,e,s){if(!e.request)return;const{axios:r,request:i,response:n}=s;if(r&&j(r)&&r.value){const a=q(r,{},!1,!1,!0);e.request.setConfig(a(t))}if(i&&j(i)&&i.value){const a=q(i,{},!1,!1,!0),o=e.request;o.__unReq&&o.__unReq(),o.__unReq=e.request.useRequest(c=>a(c,t))}if(n&&j(n)&&n.value){const a=q(n,{},!1,!1,!0),o=e.request;o.__unRes&&o.__unRes(),o.__unRes=e.request.useResponse(c=>a(c,t))}}function Wi(t,e){const{beforeEach:s,afterEach:r}=e,i=t.config.globalProperties.$router;if(s&&j(s)&&s.value){const n=q(s,{},!1,!1,!0);i&&i.beforeEach((a,o,c)=>n(a,o,c,t))}if(r&&j(r)&&r.value){const n=q(r,{},!1,!1,!0);i&&i.afterEach((a,o,c)=>n(a,o,c,t))}}function Ki(t,e,s={}){j(t)&&t.value&&q(t,{},!1,!1,!0)(e,s)}function zi(t,e,s){if(!t||!e||!s)return;const{VueI18n:r}=e;if(r){const{locale:i,fallbackLocale:n,messages:a=[]}=s,o={};for(let h of a){const l=Object.keys(h).filter(p=>p!=="key");for(const p of l)o[p]||(o[p]={}),o[p][h.key]=h[p]}const c=r.createI18n({legacy:!1,locale:i,fallbackLocale:n,messages:o});t.use(c)}}const et=Symbol("Provider");var cr=(t=>(t.Production="production",t.Development="development",t))(cr||{});class lr extends ae.Base{constructor(e){super(),this.options=e;const{service:s,mode:r=T.Raw,dependencies:i,materials:n,project:a={},adapter:o={},globals:c={},modules:h={},router:l=null,materialPath:p="./",nodeEnv:m="development"}=e;this.mode=r,this.modules=h,this.service=s,this.router=l,this.materialPath=p,this.nodeEnv=m,i&&(this.dependencies=i),n&&(this.materials=n),Object.assign(this.globals,c),Object.assign(this.adapter,o);const{access:f,request:g}=this.adapter;f&&f.connect({mode:r,router:l,request:g}),a&&r!==T.Design?(this.initialization=this.load(a).then(()=>this),this.initialization.catch(v=>d.logger.error("Provider.load.error",v))):(this.project=a,this.triggerReady(),this.initialization=Promise.resolve(this))}mode;globals={};modules={};adapter={request:d.request,jsonp:d.jsonp};apis={};dependencies={};materials={};library={};libraryLocales={};libraryLocaleMap={};service;project=null;components={};nodeEnv="development";env={};router=null;materialPath="./";urlDslCaches={};errorHandler=null;initialization;createMock(e){return async(...s)=>{let r={};if(e)try{r=await e.apply(e,s)}catch(n){d.logger.warn("模拟数据模版异常",n)}const i=Ce();return i||console.warn("[@vtj/renderer]","项目缺少mockjs, 你需要安装mockjs依赖,并在应用的 main.ts 中添加 mockjs 导入,确保 window.Mock 可用"),i?.mock(r)}}async load(e){const{vtjDir:s=".vtj"}=this.options,r=this.modules[`${s}/projects/${e.id}.json`]||this.modules[`/src/${s}/projects/${e.id}.json`];if(this.project=r?await r():await this.service.init(e),!this.project)throw new Error("project is null");const{apis:i=[],meta:n=[],env:a=[]}=this.project,o=globalThis;o&&(o.CKEDITOR_VERSION=void 0),this.initEnv(a),this.mode===T.Raw?await this.loadDependencies(o):await this.loadAssets(o),this.initMock(o),this.apis=er(i,n,this.adapter),jt(o),tr(i,o),this.project.platform!=="uniapp"&&this.initRouter(),this.triggerReady()}initMock(e){const s=Ce(e);s&&s.setup({timeout:"50-500"})}async loadDependencies(e={}){const s=Object.entries(this.dependencies);for(const[r,i]of s)e[r]||(e[r]=this.library[r]=await i())}async loadAssets(e={}){const{dependencies:s=[]}=this.project,{dependencies:r,library:i,components:n,materialPath:a,nodeEnv:o,libraryLocales:c}=this,{libraryExports:h,libraryMap:l,materials:p,materialExports:m,materialMapLibrary:f,libraryLocaleMap:g}=us(s,a,o==="development");Object.assign(this.libraryLocaleMap,g);for(const v of h){const x=r[v],b=e[v];if(b)i[v]=b;else if(x)e[v]=i[v]=await x();else{const P=l[v]||[];for(const S of P)Le(S)&&await ds(S,d.url.append(S,{v:_e})),Fe(S)&&await d.loadScript(d.url.append(S,{v:_e}));i[v]=e[v]}const I=g[v];if(I){const P=r[I];c[I]=P?await P():e[I]}}if(o==="development"){for(const x of p)await d.loadScript(d.url.append(x,{v:_e}));const v=this.materials||{};for(const x of m){const b=e[f[x]],I=b?.default||b,P=ae.BUILT_IN_COMPONENTS[x];if(P)I&&P.forEach(S=>{n[S]=I[S]});else{const S=v[x]?(await v[x]()).default:e[x];S&&I&&(S.components||[]).forEach(U=>{n[U.name]=cs(U,I)})}}}}initRouter(){const{router:e,project:s,options:r,adapter:i}=this;if(!e)return;const n=s?.platform==="uniapp"?"pages":"page",{routeAppendTo:a,pageRouteName:o=n,routeMeta:c}=r,h=a?"":"/",l={path:`${h}${o}/:id`,name:Se,component:lt},p=this.getHomepage(),m={path:h,name:Ae,component:p?lt:i.startupComponent||Bi,meta:c};if(e.hasRoute(Se)&&e.removeRoute(Se),e.hasRoute(Ae)&&e.removeRoute(Ae),r.enableStaticRoute){const f=s?.pages||[];bt({name:o,prefix:h,pages:f,component:lt,loader:this.getRenderComponent.bind(this),homepage:p?.id,routeMeta:c}).forEach(v=>{a?e.addRoute(a,v):e.addRoute(v)}),p||(a?e.addRoute(a,m):e.addRoute(m))}else a?(e.addRoute(a,l),e.addRoute(a,m)):(e.addRoute(l),e.addRoute(m))}setErrorHandler(e){e.config.errorHandler=d.debounce((s,r,i)=>{const n=r?.$options.name,a=typeof s=="string"?s:s?.message||s?.msg||"未知错误",o=`[ ${n} ] ${a} ${i}`;if(!["getComputedStyle","ResizeObserver"].some(h=>o.includes(h))){try{const h={message:o,err:s,instance:r,info:JSON.stringify(i),stack:s?.stack};console.error("[VTJ Error]:",h,s?.stack),this.errorHandler&&this.errorHandler(h)}catch(h){console.warn("[provider.setErrorHandler]",h)}this.adapter.notify&&this.adapter.notify(o,"组件渲染错误","error")}},200)}install(e){const{libraryLocaleMap:s,libraryLocales:r}=this,{libraryOptions:i={}}=this.options,n=e.config.globalProperties.installed||{};for(const[a,o]of Object.entries(this.library))if(!n[a]&&ms(o)){const h={locale:r[s[a]]},l=i[a]||{},p={...h,...l};e.use(o,p),n[a]=!0}e.provide(et,this),e.config.globalProperties.$provider=this,e.config.globalProperties.$apis=this.apis,e.config.globalProperties.$request=this.adapter?.request,this.options.install&&e.use(this.options.install),this.adapter.access&&e.use(this.adapter.access),this.project?.platform!=="uniapp"&&this.mode!==T.Design&&this.initGlobals(this.project?.globals||{},{app:e,window:globalThis,adapter:this.adapter,library:this.library,mode:this.mode}),this.mode!==T.Design&&this.project?.i18n&&this.initI18n(e,this.library,this.project.i18n),this.options.enhance&&e.use(this.options.enhance,this),this.mode===T.Design&&this.setErrorHandler(e),e.config.globalProperties.installed=n,this.setGlobals(e.config.globalProperties)}setGlobals(e={}){for(const[s,r]of Object.entries(e))this.globals[s]=r}getFile(e){const{blocks:s=[]}=this.project||{};return this.getPage(e)||s.find(r=>r.id===e)||null}getPage(e){const{pages:s=[]}=this.project||{},r=(i,n=[])=>{for(const a of n){if(a.id===i)return a;if(a.children&&a.children.length){const o=r(i,a.children);if(o)return o}}};return r(e,s)||null}getFirstPage(){const{pages:e=[]}=this.project||{};if(!e.length)return null;const s=(r=[])=>{for(const i of r){if(i.type==="page"&&!i.dir&&!i.layout)return i;if(i.children&&i.children.length){const n=s(i.children);if(n)return n}}};return s(e)||null}getMenus(e="page",s=""){return Ve(s,e,this.project?.pages||[])}getHomepage(){const{homepage:e}=this.project||{};return e?this.getPage(e):this.getFirstPage()}async getDsl(e){const{vtjDir:s=".vtj"}=this.options,r=this.modules[`${s}/files/${e}.json`]||this.modules[`/src/${s}/files/${e}.json`];return r?await r():this.service.getFile(e,this.project||void 0).catch(()=>null)}async getDslByUrl(e){const s=this.urlDslCaches[e];if(s)return s;if(!this.adapter.request)return null;const r=this.urlDslCaches[e]=this.adapter.request.send({url:e,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(i=>i.data).catch(()=>(this.urlDslCaches[e]===r&&delete this.urlDslCaches[e],null));return r}createDslRenderer(e,s={}){const{library:r,components:i,mode:n,apis:a}=this,o={mode:n,Vue:r.Vue,UniApp:r.UniApp,components:i,libs:r,apis:a,window:globalThis,...s},c=or({getDsl:async h=>await this.getDsl(h)||null,getDslByUrl:async h=>await this.getDslByUrl(h)||null,options:o});return qe({...o,dsl:e,loader:c})}async getRenderComponent(e,s){const r=this.getFile(e);if(!r)return d.logger.warn(`Can not find file: ${e}`),null;if(s&&s(r),this.mode===T.Raw){const{vtjRawDir:n=".vtj/vue"}=this.options,a=`${n}/${e}.vue`,o=this.modules[a]||this.modules[`/src/pages/${e}.vue`];return o?(await o())?.default:this.nodeEnv==="development"&&this.adapter.startupComponent||null}const i=await this.getDsl(r.id);return i?this.createDslRenderer(i).renderer:(d.logger.warn(`Can not find dsl: ${e}`),null)}defineUrlSchemaComponent(e,s){return O.defineAsyncComponent(async()=>{const r=await this.getDslByUrl(e);return r?(r.name=s||r.name,this.createDslRenderer(r).renderer):null})}definePluginComponent(e){return O.defineAsyncComponent(async()=>await Dt(e,globalThis))}initGlobals(e,s){const r=Object.assign({adapter:this.adapter,window:globalThis},s);$i(e,r)}initI18n(e,s,r){zi(e,s,r)}initEnv(e=[]){this.env=e.reduce((s,r)=>(s[r.name]=r[this.nodeEnv],s),{})}}function Ji(t){const e=new lr(t);return{provider:e,onReady:r=>e.ready(r),ready:e.initialization}}function Ut(t={}){const e=O.inject(et,null);if(!e)throw new Error("Can not find provider");if(e.nodeEnv==="development"){const{id:s,version:r}=t;s&&r&&(async()=>{const i=await e.getDsl(s);i?.__VERSION__!==r&&e.adapter.notify&&e.adapter.notify(`[ ${i?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,"版本不一致","warning")})()}return e}function ke(){return O.inject(et,null)?.globals??{}}function Qi(){return ke().$store||{}}function Yi(){return ke().$pinia||{}}function Xi(){return ke().$request}function Zi(){return ke().$libs||{}}function en(){return ke().$apis||{}}async function tn(t,e=""){const{name:s,urls:r=[]}=t||{},i=r.map(o=>e+o),{css:n,js:a}=ls(i);if(n.length&&St(n),a.length)return await Ct(a,s).catch(()=>{})}const hr={type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:t=>t.data?.code===0},sn=(t,e="/__vtj__/api/:type.json")=>(s,r,i)=>t.send({url:e,method:"post",params:{type:s},query:i,data:{type:s,data:r},settings:hr}),rn=(t,e="/__vtj__/api/uploader.json")=>async(s,r)=>await t.send({url:e,method:"post",data:{files:s,projectId:r},settings:{...hr,type:"data"}}).then(i=>i&&i[0]?i[0]:null).catch(()=>null);function nn(t){return d.createRequest({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>e.data?.code===0,showError:e=>{t&&t(e||"未知错误")}}})}class tt{constructor(e=d.request){this.req=e,this.api=sn(e),this.uploader=rn(e)}api;pluginCaches={};uploader;async getExtension(){console.log("BaseService.getExtension")}async init(e){return console.log("BaseService.init",e),{}}async saveProject(e,s){return!!await this.api("saveProject",e,{type:s}).catch(()=>!1)}async saveMaterials(e,s){return console.log("BaseService.saveMaterials",e,s),!1}async saveFile(e){return console.log("BaseService.saveFile",e),!1}async getFile(e){return console.log("BaseService.getFile",e),{}}async removeFile(e){return console.log("BaseService.removeFile",e),!1}async saveHistory(e){return console.log("BaseService.saveHistory",e),!1}async removeHistory(e){return console.log("BaseService.removeHistory",e),!1}async getHistory(e){return console.log("BaseService.getHistory",e),{}}async getHistoryItem(e,s){return console.log("BaseService.getHistoryItem",e,s),{}}async saveHistoryItem(e,s){return console.log("BaseService.saveHistoryItem",e,s),!1}async removeHistoryItem(e,s){return console.log("BaseService.removeHistoryItem",e,s),!1}async publish(e){return!!await this.api("publish",e).catch(()=>!1)}async publishFile(e,s){return!!await this.api("publishFile",{project:e,file:s}).catch(()=>!1)}async genVueContent(e,s){return await this.api("genVueContent",{project:e,dsl:s}).catch(()=>"")}async parseVue(e,s){return await this.api("parseVue",{project:e,...s})}async createRawPage(e){return await this.api("createRawPage",e).catch(()=>"")}async removeRawPage(e){return await this.api("removeRawPage",e).catch(()=>"")}async uploadStaticFile(e,s){return await this.uploader(e,s).catch(()=>null)}async getStaticFiles(e){return await this.api("getStaticFiles",e).catch(()=>[])}async removeStaticFile(e,s){return await this.api("removeStaticFile",{name:e,projectId:s}).catch(()=>"")}async clearStaticFiles(e){return await this.api("clearStaticFiles",e).catch(()=>"")}async getPluginMaterial(e){const{urls:s=[]}=e,r=s.filter(n=>as(n))[0];if(!r)return null;const i=this.pluginCaches[r];return i||(this.pluginCaches[r]=d.request.send({url:r,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(n=>n.data).catch(()=>null))}async genSource(e){return console.log("BaseService.genSource",e),""}}const D=new d.Storage({type:"local",expired:0,prefix:"__VTJ_"});class an extends tt{init(e){const s=new ae.ProjectModel(e),r=D.get(`project_${s.id}`),i=Object.assign(s.toDsl(),r||{});return D.save(`project_${s.id}`,i),Promise.resolve(i)}saveProject(e){const s=new ae.ProjectModel(e);return D.save(`project_${s.id}`,s.toDsl()),Promise.resolve(!0)}saveMaterials(e,s){return D.save(`materials_${e.id}`,d.mapToObject(s)),Promise.resolve(!0)}saveFile(e){return D.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const s=D.get(`file_${e}`);return s?Promise.resolve(s):Promise.reject(null)}removeFile(e){return D.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return D.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const s=D.get(`history_${e}`);if(s){const i=(s.items||[]).map(n=>n.id);this.removeHistoryItem(e,i),D.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const s=D.get(`history_${e}`),r=new ae.HistoryModel(s||{id:e});return Promise.resolve(r.toDsl())}getHistoryItem(e,s){const r=D.get(`history_${e}_${s}`);return Promise.resolve(r)}saveHistoryItem(e,s){return D.save(`history_${e}_${s.id}`,s),Promise.resolve(!0)}removeHistoryItem(e,s){return s.forEach(r=>{D.remove(`history_${e}_${r}`)}),Promise.resolve(!0)}}class pr extends tt{projects={};materials={};files={};histories={};historyItems={};init(e){const s=new ae.ProjectModel(e),r=this.projects[s.id]||{},i=Object.assign(s.toDsl(),r);return this.projects[i.id]=i,Promise.resolve(i)}saveProject(e){const s=new ae.ProjectModel(e);return this.projects[s.id]=s.toDsl(),Promise.resolve(!0)}saveMaterials(e,s){return e.id&&(this.materials[e.id]=d.mapToObject(s)),Promise.resolve(!0)}saveFile(e){return this.files[e.id]=e,Promise.resolve(!0)}getFile(e){const s=this.files[e];return s?Promise.resolve(s):Promise.reject(null)}removeFile(e){return delete this.files[e],Promise.resolve(!0)}saveHistory(e){return this.histories[e.id]=e,Promise.resolve(!0)}removeHistory(e){const s=this.histories[e];if(s){const i=(s.items||[]).map(n=>n.id);this.removeHistoryItem(e,i),delete this.histories[e]}return Promise.resolve(!0)}getHistory(e){const s=this.histories[e],r=new ae.HistoryModel(s||{id:e});return Promise.resolve(r)}getHistoryItem(e,s){const r=`${e}_${s}`,i=this.historyItems[r]||{};return Promise.resolve(i)}saveHistoryItem(e,s){const r=`${e}_${s.id}`;return this.historyItems[r]=s,Promise.resolve(!0)}removeHistoryItem(e,s){return s.forEach(r=>{const i=`${e}_${r}`;delete this.historyItems[i]}),Promise.resolve(!0)}}let $e=null;function on(){return $e||($e=new pr,$e)}class un extends tt{getFileCaches={};async getExtension(){return await this.api("getExtension",{}).catch(()=>{})}async init(e){return await this.api("init",e).catch(()=>null)||{}}async saveProject(e,s){return!!await this.api("saveProject",e,{type:s}).catch(()=>!1)}async saveMaterials(e,s){return!!await this.api("saveMaterials",{project:e,materials:d.mapToObject(s)}).catch(()=>!1)}async saveFile(e){return!!await this.api("saveFile",e).catch(()=>!1)}async getFile(e){const s=this.getFileCaches[e];return s||(this.getFileCaches[e]=this.api("getFile",e).catch(()=>null)).finally(()=>{delete this.getFileCaches[e]})}async removeFile(e){return!!await this.api("removeFile",e).catch(()=>!1)}async saveHistory(e){return!!await this.api("saveHistory",e).catch(()=>!1)}async removeHistory(e){return!!await this.api("removeHistory",e).catch(()=>!1)}async getHistory(e){return await this.api("getHistory",e).catch(()=>null)||{}}async getHistoryItem(e,s){return await this.api("getHistoryItem",{fId:e,id:s}).catch(()=>null)||{}}async saveHistoryItem(e,s){return!!await this.api("saveHistoryItem",{fId:e,item:s}).catch(()=>!1)}async removeHistoryItem(e,s){return!!await this.api("removeHistoryItem",{fId:e,ids:s}).catch(()=>!1)}}exports.ACCESS=vr;exports.ACCESS_KEY=Ft;exports.Access=Xe;exports.BUILD_IN_TAGS=ns;exports.BUILT_IN_DIRECTIVES=rs;exports.BaseService=tt;exports.COMPOSITION_HOOKS_LIST=mr;exports.CONTEXT_HOST=pt;exports.Context=vt;exports.ContextMode=T;exports.DATA_TYPES=is;exports.HOMEPAGE_ROUTE_NAME=Ae;exports.HTML_TAGS=yt;exports.JSCodeToString=ii;exports.LIFE_CYCLES_LIST=dr;exports.LocalService=un;exports.MemoryService=pr;exports.NodeCache=Mt;exports.NodeEnv=cr;exports.PAGE_ROUTE_NAME=Se;exports.Provider=lr;exports.REMOTE=gr;exports.StorageService=an;exports.VTJ_RENDERER_VERSION=_e;exports.adoptStylesToInline=_r;exports.adoptedStyleSheets=We;exports.clearLoaderCache=_i;exports.compileScopedCSS=hs;exports.convertCssRpx=fs;exports.createAccess=oi;exports.createAdapter=ai;exports.createAssetScripts=xr;exports.createAssetsCss=br;exports.createDataSources=nr;exports.createLoader=or;exports.createMemoryService=on;exports.createMenus=Ve;exports.createMetaApi=Zs;exports.createMock=sr;exports.createProvider=Ji;exports.createRenderer=qe;exports.createSchemaApi=Xs;exports.createSchemaApis=er;exports.createServiceRequest=nn;exports.defaultLoader=ar;exports.fillBasePath=Ie;exports.getMock=Ce;exports.getModifiers=Ze;exports.getPlugin=Dt;exports.getRawComponent=cs;exports.isArrowFunction=xs;exports.isAssignment‌=ys;exports.isBuiltInTag=gs;exports.isCSSUrl=Le;exports.isCallFunction=bs;exports.isJSCode=Qs;exports.isJSExpression=R;exports.isJSFunction=j;exports.isJSON=as;exports.isJSUrl=Fe;exports.isNativeTag=vs;exports.isVuePlugin=ms;exports.loadCss=ds;exports.loadCssUrl=St;exports.loadEnhance=tn;exports.loadScriptUrl=Ct;exports.menusFilter=Bt;exports.mockApi=rr;exports.mockApis=tr;exports.mockCleanup=jt;exports.nodeCache=ir;exports.nodeRender=fe;exports.parseDeps=us;exports.parseExpression=Ee;exports.parseFunction=q;exports.parseUrls=ls;exports.providerKey=et;exports.removeProdFlag=os;exports.rpxToPx=ps;exports.setupPageSetting=Sr;exports.toString=_t;exports.triggerError=pe;exports.useAccess=Ys;exports.useApis=en;exports.useGlobals=ke;exports.useLibs=Zi;exports.useMask=Ui;exports.usePinia=Yi;exports.useProvider=Ut;exports.useRequest=Xi;exports.useStore=Qi;