pinets 0.3.0 → 0.5.0
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/README.md +3 -0
- package/dist/pinets.dev.browser.js +3739 -1372
- package/dist/pinets.dev.cjs +3734 -1368
- package/dist/pinets.dev.cjs.map +1 -1
- package/dist/pinets.dev.es.js +3688 -1326
- package/dist/pinets.dev.es.js.map +1 -1
- package/dist/pinets.min.browser.js +15 -11
- package/dist/pinets.min.cjs +15 -11
- package/dist/pinets.min.es.js +5 -1
- package/dist/types/Context.class.d.ts +61 -15
- package/dist/types/PineTS.class.d.ts +11 -1
- package/dist/types/namespaces/Core.d.ts +1 -0
- package/dist/types/namespaces/array/methods/from.d.ts +1 -1
- package/dist/types/namespaces/request/methods/security.d.ts +1 -1
- package/dist/types/namespaces/request/types/barmerge.type.d.ts +7 -0
- package/dist/types/namespaces/request/utils/findLTFContextIdx.d.ts +1 -0
- package/dist/types/namespaces/ta/getters/obv.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/accdist.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/alma.d.ts +18 -0
- package/dist/types/namespaces/ta/methods/barssince.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/bb.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/bbw.d.ts +9 -0
- package/dist/types/namespaces/ta/methods/cci.d.ts +20 -0
- package/dist/types/namespaces/ta/methods/cmo.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/cog.d.ts +18 -0
- package/dist/types/namespaces/ta/methods/correlation.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/cross.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/cum.d.ts +14 -0
- package/dist/types/namespaces/ta/methods/dmi.d.ts +24 -0
- package/dist/types/namespaces/ta/methods/falling.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/highestbars.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/iii.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/kc.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/kcw.d.ts +11 -0
- package/dist/types/namespaces/ta/methods/lowestbars.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/macd.d.ts +18 -0
- package/dist/types/namespaces/ta/methods/mfi.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/mode.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/nvi.d.ts +10 -0
- package/dist/types/namespaces/ta/methods/obv.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/percentile_linear_interpolation.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/percentile_nearest_rank.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/percentrank.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/pvi.d.ts +10 -0
- package/dist/types/namespaces/ta/methods/pvt.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/range.d.ts +7 -0
- package/dist/types/namespaces/ta/methods/rising.d.ts +15 -0
- package/dist/types/namespaces/ta/methods/sar.d.ts +12 -0
- package/dist/types/namespaces/ta/methods/stoch.d.ts +21 -0
- package/dist/types/namespaces/ta/methods/supertrend.d.ts +23 -0
- package/dist/types/namespaces/ta/methods/swma.d.ts +14 -0
- package/dist/types/namespaces/ta/methods/tr.d.ts +1 -0
- package/dist/types/namespaces/ta/methods/tsi.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/valuewhen.d.ts +6 -0
- package/dist/types/namespaces/ta/methods/vwap.d.ts +14 -0
- package/dist/types/namespaces/ta/methods/wad.d.ts +11 -0
- package/dist/types/namespaces/ta/methods/wpr.d.ts +17 -0
- package/dist/types/namespaces/ta/methods/wvad.d.ts +7 -0
- package/dist/types/namespaces/ta/ta.index.d.ts +120 -5
- package/dist/types/transpiler/analysis/ScopeManager.d.ts +11 -0
- package/dist/types/transpiler/index.d.ts +4 -1
- package/dist/types/transpiler/transformers/InjectionTransformer.d.ts +6 -0
- package/dist/types/transpiler/transformers/MainTransformer.d.ts +4 -1
- package/dist/types/transpiler/transformers/NormalizationTransformer.d.ts +15 -0
- package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +9 -0
- package/dist/types/transpiler/utils/ASTFactory.d.ts +2 -0
- package/package.json +1 -1
package/dist/pinets.min.cjs
CHANGED
|
@@ -15,17 +15,21 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ri=require("fs"),ai=require("path"),ni=require("url");function mt(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(i){if(i!=="default"){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}}),t.default=e,Object.freeze(t)}var ve=mt(ri),Se=mt(ai),si=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],dt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],oi="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",xt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Le={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"},Me="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",ui={5:Me,"5module":Me+" export import",6:Me+" const class extends export import super"},ci=/^in(stanceof)?$/,pi=new RegExp("["+xt+"]"),li=new RegExp("["+xt+oi+"]");function je(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}return!1}function J(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&pi.test(String.fromCharCode(e)):t===!1?!1:je(e,dt)}function ue(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&li.test(String.fromCharCode(e)):t===!1?!1:je(e,dt)||je(e,si)}var k=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function O(e,t){return new k(e,{beforeExpr:!0,binop:t})}var F={beforeExpr:!0},D={startsExpr:!0},Ge={};function _(e,t){return t===void 0&&(t={}),t.keyword=e,Ge[e]=new k(e,t)}var o={num:new k("num",D),regexp:new k("regexp",D),string:new k("string",D),name:new k("name",D),privateId:new k("privateId",D),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(",",F),semi:new k(";",F),colon:new k(":",F),dot:new k("."),question:new k("?",F),questionDot:new k("?."),arrow:new k("=>",F),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",F),backQuote:new k("`",D),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:O("||",1),logicalAND:O("&&",2),bitwiseOR:O("|",3),bitwiseXOR:O("^",4),bitwiseAND:O("&",5),equality:O("==/!=/===/!==",6),relational:O("</>/<=/>=",7),bitShift:O("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:O("%",10),star:O("*",10),slash:O("/",10),starstar:new k("**",{beforeExpr:!0}),coalesce:O("??",1),_break:_("break"),_case:_("case",F),_catch:_("catch"),_continue:_("continue"),_debugger:_("debugger"),_default:_("default",F),_do:_("do",{isLoop:!0,beforeExpr:!0}),_else:_("else",F),_finally:_("finally"),_for:_("for",{isLoop:!0}),_function:_("function",D),_if:_("if"),_return:_("return",F),_switch:_("switch"),_throw:_("throw",F),_try:_("try"),_var:_("var"),_const:_("const"),_while:_("while",{isLoop:!0}),_with:_("with"),_new:_("new",{beforeExpr:!0,startsExpr:!0}),_this:_("this",D),_super:_("super",D),_class:_("class",D),_extends:_("extends",F),_export:_("export"),_import:_("import",D),_null:_("null",D),_true:_("true",D),_false:_("false",D),_in:_("in",{beforeExpr:!0,binop:7}),_instanceof:_("instanceof",{beforeExpr:!0,binop:7}),_typeof:_("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},$=/\r\n?|\n|\u2028|\u2029/,hi=new RegExp($.source,"g");function ce(e){return e===10||e===13||e===8232||e===8233}function gt(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var a=e.charCodeAt(r);if(ce(a))return r<i-1&&a===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var yt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,U=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,bt=Object.prototype,fi=bt.hasOwnProperty,mi=bt.toString,pe=Object.hasOwn||function(e,t){return fi.call(e,t)},et=Array.isArray||function(e){return mi.call(e)==="[object Array]"},tt=Object.create(null);function re(e){return tt[e]||(tt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ee(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var di=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,de=function(t,i){this.line=t,this.column=i};de.prototype.offset=function(t){return new de(this.line,this.column+t)};var Pe=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function vt(e,t){for(var i=1,r=0;;){var a=gt(e,r,t);if(a<0)return new de(i,t-r);++i,r=a}}var Oe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},it=!1;function xi(e){var t={};for(var i in Oe)t[i]=e&&pe(e,i)?e[i]:Oe[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!it&&typeof console=="object"&&console.warn&&(it=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
19
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),
|
|
20
|
-
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split($).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=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(xe),this.regexpState=null,this.privateNameStack=[]},Y={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};N.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Y.inFunction.get=function(){return(this.currentVarScope().flags&le)>0};Y.inGenerator.get=function(){return(this.currentVarScope().flags&wt)>0&&!this.currentVarScope().inClassFieldInit};Y.inAsync.get=function(){return(this.currentVarScope().flags&We)>0&&!this.currentVarScope().inClassFieldInit};Y.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&ye)return!1;if(t.flags&le)return(t.flags&We)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Y.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&ze)>0||i||this.options.allowSuperOutsideMethod};Y.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Et)>0};Y.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Y.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(le|ye))>0||i};Y.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ye)>0};N.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,a=0;a<t.length;a++)r=t[a](r);return r};N.parse=function(t,i){return new this(i,t).parse()};N.parseExpressionAt=function(t,i,r){var a=new this(r,t,i);return a.nextToken(),a.parseExpression()};N.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(N.prototype,Y);var M=N.prototype,yi=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;M.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){U.lastIndex=e,e+=U.exec(this.input)[0].length;var t=yi.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){U.lastIndex=e+t[0].length;var i=U.exec(this.input),r=i.index+i[0].length,a=this.input.charAt(r);return a===";"||a==="}"||$.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(a)||a==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,U.lastIndex=e,e+=U.exec(this.input)[0].length,this.input[e]===";"&&e++}};M.eat=function(e){return this.type===e?(this.next(),!0):!1};M.isContextual=function(e){return this.type===o.name&&this.value===e&&!this.containsEsc};M.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};M.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};M.canInsertSemicolon=function(){return this.type===o.eof||this.type===o.braceR||$.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(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};M.expect=function(e){this.eat(e)||this.unexpected()};M.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Ne=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};M.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};M.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};M.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};M.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var b=N.prototype;b.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==o.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,a=Object.keys(this.undefinedExports);r<a.length;r+=1){var n=a[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Ye={kind:"loop"},bi={kind:"switch"};b.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;U.lastIndex=this.pos;var t=U.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(J(r,!0)){for(var a=i+1;ue(r=this.input.charCodeAt(a),!0);)++a;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,a);if(!ci.test(n))return!0}return!1};b.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;U.lastIndex=this.pos;var e=U.exec(this.input),t=this.pos+e[0].length,i;return!$.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(ue(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};b.parseStatement=function(e,t,i){var r=this.type,a=this.startNode(),n;switch(this.isLet(e)&&(r=o._var,n="let"),r){case o._break:case o._continue:return this.parseBreakContinueStatement(a,r.keyword);case o._debugger:return this.parseDebuggerStatement(a);case o._do:return this.parseDoStatement(a);case o._for:return this.parseForStatement(a);case o._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case o._class:return e&&this.unexpected(),this.parseClass(a,!0);case o._if:return this.parseIfStatement(a);case o._return:return this.parseReturnStatement(a);case o._switch:return this.parseSwitchStatement(a);case o._throw:return this.parseThrowStatement(a);case o._try:return this.parseTryStatement(a);case o._const:case o._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(a,n);case o._while:return this.parseWhileStatement(a);case o._with:return this.parseWithStatement(a);case o.braceL:return this.parseBlock(!0,a);case o.semi:return this.parseEmptyStatement(a);case o._export:case o._import:if(this.options.ecmaVersion>10&&r===o._import){U.lastIndex=this.pos;var s=U.exec(this.input),u=this.pos+s[0].length,c=this.input.charCodeAt(u);if(c===40||c===46)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===o._import?this.parseImport(a):this.parseExport(a,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var p=this.value,l=this.parseExpression();return r===o.name&&l.type==="Identifier"&&this.eat(o.colon)?this.parseLabeledStatement(a,p,l,e):this.parseExpressionStatement(a,l)}};b.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(o.semi)||this.insertSemicolon()?e.label=null:this.type!==o.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var a=this.labels[r];if((e.label==null||a.name===e.label.name)&&(a.kind!=null&&(i||a.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};b.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};b.parseDoStatement=function(e){return this.next(),this.labels.push(Ye),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(o._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(o.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};b.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ye),this.enterScope(0),this.expect(o.parenL),this.type===o.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===o._var||this.type===o._const||i){var r=this.startNode(),a=i?"let":this.value;return this.next(),this.parseVar(r,!0,a),this.finishNode(r,"VariableDeclaration"),(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===o._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var n=this.isContextual("let"),s=!1,u=this.containsEsc,c=new Ne,p=this.start,l=t>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);return this.type===o._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===o._in&&this.unexpected(t),e.await=!0):s&&this.options.ecmaVersion>=8&&(l.start===p&&!u&&l.type==="Identifier"&&l.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),n&&s&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,c),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(c,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))};b.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,fe|(i?0:Fe),!1,t)};b.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(o._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};b.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(o.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};b.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(o.braceL),this.labels.push(bi),this.enterScope(0);for(var t,i=!1;this.type!==o.braceR;)if(this.type===o._case||this.type===o._default){var r=this.type===o._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(o.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};b.parseThrowStatement=function(e){return this.next(),$.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var vi=[];b.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?St:0),this.checkLValPattern(e,t?kt:ie),this.expect(o.parenR),e};b.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===o._catch){var t=this.startNode();this.next(),this.eat(o.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(o._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};b.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};b.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ye),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};b.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};b.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};b.parseLabeledStatement=function(e,t,i,r){for(var a=0,n=this.labels;a<n.length;a+=1){var s=n[a];s.name===t&&this.raise(i.start,"Label '"+t+"' 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 p=this.labels[c];if(p.statementStart===e.start)p.statementStart=this.start,p.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};b.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};b.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(o.braceL),e&&this.enterScope(0);this.type!==o.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};b.parseFor=function(e,t){return e.init=t,this.expect(o.semi),e.test=this.type===o.semi?null:this.parseExpression(),this.expect(o.semi),e.update=this.type===o.parenR?null:this.parseExpression(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};b.parseForIn=function(e,t){var i=this.type===o._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};b.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var a=this.startNode();if(this.parseVarId(a,i),this.eat(o.eq)?a.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&a.id.type!=="Identifier"&&!(t&&(this.type===o._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):a.init=null,e.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(o.comma))break}return e};b.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Qe:ie,!1)};var fe=1,Fe=2,At=4;b.parseFunction=function(e,t,i,r,a){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===o.star&&t&Fe&&this.unexpected(),e.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&fe&&(e.id=t&At&&this.type!==o.name?null:this.parseIdent(),e.id&&!(t&Fe)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Qe:ie:_t));var n=this.yieldPos,s=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ke(e.async,e.generator)),t&fe||(e.id=this.type===o.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,a),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=u,this.finishNode(e,t&fe?"FunctionDeclaration":"FunctionExpression")};b.parseFunctionParams=function(e){this.expect(o.parenL),e.params=this.parseBindingList(o.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};b.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),a=this.startNode(),n=!1;for(a.body=[],this.expect(o.braceL);this.type!==o.braceR;){var s=this.parseClassElement(e.superClass!==null);s&&(a.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"?(n&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),n=!0):s.key&&s.key.type==="PrivateIdentifier"&&wi(r,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(a,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};b.parseClassElement=function(e){if(this.eat(o.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",a=!1,n=!1,s="method",u=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(o.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===o.star?u=!0:r="static"}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===o.star)&&!this.canInsertSemicolon()?n=!0:r="async"),!r&&(t>=9||!n)&&this.eat(o.star)&&(a=!0),!r&&!n&&!a){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=c:r=c)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===o.parenL||s!=="method"||a||n){var p=!i.static&&_e(i,"constructor"),l=p&&e;p&&s!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=p?"constructor":s,this.parseClassMethod(i,a,n,l)}else this.parseClassField(i);return i};b.isClassElementNameStart=function(){return this.type===o.name||this.type===o.privateId||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword};b.parseClassElementName=function(e){this.type===o.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};b.parseClassMethod=function(e,t,i,r){var a=e.key;e.kind==="constructor"?(t&&this.raise(a.start,"Constructor can't be a generator"),i&&this.raise(a.start,"Constructor can't be an async method")):e.static&&_e(e,"prototype")&&this.raise(a.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};b.parseClassField=function(e){if(_e(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&_e(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(o.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};b.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ye|ze);this.type!==o.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};b.parseClassId=function(e,t){this.type===o.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ie,!1)):(t===!0&&this.unexpected(),e.id=null)};b.parseClassSuper=function(e){e.superClass=this.eat(o._extends)?this.parseExprSubscripts(null,!1):null};b.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};b.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,a=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var s=i[n];pe(t,s.name)||(a?a.used.push(s):this.raiseRecoverable(s.start,"Private field '#"+s.name+"' must be declared in an enclosing class"))}};function wi(e,t){var i=t.key.name,r=e[i],a="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(a=(t.static?"s":"i")+t.kind),r==="iget"&&a==="iset"||r==="iset"&&a==="iget"||r==="sget"&&a==="sset"||r==="sset"&&a==="sget"?(e[i]="true",!1):r?!0:(e[i]=a,!1)}function _e(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}b.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};b.parseExport=function(e,t){if(this.next(),this.eat(o.star))return this.parseExportAllDeclaration(e,t);if(this.eat(o._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,r=e.specifiers;i<r.length;i+=1){var a=r[i];this.checkUnreserved(a.local),this.checkLocalExport(a.local),a.local.type==="Literal"&&this.raise(a.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};b.parseExportDeclaration=function(e){return this.parseStatement(null)};b.parseExportDefaultDeclaration=function(){var e;if(this.type===o._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,fe|At,!1,e)}else if(this.type===o._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};b.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),pe(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};b.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,a=t.properties;r<a.length;r+=1){var n=a[r];this.checkPatternExport(e,n)}else if(i==="ArrayPattern")for(var s=0,u=t.elements;s<u.length;s+=1){var c=u[s];c&&this.checkPatternExport(e,c)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)};b.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var a=r[i];this.checkPatternExport(e,a.id)}};b.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};b.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};b.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(o.braceL);!this.eat(o.braceR);){if(i)i=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;t.push(this.parseExportSpecifier(e))}return t};b.parseImport=function(e){return this.next(),this.type===o.string?(e.specifiers=vi,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===o.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};b.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ie),this.finishNode(e,"ImportSpecifier")};b.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ie),this.finishNode(e,"ImportDefaultSpecifier")};b.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ie),this.finishNode(e,"ImportNamespaceSpecifier")};b.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===o.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(o.comma)))return e;if(this.type===o.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(o.braceL);!this.eat(o.braceR);){if(t)t=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;e.push(this.parseImportSpecifier())}return e};b.parseWithClause=function(){var e=[];if(!this.eat(o._with))return e;this.expect(o.braceL);for(var t={},i=!0;!this.eat(o.braceR);){if(i)i=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;var r=this.parseImportAttribute(),a=r.key.type==="Identifier"?r.key.name:r.key.value;pe(t,a)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+a+"'"),t[a]=!0,e.push(r)}return e};b.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(o.colon),this.type!==o.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};b.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===o.string){var e=this.parseLiteral(this.value);return di.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};b.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};b.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var G=N.prototype;G.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,a=e.properties;r<a.length;r+=1){var n=a[r];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};G.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var a=e[r];a&&this.toAssignable(a,t)}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};G.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};G.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==o.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};G.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case o.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(o.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case o.braceL:return this.parseObj(!0)}return this.parseIdent()};G.parseBindingList=function(e,t,i,r){for(var a=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(o.comma),t&&this.type===o.comma)a.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===o.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),a.push(s),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else a.push(this.parseAssignableListItem(r))}return a};G.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};G.parseBindingListItem=function(e){return e};G.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(o.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};G.checkLValSimple=function(e,t,i){t===void 0&&(t=Ee);var r=t!==Ee;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===ie&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(pe(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==It&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};G.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Ee),e.type){case"ObjectPattern":for(var r=0,a=e.properties;r<a.length;r+=1){var n=a[r];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var s=0,u=e.elements;s<u.length;s+=1){var c=u[s];c&&this.checkLValInnerPattern(c,t,i)}break;default:this.checkLValSimple(e,t,i)}};G.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Ee),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var W=function(t,i,r,a,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=a,this.generator=!!n},P={b_stat:new W("{",!1),b_expr:new W("{",!0),b_tmpl:new W("${",!1),p_stat:new W("(",!1),p_expr:new W("(",!0),q_tmpl:new W("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new W("function",!1),f_expr:new W("function",!0),f_expr_gen:new W("function",!0,!1,null,!0),f_gen:new W("function",!1,!1,null,!0)},he=N.prototype;he.initialContext=function(){return[P.b_stat]};he.curContext=function(){return this.context[this.context.length-1]};he.braceIsBlock=function(e){var t=this.curContext();return t===P.f_expr||t===P.f_stat?!0:e===o.colon&&(t===P.b_stat||t===P.b_expr)?!t.isExpr:e===o._return||e===o.name&&this.exprAllowed?$.test(this.input.slice(this.lastTokEnd,this.start)):e===o._else||e===o.semi||e===o.eof||e===o.parenR||e===o.arrow?!0:e===o.braceL?t===P.b_stat:e===o._var||e===o._const||e===o.name?!1:!this.exprAllowed};he.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};he.updateContext=function(e){var t,i=this.type;i.keyword&&e===o.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};he.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};o.parenR.updateContext=o.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===P.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};o.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?P.b_stat:P.b_expr),this.exprAllowed=!0};o.dollarBraceL.updateContext=function(){this.context.push(P.b_tmpl),this.exprAllowed=!0};o.parenL.updateContext=function(e){var t=e===o._if||e===o._for||e===o._with||e===o._while;this.context.push(t?P.p_stat:P.p_expr),this.exprAllowed=!0};o.incDec.updateContext=function(){};o._function.updateContext=o._class.updateContext=function(e){e.beforeExpr&&e!==o._else&&!(e===o.semi&&this.curContext()!==P.p_stat)&&!(e===o._return&&$.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===o.colon||e===o.braceL)&&this.curContext()===P.b_stat)?this.context.push(P.f_expr):this.context.push(P.f_stat),this.exprAllowed=!1};o.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};o.backQuote.updateContext=function(){this.curContext()===P.q_tmpl?this.context.pop():this.context.push(P.q_tmpl),this.exprAllowed=!1};o.star.updateContext=function(e){if(e===o._function){var t=this.context.length-1;this.context[t]===P.f_expr?this.context[t]=P.f_expr_gen:this.context[t]=P.f_gen}this.exprAllowed=!0};o.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==o.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var w=N.prototype;w.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,a;switch(r.type){case"Identifier":a=r.name;break;case"Literal":a=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){a==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}a="$"+a;var s=t[a];if(s){var u;n==="init"?u=this.strict&&s.init||s.get||s.set:u=s.init||s[n],u&&this.raiseRecoverable(r.start,"Redefinition of property")}else s=t[a]={init:!1,get:!1,set:!1};s[n]=!0}};w.parseExpression=function(e,t){var i=this.start,r=this.startLoc,a=this.parseMaybeAssign(e,t);if(this.type===o.comma){var n=this.startNodeAt(i,r);for(n.expressions=[a];this.eat(o.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return a};w.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,a=-1,n=-1,s=-1;t?(a=t.parenthesizedAssign,n=t.trailingComma,s=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ne,r=!0);var u=this.start,c=this.startLoc;(this.type===o.parenL||this.type===o.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var p=this.parseMaybeConditional(e,t);if(i&&(p=i.call(this,p,u,c)),this.type.isAssign){var l=this.startNodeAt(u,c);return l.operator=this.value,this.type===o.eq&&(p=this.toAssignable(p,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=p.start&&(t.shorthandAssign=-1),this.type===o.eq?this.checkLValPattern(p):this.checkLValSimple(p),l.left=p,this.next(),l.right=this.parseMaybeAssign(e),s>-1&&(t.doubleProto=s),this.finishNode(l,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return a>-1&&(t.parenthesizedAssign=a),n>-1&&(t.trailingComma=n),p};w.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,a=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return a;if(this.eat(o.question)){var n=this.startNodeAt(i,r);return n.test=a,n.consequent=this.parseMaybeAssign(),this.expect(o.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return a};w.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,a=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||a.start===i&&a.type==="ArrowFunctionExpression"?a:this.parseExprOp(a,i,r,-1,e)};w.parseExprOp=function(e,t,i,r,a){var n=this.type.binop;if(n!=null&&(!a||this.type!==o._in)&&n>r){var s=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 p=this.start,l=this.startLoc,x=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,a),p,l,n,a),d=this.buildBinary(t,i,e,x,c,s||u);return(s&&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(d,t,i,r,a)}return e};w.buildBinary=function(e,t,i,r,a,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var s=this.startNodeAt(e,t);return s.left=i,s.operator=a,s.right=r,this.finishNode(s,n?"LogicalExpression":"BinaryExpression")};w.parseMaybeUnary=function(e,t,i,r){var a=this.start,n=this.startLoc,s;if(this.isContextual("await")&&this.canAwait)s=this.parseAwait(r),t=!0;else if(this.type.prefix){var u=this.startNode(),c=this.type===o.incDec;u.operator=this.value,u.prefix=!0,this.next(),u.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&Pt(u.argument)?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&Ue(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=!0,s=this.finishNode(u,c?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===o.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),s=this.parsePrivateIdent(),this.type!==o._in&&this.unexpected();else{if(s=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return s;for(;this.type.postfix&&!this.canInsertSemicolon();){var p=this.startNodeAt(a,n);p.operator=this.value,p.prefix=!1,p.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(p,"UpdateExpression")}}if(!i&&this.eat(o.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(a,n,s,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return s};function Pt(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Pt(e.expression)}function Ue(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ue(e.expression)||e.type==="ParenthesizedExpression"&&Ue(e.expression)}w.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,a=this.parseExprAtom(e,t);if(a.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return a;var n=this.parseSubscripts(a,i,r,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};w.parseSubscripts=function(e,t,i,r,a){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,s=!1;;){var u=this.parseSubscript(e,t,i,r,n,s,a);if(u.optional&&(s=!0),u===e||u.type==="ArrowFunctionExpression"){if(s){var c=this.startNodeAt(t,i);c.expression=u,u=this.finishNode(c,"ChainExpression")}return u}e=u}};w.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(o.arrow)};w.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,r)};w.parseSubscript=function(e,t,i,r,a,n,s){var u=this.options.ecmaVersion>=11,c=u&&this.eat(o.questionDot);r&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var p=this.eat(o.bracketL);if(p||c&&this.type!==o.parenL&&this.type!==o.backQuote||this.eat(o.dot)){var l=this.startNodeAt(t,i);l.object=e,p?(l.property=this.parseExpression(),this.expect(o.bracketR)):this.type===o.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!p,u&&(l.optional=c),e=this.finishNode(l,"MemberExpression")}else if(!r&&this.eat(o.parenL)){var x=new Ne,d=this.yieldPos,h=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var C=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,!1,x);if(a&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(x,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=h,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,i,C,s);this.checkExpressionErrors(x,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var S=this.startNodeAt(t,i);S.callee=e,S.arguments=C,u&&(S.optional=c),e=this.finishNode(S,"CallExpression")}else if(this.type===o.backQuote){(c||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var A=this.startNodeAt(t,i);A.tag=e,A.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(A,"TaggedTemplateExpression")}return e};w.parseExprAtom=function(e,t,i){this.type===o.slash&&this.readRegexp();var r,a=this.potentialArrowAt===this.start;switch(this.type){case o._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===o.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==o.dot&&this.type!==o.bracketL&&this.type!==o.parenL&&this.unexpected(),this.finishNode(r,"Super");case o._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case o.name:var n=this.start,s=this.startLoc,u=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!u&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(o._function))return this.overrideContext(P.f_expr),this.parseFunction(this.startNodeAt(n,s),0,!1,!0,t);if(a&&!this.canInsertSemicolon()){if(this.eat(o.arrow))return this.parseArrowExpression(this.startNodeAt(n,s),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===o.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,s),[c],!0,t)}return c;case o.regexp:var p=this.value;return r=this.parseLiteral(p.value),r.regex={pattern:p.pattern,flags:p.flags},r;case o.num:case o.string:return this.parseLiteral(this.value);case o._null:case o._true:case o._false:return r=this.startNode(),r.value=this.type===o._null?null:this.type===o._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case o.parenL:var l=this.start,x=this.parseParenAndDistinguishExpression(a,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(x)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),x;case o.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(o.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case o.braceL:return this.overrideContext(P.b_expr),this.parseObj(!1,e);case o._function:return r=this.startNode(),this.next(),this.parseFunction(r,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(i):this.unexpected();default:return this.parseExprAtomDefault()}};w.parseExprAtomDefault=function(){this.unexpected()};w.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===o.parenL&&!e)return this.parseDynamicImport(t);if(this.type===o.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};w.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(o.parenR)?e.options=null:(this.expect(o.comma),this.afterTrailingComma(o.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(o.parenR)||(this.expect(o.comma),this.afterTrailingComma(o.parenR)||this.unexpected())));else if(!this.eat(o.parenR)){var t=this.start;this.eat(o.comma)&&this.eat(o.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};w.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};w.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};w.parseParenExpression=function(){this.expect(o.parenL);var e=this.parseExpression();return this.expect(o.parenR),e};w.shouldParseArrow=function(e){return!this.canInsertSemicolon()};w.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,a,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,u=this.startLoc,c=[],p=!0,l=!1,x=new Ne,d=this.yieldPos,h=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==o.parenR;)if(p?p=!1:this.expect(o.comma),n&&this.afterTrailingComma(o.parenR,!0)){l=!0;break}else if(this.type===o.ellipsis){g=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(!1,x,this.parseParenItem));var C=this.lastTokEnd,S=this.lastTokEndLoc;if(this.expect(o.parenR),e&&this.shouldParseArrow(c)&&this.eat(o.arrow))return this.checkPatternErrors(x,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=h,this.parseParenArrowList(i,r,c,t);(!c.length||l)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(x,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,c.length>1?(a=this.startNodeAt(s,u),a.expressions=c,this.finishNodeAt(a,"SequenceExpression",C,S)):a=c[0]}else a=this.parseParenExpression();if(this.options.preserveParens){var A=this.startNodeAt(i,r);return A.expression=a,this.finishNode(A,"ParenthesizedExpression")}else return a};w.parseParenItem=function(e){return e};w.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Ci=[];w.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===o.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,a=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,a,!0,!1),this.eat(o.parenL)?e.arguments=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ci,this.finishNode(e,"NewExpression")};w.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===o.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
|
|
18
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var yi=require("fs"),bi=require("path"),vi=require("url");function It(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(i){if(i!=="default"){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}}),t.default=e,Object.freeze(t)}var Ae=It(yi),Te=It(bi),wi=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],At=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Si="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Pt="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Ue={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"},Ge="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",Ci={5:Ge,"5module":Ge+" export import",6:Ge+" const class extends export import super"},Ni=/^in(stanceof)?$/,_i=new RegExp("["+Pt+"]"),Ei=new RegExp("["+Pt+Si+"]");function Qe(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}return!1}function ie(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&_i.test(String.fromCharCode(e)):t===!1?!1:Qe(e,At)}function de(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ei.test(String.fromCharCode(e)):t===!1?!1:Qe(e,At)||Qe(e,wi)}var P=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function $(e,t){return new P(e,{beforeExpr:!0,binop:t})}var q={beforeExpr:!0},j={startsExpr:!0},et={};function A(e,t){return t===void 0&&(t={}),t.keyword=e,et[e]=new P(e,t)}var l={num:new P("num",j),regexp:new P("regexp",j),string:new P("string",j),name:new P("name",j),privateId:new P("privateId",j),eof:new P("eof"),bracketL:new P("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new P("]"),braceL:new P("{",{beforeExpr:!0,startsExpr:!0}),braceR:new P("}"),parenL:new P("(",{beforeExpr:!0,startsExpr:!0}),parenR:new P(")"),comma:new P(",",q),semi:new P(";",q),colon:new P(":",q),dot:new P("."),question:new P("?",q),questionDot:new P("?."),arrow:new P("=>",q),template:new P("template"),invalidTemplate:new P("invalidTemplate"),ellipsis:new P("...",q),backQuote:new P("`",j),dollarBraceL:new P("${",{beforeExpr:!0,startsExpr:!0}),eq:new P("=",{beforeExpr:!0,isAssign:!0}),assign:new P("_=",{beforeExpr:!0,isAssign:!0}),incDec:new P("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new P("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:$("||",1),logicalAND:$("&&",2),bitwiseOR:$("|",3),bitwiseXOR:$("^",4),bitwiseAND:$("&",5),equality:$("==/!=/===/!==",6),relational:$("</>/<=/>=",7),bitShift:$("<</>>/>>>",8),plusMin:new P("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:$("%",10),star:$("*",10),slash:$("/",10),starstar:new P("**",{beforeExpr:!0}),coalesce:$("??",1),_break:A("break"),_case:A("case",q),_catch:A("catch"),_continue:A("continue"),_debugger:A("debugger"),_default:A("default",q),_do:A("do",{isLoop:!0,beforeExpr:!0}),_else:A("else",q),_finally:A("finally"),_for:A("for",{isLoop:!0}),_function:A("function",j),_if:A("if"),_return:A("return",q),_switch:A("switch"),_throw:A("throw",q),_try:A("try"),_var:A("var"),_const:A("const"),_while:A("while",{isLoop:!0}),_with:A("with"),_new:A("new",{beforeExpr:!0,startsExpr:!0}),_this:A("this",j),_super:A("super",j),_class:A("class",j),_extends:A("extends",q),_export:A("export"),_import:A("import",j),_null:A("null",j),_true:A("true",j),_false:A("false",j),_in:A("in",{beforeExpr:!0,binop:7}),_instanceof:A("instanceof",{beforeExpr:!0,binop:7}),_typeof:A("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:A("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:A("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},H=/\r\n?|\n|\u2028|\u2029/,ki=new RegExp(H.source,"g");function xe(e){return e===10||e===13||e===8232||e===8233}function Vt(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var a=e.charCodeAt(r);if(xe(a))return r<i-1&&a===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Tt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,U=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Mt=Object.prototype,Ii=Mt.hasOwnProperty,Ai=Mt.toString,ye=Object.hasOwn||function(e,t){return Ii.call(e,t)},ft=Array.isArray||function(e){return Ai.call(e)==="[object Array]"},mt=Object.create(null);function oe(e){return mt[e]||(mt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function re(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Pi=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Ne=function(t,i){this.line=t,this.column=i};Ne.prototype.offset=function(t){return new Ne(this.line,this.column+t)};var je=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function Lt(e,t){for(var i=1,r=0;;){var a=Vt(e,r,t);if(a<0)return new Ne(i,t-r);++i,r=a}}var Xe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},dt=!1;function Vi(e){var t={};for(var i in Xe)t[i]=e&&ye(e,i)?e[i]:Xe[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!dt&&typeof console=="object"&&console.warn&&(dt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
19
|
+
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ft(t.onToken)){var r=t.onToken;t.onToken=function(a){return r.push(a)}}return ft(t.onComment)&&(t.onComment=Ti(t,t.onComment)),t}function Ti(e,t){return function(i,r,a,s,n,o){var u={type:i?"Block":"Line",value:r,start:a,end:s};e.locations&&(u.loc=new je(this,n,o)),e.ranges&&(u.range=[a,s]),t.push(u)}}var _e=1,be=2,tt=4,Dt=8,Rt=16,Bt=32,it=64,jt=128,Ee=256,rt=_e|be|Ee;function at(e,t){return be|(e?tt:0)|(t?Dt:0)}var Me=0,nt=1,ne=2,Ot=3,Ft=4,Wt=5,M=function(t,i,r){this.options=t=Vi(t),this.sourceFile=t.sourceFile,this.keywords=oe(Ci[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var a="";t.allowReserved!==!0&&(a=Ue[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(a+=" await")),this.reservedWords=oe(a);var s=(a?a+" ":"")+Ue.strict;this.reservedWordsStrict=oe(s),this.reservedWordsStrictBind=oe(s+" "+Ue.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
|
|
20
|
+
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(H).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=l.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=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(_e),this.regexpState=null,this.privateNameStack=[]},J={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};M.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};J.inFunction.get=function(){return(this.currentVarScope().flags&be)>0};J.inGenerator.get=function(){return(this.currentVarScope().flags&Dt)>0&&!this.currentVarScope().inClassFieldInit};J.inAsync.get=function(){return(this.currentVarScope().flags&tt)>0&&!this.currentVarScope().inClassFieldInit};J.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Ee)return!1;if(t.flags&be)return(t.flags&tt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};J.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&it)>0||i||this.options.allowSuperOutsideMethod};J.allowDirectSuper.get=function(){return(this.currentThisScope().flags&jt)>0};J.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};J.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(be|Ee))>0||i};J.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ee)>0};M.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,a=0;a<t.length;a++)r=t[a](r);return r};M.parse=function(t,i){return new this(i,t).parse()};M.parseExpressionAt=function(t,i,r){var a=new this(r,t,i);return a.nextToken(),a.parseExpression()};M.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(M.prototype,J);var B=M.prototype,Mi=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;B.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){U.lastIndex=e,e+=U.exec(this.input)[0].length;var t=Mi.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){U.lastIndex=e+t[0].length;var i=U.exec(this.input),r=i.index+i[0].length,a=this.input.charAt(r);return a===";"||a==="}"||H.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(a)||a==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,U.lastIndex=e,e+=U.exec(this.input)[0].length,this.input[e]===";"&&e++}};B.eat=function(e){return this.type===e?(this.next(),!0):!1};B.isContextual=function(e){return this.type===l.name&&this.value===e&&!this.containsEsc};B.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};B.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};B.canInsertSemicolon=function(){return this.type===l.eof||this.type===l.braceR||H.test(this.input.slice(this.lastTokEnd,this.start))};B.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};B.semicolon=function(){!this.eat(l.semi)&&!this.insertSemicolon()&&this.unexpected()};B.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};B.expect=function(e){this.eat(e)||this.unexpected()};B.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Oe=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};B.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};B.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};B.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")};B.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var C=M.prototype;C.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==l.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,a=Object.keys(this.undefinedExports);r<a.length;r+=1){var s=a[r];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var st={kind:"loop"},Li={kind:"switch"};C.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;U.lastIndex=this.pos;var t=U.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(ie(r,!0)){for(var a=i+1;de(r=this.input.charCodeAt(a),!0);)++a;if(r===92||r>55295&&r<56320)return!0;var s=this.input.slice(i,a);if(!Ni.test(s))return!0}return!1};C.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;U.lastIndex=this.pos;var e=U.exec(this.input),t=this.pos+e[0].length,i;return!H.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(de(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};C.parseStatement=function(e,t,i){var r=this.type,a=this.startNode(),s;switch(this.isLet(e)&&(r=l._var,s="let"),r){case l._break:case l._continue:return this.parseBreakContinueStatement(a,r.keyword);case l._debugger:return this.parseDebuggerStatement(a);case l._do:return this.parseDoStatement(a);case l._for:return this.parseForStatement(a);case l._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case l._class:return e&&this.unexpected(),this.parseClass(a,!0);case l._if:return this.parseIfStatement(a);case l._return:return this.parseReturnStatement(a);case l._switch:return this.parseSwitchStatement(a);case l._throw:return this.parseThrowStatement(a);case l._try:return this.parseTryStatement(a);case l._const:case l._var:return s=s||this.value,e&&s!=="var"&&this.unexpected(),this.parseVarStatement(a,s);case l._while:return this.parseWhileStatement(a);case l._with:return this.parseWithStatement(a);case l.braceL:return this.parseBlock(!0,a);case l.semi:return this.parseEmptyStatement(a);case l._export:case l._import:if(this.options.ecmaVersion>10&&r===l._import){U.lastIndex=this.pos;var n=U.exec(this.input),o=this.pos+n[0].length,u=this.input.charCodeAt(o);if(u===40||u===46)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===l._import?this.parseImport(a):this.parseExport(a,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var c=this.value,p=this.parseExpression();return r===l.name&&p.type==="Identifier"&&this.eat(l.colon)?this.parseLabeledStatement(a,c,p,e):this.parseExpressionStatement(a,p)}};C.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(l.semi)||this.insertSemicolon()?e.label=null:this.type!==l.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var a=this.labels[r];if((e.label==null||a.name===e.label.name)&&(a.kind!=null&&(i||a.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};C.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};C.parseDoStatement=function(e){return this.next(),this.labels.push(st),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(l._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(l.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};C.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(st),this.enterScope(0),this.expect(l.parenL),this.type===l.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===l._var||this.type===l._const||i){var r=this.startNode(),a=i?"let":this.value;return this.next(),this.parseVar(r,!0,a),this.finishNode(r,"VariableDeclaration"),(this.type===l._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===l._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=this.isContextual("let"),n=!1,o=this.containsEsc,u=new Oe,c=this.start,p=t>-1?this.parseExprSubscripts(u,"await"):this.parseExpression(!0,u);return this.type===l._in||(n=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===l._in&&this.unexpected(t),e.await=!0):n&&this.options.ecmaVersion>=8&&(p.start===c&&!o&&p.type==="Identifier"&&p.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),s&&n&&this.raise(p.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(p,!1,u),this.checkLValPattern(p),this.parseForIn(e,p)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,p))};C.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Se|(i?0:Ye),!1,t)};C.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(l._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};C.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(l.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};C.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(l.braceL),this.labels.push(Li),this.enterScope(0);for(var t,i=!1;this.type!==l.braceR;)if(this.type===l._case||this.type===l._default){var r=this.type===l._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(l.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};C.parseThrowStatement=function(e){return this.next(),H.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Di=[];C.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Bt:0),this.checkLValPattern(e,t?Ft:ne),this.expect(l.parenR),e};C.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===l._catch){var t=this.startNode();this.next(),this.eat(l.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(l._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};C.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};C.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(st),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};C.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};C.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};C.parseLabeledStatement=function(e,t,i,r){for(var a=0,s=this.labels;a<s.length;a+=1){var n=s[a];n.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===l._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var c=this.labels[u];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};C.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};C.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(l.braceL),e&&this.enterScope(0);this.type!==l.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};C.parseFor=function(e,t){return e.init=t,this.expect(l.semi),e.test=this.type===l.semi?null:this.parseExpression(),this.expect(l.semi),e.update=this.type===l.parenR?null:this.parseExpression(),this.expect(l.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};C.parseForIn=function(e,t){var i=this.type===l._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(l.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};C.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var a=this.startNode();if(this.parseVarId(a,i),this.eat(l.eq)?a.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===l._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&a.id.type!=="Identifier"&&!(t&&(this.type===l._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):a.init=null,e.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(l.comma))break}return e};C.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?nt:ne,!1)};var Se=1,Ye=2,$t=4;C.parseFunction=function(e,t,i,r,a){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===l.star&&t&Ye&&this.unexpected(),e.generator=this.eat(l.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Se&&(e.id=t&$t&&this.type!==l.name?null:this.parseIdent(),e.id&&!(t&Ye)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?nt:ne:Ot));var s=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(at(e.async,e.generator)),t&Se||(e.id=this.type===l.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,a),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(e,t&Se?"FunctionDeclaration":"FunctionExpression")};C.parseFunctionParams=function(e){this.expect(l.parenL),e.params=this.parseBindingList(l.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};C.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),a=this.startNode(),s=!1;for(a.body=[],this.expect(l.braceL);this.type!==l.braceR;){var n=this.parseClassElement(e.superClass!==null);n&&(a.body.push(n),n.type==="MethodDefinition"&&n.kind==="constructor"?(s&&this.raiseRecoverable(n.start,"Duplicate constructor in the same class"),s=!0):n.key&&n.key.type==="PrivateIdentifier"&&Ri(r,n)&&this.raiseRecoverable(n.key.start,"Identifier '#"+n.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(a,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};C.parseClassElement=function(e){if(this.eat(l.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",a=!1,s=!1,n="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(l.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===l.star?o=!0:r="static"}if(i.static=o,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===l.star)&&!this.canInsertSemicolon()?s=!0:r="async"),!r&&(t>=9||!s)&&this.eat(l.star)&&(a=!0),!r&&!s&&!a){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?n=u:r=u)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===l.parenL||n!=="method"||a||s){var c=!i.static&&Le(i,"constructor"),p=c&&e;c&&n!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":n,this.parseClassMethod(i,a,s,p)}else this.parseClassField(i);return i};C.isClassElementNameStart=function(){return this.type===l.name||this.type===l.privateId||this.type===l.num||this.type===l.string||this.type===l.bracketL||this.type.keyword};C.parseClassElementName=function(e){this.type===l.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};C.parseClassMethod=function(e,t,i,r){var a=e.key;e.kind==="constructor"?(t&&this.raise(a.start,"Constructor can't be a generator"),i&&this.raise(a.start,"Constructor can't be an async method")):e.static&&Le(e,"prototype")&&this.raise(a.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&s.params.length!==0&&this.raiseRecoverable(s.start,"getter should have no params"),e.kind==="set"&&s.params.length!==1&&this.raiseRecoverable(s.start,"setter should have exactly one param"),e.kind==="set"&&s.params[0].type==="RestElement"&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};C.parseClassField=function(e){if(Le(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Le(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(l.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};C.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Ee|it);this.type!==l.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};C.parseClassId=function(e,t){this.type===l.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ne,!1)):(t===!0&&this.unexpected(),e.id=null)};C.parseClassSuper=function(e){e.superClass=this.eat(l._extends)?this.parseExprSubscripts(null,!1):null};C.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};C.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,a=r===0?null:this.privateNameStack[r-1],s=0;s<i.length;++s){var n=i[s];ye(t,n.name)||(a?a.used.push(n):this.raiseRecoverable(n.start,"Private field '#"+n.name+"' must be declared in an enclosing class"))}};function Ri(e,t){var i=t.key.name,r=e[i],a="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(a=(t.static?"s":"i")+t.kind),r==="iget"&&a==="iset"||r==="iset"&&a==="iget"||r==="sget"&&a==="sset"||r==="sset"&&a==="sget"?(e[i]="true",!1):r?!0:(e[i]=a,!1)}function Le(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}C.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==l.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};C.parseExport=function(e,t){if(this.next(),this.eat(l.star))return this.parseExportAllDeclaration(e,t);if(this.eat(l._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==l.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,r=e.specifiers;i<r.length;i+=1){var a=r[i];this.checkUnreserved(a.local),this.checkLocalExport(a.local),a.local.type==="Literal"&&this.raise(a.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};C.parseExportDeclaration=function(e){return this.parseStatement(null)};C.parseExportDefaultDeclaration=function(){var e;if(this.type===l._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Se|$t,!1,e)}else if(this.type===l._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};C.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),ye(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};C.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,a=t.properties;r<a.length;r+=1){var s=a[r];this.checkPatternExport(e,s)}else if(i==="ArrayPattern")for(var n=0,o=t.elements;n<o.length;n+=1){var u=o[n];u&&this.checkPatternExport(e,u)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)};C.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var a=r[i];this.checkPatternExport(e,a.id)}};C.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};C.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};C.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(l.braceL);!this.eat(l.braceR);){if(i)i=!1;else if(this.expect(l.comma),this.afterTrailingComma(l.braceR))break;t.push(this.parseExportSpecifier(e))}return t};C.parseImport=function(e){return this.next(),this.type===l.string?(e.specifiers=Di,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===l.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};C.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ne),this.finishNode(e,"ImportSpecifier")};C.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ne),this.finishNode(e,"ImportDefaultSpecifier")};C.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ne),this.finishNode(e,"ImportNamespaceSpecifier")};C.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===l.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(l.comma)))return e;if(this.type===l.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(l.braceL);!this.eat(l.braceR);){if(t)t=!1;else if(this.expect(l.comma),this.afterTrailingComma(l.braceR))break;e.push(this.parseImportSpecifier())}return e};C.parseWithClause=function(){var e=[];if(!this.eat(l._with))return e;this.expect(l.braceL);for(var t={},i=!0;!this.eat(l.braceR);){if(i)i=!1;else if(this.expect(l.comma),this.afterTrailingComma(l.braceR))break;var r=this.parseImportAttribute(),a=r.key.type==="Identifier"?r.key.name:r.key.value;ye(t,a)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+a+"'"),t[a]=!0,e.push(r)}return e};C.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===l.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(l.colon),this.type!==l.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};C.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===l.string){var e=this.parseLiteral(this.value);return Pi.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};C.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};C.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var z=M.prototype;z.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,a=e.properties;r<a.length;r+=1){var s=a[r];this.toAssignable(s,t),s.type==="RestElement"&&(s.argument.type==="ArrayPattern"||s.argument.type==="ObjectPattern")&&this.raise(s.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};z.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var a=e[r];a&&this.toAssignable(a,t)}if(i){var s=e[i-1];this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return e};z.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};z.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==l.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};z.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case l.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(l.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case l.braceL:return this.parseObj(!0)}return this.parseIdent()};z.parseBindingList=function(e,t,i,r){for(var a=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(l.comma),t&&this.type===l.comma)a.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===l.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),a.push(n),this.type===l.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else a.push(this.parseAssignableListItem(r))}return a};z.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};z.parseBindingListItem=function(e){return e};z.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(l.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};z.checkLValSimple=function(e,t,i){t===void 0&&(t=Me);var r=t!==Me;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===ne&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(ye(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Wt&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};z.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Me),e.type){case"ObjectPattern":for(var r=0,a=e.properties;r<a.length;r+=1){var s=a[r];this.checkLValInnerPattern(s,t,i)}break;case"ArrayPattern":for(var n=0,o=e.elements;n<o.length;n+=1){var u=o[n];u&&this.checkLValInnerPattern(u,t,i)}break;default:this.checkLValSimple(e,t,i)}};z.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Me),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var Q=function(t,i,r,a,s){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=a,this.generator=!!s},V={b_stat:new Q("{",!1),b_expr:new Q("{",!0),b_tmpl:new Q("${",!1),p_stat:new Q("(",!1),p_expr:new Q("(",!0),q_tmpl:new Q("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Q("function",!1),f_expr:new Q("function",!0),f_expr_gen:new Q("function",!0,!1,null,!0),f_gen:new Q("function",!1,!1,null,!0)},ve=M.prototype;ve.initialContext=function(){return[V.b_stat]};ve.curContext=function(){return this.context[this.context.length-1]};ve.braceIsBlock=function(e){var t=this.curContext();return t===V.f_expr||t===V.f_stat?!0:e===l.colon&&(t===V.b_stat||t===V.b_expr)?!t.isExpr:e===l._return||e===l.name&&this.exprAllowed?H.test(this.input.slice(this.lastTokEnd,this.start)):e===l._else||e===l.semi||e===l.eof||e===l.parenR||e===l.arrow?!0:e===l.braceL?t===V.b_stat:e===l._var||e===l._const||e===l.name?!1:!this.exprAllowed};ve.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};ve.updateContext=function(e){var t,i=this.type;i.keyword&&e===l.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};ve.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};l.parenR.updateContext=l.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===V.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};l.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?V.b_stat:V.b_expr),this.exprAllowed=!0};l.dollarBraceL.updateContext=function(){this.context.push(V.b_tmpl),this.exprAllowed=!0};l.parenL.updateContext=function(e){var t=e===l._if||e===l._for||e===l._with||e===l._while;this.context.push(t?V.p_stat:V.p_expr),this.exprAllowed=!0};l.incDec.updateContext=function(){};l._function.updateContext=l._class.updateContext=function(e){e.beforeExpr&&e!==l._else&&!(e===l.semi&&this.curContext()!==V.p_stat)&&!(e===l._return&&H.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===l.colon||e===l.braceL)&&this.curContext()===V.b_stat)?this.context.push(V.f_expr):this.context.push(V.f_stat),this.exprAllowed=!1};l.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};l.backQuote.updateContext=function(){this.curContext()===V.q_tmpl?this.context.pop():this.context.push(V.q_tmpl),this.exprAllowed=!1};l.star.updateContext=function(e){if(e===l._function){var t=this.context.length-1;this.context[t]===V.f_expr?this.context[t]=V.f_expr_gen:this.context[t]=V.f_gen}this.exprAllowed=!0};l.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==l.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var _=M.prototype;_.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,a;switch(r.type){case"Identifier":a=r.name;break;case"Literal":a=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6){a==="__proto__"&&s==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}a="$"+a;var n=t[a];if(n){var o;s==="init"?o=this.strict&&n.init||n.get||n.set:o=n.init||n[s],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else n=t[a]={init:!1,get:!1,set:!1};n[s]=!0}};_.parseExpression=function(e,t){var i=this.start,r=this.startLoc,a=this.parseMaybeAssign(e,t);if(this.type===l.comma){var s=this.startNodeAt(i,r);for(s.expressions=[a];this.eat(l.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return a};_.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,a=-1,s=-1,n=-1;t?(a=t.parenthesizedAssign,s=t.trailingComma,n=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Oe,r=!0);var o=this.start,u=this.startLoc;(this.type===l.parenL||this.type===l.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,o,u)),this.type.isAssign){var p=this.startNodeAt(o,u);return p.operator=this.value,this.type===l.eq&&(c=this.toAssignable(c,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===l.eq?this.checkLValPattern(c):this.checkLValSimple(c),p.left=c,this.next(),p.right=this.parseMaybeAssign(e),n>-1&&(t.doubleProto=n),this.finishNode(p,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return a>-1&&(t.parenthesizedAssign=a),s>-1&&(t.trailingComma=s),c};_.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,a=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return a;if(this.eat(l.question)){var s=this.startNodeAt(i,r);return s.test=a,s.consequent=this.parseMaybeAssign(),this.expect(l.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return a};_.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,a=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||a.start===i&&a.type==="ArrowFunctionExpression"?a:this.parseExprOp(a,i,r,-1,e)};_.parseExprOp=function(e,t,i,r,a){var s=this.type.binop;if(s!=null&&(!a||this.type!==l._in)&&s>r){var n=this.type===l.logicalOR||this.type===l.logicalAND,o=this.type===l.coalesce;o&&(s=l.logicalAND.binop);var u=this.value;this.next();var c=this.start,p=this.startLoc,m=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,a),c,p,s,a),d=this.buildBinary(t,i,e,m,u,n||o);return(n&&this.type===l.coalesce||o&&(this.type===l.logicalOR||this.type===l.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,i,r,a)}return e};_.buildBinary=function(e,t,i,r,a,s){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var n=this.startNodeAt(e,t);return n.left=i,n.operator=a,n.right=r,this.finishNode(n,s?"LogicalExpression":"BinaryExpression")};_.parseMaybeUnary=function(e,t,i,r){var a=this.start,s=this.startLoc,n;if(this.isContextual("await")&&this.canAwait)n=this.parseAwait(r),t=!0;else if(this.type.prefix){var o=this.startNode(),u=this.type===l.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&qt(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&Ze(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,n=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===l.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),n=this.parsePrivateIdent(),this.type!==l._in&&this.unexpected();else{if(n=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(a,s);c.operator=this.value,c.prefix=!1,c.argument=n,this.checkLValSimple(n),this.next(),n=this.finishNode(c,"UpdateExpression")}}if(!i&&this.eat(l.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(a,s,n,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return n};function qt(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&qt(e.expression)}function Ze(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ze(e.expression)||e.type==="ParenthesizedExpression"&&Ze(e.expression)}_.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,a=this.parseExprAtom(e,t);if(a.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return a;var s=this.parseSubscripts(a,i,r,!1,t);return e&&s.type==="MemberExpression"&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),s};_.parseSubscripts=function(e,t,i,r,a){for(var s=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,n=!1;;){var o=this.parseSubscript(e,t,i,r,s,n,a);if(o.optional&&(n=!0),o===e||o.type==="ArrowFunctionExpression"){if(n){var u=this.startNodeAt(t,i);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}};_.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(l.arrow)};_.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,r)};_.parseSubscript=function(e,t,i,r,a,s,n){var o=this.options.ecmaVersion>=11,u=o&&this.eat(l.questionDot);r&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(l.bracketL);if(c||u&&this.type!==l.parenL&&this.type!==l.backQuote||this.eat(l.dot)){var p=this.startNodeAt(t,i);p.object=e,c?(p.property=this.parseExpression(),this.expect(l.bracketR)):this.type===l.privateId&&e.type!=="Super"?p.property=this.parsePrivateIdent():p.property=this.parseIdent(this.options.allowReserved!=="never"),p.computed=!!c,o&&(p.optional=u),e=this.finishNode(p,"MemberExpression")}else if(!r&&this.eat(l.parenL)){var m=new Oe,d=this.yieldPos,h=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var x=this.parseExprList(l.parenR,this.options.ecmaVersion>=8,!1,m);if(a&&!u&&this.shouldParseAsyncArrow())return this.checkPatternErrors(m,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=h,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,i,x,n);this.checkExpressionErrors(m,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var b=this.startNodeAt(t,i);b.callee=e,b.arguments=x,o&&(b.optional=u),e=this.finishNode(b,"CallExpression")}else if(this.type===l.backQuote){(u||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var N=this.startNodeAt(t,i);N.tag=e,N.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(N,"TaggedTemplateExpression")}return e};_.parseExprAtom=function(e,t,i){this.type===l.slash&&this.readRegexp();var r,a=this.potentialArrowAt===this.start;switch(this.type){case l._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===l.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==l.dot&&this.type!==l.bracketL&&this.type!==l.parenL&&this.unexpected(),this.finishNode(r,"Super");case l._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case l.name:var s=this.start,n=this.startLoc,o=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(l._function))return this.overrideContext(V.f_expr),this.parseFunction(this.startNodeAt(s,n),0,!1,!0,t);if(a&&!this.canInsertSemicolon()){if(this.eat(l.arrow))return this.parseArrowExpression(this.startNodeAt(s,n),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===l.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(l.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,n),[u],!0,t)}return u;case l.regexp:var c=this.value;return r=this.parseLiteral(c.value),r.regex={pattern:c.pattern,flags:c.flags},r;case l.num:case l.string:return this.parseLiteral(this.value);case l._null:case l._true:case l._false:return r=this.startNode(),r.value=this.type===l._null?null:this.type===l._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case l.parenL:var p=this.start,m=this.parseParenAndDistinguishExpression(a,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(m)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),m;case l.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(l.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case l.braceL:return this.overrideContext(V.b_expr),this.parseObj(!1,e);case l._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case l._class:return this.parseClass(this.startNode(),!1);case l._new:return this.parseNew();case l.backQuote:return this.parseTemplate();case l._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};_.parseExprAtomDefault=function(){this.unexpected()};_.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===l.parenL&&!e)return this.parseDynamicImport(t);if(this.type===l.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};_.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(l.parenR)?e.options=null:(this.expect(l.comma),this.afterTrailingComma(l.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(l.parenR)||(this.expect(l.comma),this.afterTrailingComma(l.parenR)||this.unexpected())));else if(!this.eat(l.parenR)){var t=this.start;this.eat(l.comma)&&this.eat(l.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};_.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};_.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};_.parseParenExpression=function(){this.expect(l.parenL);var e=this.parseExpression();return this.expect(l.parenR),e};_.shouldParseArrow=function(e){return!this.canInsertSemicolon()};_.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,a,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var n=this.start,o=this.startLoc,u=[],c=!0,p=!1,m=new Oe,d=this.yieldPos,h=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==l.parenR;)if(c?c=!1:this.expect(l.comma),s&&this.afterTrailingComma(l.parenR,!0)){p=!0;break}else if(this.type===l.ellipsis){g=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===l.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,m,this.parseParenItem));var x=this.lastTokEnd,b=this.lastTokEndLoc;if(this.expect(l.parenR),e&&this.shouldParseArrow(u)&&this.eat(l.arrow))return this.checkPatternErrors(m,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=h,this.parseParenArrowList(i,r,u,t);(!u.length||p)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(m,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,u.length>1?(a=this.startNodeAt(n,o),a.expressions=u,this.finishNodeAt(a,"SequenceExpression",x,b)):a=u[0]}else a=this.parseParenExpression();if(this.options.preserveParens){var N=this.startNodeAt(i,r);return N.expression=a,this.finishNode(N,"ParenthesizedExpression")}else return a};_.parseParenItem=function(e){return e};_.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Bi=[];_.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===l.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,a=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,a,!0,!1),this.eat(l.parenL)?e.arguments=this.parseExprList(l.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Bi,this.finishNode(e,"NewExpression")};_.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===l.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
|
|
21
21
|
`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
22
|
-
`),cooked:this.value},this.next(),i.tail=this.type===o.backQuote,this.finishNode(i,"TemplateElement")};w.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===o.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(o.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(o.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};w.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.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)&&!$.test(this.input.slice(this.lastTokEnd,this.start))};w.parseObj=function(e,t){var i=this.startNode(),r=!0,a={};for(i.properties=[],this.next();!this.eat(o.braceR);){if(r)r=!1;else if(this.expect(o.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(o.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,a,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};w.parseProperty=function(e,t){var i=this.startNode(),r,a,n,s;if(this.options.ecmaVersion>=9&&this.eat(o.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===o.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,s=this.startLoc),e||(r=this.eat(o.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(a=!0,r=this.options.ecmaVersion>=9&&this.eat(o.star),this.parsePropertyName(i)):a=!1,this.parsePropertyValue(i,e,r,a,n,s,t,u),this.finishNode(i,"Property")};w.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};w.parsePropertyValue=function(e,t,i,r,a,n,s,u){(i||r)&&this.type===o.colon&&this.unexpected(),this.eat(o.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===o.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r)):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==o.comma&&this.type!==o.braceR&&this.type!==o.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=a),e.kind="init",t?e.value=this.parseMaybeDefault(a,n,this.copyNode(e.key)):this.type===o.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(a,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};w.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(o.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(o.bracketR),e.key;e.computed=!1}return e.key=this.type===o.num||this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};w.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};w.parseMethod=function(e,t,i){var r=this.startNode(),a=this.yieldPos,n=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ke(t,r.generator)|ze|(i?Et:0)),this.expect(o.parenL),r.params=this.parseBindingList(o.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=s,this.finishNode(r,"FunctionExpression")};w.parseArrowExpression=function(e,t,i,r){var a=this.yieldPos,n=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(Ke(i,!1)|Ct),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};w.parseFunctionBody=function(e,t,i,r){var a=t&&this.type!==o.braceL,n=this.strict,s=!1;if(a)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||u)&&(s=this.strictDirective(this.end),s&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var c=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!n&&!s&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,It),e.body=this.parseBlock(!1,void 0,s&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()};w.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0};w.checkParams=function(e,t){for(var i=Object.create(null),r=0,a=e.params;r<a.length;r+=1){var n=a[r];this.checkLValInnerPattern(n,Qe,t?null:i)}};w.parseExprList=function(e,t,i,r){for(var a=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(o.comma),t&&this.afterTrailingComma(e))break;var s=void 0;i&&this.type===o.comma?s=null:this.type===o.ellipsis?(s=this.parseSpread(r),r&&this.type===o.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):s=this.parseMaybeAssign(!1,r),a.push(s)}return a};w.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var a=this.strict?this.reservedWordsStrict:this.reservedWords;a.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}};w.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};w.parseIdentNode=function(){var e=this.startNode();return this.type===o.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=o.name):this.unexpected(),e};w.parsePrivateIdent=function(){var e=this.startNode();return this.type===o.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};w.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===o.semi||this.canInsertSemicolon()||this.type!==o.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(o.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};w.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var ke=N.prototype;ke.raise=function(e,t){var i=vt(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};ke.raiseRecoverable=ke.raise;ke.curPosition=function(){if(this.options.locations)return new de(this.curLine,this.pos-this.lineStart)};var ne=N.prototype,Si=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};ne.enterScope=function(e){this.scopeStack.push(new Si(e))};ne.exitScope=function(){this.scopeStack.pop()};ne.treatFunctionsAsVarInScope=function(e){return e.flags&le||!this.inModule&&e.flags&xe};ne.declareName=function(e,t,i){var r=!1;if(t===ie){var a=this.currentScope();r=a.lexical.indexOf(e)>-1||a.functions.indexOf(e)>-1||a.var.indexOf(e)>-1,a.lexical.push(e),this.inModule&&a.flags&xe&&delete this.undefinedExports[e]}else if(t===kt){var n=this.currentScope();n.lexical.push(e)}else if(t===_t){var s=this.currentScope();this.treatFunctionsAsVar?r=s.lexical.indexOf(e)>-1:r=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var c=this.scopeStack[u];if(c.lexical.indexOf(e)>-1&&!(c.flags&St&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){r=!0;break}if(c.var.push(e),this.inModule&&c.flags&xe&&delete this.undefinedExports[e],c.flags&He)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};ne.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};ne.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};ne.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&He)return t}};ne.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&He&&!(t.flags&Ct))return t}};var Ve=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new Pe(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},be=N.prototype;be.startNode=function(){return new Ve(this,this.start,this.startLoc)};be.startNodeAt=function(e,t){return new Ve(this,e,t)};function Nt(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}be.finishNode=function(e,t){return Nt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};be.finishNodeAt=function(e,t,i,r){return Nt.call(this,e,t,i,r)};be.copyNode=function(e){var t=new Ve(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Ei="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Vt="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",Tt=Vt+" Extended_Pictographic",Lt=Tt,Mt=Lt+" EBase EComp EMod EPres ExtPict",Dt=Mt,_i=Dt,ki={9:Vt,10:Tt,11:Lt,12:Mt,13:Dt,14:_i},Ii="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Ai={9:"",10:"",11:"",12:"",13:"",14:Ii},rt="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",Rt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Bt=Rt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",jt=Bt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ot=jt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ft=Ot+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Pi=Ft+" "+Ei,Ni={9:Rt,10:Bt,11:jt,12:Ot,13:Ft,14:Pi},Ut={};function Vi(e){var t=Ut[e]={binary:re(ki[e]+" "+rt),binaryOfStrings:re(Ai[e]),nonBinary:{General_Category:re(rt),Script:re(Ni[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var De=0,at=[9,10,11,12,13,14];De<at.length;De+=1){var Ti=at[De];Vi(Ti)}var y=N.prototype,Ie=function(t,i){this.parent=t,this.base=i||this};Ie.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return!0;return!1};Ie.prototype.sibling=function(){return new Ie(this.parent,this.base)};var X=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ut[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};X.prototype.reset=function(t,i,r){var a=r.indexOf("v")!==-1,n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,a&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)};X.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};X.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,a=r.length;if(t>=a)return-1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=a)return n;var s=r.charCodeAt(t+1);return s>=56320&&s<=57343?(n<<10)+s-56613888:n};X.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,a=r.length;if(t>=a)return a;var n=r.charCodeAt(t),s;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=a||(s=r.charCodeAt(t+1))<56320||s>57343?t+1:t+2};X.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};X.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};X.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};X.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};X.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var r=this.pos,a=0,n=t;a<n.length;a+=1){var s=n[a],u=this.at(r,i);if(u===-1||u!==s)return!1;r=this.nextIndex(r,i)}return this.pos=r,!0};y.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=!1,a=!1,n=0;n<i.length;n++){var s=i.charAt(n);t.indexOf(s)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(s,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),s==="u"&&(r=!0),s==="v"&&(a=!0)}this.options.ecmaVersion>=15&&r&&a&&this.raise(e.start,"Invalid regular expression flag")};function Li(e){for(var t in e)return!0;return!1}y.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Li(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};y.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced")}};y.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Ie(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};y.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};y.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};y.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};y.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};y.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};y.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,a=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue),e.eat(125)))return a!==-1&&a<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};y.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};y.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};y.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var a=0;a<i.length;a++){var n=i.charAt(a);i.indexOf(n,a+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(r){var s=this.regexp_eatModifiers(e);!i&&!s&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u<s.length;u++){var c=s.charAt(u);(s.indexOf(c,u+1)>-1||i.indexOf(c)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};y.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};y.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&Mi(i);)t+=ee(i),e.advance();return t};function Mi(e){return e===105||e===109||e===115}y.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};y.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};y.regexp_eatSyntaxCharacter=function(e){var t=e.current();return qt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function qt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}y.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!qt(i);)e.advance();return e.pos!==t};y.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};y.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,a=i;r<a.length;r+=1){var n=a[r];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};y.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};y.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ee(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ee(e.lastIntValue);return!0}return!1};y.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Di(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Di(e){return J(e,!0)||e===36||e===95}y.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Ri(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Ri(e){return ue(e,!0)||e===36||e===95||e===8204||e===8205}y.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};y.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};y.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};y.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};y.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};y.regexp_eatZero=function(e){return e.current()===48&&!Te(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};y.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};y.regexp_eatControlLetter=function(e){var t=e.current();return $t(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function $t(e){return e>=65&&e<=90||e>=97&&e<=122}y.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(r&&a>=55296&&a<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(a-55296)*1024+(s-56320)+65536,!0}e.pos=n,e.lastIntValue=a}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Bi(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Bi(e){return e>=0&&e<=1114111}y.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};y.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Gt=0,te=1,q=2;y.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(ji(t))return e.lastIntValue=-1,e.advance(),te;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===q&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return Gt};function ji(e){return e===100||e===68||e===115||e===83||e===119||e===87}y.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),te}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,a)}return Gt};y.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){pe(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};y.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return te;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return q;e.raise("Invalid property name")};y.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Wt(t=e.current());)e.lastStringValue+=ee(t),e.advance();return e.lastStringValue!==""};function Wt(e){return $t(e)||e===95}y.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Oi(t=e.current());)e.lastStringValue+=ee(t),e.advance();return e.lastStringValue!==""};function Oi(e){return Wt(e)||Te(e)}y.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};y.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===q&&e.raise("Negated character class may contain strings"),!0}return!1};y.regexp_classContents=function(e){return e.current()===93?te:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),te)};y.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};y.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||Kt(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};y.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};y.regexp_classSetExpression=function(e){var t=te,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===q&&(t=q);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==q&&(t=te);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===q&&(t=q)}};y.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};y.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?te:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};y.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===q&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var a=this.regexp_eatCharacterClassEscape(e);if(a)return a;e.pos=t}return null};y.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null};y.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===q&&(t=q);return t};y.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?te:q};y.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&Fi(i)||Ui(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function Fi(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Ui(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}y.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return qi(t)?(e.lastIntValue=t,e.advance(),!0):!1};function qi(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}y.regexp_eatClassControlLetter=function(e){var t=e.current();return Te(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};y.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};y.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Te(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Te(e){return e>=48&&e<=57}y.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;zt(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ht(i),e.advance();return e.pos!==t};function zt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ht(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}y.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};y.regexp_eatOctalDigit=function(e){var t=e.current();return Kt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Kt(e){return e>=48&&e<=55}y.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var a=e.current();if(!zt(a))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Ht(a),e.advance()}return!0};var Xe=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Pe(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},E=N.prototype;E.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Xe(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};E.getToken=function(){return this.next(),new Xe(this)};typeof Symbol<"u"&&(E[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===o.eof,value:t}}}});E.nextToken=function(){var e=this.curContext();if((!e||!e.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(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};E.readToken=function(e){return J(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};E.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};E.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,a=t;(r=gt(this.input,a,this.pos))>-1;)++this.curLine,a=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};E.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!ce(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};E.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){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(e>8&&e<14||e>=5760&&yt.test(String.fromCharCode(e)))++this.pos;else break e}}};E.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};E.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(o.ellipsis)):(++this.pos,this.finishToken(o.dot))};E.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(o.assign,2):this.finishOp(o.slash,1)};E.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?o.star:o.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=o.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(o.assign,i+1):this.finishOp(r,i)};E.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(o.assign,3)}return this.finishOp(e===124?o.logicalOR:o.logicalAND,2)}return t===61?this.finishOp(o.assign,2):this.finishOp(e===124?o.bitwiseOR:o.bitwiseAND,1)};E.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(o.assign,2):this.finishOp(o.bitwiseXOR,1)};E.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||$.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(o.incDec,2):t===61?this.finishOp(o.assign,2):this.finishOp(o.plusMin,1)};E.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(o.assign,i+1):this.finishOp(o.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(o.relational,i))};E.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(o.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(o.arrow)):this.finishOp(e===61?o.eq:o.prefix,1)};E.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(o.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(o.assign,3)}return this.finishOp(o.coalesce,2)}}return this.finishOp(o.question,1)};E.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),J(t,!0)||t===92))return this.finishToken(o.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ee(t)+"'")};E.getTokenFromCode=function(e){switch(e){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 t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(o.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ee(e)+"'")};E.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};E.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if($.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var a=this.input.slice(i,this.pos);++this.pos;var n=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new X(this));u.reset(i,a,s),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var c=null;try{c=new RegExp(a,s)}catch{}return this.finishToken(o.regexp,{pattern:a,flags:s,value:c})};E.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,a=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,s=0,u=0,c=0,p=t??1/0;c<p;++c,++this.pos){var l=this.input.charCodeAt(this.pos),x=void 0;if(r&&l===95){a&&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=l;continue}if(l>=97?x=l-97+10:l>=65?x=l-65+10:l>=48&&l<=57?x=l-48:x=1/0,x>=e)break;u=l,s=s*e+x}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:s};function $i(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Qt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}E.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Qt(this.input.slice(t,this.pos)),++this.pos):J(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,i)};E.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var a=Qt(this.input.slice(t,this.pos));return++this.pos,J(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,a)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),J(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=$i(this.input.slice(t,this.pos),i);return this.finishToken(o.num,n)};E.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};E.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ce(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(o.string,t)};var Yt={};E.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Yt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};E.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Yt;this.raise(e,t)};E.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===o.template||this.type===o.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(o.dollarBraceL)):(++this.pos,this.finishToken(o.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(o.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(ce(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
23
|
-
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};
|
|
22
|
+
`),cooked:this.value},this.next(),i.tail=this.type===l.backQuote,this.finishNode(i,"TemplateElement")};_.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===l.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(l.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(l.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};_.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===l.name||this.type===l.num||this.type===l.string||this.type===l.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===l.star)&&!H.test(this.input.slice(this.lastTokEnd,this.start))};_.parseObj=function(e,t){var i=this.startNode(),r=!0,a={};for(i.properties=[],this.next();!this.eat(l.braceR);){if(r)r=!1;else if(this.expect(l.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(l.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,a,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};_.parseProperty=function(e,t){var i=this.startNode(),r,a,s,n;if(this.options.ecmaVersion>=9&&this.eat(l.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===l.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===l.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(s=this.start,n=this.startLoc),e||(r=this.eat(l.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(a=!0,r=this.options.ecmaVersion>=9&&this.eat(l.star),this.parsePropertyName(i)):a=!1,this.parsePropertyValue(i,e,r,a,s,n,t,o),this.finishNode(i,"Property")};_.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};_.parsePropertyValue=function(e,t,i,r,a,s,n,o){(i||r)&&this.type===l.colon&&this.unexpected(),this.eat(l.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),e.kind="init"):this.options.ecmaVersion>=6&&this.type===l.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r)):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==l.comma&&this.type!==l.braceR&&this.type!==l.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=a),e.kind="init",t?e.value=this.parseMaybeDefault(a,s,this.copyNode(e.key)):this.type===l.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),e.value=this.parseMaybeDefault(a,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};_.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(l.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(l.bracketR),e.key;e.computed=!1}return e.key=this.type===l.num||this.type===l.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};_.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};_.parseMethod=function(e,t,i){var r=this.startNode(),a=this.yieldPos,s=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(at(t,r.generator)|it|(i?jt:0)),this.expect(l.parenL),r.params=this.parseBindingList(l.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=n,this.finishNode(r,"FunctionExpression")};_.parseArrowExpression=function(e,t,i,r){var a=this.yieldPos,s=this.awaitPos,n=this.awaitIdentPos;return this.enterScope(at(i,!1)|Rt),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=n,this.finishNode(e,"ArrowFunctionExpression")};_.parseFunctionBody=function(e,t,i,r){var a=t&&this.type!==l.braceL,s=this.strict,n=!1;if(a)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!s||o)&&(n=this.strictDirective(this.end),n&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],n&&(this.strict=!0),this.checkParams(e,!s&&!n&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Wt),e.body=this.parseBlock(!1,void 0,n&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};_.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0};_.checkParams=function(e,t){for(var i=Object.create(null),r=0,a=e.params;r<a.length;r+=1){var s=a[r];this.checkLValInnerPattern(s,nt,t?null:i)}};_.parseExprList=function(e,t,i,r){for(var a=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(l.comma),t&&this.afterTrailingComma(e))break;var n=void 0;i&&this.type===l.comma?n=null:this.type===l.ellipsis?(n=this.parseSpread(r),r&&this.type===l.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):n=this.parseMaybeAssign(!1,r),a.push(n)}return a};_.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var a=this.strict?this.reservedWordsStrict:this.reservedWords;a.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}};_.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};_.parseIdentNode=function(){var e=this.startNode();return this.type===l.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=l.name):this.unexpected(),e};_.parsePrivateIdent=function(){var e=this.startNode();return this.type===l.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};_.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===l.semi||this.canInsertSemicolon()||this.type!==l.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(l.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};_.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var De=M.prototype;De.raise=function(e,t){var i=Lt(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};De.raiseRecoverable=De.raise;De.curPosition=function(){if(this.options.locations)return new Ne(this.curLine,this.pos-this.lineStart)};var le=M.prototype,ji=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};le.enterScope=function(e){this.scopeStack.push(new ji(e))};le.exitScope=function(){this.scopeStack.pop()};le.treatFunctionsAsVarInScope=function(e){return e.flags&be||!this.inModule&&e.flags&_e};le.declareName=function(e,t,i){var r=!1;if(t===ne){var a=this.currentScope();r=a.lexical.indexOf(e)>-1||a.functions.indexOf(e)>-1||a.var.indexOf(e)>-1,a.lexical.push(e),this.inModule&&a.flags&_e&&delete this.undefinedExports[e]}else if(t===Ft){var s=this.currentScope();s.lexical.push(e)}else if(t===Ot){var n=this.currentScope();this.treatFunctionsAsVar?r=n.lexical.indexOf(e)>-1:r=n.lexical.indexOf(e)>-1||n.var.indexOf(e)>-1,n.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var u=this.scopeStack[o];if(u.lexical.indexOf(e)>-1&&!(u.flags&Bt&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&_e&&delete this.undefinedExports[e],u.flags&rt)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};le.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};le.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};le.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&rt)return t}};le.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&rt&&!(t.flags&Rt))return t}};var Fe=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new je(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},ke=M.prototype;ke.startNode=function(){return new Fe(this,this.start,this.startLoc)};ke.startNodeAt=function(e,t){return new Fe(this,e,t)};function Ut(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}ke.finishNode=function(e,t){return Ut.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ke.finishNodeAt=function(e,t,i,r){return Ut.call(this,e,t,i,r)};ke.copyNode=function(e){var t=new Fe(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Oi="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Gt="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",Ht=Gt+" Extended_Pictographic",zt=Ht,Kt=zt+" EBase EComp EMod EPres ExtPict",Qt=Kt,Fi=Qt,Wi={9:Gt,10:Ht,11:zt,12:Kt,13:Qt,14:Fi},$i="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",qi={9:"",10:"",11:"",12:"",13:"",14:$i},gt="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",Xt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Yt=Xt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Zt=Yt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Jt=Zt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ei=Jt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Ui=ei+" "+Oi,Gi={9:Xt,10:Yt,11:Zt,12:Jt,13:ei,14:Ui},ti={};function Hi(e){var t=ti[e]={binary:oe(Wi[e]+" "+gt),binaryOfStrings:oe(qi[e]),nonBinary:{General_Category:oe(gt),Script:oe(Gi[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var He=0,xt=[9,10,11,12,13,14];He<xt.length;He+=1){var zi=xt[He];Hi(zi)}var S=M.prototype,Re=function(t,i){this.parent=t,this.base=i||this};Re.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return!0;return!1};Re.prototype.sibling=function(){return new Re(this.parent,this.base)};var ee=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ti[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};ee.prototype.reset=function(t,i,r){var a=r.indexOf("v")!==-1,s=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,a&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=s&&this.parser.options.ecmaVersion>=9)};ee.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};ee.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,a=r.length;if(t>=a)return-1;var s=r.charCodeAt(t);if(!(i||this.switchU)||s<=55295||s>=57344||t+1>=a)return s;var n=r.charCodeAt(t+1);return n>=56320&&n<=57343?(s<<10)+n-56613888:s};ee.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,a=r.length;if(t>=a)return a;var s=r.charCodeAt(t),n;return!(i||this.switchU)||s<=55295||s>=57344||t+1>=a||(n=r.charCodeAt(t+1))<56320||n>57343?t+1:t+2};ee.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};ee.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};ee.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};ee.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};ee.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var r=this.pos,a=0,s=t;a<s.length;a+=1){var n=s[a],o=this.at(r,i);if(o===-1||o!==n)return!1;r=this.nextIndex(r,i)}return this.pos=r,!0};S.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=!1,a=!1,s=0;s<i.length;s++){var n=i.charAt(s);t.indexOf(n)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(n,s+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),n==="u"&&(r=!0),n==="v"&&(a=!0)}this.options.ecmaVersion>=15&&r&&a&&this.raise(e.start,"Invalid regular expression flag")};function Ki(e){for(var t in e)return!0;return!1}S.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Ki(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};S.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced")}};S.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Re(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};S.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};S.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};S.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};S.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};S.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};S.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,a=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue),e.eat(125)))return a!==-1&&a<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};S.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};S.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};S.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var a=0;a<i.length;a++){var s=i.charAt(a);i.indexOf(s,a+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(r){var n=this.regexp_eatModifiers(e);!i&&!n&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var o=0;o<n.length;o++){var u=n.charAt(o);(n.indexOf(u,o+1)>-1||i.indexOf(u)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};S.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};S.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&Qi(i);)t+=re(i),e.advance();return t};function Qi(e){return e===105||e===109||e===115}S.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};S.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};S.regexp_eatSyntaxCharacter=function(e){var t=e.current();return ii(t)?(e.lastIntValue=t,e.advance(),!0):!1};function ii(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}S.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!ii(i);)e.advance();return e.pos!==t};S.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};S.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,a=i;r<a.length;r+=1){var s=a[r];s.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};S.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};S.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=re(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=re(e.lastIntValue);return!0}return!1};S.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Xi(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Xi(e){return ie(e,!0)||e===36||e===95}S.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Yi(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Yi(e){return de(e,!0)||e===36||e===95||e===8204||e===8205}S.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};S.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};S.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};S.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};S.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};S.regexp_eatZero=function(e){return e.current()===48&&!We(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};S.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};S.regexp_eatControlLetter=function(e){var t=e.current();return ri(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function ri(e){return e>=65&&e<=90||e>=97&&e<=122}S.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(r&&a>=55296&&a<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(n>=56320&&n<=57343)return e.lastIntValue=(a-55296)*1024+(n-56320)+65536,!0}e.pos=s,e.lastIntValue=a}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Zi(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Zi(e){return e>=0&&e<=1114111}S.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};S.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var ai=0,ae=1,G=2;S.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Ji(t))return e.lastIntValue=-1,e.advance(),ae;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===G&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return ai};function Ji(e){return e===100||e===68||e===115||e===83||e===119||e===87}S.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),ae}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,a)}return ai};S.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){ye(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};S.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return ae;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return G;e.raise("Invalid property name")};S.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";ni(t=e.current());)e.lastStringValue+=re(t),e.advance();return e.lastStringValue!==""};function ni(e){return ri(e)||e===95}S.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";er(t=e.current());)e.lastStringValue+=re(t),e.advance();return e.lastStringValue!==""};function er(e){return ni(e)||We(e)}S.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};S.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===G&&e.raise("Negated character class may contain strings"),!0}return!1};S.regexp_classContents=function(e){return e.current()===93?ae:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ae)};S.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};S.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||ui(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};S.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};S.regexp_classSetExpression=function(e){var t=ae,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===G&&(t=G);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==G&&(t=ae);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===G&&(t=G)}};S.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};S.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ae:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};S.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===G&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var a=this.regexp_eatCharacterClassEscape(e);if(a)return a;e.pos=t}return null};S.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null};S.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===G&&(t=G);return t};S.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?ae:G};S.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&tr(i)||ir(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function tr(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function ir(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}S.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return rr(t)?(e.lastIntValue=t,e.advance(),!0):!1};function rr(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}S.regexp_eatClassControlLetter=function(e){var t=e.current();return We(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};S.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};S.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;We(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function We(e){return e>=48&&e<=57}S.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;si(i=e.current());)e.lastIntValue=16*e.lastIntValue+oi(i),e.advance();return e.pos!==t};function si(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function oi(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}S.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};S.regexp_eatOctalDigit=function(e){var t=e.current();return ui(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function ui(e){return e>=48&&e<=55}S.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var a=e.current();if(!si(a))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+oi(a),e.advance()}return!0};var ot=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new je(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},I=M.prototype;I.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ot(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};I.getToken=function(){return this.next(),new ot(this)};typeof Symbol<"u"&&(I[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===l.eof,value:t}}}});I.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(l.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};I.readToken=function(e){return ie(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};I.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};I.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,a=t;(r=Vt(this.input,a,this.pos))>-1;)++this.curLine,a=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};I.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!xe(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};I.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){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(e>8&&e<14||e>=5760&&Tt.test(String.fromCharCode(e)))++this.pos;else break e}}};I.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};I.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(l.ellipsis)):(++this.pos,this.finishToken(l.dot))};I.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(l.assign,2):this.finishOp(l.slash,1)};I.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?l.star:l.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=l.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(l.assign,i+1):this.finishOp(r,i)};I.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(l.assign,3)}return this.finishOp(e===124?l.logicalOR:l.logicalAND,2)}return t===61?this.finishOp(l.assign,2):this.finishOp(e===124?l.bitwiseOR:l.bitwiseAND,1)};I.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(l.assign,2):this.finishOp(l.bitwiseXOR,1)};I.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||H.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(l.incDec,2):t===61?this.finishOp(l.assign,2):this.finishOp(l.plusMin,1)};I.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(l.assign,i+1):this.finishOp(l.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(l.relational,i))};I.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(l.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(l.arrow)):this.finishOp(e===61?l.eq:l.prefix,1)};I.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(l.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(l.assign,3)}return this.finishOp(l.coalesce,2)}}return this.finishOp(l.question,1)};I.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),ie(t,!0)||t===92))return this.finishToken(l.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+re(t)+"'")};I.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(l.parenL);case 41:return++this.pos,this.finishToken(l.parenR);case 59:return++this.pos,this.finishToken(l.semi);case 44:return++this.pos,this.finishToken(l.comma);case 91:return++this.pos,this.finishToken(l.bracketL);case 93:return++this.pos,this.finishToken(l.bracketR);case 123:return++this.pos,this.finishToken(l.braceL);case 125:return++this.pos,this.finishToken(l.braceR);case 58:return++this.pos,this.finishToken(l.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(l.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(l.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+re(e)+"'")};I.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};I.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(H.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var a=this.input.slice(i,this.pos);++this.pos;var s=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new ee(this));o.reset(i,a,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(a,n)}catch{}return this.finishToken(l.regexp,{pattern:a,flags:n,value:u})};I.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,a=i&&this.input.charCodeAt(this.pos)===48,s=this.pos,n=0,o=0,u=0,c=t??1/0;u<c;++u,++this.pos){var p=this.input.charCodeAt(this.pos),m=void 0;if(r&&p===95){a&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=p;continue}if(p>=97?m=p-97+10:p>=65?m=p-65+10:p>=48&&p<=57?m=p-48:m=1/0,m>=e)break;o=p,n=n*e+m}return r&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||t!=null&&this.pos-s!==t?null:n};function ar(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function ci(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}I.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=ci(this.input.slice(t,this.pos)),++this.pos):ie(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(l.num,i)};I.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var a=ci(this.input.slice(t,this.pos));return++this.pos,ie(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(l.num,a)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),ie(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s=ar(this.input.slice(t,this.pos),i);return this.finishToken(l.num,s)};I.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};I.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(xe(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(l.string,t)};var li={};I.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===li)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};I.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw li;this.raise(e,t)};I.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===l.template||this.type===l.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(l.dollarBraceL)):(++this.pos,this.finishToken(l.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(l.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(xe(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
23
|
+
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};I.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(l.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
|
|
24
24
|
`&&++this.pos;case`
|
|
25
|
-
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};
|
|
26
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return
|
|
27
|
-
`),
|
|
28
|
-
`,s):(e.write("/*"),Ki(e,s.value,i,r),e.write("*/"+r))}}function Qi(e){let t=e;for(;t!=null;){const{type:i}=t;if(i[0]==="C"&&i[1]==="a")return!0;if(i[0]==="M"&&i[1]==="e"&&i[2]==="m")t=t.object;else return!1}}function Re(e,t){const{generator:i}=e,{declarations:r}=t;e.write(t.kind+" ");const{length:a}=r;if(a>0){i.VariableDeclarator(r[0],e);for(let n=1;n<a;n++)e.write(", "),i.VariableDeclarator(r[n],e)}}let nt,st,ot,ut,ct,pt;const Yi={Program(e,t){const i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:a}=t;a&&e.comments!=null&&T(t,e.comments,i,r);const n=e.body,{length:s}=n;for(let u=0;u<s;u++){const c=n[u];a&&c.comments!=null&&T(t,c.comments,i,r),t.write(i),this[c.type](c,t),t.write(r)}a&&e.trailingComments!=null&&T(t,e.trailingComments,i,r)},BlockStatement:pt=function(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:a}=t,n=i+t.indent;t.write("{");const s=e.body;if(s!=null&&s.length>0){t.write(r),a&&e.comments!=null&&T(t,e.comments,n,r);const{length:u}=s;for(let c=0;c<u;c++){const p=s[c];a&&p.comments!=null&&T(t,p.comments,n,r),t.write(n),this[p.type](p,t),t.write(r)}t.write(i)}else a&&e.comments!=null&&(t.write(r),T(t,e.comments,n,r),t.write(i));a&&e.trailingComments!=null&&T(t,e.trailingComments,n,r),t.write("}"),t.indentLevel--},ClassBody:pt,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){const i=t.expressionsPrecedence[e.expression.type];i===z||i===3&&e.expression.left.type[0]==="O"?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),e.alternate!=null&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:a}=t;t.indentLevel++;const n=i+t.indent,s=n+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);const{cases:u}=e,{length:c}=u;for(let p=0;p<c;p++){const l=u[p];a&&l.comments!=null&&T(t,l.comments,n,r),l.test?(t.write(n+"case "),this[l.test.type](l.test,t),t.write(":"+r)):t.write(n+"default:"+r);const{consequent:x}=l,{length:d}=x;for(let h=0;h<d;h++){const g=x[h];a&&g.comments!=null&&T(t,g.comments,s,r),t.write(s),this[g.type](g,t),t.write(r)}}t.indentLevel-=2,t.write(i+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){const{handler:i}=e;i.param==null?t.write(" catch "):(t.write(" catch ("),this[i.param.type](i.param,t),t.write(") ")),this[i.body.type](i.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),e.init!=null){const{init:i}=e;i.type[0]==="V"?Re(t,i):this[i.type](i,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:nt=function(e,t){t.write(`for ${e.await?"await ":""}(`);const{left:i}=e;i.type[0]==="V"?Re(t,i):this[i.type](i,t),t.write(e.type[3]==="I"?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:nt,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:st=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),oe(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:st,VariableDeclaration(e,t){Re(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),e.init!=null&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");const{superClass:i}=e,{type:r}=i,a=t.expressionsPrecedence[r];(r[0]!=="C"||r[1]!=="l"||r[5]!=="E")&&(a===z||a<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");const{specifiers:i,attributes:r}=e,{length:a}=i;let n=0;if(a>0){for(;n<a;){n>0&&t.write(", ");const s=i[n],u=s.type[6];if(u==="D")t.write(s.local.name,s),n++;else if(u==="N")t.write("* as "+s.local.name,s),n++;else break}if(n<a){for(t.write("{");;){const s=i[n],{name:u}=s.imported;if(t.write(u,s),u!==s.local.name&&t.write(" as "+s.local.name),++n<a)t.write(", ");else break}t.write("}")}t.write(" from ")}if(this.Literal(e.source,t),r&&r.length>0){t.write(" with { ");for(let s=0;s<r.length;s++)this.ImportAttribute(r[s],t),s<r.length-1&&t.write(", ");t.write(" }")}t.write(";")},ImportAttribute(e,t){this.Identifier(e.key,t),t.write(": "),this.Literal(e.value,t)},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),t.expressionsPrecedence[e.declaration.type]!=null&&e.declaration.type[0]!=="F"&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");const{specifiers:i}=e,{length:r}=i;if(r>0)for(let a=0;;){const n=i[a],{name:s}=n.local;if(t.write(s,n),s!==n.exported.name&&t.write(" as "+n.exported.name),++a<r)t.write(", ");else break}if(t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let a=0;a<e.attributes.length;a++)this.ImportAttribute(e.attributes[a],t),a<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")}},ExportAllDeclaration(e,t){if(e.exported!=null?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let i=0;i<e.attributes.length;i++)this.ImportAttribute(e.attributes[i],t),i<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");const i=e.kind[0];(i==="g"||i==="s")&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),oe(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);const{params:i}=e;i!=null&&(i.length===1&&i[0].type[0]==="I"?t.write(i[0].name,i[0]):oe(t,e.params)),t.write(" => "),e.body.type[0]==="O"?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:ot=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:ot,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),Ce(t,e.argument,e)},TemplateLiteral(e,t){const{quasis:i,expressions:r}=e;t.write("`");const{length:a}=r;for(let s=0;s<a;s++){const u=r[s],c=i[s];t.write(c.value.raw,c),t.write("${"),this[u.type](u,t),t.write("}")}const n=i[i.length-1];t.write(n.value.raw,n),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){Ce(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:ct=function(e,t){if(t.write("["),e.elements.length>0){const{elements:i}=e,{length:r}=i;for(let a=0;;){const n=i[a];if(n!=null&&this[n.type](n,t),++a<r)t.write(", ");else{n==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:ct,ObjectExpression(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:a}=t,n=i+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),a&&e.comments!=null&&T(t,e.comments,n,r);const s=","+r,{properties:u}=e,{length:c}=u;for(let p=0;;){const l=u[p];if(a&&l.comments!=null&&T(t,l.comments,n,r),t.write(n),this[l.type](l,t),++p<c)t.write(s);else break}t.write(r),a&&e.trailingComments!=null&&T(t,e.trailingComments,n,r),t.write(i+"}")}else a?e.comments!=null?(t.write(r),T(t,e.comments,n,r),e.trailingComments!=null&&T(t,e.trailingComments,n,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),T(t,e.trailingComments,n,r),t.write(i+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||e.kind[0]!=="i"?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),e.value==null){e.key.type[0]!=="F"&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){const{properties:i}=e,{length:r}=i;for(let a=0;this[i[a].type](i[a],t),++a<r;)t.write(", ")}t.write("}")},SequenceExpression(e,t){oe(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){const{operator:i,argument:r,argument:{type:a}}=e;t.write(i);const n=Xt(t,r,e);!n&&(i.length>1||a[0]==="U"&&(a[1]==="n"||a[1]==="p")&&r.prefix&&r.operator[0]===i&&(i==="+"||i==="-"))&&t.write(" "),n?(t.write(i.length>1?" (":"("),this[a](r,t),t.write(")")):this[a](r,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:ut=function(e,t){const i=e.operator==="in";i&&t.write("("),Ce(t,e.left,e,!1),t.write(" "+e.operator+" "),Ce(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:ut,ConditionalExpression(e,t){const{test:i}=e,r=t.expressionsPrecedence[i.type];r===z||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[i.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");const i=t.expressionsPrecedence[e.callee.type];i===z||i<t.expressionsPrecedence.CallExpression||Qi(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),oe(t,e.arguments)},CallExpression(e,t){const i=t.expressionsPrecedence[e.callee.type];i===z||i<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),oe(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){const i=t.expressionsPrecedence[e.object.type];i===z||i<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){e.raw!=null?t.write(e.raw,e):e.regex!=null?this.RegExpLiteral(e,t):e.bigint!=null?t.write(e.bigint+"n",e):t.write(zi(e.value),e)},RegExpLiteral(e,t){const{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},Xi={};class Zi{constructor(t){const i=t??Xi;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:Yi,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:Hi,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
|
|
25
|
+
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};I.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
26
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return re(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(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],a=parseInt(r,8);return a>255&&(r=r.slice(0,-1),a=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(a)}return xe(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};I.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};I.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var a=this.fullCharCodeAtPos();if(de(a,r))this.pos+=a<=65535?1:2;else if(a===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var s=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var n=this.readCodePoint();(t?ie:de)(n,r)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=re(n),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};I.readWord=function(){var e=this.readWord1(),t=l.name;return this.keywords.test(e)&&(t=et[e]),this.finishToken(t,e)};var nr="8.14.0";M.acorn={Parser:M,version:nr,defaultOptions:Xe,Position:Ne,SourceLocation:je,getLineInfo:Lt,Node:Fe,TokenType:P,tokTypes:l,keywordTypes:et,TokContext:Q,tokContexts:V,isIdentifierChar:de,isIdentifierStart:ie,Token:ot,isNewLine:xe,lineBreak:H,lineBreakG:ki,nonASCIIwhitespace:Tt};function pi(e,t){return M.parse(e,t)}const{stringify:sr}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");const Pe={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},X=17,or={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:X,ClassExpression:X,FunctionExpression:X,ObjectExpression:X,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function me(e,t){const{generator:i}=e;if(e.write("("),t!=null&&t.length>0){i[t[0].type](t[0],e);const{length:r}=t;for(let a=1;a<r;a++){const s=t[a];e.write(", "),i[s.type](s,e)}}e.write(")")}function hi(e,t,i,r){const a=e.expressionsPrecedence[t.type];if(a===X)return!0;const s=e.expressionsPrecedence[i.type];return a!==s?!r&&a===15&&s===14&&i.operator==="**"||a<s:a!==13&&a!==14?!1:t.operator==="**"&&i.operator==="**"?!r:a===13&&s===13&&(t.operator==="??"||i.operator==="??")?!0:r?Pe[t.operator]<=Pe[i.operator]:Pe[t.operator]<Pe[i.operator]}function Ve(e,t,i,r){const{generator:a}=e;hi(e,t,i,r)?(e.write("("),a[t.type](t,e),e.write(")")):a[t.type](t,e)}function ur(e,t,i,r){const a=t.split(`
|
|
27
|
+
`),s=a.length-1;if(e.write(a[0].trim()),s>0){e.write(r);for(let n=1;n<s;n++)e.write(i+a[n].trim()+r);e.write(i+a[s].trim())}}function R(e,t,i,r){const{length:a}=t;for(let s=0;s<a;s++){const n=t[s];e.write(i),n.type[0]==="L"?e.write("// "+n.value.trim()+`
|
|
28
|
+
`,n):(e.write("/*"),ur(e,n.value,i,r),e.write("*/"+r))}}function cr(e){let t=e;for(;t!=null;){const{type:i}=t;if(i[0]==="C"&&i[1]==="a")return!0;if(i[0]==="M"&&i[1]==="e"&&i[2]==="m")t=t.object;else return!1}}function ze(e,t){const{generator:i}=e,{declarations:r}=t;e.write(t.kind+" ");const{length:a}=r;if(a>0){i.VariableDeclarator(r[0],e);for(let s=1;s<a;s++)e.write(", "),i.VariableDeclarator(r[s],e)}}let yt,bt,vt,wt,St,Ct;const ut={Program(e,t){const i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:a}=t;a&&e.comments!=null&&R(t,e.comments,i,r);const s=e.body,{length:n}=s;for(let o=0;o<n;o++){const u=s[o];a&&u.comments!=null&&R(t,u.comments,i,r),t.write(i),this[u.type](u,t),t.write(r)}a&&e.trailingComments!=null&&R(t,e.trailingComments,i,r)},BlockStatement:Ct=function(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:a}=t,s=i+t.indent;t.write("{");const n=e.body;if(n!=null&&n.length>0){t.write(r),a&&e.comments!=null&&R(t,e.comments,s,r);const{length:o}=n;for(let u=0;u<o;u++){const c=n[u];a&&c.comments!=null&&R(t,c.comments,s,r),t.write(s),this[c.type](c,t),t.write(r)}t.write(i)}else a&&e.comments!=null&&(t.write(r),R(t,e.comments,s,r),t.write(i));a&&e.trailingComments!=null&&R(t,e.trailingComments,s,r),t.write("}"),t.indentLevel--},ClassBody:Ct,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){const i=t.expressionsPrecedence[e.expression.type];i===X||i===3&&e.expression.left.type[0]==="O"?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),e.alternate!=null&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:a}=t;t.indentLevel++;const s=i+t.indent,n=s+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);const{cases:o}=e,{length:u}=o;for(let c=0;c<u;c++){const p=o[c];a&&p.comments!=null&&R(t,p.comments,s,r),p.test?(t.write(s+"case "),this[p.test.type](p.test,t),t.write(":"+r)):t.write(s+"default:"+r);const{consequent:m}=p,{length:d}=m;for(let h=0;h<d;h++){const g=m[h];a&&g.comments!=null&&R(t,g.comments,n,r),t.write(n),this[g.type](g,t),t.write(r)}}t.indentLevel-=2,t.write(i+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){const{handler:i}=e;i.param==null?t.write(" catch "):(t.write(" catch ("),this[i.param.type](i.param,t),t.write(") ")),this[i.body.type](i.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),e.init!=null){const{init:i}=e;i.type[0]==="V"?ze(t,i):this[i.type](i,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:yt=function(e,t){t.write(`for ${e.await?"await ":""}(`);const{left:i}=e;i.type[0]==="V"?ze(t,i):this[i.type](i,t),t.write(e.type[3]==="I"?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:yt,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:bt=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),me(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:bt,VariableDeclaration(e,t){ze(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),e.init!=null&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");const{superClass:i}=e,{type:r}=i,a=t.expressionsPrecedence[r];(r[0]!=="C"||r[1]!=="l"||r[5]!=="E")&&(a===X||a<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");const{specifiers:i,attributes:r}=e,{length:a}=i;let s=0;if(a>0){for(;s<a;){s>0&&t.write(", ");const n=i[s],o=n.type[6];if(o==="D")t.write(n.local.name,n),s++;else if(o==="N")t.write("* as "+n.local.name,n),s++;else break}if(s<a){for(t.write("{");;){const n=i[s],{name:o}=n.imported;if(t.write(o,n),o!==n.local.name&&t.write(" as "+n.local.name),++s<a)t.write(", ");else break}t.write("}")}t.write(" from ")}if(this.Literal(e.source,t),r&&r.length>0){t.write(" with { ");for(let n=0;n<r.length;n++)this.ImportAttribute(r[n],t),n<r.length-1&&t.write(", ");t.write(" }")}t.write(";")},ImportAttribute(e,t){this.Identifier(e.key,t),t.write(": "),this.Literal(e.value,t)},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),t.expressionsPrecedence[e.declaration.type]!=null&&e.declaration.type[0]!=="F"&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");const{specifiers:i}=e,{length:r}=i;if(r>0)for(let a=0;;){const s=i[a],{name:n}=s.local;if(t.write(n,s),n!==s.exported.name&&t.write(" as "+s.exported.name),++a<r)t.write(", ");else break}if(t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let a=0;a<e.attributes.length;a++)this.ImportAttribute(e.attributes[a],t),a<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")}},ExportAllDeclaration(e,t){if(e.exported!=null?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let i=0;i<e.attributes.length;i++)this.ImportAttribute(e.attributes[i],t),i<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");const i=e.kind[0];(i==="g"||i==="s")&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),me(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);const{params:i}=e;i!=null&&(i.length===1&&i[0].type[0]==="I"?t.write(i[0].name,i[0]):me(t,e.params)),t.write(" => "),e.body.type[0]==="O"?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:vt=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:vt,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),Ve(t,e.argument,e)},TemplateLiteral(e,t){const{quasis:i,expressions:r}=e;t.write("`");const{length:a}=r;for(let n=0;n<a;n++){const o=r[n],u=i[n];t.write(u.value.raw,u),t.write("${"),this[o.type](o,t),t.write("}")}const s=i[i.length-1];t.write(s.value.raw,s),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){Ve(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:St=function(e,t){if(t.write("["),e.elements.length>0){const{elements:i}=e,{length:r}=i;for(let a=0;;){const s=i[a];if(s!=null&&this[s.type](s,t),++a<r)t.write(", ");else{s==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:St,ObjectExpression(e,t){const i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:a}=t,s=i+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),a&&e.comments!=null&&R(t,e.comments,s,r);const n=","+r,{properties:o}=e,{length:u}=o;for(let c=0;;){const p=o[c];if(a&&p.comments!=null&&R(t,p.comments,s,r),t.write(s),this[p.type](p,t),++c<u)t.write(n);else break}t.write(r),a&&e.trailingComments!=null&&R(t,e.trailingComments,s,r),t.write(i+"}")}else a?e.comments!=null?(t.write(r),R(t,e.comments,s,r),e.trailingComments!=null&&R(t,e.trailingComments,s,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),R(t,e.trailingComments,s,r),t.write(i+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||e.kind[0]!=="i"?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),e.value==null){e.key.type[0]!=="F"&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){const{properties:i}=e,{length:r}=i;for(let a=0;this[i[a].type](i[a],t),++a<r;)t.write(", ")}t.write("}")},SequenceExpression(e,t){me(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){const{operator:i,argument:r,argument:{type:a}}=e;t.write(i);const s=hi(t,r,e);!s&&(i.length>1||a[0]==="U"&&(a[1]==="n"||a[1]==="p")&&r.prefix&&r.operator[0]===i&&(i==="+"||i==="-"))&&t.write(" "),s?(t.write(i.length>1?" (":"("),this[a](r,t),t.write(")")):this[a](r,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:wt=function(e,t){const i=e.operator==="in";i&&t.write("("),Ve(t,e.left,e,!1),t.write(" "+e.operator+" "),Ve(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:wt,ConditionalExpression(e,t){const{test:i}=e,r=t.expressionsPrecedence[i.type];r===X||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[i.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");const i=t.expressionsPrecedence[e.callee.type];i===X||i<t.expressionsPrecedence.CallExpression||cr(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),me(t,e.arguments)},CallExpression(e,t){const i=t.expressionsPrecedence[e.callee.type];i===X||i<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),me(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){const i=t.expressionsPrecedence[e.object.type];i===X||i<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){e.raw!=null?t.write(e.raw,e):e.regex!=null?this.RegExpLiteral(e,t):e.bigint!=null?t.write(e.bigint+"n",e):t.write(sr(e.value),e)},RegExpLiteral(e,t){const{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},lr={},pr=ut;class hr{constructor(t){const i=t??lr;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:ut,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:or,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
|
|
29
29
|
`,this.indentLevel=i.startingIndentLevel!=null?i.startingIndentLevel:0,this.writeComments=i.comments?i.comments:!1,i.sourceMap!=null&&(this.write=i.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=i.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
|
|
30
|
-
`).length-1,this.mapping={original:null,generated:this,name:void 0,source:i.sourceMap.file||i.sourceMap._file})}write(t){this.output+=t}writeToStream(t){this.output.write(t)}writeAndMap(t,i){this.output+=t,this.map(t,i)}writeToStreamAndMap(t,i){this.output.write(t),this.map(t,i)}map(t,i){if(i!=null){const{type:
|
|
31
|
-
`?(u=0,c++):u++;this.column=u,this.line=c;return}}const{length:r}=t,{lineEnd:a}=this;r>0&&(this.lineEndSize>0&&(a.length===1?t[r-1]===a:t.endsWith(a))?(this.line+=this.lineEndSize,this.column=0):this.column+=r)}toString(){return this.output}}function Ji(e,t){const i=new Zi(t);return i.generator[e.type](e,i),i.output}class er{scopes=[];scopeTypes=[];scopeCounts=new Map;contextBoundVars=new Set;arrayPatternElements=new Set;rootParams=new Set;varKinds=new Map;loopVars=new Set;loopVarNames=new Map;paramIdCounter=0;cacheIdCounter=0;tempVarCounter=0;taCallIdCounter=0;get nextParamIdArg(){return{type:"Identifier",name:`'p${this.paramIdCounter++}'`}}get nextCacheIdArg(){return{type:"Identifier",name:`'cache_${this.cacheIdCounter++}'`}}getNextTACallId(){return{type:"Literal",value:`_ta${this.taCallIdCounter++}`}}constructor(){this.pushScope("glb")}pushScope(t){this.scopes.push(new Map),this.scopeTypes.push(t),this.scopeCounts.set(t,(this.scopeCounts.get(t)||0)+1)}popScope(){this.scopes.pop(),this.scopeTypes.pop()}getCurrentScopeType(){return this.scopeTypes[this.scopeTypes.length-1]}getCurrentScopeCount(){return this.scopeCounts.get(this.getCurrentScopeType())||1}addContextBoundVar(t,i=!1){this.contextBoundVars.add(t),i&&this.rootParams.add(t)}removeContextBoundVar(t){this.contextBoundVars.has(t)&&(this.contextBoundVars.delete(t),this.rootParams.has(t)&&this.rootParams.delete(t))}addArrayPatternElement(t){this.arrayPatternElements.add(t)}isContextBound(t){return this.contextBoundVars.has(t)}isArrayPatternElement(t){return this.arrayPatternElements.has(t)}isRootParam(t){return this.rootParams.has(t)}addLoopVariable(t,i){this.loopVars.add(t),this.loopVarNames.set(t,i)}getLoopVariableName(t){return this.loopVarNames.get(t)}isLoopVariable(t){return this.loopVars.has(t)}addVariable(t,i){if(this.isContextBound(t))return t;const r=this.scopes[this.scopes.length-1],a=this.scopeTypes[this.scopeTypes.length-1],n=this.scopeCounts.get(a)||1,s=`${a}${n}_${t}`;return r.set(t,s),this.varKinds.set(s,i),s}getVariable(t){if(this.loopVars.has(t)){const i=this.loopVarNames.get(t);if(i)return[i,"let"]}if(this.isContextBound(t))return[t,"let"];for(let i=this.scopes.length-1;i>=0;i--){const r=this.scopes[i];if(r.has(t)){const a=r.get(t),n=this.varKinds.get(a)||"let";return[a,n]}}return[t,"let"]}generateTempVar(){return`temp_${++this.tempVarCounter}`}}function Ze(e,t,i,r,a){i||(i=m),function n(s,u,c){var p=c||s.type;i[p](s,u,n),t[p]&&t[p](s,u)}(e,r,a)}function L(e,t,i,r,a){var n=i?tr(i,r||void 0):r;(function s(u,c,p){n[p||u.type](u,c,s)})(e,t,a)}function tr(e,t){var i=Object.create(t||m);for(var r in e)i[r]=e[r];return i}function Je(e,t,i){i(e,t)}function se(e,t,i){}var m={};m.Program=m.BlockStatement=m.StaticBlock=function(e,t,i){for(var r=0,a=e.body;r<a.length;r+=1){var n=a[r];i(n,t,"Statement")}};m.Statement=Je;m.EmptyStatement=se;m.ExpressionStatement=m.ParenthesizedExpression=m.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};m.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement")};m.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};m.BreakStatement=m.ContinueStatement=se;m.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement")};m.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,a=e.cases;r<a.length;r+=1){var n=a[r];i(n,t)}};m.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,a=e.consequent;r<a.length;r+=1){var n=a[r];i(n,t,"Statement")}};m.ReturnStatement=m.YieldExpression=m.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression")};m.ThrowStatement=m.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};m.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement")};m.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement")};m.WhileStatement=m.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement")};m.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement")};m.ForInStatement=m.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement")};m.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression")};m.DebuggerStatement=se;m.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};m.VariableDeclaration=function(e,t,i){for(var r=0,a=e.declarations;r<a.length;r+=1){var n=a[r];i(n,t)}};m.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression")};m.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,a=e.params;r<a.length;r+=1){var n=a[r];i(n,t,"Pattern")}i(e.body,t,e.expression?"Expression":"Statement")};m.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t)};m.VariablePattern=se;m.MemberPattern=Je;m.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};m.ArrayPattern=function(e,t,i){for(var r=0,a=e.elements;r<a.length;r+=1){var n=a[r];n&&i(n,t,"Pattern")}};m.ObjectPattern=function(e,t,i){for(var r=0,a=e.properties;r<a.length;r+=1){var n=a[r];n.type==="Property"?(n.computed&&i(n.key,t,"Expression"),i(n.value,t,"Pattern")):n.type==="RestElement"&&i(n.argument,t,"Pattern")}};m.Expression=Je;m.ThisExpression=m.Super=m.MetaProperty=se;m.ArrayExpression=function(e,t,i){for(var r=0,a=e.elements;r<a.length;r+=1){var n=a[r];n&&i(n,t,"Expression")}};m.ObjectExpression=function(e,t,i){for(var r=0,a=e.properties;r<a.length;r+=1){var n=a[r];i(n,t)}};m.FunctionExpression=m.ArrowFunctionExpression=m.FunctionDeclaration;m.SequenceExpression=function(e,t,i){for(var r=0,a=e.expressions;r<a.length;r+=1){var n=a[r];i(n,t,"Expression")}};m.TemplateLiteral=function(e,t,i){for(var r=0,a=e.quasis;r<a.length;r+=1){var n=a[r];i(n,t)}for(var s=0,u=e.expressions;s<u.length;s+=1){var c=u[s];i(c,t,"Expression")}};m.TemplateElement=se;m.UnaryExpression=m.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression")};m.BinaryExpression=m.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression")};m.AssignmentExpression=m.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression")};m.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression")};m.NewExpression=m.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,a=e.arguments;r<a.length;r+=1){var n=a[r];i(n,t,"Expression")}};m.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression")};m.ExportNamedDeclaration=m.ExportDefaultDeclaration=function(e,t,i){e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression")};m.ExportAllDeclaration=function(e,t,i){e.exported&&i(e.exported,t),i(e.source,t,"Expression")};m.ImportDeclaration=function(e,t,i){for(var r=0,a=e.specifiers;r<a.length;r+=1){var n=a[r];i(n,t)}i(e.source,t,"Expression")};m.ImportExpression=function(e,t,i){i(e.source,t,"Expression")};m.ImportSpecifier=m.ImportDefaultSpecifier=m.ImportNamespaceSpecifier=m.Identifier=m.PrivateIdentifier=m.Literal=se;m.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression")};m.ClassDeclaration=m.ClassExpression=function(e,t,i){return i(e,t,"Class")};m.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t)};m.ClassBody=function(e,t,i){for(var r=0,a=e.body;r<a.length;r+=1){var n=a[r];i(n,t)}};m.MethodDefinition=m.PropertyDefinition=m.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression")};const V="$",v={createIdentifier(e){return{type:"Identifier",name:e}},createLiteral(e){return{type:"Literal",value:e}},createMemberExpression(e,t,i=!1){return{type:"MemberExpression",object:e,property:t,computed:i}},createContextIdentifier(){return this.createIdentifier(V)},createContextVariableReference(e,t){const i=this.createContextIdentifier(),r=this.createIdentifier(e),a=this.createIdentifier(t);return this.createMemberExpression(this.createMemberExpression(i,r,!1),a,!1)},createContextVariableAccess0(e,t){const i=this.createContextVariableReference(e,t);return this.createArrayAccess(i,0)},createArrayAccess(e,t){const i=typeof t=="number"?this.createLiteral(t):t;return this.createMemberExpression(e,i,!0)},createCallExpression(e,t){return{type:"CallExpression",callee:e,arguments:t}},createAssignmentExpression(e,t,i="="){return{type:"AssignmentExpression",operator:i,left:e,right:t}},createExpressionStatement(e){return{type:"ExpressionStatement",expression:e}},createInitCall(e,t,i){const r=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("init"),!1),a=[e,t];return i&&a.push(i),this.createCallExpression(r,a)},createGetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("get"),!1),r=typeof t=="number"?this.createLiteral(t):t;return this.createCallExpression(i,[e,r])},createSetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("set"),!1);return this.createCallExpression(i,[e,t])},createMathEqCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("math"),!1),r=this.createMemberExpression(i,this.createIdentifier("__eq"),!1);return this.createCallExpression(r,[e,t])},createWrapperFunction(e){return{type:"FunctionDeclaration",id:null,params:[this.createIdentifier("context")],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:e}]}}}};function ir(e){L(e,null,{VariableDeclaration(t,i,r){t.declarations&&t.declarations.length>0&&t.declarations.forEach(a=>{if(a.init&&a.init.type==="ArrowFunctionExpression"&&a.init.start!==0){const n={type:"FunctionDeclaration",id:a.id,params:a.init.params,body:a.init.body.type==="BlockStatement"?a.init.body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:a.init.body}]},async:a.init.async,generator:!1};Object.assign(t,n)}}),t.body&&t.body.body&&t.body.body.forEach(a=>r(a,i))}})}function rr(e,t){Ze(e,{VariableDeclaration(i){i.declarations.forEach(r=>{const a=r.init&&r.init.type==="MemberExpression"&&r.init.object&&(r.init.object.name==="context"||r.init.object.name===V||r.init.object.name==="context2"),n=r.init&&r.init.type==="MemberExpression"&&r.init.object?.object&&(r.init.object.object.name==="context"||r.init.object.object.name===V||r.init.object.object.name==="context2");(a||n)&&(r.id.name&&t.addContextBoundVar(r.id.name),r.id.properties&&r.id.properties.forEach(s=>{s.key.name&&t.addContextBoundVar(s.key.name)}))})}})}function ar(e,t,i=!1){e.params.forEach(r=>{r.type==="Identifier"&&t.addContextBoundVar(r.name,i)})}function nr(e,t){e.params.forEach(i=>{i.type==="Identifier"&&t.addContextBoundVar(i.name,!1)})}function sr(e,t){let i;return Ze(e,{FunctionDeclaration(r){nr(r,t)},ArrowFunctionExpression(r){const a=r.start===0;a&&r.params&&r.params.length>0&&(i=r.params[0].name,r.params[0].name=V),ar(r,t,a)},VariableDeclaration(r){r.declarations.forEach(a=>{if(a.id.type==="ArrayPattern"){const n=t.generateTempVar(),s={type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:n},init:a.init}]};a.id.elements?.forEach(c=>{c.type==="Identifier"&&t.addArrayPatternElement(c.name)});const u=a.id.elements.map((c,p)=>({type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:c,init:{type:"MemberExpression",object:{type:"Identifier",name:n},property:{type:"Literal",value:p},computed:!0}}]}));Object.assign(r,{type:"BlockStatement",body:[s,...u]})}})},ForStatement(r){}}),i}const qe={type:"Identifier",name:"undefined"};function ae(e,t){if(e.computed&&e.property.type==="Identifier"){if(t.isLoopVariable(e.property.name))return;if(!t.isContextBound(e.property.name)){const[i,r]=t.getVariable(e.property.name);e.property=v.createContextVariableReference(r,i),e.property=v.createGetCall(e.property,0)}}if(e.computed&&e.object.type==="Identifier"){if(t.isLoopVariable(e.object.name))return;if(!t.isContextBound(e.object.name)){const[i,r]=t.getVariable(e.object.name);e.object=v.createContextVariableReference(r,i)}if(e.property.type==="MemberExpression"){const i=e.property;i._indexTransformed||(ae(i,t),i._indexTransformed=!0)}}}function Z(e,t){const i=v.createGetCall(v.createIdentifier(e.name),0);e.start!==void 0&&(i.start=e.start),e.end!==void 0&&(i.end=e.end),i._indexTransformed=!0,Object.assign(e,i)}function B(e,t){if(e.name!==V){if(e.name==="Math"||e.name==="NaN"||e.name==="undefined"||e.name==="Infinity"||e.name==="null"||e.name.startsWith("'")&&e.name.endsWith("'")||e.name.startsWith('"')&&e.name.endsWith('"')||e.name.startsWith("`")&&e.name.endsWith("`")||t.isLoopVariable(e.name)||t.isContextBound(e.name)&&!t.isRootParam(e.name))return;const i=e.parent&&e.parent.type==="MemberExpression"&&e.parent.object===e&&t.isContextBound(e.name),r=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee&&e.parent.callee.type==="MemberExpression"&&e.parent.callee.property.name==="param";e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left;const a=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee&&e.parent.callee.type==="MemberExpression"&&t.isContextBound(e.parent.callee.object.name),n=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed,s=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.property===e&&e.parent.parent&&e.parent.parent.type==="CallExpression"&&e.parent.parent.callee&&e.parent.parent.callee.type==="MemberExpression"&&t.isContextBound(e.parent.parent.callee.object.name),u=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e;if(i||r||a||s||u){if(u)return;const[x,d]=t.getVariable(e.name),h=v.createContextVariableReference(d,x);Object.assign(e,h);return}const[c,p]=t.getVariable(e.name),l=v.createContextVariableReference(p,c);if(!(e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.object===e)&&!n){const x=v.createGetCall(l,0);Object.assign(e,x)}else Object.assign(e,l)}}function H(e,t,i){if(e.object&&e.object.type==="Identifier"&&e.object.name==="Math")return;const r=i.getCurrentScopeType()=="if",a=i.getCurrentScopeType()=="els",n=i.getCurrentScopeType()=="for";if(!r&&!a&&!n&&e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)&&!e.computed)return;e._indexTransformed||(ae(e,i),e._indexTransformed=!0);const s=e.object&&e.object.type==="MemberExpression"&&e.object.object&&e.object.object.type==="MemberExpression"&&e.object.object.object&&e.object.object.object.name===V,u=e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name);if(e.computed&&(s||u)){if(e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e)return;const c=v.createGetCall(e.object,e.property);e.start&&(c.start=e.start),e.end&&(c.end=e.end),Object.assign(e,c)}}function me(e,t){if(e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(t.isLoopVariable(e.name))return e;if(t.isRootParam(e.name)){const[a,n]=t.getVariable(e.name);return v.createContextVariableReference(n,a)}if(t.isContextBound(e.name))return e;const[i,r]=t.getVariable(e.name);return v.createContextVariableReference(r,i)}return e}function ge(e,t,i=""){switch(e.type){case"BinaryExpression":return Zt(e,t,i);case"MemberExpression":return{type:"MemberExpression",object:e.object.type==="Identifier"?me(e.object,t):e.object,property:e.property,computed:e.computed};case"Identifier":{if(t.isLoopVariable(e.name)||e.parent&&e.parent.type==="MemberExpression"&&e.parent.property===e)return e;const r=me(e,t);return v.createGetCall(r,0)}case"UnaryExpression":return Jt(e,t,i)}return e}function Zt(e,t,i){const r=ge(e.left,t,i),a=ge(e.right,t,i),n={type:"BinaryExpression",operator:e.operator,left:r,right:a,start:e.start,end:e.end};return L(n,t,{CallExpression(s,u){s._transformed||K(s,u)},MemberExpression(s){H(s,"",t)}}),n}function or(e,t,i){const r=ge(e.left,t,i),a=ge(e.right,t,i),n={type:"LogicalExpression",operator:e.operator,left:r,right:a,start:e.start,end:e.end};return L(n,t,{CallExpression(s,u){s._transformed||K(s,u)}}),n}function ur(e,t,i){return L(e,{parent:e,inNamespaceCall:!1},{Identifier(r,a,n){if(r.name=="NaN")return;if(r.name=="na"){r.name="NaN";return}r.parent=a.parent,B(r,t);const s=r.parent&&r.parent.type==="BinaryExpression";(r.parent&&r.parent.type==="ConditionalExpression"||s)&&(r.type==="MemberExpression"?ae(r,t):r.type==="Identifier"&&(r.parent&&r.parent.type==="CallExpression"&&r.parent.callee&&r.parent.callee.object&&r.parent.callee.object.name===V&&r.parent.callee.property.name==="get"||Z(r)))},MemberExpression(r,a,n){ae(r,t),r.object&&n(r.object,{parent:r,inNamespaceCall:a.inNamespaceCall})},CallExpression(r,a,n){const s=r.callee&&r.callee.type==="MemberExpression"&&r.callee.object&&r.callee.object.type==="Identifier"&&t.isContextBound(r.callee.object.name);K(r,t),r.arguments.forEach(u=>n(u,{parent:r,inNamespaceCall:s||a.inNamespaceCall}))}}),{type:"CallExpression",callee:v.createMemberExpression(v.createIdentifier(i),v.createIdentifier("param")),arguments:[e,qe,t.nextParamIdArg],_transformed:!0,_isParamCall:!0}}function Jt(e,t,i){const r=ge(e.argument,t,i);return{type:"UnaryExpression",operator:e.operator,prefix:e.prefix,argument:r,start:e.start,end:e.end}}function lt(e,t,i){switch(e?.type){case"BinaryExpression":e=Zt(e,i,t);break;case"LogicalExpression":e=or(e,i,t);break;case"ConditionalExpression":return ur(e,i,t);case"UnaryExpression":e=Jt(e,i,t);break}if(e.type==="MemberExpression"&&e.computed&&e.property){const r=e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)?e.object:me(e.object,i),a=e.property.type==="Identifier"&&!i.isContextBound(e.property.name)&&!i.isLoopVariable(e.property.name)?me(e.property,i):e.property;return{type:"CallExpression",callee:v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),arguments:[r,a,i.nextParamIdArg],_transformed:!0,_isParamCall:!0}}if(e.type==="ObjectExpression"&&(e.properties=e.properties.map(r=>{if(r.value.name){const[a,n]=i.getVariable(r.value.name);return{type:"Property",key:{type:"Identifier",name:r.key.name},value:v.createContextVariableReference(n,a),kind:"init",method:!1,shorthand:!1,computed:!1}}return r})),e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(i.isContextBound(e.name)&&!i.isRootParam(e.name))return{type:"CallExpression",callee:v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),arguments:[e,qe,i.nextParamIdArg],_transformed:!0,_isParamCall:!0}}return e?.type==="CallExpression"&&K(e,i),{type:"CallExpression",callee:v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),arguments:[e.type==="Identifier"?me(e,i):e,qe,i.nextParamIdArg],_transformed:!0,_isParamCall:!0}}function K(e,t,i){if(!e._transformed){if(e.callee&&e.callee.type==="MemberExpression"&&e.callee.object&&e.callee.object.type==="Identifier"&&(t.isContextBound(e.callee.object.name)||e.callee.object.name==="math"||e.callee.object.name==="ta")){if(e.callee.object.name===V&&["get","init","param"].includes(e.callee.property.name))return;const r=e.callee.object.name;e.arguments=e.arguments.map(a=>a._isParamCall?a:lt(a,r,t)),r==="ta"&&e.arguments.push(t.getNextTACallId()),e._transformed=!0}else e.callee&&e.callee.type==="Identifier"&&(e.arguments=e.arguments.map(r=>r._isParamCall?r:lt(r,V,t)),e._transformed=!0);e.arguments.forEach(r=>{L(r,t,{Identifier(a,n,s){a.parent=n.parent,B(a,t);const u=a.parent&&a.parent.type==="BinaryExpression";(a.parent&&a.parent.type==="ConditionalExpression"||u)&&(a.type==="MemberExpression"?ae(a,t):a.type==="Identifier"&&(a.parent&&a.parent.type==="CallExpression"&&a.parent.callee&&a.parent.callee.object&&a.parent.callee.object.name===V&&a.parent.callee.property.name==="get"||Z(a)))},CallExpression(a,n,s){a._transformed||K(a,n)},MemberExpression(a,n,s){H(a,"",t),a.object&&s(a.object,{parent:a,inNamespaceCall:n.inNamespaceCall})}})})}}function ei(e,t){let i=null;if(e.left.type==="Identifier"){const[r,a]=t.getVariable(e.left.name);i=v.createContextVariableReference(a,r)}else if(e.left.type==="MemberExpression"&&e.left.computed&&e.left.object.type==="Identifier"){const r=e.left.object.name,[a,n]=t.getVariable(r),s=a!==r,u=t.isContextBound(r);(s||u)&&!t.isLoopVariable(r)&&e.left.property.type==="Literal"&&e.left.property.value===0&&(i=v.createContextVariableReference(n,a))}if(L(e.right,{parent:e.right,inNamespaceCall:!1},{Identifier(r,a,n){r.name=="na"&&(r.name="NaN"),r.parent=a.parent,B(r,t);const s=r.parent&&r.parent.type==="BinaryExpression",u=r.parent&&r.parent.type==="ConditionalExpression",c=t.isContextBound(r.name)&&!t.isRootParam(r.name),p=r.parent&&r.parent.type==="MemberExpression"&&r.parent.computed&&r.parent.object===r,l=r.parent&&r.parent._isParamCall,x=r.parent&&r.parent.type==="MemberExpression",d=r.name==="NaN",h=r.parent&&r.parent.type==="CallExpression"&&r.parent.callee&&r.parent.callee.object&&r.parent.callee.object.name===V&&r.parent.callee.property.name==="get";(c||u||s)&&(r.type==="MemberExpression"?ae(r,t):r.type==="Identifier"&&!x&&!p&&!l&&!d&&!h&&Z(r))},MemberExpression(r,a,n){H(r,"",t),r.type==="CallExpression"?r.arguments.forEach(s=>n(s,{parent:r,inNamespaceCall:a.inNamespaceCall})):r.object&&n(r.object,{parent:r,inNamespaceCall:a.inNamespaceCall})},CallExpression(r,a,n){const s=r.callee&&r.callee.type==="MemberExpression"&&r.callee.object&&r.callee.object.type==="Identifier"&&t.isContextBound(r.callee.object.name);K(r,t),r.arguments.forEach(u=>n(u,{parent:r,inNamespaceCall:s||a.inNamespaceCall}))}}),i){let r=e.right;if(e.operator!=="="){const n=e.operator.replace("=",""),s=v.createGetCall(i,0);r={type:"BinaryExpression",operator:n,left:s,right:e.right,start:e.start,end:e.end}}const a=v.createSetCall(i,r);e.start&&(a.start=e.start),e.end&&(a.end=e.end),Object.assign(e,a)}}function ti(e,t){e.declarations.forEach(i=>{i.init.name=="na"&&(i.init.name="NaN");const r=i.init&&i.init.type==="MemberExpression"&&i.init.object&&(i.init.object.name==="context"||i.init.object.name===V||i.init.object.name==="context2"),a=i.init&&i.init.type==="MemberExpression"&&i.init.object?.object&&(i.init.object.object.name==="context"||i.init.object.object.name===V||i.init.object.object.name==="context2"),n=i.init&&i.init.type==="ArrowFunctionExpression";if(r){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(h=>{h.key.name&&t.addContextBoundVar(h.key.name)}),i.init.object.name=V;return}if(a){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(h=>{h.key.name&&t.addContextBoundVar(h.key.name)}),i.init.object.object.name=V;return}n&&i.init.params.forEach(h=>{h.type==="Identifier"&&t.addContextBoundVar(h.name)});const s=t.addVariable(i.id.name,e.kind),u=e.kind;i.init&&!n&&(i.init.type==="CallExpression"&&i.init.callee.type==="MemberExpression"&&i.init.callee.object&&i.init.callee.object.type==="Identifier"&&t.isContextBound(i.init.callee.object.name)?K(i.init,t):L(i.init,{parent:i.init},{Identifier(h,g){h.parent=g.parent,B(h,t);const C=h.parent&&h.parent.type==="BinaryExpression",S=h.parent&&h.parent.type==="ConditionalExpression",A=h.parent&&h.parent.type==="CallExpression"&&h.parent.callee&&h.parent.callee.object&&h.parent.callee.object.name===V&&h.parent.callee.property.name==="get";h.type==="Identifier"&&(C||S)&&!A&&Z(h)},CallExpression(h,g,C){h.callee.type==="Identifier"&&(h.callee.parent=h),h.arguments.forEach(S=>{S.type==="Identifier"&&(S.parent=h)}),K(h,t),h.arguments.forEach(S=>C(S,{parent:h}))},BinaryExpression(h,g,C){h.left.type==="Identifier"&&(h.left.parent=h),h.right.type==="Identifier"&&(h.right.parent=h),C(h.left,{parent:h}),C(h.right,{parent:h})},MemberExpression(h,g,C){h.object&&h.object.type==="Identifier"&&(h.object.parent=h),h.property&&h.property.type==="Identifier"&&(h.property.parent=h),H(h,"",t),h.type==="CallExpression"?h.arguments.forEach(S=>C(S,{parent:h})):h.object&&C(h.object,{parent:h})}}));const c=v.createContextVariableReference(u,s),p=t.isArrayPatternElement(i.id.name),l=!p&&i.init&&i.init.type==="MemberExpression"&&i.init.computed&&i.init.property&&(i.init.property.type==="Literal"||i.init.property.type==="MemberExpression");i.init?.property?.type==="MemberExpression"&&(i.init.property._indexTransformed||(ae(i.init.property,t),i.init.property._indexTransformed=!0));let x;i.init?n||p?x=i.init:x=v.createInitCall(c,l?i.init.object:i.init,l?i.init.property:void 0):x=v.createIdentifier("undefined");const d=v.createExpressionStatement(v.createAssignmentExpression(c,x));if(p){d.expression.right.object.property.name+=`?.[0][${i.init.property.value}]`;const h=d.expression.right.object;d.expression.right=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("init")),[c,h])}n&&(t.pushScope("fn"),L(i.init.body,t,{BlockStatement(h,g,C){h.body.forEach(S=>C(S,g))},IfStatement(h,g,C){g.pushScope("if"),C(h.consequent,g),h.alternate&&(g.pushScope("els"),C(h.alternate,g),g.popScope()),g.popScope()},VariableDeclaration(h,g){ti(h,g)},Identifier(h,g){B(h,g)},AssignmentExpression(h,g){ei(h,g)}}),t.popScope()),Object.assign(e,d)})}function cr(e,t,i){if(e.init&&e.init.type==="VariableDeclaration"){const r=e.init.declarations[0],a=r.id.name;t.addLoopVariable(a,a),e.init={type:"VariableDeclaration",kind:e.init.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:a},init:r.init}]},r.init&&L(r.init,t,{Identifier(n,s){t.isLoopVariable(n.name)||(t.pushScope("for"),B(n,s),t.popScope())},MemberExpression(n){t.pushScope("for"),H(n,"",t),t.popScope()}})}e.test&&L(e.test,t,{Identifier(r,a){!t.isLoopVariable(r.name)&&!r.computed&&(t.pushScope("for"),B(r,a),r.type==="Identifier"&&(r.computed=!0,Z(r)),t.popScope())},MemberExpression(r){t.pushScope("for"),H(r,"",t),t.popScope()}}),e.update&&L(e.update,t,{Identifier(r,a){t.isLoopVariable(r.name)||(t.pushScope("for"),B(r,a),t.popScope())}}),t.pushScope("for"),i(e.body,t),t.popScope()}function pr(e,t){L(e,t,{MemberExpression(i){H(i,"",t)},CallExpression(i,r){K(i,r)},Identifier(i,r){B(i,r);const a=t.getCurrentScopeType()==="if";t.isContextBound(i.name)&&!t.isRootParam(i.name)&&a&&Z(i)}})}function lr(e,t,i){e.test&&(t.pushScope("if"),pr(e.test,t),t.popScope()),t.pushScope("if"),i(e.consequent,t),t.popScope(),e.alternate&&(t.pushScope("els"),i(e.alternate,t),t.popScope())}function hr(e,t){const i=t.getCurrentScopeType();if(e.argument&&(e.argument.type==="ArrayExpression"?(e.argument.elements=e.argument.elements.map(r=>{if(r.type==="Identifier"){if(t.isContextBound(r.name)&&!t.isRootParam(r.name))return v.createArrayAccess(r,0);const[a,n]=t.getVariable(r.name);return v.createContextVariableAccess0(n,a)}else if(r.type==="MemberExpression")return r.computed&&r.object.type==="Identifier"&&t.isContextBound(r.object.name)&&!t.isRootParam(r.object.name)||H(r,"",t),r;return r}),e.argument={type:"ArrayExpression",elements:[e.argument]}):e.argument.type==="BinaryExpression"?L(e.argument,t,{Identifier(r,a){B(r,a),r.type==="Identifier"&&Z(r)},MemberExpression(r){H(r,"",t)}}):e.argument.type==="ObjectExpression"?e.argument.properties=e.argument.properties.map(r=>{if(r.shorthand){const[a,n]=t.getVariable(r.value.name);return{type:"Property",key:v.createIdentifier(r.key.name),value:v.createContextVariableReference(n,a),kind:"init",method:!1,shorthand:!1,computed:!1}}return r}):e.argument.type==="Identifier"&&(B(e.argument,t),e.argument.type==="Identifier"&&Z(e.argument)),i==="fn")){e.argument.type==="Identifier"&&t.isContextBound(e.argument.name)&&!t.isRootParam(e.argument.name)?e.argument=v.createArrayAccess(e.argument,0):e.argument.type==="MemberExpression"?e.argument.object.type==="Identifier"&&t.isContextBound(e.argument.object.name)&&!t.isRootParam(e.argument.object.name)&&(e.argument._indexTransformed||(ae(e.argument,t),e.argument._indexTransformed=!0)):(e.argument.type==="BinaryExpression"||e.argument.type==="LogicalExpression"||e.argument.type==="ConditionalExpression"||e.argument.type==="CallExpression")&&L(e.argument,t,{Identifier(a,n){B(a,n),a.type==="Identifier"&&!a._arrayAccessed&&(Z(a),a._arrayAccessed=!0)},MemberExpression(a){H(a,"",t)},CallExpression(a,n){K(a,n)}});const r=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("precision")),[e.argument]);e.argument=r}}function fr(e,t,i){e.body&&e.body.type==="BlockStatement"&&(t.pushScope("fn"),i(e.body,t),t.popScope())}function mr(e){Ze(e,{BinaryExpression(t){if(t.operator==="=="||t.operator==="==="){const i=t.left,r=t.right,a=v.createMathEqCall(i,r);a._transformed=!0,Object.assign(t,a)}}})}function dr(e,t,i){L(e,t,{BlockStatement(r,a,n){r.body.forEach(s=>n(s,a))},ReturnStatement(r,a){hr(r,a)},VariableDeclaration(r,a){ti(r,a)},Identifier(r,a){B(r,a)},CallExpression(r,a){K(r,a)},MemberExpression(r,a){H(r,i,a)},AssignmentExpression(r,a){ei(r,a)},FunctionDeclaration(r,a,n){fr(r,a,n)},ForStatement(r,a,n){cr(r,a,n)},IfStatement(r,a,n){lr(r,a,n)}})}function xr(e){let t=typeof e=="function"?e.toString():e;const i=Wi(t.trim(),{ecmaVersion:"latest",sourceType:"module"});ir(i);const r=new er;rr(i,r);const a=sr(i,r)||"";dr(i,r,a),mr(i);const n=Ji(i);return new Function("",`return ${n}`)(this)}class f{constructor(t,i=0){this.data=t,this.offset=i}get(t){const i=this.data.length-1-(this.offset+t);return i<0||i>=this.data.length?NaN:this.data[i]}set(t,i){const r=this.data.length-1-(this.offset+t);r>=0&&r<this.data.length&&(this.data[r]=i)}get length(){return this.data.length}toArray(){return this.data}static from(t){return t instanceof f?t:Array.isArray(t)?new f(t):new f([t])}}class gr{constructor(t){this.context=t}color={param:(t,i=0)=>f.from(t).get(i),rgb:(t,i,r,a)=>a?`rgba(${t}, ${i}, ${r}, ${a})`:`rgb(${t}, ${i}, ${r})`,new:(t,i)=>{if(t&&t.startsWith("#")){const r=t.slice(1),a=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),s=parseInt(r.slice(4,6),16);return i?`rgba(${a}, ${n}, ${s}, ${i})`:`rgb(${a}, ${n}, ${s})`}return i?`rgba(${t}, ${i})`:t},white:"white",lime:"lime",green:"green",red:"red",maroon:"maroon",black:"black",gray:"gray",blue:"blue"};extractPlotOptions(t){const i={};for(let r in t)i[r]=f.from(t[r]).get(0);return i}indicator(t,i,r){}plotchar(t,i,r){this.context.plots[i]||(this.context.plots[i]={data:[],options:this.extractPlotOptions(r),title:i});const a=f.from(t).get(0);this.context.plots[i].data.push({time:this.context.marketData[this.context.idx].openTime,value:a,options:{...this.extractPlotOptions(r),style:"char"}})}plot(t,i,r){this.context.plots[i]||(this.context.plots[i]={data:[],options:this.extractPlotOptions(r),title:i});const a=f.from(t).get(0);this.context.plots[i].data.push({time:this.context.marketData[this.context.idx].openTime,value:a,options:this.extractPlotOptions(r)})}na(t){return isNaN(f.from(t).get(0))}nz(t,i=0){const r=f.from(t).get(0),a=f.from(i).get(0);return isNaN(r)?a:r}}function yr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function br(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function vr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function wr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Cr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Sr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Er(e){return(t,i=0)=>[f.from(t).get(i)]}function _r(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function kr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Ir(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Ar(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Pr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Nr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Vr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Tr(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}const Lr={any:yr,bool:br,color:vr,enum:wr,float:Cr,int:Sr,param:Er,price:_r,session:kr,source:Ir,string:Ar,symbol:Pr,text_area:Nr,time:Vr,timeframe:Tr};class Mr{constructor(t){this.context=t,Object.entries(Lr).forEach(([i,r])=>{this[i]=r(t)})}any;bool;color;enum;float;int;param;price;session;source;string;symbol;text_area;time;timeframe}function Dr(e){return t=>Math.abs(f.from(t).get(0))}function Rr(e){return t=>Math.acos(f.from(t).get(0))}function Br(e){return t=>Math.asin(f.from(t).get(0))}function jr(e){return t=>Math.atan(f.from(t).get(0))}function Or(e){return(...t)=>{const i=t.map(r=>f.from(r).get(0));return i.reduce((r,a)=>r+a,0)/i.length}}function Fr(e){return t=>Math.ceil(f.from(t).get(0))}function Ur(e){return t=>Math.cos(f.from(t).get(0))}function qr(e){return t=>Math.exp(f.from(t).get(0))}function $r(e){return t=>Math.floor(f.from(t).get(0))}function Gr(e){return t=>Math.log(f.from(t).get(0))}function Wr(e){return t=>Math.log(f.from(t).get(0))}function zr(e){return t=>Math.log10(f.from(t).get(0))}function Hr(e){return(...t)=>{const i=t.map(r=>f.from(r).get(0));return Math.max(...i)}}function Kr(e){return(...t)=>{const i=t.map(r=>f.from(r).get(0));return Math.min(...i)}}function Qr(e){return(t,i,r)=>typeof t=="string"?t:t instanceof f?i?new f(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new f(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new f(e.params[r],0)))}function Yr(e){return(t,i)=>Math.pow(f.from(t).get(0),f.from(i).get(0))}function Xr(e){return()=>Math.random()}function Zr(e){return t=>Math.round(f.from(t).get(0))}function Jr(e){return t=>Math.sin(f.from(t).get(0))}function ea(e){return t=>Math.sqrt(f.from(t).get(0))}function ta(e){return(t,i)=>{const r=f.from(i).get(0),a=f.from(t);let n=0;for(let s=0;s<r;s++){const u=a.get(s);isNaN(u)||(n+=u)}return n}}function ia(e){return t=>Math.tan(f.from(t).get(0))}function ra(e){return(t,i)=>{const r=f.from(t).get(0),a=f.from(i).get(0);return isNaN(r)&&isNaN(a)?!0:isNaN(r)||isNaN(a)?!1:Math.abs(r-a)<1e-8}}const aa={abs:Dr,acos:Rr,asin:Br,atan:jr,avg:Or,ceil:Fr,cos:Ur,exp:qr,floor:$r,ln:Gr,log:Wr,log10:zr,max:Hr,min:Kr,param:Qr,pow:Yr,random:Xr,round:Zr,sin:Jr,sqrt:ea,sum:ta,tan:ia,__eq:ra};class na{constructor(t){this.context=t,Object.entries(aa).forEach(([i,r])=>{this[i]=r(t)})}_cache={};abs;acos;asin;atan;avg;ceil;cos;exp;floor;ln;log;log10;max;min;param;pow;random;round;sin;sqrt;sum;tan;__eq}function sa(e){return(t,i,r)=>(e.params[r]||(e.params[r]=[]),t instanceof f||Array.isArray(t)?[f.from(t).get(i||0),r]:(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,[t,r]))}const ht=["1","3","5","15","30","45","60","120","180","240","D","W","M"];function ft(e,t,i,r,a=!1){for(let n=0;n<i.length;n++)if(i[n]<=e&&t<=r[n])return n+(a?1:2);return-1}function oa(e){return async(t,i,r,a=!1,n=!1,s=!1,u=null,c=null)=>{const p=t[0],l=i[0],x=r[0],d=r[1],h=ht.indexOf(e.timeframe),g=ht.indexOf(l);if(h==-1||g==-1)throw new Error("Invalid timeframe");if(h>g)throw new Error("Only higher timeframes are supported for now");if(h===g)return x;const C=e.data.openTime[0],S=e.data.closeTime[0];if(e.cache[d]){const Q=e.cache[d],I=ft(C,S,Q.data.openTime,Q.data.closeTime,n);return I==-1?NaN:Q.params[d][I]}const A=await new ii(e.source,p,l,e.limit||1e3,e.sDate,e.eDate).run(e.pineTSCode);e.cache[d]=A;const j=ft(C,S,A.data.openTime,A.data.closeTime,n);return j==-1?NaN:A.params[d][j]}}const ua={param:sa,security:oa};class ca{constructor(t){this.context=t,Object.entries(ua).forEach(([i,r])=>{this[i]=r(t)})}_cache={};param;security}function pa(e){return()=>{const t=e.get(e.data.high,0),i=e.get(e.data.low,0),r=e.get(e.data.close,1);return isNaN(r)?t-i:Math.max(t-i,Math.abs(t-r),Math.abs(i-r))}}function la(e){return(t,i)=>{const r=f.from(t).get(0);e.taState||(e.taState={});const a=i||`atr_${r}`;e.taState[a]||(e.taState[a]={prevAtr:null,initSum:0,initCount:0,prevClose:null});const n=e.taState[a],s=e.get(e.data.high,0),u=e.get(e.data.low,0),c=e.get(e.data.close,0);let p;if(n.prevClose!==null){const x=s-u,d=Math.abs(s-n.prevClose),h=Math.abs(u-n.prevClose);p=Math.max(x,d,h)}else p=s-u;if(n.prevClose=c,n.initCount<r)return n.initSum+=p,n.initCount++,n.initCount===r?(n.prevAtr=n.initSum/r,e.precision(n.prevAtr)):NaN;const l=(n.prevAtr*(r-1)+p)/r;return n.prevAtr=l,e.precision(l)}}function ha(e){return(t,i=1,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`change_${a}`;e.taState[n]||(e.taState[n]={window:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.window.unshift(u),s.window.length<=a)return NaN;s.window.length>a+1&&s.window.pop();const c=u-s.window[a];return e.precision(c)}}function fa(e){return(t,i)=>{const r=f.from(t),a=f.from(i),n=r.get(0),s=a.get(0),u=r.get(1),c=a.get(1);return u<c&&n>s}}function ma(e){return(t,i)=>{const r=f.from(t),a=f.from(i),n=r.get(0),s=a.get(0),u=r.get(1),c=a.get(1);return u>c&&n<s}}function da(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`dev_${a}`;e.taState[n]||(e.taState[n]={window:[],sum:0});const s=e.taState[n],u=f.from(t).get(0)||0;if(s.window.unshift(u),s.sum+=u,s.window.length<a)return NaN;if(s.window.length>a){const x=s.window.pop();s.sum-=x}const c=s.sum/a;let p=0;for(let x=0;x<a;x++)p+=Math.abs(s.window[x]-c);const l=p/a;return e.precision(l)}}function xa(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`ema_${a}`;e.taState[n]||(e.taState[n]={prevEma:null,initSum:0,initCount:0});const s=e.taState[n],u=f.from(t).get(0);if(s.initCount<a)return s.initSum+=u,s.initCount++,s.initCount===a?(s.prevEma=s.initSum/a,e.precision(s.prevEma)):NaN;const c=2/(a+1),p=u*c+s.prevEma*(1-c);return s.prevEma=p,e.precision(p)}}function ga(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`highest_${a}`;e.taState[n]||(e.taState[n]={window:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.window.unshift(u),s.window.length<a)return NaN;s.window.length>a&&s.window.pop();const c=Math.max(...s.window.filter(p=>!isNaN(p)));return e.precision(c)}}function ya(e){return(t,i,r)=>{const a=f.from(i).get(0),n=Math.floor(a/2),s=Math.floor(Math.sqrt(a)),u=e.ta.wma,c=u(t,n,r?`${r}_wma1`:void 0),p=u(t,a,r?`${r}_wma2`:void 0);if(isNaN(c)||isNaN(p))return NaN;e.taState||(e.taState={});const l=r||`hma_raw_${a}`;e.taState[l]||(e.taState[l]=[]);const x=2*c-p;e.taState[l].unshift(x);const d=r?`${r}_hma_final`:`hma_final_${a}`;e.taState[d]||(e.taState[d]={window:[]});const h=e.taState[d];if(h.window.unshift(x),h.window.length<s)return NaN;h.window.length>s&&h.window.pop();let g=0,C=0;for(let A=0;A<s;A++){const j=s-A;g+=h.window[A]*j,C+=j}const S=g/C;return e.precision(S)}}function ba(e){return(t,i,r,a)=>{const n=f.from(i).get(0),s=f.from(r).get(0);e.taState||(e.taState={});const u=a||`linreg_${n}_${s}`;e.taState[u]||(e.taState[u]={window:[]});const c=e.taState[u],p=f.from(t).get(0);if(c.window.unshift(p),c.window.length<n)return NaN;c.window.length>n&&c.window.pop();let l=0,x=0,d=0,h=0;const g=n;for(let j=0;j<n;j++){const Q=n-1-j,I=c.window[j];l+=Q,x+=I,d+=Q*I,h+=Q*Q}const C=g*h-l*l;if(C===0)return NaN;const S=(g*d-l*x)/C,A=(x-S*l)/g+S*(n-1-s);return e.precision(A)}}function va(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`lowest_${a}`;e.taState[n]||(e.taState[n]={window:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.window.unshift(u),s.window.length<a)return NaN;s.window.length>a&&s.window.pop();const c=s.window.filter(l=>!isNaN(l)&&l!==void 0),p=c.length>0?Math.min(...c):NaN;return e.precision(p)}}function wa(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`median_${a}`;e.taState[n]||(e.taState[n]={window:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.window.unshift(u),s.window.length<a)return NaN;s.window.length>a&&s.window.pop();const c=s.window.slice().sort((x,d)=>x-d),p=Math.floor(a/2),l=a%2===0?(c[p-1]+c[p])/2:c[p];return e.precision(l)}}function Ca(e){return(t,i,r)=>{const a=f.from(i).get(0);return e.ta.change(t,a)}}function Sa(e){return(t,i,r)=>t instanceof f?i?new f(t.data,t.offset+i):t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new f(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new f(e.params[r],0)))}function Ea(e,t,i){const r=new Array(e.length).fill(NaN);for(let a=t+i;a<e.length;a++){const n=e[a-i];let s=!0;for(let u=1;u<=t;u++)if(e[a-i-u]>=n){s=!1;break}if(s){for(let u=1;u<=i;u++)if(e[a-i+u]>=n){s=!1;break}}s&&(r[a]=n)}return r}function _a(e){return(t,i,r)=>{r==null&&(r=i,i=t,t=e.data.high);const a=f.from(i).get(0),n=f.from(r).get(0),s=f.from(t).toArray(),u=Ea(s,a,n),c=e.idx;return e.precision(u[c])}}function ka(e,t,i){const r=new Array(e.length).fill(NaN);for(let a=t+i;a<e.length;a++){const n=e[a-i];let s=!0;for(let u=1;u<=t;u++)if(e[a-i-u]<=n){s=!1;break}if(s){for(let u=1;u<=i;u++)if(e[a-i+u]<=n){s=!1;break}}s&&(r[a]=n)}return r}function Ia(e){return(t,i,r)=>{r==null&&(r=i,i=t,t=e.data.low);const a=f.from(i).get(0),n=f.from(r).get(0),s=f.from(t).toArray(),u=ka(s,a,n),c=e.idx;return e.precision(u[c])}}function Aa(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`rma_${a}`;e.taState[n]||(e.taState[n]={prevRma:null,initSum:0,initCount:0});const s=e.taState[n],u=f.from(t).get(0)||0;if(s.initCount<a)return s.initSum+=u,s.initCount++,s.initCount===a?(s.prevRma=s.initSum/a,e.precision(s.prevRma)):NaN;const c=1/a,p=u*c+s.prevRma*(1-c);return s.prevRma=p,e.precision(p)}}function Pa(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`roc_${a}`;e.taState[n]||(e.taState[n]={window:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.window.unshift(u),s.window.length<=a)return NaN;s.window.length>a+1&&s.window.pop();const c=s.window[a],p=(u-c)/c*100;return e.precision(p)}}function Na(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`rsi_${a}`;e.taState[n]||(e.taState[n]={prevValue:null,avgGain:0,avgLoss:0,initGains:[],initLosses:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.prevValue!==null){const c=u-s.prevValue,p=c>0?c:0,l=c<0?-c:0;if(s.initGains.length<a){if(s.initGains.push(p),s.initLosses.push(l),s.initGains.length===a){s.avgGain=s.initGains.reduce((h,g)=>h+g,0)/a,s.avgLoss=s.initLosses.reduce((h,g)=>h+g,0)/a,s.prevValue=u;const d=s.avgLoss===0?100:100-100/(1+s.avgGain/s.avgLoss);return e.precision(d)}return s.prevValue=u,NaN}s.avgGain=(s.avgGain*(a-1)+p)/a,s.avgLoss=(s.avgLoss*(a-1)+l)/a;const x=s.avgLoss===0?100:100-100/(1+s.avgGain/s.avgLoss);return s.prevValue=u,e.precision(x)}return s.prevValue=u,NaN}}function Va(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`sma_${a}`;e.taState[n]||(e.taState[n]={window:[],sum:0});const s=e.taState[n],u=f.from(t).get(0)||0;if(s.window.unshift(u),s.sum+=u,s.window.length<a)return NaN;if(s.window.length>a){const p=s.window.pop();s.sum-=p}const c=s.sum/a;return e.precision(c)}}function Ta(e){return(t,i,r=!0,a)=>{const n=f.from(i).get(0),s=f.from(r).get(0);e.taState||(e.taState={});const u=a||`stdev_${n}_${s}`;e.taState[u]||(e.taState[u]={window:[],sum:0});const c=e.taState[u],p=f.from(t).get(0);if(c.window.unshift(p),c.sum+=p,c.window.length<n)return NaN;if(c.window.length>n){const g=c.window.pop();c.sum-=g}const l=c.sum/n;let x=0;for(let g=0;g<n;g++)x+=Math.pow(c.window[g]-l,2);const d=s?n:n-1,h=Math.sqrt(x/d);return e.precision(h)}}function La(e){return(t,i,r)=>{const a=f.from(t).get(0),n=f.from(i).get(0);e.taState||(e.taState={});const s=`supertrend_${a}_${n}`;e.taState[s]||(e.taState[s]={prevUpperBand:null,prevLowerBand:null,prevSupertrend:null,prevDirection:null});const u=e.taState[s],c=e.get(e.data.high,0),p=e.get(e.data.low,0),l=e.get(e.data.close,0),x=e.get(e.data.close,1),d=e.ta.atr(n,r?`${r}_atr`:void 0);if(isNaN(d))return[[NaN,0]];const h=(c+p)/2;let g=h+a*d,C=h-a*d;u.prevUpperBand!==null&&(g<u.prevUpperBand||x>u.prevUpperBand?g=g:g=u.prevUpperBand,C>u.prevLowerBand||x<u.prevLowerBand?C=C:C=u.prevLowerBand);let S,A;return u.prevSupertrend===null?(S=l<=g?-1:1,A=S===-1?g:C):u.prevSupertrend===u.prevUpperBand?l>g?(S=1,A=C):(S=-1,A=g):l<C?(S=-1,A=g):(S=1,A=C),u.prevUpperBand=g,u.prevLowerBand=C,u.prevSupertrend=A,u.prevDirection=S,[[e.precision(A),S]]}}function Ma(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`variance_${a}`;e.taState[n]||(e.taState[n]={window:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.window.unshift(u),s.window.length<a)return NaN;s.window.length>a&&s.window.pop();let c=0,p=0;for(let d=0;d<a;d++)c+=s.window[d],p+=s.window[d]*s.window[d];const l=c/a,x=p/a-l*l;return e.precision(x)}}function Da(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`vwma_${a}`;e.taState[n]||(e.taState[n]={window:[],volumeWindow:[]});const s=e.taState[n],u=f.from(t).get(0),c=e.get(e.data.volume,0);if(s.window.unshift(u),s.volumeWindow.unshift(c),s.window.length<a)return NaN;s.window.length>a&&(s.window.pop(),s.volumeWindow.pop());let p=0,l=0;for(let d=0;d<a;d++)p+=s.window[d]*s.volumeWindow[d],l+=s.volumeWindow[d];const x=p/l;return e.precision(x)}}function Ra(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const n=r||`wma_${a}`;e.taState[n]||(e.taState[n]={window:[]});const s=e.taState[n],u=f.from(t).get(0);if(s.window.unshift(u),s.window.length<a)return NaN;s.window.length>a&&s.window.pop();let c=0,p=0;for(let x=0;x<a;x++){const d=a-x;c+=s.window[x]*d,p+=d}const l=c/p;return e.precision(l)}}const Ba={tr:pa},ja={atr:la,change:ha,crossover:fa,crossunder:ma,dev:da,ema:xa,highest:ga,hma:ya,linreg:ba,lowest:va,median:wa,mom:Ca,param:Sa,pivothigh:_a,pivotlow:Ia,rma:Aa,roc:Pa,rsi:Na,sma:Va,stdev:Ta,supertrend:La,variance:Ma,vwma:Da,wma:Ra};class Oa{constructor(t){this.context=t,Object.entries(Ba).forEach(([i,r])=>{Object.defineProperty(this,i,{get:r(t),enumerable:!0})}),Object.entries(ja).forEach(([i,r])=>{this[i]=r(t)})}tr;atr;change;crossover;crossunder;dev;ema;highest;hma;linreg;lowest;median;mom;param;pivothigh;pivotlow;rma;roc;rsi;sma;stdev;supertrend;variance;vwma;wma}class R{constructor(t){this.array=t}toString(){return"PineArrayObject:"+this.array.toString()}}function Fa(e){return t=>new R(t.array.map(i=>Math.abs(i)))}function Ua(e){return t=>e.array.sum(t)/t.array.length}function qa(e){return t=>{t.array.length=0}}function $a(e){return(t,i)=>(t.array.push(...i.array),t)}function Ga(e){return t=>new R([...t.array])}function Wa(e){return(t,i,r=!0)=>{if(t.array.length!==i.array.length||t.array.length<2)return NaN;const a=r?t.array.length:t.array.length-1,n=e.array.avg(t),s=e.array.avg(i);let u=0;for(let c=0;c<t.array.length;c++)u+=(t.array[c]-n)*(i.array[c]-s);return u/a}}function za(e){return(t,i)=>t.array.every(i)}function Ha(e){return(t,i,r=0,a)=>{const n=t.array.length,s=a!==void 0?Math.min(a,n):n;for(let u=r;u<s;u++)t.array[u]=i}}function Ka(e){return t=>t.array.length>0?t.array[0]:e.NA}function Qa(e){return t=>new R([...t])}function Ya(e){return(t,i)=>t.array[i]}function Xa(e){return(t,i)=>t.array.includes(i)}function Za(e){return(t,i)=>t.array.indexOf(i)}function Ja(e){return(t,i,r)=>{t.array.splice(i,0,r)}}function en(e){return(t,i=",")=>t.array.join(i)}function tn(e){return t=>t.array.length>0?t.array[t.array.length-1]:e.NA}function rn(e){return(t,i)=>t.array.lastIndexOf(i)}function an(e){return(t,i=0)=>[...t.array].sort((r,a)=>a-r)[i]??e.NA}function nn(e){return(t,i=0)=>[...t.array].sort((r,a)=>r-a)[i]??e.NA}function sn(e){return(t,i)=>new R(Array(t).fill(i))}function on(e){return(t,i=!1)=>new R(Array(t).fill(i))}function un(e){return(t,i=NaN)=>new R(Array(t).fill(i))}function cn(e){return(t,i=0)=>new R(Array(t).fill(Math.round(i)))}function pn(e){return(t,i="")=>new R(Array(t).fill(i))}function ln(e){return(t,i=0)=>f.from(t).get(i)}function hn(e){return t=>t.array.pop()}function fn(e){return(t,i)=>{t.array.push(i)}}function mn(e){return t=>e.array.max(t)-e.array.min(t)}function dn(e){return(t,i)=>i>=0&&i<t.array.length?t.array.splice(i,1)[0]:e.NA}function xn(e){return t=>{t.array.reverse()}}function gn(e){return(t,i,r)=>{t.array[i]=r}}function yn(e){return t=>t.array.shift()}function bn(e){return t=>t.array.length}function vn(e){return(t,i,r)=>{const a=r!==void 0?r+1:void 0;return new R(t.array.slice(i,a))}}function wn(e){return(t,i)=>t.array.some(i)}function Cn(e){return(t,i="asc")=>{t.array.sort((r,a)=>i==="asc"?r-a:a-r)}}function Sn(e){return(t,i)=>{const r=t.array.map((a,n)=>n);return r.sort((a,n)=>{const s=t.array[a],u=t.array[n];return i?i(s,u):s-u}),new R(r)}}function En(e){return t=>{const i=e.array.avg(t),r=e.array.stdev(t);return r===0?new R(t.array.map(()=>0)):new R(t.array.map(a=>(a-i)/r))}}function _n(e){return(t,i=!0)=>{const r=e.array.avg(t),a=t.array.map(s=>Math.pow(s-r,2)),n=i?t.array.length:t.array.length-1;return Math.sqrt(e.array.sum(new R(a))/n)}}function kn(e){return t=>t.array.reduce((i,r)=>i+(isNaN(r)?0:r),0)}function In(e){return(t,i)=>{t.array.unshift(i)}}function An(e){return(t,i=!0)=>{const r=e.array.avg(t),a=t.array.map(s=>Math.pow(s-r,2)),n=i?t.array.length:t.array.length-1;return e.array.sum(new R(a))/n}}const Pn={abs:Fa,avg:Ua,clear:qa,concat:$a,copy:Ga,covariance:Wa,every:za,fill:Ha,first:Ka,from:Qa,get:Ya,includes:Xa,indexof:Za,insert:Ja,join:en,last:tn,lastindexof:rn,max:an,min:nn,new:sn,new_bool:on,new_float:un,new_int:cn,new_string:pn,param:ln,pop:hn,push:fn,range:mn,remove:dn,reverse:xn,set:gn,shift:yn,size:bn,slice:vn,some:wn,sort:Cn,sort_indices:Sn,standardize:En,stdev:_n,sum:kn,unshift:In,variance:An};class Nn{constructor(t){this.context=t,Object.entries(Pn).forEach(([i,r])=>{this[i]=r(t)})}_cache={};abs;avg;clear;concat;copy;covariance;every;fill;first;from;get;includes;indexof;insert;join;last;lastindexof;max;min;new;new_bool;new_float;new_int;new_string;param;pop;push;range;remove;reverse;set;shift;size;slice;some;sort;sort_indices;standardize;stdev;sum;unshift;variance}class $e{data={open:[],high:[],low:[],close:[],volume:[],hl2:[],hlc3:[],ohlc4:[]};cache={};taState={};NA=NaN;math;ta;input;request;array;core;lang;idx=0;params={};const={};var={};let={};result=void 0;plots={};marketData;source;tickerId;timeframe="";limit;sDate;eDate;pineTSCode;constructor({marketData:t,source:i,tickerId:r,timeframe:a,limit:n,sDate:s,eDate:u}){this.marketData=t,this.source=i,this.tickerId=r,this.timeframe=a,this.limit=n,this.sDate=s,this.eDate=u,this.math=new na(this),this.ta=new Oa(this),this.input=new Mr(this),this.request=new ca(this),this.array=new Nn(this);const c=new gr(this);this.core={plotchar:c.plotchar.bind(c),na:c.na.bind(c),color:c.color,plot:c.plot.bind(c),nz:c.nz.bind(c)}}init(t,i,r=0){return i instanceof f&&(i=i.get(0)),t?!Array.isArray(i)||Array.isArray(i[0])?t[t.length-1]=Array.isArray(i?.[0])?i[0]:this.precision(i):t[t.length-1]=this.precision(i[i.length-1+r]):Array.isArray(i)?t=[this.precision(i[i.length-1+r])]:t=[this.precision(i)],t}precision(t,i=10){return typeof t!="number"||isNaN(t)?t:Number(t.toFixed(i))}param(t,i,r){return typeof t=="string"?t:t instanceof f?i?new f(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(this.params[r]||(this.params[r]=[]),Array.isArray(t)?new f(t,i||0):(this.params[r].length===0?this.params[r].push(t):this.params[r][this.params[r].length-1]=t,new f(this.params[r],0)))}get(t,i){if(t instanceof f)return t.get(i);if(Array.isArray(t)){const r=t.length-1-i;return r<0||r>=t.length?NaN:t[r]}return t}set(t,i){if(t instanceof f){t.set(0,i);return}if(Array.isArray(t)){t.length>0?t[t.length-1]=i:t.push(i);return}}}class ii{constructor(t,i,r,a,n,s){this.source=t,this.tickerId=i,this.timeframe=r,this.limit=a,this.sDate=n,this.eDate=s,this._readyPromise=new Promise(u=>{this.loadMarketData(t,i,r,a,n,s).then(c=>{const p=c;this.data=p;const l=p.map(I=>I.open),x=p.map(I=>I.close),d=p.map(I=>I.high),h=p.map(I=>I.low),g=p.map(I=>I.volume),C=p.map(I=>(I.high+I.low+I.close)/3),S=p.map(I=>(I.high+I.low)/2),A=p.map(I=>(I.high+I.low+I.open+I.close)/4),j=p.map(I=>I.openTime),Q=p.map(I=>I.closeTime);this.open=l,this.close=x,this.high=d,this.low=h,this.volume=g,this.hl2=S,this.hlc3=C,this.ohlc4=A,this.openTime=j,this.closeTime=Q,this._ready=!0,u(!0)})})}data=[];open=[];high=[];low=[];close=[];volume=[];hl2=[];hlc3=[];ohlc4=[];openTime=[];closeTime=[];_readyPromise=null;_ready=!1;_transpiledCode=null;get transpiledCode(){return this._transpiledCode}async loadMarketData(t,i,r,a,n,s){return Array.isArray(t)?t:t.getMarketData(i,r,a,n,s)}async ready(){if(this._ready)return!0;if(!this._readyPromise)throw new Error("PineTS is not ready");return this._readyPromise}run(t,i,r){if(r&&r>0){const a=typeof this.eDate>"u"&&!Array.isArray(this.source);return this._runPaginated(t,i,r,a)}else return this._runComplete(t,i)}async _runComplete(t,i){await this.ready(),i||(i=this.data.length);const r=this._initializeContext(t);return this._transpiledCode=this._transpileCode(t),await this._executeIterations(r,this._transpiledCode,this.data.length-i,this.data.length),r}async*_runPaginated(t,i,r,a=!1){await this.ready(),i||(i=this.data.length);const n=this._initializeContext(t);this._transpiledCode=this._transpileCode(t);let s=this.data.length-i;for(;;){const u=this.data.length-s;if(u>0){const l=Math.min(u,r),x=this._getResultLength(n.result);await this._executeIterations(n,this._transpiledCode,s,s+l),s+=l,yield this._createPageContext(n,x);continue}if(!a||Array.isArray(this.source))break;const{newCandles:c,updatedLastCandle:p}=await this._updateMarketData();if(c===0&&!p){yield null;continue}this._removeLastResult(n),s=this.data.length-(c+1)}}_getResultLength(t){if(Array.isArray(t))return t.length;if(typeof t=="object"&&t!==null){const i=Object.keys(t);if(i.length>0&&Array.isArray(t[i[0]]))return t[i[0]].length}return 0}_createPageContext(t,i){const r=new $e({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate});if(r.pineTSCode=t.pineTSCode,r.idx=t.idx,Array.isArray(t.result))r.result=t.result.slice(i);else if(typeof t.result=="object"&&t.result!==null){r.result={};for(let a in t.result)Array.isArray(t.result[a])?r.result[a]=t.result[a].slice(i):r.result[a]=t.result[a]}else r.result=t.result;return r.plots={...t.plots},r}async _updateMarketData(t){if(Array.isArray(this.source))return{newCandles:0,updatedLastCandle:!1};const i=this.source,r=this.data.length-1,a=this.data[r].openTime;try{const n=await i.getMarketData(this.tickerId,this.timeframe,void 0,a,t);if(!n||n.length===0)return{newCandles:0,updatedLastCandle:!1};let s=!1,u=0;for(let c=0;c<n.length;c++){const p=n[c];p.openTime===a?(this._replaceCandle(r,p),s=!0):p.openTime>a&&(this._appendCandle(p),u++)}return{newCandles:u,updatedLastCandle:s}}catch(n){return console.error("Error updating market data:",n),{newCandles:0,updatedLastCandle:!1}}}_replaceCandle(t,i){this.data[t]=i,this.open[t]=i.open,this.close[t]=i.close,this.high[t]=i.high,this.low[t]=i.low,this.volume[t]=i.volume,this.hl2[t]=(i.high+i.low)/2,this.hlc3[t]=(i.high+i.low+i.close)/3,this.ohlc4[t]=(i.high+i.low+i.open+i.close)/4,this.openTime[t]=i.openTime,this.closeTime[t]=i.closeTime}_appendCandle(t){this.data.push(t),this.open.push(t.open),this.close.push(t.close),this.high.push(t.high),this.low.push(t.low),this.volume.push(t.volume),this.hl2.push((t.high+t.low)/2),this.hlc3.push((t.high+t.low+t.close)/3),this.ohlc4.push((t.high+t.low+t.open+t.close)/4),this.openTime.push(t.openTime),this.closeTime.push(t.closeTime)}_removeLastResult(t){if(Array.isArray(t.result))t.result.pop();else if(typeof t.result=="object"&&t.result!==null)for(let i in t.result)Array.isArray(t.result[i])&&t.result[i].pop();t.data.close.pop(),t.data.open.pop(),t.data.high.pop(),t.data.low.pop(),t.data.volume.pop(),t.data.hl2.pop(),t.data.hlc3.pop(),t.data.ohlc4.pop(),t.data.openTime.pop(),t.data.closeTime&&t.data.closeTime.pop()}_initializeContext(t){const i=new $e({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate});return i.pineTSCode=t,i.data.close=[],i.data.open=[],i.data.high=[],i.data.low=[],i.data.volume=[],i.data.hl2=[],i.data.hlc3=[],i.data.ohlc4=[],i.data.openTime=[],i.data.closeTime=[],i}_transpileCode(t){return xr.bind(this)(t)}async _executeIterations(t,i,r,a){const n=["const","var","let","params"];for(let s=r;s<a;s++){t.idx=s,t.data.close.push(this.close[s]),t.data.open.push(this.open[s]),t.data.high.push(this.high[s]),t.data.low.push(this.low[s]),t.data.volume.push(this.volume[s]),t.data.hl2.push(this.hl2[s]),t.data.hlc3.push(this.hlc3[s]),t.data.ohlc4.push(this.ohlc4[s]),t.data.openTime.push(this.openTime[s]);const u=await i(t);if(typeof u=="object"){typeof t.result!="object"&&(t.result={});for(let c in u){t.result[c]===void 0&&(t.result[c]=[]);const p=Array.isArray(u[c])?u[c][u[c].length-1]:u[c];t.result[c].push(p)}}else Array.isArray(t.result)||(t.result=[]),t.result.push(u);for(let c of n)for(let p in t[c])if(Array.isArray(t[c][p])){const l=t[c][p],x=l[l.length-1];l.push(x)}}}}const Vn="https://api.binance.com/api/v3",Be={1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",45:null,60:"1h",120:"2h",180:null,240:"4h","4H":"4h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"};class Tn{cache;cacheDuration;constructor(t=5*60*1e3){this.cache=new Map,this.cacheDuration=t}generateKey(t){return Object.entries(t).filter(([i,r])=>r!==void 0).map(([i,r])=>`${i}:${r}`).join("|")}get(t){const i=this.generateKey(t),r=this.cache.get(i);return r?Date.now()-r.timestamp>this.cacheDuration?(this.cache.delete(i),null):r.data:null}set(t,i){const r=this.generateKey(t);this.cache.set(r,{data:i,timestamp:Date.now()})}clear(){this.cache.clear()}cleanup(){const t=Date.now();for(const[i,r]of this.cache.entries())t-r.timestamp>this.cacheDuration&&this.cache.delete(i)}}class Ln{cacheManager;constructor(){this.cacheManager=new Tn(5*60*1e3)}async getMarketDataInterval(t,i,r,a){try{const n=Be[i.toUpperCase()];if(!n)return console.error(`Unsupported timeframe: ${i}`),[];const s={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3};let u=[],c=r;const p=a,l=s[n];if(!l)return console.error(`Duration not defined for interval: ${n}`),[];for(;c<p;){const x=Math.min(c+1e3*l,p),d=await this.getMarketData(t,i,1e3,c,x);if(d.length===0)break;u=u.concat(d),c=d[d.length-1].closeTime+1}return u}catch(n){return console.error("Error in getMarketDataInterval:",n),[]}}async getMarketData(t,i,r,a,n){try{const s={tickerId:t,timeframe:i,limit:r,sDate:a,eDate:n},u=this.cacheManager.get(s);if(u)return console.log("cache hit",t,i,r,a,n),u;const c=Be[i.toUpperCase()];if(!c)return console.error(`Unsupported timeframe: ${i}`),[];if(this.shouldPaginate(i,r,a,n)&&a&&n){const d=await this.getMarketDataInterval(t,i,a,n),h=r?d.slice(0,r):d;return this.cacheManager.set(s,h),h}let p=`${Vn}/klines?symbol=${t}&interval=${c}`;r&&(p+=`&limit=${Math.min(r,1e3)}`),a&&(p+=`&startTime=${a}`),n&&(p+=`&endTime=${n}`);const l=await fetch(p);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const x=(await l.json()).map(d=>({openTime:parseInt(d[0]),open:parseFloat(d[1]),high:parseFloat(d[2]),low:parseFloat(d[3]),close:parseFloat(d[4]),volume:parseFloat(d[5]),closeTime:parseInt(d[6]),quoteAssetVolume:parseFloat(d[7]),numberOfTrades:parseInt(d[8]),takerBuyBaseAssetVolume:parseFloat(d[9]),takerBuyQuoteAssetVolume:parseFloat(d[10]),ignore:d[11]}));return this.cacheManager.set(s,x),x}catch(s){return console.error("Error in binance.klines:",s),[]}}shouldPaginate(t,i,r,a){if(i&&i>1e3)return!0;if(r&&a){const n=Be[t.toUpperCase()],s={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3}[n];if(s)return Math.ceil((a-r)/s)>1e3}return!1}}const Mn=ni.fileURLToPath(typeof document>"u"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||new URL("pinets.min.cjs",document.baseURI).href),Dn=Se.dirname(Mn);class Rn{dataCache=new Map;dataDirectory;constructor(t){if(t)this.dataDirectory=t;else{const i=Se.resolve(Dn,"../../../");this.dataDirectory=Se.join(i,"tests","compatibility","_data")}}getDataFileName(t,i,r,a){return r&&a?`${t}-${i}-${r}-${a}.json`:null}loadDataFromFile(t){const i=`file:${t}`;if(this.dataCache.has(i))return this.dataCache.get(i);const r=Se.join(this.dataDirectory,t);if(!ve.existsSync(r))throw new Error(`Mock data file not found: ${r}`);const a=ve.readFileSync(r,"utf-8"),n=JSON.parse(a);return this.dataCache.set(i,n),n}findDataFile(t,i,r,a){if(!ve.existsSync(this.dataDirectory))return null;const n=ve.readdirSync(this.dataDirectory).filter(c=>c.endsWith(".json"));if(r&&a){const c=`${t}-${i}-${r}-${a}.json`;if(n.includes(c))return c}const s=new RegExp(`^${t}-${i}-(\\d+)-(\\d+)\\.json$`),u=n.filter(c=>s.test(c)).map(c=>{const p=c.match(s);return{file:c,startTime:parseInt(p[1]),endTime:parseInt(p[2])}}).sort((c,p)=>p.endTime-c.endTime);if(u.length===0)return null;if(r&&a){const c=u.find(p=>p.startTime<=r&&p.endTime>=a);if(c)return c.file}return u[0].file}filterData(t,i,r,a){let n=t;return(i||r)&&(n=t.filter(s=>{const u=!i||s.openTime>=i,c=!r||s.openTime<=r;return u&&c})),n.sort((s,u)=>s.openTime-u.openTime),a&&a>0&&(n=n.slice(0,a)),n}normalizeTimeframe(t){return{1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",60:"1h",120:"2h",240:"4h","4H":"4h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"}[t.toUpperCase()]||t.toLowerCase()}async getMarketData(t,i,r,a,n){try{const s=this.normalizeTimeframe(i),u=this.findDataFile(t,s,a,n);if(!u)return console.warn(`No mock data file found for ${t} ${s}. Searched in: ${this.dataDirectory}`),[];const c=this.loadDataFromFile(u);return this.filterData(c,a,n,r)}catch(s){return console.error("Error in MockProvider.getMarketData:",s),[]}}clearCache(){this.dataCache.clear()}setDataDirectory(t){this.dataDirectory=t,this.clearCache()}}const Bn=typeof process<"u"&&process.versions&&process.versions.node;let Ae=null;if(Bn)try{Ae=new Rn}catch{Ae=null}const jn={Binance:new Ln,...Ae?{Mock:Ae}:{}};exports.Context=$e;exports.PineTS=ii;exports.Provider=jn;
|
|
30
|
+
`).length-1,this.mapping={original:null,generated:this,name:void 0,source:i.sourceMap.file||i.sourceMap._file})}write(t){this.output+=t}writeToStream(t){this.output.write(t)}writeAndMap(t,i){this.output+=t,this.map(t,i)}writeToStreamAndMap(t,i){this.output.write(t),this.map(t,i)}map(t,i){if(i!=null){const{type:s}=i;if(s[0]==="L"&&s[2]==="n"){this.column=0,this.line++;return}if(i.loc!=null){const{mapping:n}=this;n.original=i.loc.start,n.name=i.name,this.sourceMap.addMapping(n)}if(s[0]==="T"&&s[8]==="E"||s[0]==="L"&&s[1]==="i"&&typeof i.value=="string"){const{length:n}=t;let{column:o,line:u}=this;for(let c=0;c<n;c++)t[c]===`
|
|
31
|
+
`?(o=0,u++):o++;this.column=o,this.line=u;return}}const{length:r}=t,{lineEnd:a}=this;r>0&&(this.lineEndSize>0&&(a.length===1?t[r-1]===a:t.endsWith(a))?(this.line+=this.lineEndSize,this.column=0):this.column+=r)}toString(){return this.output}}function fr(e,t){const i=new hr(t);return i.generator[e.type](e,i),i.output}const mr=new Set(["Infinity","NaN","undefined","null","true","false"]),dr=new Set(["Math","Array","Object","String","Number","Boolean","Date","RegExp","Error","JSON","Promise","Set","Map","WeakSet","WeakMap","Symbol","BigInt","Proxy","Reflect","console","isNaN","isFinite","parseInt","parseFloat","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent"]);class gr{scopes=[];scopeTypes=[];scopeCounts=new Map;contextBoundVars=new Set;arrayPatternElements=new Set;rootParams=new Set;localSeriesVars=new Set;varKinds=new Map;loopVars=new Set;loopVarNames=new Map;paramIdCounter=0;cacheIdCounter=0;tempVarCounter=0;taCallIdCounter=0;hoistingStack=[];suppressHoisting=!1;get nextParamIdArg(){return{type:"Identifier",name:`'p${this.paramIdCounter++}'`}}get nextCacheIdArg(){return{type:"Identifier",name:`'cache_${this.cacheIdCounter++}'`}}getNextTACallId(){return{type:"Literal",value:`_ta${this.taCallIdCounter++}`}}constructor(){this.pushScope("glb")}pushScope(t){this.scopes.push(new Map),this.scopeTypes.push(t),this.scopeCounts.set(t,(this.scopeCounts.get(t)||0)+1)}popScope(){this.scopes.pop(),this.scopeTypes.pop()}getCurrentScopeType(){return this.scopeTypes[this.scopeTypes.length-1]}getCurrentScopeCount(){return this.scopeCounts.get(this.getCurrentScopeType())||1}addLocalSeriesVar(t){this.localSeriesVars.add(t)}isLocalSeriesVar(t){return this.localSeriesVars.has(t)}addContextBoundVar(t,i=!1){this.contextBoundVars.add(t),i&&this.rootParams.add(t)}removeContextBoundVar(t){this.contextBoundVars.has(t)&&(this.contextBoundVars.delete(t),this.rootParams.has(t)&&this.rootParams.delete(t))}addArrayPatternElement(t){this.arrayPatternElements.add(t)}isContextBound(t){return mr.has(t)||dr.has(t)?!1:this.contextBoundVars.has(t)}isArrayPatternElement(t){return this.arrayPatternElements.has(t)}isRootParam(t){return this.rootParams.has(t)}addLoopVariable(t,i){this.loopVars.add(t),this.loopVarNames.set(t,i)}getLoopVariableName(t){return this.loopVarNames.get(t)}isLoopVariable(t){return this.loopVars.has(t)}addVariable(t,i){if(this.isContextBound(t))return t;const r=this.scopes[this.scopes.length-1],a=this.scopeTypes[this.scopeTypes.length-1],s=this.scopeCounts.get(a)||1,n=`${a}${s}_${t}`;return r.set(t,n),this.varKinds.set(n,i),n}getVariable(t){if(this.loopVars.has(t)){const i=this.loopVarNames.get(t);if(i)return[i,"let"]}if(this.isContextBound(t))return[t,"let"];for(let i=this.scopes.length-1;i>=0;i--){const r=this.scopes[i];if(r.has(t)){const a=r.get(t),s=this.varKinds.get(a)||"let";return[a,s]}}return[t,"let"]}generateTempVar(){return`temp_${++this.tempVarCounter}`}enterHoistingScope(){this.hoistingStack.push([])}exitHoistingScope(){return this.hoistingStack.pop()||[]}addHoistedStatement(t){this.hoistingStack.length>0&&!this.suppressHoisting&&this.hoistingStack[this.hoistingStack.length-1].push(t)}setSuppressHoisting(t){this.suppressHoisting=t}shouldSuppressHoisting(){return this.suppressHoisting}generateParamId(){return`p${this.paramIdCounter++}`}}function ct(e,t,i,r,a){i||(i=y),function s(n,o,u){var c=u||n.type;i[c](n,o,s),t[c]&&t[c](n,o)}(e,r,a)}function D(e,t,i,r,a){var s=i?xr(i,r||void 0):r;(function n(o,u,c){s[c||o.type](o,u,n)})(e,t,a)}function xr(e,t){var i=Object.create(t||y);for(var r in e)i[r]=e[r];return i}function lt(e,t,i){i(e,t)}function pe(e,t,i){}var y={};y.Program=y.BlockStatement=y.StaticBlock=function(e,t,i){for(var r=0,a=e.body;r<a.length;r+=1){var s=a[r];i(s,t,"Statement")}};y.Statement=lt;y.EmptyStatement=pe;y.ExpressionStatement=y.ParenthesizedExpression=y.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};y.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement")};y.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};y.BreakStatement=y.ContinueStatement=pe;y.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement")};y.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,a=e.cases;r<a.length;r+=1){var s=a[r];i(s,t)}};y.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,a=e.consequent;r<a.length;r+=1){var s=a[r];i(s,t,"Statement")}};y.ReturnStatement=y.YieldExpression=y.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression")};y.ThrowStatement=y.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};y.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement")};y.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement")};y.WhileStatement=y.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement")};y.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement")};y.ForInStatement=y.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement")};y.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression")};y.DebuggerStatement=pe;y.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};y.VariableDeclaration=function(e,t,i){for(var r=0,a=e.declarations;r<a.length;r+=1){var s=a[r];i(s,t)}};y.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression")};y.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,a=e.params;r<a.length;r+=1){var s=a[r];i(s,t,"Pattern")}i(e.body,t,e.expression?"Expression":"Statement")};y.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t)};y.VariablePattern=pe;y.MemberPattern=lt;y.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};y.ArrayPattern=function(e,t,i){for(var r=0,a=e.elements;r<a.length;r+=1){var s=a[r];s&&i(s,t,"Pattern")}};y.ObjectPattern=function(e,t,i){for(var r=0,a=e.properties;r<a.length;r+=1){var s=a[r];s.type==="Property"?(s.computed&&i(s.key,t,"Expression"),i(s.value,t,"Pattern")):s.type==="RestElement"&&i(s.argument,t,"Pattern")}};y.Expression=lt;y.ThisExpression=y.Super=y.MetaProperty=pe;y.ArrayExpression=function(e,t,i){for(var r=0,a=e.elements;r<a.length;r+=1){var s=a[r];s&&i(s,t,"Expression")}};y.ObjectExpression=function(e,t,i){for(var r=0,a=e.properties;r<a.length;r+=1){var s=a[r];i(s,t)}};y.FunctionExpression=y.ArrowFunctionExpression=y.FunctionDeclaration;y.SequenceExpression=function(e,t,i){for(var r=0,a=e.expressions;r<a.length;r+=1){var s=a[r];i(s,t,"Expression")}};y.TemplateLiteral=function(e,t,i){for(var r=0,a=e.quasis;r<a.length;r+=1){var s=a[r];i(s,t)}for(var n=0,o=e.expressions;n<o.length;n+=1){var u=o[n];i(u,t,"Expression")}};y.TemplateElement=pe;y.UnaryExpression=y.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression")};y.BinaryExpression=y.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression")};y.AssignmentExpression=y.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression")};y.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression")};y.NewExpression=y.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,a=e.arguments;r<a.length;r+=1){var s=a[r];i(s,t,"Expression")}};y.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression")};y.ExportNamedDeclaration=y.ExportDefaultDeclaration=function(e,t,i){e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression")};y.ExportAllDeclaration=function(e,t,i){e.exported&&i(e.exported,t),i(e.source,t,"Expression")};y.ImportDeclaration=function(e,t,i){for(var r=0,a=e.specifiers;r<a.length;r+=1){var s=a[r];i(s,t)}i(e.source,t,"Expression")};y.ImportExpression=function(e,t,i){i(e.source,t,"Expression")};y.ImportSpecifier=y.ImportDefaultSpecifier=y.ImportNamespaceSpecifier=y.Identifier=y.PrivateIdentifier=y.Literal=pe;y.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression")};y.ClassDeclaration=y.ClassExpression=function(e,t,i){return i(e,t,"Class")};y.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t)};y.ClassBody=function(e,t,i){for(var r=0,a=e.body;r<a.length;r+=1){var s=a[r];i(s,t)}};y.MethodDefinition=y.PropertyDefinition=y.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression")};const T="$",v={createIdentifier(e){return{type:"Identifier",name:e}},createLiteral(e){return{type:"Literal",value:e}},createMemberExpression(e,t,i=!1){return{type:"MemberExpression",object:e,property:t,computed:i}},createContextIdentifier(){return this.createIdentifier(T)},createContextVariableReference(e,t){const i=this.createContextIdentifier(),r=this.createIdentifier(e),a=this.createIdentifier(t);return this.createMemberExpression(this.createMemberExpression(i,r,!1),a,!1)},createContextVariableAccess0(e,t){const i=this.createContextVariableReference(e,t);return this.createGetCall(i,0)},createArrayAccess(e,t){const i=typeof t=="number"?this.createLiteral(t):t;return this.createMemberExpression(e,i,!0)},createCallExpression(e,t){return{type:"CallExpression",callee:e,arguments:t}},createAssignmentExpression(e,t,i="="){return{type:"AssignmentExpression",operator:i,left:e,right:t}},createExpressionStatement(e){return{type:"ExpressionStatement",expression:e}},createInitCall(e,t,i){const r=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("init"),!1),a=[e,t];return i&&a.push(i),this.createCallExpression(r,a)},createInitVarCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("initVar"),!1),r=[e,t];return this.createCallExpression(i,r)},createGetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("get"),!1),r=typeof t=="number"?this.createLiteral(t):t;return this.createCallExpression(i,[e,r])},createSetCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("set"),!1);return this.createCallExpression(i,[e,t])},createMathEqCall(e,t){const i=this.createMemberExpression(this.createContextIdentifier(),this.createIdentifier("math"),!1),r=this.createMemberExpression(i,this.createIdentifier("__eq"),!1);return this.createCallExpression(r,[e,t])},createWrapperFunction(e){return{type:"FunctionDeclaration",id:null,params:[this.createIdentifier("context")],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:e}]}}},createVariableDeclaration(e,t){return{type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:this.createIdentifier(e),init:t}]}}};function yr(e){let t=null,i=T;if(e.type==="Program"&&e.body.length>0){const h=e.body[0];if(h.type==="ExpressionStatement"&&(h.expression.type==="ArrowFunctionExpression"||h.expression.type==="FunctionExpression")){const g=h.expression;g.body.type==="BlockStatement"&&(t=g.body.body,g.params.length>0&&g.params[0].type==="Identifier"&&(i=g.params[0].name))}}if(!t)return;const r=new Set,a=new Set,s=h=>{h.type==="Identifier"?r.add(h.name):h.type==="ObjectPattern"?h.properties.forEach(g=>s(g.value)):h.type==="ArrayPattern"&&h.elements.forEach(g=>{g&&s(g)})};D(e,{},{VariableDeclarator(h,g,x){s(h.id),h.init&&x(h.init,g)},FunctionDeclaration(h,g,x){s(h.id),x(h.body,g)},Identifier(h,g,x){a.add(h.name)},MemberExpression(h,g,x){x(h.object,g),h.computed&&x(h.property,g)},Property(h,g,x){h.computed&&x(h.key,g),x(h.value,g)}}),t.forEach(h=>{h.type==="VariableDeclaration"?h.declarations.forEach(g=>s(g.id)):h.type==="FunctionDeclaration"&&s(h.id)});const n=["open","high","low","close","volume","hl2","hlc3","ohlc4","openTime","closeTime"],o=["input","ta","math","request","array","na","plotchar","color","plot","nz","strategy","library","str","box","line","label","table","map","matrix"],u=n.filter(h=>!r.has(h)),c=o.filter(h=>!r.has(h)),p=u.filter(h=>a.has(h)),m=c.filter(h=>a.has(h)),d=[];p.length>0&&d.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"ObjectPattern",properties:p.map(h=>({type:"Property",key:{type:"Identifier",name:h},value:{type:"Identifier",name:h},kind:"init",shorthand:!0}))},init:{type:"MemberExpression",object:{type:"Identifier",name:i},property:{type:"Identifier",name:"data"},computed:!1}}]}),m.length>0&&d.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"ObjectPattern",properties:m.map(h=>({type:"Property",key:{type:"Identifier",name:h},value:{type:"Identifier",name:h},kind:"init",shorthand:!0}))},init:{type:"MemberExpression",object:{type:"Identifier",name:i},property:{type:"Identifier",name:"pine"},computed:!1}}]}),d.length>0&&t.unshift(...d)}function br(e){let t=null,i=T;if(e.type==="Program"&&e.body.length>0){const o=e.body[0];if(o.type==="ExpressionStatement"&&(o.expression.type==="ArrowFunctionExpression"||o.expression.type==="FunctionExpression")){const u=o.expression;u.body.type==="BlockStatement"&&(t=u.body.body,u.params.length>0&&u.params[0].type==="Identifier"&&(i=u.params[0].name))}}if(!t)return;const r=new Set(["open","high","low","close","volume","hl2","hlc3","ohlc4","openTime","closeTime"]),a=new Set(["input","ta","math","request","array","na","plotchar","color","plot","nz","strategy","library","str","box","line","label","table","map","matrix"]),s=new Set(["na","nz","plot","plotchar","color"]),n=new Map;t.forEach(o=>{o.type==="VariableDeclaration"&&o.declarations.forEach(u=>{if(u.init&&u.init.type==="MemberExpression"&&u.init.object.type==="Identifier"&&u.init.object.name===i&&u.init.property.type==="Identifier"){const c=u.init.property.name;let p=null;if(c==="data"?p=r:c==="pine"?p=a:c==="core"&&(p=s),p&&u.id.type==="ObjectPattern")u.id.properties.forEach(m=>{if(m.type==="Property"&&m.key.type==="Identifier"&&m.value.type==="Identifier"){const d=m.key.name,h=m.value.name;p.has(d)&&d!==h&&(n.set(h,d),m.value.name=d,m.shorthand=!0)}});else if(u.id.type==="Identifier"&&["ta","math","input","request","array"].includes(c)){const m=c,d=u.id.name;m!==d&&(n.set(d,m),u.id.name=m)}}})}),n.size>0&&D(e,{},{Identifier(o){n.has(o.name)&&(o.name=n.get(o.name))},MemberExpression(o,u,c){c(o.object,u),o.computed&&c(o.property,u)},Property(o,u,c){o.computed&&c(o.key,u),c(o.value,u)}})}function vr(e){try{const t=pi(e,{ecmaVersion:"latest",sourceType:"module"});if(t.type==="Program"&&t.body.length===1){const i=t.body[0];if(i.type==="ExpressionStatement"){const r=i.expression;if(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression")return!0}if(i.type==="FunctionDeclaration")return!0}return!1}catch{return!1}}function wr(e){return e=e.trim(),vr(e)?e:`(context) => {
|
|
32
|
+
${e}
|
|
33
|
+
}`}function Sr(e){D(e,null,{VariableDeclaration(t,i,r){t.declarations&&t.declarations.length>0&&t.declarations.forEach(a=>{if(a.init&&a.init.type==="ArrowFunctionExpression"&&a.init.start!==0){const s={type:"FunctionDeclaration",id:a.id,params:a.init.params,body:a.init.body.type==="BlockStatement"?a.init.body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:a.init.body}]},async:a.init.async,generator:!1};Object.assign(t,s)}}),t.body&&t.body.body&&t.body.body.forEach(a=>r(a,i))}})}function Cr(e,t){ct(e,{VariableDeclaration(i){i.declarations.forEach(r=>{const a=r.init&&r.init.type==="MemberExpression"&&r.init.object&&(r.init.object.name==="context"||r.init.object.name===T||r.init.object.name==="context2"),s=r.init&&r.init.type==="MemberExpression"&&r.init.object?.object&&(r.init.object.object.name==="context"||r.init.object.object.name===T||r.init.object.object.name==="context2");(a||s)&&(r.id.name&&t.addContextBoundVar(r.id.name),r.id.properties&&r.id.properties.forEach(n=>{n.key.name&&t.addContextBoundVar(n.key.name)}))})}})}function Nr(e,t,i=!1){e.params.forEach(r=>{r.type==="Identifier"&&t.addContextBoundVar(r.name,i)})}function _r(e,t){e.params.forEach(i=>{i.type==="Identifier"&&t.addContextBoundVar(i.name,!1)})}function Er(e,t){let i;return ct(e,{FunctionDeclaration(r){_r(r,t)},ArrowFunctionExpression(r){const a=r.start===0;a&&r.params&&r.params.length>0&&(i=r.params[0].name,r.params[0].name=T),Nr(r,t,a)},VariableDeclaration(r){r.declarations.forEach(a=>{if(a.id.type==="ArrayPattern"){const s=t.generateTempVar(),n={type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:s},init:a.init}]};a.id.elements?.forEach(u=>{u.type==="Identifier"&&t.addArrayPatternElement(u.name)});const o=a.id.elements.map((u,c)=>({type:"VariableDeclaration",kind:r.kind,declarations:[{type:"VariableDeclarator",id:u,init:{type:"MemberExpression",object:{type:"Identifier",name:s},property:{type:"Literal",value:c},computed:!0}}]}));Object.assign(r,{type:"BlockStatement",body:[n,...o]})}})},ForStatement(r){}}),i}const Je={type:"Identifier",name:"undefined"};function ce(e,t){if(e.computed&&e.property.type==="Identifier"){if(t.isLoopVariable(e.property.name)){if(e.object.type==="Identifier"&&!t.isLoopVariable(e.object.name)&&!t.isContextBound(e.object.name)){const[i,r]=t.getVariable(e.object.name),a=v.createContextVariableReference(r,i),s=v.createGetCall(a,e.property);Object.assign(e,s),e._indexTransformed=!0}return}if(!t.isContextBound(e.property.name)){const[i,r]=t.getVariable(e.property.name);e.property=v.createContextVariableReference(r,i),e.property=v.createGetCall(e.property,0)}}if(e.computed&&e.object.type==="Identifier"){if(t.isLoopVariable(e.object.name))return;if(!t.isContextBound(e.object.name)){const[i,r]=t.getVariable(e.object.name);e.object=v.createContextVariableReference(r,i)}if(e.property.type==="MemberExpression"){const i=e.property;i._indexTransformed||(ce(i,t),i._indexTransformed=!0)}}}function te(e,t){const i=v.createGetCall(v.createIdentifier(e.name),0);e.start!==void 0&&(i.start=e.start),e.end!==void 0&&(i.end=e.end),i._indexTransformed=!0,Object.assign(e,i)}function F(e,t){if(e.name!==T){if(e.name==="na"&&!(e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e)){e.name="NaN";return}if(e.name==="Math"||e.name==="NaN"||e.name==="undefined"||e.name==="Infinity"||e.name==="null"||e.name.startsWith("'")&&e.name.endsWith("'")||e.name.startsWith('"')&&e.name.endsWith('"')||e.name.startsWith("`")&&e.name.endsWith("`")||t.isLoopVariable(e.name)||t.isContextBound(e.name)&&!t.isRootParam(e.name))return;const i=e.parent&&e.parent.type==="MemberExpression"&&e.parent.object===e&&t.isContextBound(e.name),r=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee&&e.parent.callee.type==="MemberExpression"&&e.parent.callee.property.name==="param";e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left;let a=!1;if(e.parent&&e.parent.type==="CallExpression"&&e.parent.arguments.includes(e)){const d=e.parent.callee;d.type==="MemberExpression"&&d.object&&d.object.name===T&&["get","set","init","param"].includes(d.property.name)?e.parent.arguments.indexOf(e)===0&&(a=!0):a=!0}const s=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed,n=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.property===e&&e.parent.parent&&e.parent.parent.type==="CallExpression"&&e.parent.parent.callee&&e.parent.parent.callee.type==="MemberExpression"&&t.isContextBound(e.parent.parent.callee.object.name),o=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e,u=e.parent&&e.parent.type==="MemberExpression"&&e.parent.computed&&e.parent.object===e;if(i||r||a||n||o){if(o||t.isLocalSeriesVar(e.name))return;const[d,h]=t.getVariable(e.name),g=v.createContextVariableReference(h,d);Object.assign(e,g);return}if(t.isLocalSeriesVar(e.name)){if(!u&&!s){const d=v.createIdentifier(e.name),h=v.createGetCall(d,0);Object.assign(e,h)}return}const[c,p]=t.getVariable(e.name),m=v.createContextVariableReference(p,c);if(!u&&!s){const d=v.createGetCall(m,0);Object.assign(e,d)}else Object.assign(e,m)}}function Y(e,t,i){if(e.object&&e.object.type==="Identifier"&&e.object.name==="Math")return;const r=["ta","math","request","array","input"];if(e.object&&e.object.type==="Identifier"&&r.includes(e.object.name)&&i.isContextBound(e.object.name)&&!e.computed){const c=e.parent&&e.parent.type==="CallExpression"&&e.parent.callee===e,p=e.parent&&(e.parent.type==="VariableDeclarator"||e.parent.type==="Property"||e.parent.type==="AssignmentExpression");if(!c&&!p){const m={type:"CallExpression",callee:{type:"MemberExpression",object:e.object,property:e.property,computed:!1},arguments:[],_transformed:!1};e.start!==void 0&&(m.start=e.start),e.end!==void 0&&(m.end=e.end),Object.assign(e,m);return}}const a=i.getCurrentScopeType()=="if",s=i.getCurrentScopeType()=="els",n=i.getCurrentScopeType()=="for";if(!a&&!s&&!n&&e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)&&!e.computed)return;e._indexTransformed||(ce(e,i),e._indexTransformed=!0);const o=e.object&&e.object.type==="MemberExpression"&&e.object.object&&e.object.object.type==="MemberExpression"&&e.object.object.object&&e.object.object.object.name===T,u=e.object&&e.object.type==="Identifier"&&i.isContextBound(e.object.name);if(e.computed&&(o||u)){if(e.parent&&e.parent.type==="AssignmentExpression"&&e.parent.left===e)return;const c=v.createGetCall(e.object,e.property);e.start&&(c.start=e.start),e.end&&(c.end=e.end),Object.assign(e,c)}}function Ce(e,t){if(e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(t.isLoopVariable(e.name))return e;if(t.isRootParam(e.name)){const[a,s]=t.getVariable(e.name);return v.createContextVariableReference(s,a)}if(t.isContextBound(e.name)||t.isLocalSeriesVar(e.name))return e;const[i,r]=t.getVariable(e.name);return i===e.name&&!t.isContextBound(e.name)?e:v.createContextVariableReference(r,i)}return e}function ue(e,t,i=""){switch(e.type){case"BinaryExpression":return fi(e,t,i);case"MemberExpression":return{type:"MemberExpression",object:e.object.type==="Identifier"?Ce(e.object,t):e.object,property:e.property,computed:e.computed};case"Identifier":{if(t.isLoopVariable(e.name)||e.parent&&e.parent.type==="MemberExpression"&&e.parent.property===e)return e;const r=Ce(e,t);return r.type==="Identifier"&&(r.name==="NaN"||r.name==="undefined"||r.name==="Infinity"||r.name==="null"||r.name==="Math")?r:v.createGetCall(r,0)}case"UnaryExpression":return mi(e,t,i);case"ConditionalExpression":{const r=ue(e.test,t,i),a=ue(e.consequent,t,i),s=ue(e.alternate,t,i);return{type:"ConditionalExpression",test:r,consequent:a,alternate:s,start:e.start,end:e.end}}}return e}function fi(e,t,i){const r=ue(e.left,t,i),a=ue(e.right,t,i),s={type:"BinaryExpression",operator:e.operator,left:r,right:a,start:e.start,end:e.end};return D(s,t,{CallExpression(n,o){n._transformed||Z(n,o)},MemberExpression(n){Y(n,"",t)}}),s}function kr(e,t,i){const r=ue(e.left,t,i),a=ue(e.right,t,i),s={type:"LogicalExpression",operator:e.operator,left:r,right:a,start:e.start,end:e.end};return D(s,t,{CallExpression(n,o){n._transformed||Z(n,o)}}),s}function Ir(e,t,i){D(e,{parent:e,inNamespaceCall:!1},{Identifier(n,o,u){if(n.name=="NaN")return;if(n.name=="na"){n.name="NaN";return}n.parent=o.parent,F(n,t);const c=n.parent&&n.parent.type==="BinaryExpression";(n.parent&&n.parent.type==="ConditionalExpression"||c)&&(n.type==="MemberExpression"?ce(n,t):n.type==="Identifier"&&(n.parent&&n.parent.type==="CallExpression"&&n.parent.callee&&n.parent.callee.object&&n.parent.callee.object.name===T&&n.parent.callee.property.name==="get"||te(n)))},MemberExpression(n,o,u){ce(n,t),n.object&&u(n.object,{parent:n,inNamespaceCall:o.inNamespaceCall})},ConditionalExpression(n,o,u){n.test&&u(n.test,{parent:n,inNamespaceCall:o.inNamespaceCall}),n.consequent&&u(n.consequent,{parent:n,inNamespaceCall:o.inNamespaceCall}),n.alternate&&u(n.alternate,{parent:n,inNamespaceCall:o.inNamespaceCall})},CallExpression(n,o,u){const c=n.callee&&n.callee.type==="MemberExpression"&&n.callee.object&&n.callee.object.type==="Identifier"&&t.isContextBound(n.callee.object.name);Z(n,t),n.arguments.forEach(p=>u(p,{parent:n,inNamespaceCall:c||o.inNamespaceCall}))}});const r=v.createMemberExpression(v.createIdentifier(i),v.createIdentifier("param")),a=t.generateParamId(),s={type:"CallExpression",callee:r,arguments:[e,Je,{type:"Identifier",name:`'${a}'`}],_transformed:!0,_isParamCall:!0};if(!t.shouldSuppressHoisting()){const n=a;t.addLocalSeriesVar(n);const o=v.createVariableDeclaration(n,s);return t.addHoistedStatement(o),v.createIdentifier(n)}return s}function mi(e,t,i){const r=ue(e.argument,t,i);return{type:"UnaryExpression",operator:e.operator,prefix:e.prefix,argument:r,start:e.start,end:e.end}}function Nt(e,t,i){switch(e?.type){case"BinaryExpression":e=fi(e,i,t);break;case"LogicalExpression":e=kr(e,i,t);break;case"ConditionalExpression":return Ir(e,i,t);case"UnaryExpression":e=mi(e,i,t);break;case"ArrayExpression":e.elements=e.elements.map(o=>{if(o.type==="Identifier"){if(i.isContextBound(o.name)&&!i.isRootParam(o.name))return o;const[u,c]=i.getVariable(o.name);return v.createContextVariableAccess0(c,u)}return o});break}if(e.type==="MemberExpression"&&e.computed&&e.property){const o=e.object.type==="Identifier"&&i.isContextBound(e.object.name)&&!i.isRootParam(e.object.name)?e.object:Ce(e.object,i),u=e.property.type==="Identifier"&&!i.isContextBound(e.property.name)&&!i.isLoopVariable(e.property.name)?Ce(e.property,i):e.property,c=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),p=i.generateParamId(),m={type:"CallExpression",callee:c,arguments:[o,u,{type:"Identifier",name:`'${p}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const d=p;i.addLocalSeriesVar(d);const h=v.createVariableDeclaration(d,m);return i.addHoistedStatement(h),v.createIdentifier(d)}return m}if(e.type==="ObjectExpression"&&(e.properties=e.properties.map(o=>{if(o.value.name){const[u,c]=i.getVariable(o.value.name);return{type:"Property",key:{type:"Identifier",name:o.key.name},value:v.createContextVariableReference(c,u),kind:"init",method:!1,shorthand:!1,computed:!1}}return o})),e.type==="Identifier"){if(e.name==="na")return e.name="NaN",e;if(i.isContextBound(e.name)&&!i.isRootParam(e.name)){const o=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),u=i.generateParamId(),c={type:"CallExpression",callee:o,arguments:[e,Je,{type:"Identifier",name:`'${u}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const p=u;i.addLocalSeriesVar(p);const m=v.createVariableDeclaration(p,c);return i.addHoistedStatement(m),v.createIdentifier(p)}return c}}e?.type==="CallExpression"&&Z(e,i);const r=v.createMemberExpression(v.createIdentifier(t),v.createIdentifier("param")),a=e.type==="Identifier"?Ce(e,i):e,s=i.generateParamId(),n={type:"CallExpression",callee:r,arguments:[a,Je,{type:"Identifier",name:`'${s}'`}],_transformed:!0,_isParamCall:!0};if(!i.shouldSuppressHoisting()){const o=s;i.addLocalSeriesVar(o);const u=v.createVariableDeclaration(o,n);return i.addHoistedStatement(u),v.createIdentifier(o)}return n}function Z(e,t,i){if(!e._transformed){if(e.callee&&e.callee.type==="MemberExpression"&&e.callee.object&&e.callee.object.type==="Identifier"&&(t.isContextBound(e.callee.object.name)||e.callee.object.name==="math"||e.callee.object.name==="ta")){if(e.callee.object.name===T&&["get","init","param"].includes(e.callee.property.name))return;const r=e.callee.object.name,a=[];if(e.arguments.forEach(s=>{if(s._isParamCall){a.push(s);return}a.push(Nt(s,r,t))}),e.arguments=a,r==="ta"&&e.arguments.push(t.getNextTACallId()),!t.shouldSuppressHoisting()){const s=t.generateTempVar();t.addLocalSeriesVar(s);const n=v.createVariableDeclaration(s,Object.assign({},e));t.addHoistedStatement(n),Object.assign(e,v.createIdentifier(s));return}e._transformed=!0}else e.callee&&e.callee.type==="Identifier"&&(e.arguments=e.arguments.map(r=>r._isParamCall?r:Nt(r,T,t)),e._transformed=!0);e.arguments.forEach(r=>{D(r,{parent:e},{Identifier(a,s,n){a.parent=s.parent,F(a,t);const o=a.parent&&a.parent.type==="BinaryExpression";(a.parent&&a.parent.type==="ConditionalExpression"||o)&&(a.type==="MemberExpression"?ce(a,t):a.type==="Identifier"&&(a.parent&&a.parent.type==="CallExpression"&&a.parent.callee&&a.parent.callee.object&&a.parent.callee.object.name===T&&a.parent.callee.property.name==="get"||te(a)))},CallExpression(a,s,n){a._transformed||Z(a,t)},MemberExpression(a,s,n){Y(a,"",t),a.object&&n(a.object,{parent:a})}})})}}function di(e,t){let i=null;if(e.left.type==="Identifier"){const[r,a]=t.getVariable(e.left.name);i=v.createContextVariableReference(a,r)}else if(e.left.type==="MemberExpression"&&e.left.computed&&e.left.object.type==="Identifier"){const r=e.left.object.name,[a,s]=t.getVariable(r),n=a!==r,o=t.isContextBound(r);(n||o)&&!t.isLoopVariable(r)&&e.left.property.type==="Literal"&&e.left.property.value===0&&(i=v.createContextVariableReference(s,a))}if(D(e.right,{parent:e.right,inNamespaceCall:!1},{Identifier(r,a,s){r.name=="na"&&(r.name="NaN"),r.parent=a.parent,F(r,t);const n=r.parent&&r.parent.type==="BinaryExpression",o=r.parent&&r.parent.type==="ConditionalExpression",u=t.isContextBound(r.name)&&!t.isRootParam(r.name),c=r.parent&&r.parent.type==="MemberExpression"&&r.parent.computed&&r.parent.object===r,p=r.parent&&r.parent._isParamCall,m=r.parent&&r.parent.type==="MemberExpression",d=r.name==="NaN",h=r.parent&&r.parent.type==="CallExpression"&&r.parent.callee&&r.parent.callee.object&&r.parent.callee.object.name===T&&r.parent.callee.property.name==="get";(u||o||n)&&(r.type==="MemberExpression"?ce(r,t):r.type==="Identifier"&&!m&&!c&&!p&&!d&&!h&&te(r))},MemberExpression(r,a,s){Y(r,"",t),r.type==="CallExpression"?r.arguments.forEach(n=>s(n,{parent:r,inNamespaceCall:a.inNamespaceCall})):r.object&&s(r.object,{parent:r,inNamespaceCall:a.inNamespaceCall})},CallExpression(r,a,s){const n=r.callee&&r.callee.type==="MemberExpression"&&r.callee.object&&r.callee.object.type==="Identifier"&&t.isContextBound(r.callee.object.name);Z(r,t),r.type==="CallExpression"&&r.arguments.forEach(o=>s(o,{parent:r,inNamespaceCall:n||a.inNamespaceCall}))}}),i){let r=e.right;if(e.operator!=="="){const s=e.operator.replace("=",""),n=v.createGetCall(i,0);r={type:"BinaryExpression",operator:s,left:n,right:e.right,start:e.start,end:e.end}}const a=v.createSetCall(i,r);e.start&&(a.start=e.start),e.end&&(a.end=e.end),Object.assign(e,a)}}function gi(e,t){e.declarations.forEach(i=>{i.init.name=="na"&&(i.init.name="NaN");const r=i.init&&i.init.type==="MemberExpression"&&i.init.object&&(i.init.object.name==="context"||i.init.object.name===T||i.init.object.name==="context2"),a=i.init&&i.init.type==="MemberExpression"&&i.init.object?.object&&(i.init.object.object.name==="context"||i.init.object.object.name===T||i.init.object.object.name==="context2"),s=i.init&&i.init.type==="ArrowFunctionExpression";if(r){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(h=>{h.key.name&&t.addContextBoundVar(h.key.name)}),i.init.object.name=T;return}if(a){i.id.name&&t.addContextBoundVar(i.id.name),i.id.properties&&i.id.properties.forEach(h=>{h.key.name&&t.addContextBoundVar(h.key.name)}),i.init.object.object.name=T;return}s&&i.init.params.forEach(h=>{h.type==="Identifier"&&t.addContextBoundVar(h.name)});const n=t.addVariable(i.id.name,e.kind),o=e.kind;i.init&&!s&&(i.init.type==="CallExpression"&&i.init.callee.type==="MemberExpression"&&i.init.callee.object&&i.init.callee.object.type==="Identifier"&&t.isContextBound(i.init.callee.object.name)?Z(i.init,t):D(i.init,{parent:i.init},{Identifier(h,g){h.parent=g.parent,F(h,t);const x=h.parent&&h.parent.type==="BinaryExpression",b=h.parent&&h.parent.type==="UnaryExpression",N=h.parent&&h.parent.type==="ConditionalExpression",k=h.parent&&h.parent.type==="CallExpression"&&h.parent.callee&&h.parent.callee.object&&h.parent.callee.object.name===T&&h.parent.callee.property.name==="get";h.type==="Identifier"&&(x||b||N)&&!k&&te(h)},CallExpression(h,g,x){h.callee.type==="Identifier"&&(h.callee.parent=h),h.arguments.forEach(b=>{b.type==="Identifier"&&(b.parent=h)}),Z(h,t),h.type==="CallExpression"&&h.arguments.forEach(b=>x(b,{parent:h}))},BinaryExpression(h,g,x){h.left.type==="Identifier"&&(h.left.parent=h),h.right.type==="Identifier"&&(h.right.parent=h),x(h.left,{parent:h}),x(h.right,{parent:h})},MemberExpression(h,g,x){h.object&&h.object.type==="Identifier"&&(h.object.parent=h),h.property&&h.property.type==="Identifier"&&(h.property.parent=h),Y(h,"",t),h.type==="CallExpression"?h.arguments.forEach(b=>x(b,{parent:h})):h.object&&x(h.object,{parent:h})}}));const u=v.createContextVariableReference(o,n),c=t.isArrayPatternElement(i.id.name),p=!c&&i.init&&i.init.type==="MemberExpression"&&i.init.computed&&i.init.property&&(i.init.property.type==="Literal"||i.init.property.type==="MemberExpression");i.init?.property?.type==="MemberExpression"&&(i.init.property._indexTransformed||(ce(i.init.property,t),i.init.property._indexTransformed=!0));let m;i.init?s||c?m=i.init:o==="var"?m=v.createInitVarCall(u,i.init):m=v.createInitCall(u,p?i.init.object:i.init,p?i.init.property:void 0):m=v.createIdentifier("undefined");const d=v.createExpressionStatement(v.createAssignmentExpression(u,m));if(c){const h=d.expression.right.object,g=i.init.property.value,x={type:"MemberExpression",object:v.createGetCall(h,0),property:{type:"Literal",value:g},computed:!0};d.expression.right=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("init")),[u,x])}s&&(t.pushScope("fn"),D(i.init.body,t,{BlockStatement(h,g,x){h.body.forEach(b=>x(b,g))},IfStatement(h,g,x){g.pushScope("if"),x(h.consequent,g),h.alternate&&(g.pushScope("els"),x(h.alternate,g),g.popScope()),g.popScope()},VariableDeclaration(h,g){gi(h,g)},Identifier(h,g){F(h,g)},AssignmentExpression(h,g){di(h,g)}}),t.popScope()),Object.assign(e,d)})}function Ar(e,t,i){if(t.setSuppressHoisting(!0),e.init&&e.init.type==="VariableDeclaration"){const r=e.init.declarations[0],a=r.id.name;t.addLoopVariable(a,a),e.init={type:"VariableDeclaration",kind:e.init.kind,declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:a},init:r.init}]},r.init&&D(r.init,t,{Identifier(s,n){t.isLoopVariable(s.name)||(t.pushScope("for"),F(s,n),t.popScope())},MemberExpression(s){t.pushScope("for"),Y(s,"",t),t.popScope()}})}e.test&&D(e.test,t,{Identifier(r,a){!t.isLoopVariable(r.name)&&!r.computed&&(t.pushScope("for"),F(r,a),r.type==="Identifier"&&(r.computed=!0,te(r)),t.popScope())},MemberExpression(r){t.pushScope("for"),Y(r,"",t),t.popScope()}}),e.update&&D(e.update,t,{Identifier(r,a){t.isLoopVariable(r.name)||(t.pushScope("for"),F(r,a),t.popScope())}}),t.setSuppressHoisting(!1),t.pushScope("for"),i(e.body,t),t.popScope()}function Pr(e,t){D(e,t,{MemberExpression(i){Y(i,"",t)},CallExpression(i,r){Z(i,r)},Identifier(i,r){F(i,r);const a=t.getCurrentScopeType()==="if";t.isContextBound(i.name)&&!t.isRootParam(i.name)&&a&&te(i)}})}function Vr(e,t,i){e.test&&(t.pushScope("if"),Pr(e.test,t),t.popScope()),t.pushScope("if"),i(e.consequent,t),t.popScope(),e.alternate&&(t.pushScope("els"),i(e.alternate,t),t.popScope())}function Tr(e,t){const i=t.getCurrentScopeType();if(e.argument&&(e.argument.type==="ArrayExpression"?(e.argument.elements=e.argument.elements.map(r=>{if(r.type==="Identifier"){if(t.isContextBound(r.name)&&!t.isRootParam(r.name))return v.createGetCall(r,0);const[a,s]=t.getVariable(r.name);return v.createContextVariableAccess0(s,a)}else if(r.type==="MemberExpression")return r.object&&r.object.type==="MemberExpression"&&r.object.object&&r.object.object.type==="Identifier"&&r.object.object.name==="$"&&r.object.property&&["const","let","var","params"].includes(r.object.property.name)?v.createGetCall(r,0):(r.computed&&r.object.type==="Identifier"&&t.isContextBound(r.object.name)&&!t.isRootParam(r.object.name)||Y(r,"",t),r);return r}),e.argument={type:"ArrayExpression",elements:[e.argument]}):e.argument.type==="BinaryExpression"?D(e.argument,t,{Identifier(r,a){F(r,a),r.type==="Identifier"&&te(r)},MemberExpression(r){Y(r,"",t)}}):e.argument.type==="ObjectExpression"?e.argument.properties=e.argument.properties.map(r=>{if(r.shorthand){const[a,s]=t.getVariable(r.value.name);return{type:"Property",key:v.createIdentifier(r.key.name),value:v.createContextVariableReference(s,a),kind:"init",method:!1,shorthand:!1,computed:!1}}if(r.value&&r.value.type==="Identifier"){if(t.isContextBound(r.value.name)&&!t.isRootParam(r.value.name))r.value=v.createGetCall(r.value,0);else if(!t.isContextBound(r.value.name)){const[a,s]=t.getVariable(r.value.name);r.value=v.createContextVariableReference(s,a)}}return r}):e.argument.type==="Identifier"&&(F(e.argument,t),e.argument.type==="Identifier"&&te(e.argument)),i==="fn")){e.argument.type==="Identifier"&&t.isContextBound(e.argument.name)&&!t.isRootParam(e.argument.name)?e.argument=v.createArrayAccess(e.argument,0):e.argument.type==="MemberExpression"?e.argument.object.type==="Identifier"&&t.isContextBound(e.argument.object.name)&&!t.isRootParam(e.argument.object.name)&&(e.argument._indexTransformed||(ce(e.argument,t),e.argument._indexTransformed=!0)):(e.argument.type==="BinaryExpression"||e.argument.type==="LogicalExpression"||e.argument.type==="ConditionalExpression"||e.argument.type==="CallExpression")&&D(e.argument,t,{Identifier(a,s){F(a,s),a.type==="Identifier"&&!a._arrayAccessed&&(te(a),a._arrayAccessed=!0)},MemberExpression(a){Y(a,"",t)},CallExpression(a,s){Z(a,s)}});const r=v.createCallExpression(v.createMemberExpression(v.createContextIdentifier(),v.createIdentifier("precision")),[e.argument]);e.argument=r}}function Mr(e,t,i){e.body&&e.body.type==="BlockStatement"&&(t.pushScope("fn"),i(e.body,t),t.popScope())}function Lr(e){const t={...y,LineComment:()=>{}};ct(e,{BinaryExpression(i){if(i.operator==="=="||i.operator==="==="){const r=i.left,a=i.right,s=v.createMathEqCall(r,a);s._transformed=!0,Object.assign(i,s)}}},t)}function Dr(e,t,i,r={debug:!1,ln:!1},a=[]){const s=n=>{if(!r.debug||!n.loc||!a.length)return null;const o=n.loc.start.line-1;if(o>=0&&o<a.length){const u=a[o].trim();if(u)return{type:"LineComment",value:`${r.ln?` [Line ${n.loc.start.line}]`:""} ${u}`}}return null};D(e,t,{Program(n,o,u){const c=[];n.body.forEach(p=>{o.enterHoistingScope(),u(p,o);const m=o.exitHoistingScope(),d=s(p);d&&c.push(d),c.push(...m),c.push(p)}),n.body=c},BlockStatement(n,o,u){const c=[];n.body.forEach(p=>{o.enterHoistingScope(),u(p,o);const m=o.exitHoistingScope(),d=s(p);d&&c.push(d),c.push(...m),c.push(p)}),n.body=c},ReturnStatement(n,o){Tr(n,o)},VariableDeclaration(n,o){gi(n,o)},Identifier(n,o){F(n,o)},CallExpression(n,o){Z(n,o)},MemberExpression(n,o){Y(n,i,o)},AssignmentExpression(n,o){di(n,o)},FunctionDeclaration(n,o,u){Mr(n,o,u)},ForStatement(n,o,u){Ar(n,o,u)},IfStatement(n,o,u){Vr(n,o,u)}})}function Rr(e,t={debug:!1,ln:!1}){typeof t=="boolean"&&(t={debug:t,ln:!0});const{debug:i}=t;let r=typeof e=="function"?e.toString():e;r=r.trim(),r=wr(r);const a=i?r.split(`
|
|
34
|
+
`):[],s=pi(r,{ecmaVersion:"latest",sourceType:"module",locations:i});Sr(s),br(s),yr(s);const n=new gr;Cr(s,n);const o=Er(s,n)||"";Dr(s,n,o,t,a),Lr(s);const u=pr||ut||void 0,c=Object.assign({},u,{LineComment(m,d){d.write("//"+m.value)}}),p=fr(s,{generator:c,comments:i});return new Function("",`var _r = ${p}
|
|
35
|
+
; return _r;`)(this)}class O{constructor(t){this.array=t}toString(){return"PineArrayObject:"+this.array.toString()}}function Br(e){return t=>new O(t.array.map(i=>Math.abs(i)))}function jr(e){return t=>e.array.sum(t)/t.array.length}function Or(e){return t=>{t.array.length=0}}function Fr(e){return(t,i)=>(t.array.push(...i.array),t)}function Wr(e){return t=>new O([...t.array])}function $r(e){return(t,i,r=!0)=>{if(t.array.length!==i.array.length||t.array.length<2)return NaN;const a=r?t.array.length:t.array.length-1,s=e.array.avg(t),n=e.array.avg(i);let o=0;for(let u=0;u<t.array.length;u++)o+=(t.array[u]-s)*(i.array[u]-n);return o/a}}function qr(e){return(t,i)=>t.array.every(i)}function Ur(e){return(t,i,r=0,a)=>{const s=t.array.length,n=a!==void 0?Math.min(a,s):s;for(let o=r;o<n;o++)t.array[o]=i}}function Gr(e){return t=>t.array.length>0?t.array[0]:e.NA}function Hr(e){return(...t)=>new O([...t])}function zr(e){return(t,i)=>t.array[i]}function Kr(e){return(t,i)=>t.array.includes(i)}function Qr(e){return(t,i)=>t.array.indexOf(i)}function Xr(e){return(t,i,r)=>{t.array.splice(i,0,r)}}function Yr(e){return(t,i=",")=>t.array.join(i)}function Zr(e){return t=>t.array.length>0?t.array[t.array.length-1]:e.NA}function Jr(e){return(t,i)=>t.array.lastIndexOf(i)}function ea(e){return(t,i=0)=>[...t.array].sort((r,a)=>a-r)[i]??e.NA}function ta(e){return(t,i=0)=>[...t.array].sort((r,a)=>r-a)[i]??e.NA}function ia(e){return(t,i)=>new O(Array(t).fill(i))}function ra(e){return(t,i=!1)=>new O(Array(t).fill(i))}function aa(e){return(t,i=NaN)=>new O(Array(t).fill(i))}function na(e){return(t,i=0)=>new O(Array(t).fill(Math.round(i)))}function sa(e){return(t,i="")=>new O(Array(t).fill(i))}class f{constructor(t,i=0){this.data=t,this.offset=i}get(t){const i=this.data.length-1-(this.offset+t);return i<0||i>=this.data.length?NaN:this.data[i]}set(t,i){const r=this.data.length-1-(this.offset+t);r>=0&&r<this.data.length&&(this.data[r]=i)}get length(){return this.data.length}toArray(){return this.data}static from(t){return t instanceof f?t:Array.isArray(t)?new f(t):new f([t])}}function oa(e){return(t,i=0)=>f.from(t).get(i)}function ua(e){return t=>t.array.pop()}function ca(e){return(t,i)=>{t.array.push(i)}}function la(e){return t=>e.array.max(t)-e.array.min(t)}function pa(e){return(t,i)=>i>=0&&i<t.array.length?t.array.splice(i,1)[0]:e.NA}function ha(e){return t=>{t.array.reverse()}}function fa(e){return(t,i,r)=>{t.array[i]=r}}function ma(e){return t=>t.array.shift()}function da(e){return t=>t.array.length}function ga(e){return(t,i,r)=>{const a=r!==void 0?r+1:void 0;return new O(t.array.slice(i,a))}}function xa(e){return(t,i)=>t.array.some(i)}function ya(e){return(t,i="asc")=>{t.array.sort((r,a)=>i==="asc"?r-a:a-r)}}function ba(e){return(t,i)=>{const r=t.array.map((a,s)=>s);return r.sort((a,s)=>{const n=t.array[a],o=t.array[s];return i?i(n,o):n-o}),new O(r)}}function va(e){return t=>{const i=e.array.avg(t),r=e.array.stdev(t);return r===0?new O(t.array.map(()=>0)):new O(t.array.map(a=>(a-i)/r))}}function wa(e){return(t,i=!0)=>{const r=e.array.avg(t),a=t.array.map(n=>Math.pow(n-r,2)),s=i?t.array.length:t.array.length-1;return Math.sqrt(e.array.sum(new O(a))/s)}}function Sa(e){return t=>t.array.reduce((i,r)=>i+(isNaN(r)?0:r),0)}function Ca(e){return(t,i)=>{t.array.unshift(i)}}function Na(e){return(t,i=!0)=>{const r=e.array.avg(t),a=t.array.map(n=>Math.pow(n-r,2)),s=i?t.array.length:t.array.length-1;return e.array.sum(new O(a))/s}}const _a={abs:Br,avg:jr,clear:Or,concat:Fr,copy:Wr,covariance:$r,every:qr,fill:Ur,first:Gr,from:Hr,get:zr,includes:Kr,indexof:Qr,insert:Xr,join:Yr,last:Zr,lastindexof:Jr,max:ea,min:ta,new:ia,new_bool:ra,new_float:aa,new_int:na,new_string:sa,param:oa,pop:ua,push:ca,range:la,remove:pa,reverse:ha,set:fa,shift:ma,size:da,slice:ga,some:xa,sort:ya,sort_indices:ba,standardize:va,stdev:wa,sum:Sa,unshift:Ca,variance:Na};class Ea{constructor(t){this.context=t,Object.entries(_a).forEach(([i,r])=>{this[i]=r(t)})}_cache={};abs;avg;clear;concat;copy;covariance;every;fill;first;from;get;includes;indexof;insert;join;last;lastindexof;max;min;new;new_bool;new_float;new_int;new_string;param;pop;push;range;remove;reverse;set;shift;size;slice;some;sort;sort_indices;standardize;stdev;sum;unshift;variance}class ka{constructor(t){this.context=t}color={param:(t,i=0)=>f.from(t).get(i),rgb:(t,i,r,a)=>a?`rgba(${t}, ${i}, ${r}, ${a})`:`rgb(${t}, ${i}, ${r})`,new:(t,i)=>{if(t&&t.startsWith("#")){const r=t.slice(1),a=parseInt(r.slice(0,2),16),s=parseInt(r.slice(2,4),16),n=parseInt(r.slice(4,6),16);return i?`rgba(${a}, ${s}, ${n}, ${i})`:`rgb(${a}, ${s}, ${n})`}return i?`rgba(${t}, ${i})`:t},white:"white",lime:"lime",green:"green",red:"red",maroon:"maroon",black:"black",gray:"gray",blue:"blue"};extractPlotOptions(t){const i={};for(let r in t)i[r]=f.from(t[r]).get(0);return i}indicator(t,i,r){}plotchar(t,i,r){this.context.plots[i]||(this.context.plots[i]={data:[],options:this.extractPlotOptions(r),title:i});const a=f.from(t).get(0);this.context.plots[i].data.push({time:this.context.marketData[this.context.idx].openTime,value:a,options:{...this.extractPlotOptions(r),style:"char"}})}plot(t,i,r){this.context.plots[i]||(this.context.plots[i]={data:[],options:this.extractPlotOptions(r),title:i});const a=f.from(t).get(0);this.context.plots[i].data.push({time:this.context.marketData[this.context.idx].openTime,value:a,options:this.extractPlotOptions(r)})}get bar_index(){return this.context.idx}na(t){return isNaN(f.from(t).get(0))}nz(t,i=0){const r=f.from(t).get(0),a=f.from(i).get(0);return isNaN(r)?a:r}}function Ia(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Aa(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Pa(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Va(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Ta(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Ma(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function La(e){return(t,i=0)=>[f.from(t).get(i)]}function Da(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Ra(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Ba(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function ja(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Oa(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Fa(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function Wa(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}function $a(e){return(t,{title:i,group:r}={})=>Array.isArray(t)?t[0]:t}const qa={any:Ia,bool:Aa,color:Pa,enum:Va,float:Ta,int:Ma,param:La,price:Da,session:Ra,source:Ba,string:ja,symbol:Oa,text_area:Fa,time:Wa,timeframe:$a};class Ua{constructor(t){this.context=t,Object.entries(qa).forEach(([i,r])=>{this[i]=r(t)})}any;bool;color;enum;float;int;param;price;session;source;string;symbol;text_area;time;timeframe}function Ga(e){return t=>Math.abs(f.from(t).get(0))}function Ha(e){return t=>Math.acos(f.from(t).get(0))}function za(e){return t=>Math.asin(f.from(t).get(0))}function Ka(e){return t=>Math.atan(f.from(t).get(0))}function Qa(e){return(...t)=>{const i=t.map(r=>f.from(r).get(0));return i.reduce((r,a)=>r+a,0)/i.length}}function Xa(e){return t=>Math.ceil(f.from(t).get(0))}function Ya(e){return t=>Math.cos(f.from(t).get(0))}function Za(e){return t=>Math.exp(f.from(t).get(0))}function Ja(e){return t=>Math.floor(f.from(t).get(0))}function en(e){return t=>Math.log(f.from(t).get(0))}function tn(e){return t=>Math.log(f.from(t).get(0))}function rn(e){return t=>Math.log10(f.from(t).get(0))}function an(e){return(...t)=>{const i=t.map(r=>f.from(r).get(0));return Math.max(...i)}}function nn(e){return(...t)=>{const i=t.map(r=>f.from(r).get(0));return Math.min(...i)}}function sn(e){return(t,i,r)=>typeof t=="string"?t:t instanceof f?i?new f(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new f(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new f(e.params[r],0)))}function on(e){return(t,i)=>Math.pow(f.from(t).get(0),f.from(i).get(0))}function un(e){return()=>Math.random()}function cn(e){return t=>Math.round(f.from(t).get(0))}function ln(e){return t=>Math.sin(f.from(t).get(0))}function pn(e){return t=>Math.sqrt(f.from(t).get(0))}function hn(e){return(t,i)=>{const r=f.from(i).get(0),a=f.from(t);let s=0;for(let n=0;n<r;n++){const o=a.get(n);s+=o}return s}}function fn(e){return t=>Math.tan(f.from(t).get(0))}function mn(e){return(t,i)=>{const r=f.from(t).get(0),a=f.from(i).get(0);return isNaN(r)&&isNaN(a)?!0:isNaN(r)||isNaN(a)?!1:Math.abs(r-a)<1e-8}}const dn={abs:Ga,acos:Ha,asin:za,atan:Ka,avg:Qa,ceil:Xa,cos:Ya,exp:Za,floor:Ja,ln:en,log:tn,log10:rn,max:an,min:nn,param:sn,pow:on,random:un,round:cn,sin:ln,sqrt:pn,sum:hn,tan:fn,__eq:mn};class gn{constructor(t){this.context=t,Object.entries(dn).forEach(([i,r])=>{this[i]=r(t)})}_cache={};abs;acos;asin;atan;avg;ceil;cos;exp;floor;ln;log;log10;max;min;param;pow;random;round;sin;sqrt;sum;tan;__eq}function xn(e){return(t,i,r)=>{e.params[r]||(e.params[r]=[]);let a;if(t instanceof f)a=t.get(i||0);else if(Array.isArray(t)){const s=t.every(o=>o instanceof f),n=t.every(o=>!(o instanceof f)&&!Array.isArray(o));(s||n)&&t.length>=1?s?a=t.map(o=>o.get(0)):a=t:a=f.from(t).get(i||0)}else a=t;return e.params[r].length===0?e.params[r].push(a):e.params[r][e.params[r].length-1]=a,[a,r]}}const _t=["1","3","5","15","30","45","60","120","180","240","D","W","M"];function Et(e,t,i,r,a=!1){for(let s=0;s<i.length;s++)if(i[s]<=e&&t<=r[s])return a||t>=r[s]?s:s-1;return-1}function kt(e,t,i,r,a=!1,s,n=!1){for(let o=i.length-1;o>=0;o--){if(r[o]<=t&&i[o]>=e){const u=s&&t>s;if(n&&a)for(let c=0;c<i.length;c++){if(i[c]>=e&&i[c]<t)return c;if(i[c]>=t)break}if(u&&a&&!n)for(let c=0;c<i.length;c++){if(i[c]>=e&&i[c]<t)return c;if(i[c]>=t)break}return o}if(r[o]<e)break}return-1}function yn(e){return async(t,i,r,a=!1,s=!1,n=!1,o=null,u=null)=>{const c=t[0],p=i[0],m=r[0],d=r[1],h=Array.isArray(a)?a[0]:a,g=Array.isArray(s)?s[0]:s;if(e.isSecondaryContext)return m;const x=_t.indexOf(e.timeframe),b=_t.indexOf(p);if(x==-1||b==-1)throw new Error("Invalid timeframe");if(x===b)return m;const N=x>b,k=f.from(e.data.openTime).get(0),E=f.from(e.data.closeTime).get(0),w=`${c}_${p}_${d}`,L=`${w}_prevIdx`;if(e.cache[w]){const we=e.cache[w],Ie=N?kt(k,E,we.data.openTime.data,we.data.closeTime.data,g,e.eDate,h):Et(k,E,we.data.openTime.data,we.data.closeTime.data,g);if(Ie==-1)return NaN;const fe=we.params[d][Ie];if(!N&&h){const ht=e.cache[L];return ht!==void 0&&ht===Ie?NaN:(e.cache[L]=Ie,Array.isArray(fe)?[fe]:fe)}return Array.isArray(fe)?[fe]:fe}const W=1e3*60*60*24*30,se=e.sDate?e.sDate-W:void 0,K=e.sDate&&e.eDate?void 0:e.limit||1e3,pt=new xi(e.source,c,p,K,se,void 0);pt.markAsSecondary();const he=await pt.run(e.pineTSCode);e.cache[w]=he;const $e=N?kt(k,E,he.data.openTime.data,he.data.closeTime.data,g,e.eDate,h):Et(k,E,he.data.openTime.data,he.data.closeTime.data,g);if($e==-1)return NaN;const qe=he.params[d][$e];return!N&&h?(e.cache[L]=$e,NaN):Array.isArray(qe)?[qe]:qe}}const bn={param:xn,security:yn};class vn{constructor(t){this.context=t,Object.entries(bn).forEach(([i,r])=>{this[i]=r(t)})}_cache={};param;security}function wn(e){return t=>{e.taState||(e.taState={});const i=t||"accdist";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],a=e.get(e.data.close,0),s=e.get(e.data.high,0),n=e.get(e.data.low,0),o=e.get(e.data.volume,0);if(isNaN(a)||isNaN(s)||isNaN(n)||isNaN(o))return e.precision(r.cumulativeSum);const u=s-n;let c=0;return u!==0&&(c=(a-n-(s-a))/u*o),r.cumulativeSum+=c,e.precision(r.cumulativeSum)}}function Sn(e){return(t,i,r,a,s)=>{const n=f.from(i).get(0),o=f.from(r).get(0),u=f.from(a).get(0);e.taState||(e.taState={});const c=s||`alma_${n}_${o}_${u}`;if(!e.taState[c]){const h=o*(n-1),g=n/u,x=[];let b=0;for(let N=0;N<n;N++){const k=Math.exp(-Math.pow(N-h,2)/(2*g*g));x.push(k),b+=k}for(let N=0;N<x.length;N++)x[N]/=b;e.taState[c]={window:[],weights:x}}const p=e.taState[c],m=f.from(t).get(0);if(p.window.unshift(m),p.window.length<n)return NaN;p.window.length>n&&p.window.pop();let d=0;for(let h=0;h<n;h++)d+=p.weights[h]*p.window[n-1-h];return e.precision(d)}}function Cn(e){return(t,i)=>{const r=f.from(t).get(0);e.taState||(e.taState={});const a=i||`atr_${r}`;e.taState[a]||(e.taState[a]={prevAtr:null,initSum:0,initCount:0,prevClose:null});const s=e.taState[a],n=e.get(e.data.high,0),o=e.get(e.data.low,0),u=e.get(e.data.close,0);let c;if(s.prevClose!==null){const m=n-o,d=Math.abs(n-s.prevClose),h=Math.abs(o-s.prevClose);c=Math.max(m,d,h)}else c=n-o;if(s.prevClose=u,s.initCount<r)return s.initSum+=c,s.initCount++,s.initCount===r?(s.prevAtr=s.initSum/r,e.precision(s.prevAtr)):NaN;const p=(s.prevAtr*(r-1)+c)/r;return s.prevAtr=p,e.precision(p)}}function Nn(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"barssince";e.taState[r]||(e.taState[r]={lastTrueIndex:null});const a=e.taState[r];return f.from(t).get(0)?(a.lastTrueIndex=e.idx,0):a.lastTrueIndex===null?NaN:e.idx-a.lastTrueIndex}}function _n(e){return(t,i,r,a)=>{const s=f.from(i).get(0),n=f.from(r).get(0);e.taState||(e.taState={});const o=a||`bb_${s}_${n}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const u=e.taState[o],c=f.from(t).get(0);if(isNaN(c))return[[NaN,NaN,NaN]];if(u.window.unshift(c),u.sum+=c,u.window.length<s)return[[NaN,NaN,NaN]];if(u.window.length>s){const x=u.window.pop();u.sum-=x}const p=u.sum/s;let m=0;for(let x=0;x<s;x++)m+=Math.pow(u.window[x]-p,2);const d=Math.sqrt(m/s),h=p+n*d,g=p-n*d;return[[e.precision(h),e.precision(p),e.precision(g)]]}}function En(e){return(t,i,r,a)=>{const s=f.from(i).get(0),n=f.from(r).get(0);e.taState||(e.taState={});const o=a||`bbw_${s}_${n}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const u=e.taState[o],c=f.from(t).get(0);if(isNaN(c))return NaN;if(u.window.unshift(c),u.sum+=c,u.window.length<s)return NaN;if(u.window.length>s){const b=u.window.pop();u.sum-=b}const p=u.sum/s;let m=0;for(let b=0;b<s;b++){const N=u.window[b]-p;m+=N*N}const d=m/s,h=Math.sqrt(d),g=n*h;if(p===0)return e.precision(0);const x=2*g/p*100;return e.precision(x)}}function kn(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`cci_${a}`;e.taState[s]||(e.taState[s]={window:[],sum:0});const n=e.taState[s],o=f.from(t).get(0);if(isNaN(o))return NaN;if(n.window.unshift(o),n.sum+=o,n.window.length<a)return NaN;if(n.window.length>a){const d=n.window.pop();n.sum-=d}const u=n.sum/a;let c=0;for(let d=0;d<a;d++)c+=Math.abs(n.window[d]-u);const p=c/a;if(p===0)return 0;const m=(o-u)/(.015*p);return e.precision(m)}}function In(e){return(t,i=1,r)=>{typeof i=="string"&&(r=i,i=1);const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`change_${a}`;e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<=a)return NaN;n.window.length>a+1&&n.window.pop();const u=o-n.window[a];return e.precision(u)}}function An(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`cmo_${a}`;e.taState[s]||(e.taState[s]={gainsWindow:[],lossesWindow:[],gainsSum:0,lossesSum:0});const n=e.taState[s],o=f.from(t).get(0),u=f.from(t).get(1);if(isNaN(o)||isNaN(u))return NaN;const c=o-u,p=c>=0?c:0,m=c>=0?0:-c;if(n.gainsWindow.unshift(p),n.lossesWindow.unshift(m),n.gainsSum+=p,n.lossesSum+=m,n.gainsWindow.length<a)return NaN;if(n.gainsWindow.length>a){const g=n.gainsWindow.pop(),x=n.lossesWindow.pop();n.gainsSum-=g,n.lossesSum-=x}const d=n.gainsSum+n.lossesSum;if(d===0)return e.precision(0);const h=100*(n.gainsSum-n.lossesSum)/d;return e.precision(h)}}function Pn(e){return(t,i,r)=>{const a=f.from(i).get(0),s=f.from(t);let n=0,o=!1;for(let p=0;p<a;p++){const m=s.get(p);if(isNaN(m)){o=!0;break}n+=m}if(o)return NaN;let u=0;for(let p=0;p<a;p++){const m=s.get(p);u+=m*(p+1)}if(n===0)return NaN;const c=-u/n;return e.precision(c)}}function Vn(e){return(t,i,r,a)=>{const s=f.from(r).get(0),n=f.from(t),o=f.from(i);if(e.idx<s-1)return NaN;let u=0,c=0,p=0,m=0,d=0,h=0;for(let k=0;k<s;k++){const E=n.get(k),w=o.get(k);isNaN(E)||isNaN(w)||(u+=E,c+=w,p+=E*w,m+=E*E,d+=w*w,h++)}if(h<2)return NaN;const g=h*p-u*c,x=h*m-u*u,b=h*d-c*c;if(x<=0||b<=0)return e.precision(0);const N=g/Math.sqrt(x*b);return e.precision(N)}}function Tn(e){return(t,i,r)=>{const a=f.from(t),s=f.from(i),n=a.get(0),o=s.get(0),u=a.get(1),c=s.get(1);if(isNaN(n)||isNaN(o)||isNaN(u)||isNaN(c))return!1;const p=n>o&&u<=c,m=n<o&&u>=c;return p||m}}function Mn(e){return(t,i)=>{const r=f.from(t),a=f.from(i),s=r.get(0),n=a.get(0),o=r.get(1),u=a.get(1);return o<u&&s>n}}function Ln(e){return(t,i)=>{const r=f.from(t),a=f.from(i),s=r.get(0),n=a.get(0),o=r.get(1),u=a.get(1);return o>u&&s<n}}function Dn(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"cum";e.taState[r]||(e.taState[r]={cumulativeSum:0});const a=e.taState[r],s=f.from(t).get(0);return isNaN(s)||(a.cumulativeSum+=s),e.precision(a.cumulativeSum)}}function Rn(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`dev_${a}`;e.taState[s]||(e.taState[s]={window:[],sum:0});const n=e.taState[s],o=f.from(t).get(0)||0;if(n.window.unshift(o),n.sum+=o,n.window.length<a)return NaN;if(n.window.length>a){const m=n.window.pop();n.sum-=m}const u=n.sum/a;let c=0;for(let m=0;m<a;m++)c+=Math.abs(n.window[m]-u);const p=c/a;return e.precision(p)}}function Bn(e){return(t,i,r)=>{const a=f.from(t).get(0),s=f.from(i).get(0);e.taState||(e.taState={});const n=r||`dmi_${a}_${s}`;e.taState[n]||(e.taState[n]={prevHigh:NaN,prevLow:NaN,prevClose:NaN,trInitSum:0,plusInitSum:0,minusInitSum:0,initCount:0,prevSmoothedTR:NaN,prevSmoothedPlus:NaN,prevSmoothedMinus:NaN,dxInitSum:0,adxInitCount:0,prevADX:NaN});const o=e.taState[n],u=e.get(e.data.high,0),c=e.get(e.data.low,0),p=e.get(e.data.close,0);if(isNaN(u)||isNaN(c)||isNaN(p))return[[NaN,NaN,NaN]];if(isNaN(o.prevHigh))return o.prevHigh=u,o.prevLow=c,o.prevClose=p,[[NaN,NaN,NaN]];const m=Math.max(u-c,Math.abs(u-o.prevClose),Math.abs(c-o.prevClose)),d=u-o.prevHigh,h=o.prevLow-c,g=d>h&&d>0?d:0,x=h>d&&h>0?h:0;o.prevHigh=u,o.prevLow=c,o.prevClose=p;let b,N,k;if(o.initCount++,o.initCount<=a)o.trInitSum+=m,o.plusInitSum+=g,o.minusInitSum+=x,o.initCount===a&&(o.prevSmoothedTR=o.trInitSum/a,o.prevSmoothedPlus=o.plusInitSum/a,o.prevSmoothedMinus=o.minusInitSum/a);else{const K=1/a;o.prevSmoothedTR=K*m+(1-K)*o.prevSmoothedTR,o.prevSmoothedPlus=K*g+(1-K)*o.prevSmoothedPlus,o.prevSmoothedMinus=K*x+(1-K)*o.prevSmoothedMinus}if(b=o.prevSmoothedTR,N=o.prevSmoothedPlus,k=o.prevSmoothedMinus,o.initCount<a)return[[NaN,NaN,NaN]];const E=b===0?0:100*N/b,w=b===0?0:100*k/b,L=E+w,W=L===0?0:100*Math.abs(E-w)/L;let se=NaN;if(o.adxInitCount++,o.adxInitCount<=s)o.dxInitSum+=W,o.adxInitCount===s&&(o.prevADX=o.dxInitSum/s,se=o.prevADX);else{const K=1/s;o.prevADX=K*W+(1-K)*o.prevADX,se=o.prevADX}return[[e.precision(E),e.precision(w),e.precision(se)]]}}function jn(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`ema_${a}`;e.taState[s]||(e.taState[s]={prevEma:null,initSum:0,initCount:0});const n=e.taState[s],o=f.from(t).get(0);if(n.initCount<a)return n.initSum+=o,n.initCount++,n.initCount===a?(n.prevEma=n.initSum/a,e.precision(n.prevEma)):NaN;const u=2/(a+1),c=o*u+n.prevEma*(1-u);return n.prevEma=c,e.precision(c)}}function On(e){return(t,i,r)=>{const a=f.from(i).get(0),s=f.from(t);for(let n=0;n<a;n++){const o=s.get(n),u=s.get(n+1);if(isNaN(o)||isNaN(u)||o>=u)return!1}return!0}}function Fn(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`highest_${a}`;e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<a)return NaN;n.window.length>a&&n.window.pop();const u=Math.max(...n.window.filter(c=>!isNaN(c)));return e.precision(u)}}function Wn(e){return(t,i,r)=>{const a=f.from(i).get(0),s=f.from(t);if(e.idx<a-1)return NaN;let n=-1/0,o=NaN;for(let u=0;u<a;u++){const c=s.get(u);isNaN(c)||(isNaN(o)||c>n)&&(n=c,o=-u)}return o}}function $n(e){return(t,i,r)=>{const a=f.from(i).get(0),s=Math.floor(a/2),n=Math.floor(Math.sqrt(a)),o=e.ta.wma,u=o(t,s,r?`${r}_wma1`:void 0),c=o(t,a,r?`${r}_wma2`:void 0);if(isNaN(u)||isNaN(c))return NaN;e.taState||(e.taState={});const p=r||`hma_raw_${a}`;e.taState[p]||(e.taState[p]=[]);const m=2*u-c;e.taState[p].unshift(m);const d=r?`${r}_hma_final`:`hma_final_${a}`;e.taState[d]||(e.taState[d]={window:[]});const h=e.taState[d];if(h.window.unshift(m),h.window.length<n)return NaN;h.window.length>n&&h.window.pop();let g=0,x=0;for(let N=0;N<n;N++){const k=n-N;g+=h.window[N]*k,x+=k}const b=g/x;return e.precision(b)}}function qn(e){return t=>{const i=e.get(e.data.close,0),r=e.get(e.data.high,0),a=e.get(e.data.low,0),s=e.get(e.data.volume,0);if(isNaN(i)||isNaN(r)||isNaN(a)||isNaN(s))return NaN;const n=(r-a)*s;if(n===0)return e.precision(0);const o=(2*i-r-a)/n;return e.precision(o)}}function Un(e){return(t,i,r,a,s)=>{const n=f.from(i).get(0),o=f.from(r).get(0);let u=!0;typeof a=="string"?s=a:a!==void 0&&(u=f.from(a).get(0));let c;const p=e.get(e.data.high,0),m=e.get(e.data.low,0);if(u){const w=e.get(e.data.close,1);isNaN(w)?c=NaN:c=Math.max(p-m,Math.abs(p-w),Math.abs(m-w))}else c=p-m;const d=f.from(t).get(0);e.taState||(e.taState={});const h=s||`kc_${n}_${o}_${u}`;e.taState[h]||(e.taState[h]={basisState:{prevEma:null,initSum:0,initCount:0},rangeState:{prevEma:null,initSum:0,initCount:0}});const g=e.taState[h],x=(w,L,W)=>{if(isNaN(L))return NaN;if(w.initCount<W)return w.initSum+=L,w.initCount++,w.initCount===W?(w.prevEma=w.initSum/W,w.prevEma):NaN;const se=2/(W+1);return w.prevEma=L*se+w.prevEma*(1-se),w.prevEma},b=x(g.basisState,d,n),N=x(g.rangeState,c,n);if(isNaN(b)||isNaN(N))return[[NaN,NaN,NaN]];const k=b+N*o,E=b-N*o;return[[e.precision(b),e.precision(k),e.precision(E)]]}}function Gn(e){return(t,i,r,a,s)=>{const n=f.from(i).get(0),o=f.from(r).get(0);let u=!0;typeof a=="string"?s=a:a!==void 0&&(u=f.from(a).get(0)),e.taState||(e.taState={});const c=s||`kcw_${n}_${o}_${u}`;e.taState[c]||(e.taState[c]={basisState:{prevEma:null,initSum:0,initCount:0},rangeState:{prevEma:null,initSum:0,initCount:0}});const p=e.taState[c],m=(E,w,L)=>{if(isNaN(w))return NaN;if(E.initCount<L)return E.initSum+=w,E.initCount++,E.initCount===L?(E.prevEma=E.initSum/L,E.prevEma):NaN;const W=2/(L+1);return E.prevEma=w*W+E.prevEma*(1-W),E.prevEma};let d;const h=e.get(e.data.high,0),g=e.get(e.data.low,0);if(u){const E=e.get(e.data.close,1);isNaN(E)?d=NaN:d=Math.max(h-g,Math.abs(h-E),Math.abs(g-E))}else d=h-g;const x=f.from(t).get(0),b=m(p.basisState,x,n),N=m(p.rangeState,d,n);if(isNaN(b)||isNaN(N))return NaN;if(b===0)return e.precision(0);const k=2*N*o/b;return e.precision(k)}}function Hn(e){return(t,i,r,a)=>{const s=f.from(i).get(0),n=f.from(r).get(0);e.taState||(e.taState={});const o=a||`linreg_${s}_${n}`;e.taState[o]||(e.taState[o]={window:[]});const u=e.taState[o],c=f.from(t).get(0);if(u.window.unshift(c),u.window.length<s)return NaN;u.window.length>s&&u.window.pop();let p=0,m=0,d=0,h=0;const g=s;for(let k=0;k<s;k++){const E=s-1-k,w=u.window[k];p+=E,m+=w,d+=E*w,h+=E*E}const x=g*h-p*p;if(x===0)return NaN;const b=(g*d-p*m)/x,N=(m-b*p)/g+b*(s-1-n);return e.precision(N)}}function zn(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`lowest_${a}`;e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<a)return NaN;n.window.length>a&&n.window.pop();const u=n.window.filter(p=>!isNaN(p)&&p!==void 0),c=u.length>0?Math.min(...u):NaN;return e.precision(c)}}function Kn(e){return(t,i,r)=>{const a=f.from(i).get(0),s=f.from(t);if(e.idx<a-1)return NaN;let n=1/0,o=NaN;for(let u=0;u<a;u++){const c=s.get(u);isNaN(c)||(isNaN(o)||c<n)&&(n=c,o=-u)}return o}}function Qn(e){return(t,i,r,a,s)=>{const n=f.from(i).get(0),o=f.from(r).get(0),u=f.from(a).get(0),c=s||`macd_${n}_${o}_${u}`,p=`${c}_fast`,m=`${c}_slow`,d=`${c}_signal`,h=e.ta.ema(t,n,p),g=e.ta.ema(t,o,m);let x=NaN;!isNaN(h)&&!isNaN(g)&&(x=h-g);let b=NaN;isNaN(x)||(b=e.ta.ema(x,u,d));let N=NaN;return!isNaN(x)&&!isNaN(b)&&(N=x-b),[[e.precision(x),e.precision(b),e.precision(N)]]}}function Xn(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`median_${a}`;e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<a)return NaN;n.window.length>a&&n.window.pop();const u=n.window.slice().sort((m,d)=>m-d),c=Math.floor(a/2),p=a%2===0?(u[c-1]+u[c])/2:u[c];return e.precision(p)}}function Yn(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`mfi_${a}`;e.taState[s]||(e.taState[s]={upperWindow:[],lowerWindow:[],upperSum:0,lowerSum:0});const n=e.taState[s],o=f.from(t).get(0),u=f.from(t).get(1),c=e.get(e.data.volume,0);if(isNaN(o)||isNaN(c))return NaN;const p=isNaN(u)?NaN:o-u;let m=0,d=0;if(m=c*(p<=0?0:o),d=c*(p>=0?0:o),n.upperWindow.unshift(m),n.lowerWindow.unshift(d),n.upperSum+=m,n.lowerSum+=d,n.upperWindow.length<a)return NaN;if(n.upperWindow.length>a){const g=n.upperWindow.pop(),x=n.lowerWindow.pop();n.upperSum-=g,n.lowerSum-=x}if(n.lowerSum===0)return n.upperSum,e.precision(100);if(n.upperSum===0)return e.precision(0);const h=100-100/(1+n.upperSum/n.lowerSum);return e.precision(h)}}function Zn(e){return(t,i,r)=>{const a=f.from(i).get(0),s=f.from(t);if(e.idx<a-1)return NaN;const n=new Map;for(let c=0;c<a;c++){const p=s.get(c);isNaN(p)||n.set(p,(n.get(p)||0)+1)}if(n.size===0)return NaN;let o=NaN,u=-1;for(const[c,p]of n.entries())p>u?(u=p,o=c):p===u&&c<o&&(o=c);return o}}function Jn(e){return(t,i,r)=>{const a=f.from(i).get(0);return e.ta.change(t,a)}}function es(e){return t=>{e.taState||(e.taState={});const i=t||"nvi";e.taState[i]||(e.taState[i]={nvi:1});const r=e.taState[i],a=e.get(e.data.close,0),s=e.get(e.data.close,1),n=e.get(e.data.volume,0),o=e.get(e.data.volume,1),u=isNaN(a)?0:a,c=isNaN(s)?0:s,p=isNaN(n)?0:n,m=isNaN(o)?0:o;if(!(u===0||c===0)&&p<m){const d=(u-c)/c;r.nvi=r.nvi+d*r.nvi}return e.precision(r.nvi)}}function ts(e){return()=>{e.taState||(e.taState={});const t="obv";e.taState[t]||(e.taState[t]={prevOBV:0});const i=e.taState[t],r=e.get(e.data.close,0),a=e.get(e.data.volume,0),s=e.get(e.data.close,1);if(isNaN(s))return i.prevOBV=0,e.precision(0);let n;return r>s?n=i.prevOBV+a:r<s?n=i.prevOBV-a:n=i.prevOBV,i.prevOBV=n,e.precision(n)}}function is(e){return(t,i,r)=>t instanceof f?i?new f(t.data,t.offset+i):t:(e.params[r]||(e.params[r]=[]),Array.isArray(t)?new f(t,i||0):(e.params[r].length===0?e.params[r].push(t):e.params[r][e.params[r].length-1]=t,new f(e.params[r],0)))}function rs(e){return(t,i,r,a)=>{const s=f.from(i).get(0),n=f.from(r).get(0),o=f.from(t);if(e.idx<s-1)return NaN;const u=[];for(let g=0;g<s;g++){const x=o.get(g);if(isNaN(x))return NaN;u.push(x)}u.sort((g,x)=>g-x);let c=n/100*s-.5;c<0&&(c=0),c>s-1&&(c=s-1);const p=Math.floor(c),m=Math.ceil(c);if(p===m)return e.precision(u[p]);const d=c-p,h=u[p]+d*(u[m]-u[p]);return e.precision(h)}}function as(e){return(t,i,r,a)=>{const s=f.from(i).get(0),n=f.from(r).get(0),o=f.from(t);if(e.idx<s-1)return NaN;const u=[];for(let p=0;p<s;p++){const m=o.get(p);isNaN(m)||u.push(m)}if(u.length===0)return NaN;u.sort((p,m)=>p-m);let c=Math.ceil(n/100*u.length)-1;return c<0&&(c=0),c>=u.length&&(c=u.length-1),e.precision(u[c])}}function ns(e){return(t,i,r)=>{const a=f.from(i).get(0),s=f.from(t);if(e.idx<a)return NaN;const n=s.get(0);if(isNaN(n))return NaN;let o=0,u=0;for(let c=1;c<=a;c++){const p=s.get(c);isNaN(p)||(u++,p<=n&&o++)}return u===0?NaN:e.precision(o/u*100)}}function ss(e,t,i){const r=new Array(e.length).fill(NaN);for(let a=t+i;a<e.length;a++){const s=e[a-i];let n=!0;for(let o=1;o<=t;o++)if(e[a-i-o]>=s){n=!1;break}if(n){for(let o=1;o<=i;o++)if(e[a-i+o]>=s){n=!1;break}}n&&(r[a]=s)}return r}function os(e){return(t,i,r)=>{r==null&&(r=i,i=t,t=e.data.high);const a=f.from(i).get(0),s=f.from(r).get(0),n=f.from(t).toArray(),o=ss(n,a,s),u=e.idx;return e.precision(o[u])}}function us(e,t,i){const r=new Array(e.length).fill(NaN);for(let a=t+i;a<e.length;a++){const s=e[a-i];let n=!0;for(let o=1;o<=t;o++)if(e[a-i-o]<=s){n=!1;break}if(n){for(let o=1;o<=i;o++)if(e[a-i+o]<=s){n=!1;break}}n&&(r[a]=s)}return r}function cs(e){return(t,i,r)=>{r==null&&(r=i,i=t,t=e.data.low);const a=f.from(i).get(0),s=f.from(r).get(0),n=f.from(t).toArray(),o=us(n,a,s),u=e.idx;return e.precision(o[u])}}function ls(e){return t=>{e.taState||(e.taState={});const i=t||"pvi";e.taState[i]||(e.taState[i]={pvi:1});const r=e.taState[i],a=e.get(e.data.close,0),s=e.get(e.data.close,1),n=e.get(e.data.volume,0),o=e.get(e.data.volume,1),u=isNaN(a)?0:a,c=isNaN(s)?0:s,p=isNaN(n)?0:n,m=isNaN(o)?0:o;if(!(u===0||c===0)&&p>m){const d=(u-c)/c;r.pvi=r.pvi+d*r.pvi}return e.precision(r.pvi)}}function ps(e){return t=>{e.taState||(e.taState={});const i=t||"pvt";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],a=e.get(e.data.close,0),s=e.get(e.data.close,1),n=e.get(e.data.volume,0);if(!isNaN(a)&&!isNaN(s)&&!isNaN(n)&&s!==0){const o=(a-s)/s*n;r.cumulativeSum+=o}return e.precision(r.cumulativeSum)}}function hs(e){return(t,i,r)=>{const a=e.pine.ta.highest(t,i,(r||"range")+"_h"),s=e.pine.ta.lowest(t,i,(r||"range")+"_l");return isNaN(a)||isNaN(s)?NaN:e.precision(a-s)}}function fs(e){return(t,i,r)=>{const a=f.from(i).get(0),s=f.from(t);for(let n=0;n<a;n++){const o=s.get(n),u=s.get(n+1);if(isNaN(o)||isNaN(u)||o<=u)return!1}return!0}}function ms(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`rma_${a}`;e.taState[s]||(e.taState[s]={prevRma:null,initSum:0,initCount:0});const n=e.taState[s],o=f.from(t).get(0)||0;if(n.initCount<a)return n.initSum+=o,n.initCount++,n.initCount===a?(n.prevRma=n.initSum/a,e.precision(n.prevRma)):NaN;const u=1/a,c=o*u+n.prevRma*(1-u);return n.prevRma=c,e.precision(c)}}function ds(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`roc_${a}`;e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<=a)return NaN;n.window.length>a+1&&n.window.pop();const u=n.window[a],c=(o-u)/u*100;return e.precision(c)}}function gs(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`rsi_${a}`;e.taState[s]||(e.taState[s]={prevValue:null,avgGain:0,avgLoss:0,initGains:[],initLosses:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.prevValue!==null){const u=o-n.prevValue,c=u>0?u:0,p=u<0?-u:0;if(n.initGains.length<a){if(n.initGains.push(c),n.initLosses.push(p),n.initGains.length===a){n.avgGain=n.initGains.reduce((h,g)=>h+g,0)/a,n.avgLoss=n.initLosses.reduce((h,g)=>h+g,0)/a,n.prevValue=o;const d=n.avgLoss===0?100:100-100/(1+n.avgGain/n.avgLoss);return e.precision(d)}return n.prevValue=o,NaN}n.avgGain=(n.avgGain*(a-1)+c)/a,n.avgLoss=(n.avgLoss*(a-1)+p)/a;const m=n.avgLoss===0?100:100-100/(1+n.avgGain/n.avgLoss);return n.prevValue=o,e.precision(m)}return n.prevValue=o,NaN}}function xs(e){return(t,i,r,a)=>{const s=f.from(t).get(0),n=f.from(i).get(0),o=f.from(r).get(0);e.taState||(e.taState={});const u=a||`sar_${s}_${n}_${o}`;e.taState[u]||(e.taState[u]={result:NaN,maxMin:NaN,acceleration:NaN,isBelow:!1,barIndex:0});const c=e.taState[u],p=e.get(e.data.high,0),m=e.get(e.data.low,0),d=e.get(e.data.close,0),h=e.get(e.data.close,1),g=e.get(e.data.high,1),x=e.get(e.data.low,1),b=e.get(e.data.high,2),N=e.get(e.data.low,2);if(isNaN(p)||isNaN(m)||isNaN(d))return NaN;let k=!1;return c.barIndex===1&&(d>h?(c.isBelow=!0,c.maxMin=p,c.result=x):(c.isBelow=!1,c.maxMin=m,c.result=g),k=!0,c.acceleration=s),c.barIndex>=1&&(c.result=c.result+c.acceleration*(c.maxMin-c.result),c.isBelow?c.result>m&&(k=!0,c.isBelow=!1,c.result=Math.max(p,c.maxMin),c.maxMin=m,c.acceleration=s):c.result<p&&(k=!0,c.isBelow=!0,c.result=Math.min(m,c.maxMin),c.maxMin=p,c.acceleration=s),k||(c.isBelow?p>c.maxMin&&(c.maxMin=p,c.acceleration=Math.min(c.acceleration+n,o)):m<c.maxMin&&(c.maxMin=m,c.acceleration=Math.min(c.acceleration+n,o))),c.isBelow?(c.result=Math.min(c.result,x),c.barIndex>1&&(c.result=Math.min(c.result,N))):(c.result=Math.max(c.result,g),c.barIndex>1&&(c.result=Math.max(c.result,b)))),c.barIndex++,c.barIndex<=1?NaN:e.precision(c.result)}}function ys(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`sma_${a}`;e.taState[s]||(e.taState[s]={window:[],sum:0});const n=e.taState[s],o=f.from(t).get(0)||0;if(n.window.unshift(o),n.sum+=o,n.window.length<a)return NaN;if(n.window.length>a){const c=n.window.pop();n.sum-=c}const u=n.sum/a;return e.precision(u)}}function bs(e){return(t,i,r=!0,a)=>{const s=f.from(i).get(0),n=f.from(r).get(0);e.taState||(e.taState={});const o=a||`stdev_${s}_${n}`;e.taState[o]||(e.taState[o]={window:[],sum:0});const u=e.taState[o],c=f.from(t).get(0);if(u.window.unshift(c),u.sum+=c,u.window.length<s)return NaN;if(u.window.length>s){const g=u.window.pop();u.sum-=g}const p=u.sum/s;let m=0;for(let g=0;g<s;g++)m+=Math.pow(u.window[g]-p,2);const d=n?s:s-1,h=Math.sqrt(m/d);return e.precision(h)}}function vs(e){return(t,i,r,a,s)=>{const n=f.from(a).get(0);e.taState||(e.taState={});const o=s||`stoch_${n}`;e.taState[o]||(e.taState[o]={highWindow:[],lowWindow:[]});const u=e.taState[o],c=f.from(t).get(0),p=f.from(i).get(0),m=f.from(r).get(0);if(isNaN(c)||isNaN(p)||isNaN(m))return NaN;if(u.highWindow.unshift(p),u.lowWindow.unshift(m),u.highWindow.length<n)return NaN;u.highWindow.length>n&&(u.highWindow.pop(),u.lowWindow.pop());let d=u.highWindow[0],h=u.lowWindow[0];for(let b=1;b<n;b++)u.highWindow[b]>d&&(d=u.highWindow[b]),u.lowWindow[b]<h&&(h=u.lowWindow[b]);const g=d-h;if(g===0)return NaN;const x=100*(c-h)/g;return e.precision(x)}}function ws(e){return(t,i,r)=>{const a=f.from(t).get(0),s=f.from(i).get(0);e.taState||(e.taState={});const n=r||`supertrend_${a}_${s}`;e.taState[n]||(e.taState[n]={trWindow:[],trSum:0,atrValue:NaN,atrCount:0,prevLowerBand:NaN,prevUpperBand:NaN,prevSuperTrend:NaN,prevDirection:NaN,prevClose:NaN});const o=e.taState[n],u=e.get(e.data.high,0),c=e.get(e.data.low,0),p=e.get(e.data.close,0);if(isNaN(u)||isNaN(c)||isNaN(p))return[[NaN,NaN]];const m=(u+c)/2;let d;isNaN(o.prevClose)?d=u-c:d=Math.max(u-c,Math.abs(u-o.prevClose),Math.abs(c-o.prevClose)),o.atrCount++,o.atrCount<=s?(o.trWindow.push(d),o.trSum+=d,o.atrCount===s&&(o.atrValue=o.trSum/s)):o.atrValue=(o.atrValue*(s-1)+d)/s;const h=o.atrValue,g=o.prevClose;if(o.prevClose=p,isNaN(h))return[[NaN,NaN]];let x=m+a*h,b=m-a*h;const N=isNaN(o.prevLowerBand)?0:o.prevLowerBand,k=isNaN(o.prevUpperBand)?0:o.prevUpperBand;isNaN(o.prevLowerBand)||b>N||g<N||(b=N),isNaN(o.prevUpperBand)||x<k||g>k||(x=k);let E,w;const L=o.prevSuperTrend;return o.atrCount===s?E=1:L===o.prevUpperBand?E=p>x?-1:1:E=p<b?1:-1,w=E===-1?b:x,o.prevLowerBand=b,o.prevUpperBand=x,o.prevSuperTrend=w,o.prevDirection=E,[[e.precision(w),E]]}}function Ss(e){return(t,i)=>{const r=[1,2,2,1],a=6;e.taState||(e.taState={});const s=i||"swma";e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<4)return NaN;n.window.length>4&&n.window.pop();let u=0;for(let c=0;c<4;c++)u+=r[c]*n.window[3-c];return u/=a,e.precision(u)}}function Cs(e){return(t,i)=>{let r=!0;typeof t=="string"||t!==void 0&&(r=f.from(t).get(0));const a=e.get(e.data.high,0),s=e.get(e.data.low,0),n=e.get(e.data.close,1);return isNaN(n)?r?a-s:NaN:Math.max(a-s,Math.abs(a-n),Math.abs(s-n))}}function Ns(e){return(t,i,r,a)=>{const s=f.from(i).get(0),n=f.from(r).get(0);e.taState||(e.taState={});const o=a||`tsi_${s}_${n}`;e.taState[o]||(e.taState[o]={prevSource:NaN,ema1_pc_multiplier:2/(n+1),ema1_pc_value:NaN,ema1_pc_count:0,ema1_pc_sum:0,ema2_pc_multiplier:2/(s+1),ema2_pc_value:NaN,ema2_pc_count:0,ema2_pc_sum:0,ema1_abs_multiplier:2/(n+1),ema1_abs_value:NaN,ema1_abs_count:0,ema1_abs_sum:0,ema2_abs_multiplier:2/(s+1),ema2_abs_value:NaN,ema2_abs_count:0,ema2_abs_sum:0});const u=e.taState[o],c=f.from(t).get(0);if(isNaN(c))return NaN;const p=isNaN(u.prevSource)?NaN:c-u.prevSource;if(u.prevSource=c,isNaN(p))return NaN;const m=Math.abs(p);if(u.ema1_pc_count++,u.ema1_pc_count<=n?(u.ema1_pc_sum+=p,u.ema1_pc_count===n&&(u.ema1_pc_value=u.ema1_pc_sum/n)):u.ema1_pc_value=p*u.ema1_pc_multiplier+u.ema1_pc_value*(1-u.ema1_pc_multiplier),u.ema1_abs_count++,u.ema1_abs_count<=n?(u.ema1_abs_sum+=m,u.ema1_abs_count===n&&(u.ema1_abs_value=u.ema1_abs_sum/n)):u.ema1_abs_value=m*u.ema1_abs_multiplier+u.ema1_abs_value*(1-u.ema1_abs_multiplier),isNaN(u.ema1_pc_value)||isNaN(u.ema1_abs_value))return NaN;if(u.ema2_pc_count++,u.ema2_pc_count<=s?(u.ema2_pc_sum+=u.ema1_pc_value,u.ema2_pc_count===s&&(u.ema2_pc_value=u.ema2_pc_sum/s)):u.ema2_pc_value=u.ema1_pc_value*u.ema2_pc_multiplier+u.ema2_pc_value*(1-u.ema2_pc_multiplier),u.ema2_abs_count++,u.ema2_abs_count<=s?(u.ema2_abs_sum+=u.ema1_abs_value,u.ema2_abs_count===s&&(u.ema2_abs_value=u.ema2_abs_sum/s)):u.ema2_abs_value=u.ema1_abs_value*u.ema2_abs_multiplier+u.ema2_abs_value*(1-u.ema2_abs_multiplier),isNaN(u.ema2_pc_value)||isNaN(u.ema2_abs_value))return NaN;if(u.ema2_abs_value===0)return e.precision(0);const d=u.ema2_pc_value/u.ema2_abs_value;return e.precision(d)}}function _s(e){return(t,i,r,a)=>{e.taState||(e.taState={});const s=a||"valuewhen";e.taState[s]||(e.taState[s]={values:[]});const n=e.taState[s],o=f.from(t).get(0),u=f.from(i).get(0),c=f.from(r).get(0);if(o&&n.values.push(u),isNaN(c)||c<0)return NaN;const p=n.values.length-1-c;if(p<0)return NaN;const m=n.values[p];return typeof m=="number"?e.precision(m):m}}function Es(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`variance_${a}`;e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<a)return NaN;n.window.length>a&&n.window.pop();let u=0,c=0;for(let d=0;d<a;d++)u+=n.window[d],c+=n.window[d]*n.window[d];const p=u/a,m=c/a-p*p;return e.precision(m)}}function ks(e){return(t,i)=>{e.taState||(e.taState={});const r=i||"vwap";e.taState[r]||(e.taState[r]={cumulativePV:0,cumulativeVolume:0,lastSessionDate:null});const a=e.taState[r],s=f.from(t).get(0),n=f.from(e.data.volume).get(0),o=f.from(e.data.openTime).get(0),u=new Date(o).toISOString().slice(0,10);if(a.lastSessionDate!==u&&(a.cumulativePV=0,a.cumulativeVolume=0,a.lastSessionDate=u),a.cumulativePV+=s*n,a.cumulativeVolume+=n,a.cumulativeVolume===0)return NaN;const c=a.cumulativePV/a.cumulativeVolume;return e.precision(c)}}function Is(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`vwma_${a}`;e.taState[s]||(e.taState[s]={window:[],volumeWindow:[]});const n=e.taState[s],o=f.from(t).get(0),u=e.get(e.data.volume,0);if(n.window.unshift(o),n.volumeWindow.unshift(u),n.window.length<a)return NaN;n.window.length>a&&(n.window.pop(),n.volumeWindow.pop());let c=0,p=0;for(let d=0;d<a;d++)c+=n.window[d]*n.volumeWindow[d],p+=n.volumeWindow[d];const m=c/p;return e.precision(m)}}function As(e){return t=>{e.taState||(e.taState={});const i=t||"wad";e.taState[i]||(e.taState[i]={cumulativeSum:0});const r=e.taState[i],a=e.get(e.data.close,0),s=e.get(e.data.high,0),n=e.get(e.data.low,0),o=e.get(e.data.close,1);if(isNaN(a)||isNaN(s)||isNaN(n))return e.precision(r.cumulativeSum);let u=0;if(!isNaN(o)){const c=Math.max(s,o),p=Math.min(n,o),m=a-o;m>0?u=a-p:m<0&&(u=a-c)}return r.cumulativeSum+=u,e.precision(r.cumulativeSum)}}function Ps(e){return(t,i,r)=>{const a=f.from(i).get(0);e.taState||(e.taState={});const s=r||`wma_${a}`;e.taState[s]||(e.taState[s]={window:[]});const n=e.taState[s],o=f.from(t).get(0);if(n.window.unshift(o),n.window.length<a)return NaN;n.window.length>a&&n.window.pop();let u=0,c=0;for(let m=0;m<a;m++){const d=a-m;u+=n.window[m]*d,c+=d}const p=u/c;return e.precision(p)}}function Vs(e){return(t,i)=>{const r=f.from(t).get(0);e.taState||(e.taState={});const a=i||`wpr_${r}`;e.taState[a]||(e.taState[a]={highWindow:[],lowWindow:[]});const s=e.taState[a],n=e.get(e.data.high,0),o=e.get(e.data.low,0),u=e.get(e.data.close,0);if(isNaN(n)||isNaN(o)||isNaN(u))return NaN;if(s.highWindow.unshift(n),s.lowWindow.unshift(o),s.highWindow.length<r)return NaN;s.highWindow.length>r&&(s.highWindow.pop(),s.lowWindow.pop());let c=s.highWindow[0],p=s.lowWindow[0];for(let h=1;h<r;h++)s.highWindow[h]>c&&(c=s.highWindow[h]),s.lowWindow[h]<p&&(p=s.lowWindow[h]);const m=c-p;if(m===0)return e.precision(0);const d=(c-u)/m*-100;return e.precision(d)}}function Ts(e){return t=>{const i=e.get(e.data.close,0),r=e.get(e.data.open,0),a=e.get(e.data.high,0),s=e.get(e.data.low,0),n=e.get(e.data.volume,0);if(isNaN(i)||isNaN(r)||isNaN(a)||isNaN(s)||isNaN(n))return NaN;const o=a-s;if(o===0)return e.precision(0);const u=(i-r)/o*n;return e.precision(u)}}const Ms={accdist:wn,alma:Sn,atr:Cn,barssince:Nn,bb:_n,bbw:En,cci:kn,change:In,cmo:An,cog:Pn,correlation:Vn,cross:Tn,crossover:Mn,crossunder:Ln,cum:Dn,dev:Rn,dmi:Bn,ema:jn,falling:On,highest:Fn,highestbars:Wn,hma:$n,iii:qn,kc:Un,kcw:Gn,linreg:Hn,lowest:zn,lowestbars:Kn,macd:Qn,median:Xn,mfi:Yn,mode:Zn,mom:Jn,nvi:es,obv:ts,param:is,percentile_linear_interpolation:rs,percentile_nearest_rank:as,percentrank:ns,pivothigh:os,pivotlow:cs,pvi:ls,pvt:ps,range:hs,rising:fs,rma:ms,roc:ds,rsi:gs,sar:xs,sma:ys,stdev:bs,stoch:vs,supertrend:ws,swma:Ss,tr:Cs,tsi:Ns,valuewhen:_s,variance:Es,vwap:ks,vwma:Is,wad:As,wma:Ps,wpr:Vs,wvad:Ts};class Ls{constructor(t){this.context=t,Object.entries(Ms).forEach(([i,r])=>{this[i]=r(t)})}accdist;alma;atr;barssince;bb;bbw;cci;change;cmo;cog;correlation;cross;crossover;crossunder;cum;dev;dmi;ema;falling;highest;highestbars;hma;iii;kc;kcw;linreg;lowest;lowestbars;macd;median;mfi;mode;mom;nvi;obv;param;percentile_linear_interpolation;percentile_nearest_rank;percentrank;pivothigh;pivotlow;pvi;pvt;range;rising;rma;roc;rsi;sar;sma;stdev;stoch;supertrend;swma;tr;tsi;valuewhen;variance;vwap;vwma;wad;wma;wpr;wvad}class ge{data={open:new f([]),high:new f([]),low:new f([]),close:new f([]),volume:new f([]),hl2:new f([]),hlc3:new f([]),ohlc4:new f([])};cache={};taState={};isSecondaryContext=!1;NA=NaN;lang;pine;static _deprecationWarningsShown=new Set;idx=0;params={};const={};var={};let={};result=void 0;plots={};marketData;source;tickerId;timeframe="";limit;sDate;eDate;pineTSCode;constructor({marketData:t,source:i,tickerId:r,timeframe:a,limit:s,sDate:n,eDate:o}){this.marketData=t,this.source=i,this.tickerId=r,this.timeframe=a,this.limit=s,this.sDate=n,this.eDate=o;const u=new ka(this),c={plotchar:u.plotchar.bind(u),na:u.na.bind(u),color:u.color,plot:u.plot.bind(u),nz:u.nz.bind(u)},p=this;this.pine={input:new Ua(this),ta:new Ls(this),math:new gn(this),request:new vn(this),array:new Ea(this),na:c.na,plotchar:c.plotchar,color:c.color,plot:c.plot,nz:c.nz,get bar_index(){return p.idx}}}init(t,i,r=0){let a;return i instanceof f?a=i.get(0):Array.isArray(i)?Array.isArray(i[0])?a=i[0]:a=this.precision(i[i.length-1+r]):a=this.precision(i),t?t instanceof f?(t.data[t.data.length-1]=a,t):Array.isArray(t)?(t[t.length-1]=a,new f(t)):new f([a]):new f([a])}initVar(t,i){if(t)return t;let r;return i instanceof f?r=i.get(0):Array.isArray(i)?Array.isArray(i[0])?r=i[0]:r=this.precision(i[i.length-1]):r=this.precision(i),new f([r])}precision(t,i=10){return typeof t!="number"||isNaN(t)?t:Number(t.toFixed(i))}param(t,i,r){return typeof t=="string"?t:t instanceof f?i?new f(t.data,t.offset+i):t:!Array.isArray(t)&&typeof t=="object"?t:(this.params[r]||(this.params[r]=[]),Array.isArray(t)?new f(t,i||0):(this.params[r].length===0?this.params[r].push(t):this.params[r][this.params[r].length-1]=t,new f(this.params[r],0)))}get(t,i){if(t instanceof f)return t.get(i);if(Array.isArray(t)){const r=t.length-1-i;return r<0||r>=t.length?NaN:t[r]}return t}set(t,i){if(t instanceof f){t.set(0,i);return}if(Array.isArray(t)){t.length>0?t[t.length-1]=i:t.push(i);return}}get math(){return this._showDeprecationWarning("const math = context.math","const { math, ta, input } = context.pine"),this.pine.math}get ta(){return this._showDeprecationWarning("const ta = context.ta","const { ta, math, input } = context.pine"),this.pine.ta}get input(){return this._showDeprecationWarning("const input = context.input","const { input, math, ta } = context.pine"),this.pine.input}get request(){return this._showDeprecationWarning("const request = context.request","const { request, math, ta } = context.pine"),this.pine.request}get array(){return this._showDeprecationWarning("const array = context.array","const { array, math, ta } = context.pine"),this.pine.array}get core(){return this._showDeprecationWarning("context.core.*","context.pine (e.g., const { na, plotchar, color, plot, nz } = context.pine)"),{na:this.pine.na,plotchar:this.pine.plotchar,color:this.pine.color,plot:this.pine.plot,nz:this.pine.nz}}_showDeprecationWarning(t,i){const r=`${t}->${i}`;ge._deprecationWarningsShown.has(r)||(ge._deprecationWarningsShown.add(r),typeof window<"u"?console.warn("%c[WARNING]%c %s syntax is deprecated. Use %s instead. This will be removed in a future version.","color: #FFA500; font-weight: bold;","color: #FFA500;",t,i):console.warn(`\x1B[33m[WARNING] ${t} syntax is deprecated. Use ${i} instead. This will be removed in a future version.\x1B[0m`))}}class xi{constructor(t,i,r,a,s,n){this.source=t,this.tickerId=i,this.timeframe=r,this.limit=a,this.sDate=s,this.eDate=n,this._readyPromise=new Promise(o=>{this.loadMarketData(t,i,r,a,s,n).then(u=>{const c=u;this.data=c;const p=c.map(w=>w.open),m=c.map(w=>w.close),d=c.map(w=>w.high),h=c.map(w=>w.low),g=c.map(w=>w.volume),x=c.map(w=>(w.high+w.low+w.close)/3),b=c.map(w=>(w.high+w.low)/2),N=c.map(w=>(w.high+w.low+w.open+w.close)/4),k=c.map(w=>w.openTime),E=c.map(w=>w.closeTime);this.open=p,this.close=m,this.high=d,this.low=h,this.volume=g,this.hl2=b,this.hlc3=x,this.ohlc4=N,this.openTime=k,this.closeTime=E,this._ready=!0,o(!0)})})}data=[];open=[];high=[];low=[];close=[];volume=[];hl2=[];hlc3=[];ohlc4=[];openTime=[];closeTime=[];_readyPromise=null;_ready=!1;_debugSettings={ln:!1,debug:!1};_transpiledCode=null;get transpiledCode(){return this._transpiledCode}_isSecondaryContext=!1;markAsSecondary(){this._isSecondaryContext=!0}setDebugSettings({ln:t,debug:i}){this._debugSettings.ln=t,this._debugSettings.debug=i}async loadMarketData(t,i,r,a,s,n){return Array.isArray(t)?t:t.getMarketData(i,r,a,s,n)}async ready(){if(this._ready)return!0;if(!this._readyPromise)throw new Error("PineTS is not ready");return this._readyPromise}run(t,i,r){if(r&&r>0){const a=typeof this.eDate>"u"&&!Array.isArray(this.source);return this._runPaginated(t,i,r,a)}else return this._runComplete(t,i)}async _runComplete(t,i){await this.ready(),i||(i=this.data.length);const r=this._initializeContext(t,this._isSecondaryContext);return this._transpiledCode=this._transpileCode(t),await this._executeIterations(r,this._transpiledCode,this.data.length-i,this.data.length),r}async*_runPaginated(t,i,r,a=!1){await this.ready(),i||(i=this.data.length);const s=this._initializeContext(t,this._isSecondaryContext);this._transpiledCode=this._transpileCode(t);let n=this.data.length-i;for(;;){const o=this.data.length-n;if(o>0){const p=Math.min(o,r),m=this._getResultLength(s.result);await this._executeIterations(s,this._transpiledCode,n,n+p),n+=p,yield this._createPageContext(s,m);continue}if(!a||Array.isArray(this.source))break;const{newCandles:u,updatedLastCandle:c}=await this._updateMarketData();if(u===0&&!c){yield null;continue}this._removeLastResult(s),n=this.data.length-(u+1)}}_getResultLength(t){if(Array.isArray(t))return t.length;if(typeof t=="object"&&t!==null){const i=Object.keys(t);if(i.length>0&&Array.isArray(t[i[0]]))return t[i[0]].length}return 0}_createPageContext(t,i){const r=new ge({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate});if(r.pineTSCode=t.pineTSCode,r.idx=t.idx,Array.isArray(t.result))r.result=t.result.slice(i);else if(typeof t.result=="object"&&t.result!==null){r.result={};for(let a in t.result)Array.isArray(t.result[a])?r.result[a]=t.result[a].slice(i):r.result[a]=t.result[a]}else r.result=t.result;return r.plots={...t.plots},r}async _updateMarketData(t){if(Array.isArray(this.source))return{newCandles:0,updatedLastCandle:!1};const i=this.source,r=this.data.length-1,a=this.data[r].openTime;try{const s=await i.getMarketData(this.tickerId,this.timeframe,void 0,a,t);if(!s||s.length===0)return{newCandles:0,updatedLastCandle:!1};let n=!1,o=0;for(let u=0;u<s.length;u++){const c=s[u];c.openTime===a?(this._replaceCandle(r,c),n=!0):c.openTime>a&&(this._appendCandle(c),o++)}return{newCandles:o,updatedLastCandle:n}}catch(s){return console.error("Error updating market data:",s),{newCandles:0,updatedLastCandle:!1}}}_replaceCandle(t,i){this.data[t]=i,this.open[t]=i.open,this.close[t]=i.close,this.high[t]=i.high,this.low[t]=i.low,this.volume[t]=i.volume,this.hl2[t]=(i.high+i.low)/2,this.hlc3[t]=(i.high+i.low+i.close)/3,this.ohlc4[t]=(i.high+i.low+i.open+i.close)/4,this.openTime[t]=i.openTime,this.closeTime[t]=i.closeTime}_appendCandle(t){this.data.push(t),this.open.push(t.open),this.close.push(t.close),this.high.push(t.high),this.low.push(t.low),this.volume.push(t.volume),this.hl2.push((t.high+t.low)/2),this.hlc3.push((t.high+t.low+t.close)/3),this.ohlc4.push((t.high+t.low+t.open+t.close)/4),this.openTime.push(t.openTime),this.closeTime.push(t.closeTime)}_removeLastResult(t){if(Array.isArray(t.result))t.result.pop();else if(typeof t.result=="object"&&t.result!==null)for(let i in t.result)Array.isArray(t.result[i])&&t.result[i].pop();t.data.close.data.pop(),t.data.open.data.pop(),t.data.high.data.pop(),t.data.low.data.pop(),t.data.volume.data.pop(),t.data.hl2.data.pop(),t.data.hlc3.data.pop(),t.data.ohlc4.data.pop(),t.data.openTime.data.pop(),t.data.closeTime&&t.data.closeTime.data.pop()}_initializeContext(t,i=!1){const r=new ge({marketData:this.data,source:this.source,tickerId:this.tickerId,timeframe:this.timeframe,limit:this.limit,sDate:this.sDate,eDate:this.eDate});return r.pineTSCode=t,r.isSecondaryContext=i,r.data.close=new f([]),r.data.open=new f([]),r.data.high=new f([]),r.data.low=new f([]),r.data.volume=new f([]),r.data.hl2=new f([]),r.data.hlc3=new f([]),r.data.ohlc4=new f([]),r.data.openTime=new f([]),r.data.closeTime=new f([]),r}_transpileCode(t){return Rr.bind(this)(t,this._debugSettings)}async _executeIterations(t,i,r,a){const s=["const","var","let","params"];for(let n=r;n<a;n++){t.idx=n,t.data.close.data.push(this.close[n]),t.data.open.data.push(this.open[n]),t.data.high.data.push(this.high[n]),t.data.low.data.push(this.low[n]),t.data.volume.data.push(this.volume[n]),t.data.hl2.data.push(this.hl2[n]),t.data.hlc3.data.push(this.hlc3[n]),t.data.ohlc4.data.push(this.ohlc4[n]),t.data.openTime.data.push(this.openTime[n]),t.data.closeTime.data.push(this.closeTime[n]);const o=await i(t);if(typeof o=="object"){typeof t.result!="object"&&(t.result={});for(let u in o){t.result[u]===void 0&&(t.result[u]=[]);let c;o[u]instanceof f?c=o[u].get(0):Array.isArray(o[u])?c=o[u][o[u].length-1]:c=o[u],t.result[u].push(c)}}else Array.isArray(t.result)||(t.result=[]),t.result.push(o);for(let u of s)for(let c in t[u]){const p=t[u][c];if(p instanceof f){const m=p.get(0);p.data.push(m)}else if(Array.isArray(p)){const m=p[p.length-1];p.push(m)}}}}}const Ds="https://api.binance.com/api/v3",Ke={1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",45:null,60:"1h",120:"2h",180:null,240:"4h","4H":"4h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"};class Rs{cache;cacheDuration;constructor(t=5*60*1e3){this.cache=new Map,this.cacheDuration=t}generateKey(t){return Object.entries(t).filter(([i,r])=>r!==void 0).map(([i,r])=>`${i}:${r}`).join("|")}get(t){const i=this.generateKey(t),r=this.cache.get(i);return r?Date.now()-r.timestamp>this.cacheDuration?(this.cache.delete(i),null):r.data:null}set(t,i){const r=this.generateKey(t);this.cache.set(r,{data:i,timestamp:Date.now()})}clear(){this.cache.clear()}cleanup(){const t=Date.now();for(const[i,r]of this.cache.entries())t-r.timestamp>this.cacheDuration&&this.cache.delete(i)}}class Bs{cacheManager;constructor(){this.cacheManager=new Rs(5*60*1e3)}async getMarketDataInterval(t,i,r,a){try{const s=Ke[i.toUpperCase()];if(!s)return console.error(`Unsupported timeframe: ${i}`),[];const n={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3};let o=[],u=r;const c=a,p=n[s];if(!p)return console.error(`Duration not defined for interval: ${s}`),[];for(;u<c;){const m=Math.min(u+1e3*p,c),d=await this.getMarketData(t,i,1e3,u,m);if(d.length===0)break;o=o.concat(d),u=d[d.length-1].closeTime+1}return o}catch(s){return console.error("Error in getMarketDataInterval:",s),[]}}async getMarketData(t,i,r,a,s){try{const n={tickerId:t,timeframe:i,limit:r,sDate:a,eDate:s},o=this.cacheManager.get(n);if(o)return o;const u=Ke[i.toUpperCase()];if(!u)return console.error(`Unsupported timeframe: ${i}`),[];if(this.shouldPaginate(i,r,a,s)&&a&&s){const d=await this.getMarketDataInterval(t,i,a,s),h=r?d.slice(0,r):d;return this.cacheManager.set(n,h),h}let c=`${Ds}/klines?symbol=${t}&interval=${u}`;r&&(c+=`&limit=${Math.min(r,1e3)}`),a&&(c+=`&startTime=${a}`),s&&(c+=`&endTime=${s}`);const p=await fetch(c);if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);const m=(await p.json()).map(d=>({openTime:parseInt(d[0]),open:parseFloat(d[1]),high:parseFloat(d[2]),low:parseFloat(d[3]),close:parseFloat(d[4]),volume:parseFloat(d[5]),closeTime:parseInt(d[6]),quoteAssetVolume:parseFloat(d[7]),numberOfTrades:parseInt(d[8]),takerBuyBaseAssetVolume:parseFloat(d[9]),takerBuyQuoteAssetVolume:parseFloat(d[10]),ignore:d[11]}));return this.cacheManager.set(n,m),m}catch(n){return console.error("Error in binance.klines:",n),[]}}shouldPaginate(t,i,r,a){if(i&&i>1e3)return!0;if(r&&a){const s=Ke[t.toUpperCase()],n={"1m":60*1e3,"3m":3*60*1e3,"5m":5*60*1e3,"15m":15*60*1e3,"30m":30*60*1e3,"1h":60*60*1e3,"2h":2*60*60*1e3,"4h":4*60*60*1e3,"1d":24*60*60*1e3,"1w":7*24*60*60*1e3,"1M":30*24*60*60*1e3}[s];if(n)return Math.ceil((a-r)/n)>1e3}return!1}}const js=vi.fileURLToPath(typeof document>"u"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||new URL("pinets.min.cjs",document.baseURI).href),Os=Te.dirname(js);class Fs{dataCache=new Map;dataDirectory;constructor(t){if(t)this.dataDirectory=t;else{const i=Te.resolve(Os,"../../../");this.dataDirectory=Te.join(i,"tests","compatibility","_data")}}getDataFileName(t,i,r,a){return r&&a?`${t}-${i}-${r}-${a}.json`:null}loadDataFromFile(t){const i=`file:${t}`;if(this.dataCache.has(i))return this.dataCache.get(i);const r=Te.join(this.dataDirectory,t);if(!Ae.existsSync(r))throw new Error(`Mock data file not found: ${r}`);const a=Ae.readFileSync(r,"utf-8"),s=JSON.parse(a);return this.dataCache.set(i,s),s}findDataFile(t,i,r,a){if(!Ae.existsSync(this.dataDirectory))return null;const s=Ae.readdirSync(this.dataDirectory).filter(u=>u.endsWith(".json"));if(r&&a){const u=`${t}-${i}-${r}-${a}.json`;if(s.includes(u))return u}const n=new RegExp(`^${t}-${i}-(\\d+)-(\\d+)\\.json$`),o=s.filter(u=>n.test(u)).map(u=>{const c=u.match(n);return{file:u,startTime:parseInt(c[1]),endTime:parseInt(c[2])}}).sort((u,c)=>c.endTime-u.endTime);if(o.length===0)return null;if(r&&a){const u=o.find(c=>c.startTime<=r&&c.endTime>=a);if(u)return u.file}return o[0].file}filterData(t,i,r,a){let s=t;return(i||r)&&(s=t.filter(n=>{const o=!i||n.openTime>=i,u=!r||n.openTime<=r;return o&&u})),s.sort((n,o)=>n.openTime-o.openTime),a&&a>0&&(s=s.slice(0,a)),s}normalizeTimeframe(t){return{1:"1m",3:"3m",5:"5m",15:"15m",30:"30m",60:"1h",120:"2h",240:"4h","4H":"4h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"}[t.toUpperCase()]||t.toLowerCase()}async getMarketData(t,i,r,a,s){try{const n=this.normalizeTimeframe(i),o=this.findDataFile(t,n,a,s);if(!o)return console.warn(`No mock data file found for ${t} ${n}. Searched in: ${this.dataDirectory}`),[];const u=this.loadDataFromFile(o);return this.filterData(u,a,s,r)}catch(n){return console.error("Error in MockProvider.getMarketData:",n),[]}}clearCache(){this.dataCache.clear()}setDataDirectory(t){this.dataDirectory=t,this.clearCache()}}const Ws=typeof process<"u"&&process.versions&&process.versions.node;let Be=null;if(Ws)try{Be=new Fs}catch{Be=null}const $s={Binance:new Bs,...Be?{Mock:Be}:{}};exports.Context=ge;exports.PineTS=xi;exports.Provider=$s;
|