@vtj/renderer 0.18.18 → 0.18.20
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 +13 -13
- package/dist/index.mjs +980 -968
- package/package.json +5 -5
- package/types/version.d.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("@vtj/core"),f=require("@vtj/utils"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("@vtj/core"),f=require("@vtj/utils"),j=require("vue"),is=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 ve=xi(j);/**!
|
|
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.
|
|
5
|
+
* @version 0.18.20
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const be="0.18.
|
|
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
|
|
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 ps(t,e){const s=await globalThis.fetch(e).then(i=>i.text()).catch(()=>"");s&&Ke(globalThis,t,s)}function wt(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 Et(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 fs(t){return f.isFunction(t)&&Object.getOwnPropertyNames(t.prototype||{}).length===0||f.isFunction(t?.install)}function ds(t){return is.includes(t)}function ms(t){return St.includes(t)}function _e(t=globalThis){const e=globalThis?.Mock;if(e)return e;const s=t?.Mock;if(s&&globalThis)return globalThis.Mock=s,s}function Ci(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 gs(t){return/^\([\s\S]*\)/.test(t.trim())}function xs(t){return/\w+\([\s\S]*\)$/.test(t.trim())}function vs(t){return t.includes("=")}var ot={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"},ut="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",wi={5:ut,"5module":ut+" export import",6:ut+" const class extends export import super"},Ei=/^in(stanceof)?$/,kt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",bs="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",ki=new RegExp("["+kt+"]"),Ii=new RegExp("["+kt+bs+"]");kt=bs=null;var ys=[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],Ai=[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 mt(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&&ki.test(String.fromCharCode(t)):e===!1?!1:mt(t,ys)}function Se(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&&Ii.test(String.fromCharCode(t)):e===!1?!1:mt(t,ys)||mt(t,Ai)}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 U(t,e){return new k(t,{beforeExpr:!0,binop:e})}var $={beforeExpr:!0},B={startsExpr:!0},It={};function w(t,e){return e===void 0&&(e={}),e.keyword=t,It[t]=new k(t,e)}var o={num:new k("num",B),regexp:new k("regexp",B),string:new k("string",B),name:new k("name",B),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(",",$),semi:new k(";",$),colon:new k(":",$),dot:new k("."),question:new k("?",$),questionDot:new k("?."),arrow:new k("=>",$),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",$),backQuote:new k("`",B),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:U("||",1),logicalAND:U("&&",2),bitwiseOR:U("|",3),bitwiseXOR:U("^",4),bitwiseAND:U("&",5),equality:U("==/!=/===/!==",6),relational:U("</>/<=/>=",7),bitShift:U("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:U("%",10),star:U("*",10),slash:U("/",10),starstar:new k("**",{beforeExpr:!0}),coalesce:U("??",1),_break:w("break"),_case:w("case",$),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",$),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",$),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",B),_if:w("if"),_return:w("return",$),_switch:w("switch"),_throw:w("throw",$),_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",B),_super:w("super",B),_class:w("class",B),_extends:w("extends",$),_export:w("export"),_import:w("import",B),_null:w("null",B),_true:w("true",B),_false:w("false",B),_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})},W=/\r\n?|\n|\u2028|\u2029/,Te=new RegExp(W.source,"g");function je(t,e){return t===10||t===13||!e&&(t===8232||t===8233)}var _s=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ss=Object.prototype,Pi=Ss.hasOwnProperty,Ti=Ss.toString;function ze(t,e){return Pi.call(t,e)}var qt=Array.isArray||(function(t){return Ti.call(t)==="[object Array]"});function le(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var Re=function(e,s){this.line=e,this.column=s};Re.prototype.offset=function(e){return new Re(this.line,this.column+e)};var Je=function(e,s,i){this.start=s,this.end=i,e.sourceFile!==null&&(this.source=e.sourceFile)};function Cs(t,e){for(var s=1,i=0;;){Te.lastIndex=i;var r=Te.exec(t);if(r&&r.index<e)++s,i=r.index+r[0].length;else return new Re(s,e-i)}}var gt={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 Ri(t){var e={};for(var s in gt)e[s]=t&&ze(t,s)?t[s]:gt[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=Ni(e,e.onComment)),e}function Ni(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 Je(this,a,u)),t.ranges&&(c.range=[r,n]),e.push(c)}}var Ne=1,Me=2,At=Ne|Me,ws=4,Es=8,ks=16,Is=32,As=64,Ps=128;function Pt(t,e){return Me|(t?ws:0)|(e?Es:0)}var Wt=0,Tt=1,Z=2,Ts=3,Rs=4,Ns=5,T=function(e,s,i){this.options=e=Ri(e),this.sourceFile=e.sourceFile,this.keywords=le(wi[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var r="";if(e.allowReserved!==!0){for(var n=e.ecmaVersion;!(r=ot[n]);n--);e.sourceType==="module"&&(r+=" await")}this.reservedWords=le(r);var a=(r?r+" ":"")+ot.strict;this.reservedWordsStrict=le(a),this.reservedWordsStrictBind=le(a+" "+ot.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(W).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(Ne),this.regexpState=null},pe={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)};pe.inFunction.get=function(){return(this.currentVarScope().flags&Me)>0};pe.inGenerator.get=function(){return(this.currentVarScope().flags&Es)>0};pe.inAsync.get=function(){return(this.currentVarScope().flags&ws)>0};pe.allowSuper.get=function(){return(this.currentThisScope().flags&As)>0};pe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ps)>0};pe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};T.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&Me)>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,pe);var j=T.prototype,Oi=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;j.strictDirective=function(t){for(;;){G.lastIndex=t,t+=G.exec(this.input)[0].length;var e=Oi.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){G.lastIndex=t+e[0].length;var s=G.exec(this.input),i=s.index+s[0].length,r=this.input.charAt(i);return r===";"||r==="}"||W.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(i+1)==="=")}t+=e[0].length,G.lastIndex=t,t+=G.exec(this.input)[0].length,this.input[t]===";"&&t++}};j.eat=function(t){return this.type===t?(this.next(),!0):!1};j.isContextual=function(t){return this.type===o.name&&this.value===t&&!this.containsEsc};j.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};j.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};j.canInsertSemicolon=function(){return this.type===o.eof||this.type===o.braceR||W.test(this.input.slice(this.lastTokEnd,this.start))};j.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};j.semicolon=function(){!this.eat(o.semi)&&!this.insertSemicolon()&&this.unexpected()};j.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};j.expect=function(t){this.eat(t)||this.unexpected()};j.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};function Qe(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}j.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")}};j.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")};j.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")};j.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 Rt={kind:"loop"},Vi={kind:"switch"};_.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;G.lastIndex=this.pos;var e=G.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;Se(this.input.charCodeAt(r),!0);)++r;var n=this.input.slice(s,r);if(!Ei.test(n))return!0}return!1};_.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;G.lastIndex=this.pos;var t=G.exec(this.input),e=this.pos+t[0].length;return!W.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!Se(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){G.lastIndex=this.pos;var a=G.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(Rt),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(Rt),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 Qe,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,Pe|(s?0:xt),!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(Vi),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(),W.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 Fi=[];_.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?Is:0),this.checkLVal(e.param,s?Rs:Z),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(Rt),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"?Tt:Z,!1)};var Pe=1,xt=2,Os=4;_.parseFunction=function(t,e,s,i){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===o.star&&e&xt&&this.unexpected(),t.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(t.async=!!i),e&Pe&&(t.id=e&Os&&this.type!==o.name?null:this.parseIdent(),t.id&&!(e&xt)&&this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?Tt:Z:Ts));var r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Pt(t.async,t.generator)),e&Pe||(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&Pe?"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,Z,!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,Pe|Os,!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&&(ze(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=Fi,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,Z),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,Z),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,Z),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 ee=T.prototype;ee.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};ee.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};ee.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};ee.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")};ee.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()};ee.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};ee.parseBindingListItem=function(t){return t};ee.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")};ee.checkLVal=function(t,e,s){switch(e===void 0&&(e=Wt),t.type){case"Identifier":e===Z&&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&&(ze(s,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),s[t.name]=!0),e!==Wt&&e!==Ns&&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 Qe,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 Qe,p=this.yieldPos,m=this.awaitPos,d=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=d,this.parseArrowExpression(this.startNodeAt(e,s),g,!0);this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=d||this.awaitIdentPos;var x=this.startNodeAt(e,s);x.callee=t,x.arguments=g,a&&(x.optional=u),t=this.finishNode(x,"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 Qe,p=this.yieldPos,m=this.awaitPos,d;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){d=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,x=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),d&&this.unexpected(d),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,x)):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 Li=[];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=Li,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)&&!W.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(Pt(e,i.generator)|As|(s?Ps: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(Pt(s,!1)|ks),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,Ns),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,Tt,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 $e=T.prototype;$e.raise=function(t,e){var s=Cs(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};$e.raiseRecoverable=$e.raise;$e.curPosition=function(){if(this.options.locations)return new Re(this.curLine,this.pos-this.lineStart)};var oe=T.prototype,ji=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};oe.enterScope=function(t){this.scopeStack.push(new ji(t))};oe.exitScope=function(){this.scopeStack.pop()};oe.treatFunctionsAsVarInScope=function(t){return t.flags&Me||!this.inModule&&t.flags&Ne};oe.declareName=function(t,e,s){var i=!1;if(e===Z){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&Ne&&delete this.undefinedExports[t]}else if(e===Rs){var n=this.currentScope();n.lexical.push(t)}else if(e===Ts){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&Is&&c.lexical[0]===t)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(t)>-1){i=!0;break}if(c.var.push(t),this.inModule&&c.flags&Ne&&delete this.undefinedExports[t],c.flags&At)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&At)return e}};oe.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&At&&!(e.flags&ks))return e}};var Nt=function(e,s,i){this.type="",this.start=s,this.end=0,e.options.locations&&(this.loc=new Je(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[s,0])},Ye=T.prototype;Ye.startNode=function(){return new Nt(this,this.start,this.startLoc)};Ye.startNodeAt=function(t,e){return new Nt(this,t,e)};function Vs(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}Ye.finishNode=function(t,e){return Vs.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Ye.finishNodeAt=function(t,e,s,i){return Vs.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)},Xe=T.prototype;Xe.initialContext=function(){return[A.b_stat]};Xe.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?W.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};Xe.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};Xe.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&&W.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 Fs="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",Ls=Fs+" Extended_Pictographic",Mi=Ls,Di={9:Fs,10:Ls,11:Mi},Kt="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",js="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",Ms=js+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Bi=Ms+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Hi={9:js,10:Ms,11:Bi},Ds={};function Ot(t){var e=Ds[t]={binary:le(Di[t]+" "+Kt),nonBinary:{General_Category:le(Kt),Script:le(Hi[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}Ot(9);Ot(10);Ot(11);var b=T.prototype,te=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=Ds[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=[]};te.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};te.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)};te.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};te.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};te.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)};te.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)};te.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)};te.prototype.eat=function(e,s){return s===void 0&&(s=!1),this.current(s)===e?(this.advance(s),!0):!1};function Ge(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}b.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")}};b.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))};b.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")}};b.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")};b.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););};b.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};b.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};b.regexp_eatQuantifier=function(t,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};b.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};b.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};b.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)};b.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1};b.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};b.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};b.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)};b.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};b.regexp_eatSyntaxCharacter=function(t){var e=t.current();return Bs(e)?(t.lastIntValue=e,t.advance(),!0):!1};function Bs(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}b.regexp_eatPatternCharacters=function(t){for(var e=t.pos,s=0;(s=t.current())!==-1&&!Bs(s);)t.advance();return t.pos!==e};b.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};b.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")}};b.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};b.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};b.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),Ui(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)};function Ui(t){return ae(t,!0)||t===36||t===95}b.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),$i(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)};function $i(t){return Se(t,!0)||t===36||t===95||t===8204||t===8205}b.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)};b.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};b.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};b.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)};b.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};b.regexp_eatZero=function(t){return t.current()===48&&!Ze(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};b.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};b.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}b.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)&&Gi(t.lastIntValue))return!0;i&&t.raise("Invalid unicode escape"),t.pos=s}return!1};function Gi(t){return t>=0&&t<=1114111}b.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};b.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};b.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(qi(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 qi(t){return t===100||t===68||t===115||t===83||t===119||t===87}b.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};b.regexp_validateUnicodePropertyNameAndValue=function(t,e,s){ze(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(s)||t.raise("Invalid property value")};b.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")};b.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";Us(e=t.current());)t.lastStringValue+=Ge(e),t.advance();return t.lastStringValue!==""};function Us(t){return Hs(t)||t===95}b.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Wi(e=t.current());)t.lastStringValue+=Ge(e),t.advance();return t.lastStringValue!==""};function Wi(t){return Us(t)||Ze(t)}b.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};b.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};b.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")}}};b.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||qs(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};b.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)};b.regexp_eatClassControlLetter=function(t){var e=t.current();return Ze(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};b.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};b.regexp_eatDecimalDigits=function(t){var e=t.pos,s=0;for(t.lastIntValue=0;Ze(s=t.current());)t.lastIntValue=10*t.lastIntValue+(s-48),t.advance();return t.pos!==e};function Ze(t){return t>=48&&t<=57}b.regexp_eatHexDigits=function(t){var e=t.pos,s=0;for(t.lastIntValue=0;$s(s=t.current());)t.lastIntValue=16*t.lastIntValue+Gs(s),t.advance();return t.pos!==e};function $s(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Gs(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}b.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};b.regexp_eatOctalDigit=function(t){var e=t.current();return qs(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function qs(t){return t>=48&&t<=55}b.regexp_eatFixedHexDigits=function(t,e){var s=t.pos;t.lastIntValue=0;for(var i=0;i<e;++i){var r=t.current();if(!$s(r))return t.pos=s,!1;t.lastIntValue=16*t.lastIntValue+Gs(r),t.advance()}return!0};var Vt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Je(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 Vt(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 Vt(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){Te.lastIndex=e;for(var i;(i=Te.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&&!je(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&&_s.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||W.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 '"+Ft(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(W.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 te(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 Ki(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}function Ws(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=Ws(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=Ws(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=Ki(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 Ft(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):(je(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 Ks={};C.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===Ks)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};C.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ks;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(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+=`
|
|
7
|
+
*/const be="0.18.20";var P=(t=>(t.Runtime="Runtime",t.Design="Design",t.Raw="Raw",t.VNode="VNode",t))(P||{});const mt=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],vi=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],bi=["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onErrorCaptured","onRenderTracked","onRenderTriggered","onActivated","onDeactivated"],rs=["vIf","vElseIf","vElse","vShow","vModel","vFor","vBind","vHtml"],ns={String,Number,Boolean,Array,Object,Function,Date},ye="VtjPage",Ae="VtjHomepage",Ct="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(","),as="component,slot".split(","),yi=["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o"].join(""),_i={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 ke(t,e){return t.map(s=>f.isUrl(s)||s.startsWith("/")?s:`${e}${s}`)}function Fe(t){return/\.css$/.test(t)}function Le(t){return/\.js$/.test(t)}function os(t){return/\.json$/.test(t)}function Si(t){return t.map(e=>`<script src="${f.url.append(e,{v:be})}"><\/script>`).join("")}function Ci(t=[]){return t.map(e=>`<link rel="stylesheet" href="${f.url.append(e,{v:be})}" />`).join("")}function us(t,e=!1){return e&&t.endsWith(".prod.js")?t.replace(".prod.js",".js"):t}function cs(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:d,library:g,assetsLibrary:v,localeLibrary:x})=>{m?.forEach(b=>{Le(b)&&r.push(us(b,s)),Fe(b)&&n.push(b)}),g&&(u.push(g),c[g]=ke(m||[],e),x&&(l[g]=x)),d&&a.push(d),v&&h.push(v),g&&v&&(p[v]=g)}),{scripts:ke(r,e),css:ke(n,e),materials:ke(a,e),libraryExports:u,materialExports:f.dedupArray(h),materialMapLibrary:p,libraryMap:c,libraryLocaleMap:l}}function ls(t,e){const{name:s,parent:i,alias:r}=t;return i?e[i]?.[r||s]:e[r||s]}function hs(t=[]){const e=t.filter(i=>Fe(i)),s=t.filter(i=>Le(i));return{css:e,js:s}}function ps(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 b=l.indexOf("*/",p+2);if(b!==-1){p=b+2;continue}}if(l[p]==="@"){const b=p;for(;p<l.length&&l[p]!=="{"&&l[p]!==";";)p++;const I=l.substring(b,p).trim(),O=I.includes("@keyframes");if(l[p]===";")h.push({type:"simple-at-rule",content:l.substring(b,p+1)}),p++;else if(l[p]==="{"){const E=p+1;let U=1;for(p++;p<l.length&&U>0;)l[p]==="{"?U++:l[p]==="}"&&U--,p++;const fe=l.substring(b,p),Ee=l.substring(E,p-1);h.push({type:O?"keyframes":"at-rule",rule:I,content:fe,inner:Ee})}continue}const m=p;for(;p<l.length&&l[p]!=="{";)p++;if(p>=l.length)break;const d=l.substring(m,p).trim();if(!d){p++;continue}const g=p+1;let v=1;for(p++;p<l.length&&v>0;)l[p]==="{"?v++:l[p]==="}"&&v--,p++;const x=l.substring(g,p-1);h.push({type:"rule",selector:d,content:x.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 d=p.trim(),g=m.trim();return d?`${d}[${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,d=""]=p,g=m.trim();return g?`${g}[${e}]${d}`: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),d=u(m);return`${h.rule} { ${d} }`}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 wi=750;function fs(t,e,s){let i;typeof t<"u"?i=t.innerWidth||t.document.documentElement.clientWidth:(console.warn("无法获取屏幕宽度,使用默认值375"),i=375);const r=s||wi;return e*i/r}function ds(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=`${fs(t,h).toFixed(6).replace(/\.?0+$/,"")}px`;n+=m,a+=c[0].length-1;continue}}n+=u}return n}function wt(t){return f.isString(t)?t:JSON.stringify(t)}function ze(t,e,s,i=!1){const r=t.CSSStyleSheet,n=i?`data-v-${e}`:e,a=t.__uniConfig?ds(t,s):s,u=i?ps(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(d=>d.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 Ei(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 ms(t,e){const s=await globalThis.fetch(e).then(i=>i.text()).catch(()=>"");s&&ze(globalThis,t,s)}function Et(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 kt(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 gs(t){return f.isFunction(t)&&Object.getOwnPropertyNames(t.prototype||{}).length===0||f.isFunction(t?.install)}function xs(t){return as.includes(t)}function vs(t){return Ct.includes(t)}function _e(t=globalThis){const e=globalThis?.Mock;if(e)return e;const s=t?.Mock;if(s&&globalThis)return globalThis.Mock=s,s}function ki(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 bs(t){return/^\([\s\S]*\)/.test(t.trim())}function ys(t){return/\w+\([\s\S]*\)$/.test(t.trim())}function _s(t){return t.includes("=")}var ut={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"},ct="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",Ii={5:ct,"5module":ct+" export import",6:ct+" const class extends export import super"},Ai=/^in(stanceof)?$/,It="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ss="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",Pi=new RegExp("["+It+"]"),Ti=new RegExp("["+It+Ss+"]");It=Ss=null;var Cs=[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],Ri=[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 gt(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&&Pi.test(String.fromCharCode(t)):e===!1?!1:gt(t,Cs)}function Se(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&&Ti.test(String.fromCharCode(t)):e===!1?!1:gt(t,Cs)||gt(t,Ri)}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},H={startsExpr:!0},At={};function w(t,e){return e===void 0&&(e={}),e.keyword=t,At[t]=new k(t,e)}var o={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),questionDot:new k("?."),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:$("||",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: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})},K=/\r\n?|\n|\u2028|\u2029/,Te=new RegExp(K.source,"g");function je(t,e){return t===10||t===13||!e&&(t===8232||t===8233)}var ws=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,q=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Es=Object.prototype,Ni=Es.hasOwnProperty,Oi=Es.toString;function Je(t,e){return Ni.call(t,e)}var zt=Array.isArray||(function(t){return Oi.call(t)==="[object Array]"});function le(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var Re=function(e,s){this.line=e,this.column=s};Re.prototype.offset=function(e){return new Re(this.line,this.column+e)};var Qe=function(e,s,i){this.start=s,this.end=i,e.sourceFile!==null&&(this.source=e.sourceFile)};function ks(t,e){for(var s=1,i=0;;){Te.lastIndex=i;var r=Te.exec(t);if(r&&r.index<e)++s,i=r.index+r[0].length;else return new Re(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 Vi(t){var e={};for(var s in xt)e[s]=t&&Je(t,s)?t[s]:xt[s];if(e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),zt(e.onToken)){var i=e.onToken;e.onToken=function(r){return i.push(r)}}return zt(e.onComment)&&(e.onComment=Fi(e,e.onComment)),e}function Fi(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 Qe(this,a,u)),t.ranges&&(c.range=[r,n]),e.push(c)}}var Ne=1,Me=2,Pt=Ne|Me,Is=4,As=8,Ps=16,Ts=32,Rs=64,Ns=128;function Tt(t,e){return Me|(t?Is:0)|(e?As:0)}var Jt=0,Rt=1,Z=2,Os=3,Vs=4,Fs=5,T=function(e,s,i){this.options=e=Vi(e),this.sourceFile=e.sourceFile,this.keywords=le(Ii[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var r="";if(e.allowReserved!==!0){for(var n=e.ecmaVersion;!(r=ut[n]);n--);e.sourceType==="module"&&(r+=" await")}this.reservedWords=le(r);var a=(r?r+" ":"")+ut.strict;this.reservedWordsStrict=le(a),this.reservedWordsStrictBind=le(a+" "+ut.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(Ne),this.regexpState=null},pe={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)};pe.inFunction.get=function(){return(this.currentVarScope().flags&Me)>0};pe.inGenerator.get=function(){return(this.currentVarScope().flags&As)>0};pe.inAsync.get=function(){return(this.currentVarScope().flags&Is)>0};pe.allowSuper.get=function(){return(this.currentThisScope().flags&Rs)>0};pe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ns)>0};pe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};T.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&Me)>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,pe);var M=T.prototype,Li=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;M.strictDirective=function(t){for(;;){q.lastIndex=t,t+=q.exec(this.input)[0].length;var e=Li.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 Ye(){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 Nt={kind:"loop"},ji={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;Se(this.input.charCodeAt(r),!0);)++r;var n=this.input.slice(s,r);if(!Ai.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||!Se(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(Nt),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(Nt),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 Ye,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,Pe|(s?0:vt),!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(ji),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 Mi=[];_.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?Ts:0),this.checkLVal(e.param,s?Vs:Z),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(Nt),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"?Rt:Z,!1)};var Pe=1,vt=2,Ls=4;_.parseFunction=function(t,e,s,i){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===o.star&&e&vt&&this.unexpected(),t.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(t.async=!!i),e&Pe&&(t.id=e&Ls&&this.type!==o.name?null:this.parseIdent(),t.id&&!(e&vt)&&this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?Rt:Z:Os));var r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Tt(t.async,t.generator)),e&Pe||(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&Pe?"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,Z,!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,Pe|Ls,!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&&(Je(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=Mi,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,Z),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,Z),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,Z),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 ee=T.prototype;ee.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};ee.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};ee.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};ee.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")};ee.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()};ee.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};ee.parseBindingListItem=function(t){return t};ee.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")};ee.checkLVal=function(t,e,s){switch(e===void 0&&(e=Jt),t.type){case"Identifier":e===Z&&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&&(Je(s,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),s[t.name]=!0),e!==Jt&&e!==Fs&&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 Ye,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 Ye,p=this.yieldPos,m=this.awaitPos,d=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=d,this.parseArrowExpression(this.startNodeAt(e,s),g,!0);this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=d||this.awaitIdentPos;var v=this.startNodeAt(e,s);v.callee=t,v.arguments=g,a&&(v.optional=u),t=this.finishNode(v,"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 x=this.startNodeAt(e,s);x.tag=t,x.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(x,"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 Ye,p=this.yieldPos,m=this.awaitPos,d;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){d=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,v=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),d&&this.unexpected(d),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,v)):i=u[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var x=this.startNodeAt(e,s);return x.expression=i,this.finishNode(x,"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 Di=[];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=Di,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(Tt(e,i.generator)|Rs|(s?Ns: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(Tt(s,!1)|Ps),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,Fs),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,Rt,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 Ge=T.prototype;Ge.raise=function(t,e){var s=ks(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};Ge.raiseRecoverable=Ge.raise;Ge.curPosition=function(){if(this.options.locations)return new Re(this.curLine,this.pos-this.lineStart)};var oe=T.prototype,Bi=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};oe.enterScope=function(t){this.scopeStack.push(new Bi(t))};oe.exitScope=function(){this.scopeStack.pop()};oe.treatFunctionsAsVarInScope=function(t){return t.flags&Me||!this.inModule&&t.flags&Ne};oe.declareName=function(t,e,s){var i=!1;if(e===Z){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&Ne&&delete this.undefinedExports[t]}else if(e===Vs){var n=this.currentScope();n.lexical.push(t)}else if(e===Os){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&Ts&&c.lexical[0]===t)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(t)>-1){i=!0;break}if(c.var.push(t),this.inModule&&c.flags&Ne&&delete this.undefinedExports[t],c.flags&Pt)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&Pt)return e}};oe.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&Pt&&!(e.flags&Ps))return e}};var Ot=function(e,s,i){this.type="",this.start=s,this.end=0,e.options.locations&&(this.loc=new Qe(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[s,0])},Xe=T.prototype;Xe.startNode=function(){return new Ot(this,this.start,this.startLoc)};Xe.startNodeAt=function(t,e){return new Ot(this,t,e)};function js(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}Xe.finishNode=function(t,e){return js.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Xe.finishNodeAt=function(t,e,s,i){return js.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)},Ze=T.prototype;Ze.initialContext=function(){return[A.b_stat]};Ze.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};Ze.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};Ze.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 Ms="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",Ds=Ms+" Extended_Pictographic",Hi=Ds,Ui={9:Ms,10:Ds,11:Hi},Qt="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",Bs="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",Hs=Bs+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",$i=Hs+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Gi={9:Bs,10:Hs,11:$i},Us={};function Vt(t){var e=Us[t]={binary:le(Ui[t]+" "+Qt),nonBinary:{General_Category:le(Qt),Script:le(Gi[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}Vt(9);Vt(10);Vt(11);var y=T.prototype,te=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=[]};te.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};te.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)};te.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};te.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};te.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)};te.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)};te.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)};te.prototype.eat=function(e,s){return s===void 0&&(s=!1),this.current(s)===e?(this.advance(s),!0):!1};function qe(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 $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+=qe(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=qe(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),qi(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)};function qi(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),Wi(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)};function Wi(t){return Se(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&&!et(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 Gs(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};function Gs(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)&&Ki(t.lastIntValue))return!0;i&&t.raise("Invalid unicode escape"),t.pos=s}return!1};function Ki(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(zi(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 zi(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){Je(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="";qs(e=t.current());)t.lastStringValue+=qe(e),t.advance();return t.lastStringValue!==""};function qs(t){return Gs(t)||t===95}y.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Ji(e=t.current());)t.lastStringValue+=qe(e),t.advance();return t.lastStringValue!==""};function Ji(t){return qs(t)||et(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||zs(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 et(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;et(s=t.current());)t.lastIntValue=10*t.lastIntValue+(s-48),t.advance();return t.pos!==e};function et(t){return t>=48&&t<=57}y.regexp_eatHexDigits=function(t){var e=t.pos,s=0;for(t.lastIntValue=0;Ws(s=t.current());)t.lastIntValue=16*t.lastIntValue+Ks(s),t.advance();return t.pos!==e};function Ws(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Ks(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 zs(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function zs(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(!Ws(r))return t.pos=s,!1;t.lastIntValue=16*t.lastIntValue+Ks(r),t.advance()}return!0};var Ft=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Qe(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 Ft(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 Ft(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){Te.lastIndex=e;for(var i;(i=Te.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&&!je(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&&ws.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 '"+Lt(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 te(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 Qi(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}function Js(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=Js(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=Js(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=Qi(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 Lt(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):(je(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 Qs={};C.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===Qs)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};C.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Qs;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(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+=`
|
|
12
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
|
|
13
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Lt(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 je(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(Se(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:Se)(a,i)||this.invalidStringToken(n,"Invalid Unicode escape"),t+=Lt(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=At[t]),this.finishToken(e,t)};var Yi="7.4.1";T.acorn={Parser:T,version:Yi,defaultOptions:xt,Position:Re,SourceLocation:Qe,getLineInfo:ks,Node:Ot,TokenType:k,tokTypes:o,keywordTypes:At,TokContext:z,tokContexts:A,isIdentifierChar:Se,isIdentifierStart:ae,Token:Ft,isNewLine:je,lineBreak:K,lineBreakG:Te,nonASCIIwhitespace:ws};function Xi(t,e){return T.parse(t,e)}class Zi extends Error{}class er extends SyntaxError{}class bt extends ReferenceError{}class tr extends TypeError{}class Ys extends Zi{}class sr extends er{}class J extends bt{}const F={ExecutionTimeOutError:[3002,"Script execution timed out after %0ms",Ys],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",bt],VariableUndefinedReferenceError:[2002,"%0 is not defined",bt],IsNotConstructor:[2003,"%0 is not a constructor",tr]},ir="1.4.8";function Yt(t,e){Object.defineProperty(t,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}const rr=Object.prototype.hasOwnProperty,de=Symbol("Break"),me=Symbol("Continue"),Xt=Symbol("DefaultCase"),V=Symbol("EmptyStatementReturn"),Zt=Symbol("WithScopeName"),es=Symbol("SuperScopeName"),ts=Symbol("RootScopeName"),ss=Symbol("GlobalScopeName");function lt(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 jt(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(jt,"__IS_EVAL_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});function Mt(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=`
|
|
14
14
|
(function anonymous(${e.join(",")}){
|
|
15
15
|
${i}
|
|
16
16
|
});
|
|
17
|
-
`;return r.evaluate(n)}Object.defineProperty(jt,"__IS_FUNCTION_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});class Y{constructor(e){this.value=e}}class ue{constructor(e){this.value=e}}class ie{constructor(e){this.value=e}}class ge{constructor(e,s=null,i){this.name=i,this.parent=s,this.data=e,this.labelStack=[]}}function He(){}function sr(t=null,e){return new ge(Object.create(null),t,e)}function ir(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:Lt,Function:jt};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 D{constructor(e=D.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||D.ecmaVersion,timeout:s.timeout||0,rootContext:s.rootContext,globalContextInFunction:s.globalContextInFunction===void 0?D.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 ge)s=e;else{let r=null;const n=this.createSuperScope(e);this.options.rootContext&&(r=new ge(ir(this.options.rootContext),n,Xt)),s=new ge(e,r||n,Zt)}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 zs||e instanceof J||e instanceof Zi}createSuperScope(e){let s=Object.assign({},X);return Object.keys(s).forEach(r=>{r in e&&delete s[r]}),new ge(s,null,Yt)}setCurrentContext(e){this.currentContext=e}setCurrentScope(e){this.currentScope=e}evaluate(e=""){let s;if(e)return s=Ji(e,{ranges:!0,locations:!0,ecmaVersion:this.options.ecmaVersion||D.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(V.NodeTypeSyntaxError,e.type,e)}return(...i)=>{const r=this.options.timeout;if(r&&r>0&&this.checkTimeout())throw this.createInternalThrowError(V.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(V.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(V.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(V.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(V.UpdateOperatorSyntaxError,e.operator,e)}}}objectExpressionHandler(e){const s=[];function i(n){return n.type==="Identifier"?n.name:n.type==="Literal"?n.value:this.throwError(V.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(){},d=h.set?h.set():function(g){};if("set"in h||"get"in h)Object.defineProperty(n,l,{configurable:!0,enumerable:!0,get:m,set:d});else{const g=c.property,x=g.kind;g.key.type==="Identifier"&&g.value.type==="FunctionExpression"&&x==="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||!ct(c)){const l=r.slice(e.start,e.end);throw this.createInternalThrowError(V.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||!ct(u))throw this.createInternalThrowError(V.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===Yt||h.name===Zt||h.name===Xt;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===Qt&&(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(),d=function(...g){s.callStack.push(`${a}`);const x=s.getCurrentScope(),v=sr(m,`FunctionScope(${a})`);s.setCurrentScope(v),s.addDeclarationsToScope(h,p,v),a&&(v.data[a]=d),v.data.arguments=arguments,c.forEach((N,E)=>{v.data[N()]=g[E]});const y=s.getCurrentContext();s.setCurrentContext(this);const I=l();if(s.setCurrentContext(y),s.setCurrentScope(x),s.callStack.pop(),I instanceof Y)return I.value};return zt(d,a),Object.defineProperty(d,"length",{value:u,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(d,"toString",{value:()=>i.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(d,"valueOf",{value:()=>i.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),d}}newExpressionHandler(e){const s=this.source,i=this.createClosure(e.callee),r=e.arguments.map(n=>this.createClosure(n));return()=>{const n=i();if(!ct(n)||n.__IS_EVAL_FUNC){const a=e.callee,u=s.slice(a.start,a.end);throw this.createInternalThrowError(V.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(V.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()=>O}getVariableName(e){if(e.type==="Identifier")return e.name;throw this.createInternalThrowError(V.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 O}}assertVariable(e,s,i){if(e===this.globalScope.data&&!(s in e))throw this.createInternalThrowError(V.VariableUndefinedReferenceError,s,i)}programHandler(e){const s=e.body.map(i=>this.createClosure(i));return()=>{let i=O;for(let r=0;r<s.length;r++){const n=s[r],a=this.setValue(n());if(a!==O&&(i=a,i instanceof Y||i instanceof ue||i instanceof ie||i===de||i===me))break}return i}}expressionStatementHandler(e){return this.createClosure(e.expression)}emptyStatementHandler(e){return()=>O}returnStatementHandler(e){const s=e.argument?this.createClosure(e.argument):He;return()=>new Y(s())}ifStatementHandler(e){const s=this.createClosure(e.test),i=this.createClosure(e.consequent),r=e.alternate?this.createClosure(e.alternate):()=>O;return()=>s()?i():r()}conditionalExpressionHandler(e){return this.ifStatementHandler(e)}forStatementHandler(e){let s=He,i=e.test?this.createClosure(e.test):()=>!0,r=He;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):He),a=>{let u,c=O,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===O||h===me)){if(h===de)break;if(c=h,c instanceof ie&&c.value===u){c=O;continue}if(c instanceof Y||c instanceof ue||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=O,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===O||h===me)){if(h===de)break;if(u=h,u instanceof ie&&u.value===a){u=O;continue}if(u instanceof Y||u instanceof ue||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 ge(r,n,Qt);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=O,h,p;const m=()=>{this.setCurrentScope(n),this.setCurrentContext(a),n.labelStack=u,this.callStack=c};try{l=this.setValue(s()),l instanceof Y&&(h=l)}catch(d){if(m(),this.isInterruptThrow(d))throw d;if(i)try{l=this.setValue(i(d)),l instanceof Y&&(h=l)}catch(g){if(m(),this.isInterruptThrow(g))throw g;p=g}}if(r)try{l=r(),l instanceof Y&&(h=l)}catch(d){if(m(),this.isInterruptThrow(d))throw d;p=d}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=tr.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):me}breakStatementHandler(e){return()=>e.label?new ue(e.label.name):de}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](),d=m.testClosure();if(!l&&d===Jt&&(l=!0,c=p),n||d===r){if(n=!0,u=this.setValue(m.bodyClosure()),u===O)continue;if(u===de||(a=u,a instanceof Y||a instanceof ue||a instanceof ie||a===me))break}}if(!n&&l)n=!0;else break}return a}}switchCaseHandler(e){const s=e.test?this.createClosure(e.test):()=>Jt,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 ue&&r.value===s&&(r=O),n.labelStack.pop(),r}}debuggerStatementHandler(e){return()=>{debugger;return O}}createParamNameGetter(e){if(e.type==="Identifier")return()=>e.name;throw this.createInternalThrowError(V.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(V.AssignmentTypeSyntaxError,e.type,e)}}createNameGetter(e){switch(e.type){case"Identifier":return()=>e.name;case"MemberExpression":return this.createMemberKeyGetter(e);default:throw this.createInternalThrowError(V.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===O||e===de||e===me||e instanceof ue||e instanceof ie||(this.value=e instanceof Y?e.value:e),e}getValue(){return this.value}}D.version=er;D.eval=Lt;D.Function=jt;D.ecmaVersion=5;D.globalContextInFunction=void 0;D.global=Object.create(null);const rr=(()=>{try{return new Function("return 1")(),!0}catch{return!1}})();function Oe(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 nr(t,e){return new D(e,{rootContext:e,globalContextInFunction:e}).evaluate(`(function($scope){ ${t} }).call(this, this)`)}function Ce(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(`
|
|
17
|
+
`;return r.evaluate(n)}Object.defineProperty(Mt,"__IS_FUNCTION_FUNC",{value:!0,writable:!1,enumerable:!1,configurable:!1});class Y{constructor(e){this.value=e}}class ue{constructor(e){this.value=e}}class ie{constructor(e){this.value=e}}class ge{constructor(e,s=null,i){this.name=i,this.parent=s,this.data=e,this.labelStack=[]}}function Ue(){}function nr(t=null,e){return new ge(Object.create(null),t,e)}function ar(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:jt,Function:Mt};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 ge)s=e;else{let r=null;const n=this.createSuperScope(e);this.options.rootContext&&(r=new ge(ar(this.options.rootContext),n,ts)),s=new ge(e,r||n,ss)}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 Ys||e instanceof J||e instanceof sr}createSuperScope(e){let s=Object.assign({},X);return Object.keys(s).forEach(r=>{r in e&&delete s[r]}),new ge(s,null,es)}setCurrentContext(e){this.currentContext=e}setCurrentScope(e){this.currentScope=e}evaluate(e=""){let s;if(e)return s=Xi(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(){},d=h.set?h.set():function(g){};if("set"in h||"get"in h)Object.defineProperty(n,l,{configurable:!0,enumerable:!0,get:m,set:d});else{const g=c.property,v=g.kind;g.key.type==="Identifier"&&g.value.type==="FunctionExpression"&&v==="init"&&!g.value.id&&Yt(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||!lt(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||!lt(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===es||h.name===ss||h.name===ts;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===Zt&&(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(),d=function(...g){s.callStack.push(`${a}`);const v=s.getCurrentScope(),x=nr(m,`FunctionScope(${a})`);s.setCurrentScope(x),s.addDeclarationsToScope(h,p,x),a&&(x.data[a]=d),x.data.arguments=arguments,c.forEach((O,E)=>{x.data[O()]=g[E]});const b=s.getCurrentContext();s.setCurrentContext(this);const I=l();if(s.setCurrentContext(b),s.setCurrentScope(v),s.callStack.pop(),I instanceof Y)return I.value};return Yt(d,a),Object.defineProperty(d,"length",{value:u,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(d,"toString",{value:()=>i.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(d,"valueOf",{value:()=>i.slice(e.start,e.end),writable:!0,configurable:!0,enumerable:!1}),d}}newExpressionHandler(e){const s=this.source,i=this.createClosure(e.callee),r=e.arguments.map(n=>this.createClosure(n));return()=>{const n=i();if(!lt(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 Y||i instanceof ue||i instanceof ie||i===de||i===me))break}return i}}expressionStatementHandler(e){return this.createClosure(e.expression)}emptyStatementHandler(e){return()=>V}returnStatementHandler(e){const s=e.argument?this.createClosure(e.argument):Ue;return()=>new Y(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=Ue,i=e.test?this.createClosure(e.test):()=>!0,r=Ue;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):Ue),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===me)){if(h===de)break;if(c=h,c instanceof ie&&c.value===u){c=V;continue}if(c instanceof Y||c instanceof ue||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===me)){if(h===de)break;if(u=h,u instanceof ie&&u.value===a){u=V;continue}if(u instanceof Y||u instanceof ue||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 ge(r,n,Zt);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 Y&&(h=l)}catch(d){if(m(),this.isInterruptThrow(d))throw d;if(i)try{l=this.setValue(i(d)),l instanceof Y&&(h=l)}catch(g){if(m(),this.isInterruptThrow(g))throw g;p=g}}if(r)try{l=r(),l instanceof Y&&(h=l)}catch(d){if(m(),this.isInterruptThrow(d))throw d;p=d}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=rr.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):me}breakStatementHandler(e){return()=>e.label?new ue(e.label.name):de}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](),d=m.testClosure();if(!l&&d===Xt&&(l=!0,c=p),n||d===r){if(n=!0,u=this.setValue(m.bodyClosure()),u===V)continue;if(u===de||(a=u,a instanceof Y||a instanceof ue||a instanceof ie||a===me))break}}if(!n&&l)n=!0;else break}return a}}switchCaseHandler(e){const s=e.test?this.createClosure(e.test):()=>Xt,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 ue&&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===de||e===me||e instanceof ue||e instanceof ie||(this.value=e instanceof Y?e.value:e),e}getValue(){return this.value}}B.version=ir;B.eval=jt;B.Function=Mt;B.ecmaVersion=5;B.globalContextInFunction=void 0;B.global=Object.create(null);const or=(()=>{try{return new Function("return 1")(),!0}catch{return!1}})();function Oe(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 ur(t,e){return new B(e,{rootContext:e,globalContextInFunction:e}).evaluate(`(function($scope){ ${t} }).call(this, this)`)}function Ce(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
18
|
`)+a;const u=r?`
|
|
19
19
|
${a}
|
|
20
|
-
`:`with(${s?"{}":"$scope || {}"}) { ${a} }`;return rr?new Function("$scope",u)(e):nr(u,e)}catch(n){if(f.logger.error("parseExpression.error",n,t,e?.__self??e),n&&(n.info=t.value),Oe(n),i)throw n}}function q(t,e,s=!1,i=!1,r=!1){const n=Ce(t,e,s,i,r);if(typeof n!="function"&&(f.logger.error("parseFunction.error","not a function",t,e?.__self??e),i))throw new Error(`"${t.value}" not a function`);return n}function R(t){return t&&t.type==="JSExpression"}function F(t){return typeof t=="object"&&t&&t.type==="JSFunction"}function Js(t){return R(t)||F(t)}function ar(t){return Js(t)?t.value.startsWith("{")?`(${t.value})`:t.value:JSON.stringify(t)}const or={session:!1,authKey:"Authorization",storageKey:"ACCESS_STORAGE",storagePrefix:"__VTJ_",unauthorized:void 0,auth:"/#/login",redirectParam:"r",unauthorizedCode:401,unauthorizedMessage:"登录已经失效,请重新登录!",noPermissionMessage:"无权限访问该页面",appName:"",statusKey:"code"},Mt=Symbol("access");class et{options;data=null;mode=P.Raw;interceptResponse=!0;isTipShowing=!1;constructor(e){this.options=Object.assign({},or,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&&(f.storage.save(s,e,{type:"local",prefix:i}),r&&f.cookie.set(n,this.data.token))}clear(){const{storageKey:e,storagePrefix:s,session:i,authKey:r}=this.options;this.data=null,f.storage.remove(e,{type:"local",prefix:s}),i&&f.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=f.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=f.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(Mt,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=>f.unRSA(r,s));try{this.data=JSON.parse(i.join(""))}catch(r){console.warn(r)}return}if(typeof e=="string")try{const i=s?f.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=f.storage.get(e,{type:"local",prefix:s});this.setData(i||null)}isLogined(){const{session:e,authKey:s}=this.options;return e&&s?!!f.cookie.get(s):!!this.getToken()}hasRoutePermission(e){if(e.name===ye){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),f.isFunction(r)?(r(),s(!1)):f.isString(r)?s(r):s(!1)}}s(!1),await f.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 f.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 Qs(){return L.inject(Mt,null)}function ur(t={}){const{notify:e,loading:s,settings:i={},Startup:r,access:n,useTitle:a,alert:u}=t;let c=null;return{request:f.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:f.jsonp,notify:e,loading:s,useTitle:a,alert:u,startupComponent:r,access:n?new et({alert:u,...n}):void 0}}function cr(t={}){return new et(t)}function Ys(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?Ce(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(f.merge(n,u||{},{data:a})))}}function Xs(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 Zs(t=[],e=[],s){const i={};for(const r of t){const n=Ys(r,s);i[r.id]=n,i[r.name]=n}for(const r of e)i[r.id]=Xs(r,s);return i}async function ei(t=[],e=globalThis){const s=_e(e);s&&(Dt(e),t.forEach(i=>si(s,i)))}function ti(t,e=globalThis){const s=F(t.mockTemplate)&&t.mockTemplate.value?q(t.mockTemplate,{},!0):void 0,i=_e(e);return async(...r)=>{let n={};if(s)try{n=await s.apply(s,r)}catch(a){f.logger.warn("模拟数据模版异常",a)}return i?.mock(n)}}function si(t,e){if(!e.mock)return;const{url:s,mockTemplate:i,method:r="get",settings:n={}}=e;if(s&&i)try{const a=f.isUrl(s)?new URL(s).pathname:s,u=f.pathToRegexp(`(.*)${a}`,[],{end:!1}),c=new RegExp(u.source+"([?#].*)?$",u.flags),l=f.pathToRegexpMatch(a,{decode:decodeURIComponent}),h=Ce(i,{},!0);t.mock(c,r.toLowerCase(),p=>{const m=f.url.parse(p.url)||{},d=n.type||"form";let g=p.body instanceof FormData?f.formDataToJson(p.body):p.body;if(typeof g=="string")if(d==="json")try{g=JSON.parse(g)}catch(y){console.warn("[Mock.mock]",y)}else g=f.url.parse(g);const x=f.isUrl(p.url)?new URL(p.url).pathname:p.url.split("?")[0],v=l(x)?.params;Object.assign(p,{data:g,params:v,query:m});try{return t.mock(h(p))}catch(y){return console.warn("[mockApi]",c,p,y),null}})}catch(a){console.warn("mockApi",a)}}function Dt(t=globalThis){const e=_e(t);e&&(e._mocked={})}class bt{__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=ve){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;dt.forEach(s=>{this[s]=e[s]||e._?.[s.replace("$","")]||null})}__cleanup(){dt.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 q({type:i,value:r},this)}else return q(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 Ce({type:i,value:r},this)}else return Ce(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 f.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]&&ve.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]&&ve.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 lt=Symbol("vtjBlockChain");function qe(t){const{Vue:e=ve,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 bt({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:{...hr(c.value.props??[],h)},async setup(m={}){const d=c.value.id,g=c.value.name,x=e.inject(lt,null);if(d&&x&&x.has(d)){const se=`检测到区块循环引用: ${g}(${d})`;return console.warn(`[VTJ Renderer] ${se},已中断渲染以防止浏览器崩溃`),Oe(new Error(se)),e.provide(lt,x),{__vtjCircular:!0}}const v=new Set(x||[]);d&&v.add(d),e.provide(lt,v);const y=new bt({mode:i,dsl:c.value,attrs:l});y.$props=y.props=m,c.value.id&&Ke(t.window||globalThis,c.value.id,c.value.css||"",!0);const I=c.value.apiMode==="composition";y.$state=y.state=pr(e,c.value.state??{},y);const N=I?xr(e,c.value.refs??{},y):{},E=I?vr(e,c.value.reactives??{},y):{},H=fr(e,c.value.computed??{},y),fe=dr(c.value.methods??{},y),Ee=mr(e,c.value.inject,y),Q=ii(c.value.dataSources||{},y);let De={};I&&(De=br(c.value.composables??[],y));const it={...m,...N,...E,...Ee,...H,...fe,...Q,...De};if(y.setup(it,e),gr(e,c.value.watch??[],y),I){if(await _r(e,c.value.lifeCycles??{},y,s),c.value.setup){const se=y.__parseFunction(c.value.setup);if(f.isFunction(se))try{await se()}catch(rt){console.warn("[VTJ] Composition setup 执行失败",rt)}}yr(e,c.value.provide??{},y)}return{vtj:y,state:y.$state,...m,...N,...E,...H,...fe}},emits:lr(c.value.emits),expose:["vtj",...c.value.expose||[]],render(){if(this.__vtjCircular)return null;const m=this.vtj||h,d=c.value;if(d.refs)for(const x of Object.keys(d.refs))this[x];if(d.reactives)for(const x of Object.keys(d.reactives)){const v=this[x];if(v&&typeof v=="object")for(const y of Object.keys(v))v[y]}if(d.state){const x=this.state;for(const v of Object.keys(d.state))x[v]}if(d.computed)for(const x of Object.keys(d.computed))this[x];if(d.inject)for(const x of d.inject)this[x.name];if(!d.nodes)return null;const g=d.nodes||[];if(g.length===1)return he(g[0],m,e,u,g);{const x=g.map(v=>he(v,m,e,u,g)).flat();return e.createVNode("div",{},x)}},...c.value.apiMode!=="composition"?Sr(c.value.lifeCycles??{},h):{}});return{renderer:e.markRaw(p),context:h}}function lr(t=[]){return t.map(e=>f.isString(e)?e:e.name)}function hr(t=[],e){const s=i=>i?(Array.isArray(i)?i:[i]).map(n=>ss[n]):void 0;return t.map(i=>f.isString(i)?{name:i}:{name:i.name,type:i.type,required:i.required,default:R(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 pr(t,e,s){return t.reactive(Object.keys(e||{}).reduce((i,r)=>{let n=e[r];return R(n)?n=s.__parseExpression(n):F(n)&&(n=s.__parseFunction(n)),i[r]=n,i},{}))}function fr(t,e,s){return Object.entries(e??{}).reduce((i,[r,n])=>(F(n)?i[r]=t.computed(s.__parseFunction(n)):i[r]=t.computed(s.__parseExpression(n)),i),{})}function dr(t,e){return Object.entries(t??{}).reduce((s,[i,r])=>(s[i]=e.__parseFunction(r),s),{})}function mr(t,e=[],s){return e.reduce((i,r)=>{const{name:n,from:a}=r||{},u=R(a)?s.__parseExpression(a)||n:a??n,c=R(r.default)?s.__parseExpression(r.default):r.default??null;return i[n]=t.inject(u,c),i},{})}function ii(t,e){return Object.keys(t).reduce((s,i)=>{const r=t[i];if(r.type==="mock")s[i]=ti(r);else if(r.ref){const n=e.$apis[r.ref],a=F(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 gr(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 xr(t,e,s){return Object.entries(e).reduce((i,[r,n])=>{const a=R(n)?s.__parseExpression(n):n;return i[r]=t.ref(a),i},{})}function vr(t,e,s){return Object.entries(e).reduce((i,[r,n])=>{const a=R(n)?s.__parseExpression(n):n;return i[r]=t.reactive(a??{}),i},{})}function br(t,e){return t.reduce((s,i)=>{try{let r;if(R(i.composable)?r=e.__parseExpression(i.composable):f.isString(i.composable)&&(r=e.$libs[i.composable]),f.isFunction(r)){const n=(i.args||[]).map(u=>R(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 yr(t,e,s){Object.entries(e).forEach(([i,r])=>{let n=r;R(r)?n=s.__parseExpression(r):F(r)&&(n=s.__parseFunction(r)),t.provide(i,n)})}async function _r(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(f.isFunction(l))try{await l()}catch(h){console.warn(`[VTJ] Composition 生命周期 "${n}" 执行失败`,h),Oe(h)}continue}const u=r[n]||n,c=t[u]||i[u];if(c&&f.isFunction(c)){const l=s.__parseFunction(a);f.isFunction(l)&&c(async()=>{try{await f.delay(0),await l()}catch(h){console.warn(`[VTJ] Composition 生命周期 "${n}" 执行失败`,h),Oe(h)}})}else console.warn(`[VTJ] 无效的 Composition 生命周期钩子 "${n}"`)}}function Sr(t,e){return Object.entries(t??{}).reduce((s,[i,r])=>(s[i]=async function(){const a=(this?.vtj||e).__parseFunction(r);f.isFunction(a)&&(await f.delay(0),await a())},s),{})}class Cr{__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 f.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=>f.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];f.isFunction(h)||(c[l]=h)}return c},n=i(e).sort(),a=i(s).sort();return f.isEqual(n,a)?f.isEqual(r(e),r(s)):!1}clear(){this.__props={},this.__events={},this.__nodes={}}}const xe=new Cr,ri=new f.Queue;let ht=[],ce={},Ie={};const ni=(t,e)=>e;async function Bt(t,e=globalThis){const{urls:s=[],library:i}=t,r=s.filter(u=>Le(u));if(r.length===0||!i)return null;const n=s.filter(u=>Fe(u));return n.length&&wt(n,e),await Et(r,i,e).catch(u=>(console.warn("loadScriptUrl error",r,i,u),null))}function We(t){const{getDsl:e,getDslByUrl:s,options:i}=t;return i.window&&(ht.forEach(r=>{delete i.window[r]}),ht=[]),(r,n,a,u=ve)=>{if(!a||typeof a=="string")return n;let c="";if(a.type==="Schema"&&a.id)return c=a.id+"_"+r,Ie[c]||(Ie[c]=u.defineAsyncComponent(async()=>{const l=ce[a.id]||await ri.add(a.id,()=>e(a.id));return l&&(l.name=n,ce[a.id]=l),l?qe({Vue:u,mode:P.Runtime,...i,dsl:f.cloneDeep(l),loader:We(t)}).renderer:null}));if(a.type==="UrlSchema"&&a.url)return c=a.url+"_"+r,Ie[c]||(Ie[c]=u.defineAsyncComponent(async()=>{const l=ce[a.url]||await s(a.url);return l&&(l.name=n,ce[a.url]=l),l?qe({...i,Vue:u,dsl:f.cloneDeep(l),mode:P.Runtime,loader:We(t)}).renderer:null}));if(a.type==="Plugin"){let l=a.library?ce[a.library]:null;return l||(a.library&&ht.push(a.library),l=ce[a.library||Symbol()]=u.defineAsyncComponent(async()=>{const h=await Bt(a,i.window);return h||(console.warn("getPlugin result is null",a),null)}),l)}return n}}function wr(){ce={},Ie={},ri.clearAllCache(),xe.clear()}function he(t,e,s=ve,i=ni,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:d,vShow:g,vModels:x,vBind:v,vHtml:y,others:I}=ai(l);if(!n&&(p||m))return null;if(h&&!kr(h,e))return Nr(t,e,s,i,r);const N=(E,H=0)=>{const fe=E.$components,Ee=(()=>{if(t.name==="component")return Ir(E,t.props?.is);if(t.name==="slot")return t.name;const K=i(`${t.id}_${H}`,t.name,t.from,s);return f.isString(K)?ds(K)||ms(K)?K:fe[K]??u?.app?.component(K)??K:K})(),Q=Ar(c,t.props??{},E),De=Rr(s,t.id,t.events??{},E);if(t.name==="slot")return Or(s,t,Q,E,i);v&&Object.assign(Q,E.__parseExpression(v.value)),g&&(Q.style=Object.assign(Q.style??{},Fr(g,E))),y&&Object.assign(Q,Lr(y,E)),x.forEach(K=>{St.includes(t.name)?Object.assign(Q,jr(K,E)):Object.assign(Q,Mr(s,K,E))});const it=Dr(s,t.children??[],E,i,t),se=E?.__id?`data-v-${E.__id}`:void 0,rt=se?{[se]:""}:{},hi=E.__mode===P.Design?{"data-vtj":c}:{},{ref:pi,...fi}=Q,Be=`${c}_${H}`,nt={key:Be,...rt,...hi,...fi};xe.isNodeEqual(nt,xe.getNode(Be))||xe.setNode(Be,nt);let at=s.createVNode(Ee,{...xe.getNode(Be)||nt,ref:pi,...De},it);const Gt=u?Er(u,I,E):[];return Gt.length&&(at=s.withDirectives(at,Gt)),at};return d?Ur(d,N,e):N(e,a)}function Er(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 ai(t=[]){const e=t.find(h=>f.camelCase(h.name)==="vIf"),s=t.find(h=>f.camelCase(h.name)==="vElseIf"),i=t.find(h=>f.camelCase(h.name)==="vElse"),r=t.find(h=>f.camelCase(h.name)==="vFor"),n=t.find(h=>f.camelCase(h.name)==="vShow"),a=t.find(h=>f.camelCase(h.name)==="vBind"),u=t.find(h=>f.camelCase(h.name)==="vHtml"),c=t.filter(h=>f.camelCase(h.name)==="vModel"),l=t.filter(h=>!ts.includes(f.camelCase(h.name)));return{vIf:e,vElseIf:s,vElse:i,vFor:r,vShow:n,vModels:c,vBind:a,others:l,vHtml:u}}function kr(t,e){return!!e.__parseExpression(t.value)}function Ir(t,e){return e?R(e)?t.__parseExpression(e):e:"div"}function Ar(t,e,s){const i=yt(e,s);return i.ref=s.__ref(t,i.ref),i}function yt(t,e){return R(t)?e.__parseExpression(t):F(t)?e.__parseFunction(t):Array.isArray(t)?t.map(s=>yt(s,e)):typeof t=="object"?Object.keys(t||{}).reduce((s,i)=>{let r=t[i];return s[i]=yt(r,e),s},{}):t}function Pr(t,e){return s=>{s?.key?.toLowerCase()===e.toLowerCase()&&t(s)}}function Tr(t){return gs(t.value)?t:xs(t.value)?{type:"JSFunction",value:`(...args) => (() => {
|
|
20
|
+
`:`with(${s?"{}":"$scope || {}"}) { ${a} }`;return or?new Function("$scope",u)(e):ur(u,e)}catch(n){if(f.logger.error("parseExpression.error",n,t,e?.__self??e),n&&(n.info=t.value),Oe(n),i)throw n}}function W(t,e,s=!1,i=!1,r=!1){const n=Ce(t,e,s,i,r);if(typeof n!="function"&&(f.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 Xs(t){return N(t)||L(t)}function cr(t){return Xs(t)?t.value.startsWith("{")?`(${t.value})`:t.value:JSON.stringify(t)}const lr={session:!1,authKey:"Authorization",storageKey:"ACCESS_STORAGE",storagePrefix:"__VTJ_",unauthorized:void 0,auth:"/#/login",redirectParam:"r",unauthorizedCode:401,unauthorizedMessage:"登录已经失效,请重新登录!",noPermissionMessage:"无权限访问该页面",appName:"",statusKey:"code"},Dt=Symbol("access");class tt{options;data=null;mode=P.Raw;interceptResponse=!0;isTipShowing=!1;constructor(e){this.options=Object.assign({},lr,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&&(f.storage.save(s,e,{type:"local",prefix:i}),r&&f.cookie.set(n,this.data.token))}clear(){const{storageKey:e,storagePrefix:s,session:i,authKey:r}=this.options;this.data=null,f.storage.remove(e,{type:"local",prefix:s}),i&&f.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=f.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=f.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(Dt,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=>f.unRSA(r,s));try{this.data=JSON.parse(i.join(""))}catch(r){console.warn(r)}return}if(typeof e=="string")try{const i=s?f.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=f.storage.get(e,{type:"local",prefix:s});this.setData(i||null)}isLogined(){const{session:e,authKey:s}=this.options;return e&&s?!!f.cookie.get(s):!!this.getToken()}hasRoutePermission(e){if(e.name===ye){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),f.isFunction(r)?(r(),s(!1)):f.isString(r)?s(r):s(!1)}}s(!1),await f.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 f.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 Zs(){return j.inject(Dt,null)}function hr(t={}){const{notify:e,loading:s,settings:i={},Startup:r,access:n,useTitle:a,alert:u}=t;let c=null;return{request:f.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:f.jsonp,notify:e,loading:s,useTitle:a,alert:u,startupComponent:r,access:n?new tt({alert:u,...n}):void 0}}function pr(t={}){return new tt(t)}function ei(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?Ce(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(f.merge(n,u||{},{data:a})))}}function ti(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 si(t=[],e=[],s){const i={};for(const r of t){const n=ei(r,s);i[r.id]=n,i[r.name]=n}for(const r of e)i[r.id]=ti(r,s);return i}async function ii(t=[],e=globalThis){const s=_e(e);s&&(Bt(e),t.forEach(i=>ni(s,i)))}function ri(t,e=globalThis){const s=L(t.mockTemplate)&&t.mockTemplate.value?W(t.mockTemplate,{},!0):void 0,i=_e(e);return async(...r)=>{let n={};if(s)try{n=await s.apply(s,r)}catch(a){f.logger.warn("模拟数据模版异常",a)}return i?.mock(n)}}function ni(t,e){if(!e.mock)return;const{url:s,mockTemplate:i,method:r="get",settings:n={}}=e;if(s&&i)try{const a=f.isUrl(s)?new URL(s).pathname:s,u=f.pathToRegexp(`(.*)${a}`,[],{end:!1}),c=new RegExp(u.source+"([?#].*)?$",u.flags),l=f.pathToRegexpMatch(a,{decode:decodeURIComponent}),h=Ce(i,{},!0);t.mock(c,r.toLowerCase(),p=>{const m=f.url.parse(p.url)||{},d=n.type||"form";let g=p.body instanceof FormData?f.formDataToJson(p.body):p.body;if(typeof g=="string")if(d==="json")try{g=JSON.parse(g)}catch(b){console.warn("[Mock.mock]",b)}else g=f.url.parse(g);const v=f.isUrl(p.url)?new URL(p.url).pathname:p.url.split("?")[0],x=l(v)?.params;Object.assign(p,{data:g,params:x,query:m});try{return t.mock(h(p))}catch(b){return console.warn("[mockApi]",c,p,b),null}})}catch(a){console.warn("mockApi",a)}}function Bt(t=globalThis){const e=_e(t);e&&(e._mocked={})}class yt{__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=ve){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;mt.forEach(s=>{this[s]=e[s]||e._?.[s.replace("$","")]||null})}__cleanup(){mt.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 Ce({type:i,value:r},this)}else return Ce(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 f.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]&&ve.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]&&ve.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 ht=Symbol("vtjBlockChain");function We(t){const{Vue:e=ve,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 yt({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:{...dr(c.value.props??[],h)},async setup(m={}){const d=c.value.id,g=c.value.name,v=e.inject(ht,null);if(d&&v&&v.has(d)){const se=`检测到区块循环引用: ${g}(${d})`;return console.warn(`[VTJ Renderer] ${se},已中断渲染以防止浏览器崩溃`),Oe(new Error(se)),e.provide(ht,v),{__vtjCircular:!0}}const x=new Set(v||[]);d&&x.add(d),e.provide(ht,x);const b=new yt({mode:i,dsl:c.value,attrs:l});b.$props=b.props=m,c.value.id&&ze(t.window||globalThis,c.value.id,c.value.css||"",!0);const I=c.value.apiMode==="composition";b.$state=b.state=mr(e,c.value.state??{},b);const O=I?yr(e,c.value.refs??{},b):{},E=I?_r(e,c.value.reactives??{},b):{},U=gr(e,c.value.computed??{},b),fe=xr(c.value.methods??{},b),Ee=vr(e,c.value.inject,b),Q=ai(c.value.dataSources||{},b);let De={};I&&(De=Sr(c.value.composables??[],b));const rt={...m,...O,...E,...Ee,...U,...fe,...Q,...De};if(b.setup(rt,e),br(e,c.value.watch??[],b),I){if(await wr(e,c.value.lifeCycles??{},b,s),c.value.setup){const se=b.__parseFunction(c.value.setup);if(f.isFunction(se))try{await se()}catch(nt){console.warn("[VTJ] Composition setup 执行失败",nt)}}Cr(e,c.value.provide??{},b)}return{vtj:b,state:b.$state,...m,...O,...E,...U,...fe}},emits:fr(c.value.emits),expose:["vtj",...c.value.expose||[]],render(){if(this.__vtjCircular)return null;const m=this.vtj||h,d=c.value;if(d.refs)for(const x of Object.keys(d.refs))this[x];if(d.reactives)for(const x of Object.keys(d.reactives)){const b=this[x];if(b&&typeof b=="object")for(const I of Object.keys(b))b[I]}if(d.state){const x=this.state;for(const b of Object.keys(d.state))x[b]}if(d.computed)for(const x of Object.keys(d.computed))this[x];if(d.inject)for(const x of d.inject)this[x.name];if(!d.nodes)return null;const g=d.nodes||[];let v;if(g.length===1)v=he(g[0],m,e,u,g);else{const x=g.map(b=>he(b,m,e,u,g)).flat();v=e.createVNode("div",{},x)}return m!==h&&(h.__contextRefs=m.__contextRefs),v},...c.value.apiMode!=="composition"?Er(c.value.lifeCycles??{},h):{}});return{renderer:e.markRaw(p),context:h}}function fr(t=[]){return t.map(e=>f.isString(e)?e:e.name)}function dr(t=[],e){const s=i=>i?(Array.isArray(i)?i:[i]).map(n=>ns[n]):void 0;return t.map(i=>f.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 mr(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 gr(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 vr(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 ai(t,e){return Object.keys(t).reduce((s,i)=>{const r=t[i];if(r.type==="mock")s[i]=ri(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 br(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 yr(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 _r(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 Sr(t,e){return t.reduce((s,i)=>{try{let r;if(N(i.composable)?r=e.__parseExpression(i.composable):f.isString(i.composable)&&(r=e.$libs[i.composable]),f.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 Cr(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 wr(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(f.isFunction(l))try{await l()}catch(h){console.warn(`[VTJ] Composition 生命周期 "${n}" 执行失败`,h),Oe(h)}continue}const u=r[n]||n,c=t[u]||i[u];if(c&&f.isFunction(c)){const l=s.__parseFunction(a);f.isFunction(l)&&c(async()=>{try{await f.delay(0),await l()}catch(h){console.warn(`[VTJ] Composition 生命周期 "${n}" 执行失败`,h),Oe(h)}})}else console.warn(`[VTJ] 无效的 Composition 生命周期钩子 "${n}"`)}}function Er(t,e){return Object.entries(t??{}).reduce((s,[i,r])=>(s[i]=async function(){const a=(this?.vtj||e).__parseFunction(r);f.isFunction(a)&&(await f.delay(0),await a())},s),{})}class kr{__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 f.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=>f.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];f.isFunction(h)||(c[l]=h)}return c},n=i(e).sort(),a=i(s).sort();return f.isEqual(n,a)?f.isEqual(r(e),r(s)):!1}clear(){this.__props={},this.__events={},this.__nodes={}}}const xe=new kr,oi=new f.Queue;let pt=[],ce={},Ie={};const ui=(t,e)=>e;async function Ht(t,e=globalThis){const{urls:s=[],library:i}=t,r=s.filter(u=>Le(u));if(r.length===0||!i)return null;const n=s.filter(u=>Fe(u));return n.length&&Et(n,e),await kt(r,i,e).catch(u=>(console.warn("loadScriptUrl error",r,i,u),null))}function Ke(t){const{getDsl:e,getDslByUrl:s,options:i}=t;return i.window&&(pt.forEach(r=>{delete i.window[r]}),pt=[]),(r,n,a,u=ve)=>{if(!a||typeof a=="string")return n;let c="";if(a.type==="Schema"&&a.id)return c=a.id+"_"+r,Ie[c]||(Ie[c]=u.defineAsyncComponent(async()=>{const l=ce[a.id]||await oi.add(a.id,()=>e(a.id));return l&&(l.name=n,ce[a.id]=l),l?We({Vue:u,mode:P.Runtime,...i,dsl:f.cloneDeep(l),loader:Ke(t)}).renderer:null}));if(a.type==="UrlSchema"&&a.url)return c=a.url+"_"+r,Ie[c]||(Ie[c]=u.defineAsyncComponent(async()=>{const l=ce[a.url]||await s(a.url);return l&&(l.name=n,ce[a.url]=l),l?We({...i,Vue:u,dsl:f.cloneDeep(l),mode:P.Runtime,loader:Ke(t)}).renderer:null}));if(a.type==="Plugin"){let l=a.library?ce[a.library]:null;return l||(a.library&&pt.push(a.library),l=ce[a.library||Symbol()]=u.defineAsyncComponent(async()=>{const h=await Ht(a,i.window);return h||(console.warn("getPlugin result is null",a),null)}),l)}return n}}function Ir(){ce={},Ie={},oi.clearAllCache(),xe.clear()}function he(t,e,s=ve,i=ui,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:d,vShow:g,vModels:v,vBind:x,vHtml:b,others:I}=ci(l);if(!n&&(p||m))return null;if(h&&!Pr(h,e))return Fr(t,e,s,i,r);const O=(E,U=0)=>{const fe=E.$components,Ee=(()=>{if(t.name==="component")return Tr(E,t.props?.is);if(t.name==="slot")return t.name;const R=i(`${t.id}_${U}`,t.name,t.from,s);return f.isString(R)?xs(R)||vs(R)?R:fe[R]??u?.app?.component(R)??R:R})(),Q=Rr(c,t.props??{},E),De=Vr(s,t.id,t.events??{},E);if(t.name==="slot")return Lr(s,t,Q,E,i);x&&Object.assign(Q,E.__parseExpression(x.value)),g&&(Q.style=Object.assign(Q.style??{},Mr(g,E))),b&&Object.assign(Q,Dr(b,E)),v.forEach(R=>{Ct.includes(t.name)?Object.assign(Q,Br(R,E)):Object.assign(Q,Hr(s,R,E))});const rt=Ur(s,t.children??[],E,i,t),se=E?.__id?`data-v-${E.__id}`:void 0,nt=se?{[se]:""}:{},di=E.__mode===P.Design?{"data-vtj":c}:{},{ref:mi,...Be}=Q,gi=Object.keys(Be).filter(R=>R.startsWith("on")),qt={},Wt={};for(const R of Object.keys(Be))gi.includes(R)?qt[R]=Be[R]:Wt[R]=Be[R];const He=`${c}_${U}`,at={key:He,...nt,...di,...Wt};xe.isNodeEqual(at,xe.getNode(He))||xe.setNode(He,at);let ot=s.createVNode(Ee,{...xe.getNode(He)||at,ref:mi,...qt,...De},rt);const Kt=u?Ar(u,I,E):[];return Kt.length&&(ot=s.withDirectives(ot,Kt)),ot};return d?qr(d,O,e):O(e,a)}function Ar(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 ci(t=[]){const e=t.find(h=>f.camelCase(h.name)==="vIf"),s=t.find(h=>f.camelCase(h.name)==="vElseIf"),i=t.find(h=>f.camelCase(h.name)==="vElse"),r=t.find(h=>f.camelCase(h.name)==="vFor"),n=t.find(h=>f.camelCase(h.name)==="vShow"),a=t.find(h=>f.camelCase(h.name)==="vBind"),u=t.find(h=>f.camelCase(h.name)==="vHtml"),c=t.filter(h=>f.camelCase(h.name)==="vModel"),l=t.filter(h=>!rs.includes(f.camelCase(h.name)));return{vIf:e,vElseIf:s,vElse:i,vFor:r,vShow:n,vModels:c,vBind:a,others:l,vHtml:u}}function Pr(t,e){return!!e.__parseExpression(t.value)}function Tr(t,e){return e?N(e)?t.__parseExpression(e):e:"div"}function Rr(t,e,s){const i=_t(e,s);return i.ref=s.__ref(t,i.ref),i}function _t(t,e){return N(t)?e.__parseExpression(t):L(t)?e.__parseFunction(t):Array.isArray(t)?t.map(s=>_t(s,e)):typeof t=="object"?Object.keys(t||{}).reduce((s,i)=>{let r=t[i];return s[i]=_t(r,e),s},{}):t}function Nr(t,e){return s=>{s?.key?.toLowerCase()===e.toLowerCase()&&t(s)}}function Or(t){return bs(t.value)?t:ys(t.value)?{type:"JSFunction",value:`(...args) => (() => {
|
|
21
21
|
return (($event) => {
|
|
22
22
|
${t.value}
|
|
23
23
|
}).apply(this, args);
|
|
24
|
-
})()`}:
|
|
24
|
+
})()`}:_s(t.value)?{type:"JSFunction",value:`() => { ${t.value}}`}:t}function Vr(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=Ut(l.modifiers),p=h.find(g=>r.includes(g)),m="on"+f.upperFirstCamelCase(c)+(p&&n[p]||""),d=l.handler?i.__parseFunction(Or(l.handler)):null;return d&&(u[m]=t.withModifiers(h.includes("enter")?Nr(d,"enter"):d,h)),u},{})}function Fr(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],{vElseIf:c,vElse:l}=ci(u);if(c){if(e.__parseExpression(c.value))return he(r[a],e,s,i,r,!0);continue}if(l)return he(r[a],e,s,i,r,!0)}return null}function Ut(t={},e=!1){const s=Object.keys(t);return e?s.map(i=>"."+i):s}function Lr(t,e,s,i,r){const{children:n}=e,a=jr(e,i),u=i.$slots?.[a.name];return u?u(s):n?f.isString(n)?t.createTextVNode(n):N(n)?t.createTextVNode(wt(i.__parseExpression(n))):Array.isArray(n)?n.map((c,l)=>he(c,i,t,r,n,!1,l)):null:null}function jr(t,e){const{props:s}=t,i=s?.name||"default";return{name:N(i)?e.__parseExpression(i):i,params:[]}}function Mr(t,e){return e.__parseExpression(t.value)?{}:{display:"none"}}function Dr(t,e){return{innerHTML:e.__parseExpression(t.value)||""}}function Br(t,e){const s={type:"JSFunction",value:t.value?.value?`(v) => {
|
|
25
25
|
${t.value.value} = v?.target.value;
|
|
26
|
-
}`:"(v) => {}"};return{[
|
|
26
|
+
}`:"(v) => {}"};return{[N(t.arg)?e.__parseExpression(t.arg):t.arg||"value"]:e.__parseExpression(t.value),onInput:e.__parseFunction(s)}}function Hr(t,e,s){const i={type:"JSFunction",value:e.value?.value?`(v) => {
|
|
27
27
|
${e.value.value} = v;
|
|
28
|
-
}`:"(v) => {}"},r=s.__parseFunction(i),n=Ht(R(e.modifiers)?s.__parseExpression(e.modifiers):e.modifiers),a=R(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 Dr(t,e,s,i,r){if(!e)return null;if(f.isString(e))return{default:()=>e};if(R(e))return{default:()=>Ct(s.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const n=Br(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 d=h.length?f.pick(m??{},h):a(m,p);return l.map((g,x)=>he(g,s.__clone(d),t,i,l,!1,x))},u),{})}return null}function Br(t){const e={};for(const s of t){const i=Hr(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 Hr(t="default"){return f.isString(t)?{name:t,params:[],scope:""}:{params:[],scope:"",...t}}function Ur(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 pt=L.defineComponent({name:"VtjPageContainer",async setup(){const t=$t(),e=es.useRoute(),s=e.meta.__vtj__||e.params.id,i=s?t.getPage(s):t.getHomepage(),r=i?await t.getRenderComponent(i.id):null,n=L.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?L.h(t,{...e,key:s}):L.h("div",{style:{padding:"10px"}},"找不到组件,组件不存在或未发布!")},activated(){this.meta.cache===!1&&(this.sid=Symbol())}}),$r=L.defineComponent({name:"VtjStartupContainer",render(){return L.h("div","page not found!")}});function Ve(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=Ve(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?Ve(t,e,c):void 0};i.push(p)}}return i}function Ut(t,e){if(!e)return t;let s=[];for(const i of t)if(i.children&&i.children.length){const r=Ut(i.children,e);r.length&&(i.children=r,s.push(i))}else e.can(i.id.toString())&&s.push(i);return s}function Gr(t){const{menuPathPrefix:e="",pageRouteName:s="page",disableMenusFilter:i=!1}=t||{},r=$t(),n=es.useRoute(),a=Qs(),u=L.ref(!1),c=L.ref(!1),l=r.project,h=(d,g)=>{u.value=!d?.mask,c.value=g?.pure??!!d?.pure};L.watchEffect(()=>{const{name:d,params:g,meta:x}=n;if(d===ye){const v=r.getPage(g.id);h(v,x)}else if(d===Ae){const v=r.getHomepage();h(v,x)}else{const v=x.__vtj__;if(v){const y=r.getPage(v);h(y,x)}else u.value=!x.mask,c.value=!!x.pure}});const p=Ve(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:Ut(p,a),pure:c}}function ft(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 _t(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:d,children:g,meta:x}=l;if(m){const v=_t({name:e,prefix:s,component:r,routeMeta:a,homepage:u,loader:n,pages:g||[]});c.push(...v)}else if(d){const v=_t({name:e,prefix:s,component:r,routeMeta:a,homepage:u,loader:n,pages:g||[]}),y={name:`layout_${h}`,path:s,component:()=>n(h),meta:{title:p,...a,...x,__vtj__:h},children:v};c.push(y),c.push(ft(l,t))}else if(c.push(ft(l,t)),u===h){const v=ft(l,t);v.path="",v.name=`home_${h}`,c.push(v)}}return c}function qr(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,Ke(n,"global-css",s||""),h&&i&&Wr(i,a,h),zr(a,c,t),!c.access&&t.access&&Kr(t.access,a,l,c),Jr(a,t),r&&Qr(r,a,u)}function Wr(t,e,s){if(!e.config.globalProperties.$pinia){const i=s.createPinia();e.use(i)}if(F(t)&&t.value){const i=q(t,{},!1,!1,!0),r=s.defineStore("$store",i(e)||{});e.config.globalProperties.$store=r()}}function Kr(t,e,s,i){if(F(t)&&t.value){const r=q(t,{},!1,!1,!0),{alert:n,request:a}=i,u=new et({alert:n,storagePrefix:"__VTJ_APP_",...r(e)}),c=e.config.globalProperties.$router;u.connect({mode:s,router:c,request:a}),e.use(u)}}function zr(t,e,s){if(!e.request)return;const{axios:i,request:r,response:n}=s;if(i&&F(i)&&i.value){const a=q(i,{},!1,!1,!0);e.request.setConfig(a(t))}if(r&&F(r)&&r.value){const a=q(r,{},!1,!1,!0),u=e.request;u.__unReq&&u.__unReq(),u.__unReq=e.request.useRequest(c=>a(c,t))}if(n&&F(n)&&n.value){const a=q(n,{},!1,!1,!0),u=e.request;u.__unRes&&u.__unRes(),u.__unRes=e.request.useResponse(c=>a(c,t))}}function Jr(t,e){const{beforeEach:s,afterEach:i}=e,r=t.config.globalProperties.$router;if(s&&F(s)&&s.value){const n=q(s,{},!1,!1,!0);r&&r.beforeEach((a,u,c)=>n(a,u,c,t))}if(i&&F(i)&&i.value){const n=q(i,{},!1,!1,!0);r&&r.afterEach((a,u,c)=>n(a,u,c,t))}}function Qr(t,e,s={}){F(t)&&t.value&&q(t,{},!1,!1,!0)(e,s)}function Yr(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 tt=Symbol("Provider");var oi=(t=>(t.Production="production",t.Development="development",t))(oi||{});class ui 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:d,request:g}=this.adapter;d&&d.connect({mode:i,router:h,request:g}),a&&i!==P.Design?this.load(a):this.project=a}mode;globals={};modules={};adapter={request:f.request,jsonp:f.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){f.logger.warn("模拟数据模版异常",n)}const r=_e();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=Zs(r,n,this.adapter),Dt(u),ei(r,u),e.platform!=="uniapp"&&this.initRouter(),this.triggerReady()}initMock(e){const s=_e(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:d,libraryLocaleMap:g}=as(s,a,u==="development");Object.assign(this.libraryLocaleMap,g);for(const x of l){const v=i[x],y=e[x];if(y)r[x]=y;else if(v)e[x]=r[x]=await v();else{const N=h[x]||[];for(const E of N)Fe(E)&&await ps(E,f.url.append(E,{v:be})),Le(E)&&await f.loadScript(f.url.append(E,{v:be}));r[x]=e[x]}const I=g[x];if(I){const N=i[I];c[I]=N?await N():e[I]}}if(u==="development"){for(const v of p)await f.loadScript(f.url.append(v,{v:be}));const x=this.materials||{};for(const v of m){const y=e[d[v]],I=y?.default||y,N=ne.BUILT_IN_COMPONENTS[v];if(N)I&&N.forEach(E=>{n[E]=I[E]});else{const E=x[v]?(await x[v]()).default:e[v];E&&I&&(E.components||[]).forEach(H=>{n[H.name]=os(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:ye,component:pt},p=this.getHomepage(),m={path:l,name:Ae,component:p?pt:r.startupComponent||$r,meta:c};if(e.hasRoute(ye)&&e.removeRoute(ye),e.hasRoute(Ae)&&e.removeRoute(Ae),i.enableStaticRoute){const d=s?.pages||[];_t({name:u,prefix:l,pages:d,component:pt,loader:this.getRenderComponent.bind(this),homepage:p?.id}).forEach(x=>{a?e.addRoute(a,x):e.addRoute(x)}),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=f.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]&&fs(u)){const l={locale:i[s[a]]},h=r[a]||{},p={...l,...h};e.use(u,p),n[a]=!0}e.provide(tt,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 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,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=We({getDsl:async l=>await this.getDsl(l)||null,getDslByUrl:async l=>await this.getDslByUrl(l)||null,options:u});return qe({...u,dsl:e,loader:c})}async getRenderComponent(e,s){const i=this.getFile(e);if(!i)return f.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:(f.logger.warn(`Can not find dsl: ${e}`),null)}defineUrlSchemaComponent(e,s){return L.defineAsyncComponent(async()=>{const i=await this.getDslByUrl(e);return i?(i.name=s||i.name,this.createDslRenderer(i).renderer):null})}definePluginComponent(e){return L.defineAsyncComponent(async()=>await Bt(e,globalThis))}initGlobals(e,s){const i=Object.assign({adapter:this.adapter,window:globalThis},s);qr(e,i)}initI18n(e,s,i){Yr(e,s,i)}initEnv(e=[]){this.env=e.reduce((s,i)=>(s[i.name]=i[this.nodeEnv],s),{})}}function Xr(t){const e=new ui(t);return{provider:e,onReady:i=>e.ready(i)}}function $t(t={}){const e=L.inject(tt,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 we(){return L.inject(tt,null)?.globals??{}}function Zr(){return we().$store||{}}function en(){return we().$pinia||{}}function tn(){return we().$request}function sn(){return we().$libs||{}}function rn(){return we().$apis||{}}async function nn(t,e=""){const{name:s,urls:i=[]}=t||{},r=i.map(u=>e+u),{css:n,js:a}=us(r);if(n.length&&wt(n),a.length)return await Et(a,s).catch(()=>{})}const ci={type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:t=>t.data?.code===0},an=(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:ci}),on=(t,e="/__vtj__/api/uploader.json")=>async(s,i)=>await t.send({url:e,method:"post",data:{files:s,projectId:i},settings:{...ci,type:"data"}}).then(r=>r&&r[0]?r[0]:null).catch(()=>null);function un(t){return f.createRequest({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>e.data?.code===0,showError:e=>{t&&t(e||"未知错误")}}})}class st{constructor(e=f.request){this.req=e,this.api=an(e),this.uploader=on(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=>rs(n))[0];if(!i)return null;const r=this.pluginCaches[i];return r||(this.pluginCaches[i]=f.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 M=new f.Storage({type:"local",expired:0,prefix:"__VTJ_"});class cn extends st{init(e){const s=new ne.ProjectModel(e),i=M.get(`project_${s.id}`),r=Object.assign(s.toDsl(),i||{});return M.save(`project_${s.id}`,r),Promise.resolve(r)}saveProject(e){const s=new ne.ProjectModel(e);return M.save(`project_${s.id}`,s.toDsl()),Promise.resolve(!0)}saveMaterials(e,s){return M.save(`materials_${e.id}`,f.mapToObject(s)),Promise.resolve(!0)}saveFile(e){return M.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const s=M.get(`file_${e}`);return s?Promise.resolve(s):Promise.reject(null)}removeFile(e){return M.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return M.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const s=M.get(`history_${e}`);if(s){const r=(s.items||[]).map(n=>n.id);this.removeHistoryItem(e,r),M.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const s=M.get(`history_${e}`),i=new ne.HistoryModel(s||{id:e});return Promise.resolve(i.toDsl())}getHistoryItem(e,s){const i=M.get(`history_${e}_${s}`);return Promise.resolve(i)}saveHistoryItem(e,s){return M.save(`history_${e}_${s.id}`,s),Promise.resolve(!0)}removeHistoryItem(e,s){return s.forEach(i=>{M.remove(`history_${e}_${i}`)}),Promise.resolve(!0)}}class li extends st{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]=f.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 Ue=null;function ln(){return Ue||(Ue=new li,Ue)}class hn extends st{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:f.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=vi;exports.ACCESS_KEY=Mt;exports.Access=et;exports.BUILD_IN_TAGS=is;exports.BUILT_IN_DIRECTIVES=ts;exports.BaseService=st;exports.COMPOSITION_HOOKS_LIST=gi;exports.CONTEXT_HOST=dt;exports.Context=bt;exports.ContextMode=P;exports.DATA_TYPES=ss;exports.HOMEPAGE_ROUTE_NAME=Ae;exports.HTML_TAGS=St;exports.JSCodeToString=ar;exports.LIFE_CYCLES_LIST=mi;exports.LocalService=hn;exports.MemoryService=li;exports.NodeEnv=oi;exports.PAGE_ROUTE_NAME=ye;exports.Provider=ui;exports.REMOTE=xi;exports.StorageService=cn;exports.VTJ_RENDERER_VERSION=be;exports.adoptStylesToInline=Si;exports.adoptedStyleSheets=Ke;exports.clearLoaderCache=wr;exports.compileScopedCSS=cs;exports.convertCssRpx=hs;exports.createAccess=cr;exports.createAdapter=ur;exports.createAssetScripts=bi;exports.createAssetsCss=yi;exports.createDataSources=ii;exports.createLoader=We;exports.createMemoryService=ln;exports.createMenus=Ve;exports.createMetaApi=Xs;exports.createMock=ti;exports.createProvider=Xr;exports.createRenderer=qe;exports.createSchemaApi=Ys;exports.createSchemaApis=Zs;exports.createServiceRequest=un;exports.defaultLoader=ni;exports.fillBasePath=ke;exports.getMock=_e;exports.getModifiers=Ht;exports.getPlugin=Bt;exports.getRawComponent=os;exports.isArrowFunction=gs;exports.isAssignment=vs;exports.isBuiltInTag=ds;exports.isCSSUrl=Fe;exports.isCallFunction=xs;exports.isJSCode=Js;exports.isJSExpression=R;exports.isJSFunction=F;exports.isJSON=rs;exports.isJSUrl=Le;exports.isNativeTag=ms;exports.isVuePlugin=fs;exports.loadCss=ps;exports.loadCssUrl=wt;exports.loadEnhance=nn;exports.loadScriptUrl=Et;exports.menusFilter=Ut;exports.mockApi=si;exports.mockApis=ei;exports.mockCleanup=Dt;exports.nodeCache=xe;exports.nodeRender=he;exports.parseDeps=as;exports.parseExpression=Ce;exports.parseFunction=q;exports.parseUrls=us;exports.providerKey=tt;exports.removeProdFlag=ns;exports.rpxToPx=ls;exports.setupPageSetting=Ci;exports.toString=Ct;exports.triggerError=Oe;exports.useAccess=Qs;exports.useApis=rn;exports.useGlobals=we;exports.useLibs=sn;exports.useMask=Gr;exports.usePinia=en;exports.useProvider=$t;exports.useRequest=tn;exports.useStore=Zr;
|
|
28
|
+
}`:"(v) => {}"},r=s.__parseFunction(i),n=Ut(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 Ur(t,e,s,i,r){if(!e)return null;if(f.isString(e))return{default:()=>e};if(N(e))return{default:()=>wt(s.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const n=$r(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 d=h.length?f.pick(m??{},h):a(m,p);return l.map((g,v)=>he(g,s.__clone(d),t,i,l,!1,v))},u),{})}return null}function $r(t){const e={};for(const s of t){const i=Gr(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 Gr(t="default"){return f.isString(t)?{name:t,params:[],scope:""}:{params:[],scope:"",...t}}function qr(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 ft=j.defineComponent({name:"VtjPageContainer",async setup(){const t=Gt(),e=is.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())}}),Wr=j.defineComponent({name:"VtjStartupContainer",render(){return j.h("div","page not found!")}});function Ve(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=Ve(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?Ve(t,e,c):void 0};i.push(p)}}return i}function $t(t,e){if(!e)return t;let s=[];for(const i of t)if(i.children&&i.children.length){const r=$t(i.children,e);r.length&&(i.children=r,s.push(i))}else e.can(i.id.toString())&&s.push(i);return s}function Kr(t){const{menuPathPrefix:e="",pageRouteName:s="page",disableMenusFilter:i=!1}=t||{},r=Gt(),n=is.useRoute(),a=Zs(),u=j.ref(!1),c=j.ref(!1),l=r.project,h=(d,g)=>{u.value=!d?.mask,c.value=g?.pure??!!d?.pure};j.watchEffect(()=>{const{name:d,params:g,meta:v}=n;if(d===ye){const x=r.getPage(g.id);h(x,v)}else if(d===Ae){const x=r.getHomepage();h(x,v)}else{const x=v.__vtj__;if(x){const b=r.getPage(x);h(b,v)}else u.value=!v.mask,c.value=!!v.pure}});const p=Ve(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:$t(p,a),pure:c}}function dt(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 St(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:d,children:g,meta:v}=l;if(m){const x=St({name:e,prefix:s,component:r,routeMeta:a,homepage:u,loader:n,pages:g||[]});c.push(...x)}else if(d){const x=St({name:e,prefix:s,component:r,routeMeta:a,homepage:u,loader:n,pages:g||[]}),b={name:`layout_${h}`,path:s,component:()=>n(h),meta:{title:p,...a,...v,__vtj__:h},children:x};c.push(b),c.push(dt(l,t))}else if(c.push(dt(l,t)),u===h){const x=dt(l,t);x.path="",x.name=`home_${h}`,c.push(x)}}return c}function zr(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,ze(n,"global-css",s||""),h&&i&&Jr(i,a,h),Yr(a,c,t),!c.access&&t.access&&Qr(t.access,a,l,c),Xr(a,t),r&&Zr(r,a,u)}function Jr(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 Qr(t,e,s,i){if(L(t)&&t.value){const r=W(t,{},!1,!1,!0),{alert:n,request:a}=i,u=new tt({alert:n,storagePrefix:"__VTJ_APP_",...r(e)}),c=e.config.globalProperties.$router;u.connect({mode:s,router:c,request:a}),e.use(u)}}function Yr(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 Xr(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 Zr(t,e,s={}){L(t)&&t.value&&W(t,{},!1,!1,!0)(e,s)}function en(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 st=Symbol("Provider");var li=(t=>(t.Production="production",t.Development="development",t))(li||{});class hi 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:d,request:g}=this.adapter;d&&d.connect({mode:i,router:h,request:g}),a&&i!==P.Design?this.load(a):this.project=a}mode;globals={};modules={};adapter={request:f.request,jsonp:f.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){f.logger.warn("模拟数据模版异常",n)}const r=_e();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=si(r,n,this.adapter),Bt(u),ii(r,u),e.platform!=="uniapp"&&this.initRouter(),this.triggerReady()}initMock(e){const s=_e(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:d,libraryLocaleMap:g}=cs(s,a,u==="development");Object.assign(this.libraryLocaleMap,g);for(const v of l){const x=i[v],b=e[v];if(b)r[v]=b;else if(x)e[v]=r[v]=await x();else{const O=h[v]||[];for(const E of O)Fe(E)&&await ms(E,f.url.append(E,{v:be})),Le(E)&&await f.loadScript(f.url.append(E,{v:be}));r[v]=e[v]}const I=g[v];if(I){const O=i[I];c[I]=O?await O():e[I]}}if(u==="development"){for(const x of p)await f.loadScript(f.url.append(x,{v:be}));const v=this.materials||{};for(const x of m){const b=e[d[x]],I=b?.default||b,O=ne.BUILT_IN_COMPONENTS[x];if(O)I&&O.forEach(E=>{n[E]=I[E]});else{const E=v[x]?(await v[x]()).default:e[x];E&&I&&(E.components||[]).forEach(U=>{n[U.name]=ls(U,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:ye,component:ft},p=this.getHomepage(),m={path:l,name:Ae,component:p?ft:r.startupComponent||Wr,meta:c};if(e.hasRoute(ye)&&e.removeRoute(ye),e.hasRoute(Ae)&&e.removeRoute(Ae),i.enableStaticRoute){const d=s?.pages||[];St({name:u,prefix:l,pages:d,component:ft,loader:this.getRenderComponent.bind(this),homepage:p?.id}).forEach(v=>{a?e.addRoute(a,v):e.addRoute(v)}),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=f.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]&&gs(u)){const l={locale:i[s[a]]},h=r[a]||{},p={...l,...h};e.use(u,p),n[a]=!0}e.provide(st,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 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,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=Ke({getDsl:async l=>await this.getDsl(l)||null,getDslByUrl:async l=>await this.getDslByUrl(l)||null,options:u});return We({...u,dsl:e,loader:c})}async getRenderComponent(e,s){const i=this.getFile(e);if(!i)return f.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:(f.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 Ht(e,globalThis))}initGlobals(e,s){const i=Object.assign({adapter:this.adapter,window:globalThis},s);zr(e,i)}initI18n(e,s,i){en(e,s,i)}initEnv(e=[]){this.env=e.reduce((s,i)=>(s[i.name]=i[this.nodeEnv],s),{})}}function tn(t){const e=new hi(t);return{provider:e,onReady:i=>e.ready(i)}}function Gt(t={}){const e=j.inject(st,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 we(){return j.inject(st,null)?.globals??{}}function sn(){return we().$store||{}}function rn(){return we().$pinia||{}}function nn(){return we().$request}function an(){return we().$libs||{}}function on(){return we().$apis||{}}async function un(t,e=""){const{name:s,urls:i=[]}=t||{},r=i.map(u=>e+u),{css:n,js:a}=hs(r);if(n.length&&Et(n),a.length)return await kt(a,s).catch(()=>{})}const pi={type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:t=>t.data?.code===0},cn=(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:pi}),ln=(t,e="/__vtj__/api/uploader.json")=>async(s,i)=>await t.send({url:e,method:"post",data:{files:s,projectId:i},settings:{...pi,type:"data"}}).then(r=>r&&r[0]?r[0]:null).catch(()=>null);function hn(t){return f.createRequest({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>e.data?.code===0,showError:e=>{t&&t(e||"未知错误")}}})}class it{constructor(e=f.request){this.req=e,this.api=cn(e),this.uploader=ln(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=>os(n))[0];if(!i)return null;const r=this.pluginCaches[i];return r||(this.pluginCaches[i]=f.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 f.Storage({type:"local",expired:0,prefix:"__VTJ_"});class pn extends it{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}`,f.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 fi extends it{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]=f.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 $e=null;function fn(){return $e||($e=new fi,$e)}class dn extends it{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:f.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=_i;exports.ACCESS_KEY=Dt;exports.Access=tt;exports.BUILD_IN_TAGS=as;exports.BUILT_IN_DIRECTIVES=rs;exports.BaseService=it;exports.COMPOSITION_HOOKS_LIST=bi;exports.CONTEXT_HOST=mt;exports.Context=yt;exports.ContextMode=P;exports.DATA_TYPES=ns;exports.HOMEPAGE_ROUTE_NAME=Ae;exports.HTML_TAGS=Ct;exports.JSCodeToString=cr;exports.LIFE_CYCLES_LIST=vi;exports.LocalService=dn;exports.MemoryService=fi;exports.NodeEnv=li;exports.PAGE_ROUTE_NAME=ye;exports.Provider=hi;exports.REMOTE=yi;exports.StorageService=pn;exports.VTJ_RENDERER_VERSION=be;exports.adoptStylesToInline=Ei;exports.adoptedStyleSheets=ze;exports.clearLoaderCache=Ir;exports.compileScopedCSS=ps;exports.convertCssRpx=ds;exports.createAccess=pr;exports.createAdapter=hr;exports.createAssetScripts=Si;exports.createAssetsCss=Ci;exports.createDataSources=ai;exports.createLoader=Ke;exports.createMemoryService=fn;exports.createMenus=Ve;exports.createMetaApi=ti;exports.createMock=ri;exports.createProvider=tn;exports.createRenderer=We;exports.createSchemaApi=ei;exports.createSchemaApis=si;exports.createServiceRequest=hn;exports.defaultLoader=ui;exports.fillBasePath=ke;exports.getMock=_e;exports.getModifiers=Ut;exports.getPlugin=Ht;exports.getRawComponent=ls;exports.isArrowFunction=bs;exports.isAssignment=_s;exports.isBuiltInTag=xs;exports.isCSSUrl=Fe;exports.isCallFunction=ys;exports.isJSCode=Xs;exports.isJSExpression=N;exports.isJSFunction=L;exports.isJSON=os;exports.isJSUrl=Le;exports.isNativeTag=vs;exports.isVuePlugin=gs;exports.loadCss=ms;exports.loadCssUrl=Et;exports.loadEnhance=un;exports.loadScriptUrl=kt;exports.menusFilter=$t;exports.mockApi=ni;exports.mockApis=ii;exports.mockCleanup=Bt;exports.nodeCache=xe;exports.nodeRender=he;exports.parseDeps=cs;exports.parseExpression=Ce;exports.parseFunction=W;exports.parseUrls=hs;exports.providerKey=st;exports.removeProdFlag=us;exports.rpxToPx=fs;exports.setupPageSetting=ki;exports.toString=wt;exports.triggerError=Oe;exports.useAccess=Zs;exports.useApis=on;exports.useGlobals=we;exports.useLibs=an;exports.useMask=Kr;exports.usePinia=rn;exports.useProvider=Gt;exports.useRequest=nn;exports.useStore=sn;
|