-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.js
More file actions
267 lines (264 loc) · 738 KB
/
plugin.js
File metadata and controls
267 lines (264 loc) · 738 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
import {createRequire} from 'module';const require=createRequire(import.meta.url);
var _0=Object.create;var vc=Object.defineProperty;var E0=Object.getOwnPropertyDescriptor;var k0=Object.getOwnPropertyNames;var y0=Object.getPrototypeOf,v0=Object.prototype.hasOwnProperty;var Vi=(n=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(n,{get:(t,e)=>(typeof require!="undefined"?require:t)[e]}):n)(function(n){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var T0=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of k0(t))!v0.call(n,r)&&r!==e&&vc(n,r,{get:()=>t[r],enumerable:!(i=E0(t,r))||i.enumerable});return n};var ps=(n,t,e)=>(e=n!=null?_0(y0(n)):{},T0(t||!n||!n.__esModule?vc(e,"default",{value:n,enumerable:!0}):e,n));var na=X(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.default=S0;var A0=b0(Vi("crypto"));function b0(n){return n&&n.__esModule?n:{default:n}}var Pr=new Uint8Array(256),Ir=Pr.length;function S0(){return Ir>Pr.length-16&&(A0.default.randomFillSync(Pr),Ir=0),Pr.slice(Ir,Ir+=16)}});var Cc=X(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.default=void 0;var D0=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;wr.default=D0});var zs=X(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.default=void 0;var N0=I0(Cc());function I0(n){return n&&n.__esModule?n:{default:n}}function P0(n){return typeof n=="string"&&N0.default.test(n)}var w0=P0;Or.default=w0});var Ys=X(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.default=void 0;Js.unsafeStringify=Ac;var O0=L0(zs());function L0(n){return n&&n.__esModule?n:{default:n}}var je=[];for(let n=0;n<256;++n)je.push((n+256).toString(16).slice(1));function Ac(n,t=0){return je[n[t+0]]+je[n[t+1]]+je[n[t+2]]+je[n[t+3]]+"-"+je[n[t+4]]+je[n[t+5]]+"-"+je[n[t+6]]+je[n[t+7]]+"-"+je[n[t+8]]+je[n[t+9]]+"-"+je[n[t+10]]+je[n[t+11]]+je[n[t+12]]+je[n[t+13]]+je[n[t+14]]+je[n[t+15]]}function F0(n,t=0){let e=Ac(n,t);if(!(0,O0.default)(e))throw TypeError("Stringified UUID is invalid");return e}var R0=F0;Js.default=R0});var Sc=X(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.default=void 0;var B0=U0(na()),M0=Ys();function U0(n){return n&&n.__esModule?n:{default:n}}var bc,sa,ra=0,oa=0;function W0(n,t,e){let i=t&&e||0,r=t||new Array(16);n=n||{};let o=n.node||bc,h=n.clockseq!==void 0?n.clockseq:sa;if(o==null||h==null){let _=n.random||(n.rng||B0.default)();o==null&&(o=bc=[_[0]|1,_[1],_[2],_[3],_[4],_[5]]),h==null&&(h=sa=(_[6]<<8|_[7])&16383)}let f=n.msecs!==void 0?n.msecs:Date.now(),p=n.nsecs!==void 0?n.nsecs:oa+1,E=f-ra+(p-oa)/1e4;if(E<0&&n.clockseq===void 0&&(h=h+1&16383),(E<0||f>ra)&&n.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ra=f,oa=p,sa=h,f+=122192928e5;let d=((f&268435455)*1e4+p)%4294967296;r[i++]=d>>>24&255,r[i++]=d>>>16&255,r[i++]=d>>>8&255,r[i++]=d&255;let x=f/4294967296*1e4&268435455;r[i++]=x>>>8&255,r[i++]=x&255,r[i++]=x>>>24&15|16,r[i++]=x>>>16&255,r[i++]=h>>>8|128,r[i++]=h&255;for(let _=0;_<6;++_)r[i+_]=o[_];return t||(0,M0.unsafeStringify)(r)}var H0=W0;Lr.default=H0});var aa=X(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.default=void 0;var V0=G0(zs());function G0(n){return n&&n.__esModule?n:{default:n}}function q0(n){if(!(0,V0.default)(n))throw TypeError("Invalid UUID");let t,e=new Uint8Array(16);return e[0]=(t=parseInt(n.slice(0,8),16))>>>24,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=t&255,e[4]=(t=parseInt(n.slice(9,13),16))>>>8,e[5]=t&255,e[6]=(t=parseInt(n.slice(14,18),16))>>>8,e[7]=t&255,e[8]=(t=parseInt(n.slice(19,23),16))>>>8,e[9]=t&255,e[10]=(t=parseInt(n.slice(24,36),16))/1099511627776&255,e[11]=t/4294967296&255,e[12]=t>>>24&255,e[13]=t>>>16&255,e[14]=t>>>8&255,e[15]=t&255,e}var z0=q0;Fr.default=z0});var ha=X(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.URL=Xn.DNS=void 0;Xn.default=K0;var J0=Ys(),Y0=X0(aa());function X0(n){return n&&n.__esModule?n:{default:n}}function j0(n){n=unescape(encodeURIComponent(n));let t=[];for(let e=0;e<n.length;++e)t.push(n.charCodeAt(e));return t}var Dc="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Xn.DNS=Dc;var Nc="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Xn.URL=Nc;function K0(n,t,e){function i(r,o,h,f){var p;if(typeof r=="string"&&(r=j0(r)),typeof o=="string"&&(o=(0,Y0.default)(o)),((p=o)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let E=new Uint8Array(16+r.length);if(E.set(o),E.set(r,o.length),E=e(E),E[6]=E[6]&15|t,E[8]=E[8]&63|128,h){f=f||0;for(let d=0;d<16;++d)h[f+d]=E[d];return h}return(0,J0.unsafeStringify)(E)}try{i.name=n}catch{}return i.DNS=Dc,i.URL=Nc,i}});var Ic=X(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.default=void 0;var Q0=$0(Vi("crypto"));function $0(n){return n&&n.__esModule?n:{default:n}}function Z0(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),Q0.default.createHash("md5").update(n).digest()}var tC=Z0;Rr.default=tC});var wc=X(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.default=void 0;var eC=Pc(ha()),iC=Pc(Ic());function Pc(n){return n&&n.__esModule?n:{default:n}}var nC=(0,eC.default)("v3",48,iC.default),sC=nC;Br.default=sC});var Oc=X(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.default=void 0;var rC=oC(Vi("crypto"));function oC(n){return n&&n.__esModule?n:{default:n}}var aC={randomUUID:rC.default.randomUUID};Mr.default=aC});var Rc=X(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.default=void 0;var Lc=Fc(Oc()),hC=Fc(na()),uC=Ys();function Fc(n){return n&&n.__esModule?n:{default:n}}function lC(n,t,e){if(Lc.default.randomUUID&&!t&&!n)return Lc.default.randomUUID();n=n||{};let i=n.random||(n.rng||hC.default)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let r=0;r<16;++r)t[e+r]=i[r];return t}return(0,uC.unsafeStringify)(i)}var cC=lC;Ur.default=cC});var Bc=X(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.default=void 0;var fC=pC(Vi("crypto"));function pC(n){return n&&n.__esModule?n:{default:n}}function dC(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),fC.default.createHash("sha1").update(n).digest()}var mC=dC;Wr.default=mC});var Uc=X(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.default=void 0;var gC=Mc(ha()),xC=Mc(Bc());function Mc(n){return n&&n.__esModule?n:{default:n}}var _C=(0,gC.default)("v5",80,xC.default),EC=_C;Hr.default=EC});var Wc=X(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.default=void 0;var kC="00000000-0000-0000-0000-000000000000";Vr.default=kC});var Hc=X(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.default=void 0;var yC=vC(zs());function vC(n){return n&&n.__esModule?n:{default:n}}function TC(n){if(!(0,yC.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}var CC=TC;Gr.default=CC});var Vc=X(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Object.defineProperty(Gi,"NIL",{enumerable:!0,get:function(){return NC.default}});Object.defineProperty(Gi,"parse",{enumerable:!0,get:function(){return OC.default}});Object.defineProperty(Gi,"stringify",{enumerable:!0,get:function(){return wC.default}});Object.defineProperty(Gi,"v1",{enumerable:!0,get:function(){return AC.default}});Object.defineProperty(Gi,"v3",{enumerable:!0,get:function(){return bC.default}});Object.defineProperty(Gi,"v4",{enumerable:!0,get:function(){return SC.default}});Object.defineProperty(Gi,"v5",{enumerable:!0,get:function(){return DC.default}});Object.defineProperty(Gi,"validate",{enumerable:!0,get:function(){return PC.default}});Object.defineProperty(Gi,"version",{enumerable:!0,get:function(){return IC.default}});var AC=_n(Sc()),bC=_n(wc()),SC=_n(Rc()),DC=_n(Uc()),NC=_n(Wc()),IC=_n(Hc()),PC=_n(zs()),wC=_n(Ys()),OC=_n(aa());function _n(n){return n&&n.__esModule?n:{default:n}}});var Kc=X((uo,jc)=>{(function(n,t){typeof uo=="object"&&typeof jc<"u"?t(uo,Vi("prettier/standalone")):typeof define=="function"&&define.amd?define(["exports","prettier/standalone"],t):t(((n=typeof globalThis<"u"?globalThis:n||self).prettierPlugins=n.prettierPlugins||{},n.prettierPlugins.php={}),n.prettier)})(uo,function(n,t){"use strict";var e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function i(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var r={name:"PHP",type:"programming",tmScope:"text.html.php",aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",color:"#4F5D95",extensions:[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"],interpreters:["php"],aliases:["inc"],languageId:272},o={name:"HTML+PHP",type:"markup",color:"#4f5d95",tmScope:"text.html.php",group:"HTML",extensions:[".phtml"],aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",languageId:151},h={exports:{}},f={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE:function(){let s=this.input();if(this.is_WHITESPACE()){do s=this.input();while(this.is_WHITESPACE());return this.unput(1),null}switch(s){case"]":return this.attributeListDepth[this.attributeIndex]===0?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return this._input[this.offset]==="/"?this.T_COMMENT():this._input[this.offset]==="*"?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||s==="\\"){for(;this.offset<this.size;){let a=this.input();if(!this.is_LABEL()&&a!=="\\"){a&&this.unput(1);break}}return this.T_STRING()}if(this.is_NUM())return this.consume_NUM();throw new Error(`Bad terminal sequence "${s}" at line ${this.yylineno} (offset ${this.offset})`)}},p={consume_NUM:function(){let s=this.yytext[0],a=s===".";if(s==="0")if(s=this.input(),s==="x"||s==="X"){if(s=this.input(),s!=="_"&&this.is_HEX())return this.consume_HNUM();this.unput(s?2:1)}else if(s==="b"||s==="B"){if(s=this.input(),s!=="_"&&s==="0"||s==="1")return this.consume_BNUM();this.unput(s?2:1)}else if(s==="o"||s==="O"){if(s=this.input(),s!=="_"&&this.is_OCTAL())return this.consume_ONUM();this.unput(s?2:1)}else this.is_NUM()||s&&this.unput(1);for(;this.offset<this.size;){let l=s;if(s=this.input(),s==="_"){if(l==="_"){this.unput(2);break}if(l==="."){this.unput(1);break}if(l==="e"||l==="E"){this.unput(2);break}}else{if(s==="."){if(a){this.unput(1);break}if(l==="_"){this.unput(2);break}a=!0;continue}if(s==="e"||s==="E"){if(l==="_"){this.unput(1);break}let m=2;if(s=this.input(),s!=="+"&&s!=="-"||(m=3,s=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(s?m:m-1);break}}if(!this.is_NUM()){s&&this.unput(1);break}}return a?this.tok.T_DNUMBER:this.yytext.length<9||this.yytext.length<10||this.yytext.length==10&&this.yytext<"2147483648"?this.tok.T_LNUMBER:this.tok.T_DNUMBER},consume_HNUM:function(){for(;this.offset<this.size;){let s=this.input();if(!this.is_HEX()){s&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_LNUM:function(){for(;this.offset<this.size;){let s=this.input();if(!this.is_NUM()){s&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){let s;for(;this.offset<this.size;)if(s=this.input(),s!=="0"&&s!=="1"&&s!=="_"){s&&this.unput(1);break}return this.tok.T_LNUMBER},consume_ONUM:function(){for(;this.offset<this.size;){let s=this.input();if(!this.is_OCTAL()){s&&this.unput(1);break}}return this.tok.T_LNUMBER}},E={matchST_LOOKING_FOR_PROPERTY:function(){let s=this.input();if(s==="-"){if(s=this.input(),s===">")return this.tok.T_OBJECT_OPERATOR;s&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),s&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){let s=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),s=this.input(),s==="["||s==="}")return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else s&&this.unput(1);return!1},matchST_VAR_OFFSET:function(){let s=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if(s==="]")return this.popState(),"]";if(s==="$"){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||s==="\\"||s==="'"||s==="#")return this.tok.T_ENCAPSED_AND_WHITESPACE;if(s==="["||s==="{"||s==="}"||s==='"'||s==="`"||this.is_TOKEN())return s;throw new Error("Unexpected terminal")}},d={matchST_IN_SCRIPTING:function(){let s=this.input();switch(s){case" ":case" ":case`
`:case"\r":case`\r
`:return this.T_WHITESPACE();case"#":return this.version>=800&&this._input[this.offset]==="["?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return this._input[this.offset]==="/"?this.T_COMMENT():this._input[this.offset]==="*"?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();let a=this._input[this.offset];return a!==`
`&&a!=="\r"||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&this._input[this.offset]===">"?(this.input(),s=this._input[this.offset],s!==`
`&&s!=="\r"||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if(s==="."){if(s=this.input(),this.is_NUM_START())return this.consume_NUM();s&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+s+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function(){for(;this.offset<this.size;){let s=this.input();if(s!==" "&&s!==" "&&s!==`
`&&s!=="\r"){s&&this.unput(1);break}}return this.tok.T_WHITESPACE}};let x=[`
`,"\r"],_=[`
`,"\r",";"],u=_.concat([" "," ",",","]",")","/","=","!"]);var c={T_CONSTANT_ENCAPSED_STRING:function(){let s;for(;this.offset<this.size;)if(s=this.input(),s=="\\")this.input();else if(s=="'")break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){let s=this.offset;if(this._input[this.offset-1]==="<"&&this._input[this.offset]==="<"&&this._input[this.offset+1]==="<"){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,this.is_TABSPACE()););let a=this._input[this.offset-1];if(a==="'"||a==='"'?this.offset++:a=null,this.is_LABEL_START()){let l=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););let m=this._input.substring(l,this.offset-1);if((!a||a===this._input[this.offset-1])&&(a&&this.offset++,x.includes(this._input[this.offset-1])))return this.heredoc_label.label=m,this.heredoc_label.length=m.length,this.heredoc_label.finished=!1,l=this.offset-s,this.offset=s,this.consume(l),a==="'"?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.prematch_ENDOFDOC(),this.tok.T_START_HEREDOC}}return this.offset=s,!1},ST_DOUBLE_QUOTES:function(){let s;for(;this.offset<this.size;)if(s=this.input(),s=="\\")this.input();else{if(s=='"')break;if(s=="$"){if(s=this.input(),s=="{"||this.is_LABEL_START()){this.unput(2);break}s&&this.unput(1)}else if(s=="{"){if(s=this.input(),s=="$"){this.unput(2);break}s&&this.unput(1)}}if(s=='"')return this.tok.T_CONSTANT_ENCAPSED_STRING;{let a=1;return this.yytext[0]!=="b"&&this.yytext[0]!=="B"||(a=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-a),this.unput(this.yytext.length-a),this.begin("ST_DOUBLE_QUOTES"),this.yytext}},isDOC_MATCH:function(s,a){let l=this._input[s-2];if(!x.includes(l))return!1;let m=!1,v=!1,b=0,L=this._input[s-1];if(this.version>=703){for(;L===" "||L===" ";)L===" "?m=!0:L===" "&&(v=!0),L=this._input[s+b],b++;if(s+=b,x.includes(this._input[s-1]))return!1}if(this._input.substring(s-1,s-1+this.heredoc_label.length)===this.heredoc_label.label){let I=this._input[s-1+this.heredoc_label.length];if((this.version>=703?u:_).includes(I)){if(a){if(this.consume(b),m&&v)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=b,this.heredoc_label.indentation_uses_spaces=m,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC:function(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;let s=this.offset+1;for(;s<this._input.length;){if(this.isDOC_MATCH(s,!1))return;if(!x.includes(this._input[s-1]))for(;!x.includes(this._input[s++])&&s<this._input.length;);s++}},matchST_NOWDOC:function(){if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;let s=this._input[this.offset-1];for(;this.offset<this.size;)if(x.includes(s)){if(s=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else s=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC:function(){let s=this.input();if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if(s==="\\"&&(s=this.input(),x.includes(s)||(s=this.input())),x.includes(s)){if(s=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if(s==="$"){if(s=this.input(),s==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){let a=this.offset,l=this.consume_VARIABLE();return this.yytext.length>this.offset-a+2?(this.appendToken(l,this.offset-a+2),this.unput(this.offset-a+2),this.tok.T_ENCAPSED_AND_WHITESPACE):l}}else if(s==="{"){if(s=this.input(),s==="$")return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else s=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){this.consume_LABEL();let s=this.input();if(s=="[")return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if(s==="-"){if(this.input()===">")return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else s&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){let s=this.input();if(s==="$"){if(s=this.input(),s==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if(s==="{"){if(this._input[this.offset]==="$")return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if(s==="`")return this.popState(),"`";for(;this.offset<this.size;){if(s==="\\")this.input();else{if(s==="`"){this.unput(1),this.popState(),this.appendToken("`",1);break}if(s==="$"){if(s=this.input(),s==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){let a=this.offset,l=this.consume_VARIABLE();return this.yytext.length>this.offset-a+2?(this.appendToken(l,this.offset-a+2),this.unput(this.offset-a+2),this.tok.T_ENCAPSED_AND_WHITESPACE):l}continue}if(s==="{"){if(s=this.input(),s==="$")return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}s=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){let s=this.input();if(s==="$"){if(s=this.input(),s==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if(s==="{"){if(this._input[this.offset]==="$")return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if(s==='"')return this.popState(),'"';for(;this.offset<this.size;){if(s==="\\")this.input();else{if(s==='"'){this.unput(1),this.popState(),this.appendToken('"',1);break}if(s==="$"){if(s=this.input(),s==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){let a=this.offset,l=this.consume_VARIABLE();return this.yytext.length>this.offset-a+2?(this.appendToken(l,this.offset-a+2),this.unput(this.offset-a+2),this.tok.T_ENCAPSED_AND_WHITESPACE):l}s&&this.unput(1)}else if(s==="{"){if(s=this.input(),s==="$")return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);s&&this.unput(1)}}s=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}},g={is_NUM:function(){let s=this._input.charCodeAt(this.offset-1);return s>47&&s<58||s===95},is_NUM_START:function(){let s=this._input.charCodeAt(this.offset-1);return s>47&&s<58},is_LABEL:function(){let s=this._input.charCodeAt(this.offset-1);return s>96&&s<123||s>64&&s<91||s===95||s>47&&s<58||s>126},is_LABEL_START:function(){let s=this._input.charCodeAt(this.offset-1);return s>64&&s<91||s>96&&s<123||s===95||s>126},consume_LABEL:function(){for(;this.offset<this.size;){let s=this.input();if(!this.is_LABEL()){s&&this.unput(1);break}}return this},is_TOKEN:function(){let s=this._input[this.offset-1];return";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(s)!==-1},is_WHITESPACE:function(){let s=this._input[this.offset-1];return s===" "||s===" "||s===`
`||s==="\r"},is_TABSPACE:function(){let s=this._input[this.offset-1];return s===" "||s===" "},consume_TABSPACE:function(){for(;this.offset<this.size;){let s=this.input();if(!this.is_TABSPACE()){s&&this.unput(1);break}}return this},is_HEX:function(){let s=this._input.charCodeAt(this.offset-1);return s>47&&s<58||s>64&&s<71||s>96&&s<103||s===95},is_OCTAL:function(){let s=this._input.charCodeAt(this.offset-1);return s>47&&s<56||s===95}};let y=function(s){this.engine=s,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=801,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};y.prototype.setInput=function(s){return this._input=s,this.size=s.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString:function(){this.label}},this},y.prototype.input=function(){let s=this._input[this.offset];return s?(this.yytext+=s,this.offset++,s==="\r"&&this._input[this.offset]===`
`&&(this.yytext+=`
`,this.offset++),s===`
`||s==="\r"?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,s):""},y.prototype.unput=function(s){if(s===1)this.offset--,this._input[this.offset]===`
`&&this._input[this.offset-1]==="\r"&&(this.offset--,s++),this._input[this.offset]==="\r"||this._input[this.offset]===`
`?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-s);else if(s>0)if(this.offset-=s,s<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-s),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(let a=0;a<this.yytext.length;a++){let l=this.yytext[a];l==="\r"?(l=this.yytext[++a],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,l!==`
`&&(l==="\r"?this.yylloc.last_line++:this.yylloc.last_column++)):l===`
`?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this},y.prototype.tryMatch=function(s){return s===this.ahead(s.length)},y.prototype.tryMatchCaseless=function(s){return s===this.ahead(s.length).toLowerCase()},y.prototype.ahead=function(s){let a=this._input.substring(this.offset,this.offset+s);return a[a.length-1]==="\r"&&this._input[this.offset+s+1]===`
`&&(a+=`
`),a},y.prototype.consume=function(s){for(let a=0;a<s;a++){let l=this._input[this.offset];if(!l)break;this.yytext+=l,this.offset++,l==="\r"&&this._input[this.offset]===`
`&&(this.yytext+=`
`,this.offset++,a++),l===`
`||l==="\r"?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},y.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column},heredoc_label:this.heredoc_label}},y.prototype.setState=function(s){return this.yytext=s.yytext,this.offset=s.offset,this.yylineno=s.yylineno,this.yyprevcol=s.yyprevcol,this.yylloc=s.yylloc,s.heredoc_label&&(this.heredoc_label=s.heredoc_label),this},y.prototype.appendToken=function(s,a){return this.tokens.push([s,a]),this},y.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;let s=this.next()||this.lex();if(!this.all_tokens){for(;s===this.tok.T_WHITESPACE||!this.comment_tokens&&(s===this.tok.T_COMMENT||s===this.tok.T_DOC_COMMENT)||s===this.tok.T_OPEN_TAG;)s=this.next()||this.lex();if(s==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO;if(s===this.tok.T_CLOSE_TAG)return";"}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),s},y.prototype.begin=function(s){if(this.conditionStack.push(s),this.curCondition=s,this.stateCb=this["match"+s],typeof this.stateCb!="function")throw new Error('Undefined condition state "'+s+'"');return this},y.prototype.popState=function(){let s=this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],typeof this.stateCb!="function")throw new Error('Undefined condition state "'+this.curCondition+'"');return s},y.prototype.next=function(){let s;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(s=this.tokens.shift(),typeof s[1]=="object"?this.setState(s[1]):this.consume(s[1]),s=s[0]):s=this.stateCb.apply(this,[]),this.offset>=this.size&&this.tokens.length===0&&(this.done=!0),this.debug){let a=s;a=typeof a=="number"?this.engine.tokens.values[a]:'"'+a+'"';let l=new Error(a+" from "+this.yylloc.first_line+","+this.yylloc.first_column+" - to "+this.yylloc.last_line+","+this.yylloc.last_column+' "'+this.yytext+'"');console.error(l.stack)}return s},[f,{T_COMMENT:function(){for(;this.offset<this.size;){let s=this.input();if(s===`
`||s==="\r")return this.tok.T_COMMENT;if(s==="?"&&!this.aspTagMode&&this._input[this.offset]===">")return this.unput(1),this.tok.T_COMMENT;if(s==="%"&&this.aspTagMode&&this._input[this.offset]===">")return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){let s=this.input(),a=this.tok.T_COMMENT;if(s==="*"){if(s=this.input(),this.is_WHITESPACE()&&(a=this.tok.T_DOC_COMMENT),s==="/")return a;this.unput(1)}for(;this.offset<this.size;)if(s=this.input(),s==="*"&&this._input[this.offset]==="/"){this.input();break}return a}},{nextINITIAL:function(){return this.conditionStack.length>1&&this.conditionStack[this.conditionStack.length-1]==="INITIAL"?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset<this.size;){let s=this.input();if(s=="<"){if(s=this.ahead(1),s=="?"){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}if(this.tryMatchCaseless("?php")&&(s=this._input[this.offset+4],s===" "||s===" "||s===`
`||s==="\r")){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&s=="%"){if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}}return this.yytext.length>0&&this.tok.T_INLINE_HTML}},p,E,d,c,{T_STRING:function(){let s=this.yytext.toLowerCase(),a=this.keywords[s];if(typeof a!="number"){if(s==="yield")this.version>=700&&this.tryMatch(" from")?(this.consume(5),a=this.tok.T_YIELD_FROM):a=this.tok.T_YIELD;else if(a=this.tok.T_STRING,s==="b"||s==="B"){let l=this.input();if(l==='"')return this.ST_DOUBLE_QUOTES();if(l==="'")return this.T_CONSTANT_ENCAPSED_STRING();l&&this.unput(1)}}if(a===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;let l=this.offset,m=this.input();for(;m==" ";)m=this.input();let v=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)m+=this.input();let b=m.slice(0,-1).toLowerCase();v=b!=="extends"&&b!=="implements"}return this.unput(this.offset-l),v?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&a!==this.tok.T_YIELD_FROM){let l=this.input();if(l==="\\"){a=s==="namespace"?this.tok.T_NAME_RELATIVE:this.tok.T_NAME_QUALIFIED;do{if(this._input[this.offset]==="{"){this.input();break}this.consume_LABEL(),l=this.input()}while(l==="\\")}l&&this.unput(1)}return a},consume_TOKEN:function(){let s=this._input[this.offset-1],a=this.tokenTerminals[s];return a?a.apply(this,[]):this.yytext},tokenTerminals:{$:function(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function(){let s=this._input[this.offset];return s===">"?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):s==="-"?(this.input(),this.tok.T_DEC):s==="="?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){if(this.offset<this.size){if(this.input(),this.is_LABEL_START()){let s;do{if(this._input[this.offset]==="{"){this.input();break}this.consume_LABEL(),s=this.input()}while(s==="\\");return this.unput(1),this.tok.T_NAME_FULLY_QUALIFIED}this.unput(1)}return this.tok.T_NS_SEPARATOR},"/":function(){return this._input[this.offset]==="="?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function(){return this._input[this.offset]===":"?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function(){let s=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){let a=this.yytext.length;this.consume_LABEL();let l=this.yytext.substring(a-1).toLowerCase(),m=this.castKeywords[l];if(typeof m=="number"&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this._input[this.offset-1]===")"))return m}return this.unput(this.offset-s),"("},"=":function(){let s=this._input[this.offset];return s===">"?(this.input(),this.tok.T_DOUBLE_ARROW):s==="="?this._input[this.offset+1]==="="?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){let s=this._input[this.offset];return s==="+"?(this.input(),this.tok.T_INC):s==="="?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return this._input[this.offset]==="="?this._input[this.offset+1]==="="?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return this.version>=700&&this._input[this.offset]==="?"?this.version>=704&&this._input[this.offset+1]==="="?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&this._input[this.offset]==="-"&&this._input[this.offset+1]===">"?(this.consume(2),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){let s=this._input[this.offset];return s==="<"?(s=this._input[this.offset+1],s==="="?(this.consume(2),this.tok.T_SL_EQUAL):s==="<"&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL)):s==="="?(this.input(),this.version>=700&&this._input[this.offset]===">"?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):s===">"?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){let s=this._input[this.offset];return s==="="?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):s===">"?(s=this._input[this.offset+1],s==="="?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR)):">"},"*":function(){let s=this._input[this.offset];return s==="="?(this.input(),this.tok.T_MUL_EQUAL):s==="*"?(this.input(),this._input[this.offset]==="="?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){let s=this._input[this.offset];return s==="="?(this.input(),this.tok.T_CONCAT_EQUAL):s==="."&&this._input[this.offset+1]==="."?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return this._input[this.offset]==="="?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){let s=this._input[this.offset];return s==="="?(this.input(),this.tok.T_AND_EQUAL):s==="&"?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){let s=this._input[this.offset];return s==="="?(this.input(),this.tok.T_OR_EQUAL):s==="|"?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return this._input[this.offset]==="="?(this.input(),this.tok.T_XOR_EQUAL):"^"}}},g].forEach(function(s){for(let a in s)y.prototype[a]=s[a]});var T=y,w=function(s,a,l){this.line=s,this.column=a,this.offset=l},R={read_expr:function(s){let a=this.node();if(this.token==="@")return s||(s=this.next().read_expr()),a("silent",s);if(s||(s=this.read_expr_item()),this.token==="|")return a("bin","|",s,this.next().read_expr());if(this.token==="&")return a("bin","&",s,this.next().read_expr());if(this.token==="^")return a("bin","^",s,this.next().read_expr());if(this.token===".")return a("bin",".",s,this.next().read_expr());if(this.token==="+")return a("bin","+",s,this.next().read_expr());if(this.token==="-")return a("bin","-",s,this.next().read_expr());if(this.token==="*")return a("bin","*",s,this.next().read_expr());if(this.token==="/")return a("bin","/",s,this.next().read_expr());if(this.token==="%")return a("bin","%",s,this.next().read_expr());if(this.token===this.tok.T_POW)return a("bin","**",s,this.next().read_expr());if(this.token===this.tok.T_SL)return a("bin","<<",s,this.next().read_expr());if(this.token===this.tok.T_SR)return a("bin",">>",s,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return a("bin","||",s,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return a("bin","or",s,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return a("bin","&&",s,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return a("bin","and",s,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return a("bin","xor",s,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return a("bin","===",s,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return a("bin","!==",s,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return a("bin","==",s,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return a("bin","!=",s,this.next().read_expr());if(this.token==="<")return a("bin","<",s,this.next().read_expr());if(this.token===">")return a("bin",">",s,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return a("bin","<=",s,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return a("bin",">=",s,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return a("bin","<=>",s,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(s=a("bin","instanceof",s,this.next().read_class_name_reference()),this.token!==";"&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(s=this.read_expr(s))),this.token===this.tok.T_COALESCE)return a("bin","??",s,this.next().read_expr());if(this.token==="?"){let l=null;return this.next().token!==":"&&(l=this.read_expr()),this.expect(":")&&this.next(),a("retif",s,l,this.read_expr())}return a.destroy(s),s},read_expr_cast:function(s){return this.node("cast")(s,this.text(),this.next().read_expr())},read_isset_variable:function(){return this.read_expr()},read_isset_variables:function(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc:function(){let s=null;switch(this.token){case this.tok.T_ISSET:{s=this.node("isset"),this.next().expect("(")&&this.next();let a=this.read_isset_variables();this.expect(")")&&this.next(),s=s(a)}break;case this.tok.T_EMPTY:{s=this.node("empty"),this.next().expect("(")&&this.next();let a=this.read_expr();this.expect(")")&&this.next(),s=s(a)}break;case this.tok.T_INCLUDE:s=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:s=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:{s=this.node("eval"),this.next().expect("(")&&this.next();let a=this.read_expr();this.expect(")")&&this.next(),s=s(a)}break;case this.tok.T_REQUIRE:s=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:s=this.node("include")(!0,!0,this.next().read_expr())}return s},read_optional_expr:function(s){return this.token!==s?this.read_expr():null},read_exit_expr:function(){let s=null;return this.token==="("&&(this.next(),s=this.read_optional_expr(")"),this.expect(")")&&this.next()),s},read_expr_item:function(){let s,a,l=[];if(this.token==="+")return this.node("unary")("+",this.next().read_expr());if(this.token==="-")return this.node("unary")("-",this.next().read_expr());if(this.token==="!")return this.node("unary")("!",this.next().read_expr());if(this.token==="~")return this.node("unary")("~",this.next().read_expr());if(this.token==="(")return a=this.next().read_expr(),a.parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(a);if(this.token==="`")return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){let m=null,v=this.innerList;s=this.node("list"),v||(m=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);let b=this.read_array_pair_list(!1);this.expect(")")&&this.next();let L=!1;for(let I=0;I<b.length;I++)if(b[I]!==null&&b[I].kind!=="noop"){L=!0;break}return L||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),v?s(b,!1):(this.innerList=!1,this.expect("=")?m(s(b,!1),this.next().read_expr(),"="):s(b,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(l=this.read_attr_list()),this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1));case this.tok.T_NEW:return this.read_new_expr();case this.tok.T_ISSET:case this.tok.T_EMPTY:case this.tok.T_INCLUDE:case this.tok.T_INCLUDE_ONCE:case this.tok.T_EVAL:case this.tok.T_REQUIRE:case this.tok.T_REQUIRE_ONCE:return this.read_internal_functions_in_yacc();case this.tok.T_MATCH:return this.read_match_expression();case this.tok.T_INT_CAST:return this.read_expr_cast("int");case this.tok.T_DOUBLE_CAST:return this.read_expr_cast("float");case this.tok.T_STRING_CAST:return this.read_expr_cast(this.text().indexOf("binary")!==-1?"binary":"string");case this.tok.T_ARRAY_CAST:return this.read_expr_cast("array");case this.tok.T_OBJECT_CAST:return this.read_expr_cast("object");case this.tok.T_BOOL_CAST:return this.read_expr_cast("bool");case this.tok.T_UNSET_CAST:return this.read_expr_cast("unset");case this.tok.T_THROW:return this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression"),this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:{let m=this.lexer.yytext.toLowerCase()==="die";return s=this.node("exit"),this.next(),s(this.read_exit_expr(),m)}case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:{let m=null,v=null;return s=this.node("yield"),this.next().is("EXPR")&&(m=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(v=m,m=this.next().read_expr())),s(m,v)}case this.tok.T_YIELD_FROM:return s=this.node("yieldfrom"),a=this.next().read_expr(),s(a);case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,l);case this.tok.T_STATIC:{let m=[this.token,this.lexer.getState()];if(this.next(),this.token===this.tok.T_FUNCTION||this.version>=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],l);this.lexer.tokens.push(m),this.next()}}if(this.is("VARIABLE")){s=this.node(),a=this.read_variable(!1,!1);let m=a.kind==="identifier"||a.kind==="staticlookup"&&a.offset.kind==="identifier";switch(this.token){case"=":return m&&this.error("VARIABLE"),this.next().token=="&"?this.read_assignref(s,a):s("assign",a,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return m&&this.error("VARIABLE"),s("assign",a,this.next().read_expr(),"??=");case this.tok.T_INC:return m&&this.error("VARIABLE"),this.next(),s("post","+",a);case this.tok.T_DEC:return m&&this.error("VARIABLE"),this.next(),s("post","-",a);default:s.destroy(a)}}else{if(this.is("SCALAR")){if(s=this.node(),a=this.read_scalar(),a.kind==="array"&&a.shortForm&&this.token==="="){let m=this.convertToList(a);return a.loc&&(m.loc=a.loc),s("assign",m,this.next().read_expr(),"=")}return s.destroy(a),this.handleDereferencable(a)}this.error("EXPR"),this.next()}return a},convertToList:function(s){let a=s.items.map(m=>(m.value&&m.value.kind==="array"&&m.value.shortForm&&(m.value=this.convertToList(m.value)),m)),l=this.node("list")(a,!0);return s.loc&&(l.loc=s.loc),s.leadingComments&&(l.leadingComments=s.leadingComments),s.trailingComments&&(l.trailingComments=s.trailingComments),l},read_assignref:function(s,a){let l;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),l=this.read_new_expr()):l=this.read_variable(!1,!1),s("assignref",a,l)},read_inline_function:function(s,a){if(this.token===this.tok.T_FUNCTION){let H=this.read_function(!0,s,a);return H.attrGroups=a,H}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");let l=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();let m=this.is_reference();this.expect("(")&&this.next();let v=this.read_parameter_list();this.expect(")")&&this.next();let b=!1,L=null;this.token===":"&&(this.next().token==="?"&&(b=!0,this.next()),L=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();let I=l(v,m,this.read_expr(),L,b,!!s);return I.attrGroups=a,I},read_match_expression:function(){let s=this.node("match");this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8");let a=null,l=[];return this.expect("(")&&this.next(),a=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),l=this.read_match_arms(),this.expect("}")&&this.next(),s(a,l)},read_match_arms:function(){return this.read_list(()=>this.read_match_arm(),",",!0)},read_match_arm:function(){if(this.token!=="}")return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds:function(){let s=[];if(this.token===this.tok.T_DEFAULT)s=null,this.next();else for(s.push(this.read_expr());this.token===",";){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),s;s.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),s},read_attribute(){let s=this.text(),a=[];return this.next(),this.token==="("&&(a=this.read_argument_list()),this.node("attribute")(s,a)},read_attr_list(){let s=[];if(this.token===this.tok.T_ATTRIBUTE)do{let a=this.node("attrgroup")([]);for(this.next(),a.attrs.push(this.read_attribute());this.token===",";)this.next(),this.token!=="]"&&a.attrs.push(this.read_attribute());s.push(a),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return s},read_new_expr:function(){let s=this.node("new");this.expect(this.tok.T_NEW)&&this.next();let a=[];if(this.token==="("){this.next();let v=this.read_expr();return this.expect(")"),this.next(),this.token==="("&&(a=this.read_argument_list()),s(v,a)}let l=this.read_attr_list();if(this.token===this.tok.T_CLASS){let v=this.node("class");this.next().token==="("&&(a=this.read_argument_list());let b=this.read_extends_from(),L=this.read_implements_list(),I=null;this.expect("{")&&(I=this.next().read_class_body(!0,!1));let H=v(null,b,L,I,[0,0,0]);return H.attrGroups=l,s(H,a)}let m=this.read_new_class_name();for(;this.token==="[";){let v=this.node("offsetlookup"),b=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),m=v(m,b)}return this.token==="("&&(a=this.read_argument_list()),s(m,a)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){let s=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(s=this.read_static_getter(s)),s}if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable:function(s){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)s=this.recursive_variable_chain_scan(s,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||this.token==="[")s=this.read_dereferencable(s);else{if(this.token!=="(")return s;s=this.node("call")(s,this.read_argument_list())}return s}},M={is_reference:function(){return this.token==="&"&&(this.next(),!0)},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function(s,a,l,m){let v=this.read_function_declaration(s?1:a?2:0,a&&a[1]===1,l||[],m);return a&&a[2]==1?(v.parseFlags(a),this.expect(";")&&this.next()):(this.expect("{")&&(v.body=this.read_code_block(!1),v.loc&&v.body.loc&&(v.loc.end=v.body.loc.end)),!s&&a&&v.parseFlags(a)),v},read_function_declaration:function(s,a,l,m){let v="function";s===1?v="closure":s===2&&(v="method");let b=this.node(v);this.expect(this.tok.T_FUNCTION)&&this.next();let L=this.is_reference(),I=!1,H=[],U=null,P=!1;if(s!==1){let et=this.node("identifier");s===2?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(I=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(I=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(I=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(I=this.text()),this.next()),I=et(I)}this.expect("(")&&this.next();let q=this.read_parameter_list(I.name==="__construct");return this.expect(")")&&this.next(),s===1&&(H=this.read_lexical_vars()),this.token===":"&&(this.next().token==="?"&&(P=!0,this.next()),U=this.read_types()),(et=>(et.attrGroups=l||[],m&&et.loc&&(et.loc.start=m,et.loc.source&&(et.loc.source=this.lexer._input.substr(et.loc.start.offset,et.loc.end.offset-et.loc.start.offset))),et))(s===1?b(q,L,H,U,P,a):b(I,q,L,U,P))},read_lexical_vars:function(){let s=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),s=this.read_lexical_var_list(),this.expect(")")&&this.next()),s},read_list_with_dangling_comma:function(s){let a=[];for(;this.token!=this.EOF;){if(a.push(s()),this.token!=","){if(this.token==")")break;this.error([",",")"]);break}if(this.next(),this.version>=800&&this.token===")")return a}return a},read_lexical_var_list:function(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var:function(){if(this.token==="&")return this.read_byref(this.read_lexical_var.bind(this));let s=this.node("variable");this.expect(this.tok.T_VARIABLE);let a=this.text().substring(1);return this.next(),s(a,!1)},read_parameter_list:function(s){if(this.token!==")"){let a=!1;return this.read_list_with_dangling_comma(function(){let l=this.read_parameter(s);return l&&(a&&this.raiseError("Unexpected parameter after a variadic parameter"),l.variadic&&(a=!0)),l}.bind(this),",")}return[]},read_parameter:function(s){let a=this.node("parameter"),l=null,m=null,v=null,b=!1,L=!1,I=[];this.token===this.tok.T_ATTRIBUTE&&(I=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(s?(this.next(),L=!0):this.raiseError("readonly properties can be used only on class constructor"));let H=this.read_promoted();!L&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(s?(this.next(),L=!0):this.raiseError("readonly properties can be used only on class constructor")),this.token==="?"&&(this.next(),b=!0),v=this.read_types(),b&&!v&&this.raiseError("Expecting a type definition combined with nullable operator");let U=this.is_reference(),P=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){l=this.node("identifier");let $=this.text().substring(1);this.next(),l=l($)}this.token=="="&&(m=this.next().read_expr());let q=a(l,v,m,U,P,L,b,H);return I&&(q.attrGroups=I),q},read_types(){let s="unset",a="union",l="intersection",m=[],v=s,b=this.read_type();if(!b)return null;for(m.push(b);this.token==="|"||this.version>=801&&this.token==="&";){let L=this.peek();if(L===this.tok.T_ELLIPSIS||L===this.tok.T_VARIABLE)break;v===s?v=this.token==="|"?a:l:(v===a&&this.token!=="|"||v===l&&this.token!=="&")&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),m.push(this.read_type())}return m.length===1?m[0]:v===l?this.node("intersectiontype")(m):this.node("uniontype")(m)},read_promoted(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list:function(){let s=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&this.peek()===")"?(s.push(this.node("variadicplaceholder")()),this.next()):this.token!==")"&&(s=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),s},read_non_empty_argument_list:function(){let s=!1;return this.read_function_list(function(){let a=this.read_argument();if(a){let l=a.kind==="variadic";s&&!l&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),l&&(s=!0)}return a}.bind(this),",")},read_argument:function(){return this.token===this.tok.T_ELLIPSIS?this.node("variadic")(this.next().read_expr()):(this.token===this.tok.T_STRING||Object.values(this.lexer.keywords).includes(this.token))&&this.peek()===":"?(this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr())):this.read_expr()},read_type:function(){let s=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){let a=this.text();return this.next(),s("typereference",a.toLowerCase(),a)}if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){let a=this.text(),l=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(a.toLowerCase())>-1?s("typereference",a.toLowerCase(),a):(this.lexer.tokens.push(l),this.next(),s.destroy(),this.read_namespace_name())}return s.destroy(),null}};let J={"\\":"\\",$:"$",n:`
`,r:"\r",t:" ",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var W={resolve_special_chars:function(s,a){return a?s.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,(l,m,v)=>J[m]?J[m]:m[0]==="x"||m[0]==="X"?String.fromCodePoint(parseInt(m.substr(1),16)):m[0]==="u"?String.fromCodePoint(parseInt(v,16)):String.fromCodePoint(parseInt(m,8))):s.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(s,a,l,m){if(a===0)return s;this.check_heredoc_indentation_level(s,a,l,m);let v=l?" ":" ",b=new RegExp(`\\n${v}{${a}}`,"g"),L=new RegExp(`^${v}{${a}}`);return m&&(s=s.replace(L,"")),s.replace(b,`
`)},check_heredoc_indentation_level:function(s,a,l,m){let v=s.length,b=0,L=0,I=!0,H=l?" ":" ",U=!1;if(!m){if(b=s.indexOf(`
`),b===-1)return;b++}for(;b<v;)I?s[b]===H?L++:U=!0:I=!1,s[b]!==`
`&&U&&L<a?this.raiseError(`Invalid body indentation level (expecting an indentation at least ${a})`):U=!1,s[b]===`
`&&(I=!0,L=0),b++},read_dereferencable_scalar:function(){let s=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:{let a=this.node("string"),l=this.text(),m=0;l[0]!=="b"&&l[0]!=="B"||(m=1);let v=l[m]==='"';this.next(),a=a(v,this.resolve_special_chars(l.substring(m+1,l.length-1),v),m===1,l),s=this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(a):a}break;case this.tok.T_ARRAY:case"[":s=this.read_array()}return s},read_scalar:function(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();{let s,a;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:{let l=this.node("number");return s=this.text(),this.next(),l(s,null)}case this.tok.T_START_HEREDOC:if(this.lexer.curCondition==="ST_NOWDOC"){let l=this.lexer.yylloc.first_offset;a=this.node("nowdoc"),s=this.next().text(),this.lexer.heredoc_label.indentation>0&&(s=s.substring(0,s.length-this.lexer.heredoc_label.indentation));let m=s[s.length-1];m===`
`?s=s[s.length-2]==="\r"?s.substring(0,s.length-2):s.substring(0,s.length-1):m==="\r"&&(s=s.substring(0,s.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();let v=this.lexer._input.substring(l,this.lexer.yylloc.first_offset);return a=a(this.remove_heredoc_leading_whitespace_chars(s,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),v,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,a}return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:{let l=this.error("SCALAR");return this.next(),l}}}},read_dereferencable:function(s){let a,l,m=this.node("offsetlookup");return this.token==="["?(l=this.next().read_expr(),this.expect("]")&&this.next(),a=m(s,l)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(l=this.read_encapsed_string_item(!1),a=m(s,l)),a},read_encapsed_string_item:function(s){let a=this.node("encapsedpart"),l,m,v,b=null,L=!1,I=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){let H=this.text();this.next(),I=I("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(H,s),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):H,!1,H)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(b="simple",L=!0,v=null,this.next().token===this.tok.T_STRING_VARNAME){v=this.node("variable");let H=this.text();this.next(),I.destroy(),this.token==="["?(v=v(H,!1),m=this.node("offsetlookup"),l=this.next().read_expr(),this.expect("]")&&this.next(),I=m(v,l)):I=v(H,!1)}else I=I("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)b="complex",I.destroy(),I=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(b="simple",I.destroy(),I=this.read_simple_variable(),this.token==="["&&(m=this.node("offsetlookup"),l=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),I=m(I,l)),this.token===this.tok.T_OBJECT_OPERATOR){m=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);let H=this.node("identifier");v=this.text(),this.next(),I=m(I,H(v))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);let H=this.text();this.next(),I.destroy(),I=I("string",!1,H,!1,H)}return this.lexer.heredoc_label.first_encaps_node=!1,a(I,b,L)},read_encapsed_string:function(s){let a=arguments.length>1&&arguments[1]!==void 0&&arguments[1],l=this.lexer.yylloc.first_offset,m=this.node("encapsed");this.next();let v=this.lexer.yylloc.prev_offset-(a?1:0),b=[],L=null;for(L=s==="`"?this.ast.encapsed.TYPE_SHELL:s==='"'?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==s&&this.token!==this.EOF;)b.push(this.read_encapsed_string_item(!0));if(b.length>0&&b[b.length-1].kind==="encapsedpart"&&b[b.length-1].expression.kind==="string"){let I=b[b.length-1].expression,H=I.value[I.value.length-1];H===`
`?I.value[I.value.length-2]==="\r"?I.value=I.value.substring(0,I.value.length-2):I.value=I.value.substring(0,I.value.length-1):H==="\r"&&(I.value=I.value.substring(0,I.value.length-1))}return this.expect(s)&&this.next(),m=m(b,this.lexer._input.substring(L==="heredoc"?l:v-1,this.lexer.yylloc.first_offset),L),s===this.tok.T_END_HEREDOC&&(m.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),m},get_magic_constant:function(){let s=this.node("magic"),a=this.text();return this.next(),s(a.toUpperCase(),a)}},j={read_top_statements:function(){let s=[];for(;this.token!==this.EOF&&this.token!=="}";){let a=this.read_top_statement();a&&(Array.isArray(a)?s=s.concat(a):s.push(a))}return s},read_top_statement:function(){let s=[];switch(this.token===this.tok.T_ATTRIBUTE&&(s=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,s);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(s);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(s);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(s);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:{let a=this.node("constantstatement"),l=this.next().read_const_list();return this.expectEndOfStatement(),a(null,l)}case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:{let a=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,a(this.lexer._input.substring(this.lexer.offset))}default:return this.read_statement()}},read_inner_statements:function(){let s=[];for(;this.token!=this.EOF&&this.token!=="}";){let a=this.read_inner_statement();a&&(Array.isArray(a)?s=s.concat(a):s.push(a))}return s},read_const_list:function(){return this.read_list(function(){this.expect(this.tok.T_STRING);let s=this.node("constant"),a=this.node("identifier"),l=this.text();return this.next(),a=a(l),this.expect("=")?s(a,this.next().read_expr()):s(a,null)},",",!1)},read_declare_list:function(){let s=[];for(;this.token!=this.EOF&&this.token!==")";){this.expect(this.tok.T_STRING);let a=this.node("declaredirective"),l=this.node("identifier"),m=this.text();this.next(),l=l(m);let v=null;if(this.expect("=")&&(v=this.next().read_expr()),s.push(a(l,v)),this.token!==",")break;this.next()}return s},read_inner_statement:function(){let s=[];switch(this.token===this.tok.T_ATTRIBUTE&&(s=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:{let a=this.read_function(!1,!1);return a.attrGroups=s,a}case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:{this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");let a=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),a=a(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),a}default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:{let s=this.node("return");this.next();let a=this.read_optional_expr(";");return this.expectEndOfStatement(),s(a)}case this.tok.T_BREAK:case this.tok.T_CONTINUE:{let s=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();let a=this.read_optional_expr(";");return this.expectEndOfStatement(),s(a)}case this.tok.T_GLOBAL:{let s=this.node("global"),a=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),s(a)}case this.tok.T_STATIC:{let s=[this.token,this.lexer.getState()],a=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(s);let m=this.next().read_expr();return this.expectEndOfStatement(m),a("expressionstatement",m)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);let l=this.read_variable_declarations();return this.expectEndOfStatement(),a("static",l)}case this.tok.T_ECHO:{let s=this.node("echo"),a=this.text(),l=a==="<?="||a==="<%=",m=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),s(m,l)}case this.tok.T_INLINE_HTML:{let s=this.text(),a=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,l=a==="\r"||a===`
`;l&&a===`
`&&this.lexer.yylloc.first_offset>1&&this.lexer._input[this.lexer.yylloc.first_offset-2]==="\r"&&(a=`\r
`);let m=this.node("inline");return this.next(),m(s,l?a+s:s)}case this.tok.T_UNSET:{let s=this.node("unset");this.next().expect("(")&&this.next();let a=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),s(a)}case this.tok.T_DECLARE:{let s=this.node("declare"),a=[],l;this.next().expect("(")&&this.next();let m=this.read_declare_list();if(this.expect(")")&&this.next(),this.token===":"){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)a.push(this.read_top_statement());a.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&a.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),l=this.ast.declare.MODE_SHORT}else if(this.token==="{"){for(this.next();this.token!=this.EOF&&this.token!=="}";)a.push(this.read_top_statement());a.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&a.push(this.node("noop")()),this.expect("}")&&this.next(),l=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),l=this.ast.declare.MODE_NONE;return s(m,a,l)}case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:{let s=this.node("throw"),a=this.next().read_expr();return this.expectEndOfStatement(),s(a)}case";":return this.next(),null;case this.tok.T_STRING:{let s=this.node(),a=[this.token,this.lexer.getState()],l=this.text(),m=this.node("identifier");if(this.next().token===":")return m=m(l),this.next(),s("label",m);m.destroy(),s.destroy(),this.lexer.tokens.push(a);let v=this.node("expressionstatement"),b=this.next().read_expr();return this.expectEndOfStatement(b),v(b)}case this.tok.T_GOTO:{let s=this.node("goto"),a=null;if(this.next().expect(this.tok.T_STRING)){a=this.node("identifier");let l=this.text();this.next(),a=a(l),this.expectEndOfStatement()}return s(a)}default:{let s=this.node("expressionstatement"),a=this.read_expr();return this.expectEndOfStatement(a),s(a)}}},read_code_block:function(s){let a=this.node("block");this.expect("{")&&this.next();let l=s?this.read_top_statements():this.read_inner_statements();return l.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&l.push(this.node("noop")()),this.expect("}")&&this.next(),a(null,l)}},ot={read_variable:function(s,a){let l;if(this.token==="&")return this.read_byref(this.read_variable.bind(this,s,a));if(this.is([this.tok.T_VARIABLE,"$"]))l=this.read_reference_variable(a);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){l=this.node();let m=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&this.token!="("&&["parentreference","selfreference"].indexOf(m.kind)===-1){let v=m.name.toLowerCase();v==="true"?l=m.destroy(l("boolean",!0,m.name)):v==="false"?l=m.destroy(l("boolean",!1,m.name)):v==="null"?l=m.destroy(l("nullkeyword",m.name)):(l.destroy(m),l=m)}else l.destroy(m),l=m}else if(this.token===this.tok.T_STATIC){l=this.node("staticreference");let m=this.text();this.next(),l=l(m)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(l=this.read_static_getter(l,a)),this.recursive_variable_chain_scan(l,s,a)},read_static_getter:function(s,a){let l=this.node("staticlookup"),m,v;return this.next().is([this.tok.T_VARIABLE,"$"])?m=this.read_reference_variable(a):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(m=this.node("identifier"),v=this.text(),this.next(),m=m(v)):this.token==="{"?(m=this.node("literal"),v=this.next().read_expr(),this.expect("}")&&this.next(),m=m("literal",v,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),m=this.node("identifier"),v=this.text(),this.next(),m=m(v)),l(s,m)},read_what:function(){let s=arguments.length>0&&arguments[0]!==void 0&&arguments[0],a=null,l=null;switch(this.next().token){case this.tok.T_STRING:a=this.node("identifier"),l=this.text(),this.next(),a=a(l),s&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:a=this.node("variable"),l=this.text().substring(1),this.next(),a=a(l,!1);break;case"$":a=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),this.token==="{"?(l=this.next().read_expr(),this.expect("}")&&this.next(),a=a("variable",l,!0)):(l=this.read_expr(),a=a("variable",l,!1));break;case"{":a=this.node("encapsedpart"),l=this.next().read_expr(),this.expect("}")&&this.next(),a=a(l,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),a=this.node("identifier"),l=this.text(),this.next(),a=a(l)}return a},recursive_variable_chain_scan:function(s,a,l){let m,v;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(a)return s;s=this.node("call")(s,this.read_argument_list());break;case"[":case"{":{let b=this.token==="[";m=this.node("offsetlookup"),this.next(),v=!1,l?(v=this.read_encaps_var_offset(),this.expect(b?"]":"}")&&this.next()):(b?this.token!=="]":this.token!=="}")?(v=this.read_expr(),this.expect(b?"]":"}")&&this.next()):this.next(),s=m(s,v);break}case this.tok.T_DOUBLE_COLON:s.kind==="staticlookup"&&s.offset.kind==="identifier"&&this.error(),m=this.node("staticlookup"),s=m(s,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:m=this.node("propertylookup"),s=m(s,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:m=this.node("nullsafepropertylookup"),s=m(s,this.read_what());break;default:break t}return s},read_encaps_var_offset:function(){let s=this.node();if(this.token===this.tok.T_STRING){let a=this.text();this.next(),s=s("identifier",a)}else if(this.token===this.tok.T_NUM_STRING){let a=this.text();this.next(),s=s("number",a,null)}else if(this.token==="-"){this.next();let a=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),s=s("number",a,null)}else if(this.token===this.tok.T_VARIABLE){let a=this.text().substring(1);this.next(),s=s("variable",a,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);let a=this.text();this.next(),s=s("identifier",a)}return s},read_reference_variable:function(s){let a,l=this.read_simple_variable();for(;this.token!=this.EOF;){let m=this.node();if(this.token!="{"||s){m.destroy();break}a=this.next().read_expr(),this.expect("}")&&this.next(),l=m("offsetlookup",l,a)}return l},read_simple_variable:function(){let s,a=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)s=this.text().substring(1),this.next(),a=a(s,!1);else switch(this.token==="$"&&this.next(),this.token){case"{":{let l=this.next().read_expr();this.expect("}")&&this.next(),a=a(l,!0);break}case"$":a=a(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:{s=this.text().substring(1);let l=this.node("variable");this.next(),a=a(l(s,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),s=this.text(),this.next(),a=a(s,!1)}return a}};let st=w;function kt(s){return s!="."&&s!=","&&!isNaN(parseFloat(s))&&isFinite(s)}let gt=function(s,a){this.lexer=s,this.ast=a,this.tok=s.tok,this.EOF=s.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=801,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;let l=function(m){return[m,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(l)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(l)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(l)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(l)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(l)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(l)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(l))}};gt.prototype.getTokenName=function(s){return kt(s)?s==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[s]:"'"+s+"'"},gt.prototype.parse=function(s,a){this._errors=[],this.filename=a||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(s),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;let l=this.node("program"),m=[];for(this.next();this.token!=this.EOF;)m.push(this.read_start());m.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&m.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];let v=l(m,this._errors,this._docs,this._tokens);if(this.debug){let b=this.ast.checkNodes();if(b.length>0)throw b.forEach(function(L){L.position&&console.log("Node at line "+L.position.line+", column "+L.position.column),console.log(L.stack.join(`
`))}),new Error("Some nodes are not closed")}return v},gt.prototype.raiseError=function(s,a,l,m){if(s+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){let b=new SyntaxError(s,this.filename,this.lexer.yylloc.first_line);throw b.lineNumber=this.lexer.yylloc.first_line,b.fileName=this.filename,b.columnNumber=this.lexer.yylloc.first_column,b}let v=this.ast.prepare("error",null,this)(s,m,this.lexer.yylloc.first_line,l);return this._errors.push(v),v},gt.prototype.error=function(s){let a="Parse Error : syntax error",l=this.getTokenName(this.token),m="";if(this.token!==this.EOF){if(kt(this.token)){let v=this.text();v.length>10&&(v=v.substring(0,7)+"..."),l="'"+v+"' ("+l+")"}a+=", unexpected "+l}return s&&!Array.isArray(s)&&((kt(s)||s.length===1)&&(m=", expecting "+this.getTokenName(s)),a+=m),this.raiseError(a,m,s,l)},gt.prototype.position=function(){return new st(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},gt.prototype.node=function(s){if(this.extractDoc){let a=null;this._docIndex<this._docs.length&&(a=this._docs.slice(this._docIndex),this._docIndex=this._docs.length,this.debug&&(console.log(new Error("Append docs on "+s)),console.log(a)));let l=this.ast.prepare(s,a,this);return l.postBuild=function(m){if(this._docIndex<this._docs.length)if(this._lastNode){let v=this.prev[2],b=this._docIndex;for(;b<this._docs.length&&!(this._docs[b].offset>v);b++);b>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,b)),this._docIndex=b)}else this.token===this.EOF&&(m.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=m}.bind(this),l}return this.ast.prepare(s,null,this)},gt.prototype.expectEndOfStatement=function(s){if(this.token===";")s&&this.lexer.yytext===";"&&s.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};let qt=["parser.next","parser.node","parser.showlog"];gt.prototype.showlog=function(){let s=new Error().stack.split(`
`),a;for(let l=2;l<s.length;l++){a=s[l].trim();let m=!1;for(let v=0;v<qt.length;v++)if(a.substring(3,3+qt[v].length)===qt[v]){m=!0;break}if(!m)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @-->"+a),this},gt.prototype.expect=function(s){if(Array.isArray(s)){if(s.indexOf(this.token)===-1)return this.error(s),!1}else if(this.token!=s)return this.error(s),!1;return!0},gt.prototype.text=function(){return this.lexer.yytext},gt.prototype.next=function(){if(this.token===";"&&this.lexer.yytext!==";"||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},gt.prototype.peek=function(){let s=this.lexer.getState(),a=this.lexer.lex();return this.lexer.setState(s),a},gt.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;let s=this.lexer.yytext;if(s=Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?[this.lexer.engine.tokens.values[this.token],s,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,s,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(s),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},gt.prototype.is=function(s){return Array.isArray(s)?s.indexOf(this.token)!==-1:this.entries[s].has(this.token)},[{read_array:function(){let s=null,a=!1,l=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),s=")"):(a=!0,s="]");let m=[];return this.next().token!==s&&(m=this.read_array_pair_list(a)),this.expect(s),this.next(),l(a,m)},read_array_pair_list:function(s){let a=this;return this.read_list(function(){return a.read_array_pair(s)},",",!0)},read_array_pair:function(s){if(!s&&this.token===")"||s&&this.token==="]")return;if(this.token===",")return this.node("noop")();let a=this.node("entry"),l=null,m=null,v=!1,b=!1;if(this.token==="&")this.next(),v=!0,m=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),this.token==="&"&&this.error(),b=!0,m=this.read_expr();else{let L=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),l=L,this.token==="&"?(this.next(),v=!0,m=this.read_variable(!0,!1)):m=this.read_expr()):m=L}return a(l,m,v,b)}},{read_class_declaration_statement:function(s){let a=this.node("class"),l=this.read_class_modifiers();if(this.token!==this.tok.T_CLASS)return this.error(this.tok.T_CLASS),this.next(),null;this.next().expect(this.tok.T_STRING);let m=this.node("identifier"),v=this.text();this.next(),m=m(v);let b=this.read_extends_from(),L=this.read_implements_list();this.expect("{");let I=a(m,b,L,this.next().read_class_body(!0,!1),l);return s&&(I.attrGroups=s),I},read_class_modifiers:function(){let s=this.read_class_modifier({readonly:0,final_or_abstract:0});return[0,0,s.final_or_abstract,s.readonly]},read_class_modifier:function(s){return this.token===this.tok.T_READ_ONLY?(this.next(),s.readonly=1,s=this.read_class_modifier(s)):s.final_or_abstract===0&&this.token===this.tok.T_ABSTRACT?(this.next(),s.final_or_abstract=1,s=this.read_class_modifier(s)):s.final_or_abstract===0&&this.token===this.tok.T_FINAL&&(this.next(),s.final_or_abstract=2,s=this.read_class_modifier(s)),s},read_class_body:function(s,a){let l=[],m=[];for(;this.token!==this.EOF&&this.token!=="}";){if(this.token===this.tok.T_COMMENT){l.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){l.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){l=l.concat(this.read_trait_use_statement());continue}if(a&&this.token===this.tok.T_CASE){let L=this.read_enum_case();this.expect(";")&&this.next(),l=l.concat(L);continue}this.token===this.tok.T_ATTRIBUTE&&(m=this.read_attr_list());let v=this.position(),b=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(s&&this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),b[0]=null,b[1]=0),this.token===this.tok.T_FUNCTION)l.push(this.read_function(!1,b,m,v)),m=[];else if(s&&(this.token===this.tok.T_VARIABLE||this.version>=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&(this.token==="?"||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){let L=this.read_variable_list(b,m);m=[],this.expect(";"),this.next(),l=l.concat(L)}else this.error([this.tok.T_CONST,...s?[this.tok.T_VARIABLE]:[],...a?[this.tok.T_CASE]:[],this.tok.T_FUNCTION]),this.next();else{let L=this.read_constant_list(b,m);this.expect(";")&&this.next(),l=l.concat(L)}}return this.expect("}"),this.next(),l},read_variable_list:function(s,a){let l=this.node("propertystatement"),m=this.read_list(function(){let v=this.node("property"),b=!1;this.token===this.tok.T_READ_ONLY&&(b=!0,this.next());let[L,I]=this.read_optional_type();this.expect(this.tok.T_VARIABLE);let H=this.node("identifier"),U=this.text().substring(1);return this.next(),H=H(U),this.token===";"||this.token===","?v(H,null,b,L,I,a||[]):this.token==="="?v(H,this.next().read_expr(),b,L,I,a||[]):(this.expect([",",";","="]),v(H,null,L,I,a||[]))},",");return l(null,m,s)},read_constant_list:function(s,a){this.expect(this.tok.T_CONST)&&this.next();let l=this.node("classconstant"),m=this.read_list(function(){let v=this.node("constant"),b=null,L=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){b=this.node("identifier");let I=this.text();this.next(),b=b(I)}else this.expect("IDENTIFIER");return this.expect("=")&&(L=this.next().read_expr()),v(b,L)},",");return l(null,m,s,a||[])},read_member_flags:function(s){let a=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let l=0,m=0;do{switch(this.token){case this.tok.T_PUBLIC:l=0,m=0;break;case this.tok.T_PROTECTED:l=0,m=1;break;case this.tok.T_PRIVATE:l=0,m=2;break;case this.tok.T_STATIC:l=1,m=1;break;case this.tok.T_ABSTRACT:l=2,m=1;break;case this.tok.T_FINAL:l=2,m=2}s&&(l==0&&m==2?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),m=-1):l==2&&m==1&&(this.error(),m=-1)),a[l]!==-1?this.error():m!==-1&&(a[l]=m)}while(this.next().is("T_MEMBER_FLAGS"))}return a[1]==-1&&(a[1]=0),a[2]==-1&&(a[2]=0),a},read_optional_type:function(){let s=!1;this.token==="?"&&(s=!0,this.next());let a=this.read_types();if(s&&!a&&this.raiseError("Expecting a type definition combined with nullable operator"),!s&&!a)return[!1,null];if(this.token==="|"){a=[a];do{this.next();let l=this.read_type();if(!l){this.raiseError("Expecting a type definition");break}a.push(l)}while(this.token==="|")}return[s,a]},read_interface_declaration_statement:function(s){let a=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);let l=this.node("identifier"),m=this.text();this.next(),l=l(m);let v=this.read_interface_extends_list();return this.expect("{"),a(l,v,this.next().read_interface_body(),s||[])},read_interface_body:function(){let s=[],a=[];for(;this.token!==this.EOF&&this.token!=="}";){if(this.token===this.tok.T_COMMENT){s.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){s.push(this.read_doc_comment());continue}let l=this.position();a=this.read_attr_list();let m=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){let v=this.read_constant_list(m,a);this.expect(";")&&this.next(),s=s.concat(v),a=[]}else if(this.token===this.tok.T_FUNCTION){let v=this.read_function_declaration(2,m,a,l);v.parseFlags(m),s.push(v),this.expect(";")&&this.next(),a=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}return this.expect("}")&&this.next(),s},read_trait_declaration_statement:function(){let s=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);let a=this.node("identifier"),l=this.text();return this.next(),a=a(l),this.expect("{"),s(a,this.next().read_class_body(!0,!1))},read_trait_use_statement:function(){let s=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();let a=[this.read_namespace_name()],l=null;for(;this.token===",";)a.push(this.next().read_namespace_name());if(this.token==="{"){for(l=[];this.next().token!==this.EOF&&this.token!=="}";)l.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return s(a,l)},read_trait_use_alias:function(){let s=this.node(),a,l=null;if(this.is("IDENTIFIER")){a=this.node("identifier");let m=this.text();this.next(),a=a(m)}else if(a=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){l=a,a=this.node("identifier");let m=this.text();this.next(),a=a(m)}else this.expect(this.tok.T_STRING);else a=a.name;if(this.token===this.tok.T_INSTEADOF)return s("traitprecedence",l,a,this.next().read_name_list());if(this.token===this.tok.T_AS){let m=null,v=null;if(this.next().is("T_MEMBER_FLAGS")&&(m=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){v=this.node("identifier");let b=this.text();this.next(),v=v(b)}else m===!1&&this.expect(this.tok.T_STRING);return s("traitalias",l,a,v,m)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),s("traitalias",l,a,null,null)}},{read_comment:function(){let s=this.text(),a=this.ast.prepare(s.substring(0,2)==="/*"?"commentblock":"commentline",null,this),l=this.lexer.yylloc.first_offset,m=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),a=a(s),a.offset=l,this.prev=m,a},read_doc_comment:function(){let s=this.ast.prepare("commentblock",null,this),a=this.lexer.yylloc.first_offset,l=this.text(),m=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),s=s(l),s.offset=a,this.prev=m,s}},R,{read_enum_declaration_statement:function(s){let a=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);let l=this.node("identifier"),m=this.text();this.next(),l=l(m);let v=this.read_enum_value_type(),b=this.read_implements_list();this.expect("{");let L=a(l,v,b,this.next().read_class_body(!1,!0));return s&&(L.attrGroups=s),L},read_enum_value_type:function(){return this.token===":"?this.next().read_namespace_name():null},read_enum_case:function(){this.expect(this.tok.T_CASE);let s=this.node("enumcase"),a=this.node("identifier"),l=this.next().text();this.next(),a=a(l);let m=this.token==="="?this.next().read_expr():null;return this.expect(";"),s(a,m)}},M,{read_if:function(){let s=this.node("if"),a=this.next().read_if_expr(),l=null,m=null,v=!1;if(this.token===":"){v=!0,this.next(),l=this.node("block");let b=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){m=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){m=this.read_else_short();break}b.push(this.read_inner_statement())}l=l(null,b),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else l=this.read_statement(),this.token===this.tok.T_ELSEIF?m=this.read_if():this.token===this.tok.T_ELSE&&(m=this.next().read_statement());return s(a,l,m,v)},read_if_expr:function(){this.expect("(")&&this.next();let s=this.read_expr();return this.expect(")")&&this.next(),s},read_elseif_short:function(){let s=null,a=this.node("if"),l=this.next().read_if_expr();this.expect(":")&&this.next();let m=this.node("block"),v=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){s=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){s=this.read_else_short();break}v.push(this.read_inner_statement())}return a(l,m(null,v),s,!0)},read_else_short:function(){this.next().expect(":")&&this.next();let s=this.node("block"),a=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)a.push(this.read_inner_statement());return s(null,a)}},{read_while:function(){let s=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let a=null,l=null,m=!1;return this.expect("(")&&this.next(),a=this.read_expr(),this.expect(")")&&this.next(),this.token===":"?(m=!0,l=this.read_short_form(this.tok.T_ENDWHILE)):l=this.read_statement(),s(a,l,m)},read_do:function(){let s=this.node("do");this.expect(this.tok.T_DO)&&this.next();let a=null,l=null;return l=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),a=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),s(a,l)},read_for:function(){let s=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let a=[],l=[],m=[],v=null,b=!1;return this.expect("(")&&this.next(),this.token!==";"?(a=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),this.token!==";"?(l=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),this.token!==")"?(m=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),this.token===":"?(b=!0,v=this.read_short_form(this.tok.T_ENDFOR)):v=this.read_statement(),s(a,l,m,v,b)},read_foreach:function(){let s=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let a=null,l=null,m=null,v=null,b=!1;return this.expect("(")&&this.next(),a=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),m=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(l=m,m=this.next().read_foreach_variable())),l&&l.kind==="list"&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),this.token===":"?(b=!0,v=this.read_short_form(this.tok.T_ENDFOREACH)):v=this.read_statement(),s(a,l,m,v,b)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||this.token==="["){let s=this.token==="[",a=this.node("list");this.next(),!s&&this.expect("(")&&this.next();let l=this.read_array_pair_list(s);return this.expect(s?"]":")")&&this.next(),a(l,s)}return this.read_variable(!1,!1)}},{read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}},{read_namespace:function(){let s=this.node("namespace"),a,l;return this.expect(this.tok.T_NAMESPACE)&&this.next(),l=this.token==="{"?{name:[""]}:this.read_namespace_name(),this.currentNamespace=l,this.token===";"?(this.currentNamespace=l,a=this.next().read_top_statements(),this.expect(this.EOF),s(l.name,a,!1)):this.token==="{"?(this.currentNamespace=l,a=this.next().read_top_statements(),this.expect("}")&&this.next(),a.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&a.push(this.node("noop")()),s(l.name,a,!0)):(this.error(["{",";"]),this.currentNamespace=l,a=this.read_top_statements(),this.expect(this.EOF),s(l,a,!1))},read_namespace_name:function(s){let a=this.node(),l,m=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:l=this.ast.name.RELATIVE_NAME,m=m.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:l=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:l=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(l=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return a("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),s||this.token!=="("){if(m.toLowerCase()==="parent")return a("parentreference",m);if(m.toLowerCase()==="self")return a("selfreference",m)}return a("name",m,l)},read_use_statement:function(){let s=this.node("usegroup"),a=[],l=null;this.expect(this.tok.T_USE)&&this.next();let m=this.read_use_type();return a.push(this.read_use_declaration(!1)),this.token===","?a=a.concat(this.next().read_use_declarations(!1)):this.token==="{"&&(l=a[0].name,a=this.next().read_use_declarations(m===null),this.expect("}")&&this.next()),s=s(l,m,a),this.expect(";")&&this.next(),s},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(s){let a=this.node("useitem"),l=null;s&&(l=this.read_use_type());let m=this.read_namespace_name(),v=this.read_use_alias();return a(m.name,v,l)},read_use_declarations:function(s){let a=[this.read_use_declaration(s)];for(;this.token===",";){if(this.next(),s){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;a.push(this.read_use_declaration(s))}return a},read_use_alias:function(){let s=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){let a=this.node("identifier"),l=this.text();this.next(),s=a(l)}return s},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}},W,j,{read_switch:function(){let s=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();let a=this.read_expr();this.expect(")")&&this.next();let l=this.token===":";return s(a,this.read_switch_case_list(),l)},read_switch_case_list:function(){let s=null,a=this.node("block"),l=[];for(this.token==="{"?s="}":this.token===":"?s=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),this.token===";"&&this.next();this.token!==this.EOF&&this.token!==s;)l.push(this.read_case_list(s));return l.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&l.push(this.node("noop")()),this.expect(s)&&this.next(),s===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),a(null,l)},read_case_list:function(s){let a=this.node("case"),l=null;this.token===this.tok.T_CASE?l=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();let m=this.node("block"),v=[];for(;this.token!==this.EOF&&this.token!==s&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)v.push(this.read_inner_statement());return a(l,m(null,v))}},{read_try:function(){this.expect(this.tok.T_TRY);let s=this.node("try"),a=null,l=[],m=this.next().read_statement();for(;this.token===this.tok.T_CATCH;){let v=this.node("catch");this.next().expect("(")&&this.next();let b=this.read_list(this.read_namespace_name,"|",!1),L=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(L=this.read_variable(!0,!1)),this.expect(")"),l.push(v(this.next().read_statement(),b,L))}return this.token===this.tok.T_FINALLY&&(a=this.next().read_statement()),s(m,l,a)}},{read_short_form:function(s){let a=this.node("block"),l=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==s;)l.push(this.read_inner_statement());return l.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&l.push(this.node("noop")()),this.expect(s)&&this.next(),this.expectEndOfStatement(),a(null,l)},read_function_list:function(s,a){let l=[];do{if(this.token==a&&this.version>=703&&l.length>0){l.push(this.node("noop")());break}if(l.push(s.apply(this,[])),this.token!=a||this.next().token==")"&&this.version>=703)break}while(this.token!=this.EOF);return l},read_list:function(s,a,l){let m=[];if(this.token==a&&(l&&m.push(typeof s=="function"?this.node("noop")():null),this.next()),typeof s=="function")do{let v=s.apply(this,[]);if(v&&m.push(v),this.token!=a)break}while(this.next().token!=this.EOF);else{if(!this.expect(s))return[];for(m.push(this.text());this.next().token!=this.EOF&&this.token==a&&this.next().token==s;)m.push(this.text())}return m},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(s){let a=this.node("byref");this.next(),a=a(null);let l=s();return l&&(this.ast.swapLocations(l,a,l,this),l.byref=!0),l},read_variable_declarations:function(){return this.read_list(function(){let s=this.node("staticvariable"),a=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){let l=this.text().substring(1);this.next(),a=a(l,!1)}else a=a("#ERR",!1);return this.token==="="?s(a,this.next().read_expr()):a},",")},read_extends_from:function(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list:function(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list:function(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}},ot].forEach(function(s){for(let a in s){if(Object.prototype.hasOwnProperty.call(gt.prototype,a))throw new Error("Function "+a+" is already defined - collision");gt.prototype[a]=s[a]}});var Vt=gt;let Jt={T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233,T_COALESCE_EQUAL:234,T_FN:235,T_NULLSAFE_OBJECT_OPERATOR:236,T_MATCH:237,T_ATTRIBUTE:238,T_ENUM:239,T_READ_ONLY:240,T_NAME_RELATIVE:241,T_NAME_QUALIFIED:242,T_NAME_FULLY_QUALIFIED:243},fe={values:Object.entries(Jt).reduce((s,a)=>{let[l,m]=a;return{...s,[m]:l}},{}),names:Jt};var Ye=Object.freeze(fe),Zt=function(s,a,l){this.source=s,this.start=a,this.end=l};let Bt=function(s,a,l){this.kind=s,a&&(this.leadingComments=a),l&&(this.loc=l)};Bt.prototype.setTrailingComments=function(s){this.trailingComments=s},Bt.prototype.destroy=function(s){if(!s)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(s.leadingComments?s.leadingComments=Array.concat(this.leadingComments,s.leadingComments):s.leadingComments=this.leadingComments),this.trailingComments&&(s.trailingComments?s.trailingComments=Array.concat(this.trailingComments,s.trailingComments):s.trailingComments=this.trailingComments),s},Bt.prototype.includeToken=function(s){return this.loc&&(this.loc.end&&(this.loc.end.line=s.lexer.yylloc.last_line,this.loc.end.column=s.lexer.yylloc.last_column,this.loc.end.offset=s.lexer.offset),s.ast.withSource&&(this.loc.source=s.lexer._input.substring(this.loc.start.offset,s.lexer.offset))),this},Bt.extends=function(s,a){return a.prototype=Object.create(this.prototype),a.extends=this.extends,a.prototype.constructor=a,a.kind=s,a};var te=Bt;let Ot=te,pe="expression";var Wt=Ot.extends(pe,function(s,a,l){Ot.apply(this,[s||pe,a,l])});let B=Wt,V="array";var Et=B.extends(V,function(s,a,l,m){B.apply(this,[V,l,m]),this.items=a,this.shortForm=s});let Ht=Wt,ne="arrowfunc";var se=Ht.extends(ne,function(s,a,l,m,v,b,L,I){Ht.apply(this,[ne,L,I]),this.arguments=s,this.byref=a,this.body=l,this.type=m,this.nullable=v,this.isStatic=b||!1});let z=Wt,it="assign";var Q=z.extends(it,function(s,a,l,m,v){z.apply(this,[it,m,v]),this.left=s,this.right=a,this.operator=l});let at=Wt,lt="assignref";var ht=at.extends(lt,function(s,a,l,m){at.apply(this,[lt,l,m]),this.left=s,this.right=a});let nt=te,ct="attribute";var At=nt.extends(ct,function(s,a,l,m){nt.apply(this,[ct,l,m]),this.name=s,this.args=a});let Kt=te,Qt="attrgroup";var St=Kt.extends(Qt,function(s,a,l){Kt.apply(this,[Qt,a,l]),this.attrs=s||[]});let Nt=Wt,Yt="operation";var Tt=Nt.extends(Yt,function(s,a,l){Nt.apply(this,[s||Yt,a,l])});let be=Tt;var $e=be.extends("bin",function(s,a,l,m,v){be.apply(this,["bin",m,v]),this.type=s,this.left=a,this.right=l});let Ne=te,Te="statement";var Lt=Ne.extends(Te,function(s,a,l){Ne.apply(this,[s||Te,a,l])});let xi=Lt,wi="block";var Oi=xi.extends(wi,function(s,a,l,m){xi.apply(this,[s||wi,l,m]),this.children=a.filter(Boolean)});let dt=Wt,pn="literal";var ui=dt.extends(pn,function(s,a,l,m,v){dt.apply(this,[s||pn,m,v]),this.value=a,l&&(this.raw=l)});let Ze=ui,Ji="boolean";var li=Ze.extends(Ji,function(s,a,l,m){Ze.apply(this,[Ji,s,a,l,m])});let ci=Lt,D="break";var C=ci.extends(D,function(s,a,l){ci.apply(this,[D,a,l]),this.level=s});let A=Wt,N="byref";var k=A.extends(N,function(s,a,l){A.apply(this,[N,a,l]),this.what=s});let S=Wt,O="call";var G=S.extends(O,function(s,a,l,m){S.apply(this,[O,l,m]),this.what=s,this.arguments=a});let K=Lt,tt="case";var ft=K.extends(tt,function(s,a,l,m){K.apply(this,[tt,l,m]),this.test=s,this.body=a});let Ct=Tt,Rt="cast";var Xt=Ct.extends(Rt,function(s,a,l,m,v){Ct.apply(this,[Rt,m,v]),this.type=s,this.raw=a,this.expr=l});let ee=Lt,re="catch";var ae=ee.extends(re,function(s,a,l,m,v){ee.apply(this,[re,m,v]),this.body=s,this.what=a,this.variable=l});let we=Lt,he="declaration",ti=we.extends(he,function(s,a,l,m){we.apply(this,[s||he,l,m]),this.name=a});ti.prototype.parseFlags=function(s){this.isAbstract=s[2]===1,this.isFinal=s[2]===2,this.isReadonly=s[3]===1,this.kind!=="class"&&(s[0]===-1?this.visibility="":s[0]===null?this.visibility=null:s[0]===0?this.visibility="public":s[0]===1?this.visibility="protected":s[0]===2&&(this.visibility="private"),this.isStatic=s[1]===1)};var Ue=ti;let ei=Ue,dn="class";var Ae=ei.extends(dn,function(s,a,l,m,v,b,L){ei.apply(this,[dn,s,b,L]),this.isAnonymous=!s,this.extends=a,this.implements=l,this.body=m,this.attrGroups=[],this.parseFlags(v)});let Nn=Lt,Yi="constantstatement";var mn=Nn.extends(Yi,function(s,a,l,m){Nn.apply(this,[s||Yi,l,m]),this.constants=a});let mr=mn,gr="classconstant",xr=mr.extends(gr,function(s,a,l,m,v,b){mr.apply(this,[s||gr,a,v,b]),this.parseFlags(l),this.attrGroups=m});xr.prototype.parseFlags=function(s){s[0]===-1?this.visibility="":s[0]===null?this.visibility=null:s[0]===0?this.visibility="public":s[0]===1?this.visibility="protected":s[0]===2&&(this.visibility="private"),this.final=s[2]===2};var _r=xr;let Gt=Wt,We="clone";var Wn=Gt.extends(We,function(s,a,l){Gt.apply(this,[We,a,l]),this.what=s});let Ns=Wt,Er="closure";var ss=Ns.extends(Er,function(s,a,l,m,v,b,L,I){Ns.apply(this,[Er,L,I]),this.uses=l,this.arguments=s,this.byref=a,this.type=m,this.nullable=v,this.isStatic=b||!1,this.body=null,this.attrGroups=[]});let Hn=te;var wt=Hn.extends("comment",function(s,a,l,m){Hn.apply(this,[s,l,m]),this.value=a});let ge=wt,He="commentblock";var xe=ge.extends(He,function(s,a,l){ge.apply(this,[He,s,a,l])});let Xe=wt,Ri="commentline";var ii=Xe.extends(Ri,function(s,a,l){Xe.apply(this,[Ri,s,a,l])});let Xi=te,ni="constant";var Di=Xi.extends(ni,function(s,a,l,m){Xi.apply(this,[ni,l,m]),this.name=s,this.value=a});let Se=Lt,si="continue";var kr=Se.extends(si,function(s,a,l){Se.apply(this,[si,a,l]),this.level=s});let Oe=Oi,Vn="declare",ji=Oe.extends(Vn,function(s,a,l,m,v){Oe.apply(this,[Vn,a,m,v]),this.directives=s,this.mode=l});ji.MODE_SHORT="short",ji.MODE_BLOCK="block",ji.MODE_NONE="none";var Bi=ji;let Gn=te,gn="declaredirective";var nv=Gn.extends(gn,function(s,a,l,m){Gn.apply(this,[gn,l,m]),this.key=s,this.value=a});let Ra=Lt;var sv=Ra.extends("do",function(s,a,l,m){Ra.apply(this,["do",l,m]),this.test=s,this.body=a});let Ba=Lt,Ma="echo";var rv=Ba.extends(Ma,function(s,a,l,m){Ba.apply(this,[Ma,l,m]),this.shortForm=a,this.expressions=s});let Ua=Wt,Wa="empty";var ov=Ua.extends(Wa,function(s,a,l){Ua.apply(this,[Wa,a,l]),this.expression=s});let Ha=ui,Va="encapsed",Is=Ha.extends(Va,function(s,a,l,m,v){Ha.apply(this,[Va,s,a,m,v]),this.type=l});Is.TYPE_STRING="string",Is.TYPE_SHELL="shell",Is.TYPE_HEREDOC="heredoc",Is.TYPE_OFFSET="offset";var av=Is;let Ga=Wt,qa="encapsedpart";var hv=Ga.extends(qa,function(s,a,l,m,v){Ga.apply(this,[qa,m,v]),this.expression=s,this.syntax=a,this.curly=l});let za=Wt,Ja="entry";var uv=za.extends(Ja,function(s,a,l,m,v,b){za.apply(this,[Ja,v,b]),this.key=s,this.value=a,this.byRef=l,this.unpack=m});let Ya=Ue,Xa="enum";var lv=Ya.extends(Xa,function(s,a,l,m,v,b){Ya.apply(this,[Xa,s,v,b]),this.valueType=a,this.implements=l,this.body=m,this.attrGroups=[]});let ja=te,Ka="enumcase";var cv=ja.extends(Ka,function(s,a,l,m){ja.apply(this,[Ka,l,m]),this.name=s,this.value=a});let Qa=te,$a="error";var fv=Qa.extends($a,function(s,a,l,m,v,b){Qa.apply(this,[$a,v,b]),this.message=s,this.token=a,this.line=l,this.expected=m});let Za=Wt,th="eval";var pv=Za.extends(th,function(s,a,l){Za.apply(this,[th,a,l]),this.source=s});let eh=Wt,ih="exit";var dv=eh.extends(ih,function(s,a,l,m){eh.apply(this,[ih,l,m]),this.expression=s,this.useDie=a});let nh=Lt,sh="expressionstatement";var mv=nh.extends(sh,function(s,a,l){nh.apply(this,[sh,a,l]),this.expression=s});let rh=Lt;var gv=rh.extends("for",function(s,a,l,m,v,b,L){rh.apply(this,["for",b,L]),this.init=s,this.test=a,this.increment=l,this.shortForm=v,this.body=m});let oh=Lt,ah="foreach";var xv=oh.extends(ah,function(s,a,l,m,v,b,L){oh.apply(this,[ah,b,L]),this.source=s,this.key=a,this.value=l,this.shortForm=v,this.body=m});let hh=Ue,uh="function";var lh=hh.extends(uh,function(s,a,l,m,v,b,L){hh.apply(this,[uh,s,b,L]),this.arguments=a,this.byref=l,this.type=m,this.nullable=v,this.body=null,this.attrGroups=[]});let ch=Lt,fh="global";var _v=ch.extends(fh,function(s,a,l){ch.apply(this,[fh,a,l]),this.items=s});let ph=Lt,dh="goto";var Ev=ph.extends(dh,function(s,a,l){ph.apply(this,[dh,a,l]),this.label=s});let mh=Lt,gh="halt";var kv=mh.extends(gh,function(s,a,l){mh.apply(this,[gh,a,l]),this.after=s});let xh=te,_h="identifier";var yv=xh.extends(_h,function(s,a,l){xh.apply(this,[_h,a,l]),this.name=s});let Eh=Lt;var vv=Eh.extends("if",function(s,a,l,m,v,b){Eh.apply(this,["if",v,b]),this.test=s,this.body=a,this.alternate=l,this.shortForm=m});let kh=Wt,yh="include";var Tv=kh.extends(yh,function(s,a,l,m,v){kh.apply(this,[yh,m,v]),this.once=s,this.require=a,this.target=l});let vh=ui,Th="inline";var Cv=vh.extends(Th,function(s,a,l,m){vh.apply(this,[Th,s,a,l,m])});let Ch=Ue,Ah="interface";var Av=Ch.extends(Ah,function(s,a,l,m,v,b){Ch.apply(this,[Ah,s,v,b]),this.extends=a,this.body=l,this.attrGroups=m});let bh=Ue,Sh="intersectiontype";var bv=bh.extends(Sh,function(s,a,l){bh.apply(this,[Sh,null,a,l]),this.types=s});let Dh=Wt,Nh="isset";var Sv=Dh.extends(Nh,function(s,a,l){Dh.apply(this,[Nh,a,l]),this.variables=s});let Ih=Lt,Ph="label";var Dv=Ih.extends(Ph,function(s,a,l){Ih.apply(this,[Ph,a,l]),this.name=s});let wh=Wt,Oh="list";var Nv=wh.extends(Oh,function(s,a,l,m){wh.apply(this,[Oh,l,m]),this.items=s,this.shortForm=a});let Lh=Wt,Fh="lookup";var Ps=Lh.extends(Fh,function(s,a,l,m,v){Lh.apply(this,[s||Fh,m,v]),this.what=a,this.offset=l});let Rh=ui,Bh="magic";var Iv=Rh.extends(Bh,function(s,a,l,m){Rh.apply(this,[Bh,s,a,l,m])});let Mh=Wt,Uh="match";var Pv=Mh.extends(Uh,function(s,a,l,m){Mh.apply(this,[Uh,l,m]),this.cond=s,this.arms=a});let Wh=Wt,Hh="matcharm";var wv=Wh.extends(Hh,function(s,a,l,m){Wh.apply(this,[Hh,l,m]),this.conds=s,this.body=a});let Vh=lh,Gh="method";var Ov=Vh.extends(Gh,function(){Vh.apply(this,arguments),this.kind=Gh});let qh=te,zh="reference";var rs=qh.extends(zh,function(s,a,l){qh.apply(this,[s||zh,a,l])});let Jh=rs,Yh="name",ws=Jh.extends(Yh,function(s,a,l,m){Jh.apply(this,[Yh,l,m]),this.name=s.replace(/\\$/,""),this.resolution=a});ws.UNQUALIFIED_NAME="uqn",ws.QUALIFIED_NAME="qn",ws.FULL_QUALIFIED_NAME="fqn",ws.RELATIVE_NAME="rn";var Lv=ws;let Xh=Oi,jh="namespace";var Fv=Xh.extends(jh,function(s,a,l,m,v){Xh.apply(this,[jh,a,m,v]),this.name=s,this.withBrackets=l||!1});let Kh=Wt,Qh="namedargument";var Rv=Kh.extends(Qh,function(s,a,l,m){Kh.apply(this,[Qh,l,m]),this.name=s,this.value=a});let $h=Wt;var Bv=$h.extends("new",function(s,a,l,m){$h.apply(this,["new",l,m]),this.what=s,this.arguments=a});let Zh=te,tu="noop";var Mv=Zh.extends(tu,function(s,a){Zh.apply(this,[tu,s,a])});let eu=ui,iu="nowdoc";var Uv=eu.extends(iu,function(s,a,l,m,v){eu.apply(this,[iu,s,a,m,v]),this.label=l});let nu=te,su="nullkeyword";var Wv=nu.extends(su,function(s,a,l){nu.apply(this,[su,a,l]),this.raw=s});let ru=Ps,ou="nullsafepropertylookup";var Hv=ru.extends(ou,function(s,a,l,m){ru.apply(this,[ou,s,a,l,m])});let au=ui,hu="number";var Vv=au.extends(hu,function(s,a,l,m){au.apply(this,[hu,s,a,l,m])});let uu=Ps,lu="offsetlookup";var Gv=uu.extends(lu,function(s,a,l,m){uu.apply(this,[lu,s,a,l,m])});let cu=Ue,fu="parameter";var qv=cu.extends(fu,function(s,a,l,m,v,b,L,I,H,U){cu.apply(this,[fu,s,H,U]),this.value=l,this.type=a,this.byref=m,this.variadic=v,this.readonly=b,this.nullable=L,this.flags=I||0,this.attrGroups=[]});let pu=rs,du="parentreference";var zv=pu.extends(du,function(s,a,l){pu.apply(this,[du,a,l]),this.raw=s});let mu=Tt,gu="post";var Jv=mu.extends(gu,function(s,a,l,m){mu.apply(this,[gu,l,m]),this.type=s,this.what=a});let xu=Tt;var Yv=xu.extends("pre",function(s,a,l,m){xu.apply(this,["pre",l,m]),this.type=s,this.what=a});let _u=Wt,Eu="print";var Xv=_u.extends(Eu,function(s,a,l){_u.apply(this,[Eu,a,l]),this.expression=s});let ku=Oi,yu="program";var jv=ku.extends(yu,function(s,a,l,m,v,b){ku.apply(this,[yu,s,v,b]),this.errors=a,l&&(this.comments=l),m&&(this.tokens=m)});let vu=Lt,Tu="property";var Kv=vu.extends(Tu,function(s,a,l,m,v,b,L,I){vu.apply(this,[Tu,L,I]),this.name=s,this.value=a,this.readonly=l,this.nullable=m,this.type=v,this.attrGroups=b});let Cu=Ps,Au="propertylookup";var Qv=Cu.extends(Au,function(s,a,l,m){Cu.apply(this,[Au,s,a,l,m])});let bu=Lt,Su="propertystatement",Du=bu.extends(Su,function(s,a,l,m,v){bu.apply(this,[Su,m,v]),this.properties=a,this.parseFlags(l)});Du.prototype.parseFlags=function(s){s[0]===-1?this.visibility="":s[0]===null?this.visibility=null:s[0]===0?this.visibility="public":s[0]===1?this.visibility="protected":s[0]===2&&(this.visibility="private"),this.isStatic=s[1]===1};var $v=Du;let Nu=Wt,Iu="retif";var Zv=Nu.extends(Iu,function(s,a,l,m,v){Nu.apply(this,[Iu,m,v]),this.test=s,this.trueExpr=a,this.falseExpr=l});let Pu=Lt,wu="return";var tT=Pu.extends(wu,function(s,a,l){Pu.apply(this,[wu,a,l]),this.expr=s});let Ou=rs,Lu="selfreference";var eT=Ou.extends(Lu,function(s,a,l){Ou.apply(this,[Lu,a,l]),this.raw=s});let Fu=Wt,Ru="silent";var iT=Fu.extends(Ru,function(s,a,l){Fu.apply(this,[Ru,a,l]),this.expr=s});let Bu=Lt,Mu="static";var nT=Bu.extends(Mu,function(s,a,l){Bu.apply(this,[Mu,a,l]),this.variables=s});let Uu=te,Wu="staticvariable";var sT=Uu.extends(Wu,function(s,a,l,m){Uu.apply(this,[Wu,l,m]),this.variable=s,this.defaultValue=a});let Hu=Ps,Vu="staticlookup";var rT=Hu.extends(Vu,function(s,a,l,m){Hu.apply(this,[Vu,s,a,l,m])});let Gu=rs,qu="staticreference";var oT=Gu.extends(qu,function(s,a,l){Gu.apply(this,[qu,a,l]),this.raw=s});let zu=ui,Ju="string";var aT=zu.extends(Ju,function(s,a,l,m,v,b){zu.apply(this,[Ju,a,m,v,b]),this.unicode=l,this.isDoubleQuote=s});let Yu=Lt,Xu="switch";var hT=Yu.extends(Xu,function(s,a,l,m,v){Yu.apply(this,[Xu,m,v]),this.test=s,this.body=a,this.shortForm=l});let ju=Lt,Ku="throw";var uT=ju.extends(Ku,function(s,a,l){ju.apply(this,[Ku,a,l]),this.what=s});let Qu=Ue,$u="trait";var lT=Qu.extends($u,function(s,a,l,m){Qu.apply(this,[$u,s,l,m]),this.body=a});let Zu=te,tl="traitalias";var cT=Zu.extends(tl,function(s,a,l,m,v,b){Zu.apply(this,[tl,v,b]),this.trait=s,this.method=a,this.as=l,this.visibility="",m&&(m[0]===0?this.visibility="public":m[0]===1?this.visibility="protected":m[0]===2&&(this.visibility="private"))});let el=te,il="traitprecedence";var fT=el.extends(il,function(s,a,l,m,v){el.apply(this,[il,m,v]),this.trait=s,this.method=a,this.instead=l});let nl=te,sl="traituse";var pT=nl.extends(sl,function(s,a,l,m){nl.apply(this,[sl,l,m]),this.traits=s,this.adaptations=a});let rl=Lt;var dT=rl.extends("try",function(s,a,l,m,v){rl.apply(this,["try",m,v]),this.body=s,this.catches=a,this.always=l});let ol=rs,al="typereference",hl=ol.extends(al,function(s,a,l,m){ol.apply(this,[al,l,m]),this.name=s,this.raw=a});hl.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var mT=hl;let ul=Tt,ll="unary";var gT=ul.extends(ll,function(s,a,l,m){ul.apply(this,[ll,l,m]),this.type=s,this.what=a});let cl=Ue,fl="uniontype";var xT=cl.extends(fl,function(s,a,l){cl.apply(this,[fl,null,a,l]),this.types=s});let pl=Lt,dl="unset";var _T=pl.extends(dl,function(s,a,l){pl.apply(this,[dl,a,l]),this.variables=s});let ml=Lt,gl="usegroup";var ET=ml.extends(gl,function(s,a,l,m,v){ml.apply(this,[gl,m,v]),this.name=s,this.type=a,this.items=l});let xl=Lt,_l="useitem",Oo=xl.extends(_l,function(s,a,l,m,v){xl.apply(this,[_l,m,v]),this.name=s,this.alias=a,this.type=l});Oo.TYPE_CONST="const",Oo.TYPE_FUNCTION="function";var kT=Oo;let El=Wt,kl="variable";var yT=El.extends(kl,function(s,a,l,m){El.apply(this,[kl,l,m]),this.name=s,this.curly=a||!1});let yl=Wt,vl="variadic";var vT=yl.extends(vl,function(s,a,l){yl.apply(this,[vl,a,l]),this.what=s});let Tl=te,Cl="variadicplaceholder";var TT=Tl.extends(Cl,function(s,a){Tl.apply(this,[Cl,s,a])});let Al=Lt,bl="while";var CT=Al.extends(bl,function(s,a,l,m,v){Al.apply(this,[bl,m,v]),this.test=s,this.body=a,this.shortForm=l});let Sl=Wt,Dl="yield";var AT=Sl.extends(Dl,function(s,a,l,m){Sl.apply(this,[Dl,l,m]),this.value=s,this.key=a});let Nl=Wt,Il="yieldfrom";var bT=Nl.extends(Il,function(s,a,l){Nl.apply(this,[Il,a,l]),this.value=s});let ST=Zt,DT=w,ri=function(s,a){this.withPositions=s,this.withSource=a};ri.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach(function(s,a){s.forEach(function(l){ri.precedence[l]=a+1})}),ri.prototype.isRightAssociative=function(s){return s==="**"||s==="??"},ri.prototype.swapLocations=function(s,a,l,m){this.withPositions&&(s.loc.start=a.loc.start,s.loc.end=l.loc.end,this.withSource&&(s.loc.source=m.lexer._input.substring(s.loc.start.offset,s.loc.end.offset)))},ri.prototype.resolveLocations=function(s,a,l,m){this.withPositions&&(s.loc.start.offset>a.loc.start.offset&&(s.loc.start=a.loc.start),s.loc.end.offset<l.loc.end.offset&&(s.loc.end=l.loc.end),this.withSource&&(s.loc.source=m.lexer._input.substring(s.loc.start.offset,s.loc.end.offset)))},ri.prototype.resolvePrecedence=function(s,a){let l,m,v;return s.kind==="call"?this.resolveLocations(s,s.what,s,a):s.kind==="propertylookup"||s.kind==="staticlookup"||s.kind==="offsetlookup"&&s.offset?this.resolveLocations(s,s.what,s.offset,a):s.kind==="bin"?s.right&&!s.right.parenthesizedExpression&&(s.right.kind==="bin"?(m=ri.precedence[s.type],v=ri.precedence[s.right.type],m&&v&&v<=m&&(s.type!==s.right.type||!this.isRightAssociative(s.type))&&(l=s.right,s.right=s.right.left,this.swapLocations(s,s.left,s.right,a),l.left=this.resolvePrecedence(s,a),this.swapLocations(l,l.left,l.right,a),s=l)):s.right.kind==="retif"&&(m=ri.precedence[s.type],v=ri.precedence["?"],m&&v&&v<=m&&(l=s.right,s.right=s.right.test,this.swapLocations(s,s.left,s.right,a),l.test=this.resolvePrecedence(s,a),this.swapLocations(l,l.test,l.falseExpr,a),s=l))):s.kind!=="silent"&&s.kind!=="cast"||!s.expr||s.expr.parenthesizedExpression?s.kind==="unary"?s.what&&!s.what.parenthesizedExpression&&(s.what.kind==="bin"?(l=s.what,s.what=s.what.left,this.swapLocations(s,s,s.what,a),l.left=this.resolvePrecedence(s,a),this.swapLocations(l,l.left,l.right,a),s=l):s.what.kind==="retif"&&(l=s.what,s.what=s.what.test,this.swapLocations(s,s,s.what,a),l.test=this.resolvePrecedence(s,a),this.swapLocations(l,l.test,l.falseExpr,a),s=l)):s.kind==="retif"?s.falseExpr&&s.falseExpr.kind==="retif"&&!s.falseExpr.parenthesizedExpression&&(l=s.falseExpr,s.falseExpr=l.test,this.swapLocations(s,s.test,s.falseExpr,a),l.test=this.resolvePrecedence(s,a),this.swapLocations(l,l.test,l.falseExpr,a),s=l):s.kind==="assign"?s.right&&s.right.kind==="bin"&&!s.right.parenthesizedExpression&&(m=ri.precedence["="],v=ri.precedence[s.right.type],m&&v&&v<m&&(l=s.right,s.right=s.right.left,l.left=s,this.swapLocations(l,l.left,s.right,a),s=l)):s.kind==="expressionstatement"&&this.swapLocations(s,s.expression,s,a):s.expr.kind==="bin"?(l=s.expr,s.expr=s.expr.left,this.swapLocations(s,s,s.expr,a),l.left=this.resolvePrecedence(s,a),this.swapLocations(l,l.left,l.right,a),s=l):s.expr.kind==="retif"&&(l=s.expr,s.expr=s.expr.test,this.swapLocations(s,s,s.expr,a),l.test=this.resolvePrecedence(s,a),this.swapLocations(l,l.test,l.falseExpr,a),s=l),s},ri.prototype.prepare=function(s,a,l){let m=null;(this.withPositions||this.withSource)&&(m=l.position());let v=this,b=function(){let L=null,I=Array.prototype.slice.call(arguments);if(I.push(a),v.withPositions||v.withSource){let P=null;v.withSource&&(P=l.lexer._input.substring(m.offset,l.prev[2])),L=new ST(P,m,new DT(l.prev[0],l.prev[1],l.prev[2])),I.push(L)}s||(s=I.shift());let H=v[s];if(typeof H!="function")throw new Error('Undefined node "'+s+'"');let U=Object.create(H.prototype);return H.apply(U,I),b.instance=U,b.trailingComments&&(U.trailingComments=b.trailingComments),typeof b.postBuild=="function"&&b.postBuild(U),l.debug&&delete v.stack[b.stackUid],v.resolvePrecedence(U,l)};return l.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:m,stack:new Error().stack.split(`
`).slice(3,5)},b.stackUid=this.stackUid),b.setTrailingComments=function(L){b.instance?b.instance.setTrailingComments(L):b.trailingComments=L},b.destroy=function(L){a&&(L?L.leadingComments?L.leadingComments=a.concat(L.leadingComments):L.leadingComments=a:l._docIndex=l._docs.length-a.length),l.debug&&delete v.stack[b.stackUid]},b},ri.prototype.checkNodes=function(){let s=[];for(let a in this.stack)Object.prototype.hasOwnProperty.call(this.stack,a)&&(this.stack[a].key=a,s.push(this.stack[a]));return this.stack={},s},[Et,se,Q,ht,At,St,$e,Oi,li,C,k,G,ft,Xt,ae,Ae,_r,Wn,ss,wt,xe,ii,Di,mn,kr,Ue,Bi,nv,sv,rv,ov,av,hv,uv,lv,cv,fv,pv,dv,Wt,mv,gv,xv,lh,_v,Ev,kv,yv,vv,Tv,Cv,Av,bv,Sv,Dv,Nv,ui,Ps,Iv,Pv,wv,Ov,Lv,Fv,Rv,Bv,te,Mv,Uv,Wv,Hv,Vv,Gv,Tt,qv,zv,Jv,Yv,Xv,jv,Kv,Qv,$v,rs,Zv,tT,eT,iT,Lt,nT,sT,rT,oT,aT,hT,uT,lT,cT,fT,pT,dT,mT,gT,xT,_T,ET,kT,yT,vT,TT,CT,AT,bT].forEach(function(s){ri.prototype[s.kind]=s});let Pl=T,wl=Vt,Ol=Ye,Ll=ri;function Lo(s,a){let l=Object.keys(s),m=l.length;for(;m--;){let v=l[m],b=s[v];b===null?delete a[v]:typeof b=="function"?a[v]=b.bind(a):Array.isArray(b)?a[v]=Array.isArray(a[v])?a[v].concat(b):b:a[v]=typeof b=="object"&&typeof a[v]=="object"?Lo(b,a[v]):b}return a}let _i=function(s){if(typeof this=="function")return new this(s);if(this.tokens=Ol,this.lexer=new Pl(this),this.ast=new Ll,this.parser=new wl(this.lexer,this.ast),s&&typeof s=="object"){if(s.parser&&(s.lexer||(s.lexer={}),s.parser.version)){if(typeof s.parser.version=="string"){let a=s.parser.version.split(".");if(a=100*parseInt(a[0])+parseInt(a[1]),isNaN(a))throw new Error("Bad version number : "+s.parser.version);s.parser.version=a}else if(typeof s.parser.version!="number")throw new Error("Expecting a number for version");if(s.parser.version<500||s.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}Lo(s,this),this.lexer.version=this.parser.version}},Fo=function(s){return typeof s.write=="function"?s.toString():s};_i.create=function(s){return new _i(s)},_i.parseEval=function(s,a){return new _i(a).parseEval(s)},_i.prototype.parseEval=function(s){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,s=Fo(s),this.parser.parse(s,"eval")},_i.parseCode=function(s,a,l){return typeof a!="object"||l||(l=a,a="unknown"),new _i(l).parseCode(s,a)},_i.prototype.parseCode=function(s,a){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,s=Fo(s),this.parser.parse(s,a)},_i.tokenGetAll=function(s,a){return new _i(a).tokenGetAll(s)},_i.prototype.tokenGetAll=function(s){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,s=Fo(s);let a=this.lexer.EOF,l=this.tokens.values;this.lexer.setInput(s);let m=this.lexer.lex()||a,v=[];for(;m!=a;){let b=this.lexer.yytext;Object.prototype.hasOwnProperty.call(l,m)&&(b=[l[m],b,this.lexer.yylloc.first_line]),v.push(b),m=this.lexer.lex()||a}return v},h.exports=_i,h.exports.tokens=Ol,h.exports.lexer=Pl,h.exports.AST=Ll,h.exports.parser=wl,h.exports.combine=Lo,h.exports.Engine=_i,h.exports.default=_i;var NT=i(h.exports);function Fl(s,a){let l=a&&a.parentParser==="markdown";if(!s&&l)return"";s=s.replace(/\?>\n<\?/g,`?>
___PSEUDO_INLINE_PLACEHOLDER___<?`);let m=new NT({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),v=s.indexOf("<?php")!==-1,b=l&&!v,L;try{L=b?m.parseEval(s):m.parseCode(s)}catch(I){throw I instanceof SyntaxError&&"lineNumber"in I&&(I.loc={start:{line:I.lineNumber,column:I.columnNumber}},delete I.lineNumber,delete I.columnNumber),I}return L.extra={parseAsEval:b},L.comments.forEach(I=>{I.value[I.value.length-1]===`
`&&(I.value=I.value.slice(0,-1),I.loc.end.offset=I.loc.end.offset-1)}),L}let Rl=s=>a=>a.loc?.[s]?.offset,Ei=Rl("start"),ye=Rl("end"),{hasNewline:IT,skipEverythingButNewLine:PT,skipNewline:wT}=t.util;function Bl(s){return s.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/,"$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e)/,"")}let OT=new Map([["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].flatMap((s,a)=>s.map(l=>[l,a])));function yr(s){return OT.get(s)}let Ml=["==","!=","===","!==","<>","<=>"],vr=["*","/","%"],Ro=[">>","<<"];function Bo(s,a){return yr(a)===yr(s)&&s!=="**"&&(!Ml.includes(s)||!Ml.includes(a))&&!(a==="%"&&vr.includes(s)||s==="%"&&vr.includes(a))&&(a===s||!vr.includes(a)||!vr.includes(s))&&(!Ro.includes(s)||!Ro.includes(a))}function Os(s){let a=s.children||s.body||s.adaptations;return Array.isArray(a)?a:null}function Mi(s){return s.length>0?s[s.length-1]:null}function Ls(s){let{node:a}=s;if(a.kind==="program"){let m=Os(a);return!(!m||m.length===0)&&m[0].kind==="inline"}if(a.kind==="switch"){if(!a.body)return!1;let m=Os(a.body);if(m.length===0)return!1;let[v]=m;if(!v.body)return!1;let b=Os(v.body);return b.length!==0&&b[0].kind==="inline"}let l=function(m){let{body:v}=m;return v?(v.kind==="block"&&(v=v.children),v[0]):null}(a);return!!l&&l.kind==="inline"}function Mo(s){return s.kind==="nowdoc"||s.kind==="encapsed"&&s.type==="heredoc"}function Tr(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=s.getNode(a),m=s.getNode(a+1),v=s.getNode(a+2);if(!m)return!1;if(v&&["call","new","echo"].includes(v.kind)&&!["call","array"].includes(m.kind)||m.kind==="parameter"){let b=v.arguments.length-1;return v.arguments.indexOf(m)!==b}if(v&&v.kind==="for"){let b=v.init.indexOf(m);if(b!==-1)return b!==v.init.length-1;let L=v.test.indexOf(m);if(L!==-1)return L!==v.test.length-1;let I=v.increment.indexOf(m);if(I!==-1)return I!==v.increment.length-1}if(m.kind==="bin")return m.left===l||Tr(s,a+1);if(m.kind==="case"&&m.test===l)return!0;if(m.kind==="staticvariable"){let b=v.variables.length-1;return v.variables.indexOf(m)!==b}if(m.kind==="entry"){if(m.key===l)return!0;let b=v.items.length-1;return v.items.indexOf(m)!==b}if(["call","new"].includes(m.kind)){let b=m.arguments.length-1;return m.arguments.indexOf(l)!==b}if(m.kind==="echo"){let b=m.expressions.length-1;return m.expressions.indexOf(l)!==b}if(m.kind==="array"){let b=m.items.length-1;return m.items.indexOf(l)!==b}return m.kind==="retif"&&Tr(s,a+1)}function Ul(s){let a=s.replace(/^\\/,"");return a.indexOf("\\")!==-1?a:s}function Ni(s){return s.comments&&s.comments.some(a=>!a.leading&&!a.trailing)}function fi(s){return s.kind==="propertylookup"||s.kind==="nullsafepropertylookup"||s.kind==="staticlookup"||s.kind==="offsetlookup"}function LT(s){let{node:a}=s;return!["try","catch"].includes(a.kind)&&Ls(s)}function FT(s){let{node:a}=s;if(["try","catch"].includes(a.kind))return!0;if(a.kind==="switch"){let l=Os(a.body);if(l.length===0)return!0;let m=Mi(l);if(!m.body)return!0;let v=Os(m.body);return v.length===0||v[0].kind!=="inline"}return!Ls(s)}function Uo(s){return["program","declare","namespace"].includes(s.kind)}function Wo(s){return["name","parentreference","selfreference","staticreference"].includes(s.kind)}function os(s){return s.kind==="bin"&&["||","&&"].includes(s.type)?"logical":s.kind}function Wl(s){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"body",{node:l}=s;return l[a]&&l[a].children&&l[a].children.length===0&&(!l[a].comments||l[a].comments.length===0)}function RT(s,a){let l=Ei(a);return l=PT(s,l),l=wT(s,l),IT(s,l)}function Hl(s){return s.kind==="nowdoc"||s.kind==="encapsed"&&s.type==="heredoc"||s.kind==="entry"&&(s.value.kind==="nowdoc"||s.value.kind==="encapsed"&&s.value.type==="heredoc")}function Ho(s,a){let l=function(m,v){let b=[].concat(v),L,I=-1;for(;L=m.getParentNode(++I);)if(b.indexOf(L.kind)!==-1)return I;return-1}(s,a);return l===-1?null:s.getParentNode(l)}let Vl=new Map(["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].map(s=>[s.toLowerCase(),s]));function Gl(s){let a=s.toLowerCase();return Vl.has(a)?Vl.get(a):s}let{addLeadingComment:Ui,addDanglingComment:ki,addTrailingComment:Wi,skipNewline:BT,hasNewline:Cr,hasNewlineInRange:MT,getNextNonSpaceNonCommentCharacterIndex:Fs,isNextLineEmpty:UT,isPreviousLineEmpty:WT}=t.util,{join:ql,indent:HT,hardline:Ki,cursor:zl,lineSuffix:Jl,breakParent:VT}=t.doc.builders;function Ar(s,a){let{children:l}=s;l.length===0?ki(s,a):Ui(l[0],a)}function Vo(s,a){s.kind==="block"?Ar(s,a):Ui(s,a)}function Yl(s,a,l,m,v){let b=Fs(s,ye(v)),L=s.charAt(b);return a&&a.kind==="identifier"&&l&&(l.kind==="function"||l.kind==="method")&&L===")"?(Wi(l,v),!0):!(!l||l.kind!=="function"&&l.kind!=="method"||!m||m.kind!=="block")&&(Ar(m,v),!0)}function Go(s,a,l,m,v){if(!l||l.kind!=="if"||!m)return!1;let b=Fs(s,ye(v));return s.charAt(b)===")"?(Wi(a,v),!0):a===l.body&&m===l.alternate?(ki(l,v),!0):m.kind==="if"?(Vo(m.body,v),!0):l.body===m&&(Ui(m,v),!0)}function qo(s,a,l){if(s&&["class","interface","trait"].includes(s.kind)){if(s.__parent_new_arguments?.includes(a))return!1;if(a&&s.extends){if(Array.isArray(s.extends)){if(s.extends.some(m=>{if(a&&a===m)return ki(a,l),!0}))return!0}else if(a===s.extends)return ki(a,l),!0}if(a&&s.implements&&s.implements.some(m=>{if(a&&a===m)return ki(a,l),!0}))return!0;if(!(s.body&&s.body.length>0))return ki(s,l),!0}return!!(a&&a.kind==="class"&&a.isAnonymous&&a.leadingComments&&l.kind==="commentblock")}function zo(s,a,l,m){if(a&&(a.kind==="function"||a.kind==="method")){let v=0;for(let I=0;I<a.arguments.length;I++)v=ye(a.arguments[I])>v?ye(a.arguments[I]):v;let b=a.body&&Ei(m)>v&&ye(m)<Ei(a.body),L=Fs(s,ye(m));if(a.type&&b&&s.charAt(L)!==")")return ye(m)<Ei(a.type)?(ki(a.type,m),!0):(Wi(a.type,m),!0)}return!1}function Jo(s,a,l,m,v){return!(!l||!["function","method","parameter"].includes(l.kind))&&a.kind==="typereference"&&m.kind==="identifier"&&(Wi(a,v),!0)}function Xl(s,a){return!(!s||!["label","goto"].includes(s.kind))&&(Wi(s,a),!0)}function Yo(s,a,l,m){return l&&l.kind==="inline"?(l.leadingComments||(l.leadingComments=[]),l.leadingComments.includes(m)||l.leadingComments.push(m),!0):!(s||l||!a||a.kind!=="inline")&&(ki(a,m),!0)}function jl(s,a,l){return!(!s||s.kind!=="try"||!a)&&(a.kind==="block"?(Ar(a,l),!0):a.kind==="try"?(Vo(a.always,l),!0):a.kind==="catch"&&(Vo(a.body,l),!0))}function Kl(s,a,l,m){return l||a||!s||s.kind!=="namespace"||s.withBrackets?!(a||!s||s.kind!=="namespace"||s.withBrackets)&&(ki(s,m),!0):(Wi(s,m),!0)}function Ql(s,a,l,m){return!(!s||s.kind!=="declare")&&(!a||a.kind!=="noop")&&(l&&s.directives[0]!==l?!(!l||!a)&&(Ui(l,m),!0):(s.mode==="none"?Wi(s,m):ki(s,m),!0))}function Xo(s,a,l,m,v){if(!l||l.kind!=="while"||!m)return!1;let b=Fs(s,ye(v));return s.charAt(b)===")"?(Wi(a,v),!0):m.kind==="block"&&(Ar(m,v),!0)}function jo(s,a){return s.node.printed=!0,a.printer.printComment(s,a)}function Le(s,a,l,m){let v=[],b=s.getValue();return b&&b.comments?(s.each(()=>{let L=s.node;!L||L.leading||L.trailing||m&&!m(L)||v.push(jo(s,a))},"comments"),v.length===0?"":l?ql(Ki,v):HT([Ki,ql(Ki,v)])):""}function Rs(s){return s.comments&&s.comments.some(a=>a.leading)}function Bs(s){return s.comments&&s.comments.some(a=>a.trailing)}function qn(s,a){let l=[];return s.forEach((m,v,b)=>{m.printed=!0;let L=b.length===v+1;l.push(m.value),L||l.push(Ki),UT(a.originalText,ye(m))&&!L&&l.push(Ki)}),l}function Ko(s){return s.kind==="commentblock"}function $l(s,a,l){let{node:m}=s;return m&&m===a.cursorNode?[zl,l,zl]:l}function Qo(s,a,l,m){let{node:v}=s,b=a(s),L=v&&v.comments;if(!L||L.length===0)return $l(s,l,b);let I=[],H=[m?";":"",b];return s.each(U=>{let{node:P}=U,{leading:q,trailing:$}=P;if(q){let et=function(pt,xt,It){let Dt=jo(pt,It);if(!Dt)return"";let Mt=pt.node;return It.printer.isBlockComment&&It.printer.isBlockComment(Mt)?[Dt,Cr(It.originalText,ye(Mt))?Ki:" "]:[Dt,Ki]}(s,0,l);if(!et)return;I.push(et);let Y=l.originalText;Cr(Y,BT(Y,ye(P)))&&I.push(Ki)}else $&&H.push(function(et,Y,pt){let xt=jo(et,pt);if(!xt)return"";let It=et.node,Dt=pt.printer.isBlockComment&&pt.printer.isBlockComment(It);if(Cr(pt.originalText,Ei(It),{backwards:!0})){let Mt=WT(pt.originalText,Ei(It));return Jl([Ki,Mt?Ki:"",xt])}return Dt?[" ",xt]:[Jl([" ",xt]),Dt?"":VT]}(s,0,l))},"comments"),$l(s,l,I.concat(H))}function Zl(s){let{parent:a}=s;if(!a)return!1;let{key:l,node:m}=s;if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(a.kind))return!1;switch(m.kind){case"pre":case"post":if(a.kind==="unary")return m.kind==="pre"&&(m.type==="+"&&a.type==="+"||m.type==="-"&&a.type==="-");case"unary":switch(a.kind){case"unary":return m.type===a.type&&(m.type==="+"||m.type==="-");case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return l==="what";case"bin":return a.type==="**"&&l==="left";default:return!1}case"bin":switch(a.kind){case"assign":case"retif":return["and","xor","or"].includes(m.type);case"silent":case"cast":return m.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return l==="what";case"bin":{let b=a.type,L=yr(b),I=m.type,H=yr(I);return L>H||b==="||"&&I==="&&"||L===H&&l==="right"||L===H&&!Bo(b,I)||(L<H&&I==="%"?b==="+"||b==="-":!(!Ro[v=b]&&v!=="|"&&v!=="^"&&v!=="&"))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return a.kind==="call"&&l==="what"&&m.parenthesizedExpression;case"clone":case"new":switch(a.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return l==="what";default:return!1}case"yield":switch(a.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return l==="what";case"retif":return l==="test";default:return!(!m.key&&!m.value)}case"assign":return(a.kind!=="for"||!a.init.includes(m)&&!a.increment.includes(m))&&a.kind!=="assign"&&a.kind!=="static"&&!["if","do","while","foreach","switch"].includes(a.kind)&&a.kind!=="silent"&&a.kind!=="call";case"retif":switch(a.kind){case"cast":return!0;case"unary":case"bin":case"retif":return!(l==="test"&&!a.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return l==="what";default:return!1}case"closure":switch(a.kind){case"call":return l==="what";case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return m.parenthesizedExpression;case"string":case"array":switch(a.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(m.kind)||a.kind!=="offsetlookup")&&l==="what";default:return!1}case"print":case"include":return a.kind==="bin"}var v;return!1}let{breakParent:tc,join:Ve,line:ue,lineSuffix:GT,group:yt,conditionalGroup:as,indent:bt,dedent:qT,ifBreak:zn,hardline:mt,softline:jt,literalline:hs,align:zT,dedentToRoot:JT}=t.doc.builders,{willBreak:In}=t.doc.utils,{isNextLineEmptyAfterIndex:YT,hasNewline:XT,hasNewlineInRange:ec,getNextNonSpaceNonCommentCharacterIndex:jT,isNextLineEmpty:Jn,isPreviousLineEmpty:KT}=t.util;function us(s,a){return parseFloat(s)>=parseFloat(a)}function Ms(s,a){return!!s.trailingCommaPHP&&us(s.phpVersion,a)}function $o(s){return s.braceStyle!=="1tbs"}function Zo(s,a,l){return[arguments.length>3&&arguments[3]!==void 0&&arguments[3]?"?":"","->",l("offset")]}function ic(s,a,l){return Zo(s,a,l,!0)}function nc(s,a,l){let{node:m}=s,v=!["variable","identifier"].includes(m.offset.kind);return["::",v?"{":"",l("offset"),v?"}":""]}function sc(s,a,l){let{node:m}=s,v=m.offset&&m.offset.kind==="number"||Ho(s,"encapsed");return["[",m.offset?yt([bt([v?"":jt,l("offset")]),v?"":jt]):"","]"]}function rc(s){return s.kind==="array"&&(s.items.length>0||s.comments)||s.kind==="function"||s.kind==="method"||s.kind==="closure"}function Qi(s,a,l){let m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"arguments",v=s.node[m];if(v.length===0)return["(",Le(s,a,!0),")"];let b=!1,L=!1,I=s.map(et=>{let{node:Y,isLast:pt,isFirst:xt}=et,It=[l()];return pt||(Jn(a.originalText,ye(Y))?(xt&&(L=!0),b=!0,It.push(",",mt,mt)):It.push(",",ue)),It},m),{node:H}=s,U=Mi(v),P=Ms(a,"7.3")&&["call","new","unset","isset"].includes(H.kind)||Ms(a,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(H.kind)?bt([U&&Hl(U)?mt:"",","]):"",q=function(et){if(et.length!==2)return!1;let[Y,pt]=et;return!(Y.comments&&Y.comments.length||Y.kind!=="function"&&Y.kind!=="method"&&Y.kind!=="closure"||pt.kind==="retif"||rc(pt))}(v),$=function(et){let Y=Mi(et),pt=(xt=et).length>1?xt[xt.length-2]:null;var xt;return!Rs(Y)&&!Bs(Y)&&rc(Y)&&(!pt||pt.kind!==Y.kind)}(v);if(q||$){let et=(q?I.slice(1).some(In):I.slice(0,-1).some(In))||b,Y;s.each(It=>{let{isLast:Dt,isFirst:Mt}=It;q&&Mt&&(Y=[l([],{expandFirstArg:!0}),I.length>1?",":"",L?mt:ue,L?mt:"",I.slice(1)]),$&&Dt&&(Y=[...I.slice(0,-1),l([],{expandLastArg:!0})])},m);let pt=I.some(In),xt=["(",...Y,")"];return[pt?tc:"",as([pt?zn(yt(["(",bt([ue,...I]),P,ue,")"],{shouldBreak:!0}),xt):xt,q?["(",yt(Y[0],{shouldBreak:!0}),...Y.slice(1),")"]:["(",...I.slice(0,-1),yt(Mi(Y),{shouldBreak:!0}),")"],yt(["(",bt([ue,...I]),zn(P),ue,")"],{shouldBreak:!0})],{shouldBreak:et})]}return yt(["(",bt([jt,...I]),zn(P),jt,")"],{shouldBreak:I.some(In)||b})}function oc(s){return s.kind==="array"&&s.items.length!==0}function Us(s){return s.right.kind==="array"&&s.right.items.length!==0}function ac(s,a,l,m,v){let b=[],{node:L}=s;if(L.kind==="bin"){Bo(L.type,L.left.type)?b=b.concat(s.call(()=>ac(s,a,l,!0,v),"left")):b.push(a("left"));let I=Us(L)?[L.type," ",a("right")]:[L.type,ue,a("right")],{parent:H}=s,U=!(v&&["||","&&"].includes(L.type))&&os(H)!==os(L)&&os(L.left)!==os(L)&&os(L.right)!==os(L),P=Mo(L.left)||L.left.kind==="bin"&&Mo(L.left.right);b.push(P?"":" ",U?yt(I):I),m&&L.comments&&(b=Qo(s,()=>b,l))}else b.push(a());return b}function hc(s,a,l){let{node:m}=s;switch(m.kind){case"propertylookup":return Zo(s,a,l);case"nullsafepropertylookup":return ic(s,a,l);case"staticlookup":return nc(s,0,l);case"offsetlookup":return sc(s,0,l);default:throw new Error(`Have not implemented lookup kind ${m.kind} yet.`)}}function uc(s){let{opening:a=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s.type==="heredoc")return a?`<<<${s.label}`:s.label;let l={string:'"',shell:"`"};if(l[s.type])return l[s.type];throw new Error(`Unimplemented encapsed type ${s.type}`)}function QT(s,a,l){let m=[],v=[];return s.each(b=>{let{node:L}=b;m.push(v),m.push(yt(l())),v=[",",ue],L&&Jn(a.originalText,ye(L))&&v.push(jt)},"items"),m}function Ws(s,a,l){let m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"children",{node:v,parent:b}=s,L=-1,I=[],H=[];s.map(()=>{let{node:P,next:q,isFirst:$,isLast:et,index:Y}=s,pt=P.kind==="inline",xt=l(),It=!et&&!pt&&(q&&q.kind==="case"?!Ls(s):q&&q.kind!=="inline"),Dt=[xt,It?mt:"",It&&Jn(a.originalText,ye(P))?mt:""],Mt=v.kind==="block"&&b&&["function","closure","method","try","catch"].includes(b.kind),zt=Mt&&$?"":" ";if(pt||!pt&&et&&L>=0){let yi=L;if(pt&&(L=Y),pt&&!$||!pt&&et){let Hi=(pt?yi:L)+1,vi=et&&!pt?Y+1:Y,$i=s.siblings[pt?yi:L],ls=$i?function(cs){let Gs=cs.split(`
`).pop();return Gs.length-Gs.trimLeft().length+1}($i.raw):"",Hs=vi-Hi>1,Nr=Hs?Mt&&!$i||Uo(v)&&Hi===0?"":mt:"",Vs=Hs&&P.kind!=="halt"?Mt&&et?"":mt:"";Hs&&(zt=""),H.push({start:Hi,end:vi,alignment:ls,before:Nr,after:Vs})}}if(pt){let yi=q&&q.kind==="echo"&&q.shortForm?"<?=":"<?php",Hi=P.leadingComments&&P.leadingComments.length?[$&&v.kind!=="namespace"&&!Mt?"<?php":"",v.kind!=="namespace"&&Mt?"":mt,qn(P.leadingComments,a),mt,"?>"]:Uo(v)&&$&&v.kind!=="namespace"?"":[zt,"?>"],vi=s.getNode(Y+1),$i=vi&&vi.children&&vi.children.length;Dt=[Hi,Dt,P.comments&&P.comments.length?[yi,mt,$i?qn(P.comments,a):"",mt]:Uo(v)&&et?"":[yi," "]]}I.push(Dt)},m);let U=function(P,q){if(q.length===0)return P;let $=0;return q.reduce((et,Y)=>{let{start:pt,end:xt,alignment:It,before:Dt,after:Mt}=Y,zt=[Dt||"",...P.slice(pt,xt),Mt||""],yi=et.concat(P.slice($,pt),It?JT(yt(zT(new Array(It).join(" "),zt))):yt(zt),xt===P.length-1?P.slice(xt):"");return $=xt,yi},[])}(I,H);if(v.kind==="program"&&!v.extra.parseAsEval){let P=[],[q]=v.children;if(!q||q.kind!=="inline"){let $=a.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),et=[$&&$[2]&&$[2].includes(`
`)?[mt,$[2].split(`
`).length>2?mt:""]:" ",v.comments?qn(v.comments,a):""],Y=q&&q.kind==="echo"&&q.shortForm;P.push([Y?"<?=":"<?php",et])}if(P.push(U),/\?>\n?$/.test(a.originalText)){let $=Mi(v.children),et=$?[ec(a.originalText.trimEnd(),ye($),ye(v))?$.kind==="inline"&&$.comments&&$.comments.length?"":mt:" ",Jn(a.originalText,ye($))?mt:""]:v.comments?mt:"";P.push(GT([et,"?>"]))}return P}return U}function lc(s,a,l,m){return s.map(v=>{let{node:b,isLast:L}=v,I=[];return I.push(l()),L||(I.push(mt),Jn(a.originalText,ye(b))&&I.push(mt)),I},m)}function Li(s,a,l){let m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"extends",v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:" ",b=arguments.length>5&&arguments[5]!==void 0?arguments[5]:" ",L=s.node[m],I=Ni(L)?[mt,s.call(()=>Le(s,a,!0),m),mt]:v,H=Array.isArray(L)?yt(Ve(",",s.map(U=>{let{node:P}=U,q=l();return Ni(P)?[mt,Le(s,a,!0),mt,q]:[b,q]},m))):[b,l(m)];return bt([I,m,In(I)?bt(H):H])}function Pn(s,a,l){let{inline:m=!1}=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},v=[];return s.node.attrGroups?(s.each(()=>{let b=["#["];!m&&v.length>0&&v.push(mt),b.push(jt),s.each(()=>{let L=s.node;b.length>2&&b.push(",",ue);let I=[L.name];L.args.length>0&&I.push(Qi(s,a,l,"args")),b.push(yt(I))},"attrs"),v.push(yt([bt(b),zn(Ms(a,"8.0")?",":""),jt,"]",m?zn(jt," "):""]))},"attrGroups"),v.length===0?[]:[...v,m?"":mt]):[]}function xn(s,a,l){let m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"body",{node:v}=s;if(!v[m])return";";let b=l(m);return[v.shortForm?":":" {",bt(v[m].kind!=="block"||v[m].children&&v[m].children.length>0||v[m].comments&&v[m].comments.length>0?[LT(s)?v.kind==="switch"?" ":"":mt,b]:""),v.kind==="if"&&m==="body"?"":[FT(s)?mt:"",v.shortForm?["end",v.kind,";"]:"}"]]}function br(s,a,l,m,v,b,L){if(!m)return a;let I=Sr(s,m,v,b,L);return yt([a,l,I])}function cc(s){return!!fi(s)&&(!(s.what.kind!=="variable"&&!Wo(s.what))||cc(s.what))}function Sr(s,a,l,m,v){let b=m?"&":"";if(function(I,H){return H.comments&&H.comments.some(U=>U.leading&&Cr(I,ye(U)))}(v.originalText,a))return bt([mt,b,l]);let L=a.kind==="cast"?a.expr:a;return L.kind==="bin"&&!Us(L)||L.kind==="retif"&&(!L.trueExpr&&!oc(L.falseExpr)||L.test.kind==="bin"&&!Us(L.test))||(s.kind==="variable"||s.kind==="string"||fi(s))&&(L.kind==="string"&&!fc(L)||cc(L))?yt(bt([ue,b,l])):[" ",b,l]}function fc(s){return s.raw.includes(`
`)}function Dr(s,a){return(s.kind==="string"||s.kind==="encapsed"&&(s.type==="string"||s.type==="shell"))&&fc(s)&&!XT(a,Ei(s),{backwards:!0})}function pc(s,a,l){return yt(s.map(m=>{let{isFirst:v}=m;return v?[a()]:[l,a()]},"types"))}let $T=new Set(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"]);function dc(s,a){if(s.kind==="string"&&delete a.isDoubleQuote,["array","list"].includes(s.kind)&&delete a.shortForm,s.kind==="inline"){if(s.value.includes("___PSEUDO_INLINE_PLACEHOLDER___"))return null;a.value=a.value.replace(/\n/g,"")}if((s.kind==="continue"||s.kind==="break")&&s.level){let{level:l}=a;l.kind==="number"&&(a.level=l.value==="1"?null:l)}if(s.kind==="block"&&s.children.length===1&&s.children[0].kind==="block")for(;a.children[0].kind==="block";)a.children=a.children[0].children;if(s.kind==="number"&&(a.value=Bl(s.value)),["foreach","for","if","while","do"].includes(s.kind)&&(s.body&&s.body.kind!=="block"?a.body={kind:"block",children:[a.body]}:a.body=a.body?a.body:null,s.alternate&&s.alternate.kind!=="block"?a.alternate={kind:"block",children:[a.alternate]}:a.alternate=a.alternate?a.alternate:null),s.kind==="usegroup"&&typeof s.name=="string"&&(a.name=a.name.replace(/^\\/,"")),s.kind==="useitem"&&(a.name=a.name.replace(/^\\/,"")),s.kind==="method"&&s.name.kind==="identifier"&&(a.name.name=Gl(a.name.name)),s.kind==="noop")return null}dc.ignoredProperties=$T;let ta="PHP";var ZT={phpVersion:{since:"0.13.0",category:ta,type:"choice",default:"7.0",description:"Minimum target PHP version.",choices:[{value:"5.0"},{value:"5.1"},{value:"5.2"},{value:"5.3"},{value:"5.4"},{value:"5.5"},{value:"5.6"},{value:"7.0"},{value:"7.1"},{value:"7.2"},{value:"7.3"},{value:"7.4"},{value:"8.0"},{value:"8.1"},{value:"8.2"}]},trailingCommaPHP:{since:"0.0.0",category:ta,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:ta,type:"choice",default:"per-cs",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"(deprecated) Use per-cs"},{value:"per-cs",description:"Use the PER Coding Style brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]}};let t0=(s,a,l,m)=>{if(l==="length"||l==="prototype"||l==="arguments"||l==="caller")return;let v=Object.getOwnPropertyDescriptor(s,l),b=Object.getOwnPropertyDescriptor(a,l);!e0(v,b)&&m||Object.defineProperty(s,l,b)},e0=function(s,a){return s===void 0||s.configurable||s.writable===a.writable&&s.enumerable===a.enumerable&&s.configurable===a.configurable&&(s.writable||s.value===a.value)},i0=(s,a)=>{let l=Object.getPrototypeOf(a);l!==Object.getPrototypeOf(s)&&Object.setPrototypeOf(s,l)},n0=(s,a)=>`/* Wrapped ${s}*/
${a}`,s0=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),r0=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),o0=(s,a,l)=>{let m=l===""?"":`with ${l.trim()}() `,v=n0.bind(null,m,a.toString());Object.defineProperty(v,"name",r0),Object.defineProperty(s,"toString",{...s0,value:v})};var ea={exports:{}},a0=()=>{let s={};return s.promise=new Promise((a,l)=>{s.resolve=a,s.reject=l}),s};(function(s,a){var l=e&&e.__awaiter||function(L,I,H,U){return new(H||(H=Promise))(function(P,q){function $(pt){try{Y(U.next(pt))}catch(xt){q(xt)}}function et(pt){try{Y(U.throw(pt))}catch(xt){q(xt)}}function Y(pt){pt.done?P(pt.value):new H(function(xt){xt(pt.value)}).then($,et)}Y((U=U.apply(L,I||[])).next())})},m=e&&e.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(a,"__esModule",{value:!0});let v=m(a0);function b(L){let I,H,U,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"maxAge",q=()=>l(this,void 0,void 0,function*(){if(I!==void 0)return;let et=Y=>l(this,void 0,void 0,function*(){U=v.default();let pt=Y[1][P]-Date.now();return pt<=0?(L.delete(Y[0]),void U.resolve()):(I=Y[0],H=setTimeout(()=>{L.delete(Y[0]),U&&U.resolve()},pt),typeof H.unref=="function"&&H.unref(),U.promise)});try{for(let Y of L)yield et(Y)}catch{}I=void 0}),$=L.set.bind(L);return L.set=(et,Y)=>{L.has(et)&&L.delete(et);let pt=$(et,Y);return I&&I===et&&(I=void 0,H!==void 0&&(clearTimeout(H),H=void 0),U!==void 0&&(U.reject(void 0),U=void 0)),q(),pt},q(),L}a.default=b,s.exports=b,s.exports.default=b})(ea,ea.exports);var h0=i(ea.exports);let u0=new WeakMap,mc=/@prettier|@format/,gc=function(s){let{cacheKey:a,cache:l=new Map,maxAge:m}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof m=="number"&&h0(l);let v=function(){for(var b=arguments.length,L=new Array(b),I=0;I<b;I++)L[I]=arguments[I];let H=a?a(L):L[0],U=l.get(H);if(U)return U.data;let P=s.apply(this,L);return l.set(H,{data:P,maxAge:m?Date.now()+m:Number.POSITIVE_INFINITY}),P};return function(b,L){let{ignoreNonConfigurable:I=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{name:H}=b;for(let U of Reflect.ownKeys(L))t0(b,L,U,I);i0(b,L),o0(b,L,H)}(v,s,{ignoreNonConfigurable:!0}),u0.set(v,l),v}(s=>{let a=Fl(s),[l]=a.children,[m]=a.comments.filter(v=>v.kind==="commentblock");if(l&&m&&m.loc.start.line<l.loc.start.line)return m}),{join:l0,hardline:c0}=t.doc.builders;function xc(s,a){let{extend:l,override:m}=a,v={};for(let b in s)v[b==="languageId"?"linguistLanguageId":b]=s[b];if(l)for(let b in l)v[b]=(v[b]||[]).concat(l[b]);for(let b in m)v[b]=m[b];return v}let f0=[xc(r,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),xc(o,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],p0={php:{parse:Fl,astFormat:"php",locStart:Ei,locEnd:ye,hasPragma:function(s){if(!mc.test(s))return!1;let a=gc(s);if(a){let{value:l}=a;return mc.test(l)}return!1}}},d0=new Set(["kind","loc","errors","extra","comments","leadingComments","enclosingNode","precedingNode","followingNode"]),m0={php:{print:function(s,a,l){let{node:m}=s;if(typeof m=="string")return m;let v=function(I,H,U){let{node:P}=I;switch(P.kind){case"program":return yt([Ws(I,H,U),Le(I,H,!0,q=>!q.printed)]);case"expressionstatement":return U("expression");case"block":return[Ws(I,H,U),Le(I,H,!0)];case"declare":{let q=$=>Ve(", ",$.map(U,"directives"));return["block","short"].includes(P.mode)?["declare(",q(I),")",P.mode==="block"?" {":":",P.children.length>0?bt([mt,Ws(I,H,U)]):"",Le(I,H),mt,P.mode==="block"?"}":"enddeclare;"]:["declare(",q(I),")",I.next?.kind==="inline"?"":";"]}case"declaredirective":return[U("key"),"=",U("value")];case"namespace":return["namespace ",P.name&&typeof P.name=="string"?[P.name,P.withBrackets?" ":""]:"",P.withBrackets?"{":";",Ni(P)?[" ",Le(I,H,!0)]:"",P.children.length>0?P.withBrackets?bt([mt,Ws(I,H,U)]):[P.children[0].kind==="inline"?"":[mt,RT(H.originalText,P)?mt:""],Ws(I,H,U)]:"",P.withBrackets?[mt,"}"]:""];case"usegroup":return yt(["use ",P.type?[P.type," "]:"",bt([P.name?[Ul(P.name),"\\{",jt]:"",Ve([",",ue],I.map(U,"items"))]),P.name?[zn(Ms(H,"7.2")?",":""),jt,"}"]:""]);case"useitem":return[P.type?[P.type," "]:"",Ul(P.name),Ni(P)?[" ",Le(I,H,!0)]:"",P.alias?[" as ",U("alias")]:""];case"class":case"enum":case"interface":case"trait":return function(q,$,et){let{node:Y}=q,pt=Y.kind==="class"&&Y.isAnonymous,xt=Pn(q,$,et,{inline:pt}),It=pt?[]:[...xt];Y.isFinal&&It.push("final "),Y.isAbstract&&It.push("abstract "),Y.isReadonly&&It.push("readonly "),It.push(pt?"":Y.kind),Y.name&&It.push(" ",et("name")),Y.kind==="enum"&&Y.valueType&&It.push(": ",et("valueType")),Y.extends&&Y.implements?It.push(as([[Li(q,$,et,"extends"),Li(q,$,et,"implements")],[Li(q,$,et,"extends"),Li(q,$,et,"implements"," ",mt)],[Li(q,$,et,"extends",mt," "),Li(q,$,et,"implements",mt,Y.implements.length>1?mt:" ")]],{shouldBreak:Ni(Y.extends)})):(Y.extends&&It.push(as([Li(q,$,et,"extends"),Li(q,$,et,"extends"," ",mt),Li(q,$,et,"extends",mt,Y.extends.length>1?mt:" ")])),Y.implements&&It.push(as([Li(q,$,et,"implements"),Li(q,$,et,"implements"," ",mt),Li(q,$,et,"implements",mt,Y.implements.length>1?mt:" ")])));let Dt=yt([yt(It),$o($)?pt?ue:mt:" "]),Mt=Y.body&&Y.body.length===0&&!Ni(Y),zt=["{",bt([Mt?"":mt,lc(q,$,et,"body")]),Le(q,$,!0),pt&&Mt?jt:mt,"}"];return[Dt,zt]}(I,H,U);case"traitprecedence":return[U("trait"),"::",U("method")," insteadof ",Ve(", ",I.map(U,"instead"))];case"traitalias":return[P.trait?[U("trait"),"::"]:"",P.method?U("method"):""," as ",Ve(" ",[...P.visibility?[P.visibility]:[],...P.as?[U("as")]:[]])];case"traituse":return yt(["use ",bt(yt(Ve([",",ue],I.map(U,"traits")))),P.adaptations?[" {",P.adaptations.length>0?[bt([mt,lc(I,H,U,"adaptations")]),mt]:Ni(P)?[ue,Le(I,H,!0),ue]:"","}"]:""]);case"function":case"closure":case"method":return function(q,$,et){let{node:Y}=q,pt=Pn(q,$,et,{inline:Y.kind==="closure"}),xt=[];Y.isFinal&&xt.push("final "),Y.isAbstract&&xt.push("abstract "),Y.visibility&&xt.push(Y.visibility," "),Y.isStatic&&xt.push("static "),xt.push("function "),Y.byref&&xt.push("&"),Y.name&&xt.push(et("name")),xt.push(Qi(q,$,et)),Y.uses&&Y.uses.length>0&&xt.push(yt([" use ",Qi(q,$,et,"uses")])),Y.type&&xt.push([": ",Ni(Y.type)?[q.call(()=>Le(q,$,!0),"type")," "]:"",Y.nullable?"?":"",et("type")]);let It=xt;if(!Y.body)return[...pt,It];let Dt=Y.kind==="closure",Mt=["{",bt([Wl(q)?"":mt,et("body")]),Dt&&Wl(q)?"":mt,"}"];return Dt?[...pt,It," ",Mt]:Y.arguments.length===0?[...pt,It,$o($)?mt:" ",Mt]:xt.some(In)?[It," ",Mt]:[...pt,as([[It,$o($)?mt:" ",Mt],[It," ",Mt]])]}(I,H,U);case"arrowfunc":return[P.parenthesizedExpression?"(":"",...Pn(I,H,U,{inline:!0}),P.isStatic?"static ":"","fn",Qi(I,H,U),P.type?[": ",P.nullable?"?":"",U("type")]:""," => ",U("body"),P.parenthesizedExpression?")":""];case"parameter":{let q="";P.flags===1?q="public ":P.flags===2?q="protected ":P.flags===4&&(q="private ");let $=[...Pn(I,H,U,{inline:!0}),q,P.readonly?"readonly ":"",P.nullable?"?":"",P.type?[U("type")," "]:"",P.byref?"&":"",P.variadic?"...":"","$",U("name")];return P.value?yt([$,Ni(P)?" ":"",Le(I,H,!0)," =",Sr(P.name,P.value,U("value"),!1,H)]):$}case"variadic":return["...",U("what")];case"property":return yt([P.readonly?"readonly ":"",P.type?[P.nullable?"?":"",U("type")," "]:"","$",U("name"),P.value?[" =",Sr(P.name,P.value,U("value"),!1,H)]:""]);case"propertystatement":{let q=[];I.each(()=>{q.push(...Pn(I,H,U))},"properties");let $=I.map(U,"properties"),et=P.properties.some(xt=>xt.value),Y;$.length!==1||P.properties[0].comments?$.length>0&&(Y=bt($[0])):[Y]=$;let pt=P.visibility||P.visibility===null;return yt([...q,pt?[P.visibility===null?"var":P.visibility,""]:"",P.isStatic?[pt?" ":"","static"]:"",Y?[" ",Y]:"",bt($.slice(1).map(xt=>[",",et?mt:ue,xt]))])}case"if":{let q=[],$=xn(I,H,U,"body"),et=yt(["if (",yt([bt([jt,U("test")]),jt]),")",$]);if(q.push(et,Ls(I)||!P.body?"":mt),P.alternate){q.push(P.shortForm?"":"} ");let Y=Bs(P.body)&&P.body.comments.some(xt=>xt.trailing&&!Ko(xt))||function(xt){if(!xt.comments)return!1;let It=Mi(xt.comments.filter(Dt=>!Dt.leading&&!Dt.trailing));return It&&!Ko(It)}(P),pt=!Y;q.push(pt?"":mt),Ni(P)&&q.push(Jn(H.originalText,ye(P.body))?mt:"",Le(I,H,!0),Y?mt:" "),q.push("else",yt(P.alternate.kind==="if"?U("alternate"):xn(I,H,U,"alternate")))}else q.push(P.body?P.shortForm?"endif;":"}":"");return q}case"do":return["do",xn(I,H,U,"body")," while (",yt([bt([jt,U("test")]),jt]),")"];case"while":case"switch":return yt([P.kind," (",yt([bt([jt,U("test")]),jt]),")",xn(I,H,U,"body")]);case"for":{let q=xn(I,H,U,"body"),$=Le(I,H,!0),et=$?[$,jt]:"";return P.init.length||P.test.length||P.increment.length?[et,yt(["for (",yt([bt([jt,yt(Ve([",",ue],I.map(U,"init"))),";",ue,yt(Ve([",",ue],I.map(U,"test"))),";",ue,yt(Ve([",",ue],I.map(U,"increment")))]),jt]),")",q])]:[et,yt(["for (;;)",q])]}case"foreach":{let q=xn(I,H,U,"body"),$=Le(I,H,!0);return[$?[$,jt]:"",yt(["foreach (",yt([bt([jt,U("source"),ue,"as ",yt(P.key?bt(Ve([" =>",ue],[U("key"),U("value")])):U("value"))]),jt]),")",q])]}case"try":{let q=[];return q.push("try",xn(I,H,U,"body")),P.catches&&q.push(I.map(U,"catches")),P.always&&q.push(" finally",xn(I,H,U,"always")),q}case"catch":return[" catch",P.what?[" (",Ve(" | ",I.map(U,"what")),P.variable?[" ",U("variable")]:"",")"]:"",xn(I,H,U,"body")];case"case":return[P.test?["case ",P.test.comments?bt(U("test")):U("test"),":"]:"default:",P.body&&P.body.children&&P.body.children.length?bt([Ls(I)?"":mt,U("body")]):""];case"break":case"continue":return P.level&&P.level.kind==="number"&&P.level.value!=="1"?[`${P.kind} `,U("level")]:P.kind;case"call":return P.arguments.length===1&&Dr(P.arguments[0],H.originalText)?[U("what"),"(",Ve(", ",I.map(U,"arguments")),")"]:fi(P.what)?function(q,$,et){let Y=[];function pt(Ut){let{originalText:De}=$,Ge=jT(De,ye(Ut));return De.charAt(Ge)===")"?YT(De,Ge+1,$):Jn(De,ye(Ut))}function xt(Ut){let{node:De}=Ut;if(De.kind!=="call"||!fi(De.what)&&De.what.kind!=="call")if(fi(De)){let Ge=null;Ge=De.kind==="propertylookup"?Zo(Ut,$,et):De.kind==="nullsafepropertylookup"?ic(Ut,$,et):De.kind==="staticlookup"?nc(Ut,$,et):sc(Ut,$,et),Y.unshift({node:De,needsParens:Zl(Ut),printed:Qo(Ut,()=>Ge,$)}),Ut.call(qs=>xt(qs),"what")}else Y.unshift({node:De,printed:et()});else Y.unshift({node:De,printed:[Qo(Ut,()=>Qi(Ut,$,et),$),pt(De)?mt:""]}),Ut.call(Ge=>xt(Ge),"what")}let{node:It}=q;Y.unshift({node:It,printed:Qi(q,$,et)}),q.call(Ut=>xt(Ut),"what");for(let Ut=0;Ut<Y.length;++Ut)Y[Ut].node.kind==="call"&&Y[Ut-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(Y[Ut-1].node.kind)&&Y[Ut-1].needsParens&&(Y[0].printed=["(",Y[0].printed],Y[Ut-1].printed=[Y[Ut-1].printed,")"]);let Dt=[],Mt=[Y[0]],zt=1;for(;zt<Y.length&&(Y[zt].node.kind==="call"||fi(Y[zt].node)&&Y[zt].node.offset&&Y[zt].node.offset.kind==="number");++zt)Mt.push(Y[zt]);if(Y[0].node.kind!=="call")for(;zt+1<Y.length&&fi(Y[zt].node)&&fi(Y[zt+1].node);++zt)Mt.push(Y[zt]);Dt.push(Mt),Mt=[];let yi=!1;for(;zt<Y.length;++zt){if(yi&&fi(Y[zt].node)){if(Y[zt].node.kind==="offsetlookup"&&Y[zt].node.offset&&Y[zt].node.offset.kind==="number"){Mt.push(Y[zt]);continue}Dt.push(Mt),Mt=[],yi=!1}Y[zt].node.kind==="call"&&(yi=!0),Mt.push(Y[zt]),Y[zt].node.comments&&Bs(Y[zt].node)&&(Dt.push(Mt),Mt=[],yi=!1)}Mt.length>0&&Dt.push(Mt);function Hi(Ut){let De=Ut[1].length&&Ut[1][0].node.kind==="offsetlookup";if(Ut[0].length===1){let fs=Ut[0][0].node;return fs.kind==="variable"&&(fs.name==="this"||vi&&Ge(fs.name))||Wo(fs)}function Ge(fs){return fs.length<$.tabWidth}let qs=Mi(Ut[0]).node;return fi(qs)&&(qs.offset.kind==="identifier"||qs.offset.kind==="variable")&&De}let vi=q.parent.kind==="expressionstatement",$i=Dt.length>=2&&!Dt[1][0].node.comments&&Hi(Dt);function ls(Ut){let De=[];for(let Ge=0;Ge<Ut.length;Ge++)Ut[Ge+1]&&Ut[Ge+1].needsParens?(De.push("(",Ut[Ge].printed,Ut[Ge+1].printed,")"),Ge++):De.push(Ut[Ge].printed);return De}function Hs(Ut){return Ut.length===0?"":bt(yt([mt,Ve(mt,Ut.map(ls))]))}let Nr=Dt.map(ls),Vs=Nr,cs=$i?3:2,Gs=Dt.slice(0,cs).flat(),_c=Gs.slice(1,-1).some(Ut=>Rs(Ut.node))||Gs.slice(0,-1).some(Ut=>Bs(Ut.node))||Dt[cs]&&Rs(Dt[cs][0].node),g0=Ho(q,"encapsed");if(Dt.length<=cs&&!_c||g0)return yt(Vs);let Ec=Mi($i?Dt.slice(1,2)[0]:Dt[0]).node,kc=Ec.kind!=="call"&&pt(Ec),yc=[ls(Dt[0]),$i?Dt.slice(1,2).map(ls):"",kc?mt:"",Hs(Dt.slice($i?2:1))],x0=Y.filter(Ut=>Ut.node.kind==="call").length;return _c||x0>=3||Nr.slice(0,-1).some(In)?yt(yc):[In(Vs)||kc?tc:"",as([Vs,yc])]}(I,H,U):[U("what"),Qi(I,H,U)];case"new":{let q=P.what&&P.what.kind==="class"&&P.what.isAnonymous;if(!q&&P.arguments.length===1&&Dr(P.arguments[0],H.originalText))return["new ",...I.call(Pn,"what"),U("what"),"(",Ve(", ",I.map(U,"arguments")),")"];let $=[];if($.push("new "),q)$.push(P.what.leadingComments&&P.what.leadingComments[0].kind==="commentblock"?[qn(P.what.leadingComments,H)," "]:"",...I.call(()=>Pn(I,H,U,{inline:!0}),"what"),"class",P.arguments.length>0?[" ",Qi(I,H,U)]:"",yt(U("what")));else{let et=["call","offsetlookup"].includes(P.what.kind),Y=[et?"(":"",U("what"),et?")":"",Qi(I,H,U)];$.push(Rs(P.what)?bt(Y):Y)}return $}case"clone":return["clone ",P.what.comments?bt(U("what")):U("what")];case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{let{parent:q}=I,$,et=0;do $=I.getParentNode(et),et++;while($&&fi($));let Y=Ho(I,"encapsed")||$&&($.kind==="new"||$.kind==="assign"&&$.left.kind!=="variable")||P.kind==="offsetlookup"||(Wo(P.what)||P.what.kind==="variable")&&["identifier","variable","encapsedpart"].includes(P.offset.kind)&&q&&!fi(q);return[U("what"),Y?hc(I,H,U):yt(bt([jt,hc(I,H,U)]))]}case"exit":return yt([P.useDie?"die":"exit","(",P.expression?Dr(P.expression,H.originalText)?U("expression"):[bt([jt,U("expression")]),jt]:Le(I,H),")"]);case"global":return yt(["global ",bt(Ve([",",ue],I.map(U,"items")))]);case"include":return[P.require?"require":"include",P.once?"_once":""," ",P.target.comments?bt(U("target")):U("target")];case"label":return[U("name"),":"];case"goto":return["goto ",U("label")];case"throw":return["throw ",P.what.comments?bt(U("what")):U("what")];case"silent":return["@",U("expr")];case"halt":return[Ni(P)?[Le(I,H,!0),mt]:"","__halt_compiler();",P.after];case"eval":return yt(["eval(",Dr(P.source,H.originalText)?U("source"):[bt([jt,U("source")]),jt],")"]);case"echo":{let q=I.map(U,"expressions"),$;return q.length!==1||P.expressions[0].comments?q.length>0&&($=Mo(P.expressions[0])||P.expressions[0].comments?bt(q[0]):qT(q[0])):[$]=q,yt([P.shortForm?"":"echo ",$||"",bt(q.slice(1).map(et=>[",",ue,et]))])}case"print":return["print ",P.expression.comments?bt(U("expression")):U("expression")];case"return":{let q=[];if(q.push("return"),P.expr){let $=U("expr");q.push(" ",P.expr.comments?bt($):$)}return Ni(P)&&q.push(" ",Le(I,H,!0)),q}case"isset":case"unset":return yt([P.kind,Qi(I,H,U,"variables")]);case"empty":return yt(["empty(",bt([jt,U("expression")]),jt,")"]);case"variable":{let{parent:q,grandparent:$}=I,et=q.kind==="assign"?"":P.byref?"&":"",Y=q.kind==="encapsedpart"&&q.syntax==="simple"&&q.curly||$&&q.kind==="offsetlookup"&&$.kind==="encapsedpart"&&$.syntax==="simple"&&$.curly?"":"$",pt=P.curly?"{":"",xt=P.curly?"}":"";return[et,Y,pt,U("name"),xt]}case"constantstatement":case"classconstant":{let q=Pn(I,H,U),$=I.map(U,"constants"),et;return $.length!==1||P.constants[0].comments?$.length>0&&(et=bt($[0])):[et]=$,yt([...q,P.final?"final ":"",P.visibility?[P.visibility," "]:"","const",et?[" ",et]:"",bt($.slice(1).map(Y=>[",",mt,Y]))])}case"constant":return br(P.name,U("name")," =",P.value,U("value"),!1,H);case"static":{let q=I.map(U,"variables"),$=P.variables.some(Y=>Y.defaultValue),et;return q.length!==1||P.variables[0].comments?q.length>0&&(et=bt(q[0])):[et]=q,yt(["static",et?[" ",et]:"",bt(q.slice(1).map(Y=>[",",$?mt:ue,Y]))])}case"staticvariable":return br(P.variable,U("variable")," =",P.defaultValue,U("defaultValue"),!1,H);case"list":case"array":{let q=P.kind==="array"&&us(H.phpVersion,"5.4")||P.kind==="list"&&(P.shortForm||us(H.phpVersion,"7.1")),$=q?"[":[P.kind,"("],et=q?"]":")";if(P.items.length===0)return Ni(P)?yt([$,Le(I,H),jt,et]):[$,et];let Y=Mi(P.items),pt=Y&&Y.kind==="noop",[xt]=P.items.filter(Dt=>Dt.kind!=="noop").sort((Dt,Mt)=>Ei(Dt)-Ei(Mt)),It=!(!xt||!xt.key)&&xt&&ec(H.originalText,Ei(P),Ei(xt));return yt([$,bt([jt,QT(I,H,U)]),pt?",":"",zn(!pt&&Ms(H,"5.0")?[Y&&Hl(Y)?mt:"",","]:""),Le(I,H,!0),jt,et],{shouldBreak:It})}case"entry":{let q=P.byRef?"&":"",$=P.unpack?"...":"";return P.key?br(P.key,U("key")," =>",P.value,U("value"),q,H):[q,$,U("value")]}case"yield":{let q=[P.key?[U("key")," => "]:"",U("value")];return["yield",P.key||P.value?" ":"",P.value&&P.value.comments?bt(q):q]}case"yieldfrom":return["yield from ",P.value.comments?bt(U("value")):U("value")];case"unary":return[P.type,U("what")];case"pre":return[P.type+P.type,U("what")];case"post":return[U("what"),P.type+P.type];case"cast":return["(",P.type,") ",P.expr.comments?bt(U("expr")):U("expr")];case"assignref":case"assign":{let q=P.kind==="assignref";return br(P.left,U("left"),[" ",q?"=":P.operator],P.right,U("right"),q,H)}case"bin":{let{parent:q,grandparent:$}=I,et=P!==q.body&&(q.kind==="if"||q.kind==="while"||q.kind==="switch"||q.kind==="do"),Y=ac(I,U,H,!1,et);if(et)return Y;if(q.kind==="unary"||fi(q)&&q.kind!=="offsetlookup")return yt([bt([jt,...Y]),jt]);let pt=P!==q.body&&q.kind==="for"||q.kind==="retif"&&$&&$.kind!=="return",xt=["assign","property","constant","staticvariable","entry"].includes(q.kind),It=P.left.kind==="bin"&&Bo(P.type,P.left.type);if(pt||Us(P)&&!It||!Us(P)&&xt)return yt(Y);let Dt=Y.slice(1);return yt([Y.length>0?Y[0]:"",bt(Dt)])}case"retif":{let q=[],{parent:$}=I,et,Y=0;do et=I.getParentNode(Y),Y++;while(et&&et.kind==="retif");let pt=et||$,xt=P.falseExpr.kind==="bin"?bt(U("falseExpr")):U("falseExpr"),It=[P.trueExpr?ue:" ","?",P.trueExpr?[" ",P.trueExpr.kind==="bin"?bt(U("trueExpr")):U("trueExpr"),ue]:"",":",P.trueExpr?[" ",xt]:[oc(P.falseExpr)?" ":ue,xt]];q.push(It);let Dt=vi=>$===pt?yt(vi):vi,Mt=I.grandparent,zt=$.kind==="cast"&&Mt?Mt:$,yi=["propertylookup","nullsafepropertylookup","staticlookup"].includes(zt.kind),Hi=U("test");if(!P.trueExpr){let vi=[Hi,zt.kind==="bin"||["print","echo","return","include"].includes(pt.kind)?bt(q):q];return zt.kind==="call"&&zt.what===P||zt.kind==="unary"||fi(zt)&&zt.kind!=="offsetlookup"?yt([bt([jt,vi]),jt]):Dt(vi)}return Dt([P.test.kind==="retif"?bt(Hi):Hi,bt(q),yi?jt:""])}case"boolean":return P.value?"true":"false";case"number":return Bl(P.value);case"string":{let{parent:q}=I;if(q.kind==="encapsedpart"){let Y=I.grandparent,pt=0,xt=us(H.phpVersion,"7.3"),It=hs;if(Y.type==="heredoc"){It=xt?mt:hs;let Dt=Y.raw.split(`
`);pt=Dt[Dt.length-1].search(/\S/),pt===-1&&(pt=Dt[Dt.length-2].search(/\S/))}return Ve(It,P.raw.split(`
`).map((Dt,Mt)=>Mt>0||P.loc.start.column===0?Dt.substring(pt):Dt))}let $=function(Y,pt){if(Y.isDoubleQuote===pt.singleQuote){let xt=Y.raw.slice(Y.raw[0]==="b"?2:1,-1).match(/\\([$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})|\r?\n|'|"|\$/);return Y.isDoubleQuote?xt:!xt}return Y.isDoubleQuote}(P,H)?'"':"'",et=P.raw;return P.raw[0]==="b"&&(et=et.slice(1)),['"',"'"].includes(et[0])&&(et=et.substr(1)),['"',"'"].includes(et[et.length-1])&&(et=et.substr(0,et.length-1)),[P.raw[0]==="b"?"b":"",$,Ve(hs,et.split(`
`)),$]}case"intersectiontype":return pc(I,U,"&");case"uniontype":return pc(I,U,"|");case"encapsedpart":{let q=P.syntax==="simple"&&P.curly||P.syntax==="complex"?[P.curly?"$":"","{"]:"",$=P.syntax==="simple"&&P.curly||P.syntax==="complex"?"}":"";return[q,U("expression"),$]}case"encapsed":switch(P.type){case"string":case"shell":case"heredoc":{let q=us(H.phpVersion,"7.3")?mt:hs;return[uc(P),P.type==="heredoc"?q:"",...I.map(U,"value"),uc(P,{opening:!1}),P.type==="heredoc"&&Tr(I)?mt:""]}default:throw new Error(`Have not implemented kind ${P.type} yet.`)}case"inline":return Ve(hs,P.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split(`
`));case"magic":return P.value;case"nowdoc":{let q=us(H.phpVersion,"7.3")?mt:hs;return["<<<'",P.label,"'",q,Ve(q,P.value.split(`
`)),q,P.label,Tr(I)?mt:""]}case"name":return[P.resolution==="rn"?"namespace\\":"",P.name];case"literal":return U("value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return P.name;case"nullkeyword":return"null";case"identifier":{let{parent:q}=I;return q.kind==="method"&&(P.name=Gl(P.name)),U("name")}case"match":{let q=I.map(()=>{let $=I.node,et=Rs($)?[qn($.leadingComments,H),mt]:[],Y=!I.isLast||H.trailingCommaPHP?",":"",pt=Bs($)?[" ",qn($.comments.filter(Mt=>Mt.trailing),H)]:[],xt=$.conds===null?"default":I.map(Mt=>{let{isFirst:zt}=Mt;return[",",ue,U()].slice(zt?2:0)},"conds"),It=U("body"),Dt=!I.isFirst&&KT(H.originalText,Ei($))?mt:"";return["",mt,Dt,...et,yt([yt([xt,bt(ue)]),"=> ",It,Y,...pt])].slice(I.isFirst?1:0)},"arms");return yt(["match (",yt([bt([jt,U("cond")]),jt]),") {",yt(bt([...q]))," ",jt,"}"])}case"noop":return P.comments?qn(P.comments,H):"";case"namedargument":return[P.name,": ",U("value")];case"enumcase":return yt(["case ",U("name"),P.value?[" =",Sr(P.name,P.value,U("value"),!1,H)]:""]);case"variadicplaceholder":return"...";default:throw new Error(`Have not implemented kind '${P.kind}' yet.`)}}(s,a,l),b=[],L=Zl(s);return L&&b.unshift("("),b.push(v),L&&b.push(")"),function(I){let{node:H,parent:U}=I;if(!U)return!1;if(["for","foreach","while","do","if","switch"].includes(U.kind)&&H.kind!=="block"&&H.kind!=="if"&&(U.body===H||U.alternate===H))return!0;if(!function(P){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(P.kind)}(U)||H.kind==="echo"&&H.shortForm)return!1;if(H.kind==="traituse")return!H.adaptations;if(H.kind==="method"&&H.isAbstract)return!0;if(H.kind==="method"){let{parent:P}=I;if(P&&P.kind==="interface")return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","enumcase","global","static","echo","unset","return","break","continue","throw"].includes(H.kind)}(s)&&b.push(";"),function(I){let{node:H}=I,U=H.kind==="program",P=H.children&&Mi(H.children);if(!U||P&&["halt","inline"].includes(P.kind))return!1;if(P&&(P.kind==="declare"||P.kind==="namespace")){let q=P.children.length>0&&Mi(P.children);if(q&&["halt","inline"].includes(q.kind))return!1}return!0}(s)&&b.push(mt),b},getVisitorKeys:function(s,a){return Object.keys(s).filter(l=>!a.has(l)&&!d0.has(l))},insertPragma:function(s){let a=gc(s);if(a){let{start:{offset:m},end:{offset:v}}=a.loc,b=s.substring(0,m),L=s.substring(v);return`${b}${function(I){let H=I.split(`
`);if(H.length===1){let[,P]=/\/*\*\*(.*)\*\//.exec(H[0]);H=["/**",` * ${P.trim()}`," */"]}let U=H.findIndex(P=>/@\S/.test(P))||1;return H.splice(U,0," * @format"),H.join(`
`)}(a.value)}${L}`}let l="<?php";return s.startsWith(l)?`${s.substring(0,5)}
/**
* @format
*/
${s.substring(5)}`:s},massageAstNode:dc,getCommentChildNodes:function(s){if(s.kind==="new"&&s.what.kind==="class")return s.what.__parent_new_arguments=[...s.arguments],[s.what]},canAttachComment:function(s){return s.kind&&s.kind!=="commentblock"&&s.kind!=="commentline"},isBlockComment:Ko,handleComments:{ownLine:function(s,a,l){let{precedingNode:m,enclosingNode:v,followingNode:b}=s;return Yl(a,m,v,b,s)||function(L,I,H){return L&&fi(L)&&I&&["identifier","variable","encapsed"].includes(I.kind)?(Ui(L,H),!0):!1}(v,b,s)||Go(a,m,v,b,s)||Xo(a,m,v,b,s)||jl(v,b,s)||qo(v,b,s)||Jo(a,m,v,b,s)||zo(a,v,b,s)||function(L,I,H,U){return!H&&L&&(L.kind==="for"||L.kind==="foreach")?(L.body&&L.body.kind!=="block"?Ui(H,U):Ui(L,U),!0):!1}(v,0,b,s)||Yo(v,m,b,s)||Ql(v,m,b,s)},endOfLine:function(s,a,l){let{precedingNode:m,enclosingNode:v,followingNode:b}=s;return function(L,I,H,U,P){return!I&&!U&&H&&H.kind==="array"?(Wi(H,P),!0):!1}(0,m,v,b,s)||function(L,I,H,U,P){return H&&H.kind==="return"&&!H.expr?(Wi(H,P),!0):!1}(0,0,v,0,s)||Yl(a,m,v,b,s)||function(L,I,H,U,P){let q=I&&!MT(P,ye(I),Ei(U));return(!I||!q)&&L&&L.kind==="retif"&&H?(Ui(H,U),!0):!1}(v,m,b,s,a)||Go(a,m,v,b,s)||Xo(a,m,v,b,s)||jl(v,b,s)||qo(v,b,s)||Jo(a,m,v,b,s)||zo(a,v,b,s)||function(L,I){return L&&L.kind==="entry"?(Ui(L,I),!0):!1}(v,s)||function(L,I,H){return I&&I.kind==="call"&&L&&I.what===L&&I.arguments.length>0?(Ui(I.arguments[0],H),!0):!1}(m,v,s)||function(L,I,H){if(L&&L.kind==="assign"&&I){let U=L.loc.start.offset+L.loc.source.indexOf("=");if(H.loc.start.offset>U)return Ui(I,H),!0}return!1}(v,b,s)||Yo(v,m,b,s)||Kl(v,m,b,s)||Ql(v,m,b,s)||Xl(v,s)},remaining:function(s,a,l){let{precedingNode:m,enclosingNode:v,followingNode:b}=s;return Go(a,m,v,b,s)||Xo(a,m,v,b,s)||function(L,I,H){let U=Fs(L,ye(H));return L.charAt(U)!==")"?!1:I&&(I.kind==="function"||I.kind==="closure"||I.kind==="method"||I.kind==="call"||I.kind==="new")&&I.arguments.length===0?(ki(I,H),!0):!1}(a,v,s)||qo(v,b,s)||function(L,I,H){return L&&L.kind==="traituse"&&L.adaptations&&!L.adaptations.length?(ki(L,H),!0):!1}(v,0,s)||Jo(a,m,v,b,s)||zo(a,v,b,s)||Xl(v,s)||function(L,I,H,U){return I&&I.kind==="halt"?(ki(I,U),!0):L&&L.kind==="halt"?(ki(L,U),!0):!1}(m,v,0,s)||function(L,I){return L&&(L.kind==="continue"||L.kind==="break")&&!L.label?(Wi(L,I),!0):!1}(v,s)||Yo(v,m,b,s)||Kl(v,m,b,s)}},willPrintOwnComments(s){let{node:a}=s;return a&&a.kind==="noop"},printComment(s){let a=s.node;switch(a.kind){case"commentblock":{if(!a.value.includes(`
`))return a.value;let l=a.value.split(`
`);return l.slice(1,l.length-1).every(m=>m.trim()[0]==="*")?l0(c0,l.map((m,v)=>(v>0?" ":"")+(v<l.length-1?m.trim():m.trimLeft()))):a.value}case"commentline":return a.value.trimRight();default:throw new Error(`Not a comment: ${JSON.stringify(a)}`)}},hasPrettierIgnore(s){let a=v=>v.value.includes("prettier-ignore")&&!v.value.includes("prettier-ignore-start")&&!v.value.includes("prettier-ignore-end"),{node:l,parent:m}=s;return l&&l.kind!=="classconstant"&&l.comments&&l.comments.length>0&&l.comments.some(a)||l&&l.kind==="constant"&&m&&m.kind==="classconstant"&&m.comments&&m.comments.length>0&&m.comments.some(a)}}};n.defaultOptions={tabWidth:4},n.languages=f0,n.options=ZT,n.parsers=p0,n.printers=m0})});var $c=X((Qc,la)=>{(function(n){if(typeof Qc=="object"&&typeof la<"u")la.exports=n();else if(typeof define=="function"&&define.amd)define([],n);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.jsonata=n()}})(function(){var n,t,e;return function(){function i(r,o,h){function f(d,x){if(!o[d]){if(!r[d]){var _=typeof Vi=="function"&&Vi;if(!x&&_)return _(d,!0);if(p)return p(d,!0);var u=new Error("Cannot find module '"+d+"'");throw u.code="MODULE_NOT_FOUND",u}var c=o[d]={exports:{}};r[d][0].call(c.exports,function(g){var y=r[d][1][g];return f(y||g)},c,c.exports,i,r,o,h)}return o[d].exports}for(var p=typeof Vi=="function"&&Vi,E=0;E<h.length;E++)f(h[E]);return f}return i}()({1:[function(i,r,o){let h=i("./utils"),f=function(){"use strict";let p=h.stringToArray,E=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],d=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],x=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],_=["Thousand","Million","Billion","Trillion"];function u(z,it){var Q=function(lt,ht,nt){var ct="";if(lt<=19)ct=(ht?" and ":"")+(nt?d[lt]:E[lt]);else if(lt<100){let Kt=Math.floor(lt/10),Qt=lt%10;ct=(ht?" and ":"")+x[Kt-2],Qt>0?ct+="-"+Q(Qt,!1,nt):nt&&(ct=ct.substring(0,ct.length-1)+"ieth")}else if(lt<1e3){let Kt=Math.floor(lt/100),Qt=lt%100;ct=(ht?", ":"")+E[Kt]+" Hundred",Qt>0?ct+=Q(Qt,!0,nt):nt&&(ct+="th")}else{var At=Math.floor(Math.log10(lt)/3);At>_.length&&(At=_.length);let Kt=Math.pow(10,At*3),Qt=Math.floor(lt/Kt),St=lt-Qt*Kt;ct=(ht?", ":"")+Q(Qt,!1,!1)+" "+_[At-1],St>0?ct+=Q(St,!0,nt):nt&&(ct+="th")}return ct},at=Q(z,!1,it);return at}let c={};E.forEach(function(z,it){c[z.toLowerCase()]=it}),d.forEach(function(z,it){c[z.toLowerCase()]=it}),x.forEach(function(z,it){let Q=z.toLowerCase();c[Q]=(it+2)*10,c[Q.substring(0,z.length-1)+"ieth"]=c[Q]}),c.hundredth=100,_.forEach(function(z,it){let Q=z.toLowerCase(),at=Math.pow(10,(it+1)*3);c[Q]=at,c[Q+"th"]=at});function g(z){let Q=z.split(/,\s|\sand\s|[\s\\-]/).map(ht=>c[ht]),at=[0];return Q.forEach(ht=>{if(ht<100){let nt=at.pop();nt>=1e3&&(at.push(nt),nt=0),at.push(nt+ht)}else at.push(at.pop()*ht)}),at.reduce((ht,nt)=>ht+nt,0)}let y=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],T={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function w(z){for(var it=0;it<y.length;it++){let Q=y[it];if(z>=Q[0])return Q[1]+w(z-Q[0])}return""}function R(z){for(var it=0,Q=1,at=z.length-1;at>=0;at--){let lt=z[at],ht=T[lt];ht<Q?it-=ht:(Q=ht,it+=ht)}return it}function M(z,it){for(var Q=[],at=it.charCodeAt(0);z>0;)Q.unshift(String.fromCharCode((z-1)%26+at)),z=Math.floor((z-1)/26);return Q.join("")}function J(z,it){for(var Q=it.charCodeAt(0),at=0,lt=0;lt<z.length;lt++)at+=(z.charCodeAt(z.length-lt-1)-Q+1)*Math.pow(26,lt);return at}function W(z,it){if(typeof z>"u")return;z=Math.floor(z);let Q=gt(it);return st(z,Q)}let j={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},ot={UPPER:"upper",LOWER:"lower",TITLE:"title"};function st(z,it){let Q,at=z<0;switch(z=Math.abs(z),it.primary){case j.LETTERS:Q=M(z,it.case===ot.UPPER?"A":"a");break;case j.ROMAN:Q=w(z),it.case===ot.UPPER&&(Q=Q.toUpperCase());break;case j.WORDS:Q=u(z,it.ordinal),it.case===ot.UPPER?Q=Q.toUpperCase():it.case===ot.LOWER&&(Q=Q.toLowerCase());break;case j.DECIMAL:Q=""+z;var lt=it.mandatoryDigits-Q.length;if(lt>0){var ht=new Array(lt+1).join("0");Q=ht+Q}if(it.zeroCode!==48&&(Q=p(Q).map(Kt=>String.fromCodePoint(Kt.codePointAt(0)+it.zeroCode-48)).join("")),it.regular){let Kt=Math.floor((Q.length-1)/it.groupingSeparators.position);for(let Qt=Kt;Qt>0;Qt--){let St=Q.length-Qt*it.groupingSeparators.position;Q=Q.substr(0,St)+it.groupingSeparators.character+Q.substr(St)}}else it.groupingSeparators.reverse().forEach(Kt=>{let Qt=Q.length-Kt.position;Q=Q.substr(0,Qt)+Kt.character+Q.substr(Qt)});if(it.ordinal){var nt={1:"st",2:"nd",3:"rd"},ct=Q[Q.length-1],At=nt[ct];(!At||Q.length>1&&Q[Q.length-2]==="1")&&(At="th"),Q=Q+At}break;case j.SEQUENCE:throw{code:"D3130",value:it.token}}return at&&(Q="-"+Q),Q}let kt=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function gt(z){let it={type:"integer",primary:j.DECIMAL,case:ot.LOWER,ordinal:!1},Q,at,lt=z.lastIndexOf(";");switch(lt===-1?Q=z:(Q=z.substring(0,lt),at=z.substring(lt+1),at[0]==="o"&&(it.ordinal=!0)),Q){case"A":it.case=ot.UPPER;case"a":it.primary=j.LETTERS;break;case"I":it.case=ot.UPPER;case"i":it.primary=j.ROMAN;break;case"W":it.case=ot.UPPER,it.primary=j.WORDS;break;case"Ww":it.case=ot.TITLE,it.primary=j.WORDS;break;case"w":it.primary=j.WORDS;break;default:{let ht=null,nt=0,ct=0,At=[],Kt=0;if(p(Q).map(St=>St.codePointAt(0)).reverse().forEach(St=>{let Nt=!1;for(let Yt=0;Yt<kt.length;Yt++){let Tt=kt[Yt];if(St>=Tt&&St<=Tt+9){if(Nt=!0,nt++,Kt++,ht===null)ht=Tt;else if(Tt!==ht)throw{code:"D3131"};break}}Nt||(St===35?(Kt++,ct++):At.push({position:Kt,character:String.fromCodePoint(St)}))}),nt>0){it.primary=j.DECIMAL,it.zeroCode=ht,it.mandatoryDigits=nt,it.optionalDigits=ct;let Nt=function(Yt){if(Yt.length===0)return 0;let Tt=Yt[0].character;for(let Te=1;Te<Yt.length;Te++)if(Yt[Te].character!==Tt)return 0;let be=Yt.map(Te=>Te.position),$e=function(Te,Lt){return Lt===0?Te:$e(Lt,Te%Lt)},Ne=be.reduce($e);for(let Te=1;Te<=be.length;Te++)if(be.indexOf(Te*Ne)===-1)return 0;return Ne}(At);Nt>0?(it.regular=!0,it.groupingSeparators={position:Nt,character:At[0].character}):(it.regular=!1,it.groupingSeparators=At)}else it.primary=j.SEQUENCE,it.token=Q}}return it}let qt={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function Vt(z){var it=[];let Q={type:"datetime",parts:it},at=function(Nt,Yt){if(Yt>Nt){let Tt=z.substring(Nt,Yt);Tt=Tt.split("]]").join("]"),it.push({type:"literal",value:Tt})}};for(var lt=0,ht=0;ht<z.length;){if(z.charAt(ht)==="["){if(z.charAt(ht+1)==="["){at(lt,ht),it.push({type:"literal",value:"["}),ht+=2,lt=ht;continue}if(at(lt,ht),lt=ht,ht=z.indexOf("]",lt),ht===-1)throw{code:"D3135"};let Nt=z.substring(lt+1,ht);Nt=Nt.split(/\s+/).join("");var nt={type:"marker",component:Nt.charAt(0)},ct=Nt.lastIndexOf(","),At;if(ct!==-1){let Yt=Nt.substring(ct+1),Tt=Yt.indexOf("-"),be,$e,Ne=function(Lt){if(!(typeof Lt>"u"||Lt==="*"))return parseInt(Lt)};Tt===-1?be=Yt:(be=Yt.substring(0,Tt),$e=Yt.substring(Tt+1));let Te={min:Ne(be),max:Ne($e)};nt.width=Te,At=Nt.substring(1,ct)}else At=Nt.substring(1);if(At.length===1)nt.presentation1=At;else if(At.length>1){var Kt=At.charAt(At.length-1);"atco".indexOf(Kt)!==-1?(nt.presentation2=Kt,Kt==="o"&&(nt.ordinal=!0),nt.presentation1=At.substring(0,At.length-1)):nt.presentation1=At}else nt.presentation1=qt[nt.component];if(typeof nt.presentation1>"u")throw{code:"D3132",value:nt.component};if(nt.presentation1[0]==="n")nt.names=ot.LOWER;else if(nt.presentation1[0]==="N")nt.presentation1[1]==="n"?nt.names=ot.TITLE:nt.names=ot.UPPER;else if("YMDdFWwXxHhmsf".indexOf(nt.component)!==-1){var Qt=nt.presentation1;if(nt.presentation2&&(Qt+=";"+nt.presentation2),nt.integerFormat=gt(Qt),nt.width&&nt.width.min!==void 0&&nt.integerFormat.mandatoryDigits<nt.width.min&&(nt.integerFormat.mandatoryDigits=nt.width.min),"YMD".indexOf(nt.component)!==-1)if(nt.n=-1,nt.width&&nt.width.max!==void 0)nt.n=nt.width.max,nt.integerFormat.mandatoryDigits=nt.n;else{var St=nt.integerFormat.mandatoryDigits+nt.integerFormat.optionalDigits;St>=2&&(nt.n=St)}}(nt.component==="Z"||nt.component==="z")&&(nt.integerFormat=gt(nt.presentation1)),it.push(nt),lt=ht+1}ht++}return at(lt,ht),Q}let Jt=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],fe=["January","February","March","April","May","June","July","August","September","October","November","December"],Ye=1e3*60*60*24,Zt=function(z){let it=Date.UTC(z.year,z.month);var Q=new Date(it).getUTCDay();return Q===0&&(Q=7),Q>4?it+(8-Q)*Ye:it-(Q-1)*Ye},Bt=function(z,it){return{year:z,month:it,nextMonth:function(){return it===11?Bt(z+1,0):Bt(z,it+1)},previousMonth:function(){return it===0?Bt(z-1,11):Bt(z,it-1)},nextYear:function(){return Bt(z+1,it)},previousYear:function(){return Bt(z-1,it)}}},te=function(z,it){return(it-z)/(Ye*7)+1},Ot=(z,it)=>{let Q;switch(it){case"Y":Q=z.getUTCFullYear();break;case"M":Q=z.getUTCMonth()+1;break;case"D":Q=z.getUTCDate();break;case"d":{let at=Date.UTC(z.getUTCFullYear(),z.getUTCMonth(),z.getUTCDate()),lt=Date.UTC(z.getUTCFullYear(),0);Q=(at-lt)/Ye+1;break}case"F":Q=z.getUTCDay(),Q===0&&(Q=7);break;case"W":{let at=Bt(z.getUTCFullYear(),0),lt=Zt(at),ht=Date.UTC(at.year,z.getUTCMonth(),z.getUTCDate()),nt=te(lt,ht);if(nt>52){let ct=Zt(at.nextYear());ht>=ct&&(nt=1)}else if(nt<1){let ct=Zt(at.previousYear());nt=te(ct,ht)}Q=Math.floor(nt);break}case"w":{let at=Bt(z.getUTCFullYear(),z.getUTCMonth()),lt=Zt(at),ht=Date.UTC(at.year,at.month,z.getUTCDate()),nt=te(lt,ht);if(nt>4){let ct=Zt(at.nextMonth());ht>=ct&&(nt=1)}else if(nt<1){let ct=Zt(at.previousMonth());nt=te(ct,ht)}Q=Math.floor(nt);break}case"X":{let at=Bt(z.getUTCFullYear(),0),lt=Zt(at),ht=Zt(at.nextYear()),nt=z.getTime();nt<lt?Q=at.year-1:nt>=ht?Q=at.year+1:Q=at.year;break}case"x":{let at=Bt(z.getUTCFullYear(),z.getUTCMonth()),lt=Zt(at),ht=at.nextMonth(),nt=Zt(ht),ct=z.getTime();ct<lt?Q=at.previousMonth().month+1:ct>=nt?Q=ht.month+1:Q=at.month+1;break}case"H":Q=z.getUTCHours();break;case"h":Q=z.getUTCHours(),Q=Q%12,Q===0&&(Q=12);break;case"P":Q=z.getUTCHours()>=12?"pm":"am";break;case"m":Q=z.getUTCMinutes();break;case"s":Q=z.getUTCSeconds();break;case"f":Q=z.getUTCMilliseconds();break;case"Z":case"z":break;case"C":Q="ISO";break;case"E":Q="ISO";break}return Q},pe=null;function Wt(z,it,Q){var at=0,lt=0;if(typeof Q<"u"){let Qt=parseInt(Q);at=Math.floor(Qt/100),lt=Qt%100}var ht=function(Qt,St){var Nt=Ot(Qt,St.component);if("YMDdFWwXxHhms".indexOf(St.component)!==-1)if(St.component==="Y"&&St.n!==-1&&(Nt=Nt%Math.pow(10,St.n)),St.names){if(St.component==="M"||St.component==="x")Nt=fe[Nt-1];else if(St.component==="F")Nt=Jt[Nt];else throw{code:"D3133",value:St.component};St.names===ot.UPPER?Nt=Nt.toUpperCase():St.names===ot.LOWER&&(Nt=Nt.toLowerCase()),St.width&&Nt.length>St.width.max&&(Nt=Nt.substring(0,St.width.max))}else Nt=st(Nt,St.integerFormat);else if(St.component==="f")Nt=st(Nt,St.integerFormat);else if(St.component==="Z"||St.component==="z"){let Yt=at*100+lt;if(St.integerFormat.regular)Nt=st(Yt,St.integerFormat);else{let Tt=St.integerFormat.mandatoryDigits;if(Tt===1||Tt===2)Nt=st(at,St.integerFormat),lt!==0&&(Nt+=":"+W(lt,"00"));else if(Tt===3||Tt===4)Nt=st(Yt,St.integerFormat);else throw{code:"D3134",value:Tt}}Yt>=0&&(Nt="+"+Nt),St.component==="z"&&(Nt="GMT"+Nt),Yt===0&&St.presentation2==="t"&&(Nt="Z")}return Nt};let nt;typeof it>"u"?(pe===null&&(pe=Vt("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),nt=pe):nt=Vt(it);let ct=(60*at+lt)*60*1e3,At=new Date(z+ct),Kt="";return nt.parts.forEach(function(Qt){Qt.type==="literal"?Kt+=Qt.value:Kt+=ht(At,Qt)}),Kt}function B(z){var it={};if(z.type==="datetime")it.type="datetime",it.parts=z.parts.map(function(Q){var at={};if(Q.type==="literal")at.regex=Q.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if(Q.component==="Z"||Q.component==="z"){let ht;Array.isArray(Q.integerFormat.groupingSeparators)||(ht=Q.integerFormat.groupingSeparators),at.regex="",Q.component==="z"&&(at.regex="GMT"),at.regex+="[-+][0-9]+",ht&&(at.regex+=ht.character+"[0-9]+"),at.parse=function(nt){Q.component==="z"&&(nt=nt.substring(3));let ct=0,At=0;return ht?(ct=Number.parseInt(nt.substring(0,nt.indexOf(ht.character))),At=Number.parseInt(nt.substring(nt.indexOf(ht.character)+1))):nt.length-1<=2?ct=Number.parseInt(nt):(ct=Number.parseInt(nt.substring(0,3)),At=Number.parseInt(nt.substring(3))),ct*60+At}}else if(Q.integerFormat)Q.integerFormat.n=Q.n,at=B(Q.integerFormat);else{at.regex="[a-zA-Z]+";var lt={};if(Q.component==="M"||Q.component==="x")fe.forEach(function(ht,nt){Q.width&&Q.width.max?lt[ht.substring(0,Q.width.max)]=nt+1:lt[ht]=nt+1});else if(Q.component==="F")Jt.forEach(function(ht,nt){nt>0&&(Q.width&&Q.width.max?lt[ht.substring(0,Q.width.max)]=nt:lt[ht]=nt)});else if(Q.component==="P")lt={am:0,AM:0,pm:1,PM:1};else throw{code:"D3133",value:Q.component};at.parse=function(ht){return lt[ht]}}return at.component=Q.component,at});else{it.type="integer";let Q=z.case===ot.UPPER,at;switch(z.n&&z.n>0?z.optionalDigits===0?at=`{${z.n}}`:at=`{${z.n-z.optionalDigits},${z.n}}`:at="+",z.primary){case j.LETTERS:it.regex=Q?"[A-Z]+":"[a-z]+",it.parse=function(lt){return J(lt,Q?"A":"a")};break;case j.ROMAN:it.regex=Q?"[MDCLXVI]+":"[mdclxvi]+",it.parse=function(lt){return R(Q?lt:lt.toUpperCase())};break;case j.WORDS:it.regex="(?:"+Object.keys(c).concat("and","[\\-, ]").join("|")+")+",it.parse=function(lt){return g(lt.toLowerCase())};break;case j.DECIMAL:it.regex=`[0-9]${at}`,z.ordinal&&(it.regex+="(?:th|st|nd|rd)"),it.parse=function(lt){let ht=lt;return z.ordinal&&(ht=lt.substring(0,lt.length-2)),z.regular?ht=ht.split(",").join(""):z.groupingSeparators.forEach(nt=>{ht=ht.split(nt.character).join("")}),z.zeroCode!==48&&(ht=ht.split("").map(nt=>String.fromCodePoint(nt.codePointAt(0)-z.zeroCode+48)).join("")),parseInt(ht)};break;case j.SEQUENCE:throw{code:"D3130",value:z.token}}}return it}function V(z,it){if(typeof z>"u")return;let Q=gt(it);return B(Q).parse(z)}function Et(z,it){let Q=Vt(it),at=B(Q),lt="^"+at.parts.map(At=>"("+At.regex+")").join("")+"$";var nt=new RegExp(lt,"i").exec(z);if(nt!==null){let Tt={};for(let D=1;D<nt.length;D++){let C=at.parts[D-1];C.parse&&(Tt[C.component]=C.parse(nt[D]))}if(Object.getOwnPropertyNames(Tt).length===0)return;let be=0,$e=D=>{be<<=1,be+=D?1:0},Ne=D=>!(~D&be)&&!!(D&be);"YXMxWwdD".split("").forEach(D=>$e(Tt[D]));let Lt=!Ne(161)&&Ne(130),xi=Ne(84),wi=!xi&&Ne(72);be=0,"PHhmsf".split("").forEach(D=>$e(Tt[D]));let dt=!Ne(23)&&Ne(47),Ze=(Lt?"YD":xi?"XxwF":wi?"XWF":"YMD")+(dt?"Phmsf":"Hmsf"),Ji=this.environment.timestamp,li=!1,ci=!1;if(Ze.split("").forEach(D=>{if(typeof Tt[D]>"u")li?(Tt[D]="MDd".indexOf(D)!==-1?1:0,ci=!0):Tt[D]=Ot(Ji,D);else if(li=!0,ci)throw{code:"D3136"}}),Tt.M>0?Tt.M-=1:Tt.M=0,Lt){let D=Date.UTC(Tt.Y,0),C=(Tt.d-1)*1e3*60*60*24,A=new Date(D+C);Tt.M=A.getUTCMonth(),Tt.D=A.getUTCDate()}if(xi)throw{code:"D3136"};if(wi)throw{code:"D3136"};dt&&(Tt.H=Tt.h===12?0:Tt.h,Tt.P===1&&(Tt.H+=12));var ct=Date.UTC(Tt.Y,Tt.M,Tt.D,Tt.H,Tt.m,Tt.s,Tt.f);return(Tt.Z||Tt.z)&&(ct-=(Tt.Z||Tt.z)*60*1e3),ct}}var Ht=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");function ne(z,it){if(!(typeof z>"u"))if(typeof it>"u"){if(!Ht.test(z))throw{stack:new Error().stack,code:"D3110",value:z};return Date.parse(z)}else return Et.call(this,z,it)}function se(z,it,Q){if(!(typeof z>"u"))return Wt.call(this,z,it,Q)}return{formatInteger:W,parseInteger:V,fromMillis:se,toMillis:ne}}();r.exports=f},{"./utils":6}],2:[function(i,r,o){(function(h){(function(){var f=i("./utils");let p=(()=>{"use strict";var E=f.isNumeric,d=f.isArrayOfStrings,x=f.isArrayOfNumbers,_=f.createSequence,u=f.isSequence,c=f.isFunction,g=f.isLambda,y=f.isIterable,T=f.getFunctionArity,w=f.isDeepEqual,R=f.stringToArray;function M(k){if(!(typeof k>"u")){var S=0;return k.forEach(function(O){S+=O}),S}}function J(k){return typeof k>"u"?0:k.length}function W(k){if(!(typeof k>"u"||k.length===0))return Math.max.apply(Math,k)}function j(k){if(!(typeof k>"u"||k.length===0))return Math.min.apply(Math,k)}function ot(k){if(!(typeof k>"u"||k.length===0)){var S=0;return k.forEach(function(O){S+=O}),S/k.length}}function st(k,S=!1){if(!(typeof k>"u")){var O;if(typeof k=="string")O=k;else if(c(k))O="";else{if(typeof k=="number"&&!isFinite(k))throw{code:"D3001",value:k,stack:new Error().stack};var G=S?2:0;Array.isArray(k)&&k.outerWrapper&&(k=k[0]),O=JSON.stringify(k,function(K,tt){return typeof tt<"u"&&tt!==null&&tt.toPrecision&&E(tt)?Number(tt.toPrecision(15)):tt&&c(tt)?"":tt},G)}return O}}function kt(k,S,O){if(!(typeof k>"u")){var G=R(k),K=G.length;if(K+S<0&&(S=0),typeof O<"u"){if(O<=0)return"";var tt=S>=0?S+O:K+S+O;return G.slice(S,tt).join("")}return G.slice(S).join("")}}function gt(k,S){if(!(typeof k>"u")){var O=k.indexOf(S);return O>-1?k.substr(0,O):k}}function qt(k,S){if(!(typeof k>"u")){var O=k.indexOf(S);return O>-1?k.substr(O+S.length):k}}function Vt(k){if(!(typeof k>"u"))return k.toLowerCase()}function Jt(k){if(!(typeof k>"u"))return k.toUpperCase()}function fe(k){if(!(typeof k>"u"))return R(k).length}function Ye(k){if(!(typeof k>"u")){var S=k.replace(/[ \t\n\r]+/gm," ");return S.charAt(0)===" "&&(S=S.substring(1)),S.charAt(S.length-1)===" "&&(S=S.substring(0,S.length-1)),S}}function Zt(k,S,O){if(!(typeof k>"u")){(typeof O>"u"||O.length===0)&&(O=" ");var G,K=Math.abs(S)-fe(k);if(K>0){var tt=new Array(K+1).join(O);O.length>1&&(tt=kt(tt,0,K)),S>0?G=k+tt:G=tt+k}else G=k;return G}}function*Bt(k,S){var O=k.apply(this,[S]);if(y(O)&&(O=yield*O),O&&!(typeof O.start=="number"||O.end==="number"||Array.isArray(O.groups)||c(O.next)))throw{code:"T1010",stack:new Error().stack};return O}function*te(k,S){if(!(typeof k>"u")){var O;if(typeof S=="string")O=k.indexOf(S)!==-1;else{var G=yield*Bt(S,k);O=typeof G<"u"}return O}}function*Ot(k,S,O){if(!(typeof k>"u")){if(O<0)throw{stack:new Error().stack,value:O,code:"D3040",index:3};var G=_();if(typeof O>"u"||O>0){var K=0,tt=yield*Bt(S,k);if(typeof tt<"u")for(;typeof tt<"u"&&(typeof O>"u"||K<O);)G.push({match:tt.match,index:tt.start,groups:tt.groups}),tt=yield*Bt(tt.next),K++}return G}}function*pe(k,S,O,G){if(!(typeof k>"u")){var K=this;if(S==="")throw{code:"D3010",stack:new Error().stack,value:S,index:2};if(G<0)throw{code:"D3011",stack:new Error().stack,value:G,index:4};var tt;typeof O=="string"?tt=function(ae){for(var we="",he=0,ti=O.indexOf("$",he);ti!==-1&&he<O.length;){we+=O.substring(he,ti),he=ti+1;var Ue=O.charAt(he);if(Ue==="$")we+="$",he++;else if(Ue==="0")we+=ae.match,he++;else{var ei;if(ae.groups.length===0?ei=1:ei=Math.floor(Math.log(ae.groups.length)*Math.LOG10E)+1,ti=parseInt(O.substring(he,he+ei),10),ei>1&&ti>ae.groups.length&&(ti=parseInt(O.substring(he,he+ei-1),10)),isNaN(ti))we+="$";else{if(ae.groups.length>0){var dn=ae.groups[ti-1];typeof dn<"u"&&(we+=dn)}he+=ti.toString().length}}ti=O.indexOf("$",he)}return we+=O.substring(he),we}:tt=O;var ft="",Ct=0;if(typeof G>"u"||G>0){var Rt=0;if(typeof S=="string"){for(var Xt=k.indexOf(S,Ct);Xt!==-1&&(typeof G>"u"||Rt<G);)ft+=k.substring(Ct,Xt),ft+=O,Ct=Xt+S.length,Rt++,Xt=k.indexOf(S,Ct);ft+=k.substring(Ct)}else{var ee=yield*Bt(S,k);if(typeof ee<"u"){for(;typeof ee<"u"&&(typeof G>"u"||Rt<G);){ft+=k.substring(Ct,ee.start);var re=tt.apply(K,[ee]);if(y(re)&&(re=yield*re),typeof re=="string")ft+=re;else throw{code:"D3012",stack:new Error().stack,value:re};Ct=ee.start+ee.match.length,Rt++,ee=yield*Bt(ee.next)}ft+=k.substring(Ct)}else ft=k}}else ft=k;return ft}}function Wt(k){if(!(typeof k>"u")){var S=typeof window<"u"?window.btoa:function(O){return new h.Buffer.from(O,"binary").toString("base64")};return S(k)}}function B(k){if(!(typeof k>"u")){var S=typeof window<"u"?window.atob:function(O){return new h.Buffer.from(O,"base64").toString("binary")};return S(k)}}function V(k){if(!(typeof k>"u")){var S;try{S=encodeURIComponent(k)}catch{throw{code:"D3140",stack:new Error().stack,value:k,functionName:"encodeUrlComponent"}}return S}}function Et(k){if(!(typeof k>"u")){var S;try{S=encodeURI(k)}catch{throw{code:"D3140",stack:new Error().stack,value:k,functionName:"encodeUrl"}}return S}}function Ht(k){if(!(typeof k>"u")){var S;try{S=decodeURIComponent(k)}catch{throw{code:"D3140",stack:new Error().stack,value:k,functionName:"decodeUrlComponent"}}return S}}function ne(k){if(!(typeof k>"u")){var S;try{S=decodeURI(k)}catch{throw{code:"D3140",stack:new Error().stack,value:k,functionName:"decodeUrl"}}return S}}function*se(k,S,O){if(!(typeof k>"u")){if(O<0)throw{code:"D3020",stack:new Error().stack,value:O,index:3};var G=[];if(typeof O>"u"||O>0)if(typeof S=="string")G=k.split(S,O);else{var K=0,tt=yield*Bt(S,k);if(typeof tt<"u"){for(var ft=0;typeof tt<"u"&&(typeof O>"u"||K<O);)G.push(k.substring(ft,tt.start)),ft=tt.end,tt=yield*Bt(tt.next),K++;(typeof O>"u"||K<O)&&G.push(k.substring(ft))}else G.push(k)}return G}}function z(k,S){if(!(typeof k>"u"))return typeof S>"u"&&(S=""),k.join(S)}function it(k,S,O){if(!(typeof k>"u")){var G={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"\u2030","zero-digit":"0",digit:"#","pattern-separator":";"},K=G;typeof O<"u"&&Object.keys(O).forEach(function(wt){K[wt]=O[wt]});for(var tt=[],ft=K["zero-digit"].charCodeAt(0),Ct=ft;Ct<ft+10;Ct++)tt.push(String.fromCharCode(Ct));var Rt=tt.concat([K["decimal-separator"],K["exponent-separator"],K["grouping-separator"],K.digit,K["pattern-separator"]]),Xt=S.split(K["pattern-separator"]);if(Xt.length>2)throw{code:"D3080",stack:new Error().stack};var ee=function(wt){var ge=function(){for(var Se,si=0;si<wt.length;si++)if(Se=wt.charAt(si),Rt.indexOf(Se)!==-1&&Se!==K["exponent-separator"])return wt.substring(0,si)}(),He=function(){for(var Se,si=wt.length-1;si>=0;si--)if(Se=wt.charAt(si),Rt.indexOf(Se)!==-1&&Se!==K["exponent-separator"])return wt.substring(si+1)}(),xe=wt.substring(ge.length,wt.length-He.length),Xe,Ri,ii,Xi,ni=wt.indexOf(K["exponent-separator"],ge.length);ni===-1||ni>wt.length-He.length?(Xe=xe,Ri=void 0):(Xe=xe.substring(0,ni),Ri=xe.substring(ni+1));var Di=Xe.indexOf(K["decimal-separator"]);return Di===-1?(ii=Xe,Xi=He):(ii=Xe.substring(0,Di),Xi=Xe.substring(Di+1)),{prefix:ge,suffix:He,activePart:xe,mantissaPart:Xe,exponentPart:Ri,integerPart:ii,fractionalPart:Xi,subpicture:wt}},re=function(wt){var ge,He,xe=wt.subpicture,Xe=xe.indexOf(K["decimal-separator"]);Xe!==xe.lastIndexOf(K["decimal-separator"])&&(ge="D3081"),xe.indexOf(K.percent)!==xe.lastIndexOf(K.percent)&&(ge="D3082"),xe.indexOf(K["per-mille"])!==xe.lastIndexOf(K["per-mille"])&&(ge="D3083"),xe.indexOf(K.percent)!==-1&&xe.indexOf(K["per-mille"])!==-1&&(ge="D3084");var Ri=!1;for(He=0;He<wt.mantissaPart.length;He++){var ii=wt.mantissaPart.charAt(He);if(tt.indexOf(ii)!==-1||ii===K.digit){Ri=!0;break}}Ri||(ge="D3085");var Xi=wt.activePart.split("").map(function(Se){return Rt.indexOf(Se)===-1?"p":"a"}).join("");Xi.indexOf("p")!==-1&&(ge="D3086"),Xe!==-1?(xe.charAt(Xe-1)===K["grouping-separator"]||xe.charAt(Xe+1)===K["grouping-separator"])&&(ge="D3087"):wt.integerPart.charAt(wt.integerPart.length-1)===K["grouping-separator"]&&(ge="D3088"),xe.indexOf(K["grouping-separator"]+K["grouping-separator"])!==-1&&(ge="D3089");var ni=wt.integerPart.indexOf(K.digit);ni!==-1&&wt.integerPart.substring(0,ni).split("").filter(function(Se){return tt.indexOf(Se)>-1}).length>0&&(ge="D3090"),ni=wt.fractionalPart.lastIndexOf(K.digit),ni!==-1&&wt.fractionalPart.substring(ni).split("").filter(function(Se){return tt.indexOf(Se)>-1}).length>0&&(ge="D3091");var Di=typeof wt.exponentPart=="string";if(Di&&wt.exponentPart.length>0&&(xe.indexOf(K.percent)!==-1||xe.indexOf(K["per-mille"])!==-1)&&(ge="D3092"),Di&&(wt.exponentPart.length===0||wt.exponentPart.split("").filter(function(Se){return tt.indexOf(Se)===-1}).length>0)&&(ge="D3093"),ge)throw{code:ge,stack:new Error().stack}},ae=function(wt){var ge=function(Oe,Vn){for(var ji=[],Bi=Oe.indexOf(K["grouping-separator"]);Bi!==-1;){var Gn=(Vn?Oe.substring(0,Bi):Oe.substring(Bi)).split("").filter(function(gn){return tt.indexOf(gn)!==-1||gn===K.digit}).length;ji.push(Gn),Bi=wt.integerPart.indexOf(K["grouping-separator"],Bi+1)}return ji},He=ge(wt.integerPart),xe=function(Oe){if(Oe.length===0)return 0;for(var Vn=function(Gn,gn){return gn===0?Gn:Vn(gn,Gn%gn)},ji=Oe.reduce(Vn),Bi=1;Bi<=Oe.length;Bi++)if(Oe.indexOf(Bi*ji)===-1)return 0;return ji},Xe=xe(He),Ri=ge(wt.fractionalPart,!0),ii=wt.integerPart.split("").filter(function(Oe){return tt.indexOf(Oe)!==-1}).length,Xi=ii,ni=wt.fractionalPart.split(""),Di=ni.filter(function(Oe){return tt.indexOf(Oe)!==-1}).length,Se=ni.filter(function(Oe){return tt.indexOf(Oe)!==-1||Oe===K.digit}).length,si=typeof wt.exponentPart=="string";ii===0&&Se===0&&(si?(Di=1,Se=1):ii=1),si&&ii===0&&wt.integerPart.indexOf(K.digit)!==-1&&(ii=1),ii===0&&Di===0&&(Di=1);var kr=0;return si&&(kr=wt.exponentPart.split("").filter(function(Oe){return tt.indexOf(Oe)!==-1}).length),{integerPartGroupingPositions:He,regularGrouping:Xe,minimumIntegerPartSize:ii,scalingFactor:Xi,prefix:wt.prefix,fractionalPartGroupingPositions:Ri,minimumFactionalPartSize:Di,maximumFactionalPartSize:Se,minimumExponentSize:kr,suffix:wt.suffix,picture:wt.subpicture}},we=Xt.map(ee);we.forEach(re);var he=we.map(ae),ti=K["minus-sign"],Ue=K["zero-digit"],ei=K["decimal-separator"],dn=K["grouping-separator"];he.length===1&&(he.push(JSON.parse(JSON.stringify(he[0]))),he[1].prefix=ti+he[1].prefix);var Ae;k>=0?Ae=he[0]:Ae=he[1];var Nn;Ae.picture.indexOf(K.percent)!==-1?Nn=k*100:Ae.picture.indexOf(K["per-mille"])!==-1?Nn=k*1e3:Nn=k;var Yi,mn;if(Ae.minimumExponentSize===0)Yi=Nn;else{var mr=Math.pow(10,Ae.scalingFactor),gr=Math.pow(10,Ae.scalingFactor-1);for(Yi=Nn,mn=0;Yi<gr;)Yi*=10,mn-=1;for(;Yi>mr;)Yi/=10,mn+=1}var xr=ct(Yi,Ae.maximumFactionalPartSize),_r=function(wt,ge){var He=Math.abs(wt).toFixed(ge);return Ue!=="0"&&(He=He.split("").map(function(xe){return xe>="0"&&xe<="9"?tt[xe.charCodeAt(0)-48]:xe}).join("")),He},Gt=_r(xr,Ae.maximumFactionalPartSize),We=Gt.indexOf(".");for(We===-1?Gt=Gt+ei:Gt=Gt.replace(".",ei);Gt.charAt(0)===Ue;)Gt=Gt.substring(1);for(;Gt.charAt(Gt.length-1)===Ue;)Gt=Gt.substring(0,Gt.length-1);We=Gt.indexOf(ei);var Wn=Ae.minimumIntegerPartSize-We,Ns=Ae.minimumFactionalPartSize-(Gt.length-We-1);if(Gt=(Wn>0?new Array(Wn+1).join(Ue):"")+Gt,Gt=Gt+(Ns>0?new Array(Ns+1).join(Ue):""),We=Gt.indexOf(ei),Ae.regularGrouping>0)for(var Er=Math.floor((We-1)/Ae.regularGrouping),ss=1;ss<=Er;ss++)Gt=[Gt.slice(0,We-ss*Ae.regularGrouping),dn,Gt.slice(We-ss*Ae.regularGrouping)].join("");else Ae.integerPartGroupingPositions.forEach(function(wt){Gt=[Gt.slice(0,We-wt),dn,Gt.slice(We-wt)].join(""),We++});if(We=Gt.indexOf(ei),Ae.fractionalPartGroupingPositions.forEach(function(wt){Gt=[Gt.slice(0,wt+We+1),dn,Gt.slice(wt+We+1)].join("")}),We=Gt.indexOf(ei),(Ae.picture.indexOf(ei)===-1||We===Gt.length-1)&&(Gt=Gt.substring(0,Gt.length-1)),typeof mn<"u"){var Hn=_r(mn,0);Wn=Ae.minimumExponentSize-Hn.length,Wn>0&&(Hn=new Array(Wn+1).join(Ue)+Hn),Gt=Gt+K["exponent-separator"]+(mn<0?ti:"")+Hn}return Gt=Ae.prefix+Gt+Ae.suffix,Gt}}function Q(k,S){if(!(typeof k>"u")){if(k=ct(k),typeof S>"u"?S=10:S=ct(S),S<2||S>36)throw{code:"D3100",stack:new Error().stack,value:S};var O=k.toString(S);return O}}function at(k){var S;if(!(typeof k>"u")){if(typeof k=="number")S=k;else if(typeof k=="string"&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(k)&&!isNaN(parseFloat(k))&&isFinite(k))S=parseFloat(k);else if(k===!0)S=1;else if(k===!1)S=0;else throw{code:"D3030",value:k,stack:new Error().stack,index:1};return S}}function lt(k){var S;if(!(typeof k>"u"))return S=Math.abs(k),S}function ht(k){var S;if(!(typeof k>"u"))return S=Math.floor(k),S}function nt(k){var S;if(!(typeof k>"u"))return S=Math.ceil(k),S}function ct(k,S){var O;if(!(typeof k>"u")){if(S){var G=k.toString().split("e");k=+(G[0]+"e"+(G[1]?+G[1]+S:S))}O=Math.round(k);var K=O-k;return Math.abs(K)===.5&&Math.abs(O%2)===1&&(O=O-1),S&&(G=O.toString().split("e"),O=+(G[0]+"e"+(G[1]?+G[1]-S:-S))),Object.is(O,-0)&&(O=0),O}}function At(k){var S;if(!(typeof k>"u")){if(k<0)throw{stack:new Error().stack,code:"D3060",index:1,value:k};return S=Math.sqrt(k),S}}function Kt(k,S){var O;if(!(typeof k>"u")){if(O=Math.pow(k,S),!isFinite(O))throw{stack:new Error().stack,code:"D3061",index:1,value:k,exp:S};return O}}function Qt(){return Math.random()}function St(k){if(!(typeof k>"u")){var S=!1;if(Array.isArray(k)){if(k.length===1)S=St(k[0]);else if(k.length>1){var O=k.filter(function(G){return St(G)});S=O.length>0}}else typeof k=="string"?k.length>0&&(S=!0):E(k)?k!==0&&(S=!0):k!==null&&typeof k=="object"?Object.keys(k).length>0&&(S=!0):typeof k=="boolean"&&k===!0&&(S=!0);return S}}function Nt(k){if(!(typeof k>"u"))return!St(k)}function Yt(k,S,O,G){var K=[S],tt=T(k);return tt>=2&&K.push(O),tt>=3&&K.push(G),K}function*Tt(k,S){if(!(typeof k>"u")){for(var O=_(),G=0;G<k.length;G++){var K=Yt(S,k[G],G,k),tt=yield*S.apply(this,K);typeof tt<"u"&&O.push(tt)}return O}}function*be(k,S){if(!(typeof k>"u")){for(var O=_(),G=0;G<k.length;G++){var K=k[G],tt=Yt(S,K,G,k),ft=yield*S.apply(this,tt);St(ft)&&O.push(K)}return O}}function*$e(k,S){if(!(typeof k>"u")){for(var O=!1,G,K=0;K<k.length;K++){var tt=k[K],ft=!0;if(typeof S<"u"){var Ct=Yt(S,tt,K,k),Rt=yield*S.apply(this,Ct);ft=St(Rt)}if(ft)if(!O)G=tt,O=!0;else throw{stack:new Error().stack,code:"D3138",index:K}}if(!O)throw{stack:new Error().stack,code:"D3139"};return G}}function Ne(){for(var k=[],S=Array.prototype.slice.call(arguments),O=Math.min.apply(Math,S.map(function(tt){return Array.isArray(tt)?tt.length:0})),G=0;G<O;G++){var K=S.map(tt=>tt[G]);k.push(K)}return k}function*Te(k,S,O){if(!(typeof k>"u")){var G,K=T(S);if(K<2)throw{stack:new Error().stack,code:"D3050",index:1};var tt;for(typeof O>"u"&&k.length>0?(G=k[0],tt=1):(G=O,tt=0);tt<k.length;){var ft=[G,k[tt]];K>=3&&ft.push(tt),K>=4&&ft.push(k),G=yield*S.apply(this,ft),tt++}return G}}function Lt(k){var S=_();if(Array.isArray(k)){var O={};k.forEach(function(G){var K=Lt(G);K.forEach(function(tt){O[tt]=!0})}),S=Lt(O)}else k!==null&&typeof k=="object"&&!g(k)&&Object.keys(k).forEach(G=>S.push(G));return S}function xi(k,S){var O;if(Array.isArray(k)){O=_();for(var G=0;G<k.length;G++){var K=xi(k[G],S);typeof K<"u"&&(Array.isArray(K)?K.forEach(tt=>O.push(tt)):O.push(K))}}else k!==null&&typeof k=="object"&&(O=k[S]);return O}function wi(k,S){return typeof k>"u"?S:typeof S>"u"?k:(Array.isArray(k)||(k=_(k)),Array.isArray(S)||(S=[S]),k.concat(S))}function Oi(k){return!(typeof k>"u")}function dt(k){var S=_();if(Array.isArray(k))k.forEach(function(K){S=wi(S,dt(K))});else if(k!==null&&typeof k=="object"&&!g(k))for(var O in k){var G={};G[O]=k[O],S.push(G)}else S=k;return S}function pn(k){if(!(typeof k>"u")){var S={};return k.forEach(function(O){for(var G in O)S[G]=O[G]}),S}}function ui(k){if(!(typeof k>"u")){if(k.length<=1)return k;for(var S=k.length,O=new Array(S),G=0;G<S;G++)O[S-G-1]=k[G];return O}}function*Ze(k,S){var O=_();for(var G in k){var K=Yt(S,k[G],G,k),tt=yield*S.apply(this,K);typeof tt<"u"&&O.push(tt)}return O}function Ji(k){throw{code:"D3137",stack:new Error().stack,message:k||"$error() function evaluated"}}function li(k,S){if(!k)throw{code:"D3141",stack:new Error().stack,message:S||"$assert() statement failed"}}function ci(k){if(k!==void 0)return k===null?"null":E(k)?"number":typeof k=="string"?"string":typeof k=="boolean"?"boolean":Array.isArray(k)?"array":c(k)?"function":"object"}function*D(k,S){if(!(typeof k>"u")){if(k.length<=1)return k;var O;if(typeof S>"u"){if(!x(k)&&!d(k))throw{stack:new Error().stack,code:"D3070",index:1};O=function*(ft,Ct){return ft>Ct}}else O=S;var G=function*(ft,Ct){var Rt=function*(ee,re,ae){re.length===0?Array.prototype.push.apply(ee,ae):ae.length===0?Array.prototype.push.apply(ee,re):(yield*O(re[0],ae[0]))?(ee.push(ae[0]),yield*Rt(ee,re,ae.slice(1))):(ee.push(re[0]),yield*Rt(ee,re.slice(1),ae))},Xt=[];return yield*Rt(Xt,ft,Ct),Xt},K=function*(ft){if(!Array.isArray(ft)||ft.length<=1)return ft;var Ct=Math.floor(ft.length/2),Rt=ft.slice(0,Ct),Xt=ft.slice(Ct);return Rt=yield*K(Rt),Xt=yield*K(Xt),yield*G(Rt,Xt)},tt=yield*K(k);return tt}}function C(k){if(!(typeof k>"u")){if(k.length<=1)return k;for(var S=new Array(k.length),O=0;O<k.length;O++){var G=Math.floor(Math.random()*(O+1));O!==G&&(S[O]=S[G]),S[G]=k[O]}return S}}function A(k){if(!(typeof k>"u")){if(!Array.isArray(k)||k.length<=1)return k;for(var S=u(k)?_():[],O=0;O<k.length;O++){for(var G=k[O],K=!1,tt=0;tt<S.length;tt++)if(w(G,S[tt])){K=!0;break}K||S.push(G)}return S}}function*N(k,S){var O={};for(var G in k){var K=k[G],tt=Yt(S,K,G,k),ft=yield*S.apply(this,tt);St(ft)&&(O[G]=K)}return Object.keys(O).length===0&&(O=void 0),O}return{sum:M,count:J,max:W,min:j,average:ot,string:st,substring:kt,substringBefore:gt,substringAfter:qt,lowercase:Vt,uppercase:Jt,length:fe,trim:Ye,pad:Zt,match:Ot,contains:te,replace:pe,split:se,join:z,formatNumber:it,formatBase:Q,number:at,floor:ht,ceil:nt,round:ct,abs:lt,sqrt:At,power:Kt,random:Qt,boolean:St,not:Nt,map:Tt,zip:Ne,filter:be,single:$e,foldLeft:Te,sift:N,keys:Lt,lookup:xi,append:wi,exists:Oi,spread:dt,merge:pn,reverse:ui,each:Ze,error:Ji,assert:li,type:ci,sort:D,shuffle:C,distinct:A,base64encode:Wt,base64decode:B,encodeUrlComponent:V,encodeUrl:Et,decodeUrlComponent:Ht,decodeUrl:ne}})();r.exports=p}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./utils":6}],3:[function(i,r,o){var h=i("./datetime"),f=i("./functions"),p=i("./utils"),E=i("./parser"),d=i("./signature"),x=function(){"use strict";var _=p.isNumeric,u=p.isArrayOfStrings,c=p.isArrayOfNumbers,g=p.createSequence,y=p.isSequence,T=p.isFunction,w=p.isLambda,R=p.isIterable,M=p.getFunctionArity,J=p.isDeepEqual,W=Ze(null);function*j(D,C,A){var N,k=A.lookup("__evaluate_entry");switch(k&&k(D,C,A),D.type){case"path":N=yield*ot(D,C,A);break;case"binary":N=yield*Jt(D,C,A);break;case"unary":N=yield*fe(D,C,A);break;case"name":N=Ye(D,C,A);break;case"string":case"number":case"value":N=Zt(D,C,A);break;case"wildcard":N=Bt(D,C,A);break;case"descendant":N=Ot(D,C,A);break;case"parent":N=A.lookup(D.slot.label);break;case"condition":N=yield*lt(D,C,A);break;case"block":N=yield*ht(D,C,A);break;case"bind":N=yield*at(D,C,A);break;case"regex":N=nt(D,C,A);break;case"function":N=yield*Nt(D,C,A);break;case"variable":N=ct(D,C,A);break;case"lambda":N=be(D,C,A);break;case"partial":N=yield*$e(D,C,A);break;case"apply":N=yield*St(D,C,A);break;case"transform":N=Kt(D,C,A);break}if(A.async&&(typeof N>"u"||N===null||typeof N.then!="function")&&(N=Promise.resolve(N)),A.async&&typeof N.then=="function"&&D.nextFunction&&typeof N[D.nextFunction]=="function"||(N=yield N),Object.prototype.hasOwnProperty.call(D,"predicate"))for(var S=0;S<D.predicate.length;S++)N=yield*Vt(D.predicate[S].expr,N,A);D.type!=="path"&&Object.prototype.hasOwnProperty.call(D,"group")&&(N=yield*z(D.group,N,A));var O=A.lookup("__evaluate_exit");return O&&O(D,C,A,N),N&&y(N)&&!N.tupleStream&&(D.keepArray&&(N.keepSingleton=!0),N.length===0?N=void 0:N.length===1&&(N=N.keepSingleton?N:N[0])),N}function*ot(D,C,A){var N;Array.isArray(C)&&D.steps[0].type!=="variable"?N=C:N=g(C);for(var k,S=!1,O=void 0,G=0;G<D.steps.length;G++){var K=D.steps[G];if(K.tuple&&(S=!0),G===0&&K.consarray?k=yield*j(K,N,A):S?O=yield*qt(K,N,O,A):k=yield*kt(K,N,A,G===D.steps.length-1),!S&&(typeof k>"u"||k.length===0))break;typeof K.focus>"u"&&(N=k)}if(S)if(D.tuple)k=O;else for(k=g(),G=0;G<O.length;G++)k.push(O[G]["@"]);return D.keepSingletonArray&&(Array.isArray(k)&&k.cons&&!k.sequence&&(k=g(k)),k.keepSingleton=!0),D.hasOwnProperty("group")&&(k=yield*z(D.group,S?O:k,A)),k}function st(D,C){var A=Ze(D);for(let N in C)A.bind(N,C[N]);return A}function*kt(D,C,A,N){var k;if(D.type==="sort")return k=yield*At(D,C,A),D.stages&&(k=yield*gt(D.stages,k,A)),k;k=g();for(var S=0;S<C.length;S++){var O=yield*j(D,C[S],A);if(D.stages)for(var G=0;G<D.stages.length;G++)O=yield*Vt(D.stages[G].expr,O,A);typeof O<"u"&&k.push(O)}var K=g();return N&&k.length===1&&Array.isArray(k[0])&&!y(k[0])?K=k[0]:k.forEach(function(tt){!Array.isArray(tt)||tt.cons?K.push(tt):tt.forEach(ft=>K.push(ft))}),K}function*gt(D,C,A){for(var N=C,k=0;k<D.length;k++){var S=D[k];switch(S.type){case"filter":N=yield*Vt(S.expr,N,A);break;case"index":for(var O=0;O<N.length;O++){var G=N[O];G[S.value]=O}break}}return N}function*qt(D,C,A,N){var k;if(D.type==="sort"){if(A)k=yield*At(D,A,N);else{var S=yield*At(D,C,N);k=g(),k.tupleStream=!0;for(var O=0;O<S.length;O++){var G={"@":S[O]};G[D.index]=O,k.push(G)}}return D.stages&&(k=yield*gt(D.stages,k,N)),k}k=g(),k.tupleStream=!0;var K=N;A===void 0&&(A=C.map(Rt=>({"@":Rt})));for(var tt=0;tt<A.length;tt++){K=st(N,A[tt]);var ft=yield*j(D,A[tt]["@"],K);if(typeof ft<"u"){Array.isArray(ft)||(ft=[ft]);for(var Ct=0;Ct<ft.length;Ct++)G={},Object.assign(G,A[tt]),ft.tupleStream?Object.assign(G,ft[Ct]):(D.focus?(G[D.focus]=ft[Ct],G["@"]=A[tt]["@"]):G["@"]=ft[Ct],D.index&&(G[D.index]=Ct),D.ancestor&&(G[D.ancestor.label]=A[tt]["@"])),k.push(G)}}return D.stages&&(k=yield*gt(D.stages,k,N)),k}function*Vt(D,C,A){var N=g();if(C&&C.tupleStream&&(N.tupleStream=!0),Array.isArray(C)||(C=g(C)),D.type==="number"){var k=Math.floor(D.value);k<0&&(k=C.length+k);var S=C[k];typeof S<"u"&&(Array.isArray(S)?N=S:N.push(S))}else for(k=0;k<C.length;k++){var S=C[k],O=S,G=A;C.tupleStream&&(O=S["@"],G=st(A,S));var K=yield*j(D,O,G);_(K)&&(K=[K]),c(K)?K.forEach(function(ft){var Ct=Math.floor(ft);Ct<0&&(Ct=C.length+Ct),Ct===k&&N.push(S)}):f.boolean(K)&&N.push(S)}return N}function*Jt(D,C,A){var N,k=yield*j(D.lhs,C,A),S=D.value,O=function*(){return yield*j(D.rhs,C,A)};if(S==="and"||S==="or")try{return yield*Ht(k,O,S)}catch(K){throw K.position=D.position,K.token=S,K}var G=yield*O();try{switch(S){case"+":case"-":case"*":case"/":case"%":N=Wt(k,G,S);break;case"=":case"!=":N=B(k,G,S);break;case"<":case"<=":case">":case">=":N=V(k,G,S);break;case"&":N=se(k,G);break;case"..":N=Q(k,G);break;case"in":N=Et(k,G);break}}catch(K){throw K.position=D.position,K.token=S,K}return N}function*fe(D,C,A){var N;switch(D.value){case"-":if(N=yield*j(D.expression,C,A),typeof N>"u")N=void 0;else if(_(N))N=-N;else throw{code:"D1002",stack:new Error().stack,position:D.position,token:D.value,value:N};break;case"[":N=[];for(var k=0;k<D.expressions.length;k++){var S=D.expressions[k],O=yield*j(S,C,A);typeof O<"u"&&(S.value==="["?N.push(O):N=f.append(N,O))}D.consarray&&Object.defineProperty(N,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":N=yield*z(D,C,A);break}return N}function Ye(D,C,A){return f.lookup(C,D.value)}function Zt(D){return D.value}function Bt(D,C){var A=g();return Array.isArray(C)&&C.outerWrapper&&C.length>0&&(C=C[0]),C!==null&&typeof C=="object"&&Object.keys(C).forEach(function(N){var k=C[N];Array.isArray(k)?(k=te(k),A=f.append(A,k)):A.push(k)}),A}function te(D,C){return typeof C>"u"&&(C=[]),Array.isArray(D)?D.forEach(function(A){te(A,C)}):C.push(D),C}function Ot(D,C){var A,N=g();return typeof C<"u"&&(pe(C,N),N.length===1?A=N[0]:A=N),A}function pe(D,C){Array.isArray(D)||C.push(D),Array.isArray(D)?D.forEach(function(A){pe(A,C)}):D!==null&&typeof D=="object"&&Object.keys(D).forEach(function(A){pe(D[A],C)})}function Wt(D,C,A){var N;if(typeof D<"u"&&!_(D))throw{code:"T2001",stack:new Error().stack,value:D};if(typeof C<"u"&&!_(C))throw{code:"T2002",stack:new Error().stack,value:C};if(typeof D>"u"||typeof C>"u")return N;switch(A){case"+":N=D+C;break;case"-":N=D-C;break;case"*":N=D*C;break;case"/":N=D/C;break;case"%":N=D%C;break}return N}function B(D,C,A){var N,k=typeof D,S=typeof C;if(k==="undefined"||S==="undefined")return!1;switch(A){case"=":N=J(D,C);break;case"!=":N=!J(D,C);break}return N}function V(D,C,A){var N,k=typeof D,S=typeof C,O=k==="undefined"||k==="string"||k==="number",G=S==="undefined"||S==="string"||S==="number";if(!O||!G)throw{code:"T2010",stack:new Error().stack,value:k==="string"||k==="number"?C:D};if(!(k==="undefined"||S==="undefined")){if(k!==S)throw{code:"T2009",stack:new Error().stack,value:D,value2:C};switch(A){case"<":N=D<C;break;case"<=":N=D<=C;break;case">":N=D>C;break;case">=":N=D>=C;break}return N}}function Et(D,C){var A=!1;if(typeof D>"u"||typeof C>"u")return!1;Array.isArray(C)||(C=[C]);for(var N=0;N<C.length;N++)if(C[N]===D){A=!0;break}return A}function*Ht(D,C,A){var N,k=ne(D);switch(A){case"and":N=k&&ne(yield*C());break;case"or":N=k||ne(yield*C());break}return N}function ne(D){var C=f.boolean(D);return typeof C>"u"?!1:C}function se(D,C){var A,N="",k="";return typeof D<"u"&&(N=f.string(D)),typeof C<"u"&&(k=f.string(C)),A=N.concat(k),A}function*z(D,C,A){var N={},k={},S=!!(C&&C.tupleStream);Array.isArray(C)||(C=g(C)),C.length===0&&C.push(void 0);for(var O=0;O<C.length;O++)for(var G=C[O],K=S?st(A,G):A,tt=0;tt<D.lhs.length;tt++){var ft=D.lhs[tt],Ct=yield*j(ft[0],S?G["@"]:G,K);if(typeof Ct!="string"&&Ct!==void 0)throw{code:"T1003",stack:new Error().stack,position:D.position,value:Ct};if(Ct!==void 0){var Rt={data:G,exprIndex:tt};if(k.hasOwnProperty(Ct)){if(k[Ct].exprIndex!==tt)throw{code:"D1009",stack:new Error().stack,position:D.position,value:Ct};k[Ct].data=f.append(k[Ct].data,G)}else k[Ct]=Rt}}for(Ct in k){Rt=k[Ct];var Xt=Rt.data,K=A;if(S){var ee=it(Rt.data);Xt=ee["@"],delete ee["@"],K=st(A,ee)}var re=yield*j(D.lhs[Rt.exprIndex][1],Xt,K);typeof re<"u"&&(N[Ct]=re)}return N}function it(D){if(!Array.isArray(D))return D;var C={};Object.assign(C,D[0]);for(var A=1;A<D.length;A++)for(let N in D[A])C[N]=f.append(C[N],D[A][N]);return C}function Q(D,C){var A;if(typeof D<"u"&&!Number.isInteger(D))throw{code:"T2003",stack:new Error().stack,value:D};if(typeof C<"u"&&!Number.isInteger(C))throw{code:"T2004",stack:new Error().stack,value:C};if(typeof D>"u"||typeof C>"u"||D>C)return A;var N=C-D+1;if(N>1e7)throw{code:"D2014",stack:new Error().stack,value:N};A=new Array(N);for(var k=D,S=0;k<=C;k++,S++)A[S]=k;return A.sequence=!0,A}function*at(D,C,A){var N=yield*j(D.rhs,C,A);return A.bind(D.lhs.value,N),N}function*lt(D,C,A){var N,k=yield*j(D.condition,C,A);return f.boolean(k)?N=yield*j(D.then,C,A):typeof D.else<"u"&&(N=yield*j(D.else,C,A)),N}function*ht(D,C,A){for(var N,k=Ze(A),S=0;S<D.expressions.length;S++)N=yield*j(D.expressions[S],C,k);return N}function nt(D){var C=new ci.RegexEngine(D.value),A=function(N,k){var S;C.lastIndex=k||0;var O=C.exec(N);if(O!==null){if(S={match:O[0],start:O.index,end:O.index+O[0].length,groups:[]},O.length>1)for(var G=1;G<O.length;G++)S.groups.push(O[G]);S.next=function(){if(!(C.lastIndex>=N.length)){var K=A(N,C.lastIndex);if(K&&K.match==="")throw{code:"D1004",stack:new Error().stack,position:D.position,value:D.value.source};return K}}}return S};return A}function ct(D,C,A){var N;return D.value===""?N=C&&C.outerWrapper?C[0]:C:N=A.lookup(D.value),N}function*At(D,C,A){var N,k=C,S=!!C.tupleStream,O=function*(K,tt){for(var ft=0,Ct=0;ft===0&&Ct<D.terms.length;Ct++){var Rt=D.terms[Ct],Xt=K,ee=A;S&&(Xt=K["@"],ee=st(A,K));var re=yield*j(Rt.expression,Xt,ee);Xt=tt,ee=A,S&&(Xt=tt["@"],ee=st(A,tt));var ae=yield*j(Rt.expression,Xt,ee),we=typeof re,he=typeof ae;if(we==="undefined"){ft=he==="undefined"?0:1;continue}if(he==="undefined"){ft=-1;continue}if(!(we==="string"||we==="number")||!(he==="string"||he==="number"))throw{code:"T2008",stack:new Error().stack,position:D.position,value:we==="string"||we==="number"?ae:re};if(we!==he)throw{code:"T2007",stack:new Error().stack,position:D.position,value:re,value2:ae};re!==ae&&(re<ae?ft=-1:ft=1,Rt.descending===!0&&(ft=-ft))}return ft===1},G={environment:A,input:C};return N=yield*f.sort.apply(G,[k,O]),N}function Kt(D,C,A){var N=function*(k){if(!(typeof k>"u")){var S=A.lookup("clone");if(!T(S))throw{code:"T2013",stack:new Error().stack,position:D.position};var O=yield*Yt(S,[k],null,A),G=yield*j(D.pattern,O,A);if(typeof G<"u"){Array.isArray(G)||(G=[G]);for(var K=0;K<G.length;K++){var tt=G[K],ft=yield*j(D.update,tt,A),Ct=typeof ft;if(Ct!=="undefined"){if(Ct!=="object"||ft===null||Array.isArray(ft))throw{code:"T2011",stack:new Error().stack,position:D.update.position,value:ft};for(var Rt in ft)tt[Rt]=ft[Rt]}if(typeof D.delete<"u"){var Xt=yield*j(D.delete,tt,A);if(typeof Xt<"u"){var ee=Xt;if(Array.isArray(Xt)||(Xt=[Xt]),!u(Xt))throw{code:"T2012",stack:new Error().stack,position:D.delete.position,value:ee};for(var re=0;re<Xt.length;re++)typeof tt=="object"&&tt!==null&&delete tt[Xt[re]]}}}}return O}};return dt(N,"<(oa):o>")}var Qt=E("function($f, $g) { function($x){ $g($f($x)) } }");function*St(D,C,A){var N,k=yield*j(D.lhs,C,A);if(D.rhs.type==="function")N=yield*Nt(D.rhs,C,A,{context:k});else{var S=yield*j(D.rhs,C,A);if(!T(S))throw{code:"T2006",stack:new Error().stack,position:D.position,value:S};if(T(k)){var O=yield*j(Qt,null,A);N=yield*Yt(O,[k,S],null,A)}else N=yield*Yt(S,[k],null,A)}return N}function*Nt(D,C,A,N){var k,S=yield*j(D.procedure,C,A);if(typeof S>"u"&&D.procedure.type==="path"&&A.lookup(D.procedure.steps[0].value))throw{code:"T1005",stack:new Error().stack,position:D.position,token:D.procedure.steps[0].value};var O=[];typeof N<"u"&&O.push(N.context);for(var G=0;G<D.arguments.length;G++){let tt=yield*j(D.arguments[G],C,A);if(T(tt)){let ft=function*(...Ct){return yield*Yt(tt,Ct,null,A)};ft.arity=M(tt),O.push(ft)}else O.push(tt)}var K=D.procedure.type==="path"?D.procedure.steps[0].value:D.procedure.value;try{typeof S=="object"&&(S.token=K,S.position=D.position),k=yield*Yt(S,O,C,A)}catch(tt){throw tt.position||(tt.position=D.position),tt.token||(tt.token=K),tt}return k}function*Yt(D,C,A,N){var k;for(k=yield*Tt(D,C,A,N);w(k)&&k.thunk===!0;){var S=yield*j(k.body.procedure,k.input,k.environment);k.body.procedure.type==="variable"&&(S.token=k.body.procedure.value),S.position=k.body.procedure.position;for(var O=[],G=0;G<k.body.arguments.length;G++)O.push(yield*j(k.body.arguments[G],k.input,k.environment));k=yield*Tt(S,O,A,N)}return k}function*Tt(D,C,A,N){var k;try{var S=C;if(D&&(S=Ne(D.signature,C,A)),w(D))k=yield*Te(D,S);else if(D&&D._jsonata_function===!0){var O={environment:N,input:A};k=D.implementation.apply(O,S),R(k)&&(k=yield*k)}else if(typeof D=="function")k=D.apply(A,S),R(k)&&(k=yield*k);else throw{code:"T1006",stack:new Error().stack}}catch(G){throw D&&(typeof G.token>"u"&&typeof D.token<"u"&&(G.token=D.token),G.position=D.position),G}return k}function be(D,C,A){var N={_jsonata_lambda:!0,input:C,environment:A,arguments:D.arguments,signature:D.signature,body:D.body};return D.thunk===!0&&(N.thunk=!0),N.apply=function*(k,S){return yield*Yt(N,S,C,k.environment)},N}function*$e(D,C,A){for(var N,k=[],S=0;S<D.arguments.length;S++){var O=D.arguments[S];O.type==="operator"&&O.value==="?"?k.push(O):k.push(yield*j(O,C,A))}var G=yield*j(D.procedure,C,A);if(typeof G>"u"&&D.procedure.type==="path"&&A.lookup(D.procedure.steps[0].value))throw{code:"T1007",stack:new Error().stack,position:D.position,token:D.procedure.steps[0].value};if(w(G))N=Lt(G,k);else if(G&&G._jsonata_function===!0)N=xi(G.implementation,k);else if(typeof G=="function")N=xi(G,k);else throw{code:"T1008",stack:new Error().stack,position:D.position,token:D.procedure.type==="path"?D.procedure.steps[0].value:D.procedure.value};return N}function Ne(D,C,A){if(typeof D>"u")return C;var N=D.validate(C,A);return N}function*Te(D,C){var A,N=Ze(D.environment);return D.arguments.forEach(function(k,S){N.bind(k.value,C[S])}),typeof D.body=="function"?A=yield*wi(D.body,N):A=yield*j(D.body,D.input,N),A}function Lt(D,C){var A=Ze(D.environment),N=[];D.arguments.forEach(function(S,O){var G=C[O];G&&G.type==="operator"&&G.value==="?"?N.push(S):A.bind(S.value,G)});var k={_jsonata_lambda:!0,input:D.input,environment:A,arguments:N,body:D.body};return k}function xi(D,C){var A=Oi(D);A=A.map(function(O){return"$"+O.trim()});var N="function("+A.join(", ")+"){ _ }",k=E(N);k.body=D;var S=Lt(k,C);return S}function*wi(D,C){var A=Oi(D),N=A.map(function(O){return C.lookup(O.trim())}),k={environment:C},S=D.apply(k,N);return R(S)&&(S=yield*S),S}function Oi(D){var C=D.toString(),A=/\(([^)]*)\)/.exec(C)[1],N=A.split(",");return N}function dt(D,C){var A={_jsonata_function:!0,implementation:D};return typeof C<"u"&&(A.signature=d(C)),A}function*pn(D,C){if(!(typeof D>"u")){var A=this.input;typeof C<"u"&&(A=C,Array.isArray(A)&&!y(A)&&(A=g(A),A.outerWrapper=!0));try{var N=E(D,!1)}catch(S){throw li(S),{stack:new Error().stack,code:"D3120",value:S.message,error:S}}try{var k=yield*j(N,A,this.environment)}catch(S){throw li(S),{stack:new Error().stack,code:"D3121",value:S.message,error:S}}return k}}function ui(D){if(!(typeof D>"u"))return JSON.parse(f.string(D))}function Ze(D){var C={};return{bind:function(A,N){C[A]=N},lookup:function(A){var N;return C.hasOwnProperty(A)?N=C[A]:D&&(N=D.lookup(A)),N},timestamp:D?D.timestamp:null,async:D?D.async:!1,global:D?D.global:{ancestry:[null]}}}W.bind("sum",dt(f.sum,"<a<n>:n>")),W.bind("count",dt(f.count,"<a:n>")),W.bind("max",dt(f.max,"<a<n>:n>")),W.bind("min",dt(f.min,"<a<n>:n>")),W.bind("average",dt(f.average,"<a<n>:n>")),W.bind("string",dt(f.string,"<x-b?:s>")),W.bind("substring",dt(f.substring,"<s-nn?:s>")),W.bind("substringBefore",dt(f.substringBefore,"<s-s:s>")),W.bind("substringAfter",dt(f.substringAfter,"<s-s:s>")),W.bind("lowercase",dt(f.lowercase,"<s-:s>")),W.bind("uppercase",dt(f.uppercase,"<s-:s>")),W.bind("length",dt(f.length,"<s-:n>")),W.bind("trim",dt(f.trim,"<s-:s>")),W.bind("pad",dt(f.pad,"<s-ns?:s>")),W.bind("match",dt(f.match,"<s-f<s:o>n?:a<o>>")),W.bind("contains",dt(f.contains,"<s-(sf):b>")),W.bind("replace",dt(f.replace,"<s-(sf)(sf)n?:s>")),W.bind("split",dt(f.split,"<s-(sf)n?:a<s>>")),W.bind("join",dt(f.join,"<a<s>s?:s>")),W.bind("formatNumber",dt(f.formatNumber,"<n-so?:s>")),W.bind("formatBase",dt(f.formatBase,"<n-n?:s>")),W.bind("formatInteger",dt(h.formatInteger,"<n-s:s>")),W.bind("parseInteger",dt(h.parseInteger,"<s-s:n>")),W.bind("number",dt(f.number,"<(nsb)-:n>")),W.bind("floor",dt(f.floor,"<n-:n>")),W.bind("ceil",dt(f.ceil,"<n-:n>")),W.bind("round",dt(f.round,"<n-n?:n>")),W.bind("abs",dt(f.abs,"<n-:n>")),W.bind("sqrt",dt(f.sqrt,"<n-:n>")),W.bind("power",dt(f.power,"<n-n:n>")),W.bind("random",dt(f.random,"<:n>")),W.bind("boolean",dt(f.boolean,"<x-:b>")),W.bind("not",dt(f.not,"<x-:b>")),W.bind("map",dt(f.map,"<af>")),W.bind("zip",dt(f.zip,"<a+>")),W.bind("filter",dt(f.filter,"<af>")),W.bind("single",dt(f.single,"<af?>")),W.bind("reduce",dt(f.foldLeft,"<afj?:j>")),W.bind("sift",dt(f.sift,"<o-f?:o>")),W.bind("keys",dt(f.keys,"<x-:a<s>>")),W.bind("lookup",dt(f.lookup,"<x-s:x>")),W.bind("append",dt(f.append,"<xx:a>")),W.bind("exists",dt(f.exists,"<x:b>")),W.bind("spread",dt(f.spread,"<x-:a<o>>")),W.bind("merge",dt(f.merge,"<a<o>:o>")),W.bind("reverse",dt(f.reverse,"<a:a>")),W.bind("each",dt(f.each,"<o-f:a>")),W.bind("error",dt(f.error,"<s?:x>")),W.bind("assert",dt(f.assert,"<bs?:x>")),W.bind("type",dt(f.type,"<x:s>")),W.bind("sort",dt(f.sort,"<af?:a>")),W.bind("shuffle",dt(f.shuffle,"<a:a>")),W.bind("distinct",dt(f.distinct,"<x:x>")),W.bind("base64encode",dt(f.base64encode,"<s-:s>")),W.bind("base64decode",dt(f.base64decode,"<s-:s>")),W.bind("encodeUrlComponent",dt(f.encodeUrlComponent,"<s-:s>")),W.bind("encodeUrl",dt(f.encodeUrl,"<s-:s>")),W.bind("decodeUrlComponent",dt(f.decodeUrlComponent,"<s-:s>")),W.bind("decodeUrl",dt(f.decodeUrl,"<s-:s>")),W.bind("eval",dt(pn,"<sx?:x>")),W.bind("toMillis",dt(h.toMillis,"<s-s?:n>")),W.bind("fromMillis",dt(h.fromMillis,"<n-s?s?:s>")),W.bind("clone",dt(ui,"<(oa)-:o>"));var Ji={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0106:"Comment has no closing tag",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0214:"The right side of {{token}} must be a variable name (start with $)",S0215:"A context variable binding must precede any predicates on a step",S0216:"A context variable binding must precede the 'order-by' clause on a step",S0217:"The object representing the 'parent' cannot be derived from this expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",D1009:"Multiple key definitions evaluate to same key: {{value}}",T1010:"The matcher function argument passed to function {{token}} does not return the correct object structure",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D2014:"The size of the sequence allocated by the range operator (..) must not exceed 1e6. Attempted to allocate {{value}}.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"The second argument of reduce function must be a function with at least two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",D3120:"Syntax error in expression passed to function eval: {{value}}",D3121:"Dynamic error evaluating the expression passed to function eval: {{value}}",D3130:"Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",D3131:"In a decimal digit pattern, all digits must be from the same decimal group",D3132:"Unknown component specifier {{value}} in date/time picture string",D3133:"The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",D3134:"The timezone integer format specifier cannot have more than four digits",D3135:"No matching closing bracket ']' in date/time picture string",D3136:"The date/time picture string is missing specifiers required to parse the timestamp",D3137:"{{{message}}}",D3138:"The $single() function expected exactly 1 matching result. Instead it matched more.",D3139:"The $single() function expected exactly 1 matching result. Instead it matched 0.",D3140:"Malformed URL passed to ${{{functionName}}}(): {{value}}",D3141:"{{{message}}}"};function li(D){var C=Ji[D.code];if(typeof C<"u"){var A=C.replace(/\{\{\{([^}]+)}}}/g,function(){return D[arguments[1]]});A=A.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(D[arguments[1]])}),D.message=A}}function ci(D,C){var A,N;try{A=E(D,C&&C.recover),N=A.errors,delete A.errors}catch(O){throw li(O),O}var k=Ze(W),S=new Date;return k.bind("now",dt(function(O,G){return h.fromMillis(S.getTime(),O,G)},"<s?s?:s>")),k.bind("millis",dt(function(){return S.getTime()},"<:n>")),C&&C.RegexEngine?ci.RegexEngine=C.RegexEngine:ci.RegexEngine=RegExp,{evaluate:function(O,G,K){if(typeof N<"u"){var tt={code:"S0500",position:0};throw li(tt),tt}if(typeof G<"u"){var ft;ft=Ze(k);for(var Ct in G)ft.bind(Ct,G[Ct])}else ft=k;ft.bind("$",O),S=new Date,ft.timestamp=S,Array.isArray(O)&&!y(O)&&(O=g(O),O.outerWrapper=!0);var Rt,Xt;if(typeof K=="function"){ft.async=!0;var ee=function(ae){li(ae),K(ae,null)},re=function(ae){Rt=Xt.next(ae),Rt.done?K(null,Rt.value):Rt.value.then(re).catch(ee)};Xt=j(A,O,ft),Rt=Xt.next(),Rt.value.then(re).catch(ee)}else try{for(Xt=j(A,O,ft),Rt=Xt.next();!Rt.done;)Rt=Xt.next(Rt.value);return Rt.value}catch(ae){throw li(ae),ae}},assign:function(O,G){k.bind(O,G)},registerFunction:function(O,G,K){var tt=dt(G,K);k.bind(O,tt)},ast:function(){return A},errors:function(){return N}}}return ci.parser=E,ci}();r.exports=x},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(i,r,o){var h=i("./signature");let f=(()=>{"use strict";var p={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":80,"#":80,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},E={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:" "},d=function(_){var u=0,c=_.length,g=function(w,R){var M={type:w,value:R,position:u};return M},y=function(){for(var w=u,R=0,M,J;u<c;){var W=_.charAt(u);if(W==="/"&&_.charAt(u-1)!=="\\"&&R===0){if(M=_.substring(w,u),M==="")throw{code:"S0301",stack:new Error().stack,position:u};for(u++,W=_.charAt(u),w=u;W==="i"||W==="m";)u++,W=_.charAt(u);return J=_.substring(w,u)+"g",new RegExp(M,J)}(W==="("||W==="["||W==="{")&&_.charAt(u-1)!=="\\"&&R++,(W===")"||W==="]"||W==="}")&&_.charAt(u-1)!=="\\"&&R--,u++}throw{code:"S0302",stack:new Error().stack,position:u}},T=function(w){if(u>=c)return null;for(var R=_.charAt(u);u<c&&`
\r\v`.indexOf(R)>-1;)u++,R=_.charAt(u);if(R==="/"&&_.charAt(u+1)==="*"){var M=u;for(u+=2,R=_.charAt(u);!(R==="*"&&_.charAt(u+1)==="/");)if(R=_.charAt(++u),u>=c)throw{code:"S0106",stack:new Error().stack,position:M};return u+=2,R=_.charAt(u),T(w)}if(w!==!0&&R==="/")return u++,g("regex",y());if(R==="."&&_.charAt(u+1)===".")return u+=2,g("operator","..");if(R===":"&&_.charAt(u+1)==="=")return u+=2,g("operator",":=");if(R==="!"&&_.charAt(u+1)==="=")return u+=2,g("operator","!=");if(R===">"&&_.charAt(u+1)==="=")return u+=2,g("operator",">=");if(R==="<"&&_.charAt(u+1)==="=")return u+=2,g("operator","<=");if(R==="*"&&_.charAt(u+1)==="*")return u+=2,g("operator","**");if(R==="~"&&_.charAt(u+1)===">")return u+=2,g("operator","~>");if(Object.prototype.hasOwnProperty.call(p,R))return u++,g("operator",R);if(R==='"'||R==="'"){var J=R;u++;for(var W="";u<c;){if(R=_.charAt(u),R==="\\")if(u++,R=_.charAt(u),Object.prototype.hasOwnProperty.call(E,R))W+=E[R];else if(R==="u"){var j=_.substr(u+1,4);if(/^[0-9a-fA-F]+$/.test(j)){var ot=parseInt(j,16);W+=String.fromCharCode(ot),u+=4}else throw{code:"S0104",stack:new Error().stack,position:u}}else throw{code:"S0103",stack:new Error().stack,position:u,token:R};else{if(R===J)return u++,g("string",W);W+=R}u++}throw{code:"S0101",stack:new Error().stack,position:u}}var st=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/,kt=st.exec(_.substring(u));if(kt!==null){var gt=parseFloat(kt[0]);if(!isNaN(gt)&&isFinite(gt))return u+=kt[0].length,g("number",gt);throw{code:"S0102",stack:new Error().stack,position:u,token:kt[0]}}var qt;if(R==="`"){u++;var Vt=_.indexOf("`",u);if(Vt!==-1)return qt=_.substring(u,Vt),u=Vt+1,g("name",qt);throw u=c,{code:"S0105",stack:new Error().stack,position:u}}for(var Jt=u,fe;;)if(fe=_.charAt(Jt),Jt===c||`
\r\v`.indexOf(fe)>-1||Object.prototype.hasOwnProperty.call(p,fe)){if(_.charAt(u)==="$")return qt=_.substring(u+1,Jt),u=Jt,g("variable",qt);switch(qt=_.substring(u,Jt),u=Jt,qt){case"or":case"in":case"and":return g("operator",qt);case"true":return g("value",!0);case"false":return g("value",!1);case"null":return g("value",null);default:return u===c&&qt===""?null:g("name",qt)}}else Jt++};return T},x=function(_,u){var c,g,y={},T=[],w=function(){var B=[];c.id!=="(end)"&&B.push({type:c.type,value:c.value,position:c.position});for(var V=g();V!==null;)B.push(V),V=g();return B},R={nud:function(){var B={code:"S0211",token:this.value,position:this.position};if(u)return B.remaining=w(),B.type="error",T.push(B),B;throw B.stack=new Error().stack,B}},M=function(B,V){var Et=y[B];return V=V||0,Et?V>=Et.lbp&&(Et.lbp=V):(Et=Object.create(R),Et.id=Et.value=B,Et.lbp=V,y[B]=Et),Et},J=function(B){if(u){B.remaining=w(),T.push(B);var V=y["(error)"];return c=Object.create(V),c.error=B,c.type="(error)",c}else throw B.stack=new Error().stack,B},W=function(B,V){if(B&&c.id!==B){var Et;c.id==="(end)"?Et="S0203":Et="S0202";var Ht={code:Et,position:c.position,token:c.value,value:B};return J(Ht)}var ne=g(V);if(ne===null)return c=y["(end)"],c.position=_.length,c;var se=ne.value,z=ne.type,it;switch(z){case"name":case"variable":it=y["(name)"];break;case"operator":if(it=y[se],!it)return J({code:"S0204",stack:new Error().stack,position:ne.position,token:se});break;case"string":case"number":case"value":it=y["(literal)"];break;case"regex":z="regex",it=y["(regex)"];break;default:return J({code:"S0205",stack:new Error().stack,position:ne.position,token:se})}return c=Object.create(it),c.value=se,c.type=z,c.position=ne.position,c},j=function(B){var V,Et=c;for(W(null,!0),V=Et.nud();B<c.lbp;)Et=c,W(),V=Et.led(V);return V},ot=function(B){var V=M(B,0);V.nud=function(){return this}},st=function(B,V,Et){var Ht=V||p[B],ne=M(B,Ht);return ne.led=Et||function(se){return this.lhs=se,this.rhs=j(Ht),this.type="binary",this},ne},kt=function(B,V,Et){var Ht=M(B,V);return Ht.led=Et,Ht},gt=function(B,V){var Et=M(B);return Et.nud=V||function(){return this.expression=j(70),this.type="unary",this},Et};ot("(end)"),ot("(name)"),ot("(literal)"),ot("(regex)"),M(":"),M(";"),M(","),M(")"),M("]"),M("}"),M(".."),st("."),st("+"),st("-"),st("*"),st("/"),st("%"),st("="),st("<"),st(">"),st("!="),st("<="),st(">="),st("&"),st("and"),st("or"),st("in"),ot("and"),ot("or"),ot("in"),gt("-"),st("~>"),kt("(error)",10,function(B){return this.lhs=B,this.error=c.error,this.remaining=w(),this.type="error",this}),gt("*",function(){return this.type="wildcard",this}),gt("**",function(){return this.type="descendant",this}),gt("%",function(){return this.type="parent",this}),st("(",p["("],function(B){if(this.procedure=B,this.type="function",this.arguments=[],c.id!==")")for(;c.type==="operator"&&c.id==="?"?(this.type="partial",this.arguments.push(c),W("?")):this.arguments.push(j(0)),c.id===",";)W(",");if(W(")",!0),B.type==="name"&&(B.value==="function"||B.value==="\u03BB")){if(this.arguments.forEach(function(se,z){if(se.type!=="variable")return J({code:"S0208",stack:new Error().stack,position:se.position,token:se.value,value:z+1})}),this.type="lambda",c.id==="<"){for(var V=c.position,Et=1,Ht="<";Et>0&&c.id!=="{"&&c.id!=="(end)";){var ne=W();ne.id===">"?Et--:ne.id==="<"&&Et++,Ht+=ne.value}W(">");try{this.signature=h(Ht)}catch(se){return se.position=V+se.offset,J(se)}}W("{"),this.body=j(0),W("}")}return this}),gt("(",function(){for(var B=[];c.id!==")"&&(B.push(j(0)),c.id===";");)W(";");return W(")",!0),this.type="block",this.expressions=B,this}),gt("[",function(){var B=[];if(c.id!=="]")for(;;){var V=j(0);if(c.id===".."){var Et={type:"binary",value:"..",position:c.position,lhs:V};W(".."),Et.rhs=j(0),V=Et}if(B.push(V),c.id!==",")break;W(",")}return W("]",!0),this.expressions=B,this.type="unary",this}),st("[",p["["],function(B){if(c.id==="]"){for(var V=B;V&&V.type==="binary"&&V.value==="[";)V=V.lhs;return V.keepArray=!0,W("]"),B}else return this.lhs=B,this.rhs=j(p["]"]),this.type="binary",W("]",!0),this}),st("^",p["^"],function(B){W("(");for(var V=[];;){var Et={descending:!1};if(c.id==="<"?W("<"):c.id===">"&&(Et.descending=!0,W(">")),Et.expression=j(0),V.push(Et),c.id!==",")break;W(",")}return W(")"),this.lhs=B,this.rhs=V,this.type="binary",this});var qt=function(B){var V=[];if(c.id!=="}")for(;;){var Et=j(0);W(":");var Ht=j(0);if(V.push([Et,Ht]),c.id!==",")break;W(",")}return W("}",!0),typeof B>"u"?(this.lhs=V,this.type="unary"):(this.lhs=B,this.rhs=V,this.type="binary"),this};gt("{",qt),st("{",p["{"],qt),kt(":=",p[":="],function(B){return B.type!=="variable"?J({code:"S0212",stack:new Error().stack,position:B.position,token:B.value}):(this.lhs=B,this.rhs=j(p[":="]-1),this.type="binary",this)}),st("@",p["@"],function(B){return this.lhs=B,this.rhs=j(p["@"]),this.rhs.type!=="variable"?J({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),st("#",p["#"],function(B){return this.lhs=B,this.rhs=j(p["#"]),this.rhs.type!=="variable"?J({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),st("?",p["?"],function(B){return this.type="condition",this.condition=B,this.then=j(0),c.id===":"&&(W(":"),this.else=j(0)),this}),gt("|",function(){return this.type="transform",this.pattern=j(0),W("|"),this.update=j(0),c.id===","&&(W(","),this.delete=j(0)),W("|"),this});var Vt=function(B){var V;if(B.type==="function"&&!B.predicate){var Et={type:"lambda",thunk:!0,arguments:[],position:B.position};Et.body=B,V=Et}else if(B.type==="condition")B.then=Vt(B.then),typeof B.else<"u"&&(B.else=Vt(B.else)),V=B;else if(B.type==="block"){var Ht=B.expressions.length;Ht>0&&(B.expressions[Ht-1]=Vt(B.expressions[Ht-1])),V=B}else V=B;return V},Jt=0,fe=0,Ye=[],Zt=function(B,V){switch(B.type){case"name":case"wildcard":V.level--,V.level===0&&(typeof B.ancestor>"u"||(Ye[V.index].slot.label=B.ancestor.label),B.ancestor=V,B.tuple=!0);break;case"parent":V.level++;break;case"block":B.expressions.length>0&&(B.tuple=!0,V=Zt(B.expressions[B.expressions.length-1],V));break;case"path":B.tuple=!0;var Et=B.steps.length-1;for(V=Zt(B.steps[Et--],V);V.level>0&&Et>=0;)V=Zt(B.steps[Et--],V);break;default:throw{code:"S0217",token:B.type,position:B.position}}return V},Bt=function(B,V){if(typeof V.seekingParent<"u"||V.type==="parent"){var Et=typeof V.seekingParent<"u"?V.seekingParent:[];V.type==="parent"&&Et.push(V.slot),typeof B.seekingParent>"u"?B.seekingParent=Et:Array.prototype.push.apply(B.seekingParent,Et)}},te=function(B){var V=B.steps.length-1,Et=B.steps[V],Ht=typeof Et.seekingParent<"u"?Et.seekingParent:[];Et.type==="parent"&&Ht.push(Et.slot);for(var ne=0;ne<Ht.length;ne++){var se=Ht[ne];for(V=B.steps.length-2;se.level>0;){if(V<0){typeof B.seekingParent>"u"?B.seekingParent=[se]:B.seekingParent.push(se);break}for(var z=B.steps[V--];V>=0&&z.focus&&B.steps[V].focus;)z=B.steps[V--];se=Zt(z,se)}}},Ot=function(B){var V;switch(B.type){case"binary":switch(B.value){case".":var Et=Ot(B.lhs);Et.type==="path"?V=Et:V={type:"path",steps:[Et]},Et.type==="parent"&&(V.seekingParent=[Et.slot]);var Ht=Ot(B.rhs);Ht.type==="function"&&Ht.procedure.type==="path"&&Ht.procedure.steps.length===1&&Ht.procedure.steps[0].type==="name"&&V.steps[V.steps.length-1].type==="function"&&(V.steps[V.steps.length-1].nextFunction=Ht.procedure.steps[0].value),Ht.type==="path"?Array.prototype.push.apply(V.steps,Ht.steps):(typeof Ht.predicate<"u"&&(Ht.stages=Ht.predicate,delete Ht.predicate),V.steps.push(Ht)),V.steps.filter(function(ct){if(ct.type==="number"||ct.type==="value")throw{code:"S0213",stack:new Error().stack,position:ct.position,value:ct.value};return ct.type==="string"}).forEach(function(ct){ct.type="name"}),V.steps.filter(function(ct){return ct.keepArray===!0}).length>0&&(V.keepSingletonArray=!0);var ne=V.steps[0];ne.type==="unary"&&ne.value==="["&&(ne.consarray=!0);var se=V.steps[V.steps.length-1];se.type==="unary"&&se.value==="["&&(se.consarray=!0),te(V);break;case"[":V=Ot(B.lhs);var z=V,it="predicate";if(V.type==="path"&&(z=V.steps[V.steps.length-1],it="stages"),typeof z.group<"u")throw{code:"S0209",stack:new Error().stack,position:B.position};typeof z[it]>"u"&&(z[it]=[]);var Q=Ot(B.rhs);typeof Q.seekingParent<"u"&&(Q.seekingParent.forEach(ct=>{ct.level===1?Zt(z,ct):ct.level--}),Bt(z,Q)),z[it].push({type:"filter",expr:Q,position:B.position});break;case"{":if(V=Ot(B.lhs),typeof V.group<"u")throw{code:"S0210",stack:new Error().stack,position:B.position};V.group={lhs:B.rhs.map(function(ct){return[Ot(ct[0]),Ot(ct[1])]}),position:B.position};break;case"^":V=Ot(B.lhs),V.type!=="path"&&(V={type:"path",steps:[V]});var at={type:"sort",position:B.position};at.terms=B.rhs.map(function(ct){var At=Ot(ct.expression);return Bt(at,At),{descending:ct.descending,expression:At}}),V.steps.push(at),te(V);break;case":=":V={type:"bind",value:B.value,position:B.position},V.lhs=Ot(B.lhs),V.rhs=Ot(B.rhs),Bt(V,V.rhs);break;case"@":if(V=Ot(B.lhs),z=V,V.type==="path"&&(z=V.steps[V.steps.length-1]),typeof z.stages<"u"||typeof z.predicate<"u")throw{code:"S0215",stack:new Error().stack,position:B.position};if(z.type==="sort")throw{code:"S0216",stack:new Error().stack,position:B.position};B.keepArray&&(z.keepArray=!0),z.focus=B.rhs.value,z.tuple=!0;break;case"#":V=Ot(B.lhs),z=V,V.type==="path"?z=V.steps[V.steps.length-1]:(V={type:"path",steps:[V]},typeof z.predicate<"u"&&(z.stages=z.predicate,delete z.predicate)),typeof z.stages>"u"?z.index=B.rhs.value:z.stages.push({type:"index",value:B.rhs.value,position:B.position}),z.tuple=!0;break;case"~>":V={type:"apply",value:B.value,position:B.position},V.lhs=Ot(B.lhs),V.rhs=Ot(B.rhs);break;default:V={type:B.type,value:B.value,position:B.position},V.lhs=Ot(B.lhs),V.rhs=Ot(B.rhs),Bt(V,V.lhs),Bt(V,V.rhs)}break;case"unary":V={type:B.type,value:B.value,position:B.position},B.value==="["?V.expressions=B.expressions.map(function(ct){var At=Ot(ct);return Bt(V,At),At}):B.value==="{"?V.lhs=B.lhs.map(function(ct){var At=Ot(ct[0]);Bt(V,At);var Kt=Ot(ct[1]);return Bt(V,Kt),[At,Kt]}):(V.expression=Ot(B.expression),B.value==="-"&&V.expression.type==="number"?(V=V.expression,V.value=-V.value):Bt(V,V.expression));break;case"function":case"partial":V={type:B.type,name:B.name,value:B.value,position:B.position},V.arguments=B.arguments.map(function(ct){var At=Ot(ct);return Bt(V,At),At}),V.procedure=Ot(B.procedure);break;case"lambda":V={type:B.type,arguments:B.arguments,signature:B.signature,position:B.position};var lt=Ot(B.body);V.body=Vt(lt);break;case"condition":V={type:B.type,position:B.position},V.condition=Ot(B.condition),Bt(V,V.condition),V.then=Ot(B.then),Bt(V,V.then),typeof B.else<"u"&&(V.else=Ot(B.else),Bt(V,V.else));break;case"transform":V={type:B.type,position:B.position},V.pattern=Ot(B.pattern),V.update=Ot(B.update),typeof B.delete<"u"&&(V.delete=Ot(B.delete));break;case"block":V={type:B.type,position:B.position},V.expressions=B.expressions.map(function(ct){var At=Ot(ct);return Bt(V,At),(At.consarray||At.type==="path"&&At.steps[0].consarray)&&(V.consarray=!0),At});break;case"name":V={type:"path",steps:[B]},B.keepArray&&(V.keepSingletonArray=!0);break;case"parent":V={type:"parent",slot:{label:"!"+Jt++,level:1,index:fe++}},Ye.push(V);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":V=B;break;case"operator":if(B.value==="and"||B.value==="or"||B.value==="in")B.type="name",V=Ot(B);else if(B.value==="?")V=B;else throw{code:"S0201",stack:new Error().stack,position:B.position,token:B.value};break;case"error":V=B,B.lhs&&(V=Ot(B.lhs));break;default:var ht="S0206";B.id==="(end)"&&(ht="S0207");var nt={code:ht,position:B.position,token:B.value};if(u)return T.push(nt),{type:"error",error:nt};throw nt.stack=new Error().stack,nt}return B.keepArray&&(V.keepArray=!0),V};g=d(_),W();var pe=j(0);if(c.id!=="(end)"){var Wt={code:"S0201",position:c.position,token:c.value};J(Wt)}if(pe=Ot(pe),pe.type==="parent"||typeof pe.seekingParent<"u")throw{code:"S0217",token:pe.type,position:pe.position};return T.length>0&&(pe.errors=T),pe};return x})();r.exports=f},{"./signature":5}],5:[function(i,r,o){var h=i("./utils");let f=(()=>{"use strict";var p={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};function E(d){for(var x=1,_=[],u={},c=u;x<d.length;){var g=d.charAt(x);if(g===":")break;var y=function(){_.push(u),c=u,u={}},T=function(st,kt,gt,qt){for(var Vt=1,Jt=kt;Jt<st.length;)if(Jt++,g=st.charAt(Jt),g===qt){if(Vt--,Vt===0)break}else g===gt&&Vt++;return Jt};switch(g){case"s":case"n":case"b":case"l":case"o":u.regex="["+g+"m]",u.type=g,y();break;case"a":u.regex="[asnblfom]",u.type=g,u.array=!0,y();break;case"f":u.regex="f",u.type=g,y();break;case"j":u.regex="[asnblom]",u.type=g,y();break;case"x":u.regex="[asnblfom]",u.type=g,y();break;case"-":c.context=!0,c.contextRegex=new RegExp(c.regex),c.regex+="?";break;case"?":case"+":c.regex+=g;break;case"(":var w=T(d,x,"(",")"),R=d.substring(x+1,w);if(R.indexOf("<")===-1)u.regex="["+R+"m]";else throw{code:"S0402",stack:new Error().stack,value:R,offset:x};u.type="("+R+")",x=w,y();break;case"<":if(c.type==="a"||c.type==="f"){var M=T(d,x,"<",">");c.subtype=d.substring(x+1,M),x=M}else throw{code:"S0401",stack:new Error().stack,value:c.type,offset:x};break}x++}var J="^"+_.map(function(st){return"("+st.regex+")"}).join("")+"$",W=new RegExp(J),j=function(st){var kt;if(h.isFunction(st))kt="f";else{var gt=typeof st;switch(gt){case"string":kt="s";break;case"number":kt="n";break;case"boolean":kt="b";break;case"object":st===null?kt="l":Array.isArray(st)?kt="a":kt="o";break;case"undefined":default:kt="m"}}return kt},ot=function(st,kt){for(var gt="^",qt=0,Vt=0;Vt<_.length;Vt++){gt+=_[Vt].regex;var Jt=kt.match(gt);if(Jt===null)throw{code:"T0410",stack:new Error().stack,value:st[qt],index:qt+1};qt=Jt[0].length}throw{code:"T0410",stack:new Error().stack,value:st[qt],index:qt+1}};return{definition:d,validate:function(st,kt){var gt="";st.forEach(function(fe){gt+=j(fe)});var qt=W.exec(gt);if(qt){var Vt=[],Jt=0;return _.forEach(function(fe,Ye){var Zt=st[Jt],Bt=qt[Ye+1];if(Bt==="")if(fe.context&&fe.contextRegex){var te=j(kt);if(fe.contextRegex.test(te))Vt.push(kt);else throw{code:"T0411",stack:new Error().stack,value:kt,index:Jt+1}}else Vt.push(Zt),Jt++;else Bt.split("").forEach(function(Ot){if(fe.type==="a"){if(Ot==="m")Zt=void 0;else{Zt=st[Jt];var pe=!0;if(typeof fe.subtype<"u"){if(Ot!=="a"&&Bt!==fe.subtype)pe=!1;else if(Ot==="a"&&Zt.length>0){var Wt=j(Zt[0]);if(Wt!==fe.subtype.charAt(0))pe=!1;else{var B=Zt.filter(function(V){return j(V)!==Wt});pe=B.length===0}}}if(!pe)throw{code:"T0412",stack:new Error().stack,value:Zt,index:Jt+1,type:p[fe.subtype]};Ot!=="a"&&(Zt=[Zt])}Vt.push(Zt),Jt++}else Vt.push(Zt),Jt++})}),Vt}ot(st,gt)}}}return E})();r.exports=f},{"./utils":6}],6:[function(i,r,o){let h=(()=>{"use strict";function f(M){var J=!1;if(typeof M=="number"&&(J=!isNaN(M),J&&!isFinite(M)))throw{code:"D1001",value:M,stack:new Error().stack};return J}function p(M){var J=!1;return Array.isArray(M)&&(J=M.filter(function(W){return typeof W!="string"}).length===0),J}function E(M){var J=!1;return Array.isArray(M)&&(J=M.filter(function(W){return!f(W)}).length===0),J}function d(){var M=[];return M.sequence=!0,arguments.length===1&&M.push(arguments[0]),M}function x(M){return M.sequence===!0&&Array.isArray(M)}function _(M){return M&&(M._jsonata_function===!0||M._jsonata_lambda===!0)||typeof M=="function"}function u(M){var J=typeof M.arity=="number"?M.arity:typeof M.implementation=="function"?M.implementation.length:typeof M.length=="number"?M.length:M.arguments.length;return J}function c(M){return M&&M._jsonata_lambda===!0}var g=typeof Symbol=="function"?Symbol:{},y=g.iterator||"@@iterator";function T(M){return typeof M=="object"&&M!==null&&y in M&&"next"in M&&typeof M.next=="function"}function w(M,J){if(M===J)return!0;if(typeof M=="object"&&typeof J=="object"&&M!==null&&J!==null){if(Array.isArray(M)&&Array.isArray(J)){if(M.length!==J.length)return!1;for(var W=0;W<M.length;W++)if(!w(M[W],J[W]))return!1;return!0}var j=Object.getOwnPropertyNames(M),ot=Object.getOwnPropertyNames(J);if(j.length!==ot.length)return!1;for(j=j.sort(),ot=ot.sort(),W=0;W<j.length;W++)if(j[W]!==ot[W])return!1;for(W=0;W<j.length;W++){var st=j[W];if(!w(M[st],J[st]))return!1}return!0}return!1}function R(M){var J=[];for(let W of M)J.push(W);return J}return{isNumeric:f,isArrayOfStrings:p,isArrayOfNumbers:E,createSequence:d,isSequence:x,isFunction:_,isLambda:c,isIterable:T,getFunctionArity:u,isDeepEqual:w,stringToArray:R}})();r.exports=h},{}]},{},[3])(3)})});var Zc=X(on=>{"use strict";var FC=on&&on.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(on,"__esModule",{value:!0});on.locEnd=on.locStart=on.parse=void 0;var RC=FC($c()),BC=n=>{try{let t=[],e=n.matchAll(/\/\*((\*(?!\/)|[^*])*)\*\//g);for(let r of e){let o=r.index;if(o===void 0)continue;let h=r[1];!h||t.push({position:o,value:h.trim()})}let i=(0,RC.default)(n).ast();return Object.assign(Object.assign({},i),{jsonataComments:t})}catch(t){let e=t,r=["code","position","token"].filter(h=>e[h]!==void 0).map(h=>`${h}: ${e[h]}`),o=[e.message,...r].join(", ");throw new Error(o)}};on.parse=BC;var MC=n=>n.position;on.locStart=MC;var UC=()=>0;on.locEnd=UC});var rf=X(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.print=void 0;var WC=Vi("prettier/doc"),tf=[],lo=-1,HC=(n,t,e)=>{var i,r;let o=n.getValue();"jsonataComments"in o&&(lo=-1,tf=o.jsonataComments);let h=(r=o.type==="path"?(i=o.steps[0])===null||i===void 0?void 0:i.position:o.position)!==null&&r!==void 0?r:lo,f=tf.filter(d=>d.position>lo&&d.position<h);lo=h;let p=f.map(GC),E=VC(o,n,t,e);return p.length>0?me([p,E]):E};co.print=HC;var VC=(n,...t)=>{if(n.type==="binary")return qC(n,...t);if(n.type==="function")return ef(n,...t);if(n.type==="partial")return ef(n,...t);if(n.type==="variable")return jC(n,...t);if(n.type==="wildcard")return QC(n,...t);if(n.type==="descendant")return $C(n,...t);if(n.type==="operator")return KC(n,...t);if(n.type==="number")return JC(n,...t);if(n.type==="string")return YC(n,...t);if(n.type==="name")return zC(n,...t);if(n.type==="filter")return ZC(n,...t);if(n.type==="bind")return tA(n,...t);if(n.type==="lambda")return eA(n,...t);if(n.type==="condition")return iA(n,...t);if(n.type==="value")return nA(n,...t);if(n.type==="block")return rA(n,...t);if(n.type==="path")return XC(n,...t);if(n.type==="apply")return oA(n,...t);if(n.type==="sort")return aA(n,...t);if(n.type==="unary")return uA(n,...t);if(n.type==="parent")return dA(n,...t);if(n.type==="regex")return gA(n,...t);throw new Error(`Unknown node type: ${n.type}`)},{group:me,indent:gi,join:Es,line:an,hardline:$n,breakParent:ca,softline:hn}=WC.builders,GC=n=>me(["/* ",n.value," */",$n]),qC=(n,t,e,i)=>n.value===".."?me([i("lhs"),gi([hn,n.value,i("rhs")])]):me([i("lhs"),gi([an,n.value," ",i("rhs")])]),zC=(n,t,e,i)=>me([xA(n.value),bi(n,t,e,i),Ii(n),Pi(n),ir(n,t,e,i),Ci(n,t,e,i),Ai(n)]),JC=(n,t,e,i)=>me([JSON.stringify(n.value),bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)]),YC=(n,t,e,i)=>me([JSON.stringify(n.value),bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)]),XC=(n,t,e,i)=>{let r=n.steps.flatMap((o,h)=>h===0?i(["steps",h]):o.type==="sort"?gi(["^",i(["steps",h])]):gi([hn,".",i(["steps",h])]));return me([...r,bi(n,t,e,i)])},ef=(n,t,e,i)=>me([i("procedure"),"(",nf(n,t,e,i),")",bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n),ir(n,t,e,i)]),nf=(n,t,e,i)=>{var r;if(!(!((r=n.arguments)===null||r===void 0)&&r.length))return"";if(n.arguments.length===1)return i(["arguments",0]);let o=Es([",",an],t.map(i,"arguments"));return[gi([hn,o]),hn]},jC=(n,t,e,i)=>me(["$",n.value,bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n),ir(n,t,e,i)]),KC=n=>n.value,QC=n=>n.value,$C=n=>n.value,ZC=(n,t,e,i)=>me(["[",gi([hn,i("expr")]),hn,"]"]),tA=(n,t,e,i)=>me([i("lhs")," ",n.value," ",i("rhs")]),eA=(n,t,e,i)=>n.thunk?i("body"):me(["function(",nf(n,t,e,i),") {",gi([an,i("body")]),an,"}",bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)]),iA=(n,t,e,i)=>{let r=t.getParentNode(),h=r?.type==="condition"?[$n,ca]:an;return me([i("condition"),gi([h,"? ",i("then")]),n.else?gi([h,": ",i("else")]):""])},nA=(n,t,e,i)=>me([sA(n,t,e,i),bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)]),sA=n=>n.value===null?"null":n.value===!1?"false":n.value===!0?"true":JSON.stringify(n.value),rA=(n,t,e,i)=>{if(n.expressions.length===0)return me(["()",Ci(n,t,e,i),Ai(n)]);if(n.expressions.length===1)return me(["(",i(["expressions",0]),")",bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n),ir(n,t,e,i)]);let r=Es([";",$n],t.map(i,"expressions"));return me(["(",gi([$n,r]),$n,")",bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)])},oA=(n,t,e,i)=>me([i("lhs"),gi([an,n.value," ",i("rhs")])]),aA=(n,t,e,i)=>{let r=n.terms.map((h,f)=>[hA(h),i(["terms",f,"expression"])]),o=Es([",",an],r);return me(["(",gi([hn,o]),hn,")"])},hA=n=>n.descending?">":"<",uA=(n,t,e,i)=>{if(n.value==="{")return lA(n,t,e,i);if(n.value==="[")return fA(n,t,e,i);if(n.value==="-")return pA(n,t,e,i);throw new Error("Unhandled unary node "+n.value)},lA=(n,t,e,i)=>me(["{",cA(n,t,e,i),"}",bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)]),cA=(n,t,e,i)=>{if(n.lhs.length===0)return"";let r=n.lhs.map((p,E)=>me([i(["lhs",E,0]),": ",i(["lhs",E,1])])),h=n.lhs.some(p=>sf(p[1]))?[$n,ca]:an,f=Es([",",h],r);return[gi([h,f]),h]},sf=n=>{if(n.type!=="unary")return!1;if(n.value==="["||n.value==="{")return!0},fA=(n,t,e,i)=>{let r=Es([",",an],t.map(i,"expressions"));return me(["[",gi([hn,r]),hn,"]",bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)])},pA=(n,t,e,i)=>me(["-",i("expression")]),dA=(n,t,e,i)=>me(["%",bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n),ir(n,t,e,i)]),mA=["i","m"],gA=(n,t,e,i)=>{let r=mA.filter(o=>n.value.flags.includes(o)).join("");return me([`/${n.value.source}/${r}`,bi(n,t,e,i),Ii(n),Pi(n),Ci(n,t,e,i),Ai(n)])},Ii=n=>n.focus?"@$"+n.focus:"",Pi=n=>n.index?"#$"+n.index:"",Ci=(n,t,e,i)=>n.predicate?t.map(i,"predicate"):"",ir=(n,t,e,i)=>n.stages?t.map(i,"stages"):"",Ai=n=>n.keepArray?"[]":"",bi=(n,t,e,i)=>{if(n.group===void 0)return"";if(n.group.lhs.length===0)return"{}";let r=n.group.lhs.map((p,E)=>me([i(["group","lhs",E,0]),": ",i(["group","lhs",E,1])])),h=n.group.lhs.some(p=>sf(p[1]))?[$n,ca]:an,f=Es([",",h],r);return me(["{",gi([h,f]),h,"}"])},xA=n=>n.startsWith("`")&&n.endsWith("`")?n:n.startsWith('"')&&n.endsWith('"')?`\`${n.slice(1,-1)}\``:/\s/.test(n)?`\`${n}\``:["null","false","true"].includes(n)?`\`${n}\``:/^\d+/.test(n)?`\`${n}\``:/[^a-zA-Z_[\]\d]/.test(n)?`\`${n}\``:n});var of=X(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.printers=oi.parsers=oi.languages=oi.AST_FORMAT_NAME=oi.AST_PARSER_NAME=void 0;var fa=Zc(),_A=rf();oi.AST_PARSER_NAME="JSONata";oi.AST_FORMAT_NAME="JSONataASTNode";oi.languages=[{name:"JSONata",extensions:["jsonata","JSONata"],parsers:[oi.AST_PARSER_NAME]}];oi.parsers={[oi.AST_PARSER_NAME]:{astFormat:oi.AST_FORMAT_NAME,parse:fa.parse,locStart:fa.locStart,locEnd:fa.locEnd}};oi.printers={[oi.AST_FORMAT_NAME]:{print:_A.print}}});var af=X(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.printers=Fn.parsers=Fn.languages=void 0;var pa=of();Object.defineProperty(Fn,"languages",{enumerable:!0,get:function(){return pa.languages}});Object.defineProperty(Fn,"parsers",{enumerable:!0,get:function(){return pa.parsers}});Object.defineProperty(Fn,"printers",{enumerable:!0,get:function(){return pa.printers}})});var Df=X((NP,Sf)=>{"use strict";Sf.exports={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE:function(){let n=this.input();if(this.is_WHITESPACE()){do n=this.input();while(this.is_WHITESPACE());return this.unput(1),null}switch(n){case"]":return this.attributeListDepth[this.attributeIndex]===0?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return this._input[this.offset]==="/"?this.T_COMMENT():this._input[this.offset]==="*"?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||n==="\\"){for(;this.offset<this.size;){let t=this.input();if(!(this.is_LABEL()||t==="\\")){t&&this.unput(1);break}}return this.T_STRING()}else if(this.is_NUM())return this.consume_NUM();throw new Error(`Bad terminal sequence "${n}" at line ${this.yylineno} (offset ${this.offset})`)}}});var If=X((IP,Nf)=>{"use strict";Nf.exports={T_COMMENT:function(){for(;this.offset<this.size;){let n=this.input();if(n===`
`||n==="\r")return this.tok.T_COMMENT;if(n==="?"&&!this.aspTagMode&&this._input[this.offset]===">")return this.unput(1),this.tok.T_COMMENT;if(n==="%"&&this.aspTagMode&&this._input[this.offset]===">")return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){let n=this.input(),t=this.tok.T_COMMENT;if(n==="*"){if(n=this.input(),this.is_WHITESPACE()&&(t=this.tok.T_DOC_COMMENT),n==="/")return t;this.unput(1)}for(;this.offset<this.size;)if(n=this.input(),n==="*"&&this._input[this.offset]==="/"){this.input();break}return t}}});var wf=X((PP,Pf)=>{"use strict";Pf.exports={nextINITIAL:function(){return this.conditionStack.length>1&&this.conditionStack[this.conditionStack.length-1]==="INITIAL"?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset<this.size;){let n=this.input();if(n=="<"){if(n=this.ahead(1),n=="?"){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}else if(this.tryMatchCaseless("?php")&&(n=this._input[this.offset+4],n===" "||n===" "||n===`
`||n==="\r")){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&n=="%")if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}else{this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}}return this.yytext.length>0?this.tok.T_INLINE_HTML:!1}}});var Ff=X((wP,Lf)=>{"use strict";var vo=10,Of="2147483648";process.arch=="x64"&&(vo=19,Of="9223372036854775808");Lf.exports={consume_NUM:function(){let n=this.yytext[0],t=n===".";if(n==="0")if(n=this.input(),n==="x"||n==="X"){if(n=this.input(),n!=="_"&&this.is_HEX())return this.consume_HNUM();this.unput(n?2:1)}else if(n==="b"||n==="B"){if(n=this.input(),n!=="_"&&n==="0"||n==="1")return this.consume_BNUM();this.unput(n?2:1)}else if(n==="o"||n==="O"){if(n=this.input(),n!=="_"&&this.is_OCTAL())return this.consume_ONUM();this.unput(n?2:1)}else this.is_NUM()||n&&this.unput(1);for(;this.offset<this.size;){let e=n;if(n=this.input(),n==="_"){if(e==="_"){this.unput(2);break}if(e==="."){this.unput(1);break}if(e==="e"||e==="E"){this.unput(2);break}}else if(n==="."){if(t){this.unput(1);break}if(e==="_"){this.unput(2);break}t=!0;continue}else if(n==="e"||n==="E"){if(e==="_"){this.unput(1);break}let i=2;if(n=this.input(),(n==="+"||n==="-")&&(i=3,n=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(n?i:i-1);break}if(!this.is_NUM()){n&&this.unput(1);break}}return t?this.tok.T_DNUMBER:this.yytext.length<vo-1?this.tok.T_LNUMBER:this.yytext.length<vo||this.yytext.length==vo&&this.yytext<Of?this.tok.T_LNUMBER:this.tok.T_DNUMBER},consume_HNUM:function(){for(;this.offset<this.size;){let n=this.input();if(!this.is_HEX()){n&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_LNUM:function(){for(;this.offset<this.size;){let n=this.input();if(!this.is_NUM()){n&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){let n;for(;this.offset<this.size;)if(n=this.input(),n!=="0"&&n!=="1"&&n!=="_"){n&&this.unput(1);break}return this.tok.T_LNUMBER},consume_ONUM:function(){for(;this.offset<this.size;){let n=this.input();if(!this.is_OCTAL()){n&&this.unput(1);break}}return this.tok.T_LNUMBER}}});var Bf=X((OP,Rf)=>{"use strict";Rf.exports={matchST_LOOKING_FOR_PROPERTY:function(){let n=this.input();if(n==="-"){if(n=this.input(),n===">")return this.tok.T_OBJECT_OPERATOR;n&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),n&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){let n=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),n=this.input(),n==="["||n==="}")return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else n&&this.unput(1);return!1},matchST_VAR_OFFSET:function(){let n=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if(n==="]")return this.popState(),"]";if(n==="$"){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}else{if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||n==="\\"||n==="'"||n==="#")return this.tok.T_ENCAPSED_AND_WHITESPACE;if(n==="["||n==="{"||n==="}"||n==='"'||n==="`"||this.is_TOKEN())return n;throw new Error("Unexpected terminal")}}}});var Uf=X((LP,Mf)=>{"use strict";Mf.exports={matchST_IN_SCRIPTING:function(){let n=this.input();switch(n){case" ":case" ":case`
`:case"\r":case`\r
`:return this.T_WHITESPACE();case"#":return this.version>=800&&this._input[this.offset]==="["?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return this._input[this.offset]==="/"?this.T_COMMENT():this._input[this.offset]==="*"?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();let t=this._input[this.offset];return(t===`
`||t==="\r")&&this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&this._input[this.offset]===">"?(this.input(),n=this._input[this.offset],(n===`
`||n==="\r")&&this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if(n==="."){if(n=this.input(),this.is_NUM_START())return this.consume_NUM();n&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+n+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function(){for(;this.offset<this.size;){let n=this.input();if(!(n===" "||n===" "||n===`
`||n==="\r")){n&&this.unput(1);break}}return this.tok.T_WHITESPACE}}});var Vf=X((FP,Hf)=>{"use strict";var Un=[`
`,"\r"],Wf=[`
`,"\r",";"],LA=Wf.concat([" "," ",",","]",")","/","=","!"]);Hf.exports={T_CONSTANT_ENCAPSED_STRING:function(){let n;for(;this.offset<this.size;)if(n=this.input(),n=="\\")this.input();else if(n=="'")break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){let n=this.offset;if(this._input[this.offset-1]==="<"&&this._input[this.offset]==="<"&&this._input[this.offset+1]==="<"){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,!!this.is_TABSPACE()););let t=this._input[this.offset-1];if(t==="'"||t==='"'?this.offset++:t=null,this.is_LABEL_START()){let e=this.offset-1;for(;this.offset<this.size&&(this.offset++,!!this.is_LABEL()););let i=this._input.substring(e,this.offset-1);if((!t||t===this._input[this.offset-1])&&(t&&this.offset++,Un.includes(this._input[this.offset-1])))return this.heredoc_label.label=i,this.heredoc_label.length=i.length,this.heredoc_label.finished=!1,e=this.offset-n,this.offset=n,this.consume(e),t==="'"?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.prematch_ENDOFDOC(),this.tok.T_START_HEREDOC}}return this.offset=n,!1},ST_DOUBLE_QUOTES:function(){let n;for(;this.offset<this.size;)if(n=this.input(),n=="\\")this.input();else{if(n=='"')break;if(n=="$"){if(n=this.input(),n=="{"||this.is_LABEL_START()){this.unput(2);break}n&&this.unput(1)}else if(n=="{"){if(n=this.input(),n=="$"){this.unput(2);break}n&&this.unput(1)}}if(n=='"')return this.tok.T_CONSTANT_ENCAPSED_STRING;{let t=1;return(this.yytext[0]==="b"||this.yytext[0]==="B")&&(t=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-t),this.unput(this.yytext.length-t),this.begin("ST_DOUBLE_QUOTES"),this.yytext}},isDOC_MATCH:function(n,t){let e=this._input[n-2];if(!Un.includes(e))return!1;let i=!1,r=!1,o=0,h=this._input[n-1];if(this.version>=703){for(;h===" "||h===" ";)h===" "?i=!0:h===" "&&(r=!0),h=this._input[n+o],o++;if(n=n+o,Un.includes(this._input[n-1]))return!1}if(this._input.substring(n-1,n-1+this.heredoc_label.length)===this.heredoc_label.label){let f=this._input[n-1+this.heredoc_label.length];if((this.version>=703?LA:Wf).includes(f)){if(t){if(this.consume(o),i&&r)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=o,this.heredoc_label.indentation_uses_spaces=i,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC:function(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;let n=this.offset+1;for(;n<this._input.length;){if(this.isDOC_MATCH(n,!1))return;if(!Un.includes(this._input[n-1]))for(;!Un.includes(this._input[n++])&&n<this._input.length;);n++}},matchST_NOWDOC:function(){if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;let n=this._input[this.offset-1];for(;this.offset<this.size;)if(Un.includes(n)){if(n=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else n=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC:function(){let n=this.input();if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if(n==="\\"&&(n=this.input(),Un.includes(n)||(n=this.input())),Un.includes(n)){if(n=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if(n==="$"){if(n=this.input(),n==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){let t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}}else if(n==="{"){if(n=this.input(),n==="$")return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else n=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){this.consume_LABEL();let n=this.input();if(n=="[")return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if(n==="-"){if(this.input()===">")return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else n&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){let n=this.input();if(n==="$"){if(n=this.input(),n==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if(n==="{"){if(this._input[this.offset]==="$")return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if(n==="`")return this.popState(),"`";for(;this.offset<this.size;){if(n==="\\")this.input();else if(n==="`"){this.unput(1),this.popState(),this.appendToken("`",1);break}else if(n==="$"){if(n=this.input(),n==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){let t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}continue}else if(n==="{"){if(n=this.input(),n==="$")return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}n=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){let n=this.input();if(n==="$"){if(n=this.input(),n==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if(n==="{"){if(this._input[this.offset]==="$")return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if(n==='"')return this.popState(),'"';for(;this.offset<this.size;){if(n==="\\")this.input();else if(n==='"'){this.unput(1),this.popState(),this.appendToken('"',1);break}else if(n==="$"){if(n=this.input(),n==="{")return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){let t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}n&&this.unput(1)}else if(n==="{"){if(n=this.input(),n==="$")return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);n&&this.unput(1)}n=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}}});var qf=X((RP,Gf)=>{"use strict";Gf.exports={T_STRING:function(){let n=this.yytext.toLowerCase(),t=this.keywords[n];if(typeof t!="number"){if(n==="yield")this.version>=700&&this.tryMatch(" from")?(this.consume(5),t=this.tok.T_YIELD_FROM):t=this.tok.T_YIELD;else if(t=this.tok.T_STRING,n==="b"||n==="B"){let e=this.input();if(e==='"')return this.ST_DOUBLE_QUOTES();if(e==="'")return this.T_CONSTANT_ENCAPSED_STRING();e&&this.unput(1)}}if(t===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;let e=this.offset,i=this.input();for(;i==" ";)i=this.input();let r=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)i+=this.input();let o=i.slice(0,-1).toLowerCase();r=o!=="extends"&&o!=="implements"}return this.unput(this.offset-e),r?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&t!==this.tok.T_YIELD_FROM){let e=this.input();if(e==="\\"){t=n==="namespace"?this.tok.T_NAME_RELATIVE:this.tok.T_NAME_QUALIFIED;do{if(this._input[this.offset]==="{"){this.input();break}this.consume_LABEL(),e=this.input()}while(e==="\\")}e&&this.unput(1)}return t},consume_TOKEN:function(){let n=this._input[this.offset-1],t=this.tokenTerminals[n];return t?t.apply(this,[]):this.yytext},tokenTerminals:{$:function(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function(){let n=this._input[this.offset];return n===">"?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):n==="-"?(this.input(),this.tok.T_DEC):n==="="?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){if(this.offset<this.size)if(this.input(),this.is_LABEL_START()){let n;do{if(this._input[this.offset]==="{"){this.input();break}this.consume_LABEL(),n=this.input()}while(n==="\\");return this.unput(1),this.tok.T_NAME_FULLY_QUALIFIED}else this.unput(1);return this.tok.T_NS_SEPARATOR},"/":function(){return this._input[this.offset]==="="?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function(){return this._input[this.offset]===":"?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function(){let n=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){let t=this.yytext.length;this.consume_LABEL();let e=this.yytext.substring(t-1).toLowerCase(),i=this.castKeywords[e];if(typeof i=="number"&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this._input[this.offset-1]===")"))return i}return this.unput(this.offset-n),"("},"=":function(){let n=this._input[this.offset];return n===">"?(this.input(),this.tok.T_DOUBLE_ARROW):n==="="?this._input[this.offset+1]==="="?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){let n=this._input[this.offset];return n==="+"?(this.input(),this.tok.T_INC):n==="="?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return this._input[this.offset]==="="?this._input[this.offset+1]==="="?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return this.version>=700&&this._input[this.offset]==="?"?this.version>=704&&this._input[this.offset+1]==="="?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&this._input[this.offset]==="-"&&this._input[this.offset+1]===">"?(this.consume(2),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){let n=this._input[this.offset];return n==="<"?(n=this._input[this.offset+1],n==="="?(this.consume(2),this.tok.T_SL_EQUAL):n==="<"&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL)):n==="="?(this.input(),this.version>=700&&this._input[this.offset]===">"?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):n===">"?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){let n=this._input[this.offset];return n==="="?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):n===">"?(n=this._input[this.offset+1],n==="="?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR)):">"},"*":function(){let n=this._input[this.offset];return n==="="?(this.input(),this.tok.T_MUL_EQUAL):n==="*"?(this.input(),this._input[this.offset]==="="?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){let n=this._input[this.offset];return n==="="?(this.input(),this.tok.T_CONCAT_EQUAL):n==="."&&this._input[this.offset+1]==="."?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return this._input[this.offset]==="="?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){let n=this._input[this.offset];return n==="="?(this.input(),this.tok.T_AND_EQUAL):n==="&"?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){let n=this._input[this.offset];return n==="="?(this.input(),this.tok.T_OR_EQUAL):n==="|"?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return this._input[this.offset]==="="?(this.input(),this.tok.T_XOR_EQUAL):"^"}}}});var Jf=X((BP,zf)=>{"use strict";var FA=";:,.\\[]()|^&+-/*=%!~$<>?@";zf.exports={is_NUM:function(){let n=this._input.charCodeAt(this.offset-1);return n>47&&n<58||n===95},is_NUM_START:function(){let n=this._input.charCodeAt(this.offset-1);return n>47&&n<58},is_LABEL:function(){let n=this._input.charCodeAt(this.offset-1);return n>96&&n<123||n>64&&n<91||n===95||n>47&&n<58||n>126},is_LABEL_START:function(){let n=this._input.charCodeAt(this.offset-1);return n>64&&n<91||n>96&&n<123||n===95||n>126},consume_LABEL:function(){for(;this.offset<this.size;){let n=this.input();if(!this.is_LABEL()){n&&this.unput(1);break}}return this},is_TOKEN:function(){let n=this._input[this.offset-1];return FA.indexOf(n)!==-1},is_WHITESPACE:function(){let n=this._input[this.offset-1];return n===" "||n===" "||n===`
`||n==="\r"},is_TABSPACE:function(){let n=this._input[this.offset-1];return n===" "||n===" "},consume_TABSPACE:function(){for(;this.offset<this.size;){let n=this.input();if(!this.is_TABSPACE()){n&&this.unput(1);break}}return this},is_HEX:function(){let n=this._input.charCodeAt(this.offset-1);return n>47&&n<58||n>64&&n<71||n>96&&n<103||n===95},is_OCTAL:function(){let n=this._input.charCodeAt(this.offset-1);return n>47&&n<56||n===95}}});var Xf=X((MP,Yf)=>{"use strict";var ai=function(n){this.engine=n,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=801,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};ai.prototype.setInput=function(n){return this._input=n,this.size=n.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString:function(){this.label}},this};ai.prototype.input=function(){let n=this._input[this.offset];return n?(this.yytext+=n,this.offset++,n==="\r"&&this._input[this.offset]===`
`&&(this.yytext+=`
`,this.offset++),n===`
`||n==="\r"?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,n):""};ai.prototype.unput=function(n){if(n===1)this.offset--,this._input[this.offset]===`
`&&this._input[this.offset-1]==="\r"&&(this.offset--,n++),this._input[this.offset]==="\r"||this._input[this.offset]===`
`?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-n);else if(n>0)if(this.offset-=n,n<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-n),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(let t=0;t<this.yytext.length;t++){let e=this.yytext[t];e==="\r"?(e=this.yytext[++t],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,e!==`
`&&(e==="\r"?this.yylloc.last_line++:this.yylloc.last_column++)):e===`
`?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this};ai.prototype.tryMatch=function(n){return n===this.ahead(n.length)};ai.prototype.tryMatchCaseless=function(n){return n===this.ahead(n.length).toLowerCase()};ai.prototype.ahead=function(n){let t=this._input.substring(this.offset,this.offset+n);return t[t.length-1]==="\r"&&this._input[this.offset+n+1]===`
`&&(t+=`
`),t};ai.prototype.consume=function(n){for(let t=0;t<n;t++){let e=this._input[this.offset];if(!e)break;this.yytext+=e,this.offset++,e==="\r"&&this._input[this.offset]===`
`&&(this.yytext+=`
`,this.offset++,t++),e===`
`||e==="\r"?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this};ai.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column},heredoc_label:this.heredoc_label}};ai.prototype.setState=function(n){return this.yytext=n.yytext,this.offset=n.offset,this.yylineno=n.yylineno,this.yyprevcol=n.yyprevcol,this.yylloc=n.yylloc,n.heredoc_label&&(this.heredoc_label=n.heredoc_label),this};ai.prototype.appendToken=function(n,t){return this.tokens.push([n,t]),this};ai.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;let n=this.next()||this.lex();if(!this.all_tokens){for(;n===this.tok.T_WHITESPACE||!this.comment_tokens&&(n===this.tok.T_COMMENT||n===this.tok.T_DOC_COMMENT)||n===this.tok.T_OPEN_TAG;)n=this.next()||this.lex();if(n==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO;if(n===this.tok.T_CLOSE_TAG)return";"}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),n};ai.prototype.begin=function(n){if(this.conditionStack.push(n),this.curCondition=n,this.stateCb=this["match"+n],typeof this.stateCb!="function")throw new Error('Undefined condition state "'+n+'"');return this};ai.prototype.popState=function(){let t=this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],typeof this.stateCb!="function")throw new Error('Undefined condition state "'+this.curCondition+'"');return t};ai.prototype.next=function(){let n;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(n=this.tokens.shift(),typeof n[1]=="object"?this.setState(n[1]):this.consume(n[1]),n=n[0]):n=this.stateCb.apply(this,[]),this.offset>=this.size&&this.tokens.length===0&&(this.done=!0),this.debug){let t=n;typeof t=="number"?t=this.engine.tokens.values[t]:t='"'+t+'"';let e=new Error(t+" from "+this.yylloc.first_line+","+this.yylloc.first_column+" - to "+this.yylloc.last_line+","+this.yylloc.last_column+' "'+this.yytext+'"');console.error(e.stack)}return n};[Df(),If(),wf(),Ff(),Bf(),Uf(),Vf(),qf(),Jf()].forEach(function(n){for(let t in n)ai.prototype[t]=n[t]});Yf.exports=ai});var Aa=X((UP,jf)=>{"use strict";var RA=function(n,t,e){this.line=n,this.column=t,this.offset=e};jf.exports=RA});var Qf=X((WP,Kf)=>{"use strict";Kf.exports={read_array:function(){let n=null,t=!1,e=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),n=")"):(t=!0,n="]");let i=[];return this.next().token!==n&&(i=this.read_array_pair_list(t)),this.expect(n),this.next(),e(t,i)},read_array_pair_list:function(n){let t=this;return this.read_list(function(){return t.read_array_pair(n)},",",!0)},read_array_pair:function(n){if(!n&&this.token===")"||n&&this.token==="]")return;if(this.token===",")return this.node("noop")();let t=this.node("entry"),e=null,i=null,r=!1,o=!1;if(this.token==="&")this.next(),r=!0,i=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),this.token==="&"&&this.error(),o=!0,i=this.read_expr();else{let h=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),e=h,this.token==="&"?(this.next(),r=!0,i=this.read_variable(!0,!1)):i=this.read_expr()):i=h}return t(e,i,r,o)}}});var Zf=X((HP,$f)=>{"use strict";$f.exports={read_class_declaration_statement:function(n){let t=this.node("class"),e=this.read_class_modifiers();if(this.token!==this.tok.T_CLASS)return this.error(this.tok.T_CLASS),this.next(),null;this.next().expect(this.tok.T_STRING);let i=this.node("identifier"),r=this.text();this.next(),i=i(r);let o=this.read_extends_from(),h=this.read_implements_list();this.expect("{");let f=this.next().read_class_body(!0,!1),p=t(i,o,h,f,e);return n&&(p.attrGroups=n),p},read_class_modifiers:function(){let n=this.read_class_modifier({readonly:0,final_or_abstract:0});return[0,0,n.final_or_abstract,n.readonly]},read_class_modifier:function(n){return this.token===this.tok.T_READ_ONLY?(this.next(),n.readonly=1,n=this.read_class_modifier(n)):n.final_or_abstract===0&&this.token===this.tok.T_ABSTRACT?(this.next(),n.final_or_abstract=1,n=this.read_class_modifier(n)):n.final_or_abstract===0&&this.token===this.tok.T_FINAL&&(this.next(),n.final_or_abstract=2,n=this.read_class_modifier(n)),n},read_class_body:function(n,t){let e=[],i=[];for(;this.token!==this.EOF&&this.token!=="}";){if(this.token===this.tok.T_COMMENT){e.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){e.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){e=e.concat(this.read_trait_use_statement());continue}if(t&&this.token===this.tok.T_CASE){let h=this.read_enum_case();this.expect(";")&&this.next(),e=e.concat(h);continue}this.token===this.tok.T_ATTRIBUTE&&(i=this.read_attr_list());let r=this.position(),o=this.read_member_flags(!1);if(this.token===this.tok.T_CONST){let h=this.read_constant_list(o,i);this.expect(";")&&this.next(),e=e.concat(h);continue}if(n&&this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),o[0]=null,o[1]=0),this.token===this.tok.T_FUNCTION)e.push(this.read_function(!1,o,i,r)),i=[];else if(n&&(this.token===this.tok.T_VARIABLE||this.version>=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&(this.token==="?"||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){let h=this.read_variable_list(o,i);i=[],this.expect(";"),this.next(),e=e.concat(h)}else this.error([this.tok.T_CONST,...n?[this.tok.T_VARIABLE]:[],...t?[this.tok.T_CASE]:[],this.tok.T_FUNCTION]),this.next()}return this.expect("}"),this.next(),e},read_variable_list:function(n,t){let e=this.node("propertystatement"),i=this.read_list(function(){let o=this.node("property"),h=!1;this.token===this.tok.T_READ_ONLY&&(h=!0,this.next());let[f,p]=this.read_optional_type();this.expect(this.tok.T_VARIABLE);let E=this.node("identifier"),d=this.text().substring(1);return this.next(),E=E(d),this.token===";"||this.token===","?o(E,null,h,f,p,t||[]):this.token==="="?o(E,this.next().read_expr(),h,f,p,t||[]):(this.expect([",",";","="]),o(E,null,f,p,t||[]))},",");return e(null,i,n)},read_constant_list:function(n,t){this.expect(this.tok.T_CONST)&&this.next();let e=this.node("classconstant"),i=this.read_list(function(){let o=this.node("constant"),h=null,f=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){h=this.node("identifier");let p=this.text();this.next(),h=h(p)}else this.expect("IDENTIFIER");return this.expect("=")&&(f=this.next().read_expr()),o(h,f)},",");return e(null,i,n,t||[])},read_member_flags:function(n){let t=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let e=0,i=0;do{switch(this.token){case this.tok.T_PUBLIC:e=0,i=0;break;case this.tok.T_PROTECTED:e=0,i=1;break;case this.tok.T_PRIVATE:e=0,i=2;break;case this.tok.T_STATIC:e=1,i=1;break;case this.tok.T_ABSTRACT:e=2,i=1;break;case this.tok.T_FINAL:e=2,i=2;break}n&&(e==0&&i==2?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),i=-1):e==2&&i==1&&(this.error(),i=-1)),t[e]!==-1?this.error():i!==-1&&(t[e]=i)}while(this.next().is("T_MEMBER_FLAGS"))}return t[1]==-1&&(t[1]=0),t[2]==-1&&(t[2]=0),t},read_optional_type:function(){let n=!1;this.token==="?"&&(n=!0,this.next());let t=this.read_types();if(n&&!t&&this.raiseError("Expecting a type definition combined with nullable operator"),!n&&!t)return[!1,null];if(this.token==="|"){t=[t];do{this.next();let e=this.read_type();if(!e){this.raiseError("Expecting a type definition");break}t.push(e)}while(this.token==="|")}return[n,t]},read_interface_declaration_statement:function(n){let t=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);let e=this.node("identifier"),i=this.text();this.next(),e=e(i);let r=this.read_interface_extends_list();this.expect("{");let o=this.next().read_interface_body();return t(e,r,o,n||[])},read_interface_body:function(){let n=[],t=[];for(;this.token!==this.EOF&&this.token!=="}";){if(this.token===this.tok.T_COMMENT){n.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){n.push(this.read_doc_comment());continue}let e=this.position();t=this.read_attr_list();let i=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){let r=this.read_constant_list(i,t);this.expect(";")&&this.next(),n=n.concat(r),t=[]}else if(this.token===this.tok.T_FUNCTION){let r=this.read_function_declaration(2,i,t,e);r.parseFlags(i),n.push(r),this.expect(";")&&this.next(),t=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}return this.expect("}")&&this.next(),n},read_trait_declaration_statement:function(){let n=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);let t=this.node("identifier"),e=this.text();this.next(),t=t(e),this.expect("{");let i=this.next().read_class_body(!0,!1);return n(t,i)},read_trait_use_statement:function(){let n=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();let t=[this.read_namespace_name()],e=null;for(;this.token===",";)t.push(this.next().read_namespace_name());if(this.token==="{"){for(e=[];this.next().token!==this.EOF&&this.token!=="}";)e.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return n(t,e)},read_trait_use_alias:function(){let n=this.node(),t=null,e;if(this.is("IDENTIFIER")){e=this.node("identifier");let i=this.text();this.next(),e=e(i)}else if(e=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){t=e,e=this.node("identifier");let i=this.text();this.next(),e=e(i)}else this.expect(this.tok.T_STRING);else e=e.name;if(this.token===this.tok.T_INSTEADOF)return n("traitprecedence",t,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let i=null,r=null;if(this.next().is("T_MEMBER_FLAGS")&&(i=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){r=this.node("identifier");let o=this.text();this.next(),r=r(o)}else i===!1&&this.expect(this.tok.T_STRING);return n("traitalias",t,e,r,i)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),n("traitalias",t,e,null,null)}}});var ep=X((VP,tp)=>{"use strict";tp.exports={read_comment:function(){let n=this.text(),t=this.ast.prepare(n.substring(0,2)==="/*"?"commentblock":"commentline",null,this),e=this.lexer.yylloc.first_offset,i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(n),t.offset=e,this.prev=i,t},read_doc_comment:function(){let n=this.ast.prepare("commentblock",null,this),t=this.lexer.yylloc.first_offset,e=this.text(),i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),n=n(e),n.offset=t,this.prev=i,n}}});var np=X((GP,ip)=>{"use strict";ip.exports={read_expr:function(n){let t=this.node();if(this.token==="@")return n||(n=this.next().read_expr()),t("silent",n);if(n||(n=this.read_expr_item()),this.token==="|")return t("bin","|",n,this.next().read_expr());if(this.token==="&")return t("bin","&",n,this.next().read_expr());if(this.token==="^")return t("bin","^",n,this.next().read_expr());if(this.token===".")return t("bin",".",n,this.next().read_expr());if(this.token==="+")return t("bin","+",n,this.next().read_expr());if(this.token==="-")return t("bin","-",n,this.next().read_expr());if(this.token==="*")return t("bin","*",n,this.next().read_expr());if(this.token==="/")return t("bin","/",n,this.next().read_expr());if(this.token==="%")return t("bin","%",n,this.next().read_expr());if(this.token===this.tok.T_POW)return t("bin","**",n,this.next().read_expr());if(this.token===this.tok.T_SL)return t("bin","<<",n,this.next().read_expr());if(this.token===this.tok.T_SR)return t("bin",">>",n,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return t("bin","||",n,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return t("bin","or",n,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return t("bin","&&",n,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return t("bin","and",n,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return t("bin","xor",n,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return t("bin","===",n,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return t("bin","!==",n,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return t("bin","==",n,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return t("bin","!=",n,this.next().read_expr());if(this.token==="<")return t("bin","<",n,this.next().read_expr());if(this.token===">")return t("bin",">",n,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return t("bin","<=",n,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return t("bin",">=",n,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return t("bin","<=>",n,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(n=t("bin","instanceof",n,this.next().read_class_name_reference()),this.token!==";"&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(n=this.read_expr(n))),this.token===this.tok.T_COALESCE)return t("bin","??",n,this.next().read_expr());if(this.token==="?"){let e=null;return this.next().token!==":"&&(e=this.read_expr()),this.expect(":")&&this.next(),t("retif",n,e,this.read_expr())}else t.destroy(n);return n},read_expr_cast:function(n){return this.node("cast")(n,this.text(),this.next().read_expr())},read_isset_variable:function(){return this.read_expr()},read_isset_variables:function(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc:function(){let n=null;switch(this.token){case this.tok.T_ISSET:{n=this.node("isset"),this.next().expect("(")&&this.next();let t=this.read_isset_variables();this.expect(")")&&this.next(),n=n(t)}break;case this.tok.T_EMPTY:{n=this.node("empty"),this.next().expect("(")&&this.next();let t=this.read_expr();this.expect(")")&&this.next(),n=n(t)}break;case this.tok.T_INCLUDE:n=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:n=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:{n=this.node("eval"),this.next().expect("(")&&this.next();let t=this.read_expr();this.expect(")")&&this.next(),n=n(t)}break;case this.tok.T_REQUIRE:n=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:n=this.node("include")(!0,!0,this.next().read_expr());break}return n},read_optional_expr:function(n){return this.token!==n?this.read_expr():null},read_exit_expr:function(){let n=null;return this.token==="("&&(this.next(),n=this.read_optional_expr(")"),this.expect(")")&&this.next()),n},read_expr_item:function(){let n,t,e=[];if(this.token==="+")return this.node("unary")("+",this.next().read_expr());if(this.token==="-")return this.node("unary")("-",this.next().read_expr());if(this.token==="!")return this.node("unary")("!",this.next().read_expr());if(this.token==="~")return this.node("unary")("~",this.next().read_expr());if(this.token==="(")return t=this.next().read_expr(),t.parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(t);if(this.token==="`")return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){let i=null,r=this.innerList;n=this.node("list"),r||(i=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);let o=this.read_array_pair_list(!1);this.expect(")")&&this.next();let h=!1;for(let f=0;f<o.length;f++)if(o[f]!==null&&o[f].kind!=="noop"){h=!0;break}return h||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),r?n(o,!1):(this.innerList=!1,this.expect("=")?i(n(o,!1),this.next().read_expr(),"="):n(o,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(e=this.read_attr_list()),this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1));case this.tok.T_NEW:return this.read_new_expr();case this.tok.T_ISSET:case this.tok.T_EMPTY:case this.tok.T_INCLUDE:case this.tok.T_INCLUDE_ONCE:case this.tok.T_EVAL:case this.tok.T_REQUIRE:case this.tok.T_REQUIRE_ONCE:return this.read_internal_functions_in_yacc();case this.tok.T_MATCH:return this.read_match_expression();case this.tok.T_INT_CAST:return this.read_expr_cast("int");case this.tok.T_DOUBLE_CAST:return this.read_expr_cast("float");case this.tok.T_STRING_CAST:return this.read_expr_cast(this.text().indexOf("binary")!==-1?"binary":"string");case this.tok.T_ARRAY_CAST:return this.read_expr_cast("array");case this.tok.T_OBJECT_CAST:return this.read_expr_cast("object");case this.tok.T_BOOL_CAST:return this.read_expr_cast("bool");case this.tok.T_UNSET_CAST:return this.read_expr_cast("unset");case this.tok.T_THROW:{this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression");let i=this.node("throw"),r=this.next().read_expr();return i(r)}case this.tok.T_EXIT:{let i=this.lexer.yytext.toLowerCase()==="die";n=this.node("exit"),this.next();let r=this.read_exit_expr();return n(r,i)}case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:{let i=null,r=null;return n=this.node("yield"),this.next().is("EXPR")&&(i=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(r=i,i=this.next().read_expr())),n(i,r)}case this.tok.T_YIELD_FROM:return n=this.node("yieldfrom"),t=this.next().read_expr(),n(t);case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,e);case this.tok.T_STATIC:{let i=[this.token,this.lexer.getState()];if(this.next(),this.token===this.tok.T_FUNCTION||this.version>=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],e);this.lexer.tokens.push(i),this.next()}}if(this.is("VARIABLE")){n=this.node(),t=this.read_variable(!1,!1);let i=t.kind==="identifier"||t.kind==="staticlookup"&&t.offset.kind==="identifier";switch(this.token){case"=":return i&&this.error("VARIABLE"),this.next().token=="&"?this.read_assignref(n,t):n("assign",t,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return i&&this.error("VARIABLE"),n("assign",t,this.next().read_expr(),"??=");case this.tok.T_INC:return i&&this.error("VARIABLE"),this.next(),n("post","+",t);case this.tok.T_DEC:return i&&this.error("VARIABLE"),this.next(),n("post","-",t);default:n.destroy(t)}}else if(this.is("SCALAR")){if(n=this.node(),t=this.read_scalar(),t.kind==="array"&&t.shortForm&&this.token==="="){let i=this.convertToList(t);t.loc&&(i.loc=t.loc);let r=this.next().read_expr();return n("assign",i,r,"=")}else n.destroy(t);return this.handleDereferencable(t)}else this.error("EXPR"),this.next();return t},convertToList:function(n){let t=n.items.map(i=>(i.value&&i.value.kind==="array"&&i.value.shortForm&&(i.value=this.convertToList(i.value)),i)),e=this.node("list")(t,!0);return n.loc&&(e.loc=n.loc),n.leadingComments&&(e.leadingComments=n.leadingComments),n.trailingComments&&(e.trailingComments=n.trailingComments),e},read_assignref:function(n,t){this.next();let e;return this.token===this.tok.T_NEW?(this.version>=700&&this.error(),e=this.read_new_expr()):e=this.read_variable(!1,!1),n("assignref",t,e)},read_inline_function:function(n,t){if(this.token===this.tok.T_FUNCTION){let E=this.read_function(!0,n,t);return E.attrGroups=t,E}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");let e=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();let i=this.is_reference();this.expect("(")&&this.next();let r=this.read_parameter_list();this.expect(")")&&this.next();let o=!1,h=null;this.token===":"&&(this.next().token==="?"&&(o=!0,this.next()),h=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();let f=this.read_expr(),p=e(r,i,f,h,o,!!n);return p.attrGroups=t,p},read_match_expression:function(){let n=this.node("match");this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8");let t=null,e=[];return this.expect("(")&&this.next(),t=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),e=this.read_match_arms(),this.expect("}")&&this.next(),n(t,e)},read_match_arms:function(){return this.read_list(()=>this.read_match_arm(),",",!0)},read_match_arm:function(){if(this.token!=="}")return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds:function(){let n=[];if(this.token===this.tok.T_DEFAULT)n=null,this.next();else for(n.push(this.read_expr());this.token===",";){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),n;n.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),n},read_attribute(){let n=this.text(),t=[];return this.next(),this.token==="("&&(t=this.read_argument_list()),this.node("attribute")(n,t)},read_attr_list(){let n=[];if(this.token===this.tok.T_ATTRIBUTE)do{let t=this.node("attrgroup")([]);for(this.next(),t.attrs.push(this.read_attribute());this.token===",";)this.next(),this.token!=="]"&&t.attrs.push(this.read_attribute());n.push(t),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return n},read_new_expr:function(){let n=this.node("new");this.expect(this.tok.T_NEW)&&this.next();let t=[];if(this.token==="("){this.next();let r=this.read_expr();return this.expect(")"),this.next(),this.token==="("&&(t=this.read_argument_list()),n(r,t)}let e=this.read_attr_list();if(this.token===this.tok.T_CLASS){let r=this.node("class");this.next().token==="("&&(t=this.read_argument_list());let o=this.read_extends_from(),h=this.read_implements_list(),f=null;this.expect("{")&&(f=this.next().read_class_body(!0,!1));let p=r(null,o,h,f,[0,0,0]);return p.attrGroups=e,n(p,t)}let i=this.read_new_class_name();for(;this.token==="[";){let r=this.node("offsetlookup"),o=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),i=r(i,o)}return this.token==="("&&(t=this.read_argument_list()),n(i,t)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){let n=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(n=this.read_static_getter(n)),n}else{if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])}},handleDereferencable:function(n){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)n=this.recursive_variable_chain_scan(n,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||this.token==="[")n=this.read_dereferencable(n);else if(this.token==="(")n=this.node("call")(n,this.read_argument_list());else return n;return n}}});var rp=X((qP,sp)=>{"use strict";sp.exports={read_enum_declaration_statement:function(n){let t=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);let e=this.node("identifier"),i=this.text();this.next(),e=e(i);let r=this.read_enum_value_type(),o=this.read_implements_list();this.expect("{");let h=this.next().read_class_body(!1,!0),f=t(e,r,o,h);return n&&(f.attrGroups=n),f},read_enum_value_type:function(){return this.token===":"?this.next().read_namespace_name():null},read_enum_case:function(){this.expect(this.tok.T_CASE);let n=this.node("enumcase"),t=this.node("identifier"),e=this.next().text();this.next(),t=t(e);let i=this.token==="="?this.next().read_expr():null;return this.expect(";"),n(t,i)}}});var ap=X((zP,op)=>{"use strict";op.exports={is_reference:function(){return this.token==="&"?(this.next(),!0):!1},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS?(this.next(),!0):!1},read_function:function(n,t,e,i){let r=this.read_function_declaration(n?1:t?2:0,t&&t[1]===1,e||[],i);return t&&t[2]==1?(r.parseFlags(t),this.expect(";")&&this.next()):(this.expect("{")&&(r.body=this.read_code_block(!1),r.loc&&r.body.loc&&(r.loc.end=r.body.loc.end)),!n&&t&&r.parseFlags(t)),r},read_function_declaration:function(n,t,e,i){let r="function";n===1?r="closure":n===2&&(r="method");let o=this.node(r);this.expect(this.tok.T_FUNCTION)&&this.next();let h=this.is_reference(),f=!1,p=[],E=null,d=!1;if(n!==1){let u=this.node("identifier");n===2?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(f=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(f=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(f=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(f=this.text()),this.next()),f=u(f)}this.expect("(")&&this.next();let x=this.read_parameter_list(f.name==="__construct");this.expect(")")&&this.next(),n===1&&(p=this.read_lexical_vars()),this.token===":"&&(this.next().token==="?"&&(d=!0,this.next()),E=this.read_types());let _=u=>(u.attrGroups=e||[],i&&u.loc&&(u.loc.start=i,u.loc.source&&(u.loc.source=this.lexer._input.substr(u.loc.start.offset,u.loc.end.offset-u.loc.start.offset))),u);return _(n===1?o(x,h,p,E,d,t):o(f,x,h,E,d))},read_lexical_vars:function(){let n=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),n=this.read_lexical_var_list(),this.expect(")")&&this.next()),n},read_list_with_dangling_comma:function(n){let t=[];for(;this.token!=this.EOF;)if(t.push(n()),this.token==","){if(this.next(),this.version>=800&&this.token===")")return t}else{if(this.token==")")break;this.error([",",")"]);break}return t},read_lexical_var_list:function(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var:function(){if(this.token==="&")return this.read_byref(this.read_lexical_var.bind(this));let n=this.node("variable");this.expect(this.tok.T_VARIABLE);let t=this.text().substring(1);return this.next(),n(t,!1)},read_parameter_list:function(n){if(this.token!==")"){let t=!1;return this.read_list_with_dangling_comma(function(){let e=this.read_parameter(n);return e&&(t&&this.raiseError("Unexpected parameter after a variadic parameter"),e.variadic&&(t=!0)),e}.bind(this),",")}return[]},read_parameter:function(n){let t=this.node("parameter"),e=null,i=null,r=null,o=!1,h=!1,f=[];this.token===this.tok.T_ATTRIBUTE&&(f=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(n?(this.next(),h=!0):this.raiseError("readonly properties can be used only on class constructor"));let p=this.read_promoted();!h&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(n?(this.next(),h=!0):this.raiseError("readonly properties can be used only on class constructor")),this.token==="?"&&(this.next(),o=!0),r=this.read_types(),o&&!r&&this.raiseError("Expecting a type definition combined with nullable operator");let E=this.is_reference(),d=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){e=this.node("identifier");let _=this.text().substring(1);this.next(),e=e(_)}this.token=="="&&(i=this.next().read_expr());let x=t(e,r,i,E,d,h,o,p);return f&&(x.attrGroups=f),x},read_types(){let n="unset",t="union",e="intersection",i=[],r=n,o=this.read_type();if(!o)return null;for(i.push(o);this.token==="|"||this.version>=801&&this.token==="&";){let h=this.peek();if(h===this.tok.T_ELLIPSIS||h===this.tok.T_VARIABLE)break;r===n?r=this.token==="|"?t:e:(r===t&&this.token!=="|"||r===e&&this.token!=="&")&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),i.push(this.read_type())}return i.length===1?i[0]:r===e?this.node("intersectiontype")(i):this.node("uniontype")(i)},read_promoted(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list:function(){let n=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&this.peek()===")"?(n.push(this.node("variadicplaceholder")()),this.next()):this.token!==")"&&(n=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),n},read_non_empty_argument_list:function(){let n=!1;return this.read_function_list(function(){let t=this.read_argument();if(t){let e=t.kind==="variadic";n&&!e&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),e&&(n=!0)}return t}.bind(this),",")},read_argument:function(){return this.token===this.tok.T_ELLIPSIS?this.node("variadic")(this.next().read_expr()):(this.token===this.tok.T_STRING||Object.values(this.lexer.keywords).includes(this.token))&&this.peek()===":"?(this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr())):this.read_expr()},read_type:function(){let n=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){let t=this.text();return this.next(),n("typereference",t.toLowerCase(),t)}else if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){let t=this.text(),e=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(t.toLowerCase())>-1?n("typereference",t.toLowerCase(),t):(this.lexer.tokens.push(e),this.next(),n.destroy(),this.read_namespace_name())}return n.destroy(),null}}});var up=X((JP,hp)=>{"use strict";hp.exports={read_if:function(){let n=this.node("if"),t=this.next().read_if_expr(),e=null,i=null,r=!1;if(this.token===":"){r=!0,this.next(),e=this.node("block");let o=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){i=this.read_elseif_short();break}else if(this.token===this.tok.T_ELSE){i=this.read_else_short();break}o.push(this.read_inner_statement())}e=e(null,o),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else e=this.read_statement(),this.token===this.tok.T_ELSEIF?i=this.read_if():this.token===this.tok.T_ELSE&&(i=this.next().read_statement());return n(t,e,i,r)},read_if_expr:function(){this.expect("(")&&this.next();let n=this.read_expr();return this.expect(")")&&this.next(),n},read_elseif_short:function(){let n=null,t=this.node("if"),e=this.next().read_if_expr();this.expect(":")&&this.next();let i=this.node("block"),r=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){n=this.read_elseif_short();break}else if(this.token===this.tok.T_ELSE){n=this.read_else_short();break}r.push(this.read_inner_statement())}return t(e,i(null,r),n,!0)},read_else_short:function(){this.next().expect(":")&&this.next();let n=this.node("block"),t=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)t.push(this.read_inner_statement());return n(null,t)}}});var cp=X((YP,lp)=>{"use strict";lp.exports={read_while:function(){let n=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let t=null,e=null,i=!1;return this.expect("(")&&this.next(),t=this.read_expr(),this.expect(")")&&this.next(),this.token===":"?(i=!0,e=this.read_short_form(this.tok.T_ENDWHILE)):e=this.read_statement(),n(t,e,i)},read_do:function(){let n=this.node("do");this.expect(this.tok.T_DO)&&this.next();let t=null,e=null;return e=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),t=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),n(t,e)},read_for:function(){let n=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let t=[],e=[],i=[],r=null,o=!1;return this.expect("(")&&this.next(),this.token!==";"?(t=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),this.token!==";"?(e=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),this.token!==")"?(i=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),this.token===":"?(o=!0,r=this.read_short_form(this.tok.T_ENDFOR)):r=this.read_statement(),n(t,e,i,r,o)},read_foreach:function(){let n=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let t=null,e=null,i=null,r=null,o=!1;return this.expect("(")&&this.next(),t=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),i=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(e=i,i=this.next().read_foreach_variable())),e&&e.kind==="list"&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),this.token===":"?(o=!0,r=this.read_short_form(this.tok.T_ENDFOREACH)):r=this.read_statement(),n(t,e,i,r,o)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||this.token==="["){let n=this.token==="[",t=this.node("list");this.next(),!n&&this.expect("(")&&this.next();let e=this.read_array_pair_list(n);return this.expect(n?"]":")")&&this.next(),t(e,n)}else return this.read_variable(!1,!1)}}});var pp=X((XP,fp)=>{"use strict";fp.exports={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}}});var mp=X((jP,dp)=>{"use strict";dp.exports={read_namespace:function(){let n=this.node("namespace"),t;this.expect(this.tok.T_NAMESPACE)&&this.next();let e;return this.token==="{"?e={name:[""]}:e=this.read_namespace_name(),this.currentNamespace=e,this.token===";"?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect(this.EOF),n(e.name,t,!1)):this.token==="{"?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect("}")&&this.next(),t.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),n(e.name,t,!0)):(this.error(["{",";"]),this.currentNamespace=e,t=this.read_top_statements(),this.expect(this.EOF),n(e,t,!1))},read_namespace_name:function(n){let t=this.node(),e,i=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:e=this.ast.name.RELATIVE_NAME,i=i.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:e=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:e=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(e=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return t("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),n||this.token!=="("){if(i.toLowerCase()==="parent")return t("parentreference",i);if(i.toLowerCase()==="self")return t("selfreference",i)}return t("name",i,e)},read_use_statement:function(){let n=this.node("usegroup"),t=[],e=null;this.expect(this.tok.T_USE)&&this.next();let i=this.read_use_type();return t.push(this.read_use_declaration(!1)),this.token===","?t=t.concat(this.next().read_use_declarations(!1)):this.token==="{"&&(e=t[0].name,t=this.next().read_use_declarations(i===null),this.expect("}")&&this.next()),n=n(e,i,t),this.expect(";")&&this.next(),n},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(n){let t=this.node("useitem"),e=null;n&&(e=this.read_use_type());let i=this.read_namespace_name(),r=this.read_use_alias();return t(i.name,r,e)},read_use_declarations:function(n){let t=[this.read_use_declaration(n)];for(;this.token===",";){if(this.next(),n){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;t.push(this.read_use_declaration(n))}return t},read_use_alias:function(){let n=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){let t=this.node("identifier"),e=this.text();this.next(),n=t(e)}return n},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}}});var _p=X((KP,xp)=>{"use strict";var gp={"\\":"\\",$:"$",n:`
`,r:"\r",t:" ",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};xp.exports={resolve_special_chars:function(n,t){return t?n.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,(e,i,r)=>gp[i]?gp[i]:i[0]==="x"||i[0]==="X"?String.fromCodePoint(parseInt(i.substr(1),16)):i[0]==="u"?String.fromCodePoint(parseInt(r,16)):String.fromCodePoint(parseInt(i,8))):n.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(n,t,e,i){if(t===0)return n;this.check_heredoc_indentation_level(n,t,e,i);let r=e?" ":" ",o=new RegExp(`\\n${r}{${t}}`,"g"),h=new RegExp(`^${r}{${t}}`);return i&&(n=n.replace(h,"")),n.replace(o,`
`)},check_heredoc_indentation_level:function(n,t,e,i){let r=n.length,o=0,h=0,f=!0,p=e?" ":" ",E=!1;if(!i){if(o=n.indexOf(`
`),o===-1)return;o++}for(;o<r;)f?n[o]===p?h++:E=!0:f=!1,n[o]!==`
`&&E&&h<t?this.raiseError(`Invalid body indentation level (expecting an indentation at least ${t})`):E=!1,n[o]===`
`&&(f=!0,h=0),o++},read_dereferencable_scalar:function(){let n=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:{let t=this.node("string"),e=this.text(),i=0;(e[0]==="b"||e[0]==="B")&&(i=1);let r=e[i]==='"';this.next();let o=this.resolve_special_chars(e.substring(i+1,e.length-1),r);t=t(r,o,i===1,e),this.token===this.tok.T_DOUBLE_COLON?n=this.read_static_getter(t):n=t}break;case this.tok.T_ARRAY:n=this.read_array();break;case"[":n=this.read_array();break}return n},read_scalar:function(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();{let n,t;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:{let e=this.node("number");return n=this.text(),this.next(),e(n,null)}case this.tok.T_START_HEREDOC:if(this.lexer.curCondition==="ST_NOWDOC"){let e=this.lexer.yylloc.first_offset;t=this.node("nowdoc"),n=this.next().text(),this.lexer.heredoc_label.indentation>0&&(n=n.substring(0,n.length-this.lexer.heredoc_label.indentation));let i=n[n.length-1];i===`
`?n[n.length-2]==="\r"?n=n.substring(0,n.length-2):n=n.substring(0,n.length-1):i==="\r"&&(n=n.substring(0,n.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();let r=this.lexer._input.substring(e,this.lexer.yylloc.first_offset);return t=t(this.remove_heredoc_leading_whitespace_chars(n,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),r,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,t}else return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:{let e=this.error("SCALAR");return this.next(),e}}}},read_dereferencable:function(n){let t,e,i=this.node("offsetlookup");return this.token==="["?(e=this.next().read_expr(),this.expect("]")&&this.next(),t=i(n,e)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(e=this.read_encapsed_string_item(!1),t=i(n,e)),t},read_encapsed_string_item:function(n){let t=this.node("encapsedpart"),e=null,i=!1,r=this.node(),o,h,f;if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){let p=this.text();this.next(),r=r("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(p,n),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):p,!1,p)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(e="simple",i=!0,f=null,this.next().token===this.tok.T_STRING_VARNAME){f=this.node("variable");let p=this.text();this.next(),r.destroy(),this.token==="["?(f=f(p,!1),h=this.node("offsetlookup"),o=this.next().read_expr(),this.expect("]")&&this.next(),r=h(f,o)):r=f(p,!1)}else r=r("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)e="complex",r.destroy(),r=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(e="simple",r.destroy(),r=this.read_simple_variable(),this.token==="["&&(h=this.node("offsetlookup"),o=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),r=h(r,o)),this.token===this.tok.T_OBJECT_OPERATOR){h=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);let p=this.node("identifier");f=this.text(),this.next(),r=h(r,p(f))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);let p=this.text();this.next(),r.destroy(),r=r("string",!1,p,!1,p)}return this.lexer.heredoc_label.first_encaps_node=!1,t(r,e,i)},read_encapsed_string:function(n,t=!1){let e=this.lexer.yylloc.first_offset,i=this.node("encapsed");this.next();let r=this.lexer.yylloc.prev_offset-(t?1:0),o=[],h=null;for(n==="`"?h=this.ast.encapsed.TYPE_SHELL:n==='"'?h=this.ast.encapsed.TYPE_STRING:h=this.ast.encapsed.TYPE_HEREDOC;this.token!==n&&this.token!==this.EOF;)o.push(this.read_encapsed_string_item(!0));if(o.length>0&&o[o.length-1].kind==="encapsedpart"&&o[o.length-1].expression.kind==="string"){let p=o[o.length-1].expression,E=p.value[p.value.length-1];E===`
`?p.value[p.value.length-2]==="\r"?p.value=p.value.substring(0,p.value.length-2):p.value=p.value.substring(0,p.value.length-1):E==="\r"&&(p.value=p.value.substring(0,p.value.length-1))}this.expect(n)&&this.next();let f=this.lexer._input.substring(h==="heredoc"?e:r-1,this.lexer.yylloc.first_offset);return i=i(o,f,h),n===this.tok.T_END_HEREDOC&&(i.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),i},get_magic_constant:function(){let n=this.node("magic"),t=this.text();return this.next(),n(t.toUpperCase(),t)}}});var kp=X((QP,Ep)=>{"use strict";Ep.exports={read_top_statements:function(){let n=[];for(;this.token!==this.EOF&&this.token!=="}";){let t=this.read_top_statement();t&&(Array.isArray(t)?n=n.concat(t):n.push(t))}return n},read_top_statement:function(){let n=[];switch(this.token===this.tok.T_ATTRIBUTE&&(n=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,n);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(n);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(n);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(n);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:{let t=this.node("constantstatement"),e=this.next().read_const_list();return this.expectEndOfStatement(),t(null,e)}case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:{let t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,t(this.lexer._input.substring(this.lexer.offset))}default:return this.read_statement()}},read_inner_statements:function(){let n=[];for(;this.token!=this.EOF&&this.token!=="}";){let t=this.read_inner_statement();t&&(Array.isArray(t)?n=n.concat(t):n.push(t))}return n},read_const_list:function(){return this.read_list(function(){this.expect(this.tok.T_STRING);let n=this.node("constant"),t=this.node("identifier"),e=this.text();return this.next(),t=t(e),this.expect("=")?n(t,this.next().read_expr()):n(t,null)},",",!1)},read_declare_list:function(){let n=[];for(;this.token!=this.EOF&&this.token!==")";){this.expect(this.tok.T_STRING);let t=this.node("declaredirective"),e=this.node("identifier"),i=this.text();this.next(),e=e(i);let r=null;if(this.expect("=")&&(r=this.next().read_expr()),n.push(t(e,r)),this.token!==",")break;this.next()}return n},read_inner_statement:function(){let n=[];switch(this.token===this.tok.T_ATTRIBUTE&&(n=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:{let t=this.read_function(!1,!1);return t.attrGroups=n,t}case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:{this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");let t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),t=t(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),t}default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:{let n=this.node("return");this.next();let t=this.read_optional_expr(";");return this.expectEndOfStatement(),n(t)}case this.tok.T_BREAK:case this.tok.T_CONTINUE:{let n=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();let t=this.read_optional_expr(";");return this.expectEndOfStatement(),n(t)}case this.tok.T_GLOBAL:{let n=this.node("global"),t=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),n(t)}case this.tok.T_STATIC:{let n=[this.token,this.lexer.getState()],t=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(n);let i=this.next().read_expr();return this.expectEndOfStatement(i),t("expressionstatement",i)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);let e=this.read_variable_declarations();return this.expectEndOfStatement(),t("static",e)}case this.tok.T_ECHO:{let n=this.node("echo"),t=this.text(),e=t==="<?="||t==="<%=",i=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),n(i,e)}case this.tok.T_INLINE_HTML:{let n=this.text(),t=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,e=t==="\r"||t===`
`;e&&t===`
`&&this.lexer.yylloc.first_offset>1&&this.lexer._input[this.lexer.yylloc.first_offset-2]==="\r"&&(t=`\r
`);let i=this.node("inline");return this.next(),i(n,e?t+n:n)}case this.tok.T_UNSET:{let n=this.node("unset");this.next().expect("(")&&this.next();let t=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),n(t)}case this.tok.T_DECLARE:{let n=this.node("declare"),t=[],e;this.next().expect("(")&&this.next();let i=this.read_declare_list();if(this.expect(")")&&this.next(),this.token===":"){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)t.push(this.read_top_statement());t.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),e=this.ast.declare.MODE_SHORT}else if(this.token==="{"){for(this.next();this.token!=this.EOF&&this.token!=="}";)t.push(this.read_top_statement());t.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),this.expect("}")&&this.next(),e=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),e=this.ast.declare.MODE_NONE;return n(i,t,e)}case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:{let n=this.node("throw"),t=this.next().read_expr();return this.expectEndOfStatement(),n(t)}case";":return this.next(),null;case this.tok.T_STRING:{let n=this.node(),t=[this.token,this.lexer.getState()],e=this.text(),i=this.node("identifier");if(this.next().token===":")return i=i(e),this.next(),n("label",i);i.destroy(),n.destroy(),this.lexer.tokens.push(t);let r=this.node("expressionstatement"),o=this.next().read_expr();return this.expectEndOfStatement(o),r(o)}case this.tok.T_GOTO:{let n=this.node("goto"),t=null;if(this.next().expect(this.tok.T_STRING)){t=this.node("identifier");let e=this.text();this.next(),t=t(e),this.expectEndOfStatement()}return n(t)}default:{let n=this.node("expressionstatement"),t=this.read_expr();return this.expectEndOfStatement(t),n(t)}}},read_code_block:function(n){let t=this.node("block");this.expect("{")&&this.next();let e=n?this.read_top_statements():this.read_inner_statements();return e.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect("}")&&this.next(),t(null,e)}}});var vp=X(($P,yp)=>{"use strict";yp.exports={read_switch:function(){let n=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();let t=this.read_expr();this.expect(")")&&this.next();let e=this.token===":",i=this.read_switch_case_list();return n(t,i,e)},read_switch_case_list:function(){let n=null,t=this.node("block"),e=[];for(this.token==="{"?n="}":this.token===":"?n=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),this.token===";"&&this.next();this.token!==this.EOF&&this.token!==n;)e.push(this.read_case_list(n));return e.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect(n)&&this.next(),n===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),t(null,e)},read_case_list:function(n){let t=this.node("case"),e=null;this.token===this.tok.T_CASE?e=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();let i=this.node("block"),r=[];for(;this.token!==this.EOF&&this.token!==n&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)r.push(this.read_inner_statement());return t(e,i(null,r))}}});var Cp=X((ZP,Tp)=>{"use strict";Tp.exports={read_try:function(){this.expect(this.tok.T_TRY);let n=this.node("try"),t=null,e=[],i=this.next().read_statement();for(;this.token===this.tok.T_CATCH;){let r=this.node("catch");this.next().expect("(")&&this.next();let o=this.read_list(this.read_namespace_name,"|",!1),h=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(h=this.read_variable(!0,!1)),this.expect(")"),e.push(r(this.next().read_statement(),o,h))}return this.token===this.tok.T_FINALLY&&(t=this.next().read_statement()),n(i,e,t)}}});var bp=X((tw,Ap)=>{"use strict";Ap.exports={read_short_form:function(n){let t=this.node("block"),e=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==n;)e.push(this.read_inner_statement());return e.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect(n)&&this.next(),this.expectEndOfStatement(),t(null,e)},read_function_list:function(n,t){let e=[];do{if(this.token==t&&this.version>=703&&e.length>0){e.push(this.node("noop")());break}if(e.push(n.apply(this,[])),this.token!=t||this.next().token==")"&&this.version>=703)break}while(this.token!=this.EOF);return e},read_list:function(n,t,e){let i=[];if(this.token==t&&(e&&i.push(typeof n=="function"?this.node("noop")():null),this.next()),typeof n=="function")do{let r=n.apply(this,[]);if(r&&i.push(r),this.token!=t)break}while(this.next().token!=this.EOF);else{if(this.expect(n))i.push(this.text());else return[];for(;this.next().token!=this.EOF&&!(this.token!=t||this.next().token!=n);)i.push(this.text())}return i},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(n){let t=this.node("byref");this.next(),t=t(null);let e=n();return e&&(this.ast.swapLocations(e,t,e,this),e.byref=!0),e},read_variable_declarations:function(){return this.read_list(function(){let n=this.node("staticvariable"),t=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){let e=this.text().substring(1);this.next(),t=t(e,!1)}else t=t("#ERR",!1);return this.token==="="?n(t,this.next().read_expr()):t},",")},read_extends_from:function(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list:function(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list:function(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}}});var Dp=X((ew,Sp)=>{"use strict";Sp.exports={read_variable:function(n,t){let e;if(this.token==="&")return this.read_byref(this.read_variable.bind(this,n,t));if(this.is([this.tok.T_VARIABLE,"$"]))e=this.read_reference_variable(t);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){e=this.node();let i=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&this.token!="("&&["parentreference","selfreference"].indexOf(i.kind)===-1){let r=i.name.toLowerCase();r==="true"?e=i.destroy(e("boolean",!0,i.name)):r==="false"?e=i.destroy(e("boolean",!1,i.name)):r==="null"?e=i.destroy(e("nullkeyword",i.name)):(e.destroy(i),e=i)}else e.destroy(i),e=i}else if(this.token===this.tok.T_STATIC){e=this.node("staticreference");let i=this.text();this.next(),e=e(i)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(e=this.read_static_getter(e,t)),this.recursive_variable_chain_scan(e,n,t)},read_static_getter:function(n,t){let e=this.node("staticlookup"),i,r;return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(t):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),r=this.text(),this.next(),i=i(r)):this.token==="{"?(i=this.node("literal"),r=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",r,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),r=this.text(),this.next(),i=i(r)),e(n,i)},read_what:function(n=!1){let t=null,e=null;switch(this.next().token){case this.tok.T_STRING:t=this.node("identifier"),e=this.text(),this.next(),t=t(e),n&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:t=this.node("variable"),e=this.text().substring(1),this.next(),t=t(e,!1);break;case"$":t=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),this.token==="{"?(e=this.next().read_expr(),this.expect("}")&&this.next(),t=t("variable",e,!0)):(e=this.read_expr(),t=t("variable",e,!1));break;case"{":t=this.node("encapsedpart"),e=this.next().read_expr(),this.expect("}")&&this.next(),t=t(e,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),t=this.node("identifier"),e=this.text(),this.next(),t=t(e);break}return t},recursive_variable_chain_scan:function(n,t,e){let i,r;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(t)return n;n=this.node("call")(n,this.read_argument_list());break;case"[":case"{":{let h=this.token==="[";i=this.node("offsetlookup"),this.next(),r=!1,e?(r=this.read_encaps_var_offset(),this.expect(h?"]":"}")&&this.next()):(h?this.token!=="]":this.token!=="}")?(r=this.read_expr(),this.expect(h?"]":"}")&&this.next()):this.next(),n=i(n,r);break}case this.tok.T_DOUBLE_COLON:n.kind==="staticlookup"&&n.offset.kind==="identifier"&&this.error(),i=this.node("staticlookup"),n=i(n,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:{i=this.node("propertylookup"),n=i(n,this.read_what());break}case this.tok.T_NULLSAFE_OBJECT_OPERATOR:{i=this.node("nullsafepropertylookup"),n=i(n,this.read_what());break}default:break t}return n},read_encaps_var_offset:function(){let n=this.node();if(this.token===this.tok.T_STRING){let t=this.text();this.next(),n=n("identifier",t)}else if(this.token===this.tok.T_NUM_STRING){let t=this.text();this.next(),n=n("number",t,null)}else if(this.token==="-"){this.next();let t=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),n=n("number",t,null)}else if(this.token===this.tok.T_VARIABLE){let t=this.text().substring(1);this.next(),n=n("variable",t,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);let t=this.text();this.next(),n=n("identifier",t)}return n},read_reference_variable:function(n){let t=this.read_simple_variable(),e;for(;this.token!=this.EOF;){let i=this.node();if(this.token=="{"&&!n)e=this.next().read_expr(),this.expect("}")&&this.next(),t=i("offsetlookup",t,e);else{i.destroy();break}}return t},read_simple_variable:function(){let n=this.node("variable"),t;if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)t=this.text().substring(1),this.next(),n=n(t,!1);else switch(this.token==="$"&&this.next(),this.token){case"{":{let e=this.next().read_expr();this.expect("}")&&this.next(),n=n(e,!0);break}case"$":n=n(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:{t=this.text().substring(1);let e=this.node("variable");this.next(),n=n(e(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),n=n(t,!1)}return n}}});var Ip=X((iw,Np)=>{"use strict";var BA=Aa();function Sa(n){return n!="."&&n!=","&&!isNaN(parseFloat(n))&&isFinite(n)}var Qe=function(n,t){this.lexer=n,this.ast=t,this.tok=n.tok,this.EOF=n.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=801,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;let e=function(i){return[i,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(e)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(e)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(e)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(e)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(e)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(e)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(e))}};Qe.prototype.getTokenName=function(n){return Sa(n)?n==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[n]:"'"+n+"'"};Qe.prototype.parse=function(n,t){this._errors=[],this.filename=t||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(n),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;let e=this.node("program"),i=[];for(this.next();this.token!=this.EOF;)i.push(this.read_start());i.length===0&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];let r=e(i,this._errors,this._docs,this._tokens);if(this.debug){let o=this.ast.checkNodes();if(o.length>0)throw o.forEach(function(h){h.position&&console.log("Node at line "+h.position.line+", column "+h.position.column),console.log(h.stack.join(`
`))}),new Error("Some nodes are not closed")}return r};Qe.prototype.raiseError=function(n,t,e,i){if(n+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){let o=new SyntaxError(n,this.filename,this.lexer.yylloc.first_line);throw o.lineNumber=this.lexer.yylloc.first_line,o.fileName=this.filename,o.columnNumber=this.lexer.yylloc.first_column,o}let r=this.ast.prepare("error",null,this)(n,i,this.lexer.yylloc.first_line,e);return this._errors.push(r),r};Qe.prototype.error=function(n){let t="Parse Error : syntax error",e=this.getTokenName(this.token),i="";if(this.token!==this.EOF){if(Sa(this.token)){let r=this.text();r.length>10&&(r=r.substring(0,7)+"..."),e="'"+r+"' ("+e+")"}t+=", unexpected "+e}return n&&!Array.isArray(n)&&((Sa(n)||n.length===1)&&(i=", expecting "+this.getTokenName(n)),t+=i),this.raiseError(t,i,n,e)};Qe.prototype.position=function(){return new BA(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)};Qe.prototype.node=function(n){if(this.extractDoc){let t=null;this._docIndex<this._docs.length&&(t=this._docs.slice(this._docIndex),this._docIndex=this._docs.length,this.debug&&(console.log(new Error("Append docs on "+n)),console.log(t)));let e=this.ast.prepare(n,t,this);return e.postBuild=function(i){if(this._docIndex<this._docs.length)if(this._lastNode){let r=this.prev[2],o=this._docIndex;for(;o<this._docs.length&&!(this._docs[o].offset>r);o++);o>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,o)),this._docIndex=o)}else this.token===this.EOF&&(i.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=i}.bind(this),e}return this.ast.prepare(n,null,this)};Qe.prototype.expectEndOfStatement=function(n){if(this.token===";")n&&this.lexer.yytext===";"&&n.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};var ba=["parser.next","parser.node","parser.showlog"];Qe.prototype.showlog=function(){let n=new Error().stack.split(`
`),t;for(let e=2;e<n.length;e++){t=n[e].trim();let i=!1;for(let r=0;r<ba.length;r++)if(t.substring(3,3+ba[r].length)===ba[r]){i=!0;break}if(!i)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @-->"+t),this};Qe.prototype.expect=function(n){if(Array.isArray(n)){if(n.indexOf(this.token)===-1)return this.error(n),!1}else if(this.token!=n)return this.error(n),!1;return!0};Qe.prototype.text=function(){return this.lexer.yytext};Qe.prototype.next=function(){if((this.token!==";"||this.lexer.yytext===";")&&(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this};Qe.prototype.peek=function(){let n=this.lexer.getState(),t=this.lexer.lex();return this.lexer.setState(n),t};Qe.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;let n=this.lexer.yytext;if(Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?n=[this.lexer.engine.tokens.values[this.token],n,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:n=[null,n,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(n),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this};Qe.prototype.is=function(n){return Array.isArray(n)?n.indexOf(this.token)!==-1:this.entries[n].has(this.token)};[Qf(),Zf(),ep(),np(),rp(),ap(),up(),cp(),pp(),mp(),_p(),kp(),vp(),Cp(),bp(),Dp()].forEach(function(n){for(let t in n){if(Object.prototype.hasOwnProperty.call(Qe.prototype,t))throw new Error("Function "+t+" is already defined - collision");Qe.prototype[t]=n[t]}});Np.exports=Qe});var Op=X((nw,wp)=>{"use strict";var Pp={T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233,T_COALESCE_EQUAL:234,T_FN:235,T_NULLSAFE_OBJECT_OPERATOR:236,T_MATCH:237,T_ATTRIBUTE:238,T_ENUM:239,T_READ_ONLY:240,T_NAME_RELATIVE:241,T_NAME_QUALIFIED:242,T_NAME_FULLY_QUALIFIED:243},MA={values:Object.entries(Pp).reduce((n,[t,e])=>({...n,[e]:t}),{}),names:Pp};wp.exports=Object.freeze(MA)});var Fp=X((sw,Lp)=>{"use strict";var UA=function(n,t,e){this.source=n,this.start=t,this.end=e};Lp.exports=UA});var Me=X((rw,Rp)=>{"use strict";var ur=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};ur.prototype.setTrailingComments=function(n){this.trailingComments=n};ur.prototype.destroy=function(n){if(!n)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(n.leadingComments?n.leadingComments=Array.concat(this.leadingComments,n.leadingComments):n.leadingComments=this.leadingComments),this.trailingComments&&(n.trailingComments?n.trailingComments=Array.concat(this.trailingComments,n.trailingComments):n.trailingComments=this.trailingComments),n};ur.prototype.includeToken=function(n){return this.loc&&(this.loc.end&&(this.loc.end.line=n.lexer.yylloc.last_line,this.loc.end.column=n.lexer.yylloc.last_column,this.loc.end.offset=n.lexer.offset),n.ast.withSource&&(this.loc.source=n.lexer._input.substring(this.loc.start.offset,n.lexer.offset))),this};ur.extends=function(n,t){return t.prototype=Object.create(this.prototype),t.extends=this.extends,t.prototype.constructor=t,t.kind=n,t};Rp.exports=ur});var oe=X((ow,Up)=>{"use strict";var Bp=Me(),Mp="expression";Up.exports=Bp.extends(Mp,function(t,e,i){Bp.apply(this,[t||Mp,e,i])})});var Gp=X((aw,Vp)=>{"use strict";var Wp=oe(),Hp="array";Vp.exports=Wp.extends(Hp,function(t,e,i,r){Wp.apply(this,[Hp,i,r]),this.items=e,this.shortForm=t})});var Yp=X((hw,Jp)=>{"use strict";var qp=oe(),zp="arrowfunc";Jp.exports=qp.extends(zp,function(t,e,i,r,o,h,f,p){qp.apply(this,[zp,f,p]),this.arguments=t,this.byref=e,this.body=i,this.type=r,this.nullable=o,this.isStatic=h||!1})});var Qp=X((uw,Kp)=>{"use strict";var Xp=oe(),jp="assign";Kp.exports=Xp.extends(jp,function(t,e,i,r,o){Xp.apply(this,[jp,r,o]),this.left=t,this.right=e,this.operator=i})});var ed=X((lw,td)=>{"use strict";var $p=oe(),Zp="assignref";td.exports=$p.extends(Zp,function(t,e,i,r){$p.apply(this,[Zp,i,r]),this.left=t,this.right=e})});var rd=X((cw,sd)=>{"use strict";var id=Me(),nd="attribute";sd.exports=id.extends(nd,function(t,e,i,r){id.apply(this,[nd,i,r]),this.name=t,this.args=e})});var ud=X((fw,hd)=>{"use strict";var od=Me(),ad="attrgroup";hd.exports=od.extends(ad,function(t,e,i){od.apply(this,[ad,e,i]),this.attrs=t||[]})});var es=X((pw,fd)=>{"use strict";var ld=oe(),cd="operation";fd.exports=ld.extends(cd,function(t,e,i){ld.apply(this,[t||cd,e,i])})});var gd=X((dw,md)=>{"use strict";var pd=es(),dd="bin";md.exports=pd.extends(dd,function(t,e,i,r,o){pd.apply(this,[dd,r,o]),this.type=t,this.left=e,this.right=i})});var ce=X((mw,Ed)=>{"use strict";var xd=Me(),_d="statement";Ed.exports=xd.extends(_d,function(t,e,i){xd.apply(this,[t||_d,e,i])})});var lr=X((gw,vd)=>{"use strict";var kd=ce(),yd="block";vd.exports=kd.extends(yd,function(t,e,i,r){kd.apply(this,[t||yd,i,r]),this.children=e.filter(Boolean)})});var Sn=X((xw,Ad)=>{"use strict";var Td=oe(),Cd="literal";Ad.exports=Td.extends(Cd,function(t,e,i,r,o){Td.apply(this,[t||Cd,r,o]),this.value=e,i&&(this.raw=i)})});var Nd=X((_w,Dd)=>{"use strict";var bd=Sn(),Sd="boolean";Dd.exports=bd.extends(Sd,function(t,e,i,r){bd.apply(this,[Sd,t,e,i,r])})});var Od=X((Ew,wd)=>{"use strict";var Id=ce(),Pd="break";wd.exports=Id.extends(Pd,function(t,e,i){Id.apply(this,[Pd,e,i]),this.level=t})});var Bd=X((kw,Rd)=>{"use strict";var Ld=oe(),Fd="byref";Rd.exports=Ld.extends(Fd,function(t,e,i){Ld.apply(this,[Fd,e,i]),this.what=t})});var Hd=X((yw,Wd)=>{"use strict";var Md=oe(),Ud="call";Wd.exports=Md.extends(Ud,function(t,e,i,r){Md.apply(this,[Ud,i,r]),this.what=t,this.arguments=e})});var zd=X((vw,qd)=>{"use strict";var Vd=ce(),Gd="case";qd.exports=Vd.extends(Gd,function(t,e,i,r){Vd.apply(this,[Gd,i,r]),this.test=t,this.body=e})});var jd=X((Tw,Xd)=>{"use strict";var Jd=es(),Yd="cast";Xd.exports=Jd.extends(Yd,function(t,e,i,r,o){Jd.apply(this,[Yd,r,o]),this.type=t,this.raw=e,this.expr=i})});var Zd=X((Cw,$d)=>{"use strict";var Kd=ce(),Qd="catch";$d.exports=Kd.extends(Qd,function(t,e,i,r,o){Kd.apply(this,[Qd,r,o]),this.body=t,this.what=e,this.variable=i})});var fn=X((Aw,nm)=>{"use strict";var tm=ce(),em="declaration",WA="",HA="public",VA="protected",GA="private",im=tm.extends(em,function(t,e,i,r){tm.apply(this,[t||em,i,r]),this.name=e});im.prototype.parseFlags=function(n){this.isAbstract=n[2]===1,this.isFinal=n[2]===2,this.isReadonly=n[3]===1,this.kind!=="class"&&(n[0]===-1?this.visibility=WA:n[0]===null?this.visibility=null:n[0]===0?this.visibility=HA:n[0]===1?this.visibility=VA:n[0]===2&&(this.visibility=GA),this.isStatic=n[1]===1)};nm.exports=im});var am=X((bw,om)=>{"use strict";var sm=fn(),rm="class";om.exports=sm.extends(rm,function(t,e,i,r,o,h,f){sm.apply(this,[rm,t,h,f]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=r,this.attrGroups=[],this.parseFlags(o)})});var Da=X((Sw,lm)=>{"use strict";var hm=ce(),um="constantstatement";lm.exports=hm.extends(um,function(t,e,i,r){hm.apply(this,[t||um,i,r]),this.constants=e})});var mm=X((Dw,dm)=>{"use strict";var cm=Da(),fm="classconstant",qA="",zA="public",JA="protected",YA="private",pm=cm.extends(fm,function(t,e,i,r,o,h){cm.apply(this,[t||fm,e,o,h]),this.parseFlags(i),this.attrGroups=r});pm.prototype.parseFlags=function(n){n[0]===-1?this.visibility=qA:n[0]===null?this.visibility=null:n[0]===0?this.visibility=zA:n[0]===1?this.visibility=JA:n[0]===2&&(this.visibility=YA)};dm.exports=pm});var Em=X((Nw,_m)=>{"use strict";var gm=oe(),xm="clone";_m.exports=gm.extends(xm,function(t,e,i){gm.apply(this,[xm,e,i]),this.what=t})});var Tm=X((Iw,vm)=>{"use strict";var km=oe(),ym="closure";vm.exports=km.extends(ym,function(t,e,i,r,o,h,f,p){km.apply(this,[ym,f,p]),this.uses=i,this.arguments=t,this.byref=e,this.type=r,this.nullable=o,this.isStatic=h||!1,this.body=null,this.attrGroups=[]})});var To=X((Pw,Am)=>{"use strict";var Cm=Me();Am.exports=Cm.extends("comment",function(t,e,i,r){Cm.apply(this,[t,i,r]),this.value=e})});var Nm=X((ww,Dm)=>{"use strict";var bm=To(),Sm="commentblock";Dm.exports=bm.extends(Sm,function(t,e,i){bm.apply(this,[Sm,t,e,i])})});var Om=X((Ow,wm)=>{"use strict";var Im=To(),Pm="commentline";wm.exports=Im.extends(Pm,function(t,e,i){Im.apply(this,[Pm,t,e,i])})});var Bm=X((Lw,Rm)=>{"use strict";var Lm=Me(),Fm="constant";Rm.exports=Lm.extends(Fm,function(t,e,i,r){Lm.apply(this,[Fm,i,r]),this.name=t,this.value=e})});var Hm=X((Fw,Wm)=>{"use strict";var Mm=ce(),Um="continue";Wm.exports=Mm.extends(Um,function(t,e,i){Mm.apply(this,[Um,e,i]),this.level=t})});var zm=X((Rw,qm)=>{"use strict";var Vm=lr(),Gm="declare",Co=Vm.extends(Gm,function(t,e,i,r,o){Vm.apply(this,[Gm,e,r,o]),this.directives=t,this.mode=i});Co.MODE_SHORT="short";Co.MODE_BLOCK="block";Co.MODE_NONE="none";qm.exports=Co});var jm=X((Bw,Xm)=>{"use strict";var Jm=Me(),Ym="declaredirective";Xm.exports=Jm.extends(Ym,function(t,e,i,r){Jm.apply(this,[Ym,i,r]),this.key=t,this.value=e})});var Zm=X((Mw,$m)=>{"use strict";var Km=ce(),Qm="do";$m.exports=Km.extends(Qm,function(t,e,i,r){Km.apply(this,[Qm,i,r]),this.test=t,this.body=e})});var ng=X((Uw,ig)=>{"use strict";var tg=ce(),eg="echo";ig.exports=tg.extends(eg,function(t,e,i,r){tg.apply(this,[eg,i,r]),this.shortForm=e,this.expressions=t})});var ag=X((Ww,og)=>{"use strict";var sg=oe(),rg="empty";og.exports=sg.extends(rg,function(t,e,i){sg.apply(this,[rg,e,i]),this.expression=t})});var cg=X((Hw,lg)=>{"use strict";var hg=Sn(),ug="encapsed",cr=hg.extends(ug,function(t,e,i,r,o){hg.apply(this,[ug,t,e,r,o]),this.type=i});cr.TYPE_STRING="string";cr.TYPE_SHELL="shell";cr.TYPE_HEREDOC="heredoc";cr.TYPE_OFFSET="offset";lg.exports=cr});var mg=X((Vw,dg)=>{"use strict";var fg=oe(),pg="encapsedpart";dg.exports=fg.extends(pg,function(t,e,i,r,o){fg.apply(this,[pg,r,o]),this.expression=t,this.syntax=e,this.curly=i})});var Eg=X((Gw,_g)=>{"use strict";var gg=oe(),xg="entry";_g.exports=gg.extends(xg,function(t,e,i,r,o,h){gg.apply(this,[xg,o,h]),this.key=t,this.value=e,this.byRef=i,this.unpack=r})});var Tg=X((qw,vg)=>{"use strict";var kg=fn(),yg="enum";vg.exports=kg.extends(yg,function(t,e,i,r,o,h){kg.apply(this,[yg,t,o,h]),this.valueType=e,this.implements=i,this.body=r,this.attrGroups=[]})});var Sg=X((zw,bg)=>{"use strict";var Cg=Me(),Ag="enumcase";bg.exports=Cg.extends(Ag,function(t,e,i,r){Cg.apply(this,[Ag,i,r]),this.name=t,this.value=e})});var Pg=X((Jw,Ig)=>{"use strict";var Dg=Me(),Ng="error";Ig.exports=Dg.extends(Ng,function(t,e,i,r,o,h){Dg.apply(this,[Ng,o,h]),this.message=t,this.token=e,this.line=i,this.expected=r})});var Fg=X((Yw,Lg)=>{"use strict";var wg=oe(),Og="eval";Lg.exports=wg.extends(Og,function(t,e,i){wg.apply(this,[Og,e,i]),this.source=t})});var Ug=X((Xw,Mg)=>{"use strict";var Rg=oe(),Bg="exit";Mg.exports=Rg.extends(Bg,function(t,e,i,r){Rg.apply(this,[Bg,i,r]),this.expression=t,this.useDie=e})});var Gg=X((jw,Vg)=>{"use strict";var Wg=ce(),Hg="expressionstatement";Vg.exports=Wg.extends(Hg,function(t,e,i){Wg.apply(this,[Hg,e,i]),this.expression=t})});var Yg=X((Kw,Jg)=>{"use strict";var qg=ce(),zg="for";Jg.exports=qg.extends(zg,function(t,e,i,r,o,h,f){qg.apply(this,[zg,h,f]),this.init=t,this.test=e,this.increment=i,this.shortForm=o,this.body=r})});var Qg=X((Qw,Kg)=>{"use strict";var Xg=ce(),jg="foreach";Kg.exports=Xg.extends(jg,function(t,e,i,r,o,h,f){Xg.apply(this,[jg,h,f]),this.source=t,this.key=e,this.value=i,this.shortForm=o,this.body=r})});var Na=X(($w,tx)=>{"use strict";var $g=fn(),Zg="function";tx.exports=$g.extends(Zg,function(t,e,i,r,o,h,f){$g.apply(this,[Zg,t,h,f]),this.arguments=e,this.byref=i,this.type=r,this.nullable=o,this.body=null,this.attrGroups=[]})});var sx=X((Zw,nx)=>{"use strict";var ex=ce(),ix="global";nx.exports=ex.extends(ix,function(t,e,i){ex.apply(this,[ix,e,i]),this.items=t})});var hx=X((tO,ax)=>{"use strict";var rx=ce(),ox="goto";ax.exports=rx.extends(ox,function(t,e,i){rx.apply(this,[ox,e,i]),this.label=t})});var fx=X((eO,cx)=>{"use strict";var ux=ce(),lx="halt";cx.exports=ux.extends(lx,function(t,e,i){ux.apply(this,[lx,e,i]),this.after=t})});var gx=X((iO,mx)=>{"use strict";var px=Me(),dx="identifier",XA=px.extends(dx,function(t,e,i){px.apply(this,[dx,e,i]),this.name=t});mx.exports=XA});var kx=X((nO,Ex)=>{"use strict";var xx=ce(),_x="if";Ex.exports=xx.extends(_x,function(t,e,i,r,o,h){xx.apply(this,[_x,o,h]),this.test=t,this.body=e,this.alternate=i,this.shortForm=r})});var Cx=X((sO,Tx)=>{"use strict";var yx=oe(),vx="include";Tx.exports=yx.extends(vx,function(t,e,i,r,o){yx.apply(this,[vx,r,o]),this.once=t,this.require=e,this.target=i})});var Dx=X((rO,Sx)=>{"use strict";var Ax=Sn(),bx="inline";Sx.exports=Ax.extends(bx,function(t,e,i,r){Ax.apply(this,[bx,t,e,i,r])})});var wx=X((oO,Px)=>{"use strict";var Nx=fn(),Ix="interface";Px.exports=Nx.extends(Ix,function(t,e,i,r,o,h){Nx.apply(this,[Ix,t,o,h]),this.extends=e,this.body=i,this.attrGroups=r})});var Rx=X((aO,Fx)=>{"use strict";var Ox=fn(),Lx="intersectiontype";Fx.exports=Ox.extends(Lx,function(t,e,i){Ox.apply(this,[Lx,null,e,i]),this.types=t})});var Wx=X((hO,Ux)=>{"use strict";var Bx=oe(),Mx="isset";Ux.exports=Bx.extends(Mx,function(t,e,i){Bx.apply(this,[Mx,e,i]),this.variables=t})});var qx=X((uO,Gx)=>{"use strict";var Hx=ce(),Vx="label";Gx.exports=Hx.extends(Vx,function(t,e,i){Hx.apply(this,[Vx,e,i]),this.name=t})});var Xx=X((lO,Yx)=>{"use strict";var zx=oe(),Jx="list";Yx.exports=zx.extends(Jx,function(t,e,i,r){zx.apply(this,[Jx,i,r]),this.items=t,this.shortForm=e})});var Ss=X((cO,Qx)=>{"use strict";var jx=oe(),Kx="lookup";Qx.exports=jx.extends(Kx,function(t,e,i,r,o){jx.apply(this,[t||Kx,r,o]),this.what=e,this.offset=i})});var e_=X((fO,t_)=>{"use strict";var $x=Sn(),Zx="magic";t_.exports=$x.extends(Zx,function(t,e,i,r){$x.apply(this,[Zx,t,e,i,r])})});var r_=X((pO,s_)=>{"use strict";var i_=oe(),n_="match";s_.exports=i_.extends(n_,function(t,e,i,r){i_.apply(this,[n_,i,r]),this.cond=t,this.arms=e})});var u_=X((dO,h_)=>{"use strict";var o_=oe(),a_="matcharm";h_.exports=o_.extends(a_,function(t,e,i,r){o_.apply(this,[a_,i,r]),this.conds=t,this.body=e})});var p_=X((mO,f_)=>{"use strict";var l_=Na(),c_="method";f_.exports=l_.extends(c_,function(){l_.apply(this,arguments),this.kind=c_})});var is=X((gO,g_)=>{"use strict";var d_=Me(),m_="reference",jA=d_.extends(m_,function(t,e,i){d_.apply(this,[t||m_,e,i])});g_.exports=jA});var k_=X((xO,E_)=>{"use strict";var x_=is(),__="name",fr=x_.extends(__,function(t,e,i,r){x_.apply(this,[__,i,r]),this.name=t.replace(/\\$/,""),this.resolution=e});fr.UNQUALIFIED_NAME="uqn";fr.QUALIFIED_NAME="qn";fr.FULL_QUALIFIED_NAME="fqn";fr.RELATIVE_NAME="rn";E_.exports=fr});var C_=X((_O,T_)=>{"use strict";var y_=lr(),v_="namespace";T_.exports=y_.extends(v_,function(t,e,i,r,o){y_.apply(this,[v_,e,r,o]),this.name=t,this.withBrackets=i||!1})});var D_=X((EO,S_)=>{"use strict";var A_=oe(),b_="namedargument";S_.exports=A_.extends(b_,function(t,e,i,r){A_.apply(this,[b_,i,r]),this.name=t,this.value=e})});var w_=X((kO,P_)=>{"use strict";var N_=oe(),I_="new";P_.exports=N_.extends(I_,function(t,e,i,r){N_.apply(this,[I_,i,r]),this.what=t,this.arguments=e})});var R_=X((yO,F_)=>{"use strict";var O_=Me(),L_="noop";F_.exports=O_.extends(L_,function(t,e){O_.apply(this,[L_,t,e])})});var W_=X((vO,U_)=>{"use strict";var B_=Sn(),M_="nowdoc";U_.exports=B_.extends(M_,function(t,e,i,r,o){B_.apply(this,[M_,t,e,r,o]),this.label=i})});var q_=X((TO,G_)=>{"use strict";var H_=Me(),V_="nullkeyword";G_.exports=H_.extends(V_,function(t,e,i){H_.apply(this,[V_,e,i]),this.raw=t})});var X_=X((CO,Y_)=>{"use strict";var z_=Ss(),J_="nullsafepropertylookup";Y_.exports=z_.extends(J_,function(t,e,i,r){z_.apply(this,[J_,t,e,i,r])})});var $_=X((AO,Q_)=>{"use strict";var j_=Sn(),K_="number";Q_.exports=j_.extends(K_,function(t,e,i,r){j_.apply(this,[K_,t,e,i,r])})});var iE=X((bO,eE)=>{"use strict";var Z_=Ss(),tE="offsetlookup";eE.exports=Z_.extends(tE,function(t,e,i,r){Z_.apply(this,[tE,t,e,i,r])})});var oE=X((SO,rE)=>{"use strict";var nE=fn(),sE="parameter";rE.exports=nE.extends(sE,function(t,e,i,r,o,h,f,p,E,d){nE.apply(this,[sE,t,E,d]),this.value=i,this.type=e,this.byref=r,this.variadic=o,this.readonly=h,this.nullable=f,this.flags=p||0,this.attrGroups=[]})});var lE=X((DO,uE)=>{"use strict";var aE=is(),hE="parentreference",KA=aE.extends(hE,function(t,e,i){aE.apply(this,[hE,e,i]),this.raw=t});uE.exports=KA});var dE=X((NO,pE)=>{"use strict";var cE=es(),fE="post";pE.exports=cE.extends(fE,function(t,e,i,r){cE.apply(this,[fE,i,r]),this.type=t,this.what=e})});var _E=X((IO,xE)=>{"use strict";var mE=es(),gE="pre";xE.exports=mE.extends(gE,function(t,e,i,r){mE.apply(this,[gE,i,r]),this.type=t,this.what=e})});var vE=X((PO,yE)=>{"use strict";var EE=oe(),kE="print";yE.exports=EE.extends(kE,function(t,e,i){EE.apply(this,[kE,e,i]),this.expression=t})});var bE=X((wO,AE)=>{"use strict";var TE=lr(),CE="program";AE.exports=TE.extends(CE,function(t,e,i,r,o,h){TE.apply(this,[CE,t,o,h]),this.errors=e,i&&(this.comments=i),r&&(this.tokens=r)})});var IE=X((OO,NE)=>{"use strict";var SE=ce(),DE="property";NE.exports=SE.extends(DE,function(t,e,i,r,o,h,f,p){SE.apply(this,[DE,f,p]),this.name=t,this.value=e,this.readonly=i,this.nullable=r,this.type=o,this.attrGroups=h})});var LE=X((LO,OE)=>{"use strict";var PE=Ss(),wE="propertylookup";OE.exports=PE.extends(wE,function(t,e,i,r){PE.apply(this,[wE,t,e,i,r])})});var UE=X((FO,ME)=>{"use strict";var FE=ce(),RE="propertystatement",QA="",$A="public",ZA="protected",tb="private",BE=FE.extends(RE,function(t,e,i,r,o){FE.apply(this,[RE,r,o]),this.properties=e,this.parseFlags(i)});BE.prototype.parseFlags=function(n){n[0]===-1?this.visibility=QA:n[0]===null?this.visibility=null:n[0]===0?this.visibility=$A:n[0]===1?this.visibility=ZA:n[0]===2&&(this.visibility=tb),this.isStatic=n[1]===1};ME.exports=BE});var GE=X((RO,VE)=>{"use strict";var WE=oe(),HE="retif";VE.exports=WE.extends(HE,function(t,e,i,r,o){WE.apply(this,[HE,r,o]),this.test=t,this.trueExpr=e,this.falseExpr=i})});var YE=X((BO,JE)=>{"use strict";var qE=ce(),zE="return";JE.exports=qE.extends(zE,function(t,e,i){qE.apply(this,[zE,e,i]),this.expr=t})});var QE=X((MO,KE)=>{"use strict";var XE=is(),jE="selfreference",eb=XE.extends(jE,function(t,e,i){XE.apply(this,[jE,e,i]),this.raw=t});KE.exports=eb});var ek=X((UO,tk)=>{"use strict";var $E=oe(),ZE="silent";tk.exports=$E.extends(ZE,function(t,e,i){$E.apply(this,[ZE,e,i]),this.expr=t})});var rk=X((WO,sk)=>{"use strict";var ik=ce(),nk="static";sk.exports=ik.extends(nk,function(t,e,i){ik.apply(this,[nk,e,i]),this.variables=t})});var uk=X((HO,hk)=>{"use strict";var ok=Me(),ak="staticvariable";hk.exports=ok.extends(ak,function(t,e,i,r){ok.apply(this,[ak,i,r]),this.variable=t,this.defaultValue=e})});var pk=X((VO,fk)=>{"use strict";var lk=Ss(),ck="staticlookup";fk.exports=lk.extends(ck,function(t,e,i,r){lk.apply(this,[ck,t,e,i,r])})});var xk=X((GO,gk)=>{"use strict";var dk=is(),mk="staticreference",ib=dk.extends(mk,function(t,e,i){dk.apply(this,[mk,e,i]),this.raw=t});gk.exports=ib});var yk=X((qO,kk)=>{"use strict";var _k=Sn(),Ek="string";kk.exports=_k.extends(Ek,function(t,e,i,r,o,h){_k.apply(this,[Ek,e,r,o,h]),this.unicode=i,this.isDoubleQuote=t})});var Ak=X((zO,Ck)=>{"use strict";var vk=ce(),Tk="switch";Ck.exports=vk.extends(Tk,function(t,e,i,r,o){vk.apply(this,[Tk,r,o]),this.test=t,this.body=e,this.shortForm=i})});var Nk=X((JO,Dk)=>{"use strict";var bk=ce(),Sk="throw";Dk.exports=bk.extends(Sk,function(t,e,i){bk.apply(this,[Sk,e,i]),this.what=t})});var Ok=X((YO,wk)=>{"use strict";var Ik=fn(),Pk="trait";wk.exports=Ik.extends(Pk,function(t,e,i,r){Ik.apply(this,[Pk,t,i,r]),this.body=e})});var Bk=X((XO,Rk)=>{"use strict";var Lk=Me(),Fk="traitalias",nb="",sb="public",rb="protected",ob="private";Rk.exports=Lk.extends(Fk,function(t,e,i,r,o,h){Lk.apply(this,[Fk,o,h]),this.trait=t,this.method=e,this.as=i,this.visibility=nb,r&&(r[0]===0?this.visibility=sb:r[0]===1?this.visibility=rb:r[0]===2&&(this.visibility=ob))})});var Hk=X((jO,Wk)=>{"use strict";var Mk=Me(),Uk="traitprecedence";Wk.exports=Mk.extends(Uk,function(t,e,i,r,o){Mk.apply(this,[Uk,r,o]),this.trait=t,this.method=e,this.instead=i})});var zk=X((KO,qk)=>{"use strict";var Vk=Me(),Gk="traituse";qk.exports=Vk.extends(Gk,function(t,e,i,r){Vk.apply(this,[Gk,i,r]),this.traits=t,this.adaptations=e})});var jk=X((QO,Xk)=>{"use strict";var Jk=ce(),Yk="try";Xk.exports=Jk.extends(Yk,function(t,e,i,r,o){Jk.apply(this,[Yk,r,o]),this.body=t,this.catches=e,this.always=i})});var ty=X(($O,Zk)=>{"use strict";var Kk=is(),Qk="typereference",$k=Kk.extends(Qk,function(t,e,i,r){Kk.apply(this,[Qk,i,r]),this.name=t,this.raw=e});$k.types=["int","float","string","bool","object","array","callable","iterable","void","static"];Zk.exports=$k});var sy=X((ZO,ny)=>{"use strict";var ey=es(),iy="unary";ny.exports=ey.extends(iy,function(t,e,i,r){ey.apply(this,[iy,i,r]),this.type=t,this.what=e})});var hy=X((tL,ay)=>{"use strict";var ry=fn(),oy="uniontype";ay.exports=ry.extends(oy,function(t,e,i){ry.apply(this,[oy,null,e,i]),this.types=t})});var fy=X((eL,cy)=>{"use strict";var uy=ce(),ly="unset";cy.exports=uy.extends(ly,function(t,e,i){uy.apply(this,[ly,e,i]),this.variables=t})});var gy=X((iL,my)=>{"use strict";var py=ce(),dy="usegroup";my.exports=py.extends(dy,function(t,e,i,r,o){py.apply(this,[dy,r,o]),this.name=t,this.type=e,this.items=i})});var ky=X((nL,Ey)=>{"use strict";var xy=ce(),_y="useitem",Ia=xy.extends(_y,function(t,e,i,r,o){xy.apply(this,[_y,r,o]),this.name=t,this.alias=e,this.type=i});Ia.TYPE_CONST="const";Ia.TYPE_FUNCTION="function";Ey.exports=Ia});var Cy=X((sL,Ty)=>{"use strict";var yy=oe(),vy="variable";Ty.exports=yy.extends(vy,function(t,e,i,r){yy.apply(this,[vy,i,r]),this.name=t,this.curly=e||!1})});var Dy=X((rL,Sy)=>{"use strict";var Ay=oe(),by="variadic";Sy.exports=Ay.extends(by,function(t,e,i){Ay.apply(this,[by,e,i]),this.what=t})});var wy=X((oL,Py)=>{"use strict";var Ny=Me(),Iy="variadicplaceholder";Py.exports=Ny.extends(Iy,function(t,e){Ny.apply(this,[Iy,t,e])})});var Ry=X((aL,Fy)=>{"use strict";var Oy=ce(),Ly="while";Fy.exports=Oy.extends(Ly,function(t,e,i,r,o){Oy.apply(this,[Ly,r,o]),this.test=t,this.body=e,this.shortForm=i})});var Wy=X((hL,Uy)=>{"use strict";var By=oe(),My="yield";Uy.exports=By.extends(My,function(t,e,i,r){By.apply(this,[My,i,r]),this.value=t,this.key=e})});var qy=X((uL,Gy)=>{"use strict";var Hy=oe(),Vy="yieldfrom";Gy.exports=Hy.extends(Vy,function(t,e,i){Hy.apply(this,[Vy,e,i]),this.value=t})});var Jy=X((lL,zy)=>{"use strict";var ab=Fp(),hb=Aa(),hi=function(n,t){this.withPositions=n,this.withSource=t};hi.precedence={};[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach(function(n,t){n.forEach(function(e){hi.precedence[e]=t+1})});hi.prototype.isRightAssociative=function(n){return n==="**"||n==="??"};hi.prototype.swapLocations=function(n,t,e,i){this.withPositions&&(n.loc.start=t.loc.start,n.loc.end=e.loc.end,this.withSource&&(n.loc.source=i.lexer._input.substring(n.loc.start.offset,n.loc.end.offset)))};hi.prototype.resolveLocations=function(n,t,e,i){this.withPositions&&(n.loc.start.offset>t.loc.start.offset&&(n.loc.start=t.loc.start),n.loc.end.offset<e.loc.end.offset&&(n.loc.end=e.loc.end),this.withSource&&(n.loc.source=i.lexer._input.substring(n.loc.start.offset,n.loc.end.offset)))};hi.prototype.resolvePrecedence=function(n,t){let e,i,r;return n.kind==="call"?this.resolveLocations(n,n.what,n,t):n.kind==="propertylookup"||n.kind==="staticlookup"||n.kind==="offsetlookup"&&n.offset?this.resolveLocations(n,n.what,n.offset,t):n.kind==="bin"?n.right&&!n.right.parenthesizedExpression&&(n.right.kind==="bin"?(i=hi.precedence[n.type],r=hi.precedence[n.right.type],i&&r&&r<=i&&(n.type!==n.right.type||!this.isRightAssociative(n.type))&&(e=n.right,n.right=n.right.left,this.swapLocations(n,n.left,n.right,t),e.left=this.resolvePrecedence(n,t),this.swapLocations(e,e.left,e.right,t),n=e)):n.right.kind==="retif"&&(i=hi.precedence[n.type],r=hi.precedence["?"],i&&r&&r<=i&&(e=n.right,n.right=n.right.test,this.swapLocations(n,n.left,n.right,t),e.test=this.resolvePrecedence(n,t),this.swapLocations(e,e.test,e.falseExpr,t),n=e))):(n.kind==="silent"||n.kind==="cast")&&n.expr&&!n.expr.parenthesizedExpression?n.expr.kind==="bin"?(e=n.expr,n.expr=n.expr.left,this.swapLocations(n,n,n.expr,t),e.left=this.resolvePrecedence(n,t),this.swapLocations(e,e.left,e.right,t),n=e):n.expr.kind==="retif"&&(e=n.expr,n.expr=n.expr.test,this.swapLocations(n,n,n.expr,t),e.test=this.resolvePrecedence(n,t),this.swapLocations(e,e.test,e.falseExpr,t),n=e):n.kind==="unary"?n.what&&!n.what.parenthesizedExpression&&(n.what.kind==="bin"?(e=n.what,n.what=n.what.left,this.swapLocations(n,n,n.what,t),e.left=this.resolvePrecedence(n,t),this.swapLocations(e,e.left,e.right,t),n=e):n.what.kind==="retif"&&(e=n.what,n.what=n.what.test,this.swapLocations(n,n,n.what,t),e.test=this.resolvePrecedence(n,t),this.swapLocations(e,e.test,e.falseExpr,t),n=e)):n.kind==="retif"?n.falseExpr&&n.falseExpr.kind==="retif"&&!n.falseExpr.parenthesizedExpression&&(e=n.falseExpr,n.falseExpr=e.test,this.swapLocations(n,n.test,n.falseExpr,t),e.test=this.resolvePrecedence(n,t),this.swapLocations(e,e.test,e.falseExpr,t),n=e):n.kind==="assign"?n.right&&n.right.kind==="bin"&&!n.right.parenthesizedExpression&&(i=hi.precedence["="],r=hi.precedence[n.right.type],i&&r&&r<i&&(e=n.right,n.right=n.right.left,e.left=n,this.swapLocations(e,e.left,n.right,t),n=e)):n.kind==="expressionstatement"&&this.swapLocations(n,n.expression,n,t),n};hi.prototype.prepare=function(n,t,e){let i=null;(this.withPositions||this.withSource)&&(i=e.position());let r=this,o=function(){let h=null,f=Array.prototype.slice.call(arguments);if(f.push(t),r.withPositions||r.withSource){let d=null;r.withSource&&(d=e.lexer._input.substring(i.offset,e.prev[2])),h=new ab(d,i,new hb(e.prev[0],e.prev[1],e.prev[2])),f.push(h)}n||(n=f.shift());let p=r[n];if(typeof p!="function")throw new Error('Undefined node "'+n+'"');let E=Object.create(p.prototype);return p.apply(E,f),o.instance=E,o.trailingComments&&(E.trailingComments=o.trailingComments),typeof o.postBuild=="function"&&o.postBuild(E),e.debug&&delete r.stack[o.stackUid],r.resolvePrecedence(E,e)};return e.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:i,stack:new Error().stack.split(`
`).slice(3,5)},o.stackUid=this.stackUid),o.setTrailingComments=function(h){o.instance?o.instance.setTrailingComments(h):o.trailingComments=h},o.destroy=function(h){t&&(h?h.leadingComments?h.leadingComments=t.concat(h.leadingComments):h.leadingComments=t:e._docIndex=e._docs.length-t.length),e.debug&&delete r.stack[o.stackUid]},o};hi.prototype.checkNodes=function(){let n=[];for(let t in this.stack)Object.prototype.hasOwnProperty.call(this.stack,t)&&(this.stack[t].key=t,n.push(this.stack[t]));return this.stack={},n};[Gp(),Yp(),Qp(),ed(),rd(),ud(),gd(),lr(),Nd(),Od(),Bd(),Hd(),zd(),jd(),Zd(),am(),mm(),Em(),Tm(),To(),Nm(),Om(),Bm(),Da(),Hm(),fn(),zm(),jm(),Zm(),ng(),ag(),cg(),mg(),Eg(),Tg(),Sg(),Pg(),Fg(),Ug(),oe(),Gg(),Yg(),Qg(),Na(),sx(),hx(),fx(),gx(),kx(),Cx(),Dx(),wx(),Rx(),Wx(),qx(),Xx(),Sn(),Ss(),e_(),r_(),u_(),p_(),k_(),C_(),D_(),w_(),Me(),R_(),W_(),q_(),X_(),$_(),iE(),es(),oE(),lE(),dE(),_E(),vE(),bE(),IE(),LE(),UE(),is(),GE(),YE(),QE(),ek(),ce(),rk(),uk(),pk(),xk(),yk(),Ak(),Nk(),Ok(),Bk(),Hk(),zk(),jk(),ty(),sy(),hy(),fy(),gy(),ky(),Cy(),Dy(),wy(),Ry(),Wy(),qy()].forEach(function(n){hi.prototype[n.kind]=n});zy.exports=hi});var Oa=X((cL,Dn)=>{"use strict";var Yy=Xf(),Xy=Ip(),jy=Op(),Ky=Jy();function Pa(n,t){let e=Object.keys(n),i=e.length;for(;i--;){let r=e[i],o=n[r];o===null?delete t[r]:typeof o=="function"?t[r]=o.bind(t):Array.isArray(o)?t[r]=Array.isArray(t[r])?t[r].concat(o):o:typeof o=="object"?t[r]=typeof t[r]=="object"?Pa(o,t[r]):o:t[r]=o}return t}var Si=function(n){if(typeof this=="function")return new this(n);if(this.tokens=jy,this.lexer=new Yy(this),this.ast=new Ky,this.parser=new Xy(this.lexer,this.ast),n&&typeof n=="object"){if(n.parser&&(n.lexer||(n.lexer={}),n.parser.version)){if(typeof n.parser.version=="string"){let t=n.parser.version.split(".");if(t=parseInt(t[0])*100+parseInt(t[1]),isNaN(t))throw new Error("Bad version number : "+n.parser.version);n.parser.version=t}else if(typeof n.parser.version!="number")throw new Error("Expecting a number for version");if(n.parser.version<500||n.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}Pa(n,this),this.lexer.version=this.parser.version}},wa=function(n){return typeof n.write=="function"?n.toString():n};Si.create=function(n){return new Si(n)};Si.parseEval=function(n,t){return new Si(t).parseEval(n)};Si.prototype.parseEval=function(n){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,n=wa(n),this.parser.parse(n,"eval")};Si.parseCode=function(n,t,e){return typeof t=="object"&&!e&&(e=t,t="unknown"),new Si(e).parseCode(n,t)};Si.prototype.parseCode=function(n,t){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,n=wa(n),this.parser.parse(n,t)};Si.tokenGetAll=function(n,t){return new Si(t).tokenGetAll(n)};Si.prototype.tokenGetAll=function(n){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,n=wa(n);let t=this.lexer.EOF,e=this.tokens.values;this.lexer.setInput(n);let i=this.lexer.lex()||t,r=[];for(;i!=t;){let o=this.lexer.yytext;Object.prototype.hasOwnProperty.call(e,i)&&(o=[e[i],o,this.lexer.yylloc.first_line]),r.push(o),i=this.lexer.lex()||t}return r};Dn.exports=Si;Dn.exports.tokens=jy;Dn.exports.lexer=Yy;Dn.exports.AST=Ky;Dn.exports.parser=Xy;Dn.exports.combine=Pa;Dn.exports.Engine=Si;Dn.exports.default=Si});var $y=X((pr,La)=>{(function(t,e){typeof pr=="object"&&typeof La=="object"?La.exports=e():typeof define=="function"&&define.amd?define([],e):typeof pr=="object"?pr.esprima=e():t.esprima=e()})(pr,function(){return function(n){var t={};function e(i){if(t[i])return t[i].exports;var r=t[i]={exports:{},id:i,loaded:!1};return n[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}return e.m=n,e.c=t,e.p="",e(0)}([function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(1),r=e(3),o=e(8),h=e(15);function f(_,u,c){var g=null,y=function(ot,st){c&&c(ot,st),g&&g.visit(ot,st)},T=typeof c=="function"?y:null,w=!1;if(u){w=typeof u.comment=="boolean"&&u.comment;var R=typeof u.attachComment=="boolean"&&u.attachComment;(w||R)&&(g=new i.CommentHandler,g.attach=R,u.comment=!0,T=y)}var M=!1;u&&typeof u.sourceType=="string"&&(M=u.sourceType==="module");var J;u&&typeof u.jsx=="boolean"&&u.jsx?J=new r.JSXParser(_,u,T):J=new o.Parser(_,u,T);var W=M?J.parseModule():J.parseScript(),j=W;return w&&g&&(j.comments=g.comments),J.config.tokens&&(j.tokens=J.tokens),J.config.tolerant&&(j.errors=J.errorHandler.errors),j}t.parse=f;function p(_,u,c){var g=u||{};return g.sourceType="module",f(_,g,c)}t.parseModule=p;function E(_,u,c){var g=u||{};return g.sourceType="script",f(_,g,c)}t.parseScript=E;function d(_,u,c){var g=new h.Tokenizer(_,u),y;y=[];try{for(;;){var T=g.getNextToken();if(!T)break;c&&(T=c(T)),y.push(T)}}catch(w){g.errorHandler.tolerate(w)}return g.errorHandler.tolerant&&(y.errors=g.errors()),y}t.tokenize=d;var x=e(2);t.Syntax=x.Syntax,t.version="4.0.1"},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(2),r=function(){function o(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return o.prototype.insertInnerComments=function(h,f){if(h.type===i.Syntax.BlockStatement&&h.body.length===0){for(var p=[],E=this.leading.length-1;E>=0;--E){var d=this.leading[E];f.end.offset>=d.start&&(p.unshift(d.comment),this.leading.splice(E,1),this.trailing.splice(E,1))}p.length&&(h.innerComments=p)}},o.prototype.findTrailingComments=function(h){var f=[];if(this.trailing.length>0){for(var p=this.trailing.length-1;p>=0;--p){var E=this.trailing[p];E.start>=h.end.offset&&f.unshift(E.comment)}return this.trailing.length=0,f}var d=this.stack[this.stack.length-1];if(d&&d.node.trailingComments){var x=d.node.trailingComments[0];x&&x.range[0]>=h.end.offset&&(f=d.node.trailingComments,delete d.node.trailingComments)}return f},o.prototype.findLeadingComments=function(h){for(var f=[],p;this.stack.length>0;){var E=this.stack[this.stack.length-1];if(E&&E.start>=h.start.offset)p=E.node,this.stack.pop();else break}if(p){for(var d=p.leadingComments?p.leadingComments.length:0,x=d-1;x>=0;--x){var _=p.leadingComments[x];_.range[1]<=h.start.offset&&(f.unshift(_),p.leadingComments.splice(x,1))}return p.leadingComments&&p.leadingComments.length===0&&delete p.leadingComments,f}for(var x=this.leading.length-1;x>=0;--x){var E=this.leading[x];E.start<=h.start.offset&&(f.unshift(E.comment),this.leading.splice(x,1))}return f},o.prototype.visitNode=function(h,f){if(!(h.type===i.Syntax.Program&&h.body.length>0)){this.insertInnerComments(h,f);var p=this.findTrailingComments(f),E=this.findLeadingComments(f);E.length>0&&(h.leadingComments=E),p.length>0&&(h.trailingComments=p),this.stack.push({node:h,start:f.start.offset})}},o.prototype.visitComment=function(h,f){var p=h.type[0]==="L"?"Line":"Block",E={type:p,value:h.value};if(h.range&&(E.range=h.range),h.loc&&(E.loc=h.loc),this.comments.push(E),this.attach){var d={comment:{type:p,value:h.value,range:[f.start.offset,f.end.offset]},start:f.start.offset};h.loc&&(d.comment.loc=h.loc),h.type=p,this.leading.push(d),this.trailing.push(d)}},o.prototype.visit=function(h,f){h.type==="LineComment"?this.visitComment(h,f):h.type==="BlockComment"?this.visitComment(h,f):this.attach&&this.visitNode(h,f)},o}();t.CommentHandler=r},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(n,t,e){"use strict";var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,g){c.__proto__=g}||function(c,g){for(var y in g)g.hasOwnProperty(y)&&(c[y]=g[y])};return function(c,g){u(c,g);function y(){this.constructor=c}c.prototype=g===null?Object.create(g):(y.prototype=g.prototype,new y)}}();Object.defineProperty(t,"__esModule",{value:!0});var r=e(4),o=e(5),h=e(6),f=e(7),p=e(8),E=e(13),d=e(14);E.TokenName[100]="JSXIdentifier",E.TokenName[101]="JSXText";function x(u){var c;switch(u.type){case h.JSXSyntax.JSXIdentifier:var g=u;c=g.name;break;case h.JSXSyntax.JSXNamespacedName:var y=u;c=x(y.namespace)+":"+x(y.name);break;case h.JSXSyntax.JSXMemberExpression:var T=u;c=x(T.object)+"."+x(T.property);break;default:break}return c}var _=function(u){i(c,u);function c(g,y,T){return u.call(this,g,y,T)||this}return c.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():u.prototype.parsePrimaryExpression.call(this)},c.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},c.prototype.finishJSX=function(){this.nextToken()},c.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},c.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},c.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},c.prototype.scanXHTMLEntity=function(g){for(var y="&",T=!0,w=!1,R=!1,M=!1;!this.scanner.eof()&&T&&!w;){var J=this.scanner.source[this.scanner.index];if(J===g)break;if(w=J===";",y+=J,++this.scanner.index,!w)switch(y.length){case 2:R=J==="#";break;case 3:R&&(M=J==="x",T=M||r.Character.isDecimalDigit(J.charCodeAt(0)),R=R&&!M);break;default:T=T&&!(R&&!r.Character.isDecimalDigit(J.charCodeAt(0))),T=T&&!(M&&!r.Character.isHexDigit(J.charCodeAt(0)));break}}if(T&&w&&y.length>2){var W=y.substr(1,y.length-2);R&&W.length>1?y=String.fromCharCode(parseInt(W.substr(1),10)):M&&W.length>2?y=String.fromCharCode(parseInt("0"+W.substr(1),16)):!R&&!M&&d.XHTMLEntities[W]&&(y=d.XHTMLEntities[W])}return y},c.prototype.lexJSX=function(){var g=this.scanner.source.charCodeAt(this.scanner.index);if(g===60||g===62||g===47||g===58||g===61||g===123||g===125){var y=this.scanner.source[this.scanner.index++];return{type:7,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(g===34||g===39){for(var T=this.scanner.index,w=this.scanner.source[this.scanner.index++],R="";!this.scanner.eof();){var M=this.scanner.source[this.scanner.index++];if(M===w)break;M==="&"?R+=this.scanXHTMLEntity(w):R+=M}return{type:8,value:R,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:T,end:this.scanner.index}}if(g===46){var J=this.scanner.source.charCodeAt(this.scanner.index+1),W=this.scanner.source.charCodeAt(this.scanner.index+2),y=J===46&&W===46?"...":".",T=this.scanner.index;return this.scanner.index+=y.length,{type:7,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:T,end:this.scanner.index}}if(g===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(r.Character.isIdentifierStart(g)&&g!==92){var T=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var M=this.scanner.source.charCodeAt(this.scanner.index);if(r.Character.isIdentifierPart(M)&&M!==92)++this.scanner.index;else if(M===45)++this.scanner.index;else break}var j=this.scanner.source.slice(T,this.scanner.index);return{type:100,value:j,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:T,end:this.scanner.index}}return this.scanner.lex()},c.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var g=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(g)),g},c.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var g=this.scanner.index,y="";!this.scanner.eof();){var T=this.scanner.source[this.scanner.index];if(T==="{"||T==="<")break;++this.scanner.index,y+=T,r.Character.isLineTerminator(T.charCodeAt(0))&&(++this.scanner.lineNumber,T==="\r"&&this.scanner.source[this.scanner.index]===`
`&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var w={type:101,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:g,end:this.scanner.index};return y.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(w)),w},c.prototype.peekJSXToken=function(){var g=this.scanner.saveState();this.scanner.scanComments();var y=this.lexJSX();return this.scanner.restoreState(g),y},c.prototype.expectJSX=function(g){var y=this.nextJSXToken();(y.type!==7||y.value!==g)&&this.throwUnexpectedToken(y)},c.prototype.matchJSX=function(g){var y=this.peekJSXToken();return y.type===7&&y.value===g},c.prototype.parseJSXIdentifier=function(){var g=this.createJSXNode(),y=this.nextJSXToken();return y.type!==100&&this.throwUnexpectedToken(y),this.finalize(g,new o.JSXIdentifier(y.value))},c.prototype.parseJSXElementName=function(){var g=this.createJSXNode(),y=this.parseJSXIdentifier();if(this.matchJSX(":")){var T=y;this.expectJSX(":");var w=this.parseJSXIdentifier();y=this.finalize(g,new o.JSXNamespacedName(T,w))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var R=y;this.expectJSX(".");var M=this.parseJSXIdentifier();y=this.finalize(g,new o.JSXMemberExpression(R,M))}return y},c.prototype.parseJSXAttributeName=function(){var g=this.createJSXNode(),y,T=this.parseJSXIdentifier();if(this.matchJSX(":")){var w=T;this.expectJSX(":");var R=this.parseJSXIdentifier();y=this.finalize(g,new o.JSXNamespacedName(w,R))}else y=T;return y},c.prototype.parseJSXStringLiteralAttribute=function(){var g=this.createJSXNode(),y=this.nextJSXToken();y.type!==8&&this.throwUnexpectedToken(y);var T=this.getTokenRaw(y);return this.finalize(g,new f.Literal(y.value,T))},c.prototype.parseJSXExpressionAttribute=function(){var g=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var y=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(g,new o.JSXExpressionContainer(y))},c.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},c.prototype.parseJSXNameValueAttribute=function(){var g=this.createJSXNode(),y=this.parseJSXAttributeName(),T=null;return this.matchJSX("=")&&(this.expectJSX("="),T=this.parseJSXAttributeValue()),this.finalize(g,new o.JSXAttribute(y,T))},c.prototype.parseJSXSpreadAttribute=function(){var g=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var y=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(g,new o.JSXSpreadAttribute(y))},c.prototype.parseJSXAttributes=function(){for(var g=[];!this.matchJSX("/")&&!this.matchJSX(">");){var y=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();g.push(y)}return g},c.prototype.parseJSXOpeningElement=function(){var g=this.createJSXNode();this.expectJSX("<");var y=this.parseJSXElementName(),T=this.parseJSXAttributes(),w=this.matchJSX("/");return w&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(g,new o.JSXOpeningElement(y,w,T))},c.prototype.parseJSXBoundaryElement=function(){var g=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var y=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(g,new o.JSXClosingElement(y))}var T=this.parseJSXElementName(),w=this.parseJSXAttributes(),R=this.matchJSX("/");return R&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(g,new o.JSXOpeningElement(T,R,w))},c.prototype.parseJSXEmptyExpression=function(){var g=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(g,new o.JSXEmptyExpression)},c.prototype.parseJSXExpressionContainer=function(){var g=this.createJSXNode();this.expectJSX("{");var y;return this.matchJSX("}")?(y=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),y=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(g,new o.JSXExpressionContainer(y))},c.prototype.parseJSXChildren=function(){for(var g=[];!this.scanner.eof();){var y=this.createJSXChildNode(),T=this.nextJSXText();if(T.start<T.end){var w=this.getTokenRaw(T),R=this.finalize(y,new o.JSXText(T.value,w));g.push(R)}if(this.scanner.source[this.scanner.index]==="{"){var M=this.parseJSXExpressionContainer();g.push(M)}else break}return g},c.prototype.parseComplexJSXElement=function(g){for(var y=[];!this.scanner.eof();){g.children=g.children.concat(this.parseJSXChildren());var T=this.createJSXChildNode(),w=this.parseJSXBoundaryElement();if(w.type===h.JSXSyntax.JSXOpeningElement){var R=w;if(R.selfClosing){var M=this.finalize(T,new o.JSXElement(R,[],null));g.children.push(M)}else y.push(g),g={node:T,opening:R,closing:null,children:[]}}if(w.type===h.JSXSyntax.JSXClosingElement){g.closing=w;var J=x(g.opening.name),W=x(g.closing.name);if(J!==W&&this.tolerateError("Expected corresponding JSX closing tag for %0",J),y.length>0){var M=this.finalize(g.node,new o.JSXElement(g.opening,g.children,g.closing));g=y[y.length-1],g.children.push(M),y.pop()}else break}}return g},c.prototype.parseJSXElement=function(){var g=this.createJSXNode(),y=this.parseJSXOpeningElement(),T=[],w=null;if(!y.selfClosing){var R=this.parseComplexJSXElement({node:g,opening:y,closing:w,children:T});T=R.children,w=R.closing}return this.finalize(g,new o.JSXElement(y,T,w))},c.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var g=this.parseJSXElement();return this.finishJSX(),g},c.prototype.isStartOfExpression=function(){return u.prototype.isStartOfExpression.call(this)||this.match("<")},c}(p.Parser);t.JSXParser=_},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(i){return i<65536?String.fromCharCode(i):String.fromCharCode(55296+(i-65536>>10))+String.fromCharCode(56320+(i-65536&1023))},isWhiteSpace:function(i){return i===32||i===9||i===11||i===12||i===160||i>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(i)>=0},isLineTerminator:function(i){return i===10||i===13||i===8232||i===8233},isIdentifierStart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i===92||i>=128&&e.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(i))},isIdentifierPart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===92||i>=128&&e.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(i))},isDecimalDigit:function(i){return i>=48&&i<=57},isHexDigit:function(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102},isOctalDigit:function(i){return i>=48&&i<=55}}},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(6),r=function(){function g(y){this.type=i.JSXSyntax.JSXClosingElement,this.name=y}return g}();t.JSXClosingElement=r;var o=function(){function g(y,T,w){this.type=i.JSXSyntax.JSXElement,this.openingElement=y,this.children=T,this.closingElement=w}return g}();t.JSXElement=o;var h=function(){function g(){this.type=i.JSXSyntax.JSXEmptyExpression}return g}();t.JSXEmptyExpression=h;var f=function(){function g(y){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=y}return g}();t.JSXExpressionContainer=f;var p=function(){function g(y){this.type=i.JSXSyntax.JSXIdentifier,this.name=y}return g}();t.JSXIdentifier=p;var E=function(){function g(y,T){this.type=i.JSXSyntax.JSXMemberExpression,this.object=y,this.property=T}return g}();t.JSXMemberExpression=E;var d=function(){function g(y,T){this.type=i.JSXSyntax.JSXAttribute,this.name=y,this.value=T}return g}();t.JSXAttribute=d;var x=function(){function g(y,T){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=y,this.name=T}return g}();t.JSXNamespacedName=x;var _=function(){function g(y,T,w){this.type=i.JSXSyntax.JSXOpeningElement,this.name=y,this.selfClosing=T,this.attributes=w}return g}();t.JSXOpeningElement=_;var u=function(){function g(y){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=y}return g}();t.JSXSpreadAttribute=u;var c=function(){function g(y,T){this.type=i.JSXSyntax.JSXText,this.value=y,this.raw=T}return g}();t.JSXText=c},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(2),r=function(){function C(A){this.type=i.Syntax.ArrayExpression,this.elements=A}return C}();t.ArrayExpression=r;var o=function(){function C(A){this.type=i.Syntax.ArrayPattern,this.elements=A}return C}();t.ArrayPattern=o;var h=function(){function C(A,N,k){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=A,this.body=N,this.generator=!1,this.expression=k,this.async=!1}return C}();t.ArrowFunctionExpression=h;var f=function(){function C(A,N,k){this.type=i.Syntax.AssignmentExpression,this.operator=A,this.left=N,this.right=k}return C}();t.AssignmentExpression=f;var p=function(){function C(A,N){this.type=i.Syntax.AssignmentPattern,this.left=A,this.right=N}return C}();t.AssignmentPattern=p;var E=function(){function C(A,N,k){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=A,this.body=N,this.generator=!1,this.expression=k,this.async=!0}return C}();t.AsyncArrowFunctionExpression=E;var d=function(){function C(A,N,k){this.type=i.Syntax.FunctionDeclaration,this.id=A,this.params=N,this.body=k,this.generator=!1,this.expression=!1,this.async=!0}return C}();t.AsyncFunctionDeclaration=d;var x=function(){function C(A,N,k){this.type=i.Syntax.FunctionExpression,this.id=A,this.params=N,this.body=k,this.generator=!1,this.expression=!1,this.async=!0}return C}();t.AsyncFunctionExpression=x;var _=function(){function C(A){this.type=i.Syntax.AwaitExpression,this.argument=A}return C}();t.AwaitExpression=_;var u=function(){function C(A,N,k){var S=A==="||"||A==="&&";this.type=S?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=A,this.left=N,this.right=k}return C}();t.BinaryExpression=u;var c=function(){function C(A){this.type=i.Syntax.BlockStatement,this.body=A}return C}();t.BlockStatement=c;var g=function(){function C(A){this.type=i.Syntax.BreakStatement,this.label=A}return C}();t.BreakStatement=g;var y=function(){function C(A,N){this.type=i.Syntax.CallExpression,this.callee=A,this.arguments=N}return C}();t.CallExpression=y;var T=function(){function C(A,N){this.type=i.Syntax.CatchClause,this.param=A,this.body=N}return C}();t.CatchClause=T;var w=function(){function C(A){this.type=i.Syntax.ClassBody,this.body=A}return C}();t.ClassBody=w;var R=function(){function C(A,N,k){this.type=i.Syntax.ClassDeclaration,this.id=A,this.superClass=N,this.body=k}return C}();t.ClassDeclaration=R;var M=function(){function C(A,N,k){this.type=i.Syntax.ClassExpression,this.id=A,this.superClass=N,this.body=k}return C}();t.ClassExpression=M;var J=function(){function C(A,N){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=A,this.property=N}return C}();t.ComputedMemberExpression=J;var W=function(){function C(A,N,k){this.type=i.Syntax.ConditionalExpression,this.test=A,this.consequent=N,this.alternate=k}return C}();t.ConditionalExpression=W;var j=function(){function C(A){this.type=i.Syntax.ContinueStatement,this.label=A}return C}();t.ContinueStatement=j;var ot=function(){function C(){this.type=i.Syntax.DebuggerStatement}return C}();t.DebuggerStatement=ot;var st=function(){function C(A,N){this.type=i.Syntax.ExpressionStatement,this.expression=A,this.directive=N}return C}();t.Directive=st;var kt=function(){function C(A,N){this.type=i.Syntax.DoWhileStatement,this.body=A,this.test=N}return C}();t.DoWhileStatement=kt;var gt=function(){function C(){this.type=i.Syntax.EmptyStatement}return C}();t.EmptyStatement=gt;var qt=function(){function C(A){this.type=i.Syntax.ExportAllDeclaration,this.source=A}return C}();t.ExportAllDeclaration=qt;var Vt=function(){function C(A){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=A}return C}();t.ExportDefaultDeclaration=Vt;var Jt=function(){function C(A,N,k){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=A,this.specifiers=N,this.source=k}return C}();t.ExportNamedDeclaration=Jt;var fe=function(){function C(A,N){this.type=i.Syntax.ExportSpecifier,this.exported=N,this.local=A}return C}();t.ExportSpecifier=fe;var Ye=function(){function C(A){this.type=i.Syntax.ExpressionStatement,this.expression=A}return C}();t.ExpressionStatement=Ye;var Zt=function(){function C(A,N,k){this.type=i.Syntax.ForInStatement,this.left=A,this.right=N,this.body=k,this.each=!1}return C}();t.ForInStatement=Zt;var Bt=function(){function C(A,N,k){this.type=i.Syntax.ForOfStatement,this.left=A,this.right=N,this.body=k}return C}();t.ForOfStatement=Bt;var te=function(){function C(A,N,k,S){this.type=i.Syntax.ForStatement,this.init=A,this.test=N,this.update=k,this.body=S}return C}();t.ForStatement=te;var Ot=function(){function C(A,N,k,S){this.type=i.Syntax.FunctionDeclaration,this.id=A,this.params=N,this.body=k,this.generator=S,this.expression=!1,this.async=!1}return C}();t.FunctionDeclaration=Ot;var pe=function(){function C(A,N,k,S){this.type=i.Syntax.FunctionExpression,this.id=A,this.params=N,this.body=k,this.generator=S,this.expression=!1,this.async=!1}return C}();t.FunctionExpression=pe;var Wt=function(){function C(A){this.type=i.Syntax.Identifier,this.name=A}return C}();t.Identifier=Wt;var B=function(){function C(A,N,k){this.type=i.Syntax.IfStatement,this.test=A,this.consequent=N,this.alternate=k}return C}();t.IfStatement=B;var V=function(){function C(A,N){this.type=i.Syntax.ImportDeclaration,this.specifiers=A,this.source=N}return C}();t.ImportDeclaration=V;var Et=function(){function C(A){this.type=i.Syntax.ImportDefaultSpecifier,this.local=A}return C}();t.ImportDefaultSpecifier=Et;var Ht=function(){function C(A){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=A}return C}();t.ImportNamespaceSpecifier=Ht;var ne=function(){function C(A,N){this.type=i.Syntax.ImportSpecifier,this.local=A,this.imported=N}return C}();t.ImportSpecifier=ne;var se=function(){function C(A,N){this.type=i.Syntax.LabeledStatement,this.label=A,this.body=N}return C}();t.LabeledStatement=se;var z=function(){function C(A,N){this.type=i.Syntax.Literal,this.value=A,this.raw=N}return C}();t.Literal=z;var it=function(){function C(A,N){this.type=i.Syntax.MetaProperty,this.meta=A,this.property=N}return C}();t.MetaProperty=it;var Q=function(){function C(A,N,k,S,O){this.type=i.Syntax.MethodDefinition,this.key=A,this.computed=N,this.value=k,this.kind=S,this.static=O}return C}();t.MethodDefinition=Q;var at=function(){function C(A){this.type=i.Syntax.Program,this.body=A,this.sourceType="module"}return C}();t.Module=at;var lt=function(){function C(A,N){this.type=i.Syntax.NewExpression,this.callee=A,this.arguments=N}return C}();t.NewExpression=lt;var ht=function(){function C(A){this.type=i.Syntax.ObjectExpression,this.properties=A}return C}();t.ObjectExpression=ht;var nt=function(){function C(A){this.type=i.Syntax.ObjectPattern,this.properties=A}return C}();t.ObjectPattern=nt;var ct=function(){function C(A,N,k,S,O,G){this.type=i.Syntax.Property,this.key=N,this.computed=k,this.value=S,this.kind=A,this.method=O,this.shorthand=G}return C}();t.Property=ct;var At=function(){function C(A,N,k,S){this.type=i.Syntax.Literal,this.value=A,this.raw=N,this.regex={pattern:k,flags:S}}return C}();t.RegexLiteral=At;var Kt=function(){function C(A){this.type=i.Syntax.RestElement,this.argument=A}return C}();t.RestElement=Kt;var Qt=function(){function C(A){this.type=i.Syntax.ReturnStatement,this.argument=A}return C}();t.ReturnStatement=Qt;var St=function(){function C(A){this.type=i.Syntax.Program,this.body=A,this.sourceType="script"}return C}();t.Script=St;var Nt=function(){function C(A){this.type=i.Syntax.SequenceExpression,this.expressions=A}return C}();t.SequenceExpression=Nt;var Yt=function(){function C(A){this.type=i.Syntax.SpreadElement,this.argument=A}return C}();t.SpreadElement=Yt;var Tt=function(){function C(A,N){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=A,this.property=N}return C}();t.StaticMemberExpression=Tt;var be=function(){function C(){this.type=i.Syntax.Super}return C}();t.Super=be;var $e=function(){function C(A,N){this.type=i.Syntax.SwitchCase,this.test=A,this.consequent=N}return C}();t.SwitchCase=$e;var Ne=function(){function C(A,N){this.type=i.Syntax.SwitchStatement,this.discriminant=A,this.cases=N}return C}();t.SwitchStatement=Ne;var Te=function(){function C(A,N){this.type=i.Syntax.TaggedTemplateExpression,this.tag=A,this.quasi=N}return C}();t.TaggedTemplateExpression=Te;var Lt=function(){function C(A,N){this.type=i.Syntax.TemplateElement,this.value=A,this.tail=N}return C}();t.TemplateElement=Lt;var xi=function(){function C(A,N){this.type=i.Syntax.TemplateLiteral,this.quasis=A,this.expressions=N}return C}();t.TemplateLiteral=xi;var wi=function(){function C(){this.type=i.Syntax.ThisExpression}return C}();t.ThisExpression=wi;var Oi=function(){function C(A){this.type=i.Syntax.ThrowStatement,this.argument=A}return C}();t.ThrowStatement=Oi;var dt=function(){function C(A,N,k){this.type=i.Syntax.TryStatement,this.block=A,this.handler=N,this.finalizer=k}return C}();t.TryStatement=dt;var pn=function(){function C(A,N){this.type=i.Syntax.UnaryExpression,this.operator=A,this.argument=N,this.prefix=!0}return C}();t.UnaryExpression=pn;var ui=function(){function C(A,N,k){this.type=i.Syntax.UpdateExpression,this.operator=A,this.argument=N,this.prefix=k}return C}();t.UpdateExpression=ui;var Ze=function(){function C(A,N){this.type=i.Syntax.VariableDeclaration,this.declarations=A,this.kind=N}return C}();t.VariableDeclaration=Ze;var Ji=function(){function C(A,N){this.type=i.Syntax.VariableDeclarator,this.id=A,this.init=N}return C}();t.VariableDeclarator=Ji;var li=function(){function C(A,N){this.type=i.Syntax.WhileStatement,this.test=A,this.body=N}return C}();t.WhileStatement=li;var ci=function(){function C(A,N){this.type=i.Syntax.WithStatement,this.object=A,this.body=N}return C}();t.WithStatement=ci;var D=function(){function C(A,N){this.type=i.Syntax.YieldExpression,this.argument=A,this.delegate=N}return C}();t.YieldExpression=D},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(9),r=e(10),o=e(11),h=e(7),f=e(12),p=e(2),E=e(13),d="ArrowParameterPlaceHolder",x=function(){function _(u,c,g){c===void 0&&(c={}),this.config={range:typeof c.range=="boolean"&&c.range,loc:typeof c.loc=="boolean"&&c.loc,source:null,tokens:typeof c.tokens=="boolean"&&c.tokens,comment:typeof c.comment=="boolean"&&c.comment,tolerant:typeof c.tolerant=="boolean"&&c.tolerant},this.config.loc&&c.source&&c.source!==null&&(this.config.source=String(c.source)),this.delegate=g,this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new f.Scanner(u,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return _.prototype.throwError=function(u){for(var c=[],g=1;g<arguments.length;g++)c[g-1]=arguments[g];var y=Array.prototype.slice.call(arguments,1),T=u.replace(/%(\d)/g,function(J,W){return i.assert(W<y.length,"Message reference must be in range"),y[W]}),w=this.lastMarker.index,R=this.lastMarker.line,M=this.lastMarker.column+1;throw this.errorHandler.createError(w,R,M,T)},_.prototype.tolerateError=function(u){for(var c=[],g=1;g<arguments.length;g++)c[g-1]=arguments[g];var y=Array.prototype.slice.call(arguments,1),T=u.replace(/%(\d)/g,function(J,W){return i.assert(W<y.length,"Message reference must be in range"),y[W]}),w=this.lastMarker.index,R=this.scanner.lineNumber,M=this.lastMarker.column+1;this.errorHandler.tolerateError(w,R,M,T)},_.prototype.unexpectedTokenError=function(u,c){var g=c||o.Messages.UnexpectedToken,y;if(u?(c||(g=u.type===2?o.Messages.UnexpectedEOS:u.type===3?o.Messages.UnexpectedIdentifier:u.type===6?o.Messages.UnexpectedNumber:u.type===8?o.Messages.UnexpectedString:u.type===10?o.Messages.UnexpectedTemplate:o.Messages.UnexpectedToken,u.type===4&&(this.scanner.isFutureReservedWord(u.value)?g=o.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(u.value)&&(g=o.Messages.StrictReservedWord))),y=u.value):y="ILLEGAL",g=g.replace("%0",y),u&&typeof u.lineNumber=="number"){var T=u.start,w=u.lineNumber,R=this.lastMarker.index-this.lastMarker.column,M=u.start-R+1;return this.errorHandler.createError(T,w,M,g)}else{var T=this.lastMarker.index,w=this.lastMarker.line,M=this.lastMarker.column+1;return this.errorHandler.createError(T,w,M,g)}},_.prototype.throwUnexpectedToken=function(u,c){throw this.unexpectedTokenError(u,c)},_.prototype.tolerateUnexpectedToken=function(u,c){this.errorHandler.tolerate(this.unexpectedTokenError(u,c))},_.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var u=this.scanner.scanComments();if(u.length>0&&this.delegate)for(var c=0;c<u.length;++c){var g=u[c],y=void 0;y={type:g.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(g.slice[0],g.slice[1])},this.config.range&&(y.range=g.range),this.config.loc&&(y.loc=g.loc);var T={start:{line:g.loc.start.line,column:g.loc.start.column,offset:g.range[0]},end:{line:g.loc.end.line,column:g.loc.end.column,offset:g.range[1]}};this.delegate(y,T)}}},_.prototype.getTokenRaw=function(u){return this.scanner.source.slice(u.start,u.end)},_.prototype.convertToken=function(u){var c={type:E.TokenName[u.type],value:this.getTokenRaw(u)};if(this.config.range&&(c.range=[u.start,u.end]),this.config.loc&&(c.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),u.type===9){var g=u.pattern,y=u.flags;c.regex={pattern:g,flags:y}}return c},_.prototype.nextToken=function(){var u=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var c=this.scanner.lex();return this.hasLineTerminator=u.lineNumber!==c.lineNumber,c&&this.context.strict&&c.type===3&&this.scanner.isStrictModeReservedWord(c.value)&&(c.type=4),this.lookahead=c,this.config.tokens&&c.type!==2&&this.tokens.push(this.convertToken(c)),u},_.prototype.nextRegexToken=function(){this.collectComments();var u=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(u))),this.lookahead=u,this.nextToken(),u},_.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},_.prototype.startNode=function(u,c){c===void 0&&(c=0);var g=u.start-u.lineStart,y=u.lineNumber;return g<0&&(g+=c,y--),{index:u.start,line:y,column:g}},_.prototype.finalize=function(u,c){if(this.config.range&&(c.range=[u.index,this.lastMarker.index]),this.config.loc&&(c.loc={start:{line:u.line,column:u.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(c.loc.source=this.config.source)),this.delegate){var g={start:{line:u.line,column:u.column,offset:u.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(c,g)}return c},_.prototype.expect=function(u){var c=this.nextToken();(c.type!==7||c.value!==u)&&this.throwUnexpectedToken(c)},_.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var u=this.lookahead;u.type===7&&u.value===","?this.nextToken():u.type===7&&u.value===";"?(this.nextToken(),this.tolerateUnexpectedToken(u)):this.tolerateUnexpectedToken(u,o.Messages.UnexpectedToken)}else this.expect(",")},_.prototype.expectKeyword=function(u){var c=this.nextToken();(c.type!==4||c.value!==u)&&this.throwUnexpectedToken(c)},_.prototype.match=function(u){return this.lookahead.type===7&&this.lookahead.value===u},_.prototype.matchKeyword=function(u){return this.lookahead.type===4&&this.lookahead.value===u},_.prototype.matchContextualKeyword=function(u){return this.lookahead.type===3&&this.lookahead.value===u},_.prototype.matchAssign=function(){if(this.lookahead.type!==7)return!1;var u=this.lookahead.value;return u==="="||u==="*="||u==="**="||u==="/="||u==="%="||u==="+="||u==="-="||u==="<<="||u===">>="||u===">>>="||u==="&="||u==="^="||u==="|="},_.prototype.isolateCoverGrammar=function(u){var c=this.context.isBindingElement,g=this.context.isAssignmentTarget,y=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var T=u.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=c,this.context.isAssignmentTarget=g,this.context.firstCoverInitializedNameError=y,T},_.prototype.inheritCoverGrammar=function(u){var c=this.context.isBindingElement,g=this.context.isAssignmentTarget,y=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var T=u.call(this);return this.context.isBindingElement=this.context.isBindingElement&&c,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&g,this.context.firstCoverInitializedNameError=y||this.context.firstCoverInitializedNameError,T},_.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type!==2&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},_.prototype.parsePrimaryExpression=function(){var u=this.createNode(),c,g,y;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),c=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(u,new h.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,o.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),y=this.getTokenRaw(g),c=this.finalize(u,new h.Literal(g.value,y));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),y=this.getTokenRaw(g),c=this.finalize(u,new h.Literal(g.value==="true",y));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,g=this.nextToken(),y=this.getTokenRaw(g),c=this.finalize(u,new h.Literal(null,y));break;case 10:c=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,c=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":c=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":c=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,g=this.nextRegexToken(),y=this.getTokenRaw(g),c=this.finalize(u,new h.RegexLiteral(g.regex,y,g.pattern,g.flags));break;default:c=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?c=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?c=this.finalize(u,new h.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?c=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),c=this.finalize(u,new h.ThisExpression)):this.matchKeyword("class")?c=this.parseClassExpression():c=this.throwUnexpectedToken(this.nextToken()));break;default:c=this.throwUnexpectedToken(this.nextToken())}return c},_.prototype.parseSpreadElement=function(){var u=this.createNode();this.expect("...");var c=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(u,new h.SpreadElement(c))},_.prototype.parseArrayInitializer=function(){var u=this.createNode(),c=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),c.push(null);else if(this.match("...")){var g=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),c.push(g)}else c.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(u,new h.ArrayExpression(c))},_.prototype.parsePropertyMethod=function(u){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var c=this.context.strict,g=this.context.allowStrictDirective;this.context.allowStrictDirective=u.simple;var y=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&u.firstRestricted&&this.tolerateUnexpectedToken(u.firstRestricted,u.message),this.context.strict&&u.stricted&&this.tolerateUnexpectedToken(u.stricted,u.message),this.context.strict=c,this.context.allowStrictDirective=g,y},_.prototype.parsePropertyMethodFunction=function(){var u=!1,c=this.createNode(),g=this.context.allowYield;this.context.allowYield=!0;var y=this.parseFormalParameters(),T=this.parsePropertyMethod(y);return this.context.allowYield=g,this.finalize(c,new h.FunctionExpression(null,y.params,T,u))},_.prototype.parsePropertyMethodAsyncFunction=function(){var u=this.createNode(),c=this.context.allowYield,g=this.context.await;this.context.allowYield=!1,this.context.await=!0;var y=this.parseFormalParameters(),T=this.parsePropertyMethod(y);return this.context.allowYield=c,this.context.await=g,this.finalize(u,new h.AsyncFunctionExpression(null,y.params,T))},_.prototype.parseObjectPropertyKey=function(){var u=this.createNode(),c=this.nextToken(),g;switch(c.type){case 8:case 6:this.context.strict&&c.octal&&this.tolerateUnexpectedToken(c,o.Messages.StrictOctalLiteral);var y=this.getTokenRaw(c);g=this.finalize(u,new h.Literal(c.value,y));break;case 3:case 1:case 5:case 4:g=this.finalize(u,new h.Identifier(c.value));break;case 7:c.value==="["?(g=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):g=this.throwUnexpectedToken(c);break;default:g=this.throwUnexpectedToken(c)}return g},_.prototype.isPropertyKey=function(u,c){return u.type===p.Syntax.Identifier&&u.name===c||u.type===p.Syntax.Literal&&u.value===c},_.prototype.parseObjectProperty=function(u){var c=this.createNode(),g=this.lookahead,y,T=null,w=null,R=!1,M=!1,J=!1,W=!1;if(g.type===3){var j=g.value;this.nextToken(),R=this.match("["),W=!this.hasLineTerminator&&j==="async"&&!this.match(":")&&!this.match("(")&&!this.match("*")&&!this.match(","),T=W?this.parseObjectPropertyKey():this.finalize(c,new h.Identifier(j))}else this.match("*")?this.nextToken():(R=this.match("["),T=this.parseObjectPropertyKey());var ot=this.qualifiedPropertyName(this.lookahead);if(g.type===3&&!W&&g.value==="get"&&ot)y="get",R=this.match("["),T=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod();else if(g.type===3&&!W&&g.value==="set"&&ot)y="set",R=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseSetterMethod();else if(g.type===7&&g.value==="*"&&ot)y="init",R=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),M=!0;else if(T||this.throwUnexpectedToken(this.lookahead),y="init",this.match(":")&&!W)!R&&this.isPropertyKey(T,"__proto__")&&(u.value&&this.tolerateError(o.Messages.DuplicateProtoProperty),u.value=!0),this.nextToken(),w=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))w=W?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),M=!0;else if(g.type===3){var j=this.finalize(c,new h.Identifier(g.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),J=!0;var st=this.isolateCoverGrammar(this.parseAssignmentExpression);w=this.finalize(c,new h.AssignmentPattern(j,st))}else J=!0,w=j}else this.throwUnexpectedToken(this.nextToken());return this.finalize(c,new h.Property(y,T,R,w,M,J))},_.prototype.parseObjectInitializer=function(){var u=this.createNode();this.expect("{");for(var c=[],g={value:!1};!this.match("}");)c.push(this.parseObjectProperty(g)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(u,new h.ObjectExpression(c))},_.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var u=this.createNode(),c=this.nextToken(),g=c.value,y=c.cooked;return this.finalize(u,new h.TemplateElement({raw:g,cooked:y},c.tail))},_.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var u=this.createNode(),c=this.nextToken(),g=c.value,y=c.cooked;return this.finalize(u,new h.TemplateElement({raw:g,cooked:y},c.tail))},_.prototype.parseTemplateLiteral=function(){var u=this.createNode(),c=[],g=[],y=this.parseTemplateHead();for(g.push(y);!y.tail;)c.push(this.parseExpression()),y=this.parseTemplateElement(),g.push(y);return this.finalize(u,new h.TemplateLiteral(g,c))},_.prototype.reinterpretExpressionAsPattern=function(u){switch(u.type){case p.Syntax.Identifier:case p.Syntax.MemberExpression:case p.Syntax.RestElement:case p.Syntax.AssignmentPattern:break;case p.Syntax.SpreadElement:u.type=p.Syntax.RestElement,this.reinterpretExpressionAsPattern(u.argument);break;case p.Syntax.ArrayExpression:u.type=p.Syntax.ArrayPattern;for(var c=0;c<u.elements.length;c++)u.elements[c]!==null&&this.reinterpretExpressionAsPattern(u.elements[c]);break;case p.Syntax.ObjectExpression:u.type=p.Syntax.ObjectPattern;for(var c=0;c<u.properties.length;c++)this.reinterpretExpressionAsPattern(u.properties[c].value);break;case p.Syntax.AssignmentExpression:u.type=p.Syntax.AssignmentPattern,delete u.operator,this.reinterpretExpressionAsPattern(u.left);break;default:break}},_.prototype.parseGroupExpression=function(){var u;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),u={type:d,params:[],async:!1};else{var c=this.lookahead,g=[];if(this.match("..."))u=this.parseRestElement(g),this.expect(")"),this.match("=>")||this.expect("=>"),u={type:d,params:[u],async:!1};else{var y=!1;if(this.context.isBindingElement=!0,u=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var T=[];for(this.context.isAssignmentTarget=!1,T.push(u);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var w=0;w<T.length;w++)this.reinterpretExpressionAsPattern(T[w]);y=!0,u={type:d,params:T,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),T.push(this.parseRestElement(g)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var w=0;w<T.length;w++)this.reinterpretExpressionAsPattern(T[w]);y=!0,u={type:d,params:T,async:!1}}else T.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(y)break}y||(u=this.finalize(this.startNode(c),new h.SequenceExpression(T)))}if(!y){if(this.expect(")"),this.match("=>")&&(u.type===p.Syntax.Identifier&&u.name==="yield"&&(y=!0,u={type:d,params:[u],async:!1}),!y)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),u.type===p.Syntax.SequenceExpression)for(var w=0;w<u.expressions.length;w++)this.reinterpretExpressionAsPattern(u.expressions[w]);else this.reinterpretExpressionAsPattern(u);var R=u.type===p.Syntax.SequenceExpression?u.expressions:[u];u={type:d,params:R,async:!1}}this.context.isBindingElement=!1}}}return u},_.prototype.parseArguments=function(){this.expect("(");var u=[];if(!this.match(")"))for(;;){var c=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(u.push(c),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),u},_.prototype.isIdentifierName=function(u){return u.type===3||u.type===4||u.type===1||u.type===5},_.prototype.parseIdentifierName=function(){var u=this.createNode(),c=this.nextToken();return this.isIdentifierName(c)||this.throwUnexpectedToken(c),this.finalize(u,new h.Identifier(c.value))},_.prototype.parseNewExpression=function(){var u=this.createNode(),c=this.parseIdentifierName();i.assert(c.name==="new","New expression must start with `new`");var g;if(this.match("."))if(this.nextToken(),this.lookahead.type===3&&this.context.inFunctionBody&&this.lookahead.value==="target"){var y=this.parseIdentifierName();g=new h.MetaProperty(c,y)}else this.throwUnexpectedToken(this.lookahead);else{var T=this.isolateCoverGrammar(this.parseLeftHandSideExpression),w=this.match("(")?this.parseArguments():[];g=new h.NewExpression(T,w),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(u,g)},_.prototype.parseAsyncArgument=function(){var u=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,u},_.prototype.parseAsyncArguments=function(){this.expect("(");var u=[];if(!this.match(")"))for(;;){var c=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(u.push(c),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),u},_.prototype.parseLeftHandSideExpressionAllowCall=function(){var u=this.lookahead,c=this.matchContextualKeyword("async"),g=this.context.allowIn;this.context.allowIn=!0;var y;for(this.matchKeyword("super")&&this.context.inFunctionBody?(y=this.createNode(),this.nextToken(),y=this.finalize(y,new h.Super),!this.match("(")&&!this.match(".")&&!this.match("[")&&this.throwUnexpectedToken(this.lookahead)):y=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var T=this.parseIdentifierName();y=this.finalize(this.startNode(u),new h.StaticMemberExpression(y,T))}else if(this.match("(")){var w=c&&u.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var R=w?this.parseAsyncArguments():this.parseArguments();if(y=this.finalize(this.startNode(u),new h.CallExpression(y,R)),w&&this.match("=>")){for(var M=0;M<R.length;++M)this.reinterpretExpressionAsPattern(R[M]);y={type:d,params:R,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var T=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),y=this.finalize(this.startNode(u),new h.ComputedMemberExpression(y,T))}else if(this.lookahead.type===10&&this.lookahead.head){var J=this.parseTemplateLiteral();y=this.finalize(this.startNode(u),new h.TaggedTemplateExpression(y,J))}else break;return this.context.allowIn=g,y},_.prototype.parseSuper=function(){var u=this.createNode();return this.expectKeyword("super"),!this.match("[")&&!this.match(".")&&this.throwUnexpectedToken(this.lookahead),this.finalize(u,new h.Super)},_.prototype.parseLeftHandSideExpression=function(){i.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var u=this.startNode(this.lookahead),c=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var g=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),c=this.finalize(u,new h.ComputedMemberExpression(c,g))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var g=this.parseIdentifierName();c=this.finalize(u,new h.StaticMemberExpression(c,g))}else if(this.lookahead.type===10&&this.lookahead.head){var y=this.parseTemplateLiteral();c=this.finalize(u,new h.TaggedTemplateExpression(c,y))}else break;return c},_.prototype.parseUpdateExpression=function(){var u,c=this.lookahead;if(this.match("++")||this.match("--")){var g=this.startNode(c),y=this.nextToken();u=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&u.type===p.Syntax.Identifier&&this.scanner.isRestrictedWord(u.name)&&this.tolerateError(o.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment);var T=!0;u=this.finalize(g,new h.UpdateExpression(y.value,u,T)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(u=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7&&(this.match("++")||this.match("--"))){this.context.strict&&u.type===p.Syntax.Identifier&&this.scanner.isRestrictedWord(u.name)&&this.tolerateError(o.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var w=this.nextToken().value,T=!1;u=this.finalize(this.startNode(c),new h.UpdateExpression(w,u,T))}return u},_.prototype.parseAwaitExpression=function(){var u=this.createNode();this.nextToken();var c=this.parseUnaryExpression();return this.finalize(u,new h.AwaitExpression(c))},_.prototype.parseUnaryExpression=function(){var u;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var c=this.startNode(this.lookahead),g=this.nextToken();u=this.inheritCoverGrammar(this.parseUnaryExpression),u=this.finalize(c,new h.UnaryExpression(g.value,u)),this.context.strict&&u.operator==="delete"&&u.argument.type===p.Syntax.Identifier&&this.tolerateError(o.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else this.context.await&&this.matchContextualKeyword("await")?u=this.parseAwaitExpression():u=this.parseUpdateExpression();return u},_.prototype.parseExponentiationExpression=function(){var u=this.lookahead,c=this.inheritCoverGrammar(this.parseUnaryExpression);if(c.type!==p.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var g=c,y=this.isolateCoverGrammar(this.parseExponentiationExpression);c=this.finalize(this.startNode(u),new h.BinaryExpression("**",g,y))}return c},_.prototype.binaryPrecedence=function(u){var c=u.value,g;return u.type===7?g=this.operatorPrecedence[c]||0:u.type===4?g=c==="instanceof"||this.context.allowIn&&c==="in"?7:0:g=0,g},_.prototype.parseBinaryExpression=function(){var u=this.lookahead,c=this.inheritCoverGrammar(this.parseExponentiationExpression),g=this.lookahead,y=this.binaryPrecedence(g);if(y>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var T=[u,this.lookahead],w=c,R=this.isolateCoverGrammar(this.parseExponentiationExpression),M=[w,g.value,R],J=[y];y=this.binaryPrecedence(this.lookahead),!(y<=0);){for(;M.length>2&&y<=J[J.length-1];){R=M.pop();var W=M.pop();J.pop(),w=M.pop(),T.pop();var j=this.startNode(T[T.length-1]);M.push(this.finalize(j,new h.BinaryExpression(W,w,R)))}M.push(this.nextToken().value),J.push(y),T.push(this.lookahead),M.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var ot=M.length-1;c=M[ot];for(var st=T.pop();ot>1;){var kt=T.pop(),gt=st&&st.lineStart,j=this.startNode(kt,gt),W=M[ot-1];c=this.finalize(j,new h.BinaryExpression(W,M[ot-2],c)),ot-=2,st=kt}}return c},_.prototype.parseConditionalExpression=function(){var u=this.lookahead,c=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var g=this.context.allowIn;this.context.allowIn=!0;var y=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=g,this.expect(":");var T=this.isolateCoverGrammar(this.parseAssignmentExpression);c=this.finalize(this.startNode(u),new h.ConditionalExpression(c,y,T)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return c},_.prototype.checkPatternParam=function(u,c){switch(c.type){case p.Syntax.Identifier:this.validateParam(u,c,c.name);break;case p.Syntax.RestElement:this.checkPatternParam(u,c.argument);break;case p.Syntax.AssignmentPattern:this.checkPatternParam(u,c.left);break;case p.Syntax.ArrayPattern:for(var g=0;g<c.elements.length;g++)c.elements[g]!==null&&this.checkPatternParam(u,c.elements[g]);break;case p.Syntax.ObjectPattern:for(var g=0;g<c.properties.length;g++)this.checkPatternParam(u,c.properties[g].value);break;default:break}u.simple=u.simple&&c instanceof h.Identifier},_.prototype.reinterpretAsCoverFormalsList=function(u){var c=[u],g,y=!1;switch(u.type){case p.Syntax.Identifier:break;case d:c=u.params,y=u.async;break;default:return null}g={simple:!0,paramSet:{}};for(var T=0;T<c.length;++T){var w=c[T];w.type===p.Syntax.AssignmentPattern?w.right.type===p.Syntax.YieldExpression&&(w.right.argument&&this.throwUnexpectedToken(this.lookahead),w.right.type=p.Syntax.Identifier,w.right.name="yield",delete w.right.argument,delete w.right.delegate):y&&w.type===p.Syntax.Identifier&&w.name==="await"&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(g,w),c[T]=w}if(this.context.strict||!this.context.allowYield)for(var T=0;T<c.length;++T){var w=c[T];w.type===p.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(g.message===o.Messages.StrictParamDupe){var R=this.context.strict?g.stricted:g.firstRestricted;this.throwUnexpectedToken(R,g.message)}return{simple:g.simple,params:c,stricted:g.stricted,firstRestricted:g.firstRestricted,message:g.message}},_.prototype.parseAssignmentExpression=function(){var u;if(!this.context.allowYield&&this.matchKeyword("yield"))u=this.parseYieldExpression();else{var c=this.lookahead,g=c;if(u=this.parseConditionalExpression(),g.type===3&&g.lineNumber===this.lookahead.lineNumber&&g.value==="async"&&(this.lookahead.type===3||this.matchKeyword("yield"))){var y=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(y),u={type:d,params:[y],async:!0}}if(u.type===d||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var T=u.async,w=this.reinterpretAsCoverFormalsList(u);if(w){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var R=this.context.strict,M=this.context.allowStrictDirective;this.context.allowStrictDirective=w.simple;var J=this.context.allowYield,W=this.context.await;this.context.allowYield=!0,this.context.await=T;var j=this.startNode(c);this.expect("=>");var ot=void 0;if(this.match("{")){var st=this.context.allowIn;this.context.allowIn=!0,ot=this.parseFunctionSourceElements(),this.context.allowIn=st}else ot=this.isolateCoverGrammar(this.parseAssignmentExpression);var kt=ot.type!==p.Syntax.BlockStatement;this.context.strict&&w.firstRestricted&&this.throwUnexpectedToken(w.firstRestricted,w.message),this.context.strict&&w.stricted&&this.tolerateUnexpectedToken(w.stricted,w.message),u=T?this.finalize(j,new h.AsyncArrowFunctionExpression(w.params,ot,kt)):this.finalize(j,new h.ArrowFunctionExpression(w.params,ot,kt)),this.context.strict=R,this.context.allowStrictDirective=M,this.context.allowYield=J,this.context.await=W}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.strict&&u.type===p.Syntax.Identifier){var gt=u;this.scanner.isRestrictedWord(gt.name)&&this.tolerateUnexpectedToken(g,o.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(gt.name)&&this.tolerateUnexpectedToken(g,o.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(u):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),g=this.nextToken();var qt=g.value,Vt=this.isolateCoverGrammar(this.parseAssignmentExpression);u=this.finalize(this.startNode(c),new h.AssignmentExpression(qt,u,Vt)),this.context.firstCoverInitializedNameError=null}}return u},_.prototype.parseExpression=function(){var u=this.lookahead,c=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var g=[];for(g.push(c);this.lookahead.type!==2&&this.match(",");)this.nextToken(),g.push(this.isolateCoverGrammar(this.parseAssignmentExpression));c=this.finalize(this.startNode(u),new h.SequenceExpression(g))}return c},_.prototype.parseStatementListItem=function(){var u;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalExportDeclaration),u=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalImportDeclaration),u=this.parseImportDeclaration();break;case"const":u=this.parseLexicalDeclaration({inFor:!1});break;case"function":u=this.parseFunctionDeclaration();break;case"class":u=this.parseClassDeclaration();break;case"let":u=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:u=this.parseStatement();break}else u=this.parseStatement();return u},_.prototype.parseBlock=function(){var u=this.createNode();this.expect("{");for(var c=[];!this.match("}");)c.push(this.parseStatementListItem());return this.expect("}"),this.finalize(u,new h.BlockStatement(c))},_.prototype.parseLexicalBinding=function(u,c){var g=this.createNode(),y=[],T=this.parsePattern(y,u);this.context.strict&&T.type===p.Syntax.Identifier&&this.scanner.isRestrictedWord(T.name)&&this.tolerateError(o.Messages.StrictVarName);var w=null;return u==="const"?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),w=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(o.Messages.DeclarationMissingInitializer,"const")):(!c.inFor&&T.type!==p.Syntax.Identifier||this.match("="))&&(this.expect("="),w=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(g,new h.VariableDeclarator(T,w))},_.prototype.parseBindingList=function(u,c){for(var g=[this.parseLexicalBinding(u,c)];this.match(",");)this.nextToken(),g.push(this.parseLexicalBinding(u,c));return g},_.prototype.isLexicalDeclaration=function(){var u=this.scanner.saveState();this.scanner.scanComments();var c=this.scanner.lex();return this.scanner.restoreState(u),c.type===3||c.type===7&&c.value==="["||c.type===7&&c.value==="{"||c.type===4&&c.value==="let"||c.type===4&&c.value==="yield"},_.prototype.parseLexicalDeclaration=function(u){var c=this.createNode(),g=this.nextToken().value;i.assert(g==="let"||g==="const","Lexical declaration must be either let or const");var y=this.parseBindingList(g,u);return this.consumeSemicolon(),this.finalize(c,new h.VariableDeclaration(y,g))},_.prototype.parseBindingRestElement=function(u,c){var g=this.createNode();this.expect("...");var y=this.parsePattern(u,c);return this.finalize(g,new h.RestElement(y))},_.prototype.parseArrayPattern=function(u,c){var g=this.createNode();this.expect("[");for(var y=[];!this.match("]");)if(this.match(","))this.nextToken(),y.push(null);else{if(this.match("...")){y.push(this.parseBindingRestElement(u,c));break}else y.push(this.parsePatternWithDefault(u,c));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(g,new h.ArrayPattern(y))},_.prototype.parsePropertyPattern=function(u,c){var g=this.createNode(),y=!1,T=!1,w=!1,R,M;if(this.lookahead.type===3){var J=this.lookahead;R=this.parseVariableIdentifier();var W=this.finalize(g,new h.Identifier(J.value));if(this.match("=")){u.push(J),T=!0,this.nextToken();var j=this.parseAssignmentExpression();M=this.finalize(this.startNode(J),new h.AssignmentPattern(W,j))}else this.match(":")?(this.expect(":"),M=this.parsePatternWithDefault(u,c)):(u.push(J),T=!0,M=W)}else y=this.match("["),R=this.parseObjectPropertyKey(),this.expect(":"),M=this.parsePatternWithDefault(u,c);return this.finalize(g,new h.Property("init",R,y,M,w,T))},_.prototype.parseObjectPattern=function(u,c){var g=this.createNode(),y=[];for(this.expect("{");!this.match("}");)y.push(this.parsePropertyPattern(u,c)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(g,new h.ObjectPattern(y))},_.prototype.parsePattern=function(u,c){var g;return this.match("[")?g=this.parseArrayPattern(u,c):this.match("{")?g=this.parseObjectPattern(u,c):(this.matchKeyword("let")&&(c==="const"||c==="let")&&this.tolerateUnexpectedToken(this.lookahead,o.Messages.LetInLexicalBinding),u.push(this.lookahead),g=this.parseVariableIdentifier(c)),g},_.prototype.parsePatternWithDefault=function(u,c){var g=this.lookahead,y=this.parsePattern(u,c);if(this.match("=")){this.nextToken();var T=this.context.allowYield;this.context.allowYield=!0;var w=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=T,y=this.finalize(this.startNode(g),new h.AssignmentPattern(y,w))}return y},_.prototype.parseVariableIdentifier=function(u){var c=this.createNode(),g=this.nextToken();return g.type===4&&g.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(g,o.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(g):g.type!==3?this.context.strict&&g.type===4&&this.scanner.isStrictModeReservedWord(g.value)?this.tolerateUnexpectedToken(g,o.Messages.StrictReservedWord):(this.context.strict||g.value!=="let"||u!=="var")&&this.throwUnexpectedToken(g):(this.context.isModule||this.context.await)&&g.type===3&&g.value==="await"&&this.tolerateUnexpectedToken(g),this.finalize(c,new h.Identifier(g.value))},_.prototype.parseVariableDeclaration=function(u){var c=this.createNode(),g=[],y=this.parsePattern(g,"var");this.context.strict&&y.type===p.Syntax.Identifier&&this.scanner.isRestrictedWord(y.name)&&this.tolerateError(o.Messages.StrictVarName);var T=null;return this.match("=")?(this.nextToken(),T=this.isolateCoverGrammar(this.parseAssignmentExpression)):y.type!==p.Syntax.Identifier&&!u.inFor&&this.expect("="),this.finalize(c,new h.VariableDeclarator(y,T))},_.prototype.parseVariableDeclarationList=function(u){var c={inFor:u.inFor},g=[];for(g.push(this.parseVariableDeclaration(c));this.match(",");)this.nextToken(),g.push(this.parseVariableDeclaration(c));return g},_.prototype.parseVariableStatement=function(){var u=this.createNode();this.expectKeyword("var");var c=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(u,new h.VariableDeclaration(c,"var"))},_.prototype.parseEmptyStatement=function(){var u=this.createNode();return this.expect(";"),this.finalize(u,new h.EmptyStatement)},_.prototype.parseExpressionStatement=function(){var u=this.createNode(),c=this.parseExpression();return this.consumeSemicolon(),this.finalize(u,new h.ExpressionStatement(c))},_.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(o.Messages.StrictFunction),this.parseStatement()},_.prototype.parseIfStatement=function(){var u=this.createNode(),c,g=null;this.expectKeyword("if"),this.expect("(");var y=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),c=this.finalize(this.createNode(),new h.EmptyStatement)):(this.expect(")"),c=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),g=this.parseIfClause())),this.finalize(u,new h.IfStatement(y,c,g))},_.prototype.parseDoWhileStatement=function(){var u=this.createNode();this.expectKeyword("do");var c=this.context.inIteration;this.context.inIteration=!0;var g=this.parseStatement();this.context.inIteration=c,this.expectKeyword("while"),this.expect("(");var y=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(u,new h.DoWhileStatement(g,y))},_.prototype.parseWhileStatement=function(){var u=this.createNode(),c;this.expectKeyword("while"),this.expect("(");var g=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),c=this.finalize(this.createNode(),new h.EmptyStatement);else{this.expect(")");var y=this.context.inIteration;this.context.inIteration=!0,c=this.parseStatement(),this.context.inIteration=y}return this.finalize(u,new h.WhileStatement(g,c))},_.prototype.parseForStatement=function(){var u=null,c=null,g=null,y=!0,T,w,R=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){u=this.createNode(),this.nextToken();var M=this.context.allowIn;this.context.allowIn=!1;var J=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=M,J.length===1&&this.matchKeyword("in")){var W=J[0];W.init&&(W.id.type===p.Syntax.ArrayPattern||W.id.type===p.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(o.Messages.ForInOfLoopInitializer,"for-in"),u=this.finalize(u,new h.VariableDeclaration(J,"var")),this.nextToken(),T=u,w=this.parseExpression(),u=null}else J.length===1&&J[0].init===null&&this.matchContextualKeyword("of")?(u=this.finalize(u,new h.VariableDeclaration(J,"var")),this.nextToken(),T=u,w=this.parseAssignmentExpression(),u=null,y=!1):(u=this.finalize(u,new h.VariableDeclaration(J,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){u=this.createNode();var j=this.nextToken().value;if(!this.context.strict&&this.lookahead.value==="in")u=this.finalize(u,new h.Identifier(j)),this.nextToken(),T=u,w=this.parseExpression(),u=null;else{var M=this.context.allowIn;this.context.allowIn=!1;var J=this.parseBindingList(j,{inFor:!0});this.context.allowIn=M,J.length===1&&J[0].init===null&&this.matchKeyword("in")?(u=this.finalize(u,new h.VariableDeclaration(J,j)),this.nextToken(),T=u,w=this.parseExpression(),u=null):J.length===1&&J[0].init===null&&this.matchContextualKeyword("of")?(u=this.finalize(u,new h.VariableDeclaration(J,j)),this.nextToken(),T=u,w=this.parseAssignmentExpression(),u=null,y=!1):(this.consumeSemicolon(),u=this.finalize(u,new h.VariableDeclaration(J,j)))}}else{var ot=this.lookahead,M=this.context.allowIn;if(this.context.allowIn=!1,u=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=M,this.matchKeyword("in"))(!this.context.isAssignmentTarget||u.type===p.Syntax.AssignmentExpression)&&this.tolerateError(o.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(u),T=u,w=this.parseExpression(),u=null;else if(this.matchContextualKeyword("of"))(!this.context.isAssignmentTarget||u.type===p.Syntax.AssignmentExpression)&&this.tolerateError(o.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(u),T=u,w=this.parseAssignmentExpression(),u=null,y=!1;else{if(this.match(",")){for(var st=[u];this.match(",");)this.nextToken(),st.push(this.isolateCoverGrammar(this.parseAssignmentExpression));u=this.finalize(this.startNode(ot),new h.SequenceExpression(st))}this.expect(";")}}typeof T>"u"&&(this.match(";")||(c=this.parseExpression()),this.expect(";"),this.match(")")||(g=this.parseExpression()));var kt;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),kt=this.finalize(this.createNode(),new h.EmptyStatement);else{this.expect(")");var gt=this.context.inIteration;this.context.inIteration=!0,kt=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=gt}return typeof T>"u"?this.finalize(R,new h.ForStatement(u,c,g,kt)):y?this.finalize(R,new h.ForInStatement(T,w,kt)):this.finalize(R,new h.ForOfStatement(T,w,kt))},_.prototype.parseContinueStatement=function(){var u=this.createNode();this.expectKeyword("continue");var c=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var g=this.parseVariableIdentifier();c=g;var y="$"+g.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,y)||this.throwError(o.Messages.UnknownLabel,g.name)}return this.consumeSemicolon(),c===null&&!this.context.inIteration&&this.throwError(o.Messages.IllegalContinue),this.finalize(u,new h.ContinueStatement(c))},_.prototype.parseBreakStatement=function(){var u=this.createNode();this.expectKeyword("break");var c=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var g=this.parseVariableIdentifier(),y="$"+g.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,y)||this.throwError(o.Messages.UnknownLabel,g.name),c=g}return this.consumeSemicolon(),c===null&&!this.context.inIteration&&!this.context.inSwitch&&this.throwError(o.Messages.IllegalBreak),this.finalize(u,new h.BreakStatement(c))},_.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(o.Messages.IllegalReturn);var u=this.createNode();this.expectKeyword("return");var c=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&this.lookahead.type!==2||this.lookahead.type===8||this.lookahead.type===10,g=c?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(u,new h.ReturnStatement(g))},_.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(o.Messages.StrictModeWith);var u=this.createNode(),c;this.expectKeyword("with"),this.expect("(");var g=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),c=this.finalize(this.createNode(),new h.EmptyStatement)):(this.expect(")"),c=this.parseStatement()),this.finalize(u,new h.WithStatement(g,c))},_.prototype.parseSwitchCase=function(){var u=this.createNode(),c;this.matchKeyword("default")?(this.nextToken(),c=null):(this.expectKeyword("case"),c=this.parseExpression()),this.expect(":");for(var g=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)g.push(this.parseStatementListItem());return this.finalize(u,new h.SwitchCase(c,g))},_.prototype.parseSwitchStatement=function(){var u=this.createNode();this.expectKeyword("switch"),this.expect("(");var c=this.parseExpression();this.expect(")");var g=this.context.inSwitch;this.context.inSwitch=!0;var y=[],T=!1;for(this.expect("{");!this.match("}");){var w=this.parseSwitchCase();w.test===null&&(T&&this.throwError(o.Messages.MultipleDefaultsInSwitch),T=!0),y.push(w)}return this.expect("}"),this.context.inSwitch=g,this.finalize(u,new h.SwitchStatement(c,y))},_.prototype.parseLabelledStatement=function(){var u=this.createNode(),c=this.parseExpression(),g;if(c.type===p.Syntax.Identifier&&this.match(":")){this.nextToken();var y=c,T="$"+y.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,T)&&this.throwError(o.Messages.Redeclaration,"Label",y.name),this.context.labelSet[T]=!0;var w=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),w=this.parseClassDeclaration();else if(this.matchKeyword("function")){var R=this.lookahead,M=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(R,o.Messages.StrictFunction):M.generator&&this.tolerateUnexpectedToken(R,o.Messages.GeneratorInLegacyContext),w=M}else w=this.parseStatement();delete this.context.labelSet[T],g=new h.LabeledStatement(y,w)}else this.consumeSemicolon(),g=new h.ExpressionStatement(c);return this.finalize(u,g)},_.prototype.parseThrowStatement=function(){var u=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(o.Messages.NewlineAfterThrow);var c=this.parseExpression();return this.consumeSemicolon(),this.finalize(u,new h.ThrowStatement(c))},_.prototype.parseCatchClause=function(){var u=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var c=[],g=this.parsePattern(c),y={},T=0;T<c.length;T++){var w="$"+c[T].value;Object.prototype.hasOwnProperty.call(y,w)&&this.tolerateError(o.Messages.DuplicateBinding,c[T].value),y[w]=!0}this.context.strict&&g.type===p.Syntax.Identifier&&this.scanner.isRestrictedWord(g.name)&&this.tolerateError(o.Messages.StrictCatchVariable),this.expect(")");var R=this.parseBlock();return this.finalize(u,new h.CatchClause(g,R))},_.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},_.prototype.parseTryStatement=function(){var u=this.createNode();this.expectKeyword("try");var c=this.parseBlock(),g=this.matchKeyword("catch")?this.parseCatchClause():null,y=this.matchKeyword("finally")?this.parseFinallyClause():null;return!g&&!y&&this.throwError(o.Messages.NoCatchOrFinally),this.finalize(u,new h.TryStatement(c,g,y))},_.prototype.parseDebuggerStatement=function(){var u=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(u,new h.DebuggerStatement)},_.prototype.parseStatement=function(){var u;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:u=this.parseExpressionStatement();break;case 7:var c=this.lookahead.value;c==="{"?u=this.parseBlock():c==="("?u=this.parseExpressionStatement():c===";"?u=this.parseEmptyStatement():u=this.parseExpressionStatement();break;case 3:u=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":u=this.parseBreakStatement();break;case"continue":u=this.parseContinueStatement();break;case"debugger":u=this.parseDebuggerStatement();break;case"do":u=this.parseDoWhileStatement();break;case"for":u=this.parseForStatement();break;case"function":u=this.parseFunctionDeclaration();break;case"if":u=this.parseIfStatement();break;case"return":u=this.parseReturnStatement();break;case"switch":u=this.parseSwitchStatement();break;case"throw":u=this.parseThrowStatement();break;case"try":u=this.parseTryStatement();break;case"var":u=this.parseVariableStatement();break;case"while":u=this.parseWhileStatement();break;case"with":u=this.parseWithStatement();break;default:u=this.parseExpressionStatement();break}break;default:u=this.throwUnexpectedToken(this.lookahead)}return u},_.prototype.parseFunctionSourceElements=function(){var u=this.createNode();this.expect("{");var c=this.parseDirectivePrologues(),g=this.context.labelSet,y=this.context.inIteration,T=this.context.inSwitch,w=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;this.lookahead.type!==2&&!this.match("}");)c.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=g,this.context.inIteration=y,this.context.inSwitch=T,this.context.inFunctionBody=w,this.finalize(u,new h.BlockStatement(c))},_.prototype.validateParam=function(u,c,g){var y="$"+g;this.context.strict?(this.scanner.isRestrictedWord(g)&&(u.stricted=c,u.message=o.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(u.paramSet,y)&&(u.stricted=c,u.message=o.Messages.StrictParamDupe)):u.firstRestricted||(this.scanner.isRestrictedWord(g)?(u.firstRestricted=c,u.message=o.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(g)?(u.firstRestricted=c,u.message=o.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(u.paramSet,y)&&(u.stricted=c,u.message=o.Messages.StrictParamDupe)),typeof Object.defineProperty=="function"?Object.defineProperty(u.paramSet,y,{value:!0,enumerable:!0,writable:!0,configurable:!0}):u.paramSet[y]=!0},_.prototype.parseRestElement=function(u){var c=this.createNode();this.expect("...");var g=this.parsePattern(u);return this.match("=")&&this.throwError(o.Messages.DefaultRestParameter),this.match(")")||this.throwError(o.Messages.ParameterAfterRestParameter),this.finalize(c,new h.RestElement(g))},_.prototype.parseFormalParameter=function(u){for(var c=[],g=this.match("...")?this.parseRestElement(c):this.parsePatternWithDefault(c),y=0;y<c.length;y++)this.validateParam(u,c[y],c[y].value);u.simple=u.simple&&g instanceof h.Identifier,u.params.push(g)},_.prototype.parseFormalParameters=function(u){var c;if(c={simple:!0,params:[],firstRestricted:u},this.expect("("),!this.match(")"))for(c.paramSet={};this.lookahead.type!==2&&(this.parseFormalParameter(c),!(this.match(")")||(this.expect(","),this.match(")")))););return this.expect(")"),{simple:c.simple,params:c.params,stricted:c.stricted,firstRestricted:c.firstRestricted,message:c.message}},_.prototype.matchAsyncFunction=function(){var u=this.matchContextualKeyword("async");if(u){var c=this.scanner.saveState();this.scanner.scanComments();var g=this.scanner.lex();this.scanner.restoreState(c),u=c.lineNumber===g.lineNumber&&g.type===4&&g.value==="function"}return u},_.prototype.parseFunctionDeclaration=function(u){var c=this.createNode(),g=this.matchContextualKeyword("async");g&&this.nextToken(),this.expectKeyword("function");var y=g?!1:this.match("*");y&&this.nextToken();var T,w=null,R=null;if(!u||!this.match("(")){var M=this.lookahead;w=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(M.value)&&this.tolerateUnexpectedToken(M,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(M.value)?(R=M,T=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(M.value)&&(R=M,T=o.Messages.StrictReservedWord)}var J=this.context.await,W=this.context.allowYield;this.context.await=g,this.context.allowYield=!y;var j=this.parseFormalParameters(R),ot=j.params,st=j.stricted;R=j.firstRestricted,j.message&&(T=j.message);var kt=this.context.strict,gt=this.context.allowStrictDirective;this.context.allowStrictDirective=j.simple;var qt=this.parseFunctionSourceElements();return this.context.strict&&R&&this.throwUnexpectedToken(R,T),this.context.strict&&st&&this.tolerateUnexpectedToken(st,T),this.context.strict=kt,this.context.allowStrictDirective=gt,this.context.await=J,this.context.allowYield=W,g?this.finalize(c,new h.AsyncFunctionDeclaration(w,ot,qt)):this.finalize(c,new h.FunctionDeclaration(w,ot,qt,y))},_.prototype.parseFunctionExpression=function(){var u=this.createNode(),c=this.matchContextualKeyword("async");c&&this.nextToken(),this.expectKeyword("function");var g=c?!1:this.match("*");g&&this.nextToken();var y,T=null,w,R=this.context.await,M=this.context.allowYield;if(this.context.await=c,this.context.allowYield=!g,!this.match("(")){var J=this.lookahead;T=!this.context.strict&&!g&&this.matchKeyword("yield")?this.parseIdentifierName():this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(J.value)&&this.tolerateUnexpectedToken(J,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(J.value)?(w=J,y=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(J.value)&&(w=J,y=o.Messages.StrictReservedWord)}var W=this.parseFormalParameters(w),j=W.params,ot=W.stricted;w=W.firstRestricted,W.message&&(y=W.message);var st=this.context.strict,kt=this.context.allowStrictDirective;this.context.allowStrictDirective=W.simple;var gt=this.parseFunctionSourceElements();return this.context.strict&&w&&this.throwUnexpectedToken(w,y),this.context.strict&&ot&&this.tolerateUnexpectedToken(ot,y),this.context.strict=st,this.context.allowStrictDirective=kt,this.context.await=R,this.context.allowYield=M,c?this.finalize(u,new h.AsyncFunctionExpression(T,j,gt)):this.finalize(u,new h.FunctionExpression(T,j,gt,g))},_.prototype.parseDirective=function(){var u=this.lookahead,c=this.createNode(),g=this.parseExpression(),y=g.type===p.Syntax.Literal?this.getTokenRaw(u).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(c,y?new h.Directive(g,y):new h.ExpressionStatement(g))},_.prototype.parseDirectivePrologues=function(){for(var u=null,c=[];;){var g=this.lookahead;if(g.type!==8)break;var y=this.parseDirective();c.push(y);var T=y.directive;if(typeof T!="string")break;T==="use strict"?(this.context.strict=!0,u&&this.tolerateUnexpectedToken(u,o.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(g,o.Messages.IllegalLanguageModeDirective)):!u&&g.octal&&(u=g)}return c},_.prototype.qualifiedPropertyName=function(u){switch(u.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return u.value==="[";default:break}return!1},_.prototype.parseGetterMethod=function(){var u=this.createNode(),c=!1,g=this.context.allowYield;this.context.allowYield=!c;var y=this.parseFormalParameters();y.params.length>0&&this.tolerateError(o.Messages.BadGetterArity);var T=this.parsePropertyMethod(y);return this.context.allowYield=g,this.finalize(u,new h.FunctionExpression(null,y.params,T,c))},_.prototype.parseSetterMethod=function(){var u=this.createNode(),c=!1,g=this.context.allowYield;this.context.allowYield=!c;var y=this.parseFormalParameters();y.params.length!==1?this.tolerateError(o.Messages.BadSetterArity):y.params[0]instanceof h.RestElement&&this.tolerateError(o.Messages.BadSetterRestParameter);var T=this.parsePropertyMethod(y);return this.context.allowYield=g,this.finalize(u,new h.FunctionExpression(null,y.params,T,c))},_.prototype.parseGeneratorMethod=function(){var u=this.createNode(),c=!0,g=this.context.allowYield;this.context.allowYield=!0;var y=this.parseFormalParameters();this.context.allowYield=!1;var T=this.parsePropertyMethod(y);return this.context.allowYield=g,this.finalize(u,new h.FunctionExpression(null,y.params,T,c))},_.prototype.isStartOfExpression=function(){var u=!0,c=this.lookahead.value;switch(this.lookahead.type){case 7:u=c==="["||c==="("||c==="{"||c==="+"||c==="-"||c==="!"||c==="~"||c==="++"||c==="--"||c==="/"||c==="/=";break;case 4:u=c==="class"||c==="delete"||c==="function"||c==="let"||c==="new"||c==="super"||c==="this"||c==="typeof"||c==="void"||c==="yield";break;default:break}return u},_.prototype.parseYieldExpression=function(){var u=this.createNode();this.expectKeyword("yield");var c=null,g=!1;if(!this.hasLineTerminator){var y=this.context.allowYield;this.context.allowYield=!1,g=this.match("*"),g?(this.nextToken(),c=this.parseAssignmentExpression()):this.isStartOfExpression()&&(c=this.parseAssignmentExpression()),this.context.allowYield=y}return this.finalize(u,new h.YieldExpression(c,g))},_.prototype.parseClassElement=function(u){var c=this.lookahead,g=this.createNode(),y="",T=null,w=null,R=!1,M=!1,J=!1,W=!1;if(this.match("*"))this.nextToken();else{R=this.match("["),T=this.parseObjectPropertyKey();var j=T;if(j.name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(c=this.lookahead,J=!0,R=this.match("["),this.match("*")?this.nextToken():T=this.parseObjectPropertyKey()),c.type===3&&!this.hasLineTerminator&&c.value==="async"){var ot=this.lookahead.value;ot!==":"&&ot!=="("&&ot!=="*"&&(W=!0,c=this.lookahead,T=this.parseObjectPropertyKey(),c.type===3&&c.value==="constructor"&&this.tolerateUnexpectedToken(c,o.Messages.ConstructorIsAsync))}}var st=this.qualifiedPropertyName(this.lookahead);return c.type===3?c.value==="get"&&st?(y="get",R=this.match("["),T=this.parseObjectPropertyKey(),this.context.allowYield=!1,w=this.parseGetterMethod()):c.value==="set"&&st&&(y="set",R=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseSetterMethod()):c.type===7&&c.value==="*"&&st&&(y="init",R=this.match("["),T=this.parseObjectPropertyKey(),w=this.parseGeneratorMethod(),M=!0),!y&&T&&this.match("(")&&(y="init",w=W?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),M=!0),y||this.throwUnexpectedToken(this.lookahead),y==="init"&&(y="method"),R||(J&&this.isPropertyKey(T,"prototype")&&this.throwUnexpectedToken(c,o.Messages.StaticPrototype),!J&&this.isPropertyKey(T,"constructor")&&((y!=="method"||!M||w&&w.generator)&&this.throwUnexpectedToken(c,o.Messages.ConstructorSpecialMethod),u.value?this.throwUnexpectedToken(c,o.Messages.DuplicateConstructor):u.value=!0,y="constructor")),this.finalize(g,new h.MethodDefinition(T,R,w,y,J))},_.prototype.parseClassElementList=function(){var u=[],c={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():u.push(this.parseClassElement(c));return this.expect("}"),u},_.prototype.parseClassBody=function(){var u=this.createNode(),c=this.parseClassElementList();return this.finalize(u,new h.ClassBody(c))},_.prototype.parseClassDeclaration=function(u){var c=this.createNode(),g=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var y=u&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),T=null;this.matchKeyword("extends")&&(this.nextToken(),T=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var w=this.parseClassBody();return this.context.strict=g,this.finalize(c,new h.ClassDeclaration(y,T,w))},_.prototype.parseClassExpression=function(){var u=this.createNode(),c=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var g=this.lookahead.type===3?this.parseVariableIdentifier():null,y=null;this.matchKeyword("extends")&&(this.nextToken(),y=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var T=this.parseClassBody();return this.context.strict=c,this.finalize(u,new h.ClassExpression(g,y,T))},_.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var u=this.createNode(),c=this.parseDirectivePrologues();this.lookahead.type!==2;)c.push(this.parseStatementListItem());return this.finalize(u,new h.Module(c))},_.prototype.parseScript=function(){for(var u=this.createNode(),c=this.parseDirectivePrologues();this.lookahead.type!==2;)c.push(this.parseStatementListItem());return this.finalize(u,new h.Script(c))},_.prototype.parseModuleSpecifier=function(){var u=this.createNode();this.lookahead.type!==8&&this.throwError(o.Messages.InvalidModuleSpecifier);var c=this.nextToken(),g=this.getTokenRaw(c);return this.finalize(u,new h.Literal(c.value,g))},_.prototype.parseImportSpecifier=function(){var u=this.createNode(),c,g;return this.lookahead.type===3?(c=this.parseVariableIdentifier(),g=c,this.matchContextualKeyword("as")&&(this.nextToken(),g=this.parseVariableIdentifier())):(c=this.parseIdentifierName(),g=c,this.matchContextualKeyword("as")?(this.nextToken(),g=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(u,new h.ImportSpecifier(g,c))},_.prototype.parseNamedImports=function(){this.expect("{");for(var u=[];!this.match("}");)u.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),u},_.prototype.parseImportDefaultSpecifier=function(){var u=this.createNode(),c=this.parseIdentifierName();return this.finalize(u,new h.ImportDefaultSpecifier(c))},_.prototype.parseImportNamespaceSpecifier=function(){var u=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(o.Messages.NoAsAfterImportNamespace),this.nextToken();var c=this.parseIdentifierName();return this.finalize(u,new h.ImportNamespaceSpecifier(c))},_.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalImportDeclaration);var u=this.createNode();this.expectKeyword("import");var c,g=[];if(this.lookahead.type===8)c=this.parseModuleSpecifier();else{if(this.match("{")?g=g.concat(this.parseNamedImports()):this.match("*")?g.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(g.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?g.push(this.parseImportNamespaceSpecifier()):this.match("{")?g=g.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var y=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}this.nextToken(),c=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(u,new h.ImportDeclaration(g,c))},_.prototype.parseExportSpecifier=function(){var u=this.createNode(),c=this.parseIdentifierName(),g=c;return this.matchContextualKeyword("as")&&(this.nextToken(),g=this.parseIdentifierName()),this.finalize(u,new h.ExportSpecifier(c,g))},_.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalExportDeclaration);var u=this.createNode();this.expectKeyword("export");var c;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var g=this.parseFunctionDeclaration(!0);c=this.finalize(u,new h.ExportDefaultDeclaration(g))}else if(this.matchKeyword("class")){var g=this.parseClassDeclaration(!0);c=this.finalize(u,new h.ExportDefaultDeclaration(g))}else if(this.matchContextualKeyword("async")){var g=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();c=this.finalize(u,new h.ExportDefaultDeclaration(g))}else{this.matchContextualKeyword("from")&&this.throwError(o.Messages.UnexpectedToken,this.lookahead.value);var g=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),c=this.finalize(u,new h.ExportDefaultDeclaration(g))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var y=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}this.nextToken();var T=this.parseModuleSpecifier();this.consumeSemicolon(),c=this.finalize(u,new h.ExportAllDeclaration(T))}else if(this.lookahead.type===4){var g=void 0;switch(this.lookahead.value){case"let":case"const":g=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":g=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}c=this.finalize(u,new h.ExportNamedDeclaration(g,[],null))}else if(this.matchAsyncFunction()){var g=this.parseFunctionDeclaration();c=this.finalize(u,new h.ExportNamedDeclaration(g,[],null))}else{var w=[],R=null,M=!1;for(this.expect("{");!this.match("}");)M=M||this.matchKeyword("default"),w.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),R=this.parseModuleSpecifier(),this.consumeSemicolon();else if(M){var y=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}else this.consumeSemicolon();c=this.finalize(u,new h.ExportNamedDeclaration(null,w,R))}return c},_}();t.Parser=x},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(i,r){if(!i)throw new Error("ASSERT: "+r)}t.assert=e},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=function(){function i(){this.errors=[],this.tolerant=!1}return i.prototype.recordError=function(r){this.errors.push(r)},i.prototype.tolerate=function(r){if(this.tolerant)this.recordError(r);else throw r},i.prototype.constructError=function(r,o){var h=new Error(r);try{throw h}catch(f){Object.create&&Object.defineProperty&&(h=Object.create(f),Object.defineProperty(h,"column",{value:o}))}return h},i.prototype.createError=function(r,o,h,f){var p="Line "+o+": "+f,E=this.constructError(p,h);return E.index=r,E.lineNumber=o,E.description=f,E},i.prototype.throwError=function(r,o,h,f){throw this.createError(r,o,h,f)},i.prototype.tolerateError=function(r,o,h,f){var p=this.createError(r,o,h,f);if(this.tolerant)this.recordError(p);else throw p},i}();t.ErrorHandler=e},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(9),r=e(4),o=e(11);function h(E){return"0123456789abcdef".indexOf(E.toLowerCase())}function f(E){return"01234567".indexOf(E)}var p=function(){function E(d,x){this.source=d,this.errorHandler=x,this.trackComment=!1,this.isModule=!1,this.length=d.length,this.index=0,this.lineNumber=d.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return E.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},E.prototype.restoreState=function(d){this.index=d.index,this.lineNumber=d.lineNumber,this.lineStart=d.lineStart},E.prototype.eof=function(){return this.index>=this.length},E.prototype.throwUnexpectedToken=function(d){return d===void 0&&(d=o.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,d)},E.prototype.tolerateUnexpectedToken=function(d){d===void 0&&(d=o.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,d)},E.prototype.skipSingleLineComment=function(d){var x=[],_,u;for(this.trackComment&&(x=[],_=this.index-d,u={start:{line:this.lineNumber,column:this.index-this.lineStart-d},end:{}});!this.eof();){var c=this.source.charCodeAt(this.index);if(++this.index,r.Character.isLineTerminator(c)){if(this.trackComment){u.end={line:this.lineNumber,column:this.index-this.lineStart-1};var g={multiLine:!1,slice:[_+d,this.index-1],range:[_,this.index-1],loc:u};x.push(g)}return c===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,x}}if(this.trackComment){u.end={line:this.lineNumber,column:this.index-this.lineStart};var g={multiLine:!1,slice:[_+d,this.index],range:[_,this.index],loc:u};x.push(g)}return x},E.prototype.skipMultiLineComment=function(){var d=[],x,_;for(this.trackComment&&(d=[],x=this.index-2,_={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var u=this.source.charCodeAt(this.index);if(r.Character.isLineTerminator(u))u===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(u===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){_.end={line:this.lineNumber,column:this.index-this.lineStart};var c={multiLine:!0,slice:[x+2,this.index-2],range:[x,this.index],loc:_};d.push(c)}return d}++this.index}else++this.index}if(this.trackComment){_.end={line:this.lineNumber,column:this.index-this.lineStart};var c={multiLine:!0,slice:[x+2,this.index],range:[x,this.index],loc:_};d.push(c)}return this.tolerateUnexpectedToken(),d},E.prototype.scanComments=function(){var d;this.trackComment&&(d=[]);for(var x=this.index===0;!this.eof();){var _=this.source.charCodeAt(this.index);if(r.Character.isWhiteSpace(_))++this.index;else if(r.Character.isLineTerminator(_))++this.index,_===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,x=!0;else if(_===47)if(_=this.source.charCodeAt(this.index+1),_===47){this.index+=2;var u=this.skipSingleLineComment(2);this.trackComment&&(d=d.concat(u)),x=!0}else if(_===42){this.index+=2;var u=this.skipMultiLineComment();this.trackComment&&(d=d.concat(u))}else break;else if(x&&_===45)if(this.source.charCodeAt(this.index+1)===45&&this.source.charCodeAt(this.index+2)===62){this.index+=3;var u=this.skipSingleLineComment(3);this.trackComment&&(d=d.concat(u))}else break;else if(_===60&&!this.isModule)if(this.source.slice(this.index+1,this.index+4)==="!--"){this.index+=4;var u=this.skipSingleLineComment(4);this.trackComment&&(d=d.concat(u))}else break;else break}return d},E.prototype.isFutureReservedWord=function(d){switch(d){case"enum":case"export":case"import":case"super":return!0;default:return!1}},E.prototype.isStrictModeReservedWord=function(d){switch(d){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},E.prototype.isRestrictedWord=function(d){return d==="eval"||d==="arguments"},E.prototype.isKeyword=function(d){switch(d.length){case 2:return d==="if"||d==="in"||d==="do";case 3:return d==="var"||d==="for"||d==="new"||d==="try"||d==="let";case 4:return d==="this"||d==="else"||d==="case"||d==="void"||d==="with"||d==="enum";case 5:return d==="while"||d==="break"||d==="catch"||d==="throw"||d==="const"||d==="yield"||d==="class"||d==="super";case 6:return d==="return"||d==="typeof"||d==="delete"||d==="switch"||d==="export"||d==="import";case 7:return d==="default"||d==="finally"||d==="extends";case 8:return d==="function"||d==="continue"||d==="debugger";case 10:return d==="instanceof";default:return!1}},E.prototype.codePointAt=function(d){var x=this.source.charCodeAt(d);if(x>=55296&&x<=56319){var _=this.source.charCodeAt(d+1);if(_>=56320&&_<=57343){var u=x;x=(u-55296)*1024+_-56320+65536}}return x},E.prototype.scanHexEscape=function(d){for(var x=d==="u"?4:2,_=0,u=0;u<x;++u)if(!this.eof()&&r.Character.isHexDigit(this.source.charCodeAt(this.index)))_=_*16+h(this.source[this.index++]);else return null;return String.fromCharCode(_)},E.prototype.scanUnicodeCodePointEscape=function(){var d=this.source[this.index],x=0;for(d==="}"&&this.throwUnexpectedToken();!this.eof()&&(d=this.source[this.index++],!!r.Character.isHexDigit(d.charCodeAt(0)));)x=x*16+h(d);return(x>1114111||d!=="}")&&this.throwUnexpectedToken(),r.Character.fromCodePoint(x)},E.prototype.getIdentifier=function(){for(var d=this.index++;!this.eof();){var x=this.source.charCodeAt(this.index);if(x===92)return this.index=d,this.getComplexIdentifier();if(x>=55296&&x<57343)return this.index=d,this.getComplexIdentifier();if(r.Character.isIdentifierPart(x))++this.index;else break}return this.source.slice(d,this.index)},E.prototype.getComplexIdentifier=function(){var d=this.codePointAt(this.index),x=r.Character.fromCodePoint(d);this.index+=x.length;var _;for(d===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,_=this.scanUnicodeCodePointEscape()):(_=this.scanHexEscape("u"),(_===null||_==="\\"||!r.Character.isIdentifierStart(_.charCodeAt(0)))&&this.throwUnexpectedToken()),x=_);!this.eof()&&(d=this.codePointAt(this.index),!!r.Character.isIdentifierPart(d));)_=r.Character.fromCodePoint(d),x+=_,this.index+=_.length,d===92&&(x=x.substr(0,x.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,_=this.scanUnicodeCodePointEscape()):(_=this.scanHexEscape("u"),(_===null||_==="\\"||!r.Character.isIdentifierPart(_.charCodeAt(0)))&&this.throwUnexpectedToken()),x+=_);return x},E.prototype.octalToDecimal=function(d){var x=d!=="0",_=f(d);return!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(x=!0,_=_*8+f(this.source[this.index++]),"0123".indexOf(d)>=0&&!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(_=_*8+f(this.source[this.index++]))),{code:_,octal:x}},E.prototype.scanIdentifier=function(){var d,x=this.index,_=this.source.charCodeAt(x)===92?this.getComplexIdentifier():this.getIdentifier();if(_.length===1?d=3:this.isKeyword(_)?d=4:_==="null"?d=5:_==="true"||_==="false"?d=1:d=3,d!==3&&x+_.length!==this.index){var u=this.index;this.index=x,this.tolerateUnexpectedToken(o.Messages.InvalidEscapedReservedWord),this.index=u}return{type:d,value:_,lineNumber:this.lineNumber,lineStart:this.lineStart,start:x,end:this.index}},E.prototype.scanPunctuator=function(){var d=this.index,x=this.source[this.index];switch(x){case"(":case"{":x==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,x="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:x=this.source.substr(this.index,4),x===">>>="?this.index+=4:(x=x.substr(0,3),x==="==="||x==="!=="||x===">>>"||x==="<<="||x===">>="||x==="**="?this.index+=3:(x=x.substr(0,2),x==="&&"||x==="||"||x==="=="||x==="!="||x==="+="||x==="-="||x==="*="||x==="/="||x==="++"||x==="--"||x==="<<"||x===">>"||x==="&="||x==="|="||x==="^="||x==="%="||x==="<="||x===">="||x==="=>"||x==="**"?this.index+=2:(x=this.source[this.index],"<>=!+-*%&|^/".indexOf(x)>=0&&++this.index)))}return this.index===d&&this.throwUnexpectedToken(),{type:7,value:x,lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},E.prototype.scanHexLiteral=function(d){for(var x="";!this.eof()&&r.Character.isHexDigit(this.source.charCodeAt(this.index));)x+=this.source[this.index++];return x.length===0&&this.throwUnexpectedToken(),r.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+x,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},E.prototype.scanBinaryLiteral=function(d){for(var x="",_;!this.eof()&&(_=this.source[this.index],!(_!=="0"&&_!=="1"));)x+=this.source[this.index++];return x.length===0&&this.throwUnexpectedToken(),this.eof()||(_=this.source.charCodeAt(this.index),(r.Character.isIdentifierStart(_)||r.Character.isDecimalDigit(_))&&this.throwUnexpectedToken()),{type:6,value:parseInt(x,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},E.prototype.scanOctalLiteral=function(d,x){var _="",u=!1;for(r.Character.isOctalDigit(d.charCodeAt(0))?(u=!0,_="0"+this.source[this.index++]):++this.index;!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index));)_+=this.source[this.index++];return!u&&_.length===0&&this.throwUnexpectedToken(),(r.Character.isIdentifierStart(this.source.charCodeAt(this.index))||r.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(_,8),octal:u,lineNumber:this.lineNumber,lineStart:this.lineStart,start:x,end:this.index}},E.prototype.isImplicitOctalLiteral=function(){for(var d=this.index+1;d<this.length;++d){var x=this.source[d];if(x==="8"||x==="9")return!1;if(!r.Character.isOctalDigit(x.charCodeAt(0)))return!0}return!0},E.prototype.scanNumericLiteral=function(){var d=this.index,x=this.source[d];i.assert(r.Character.isDecimalDigit(x.charCodeAt(0))||x===".","Numeric literal must start with a decimal digit or a decimal point");var _="";if(x!=="."){if(_=this.source[this.index++],x=this.source[this.index],_==="0"){if(x==="x"||x==="X")return++this.index,this.scanHexLiteral(d);if(x==="b"||x==="B")return++this.index,this.scanBinaryLiteral(d);if(x==="o"||x==="O")return this.scanOctalLiteral(x,d);if(x&&r.Character.isOctalDigit(x.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(x,d)}for(;r.Character.isDecimalDigit(this.source.charCodeAt(this.index));)_+=this.source[this.index++];x=this.source[this.index]}if(x==="."){for(_+=this.source[this.index++];r.Character.isDecimalDigit(this.source.charCodeAt(this.index));)_+=this.source[this.index++];x=this.source[this.index]}if(x==="e"||x==="E")if(_+=this.source[this.index++],x=this.source[this.index],(x==="+"||x==="-")&&(_+=this.source[this.index++]),r.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;r.Character.isDecimalDigit(this.source.charCodeAt(this.index));)_+=this.source[this.index++];else this.throwUnexpectedToken();return r.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(_),lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},E.prototype.scanStringLiteral=function(){var d=this.index,x=this.source[d];i.assert(x==="'"||x==='"',"String literal must starts with a quote"),++this.index;for(var _=!1,u="";!this.eof();){var c=this.source[this.index++];if(c===x){x="";break}else if(c==="\\")if(c=this.source[this.index++],!c||!r.Character.isLineTerminator(c.charCodeAt(0)))switch(c){case"u":if(this.source[this.index]==="{")++this.index,u+=this.scanUnicodeCodePointEscape();else{var g=this.scanHexEscape(c);g===null&&this.throwUnexpectedToken(),u+=g}break;case"x":var y=this.scanHexEscape(c);y===null&&this.throwUnexpectedToken(o.Messages.InvalidHexEscapeSequence),u+=y;break;case"n":u+=`
`;break;case"r":u+="\r";break;case"t":u+=" ";break;case"b":u+="\b";break;case"f":u+="\f";break;case"v":u+="\v";break;case"8":case"9":u+=c,this.tolerateUnexpectedToken();break;default:if(c&&r.Character.isOctalDigit(c.charCodeAt(0))){var T=this.octalToDecimal(c);_=T.octal||_,u+=String.fromCharCode(T.code)}else u+=c;break}else++this.lineNumber,c==="\r"&&this.source[this.index]===`
`&&++this.index,this.lineStart=this.index;else{if(r.Character.isLineTerminator(c.charCodeAt(0)))break;u+=c}}return x!==""&&(this.index=d,this.throwUnexpectedToken()),{type:8,value:u,octal:_,lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},E.prototype.scanTemplate=function(){var d="",x=!1,_=this.index,u=this.source[_]==="`",c=!1,g=2;for(++this.index;!this.eof();){var y=this.source[this.index++];if(y==="`"){g=1,c=!0,x=!0;break}else if(y==="$"){if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,x=!0;break}d+=y}else if(y==="\\")if(y=this.source[this.index++],r.Character.isLineTerminator(y.charCodeAt(0)))++this.lineNumber,y==="\r"&&this.source[this.index]===`
`&&++this.index,this.lineStart=this.index;else switch(y){case"n":d+=`
`;break;case"r":d+="\r";break;case"t":d+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,d+=this.scanUnicodeCodePointEscape();else{var T=this.index,w=this.scanHexEscape(y);w!==null?d+=w:(this.index=T,d+=y)}break;case"x":var R=this.scanHexEscape(y);R===null&&this.throwUnexpectedToken(o.Messages.InvalidHexEscapeSequence),d+=R;break;case"b":d+="\b";break;case"f":d+="\f";break;case"v":d+="\v";break;default:y==="0"?(r.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(o.Messages.TemplateOctalLiteral),d+="\0"):r.Character.isOctalDigit(y.charCodeAt(0))?this.throwUnexpectedToken(o.Messages.TemplateOctalLiteral):d+=y;break}else r.Character.isLineTerminator(y.charCodeAt(0))?(++this.lineNumber,y==="\r"&&this.source[this.index]===`
`&&++this.index,this.lineStart=this.index,d+=`
`):d+=y}return x||this.throwUnexpectedToken(),u||this.curlyStack.pop(),{type:10,value:this.source.slice(_+1,this.index-g),cooked:d,head:u,tail:c,lineNumber:this.lineNumber,lineStart:this.lineStart,start:_,end:this.index}},E.prototype.testRegExp=function(d,x){var _="\uFFFF",u=d,c=this;x.indexOf("u")>=0&&(u=u.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(g,y,T){var w=parseInt(y||T,16);return w>1114111&&c.throwUnexpectedToken(o.Messages.InvalidRegExp),w<=65535?String.fromCharCode(w):_}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_));try{RegExp(u)}catch{this.throwUnexpectedToken(o.Messages.InvalidRegExp)}try{return new RegExp(d,x)}catch{return null}},E.prototype.scanRegExpBody=function(){var d=this.source[this.index];i.assert(d==="/","Regular expression literal must start with a slash");for(var x=this.source[this.index++],_=!1,u=!1;!this.eof();)if(d=this.source[this.index++],x+=d,d==="\\")d=this.source[this.index++],r.Character.isLineTerminator(d.charCodeAt(0))&&this.throwUnexpectedToken(o.Messages.UnterminatedRegExp),x+=d;else if(r.Character.isLineTerminator(d.charCodeAt(0)))this.throwUnexpectedToken(o.Messages.UnterminatedRegExp);else if(_)d==="]"&&(_=!1);else if(d==="/"){u=!0;break}else d==="["&&(_=!0);return u||this.throwUnexpectedToken(o.Messages.UnterminatedRegExp),x.substr(1,x.length-2)},E.prototype.scanRegExpFlags=function(){for(var d="",x="";!this.eof();){var _=this.source[this.index];if(!r.Character.isIdentifierPart(_.charCodeAt(0)))break;if(++this.index,_==="\\"&&!this.eof())if(_=this.source[this.index],_==="u"){++this.index;var u=this.index,c=this.scanHexEscape("u");if(c!==null)for(x+=c,d+="\\u";u<this.index;++u)d+=this.source[u];else this.index=u,x+="u",d+="\\u";this.tolerateUnexpectedToken()}else d+="\\",this.tolerateUnexpectedToken();else x+=_,d+=_}return x},E.prototype.scanRegExp=function(){var d=this.index,x=this.scanRegExpBody(),_=this.scanRegExpFlags(),u=this.testRegExp(x,_);return{type:9,value:"",pattern:x,flags:_,regex:u,lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},E.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var d=this.source.charCodeAt(this.index);return r.Character.isIdentifierStart(d)?this.scanIdentifier():d===40||d===41||d===59?this.scanPunctuator():d===39||d===34?this.scanStringLiteral():d===46?r.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():r.Character.isDecimalDigit(d)?this.scanNumericLiteral():d===96||d===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():d>=55296&&d<57343&&r.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},E}();t.Scanner=p},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="<end>",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e(10),r=e(12),o=e(13),h=function(){function p(){this.values=[],this.curly=this.paren=-1}return p.prototype.beforeFunctionExpression=function(E){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(E)>=0},p.prototype.isRegexStart=function(){var E=this.values[this.values.length-1],d=E!==null;switch(E){case"this":case"]":d=!1;break;case")":var x=this.values[this.paren-1];d=x==="if"||x==="while"||x==="for"||x==="with";break;case"}":if(d=!1,this.values[this.curly-3]==="function"){var _=this.values[this.curly-4];d=_?!this.beforeFunctionExpression(_):!1}else if(this.values[this.curly-4]==="function"){var _=this.values[this.curly-5];d=_?!this.beforeFunctionExpression(_):!0}break;default:break}return d},p.prototype.push=function(E){E.type===7||E.type===4?(E.value==="{"?this.curly=this.values.length:E.value==="("&&(this.paren=this.values.length),this.values.push(E.value)):this.values.push(null)},p}(),f=function(){function p(E,d){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=d?typeof d.tolerant=="boolean"&&d.tolerant:!1,this.scanner=new r.Scanner(E,this.errorHandler),this.scanner.trackComment=d?typeof d.comment=="boolean"&&d.comment:!1,this.trackRange=d?typeof d.range=="boolean"&&d.range:!1,this.trackLoc=d?typeof d.loc=="boolean"&&d.loc:!1,this.buffer=[],this.reader=new h}return p.prototype.errors=function(){return this.errorHandler.errors},p.prototype.getNextToken=function(){if(this.buffer.length===0){var E=this.scanner.scanComments();if(this.scanner.trackComment)for(var d=0;d<E.length;++d){var x=E[d],_=this.scanner.source.slice(x.slice[0],x.slice[1]),u={type:x.multiLine?"BlockComment":"LineComment",value:_};this.trackRange&&(u.range=x.range),this.trackLoc&&(u.loc=x.loc),this.buffer.push(u)}if(!this.scanner.eof()){var c=void 0;this.trackLoc&&(c={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var g=this.scanner.source[this.scanner.index]==="/"&&this.reader.isRegexStart(),y=g?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(y);var T={type:o.TokenName[y.type],value:this.scanner.source.slice(y.start,y.end)};if(this.trackRange&&(T.range=[y.start,y.end]),this.trackLoc&&(c.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},T.loc=c),y.type===9){var w=y.pattern,R=y.flags;T.regex={pattern:w,flags:R}}this.buffer.push(T)}}return this.buffer.shift()},p}();t.Tokenizer=f}])})});var C0=[" ",`
`,"\r"," ","\f","\v","\xA0","\u2000","\u2001","\u2002","\u2003","\u2004","\u2005","\u2006","\u2007","\u2008","\u2009","\u200A","\u200B","\u2028","\u2029","\u3000"].join("");function Tc(n){return(typeof n=="number"||typeof n=="string"&&C0.indexOf(n.slice(-1))===-1)&&n!==""&&!isNaN(n)}var F=class{static normalizeLineEndings(t,e=`
`){return t.replace(/\r?\n/g,e)}static split(t){return t.split("")}static substring(t,e,i){return t.substr(e,i)}static ctypeSpace(t){return t?.search(/^[\f\n\r\t\v ]+$/g)!==-1}static ctypeAlpha(t){return t?.search(/^[A-Za-z]+$/g)!==-1}static ctypeDigit(t){return t?.search(/^[\d]+$/g)!==-1}static ctypePunct(t){return t?.search(/^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g)!==-1}static trimLeft(t,e="\\s"){return t.replace(new RegExp("^["+e+"]+"),"")}static trimRight(t,e="\\s"){return t.replace(new RegExp("["+e+"]+$"),"")}static isNumeric(t){return Tc(t)}static substringCount(t,e){let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(t.match(new RegExp(i,"gi"))||[]).length}static lastWord(t){let e=t.split(""),i=[];for(let r=e.length;r>=0&&e[r]!=" ";r--)i.push(e[r]);return i.reverse().join()}static breakByNewLine(t){return t.replace(/(\r\n|\n|\r)/gm,`
`).split(`
`)}static removeEmptyNewLines(t){let e=[];return F.breakByNewLine(F.normalizeLineEndings(t)).forEach(r=>{r.trim().length>0&&e.push(r)}),e.join(`
`)}static replaceAllInString(t,e,i){return t.replace(new RegExp(e,"g"),i)}static getTrimmedMatch(t,e,i){let r=t.exec(e);if(r==null||r.length<i)return null;let o=r[i].trim();return o.length==0?null:o}static assertMatchIs(t,e,i,r){let o=F.getTrimmedMatch(t,e,i);return o!=null&&o==r}static truncateString(t,e){return t.length<=e?t:t.slice(0,e)+"..."}static unwrapString(t){let e=t.substring(1);return e.substring(0,e.length-1)}static getLastLine(t){let e=F.breakByNewLine(t);return e.length==0?"":e[e.length-1]}static getFirstLine(t){let e=F.breakByNewLine(t);return e.length==0?"":e[0]}static collapse(t){let e=F.breakByNewLine(t),i="";for(let r=0;r<e.length;r++){let o=e[r].trim();if(r+1<e.length){let h=e[r+1].trim();if(h.length>0&&F.ctypePunct(h[0])){let f=h[0];i+=o,(f=="?"||f==":"||f=="&")&&(i+=" ")}else i+=o+" "}else i+=o}return i.trimRight()}static makeSlug(t){t<=2&&(t=7);let e="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=i.length;for(let o=0;o<t-1;o++)e+=i.charAt(Math.floor(Math.random()*r));return"B"+e+"B"}static replaceWithFillerExceptNewlines(t){return t.replace(/./g,i=>i===`
`?i:"P")}static safeReplaceAllInString(t,e,i){let r=new RegExp(e,"g");return t.split(r).join(i)}static safeReplace(t,e,i){return t.split(e).join(i)}};function Ee(n){return n==null?!1:n=='"'||n=="'"||n=="`"}function Yn(n){let t=n.getCurrent();for(n.incrementIndex(),n.getCurrentIndex();n.getCurrentIndex()<n.inputLength()&&(n.checkCurrentOffsets(),!(n.getCurrent()==t&&n.getPrev()!=rt.String_EscapeCharacter));n.incrementIndex());}function qe(n){let t=n.getCurrent(),e=[];for(n.incrementIndex(),n.getCurrentIndex();n.getCurrentIndex()<n.inputLength()&&(n.checkCurrentOffsets(),!(n.getCurrent()==t&&n.getPrev()!=rt.String_EscapeCharacter));n.incrementIndex())e.push(n.getCurrent());return{value:e.join(""),endedOn:n.getCurrentIndex()}}var Zi=class{constructor(){this.chars=[];this.cur=null;this.prev=null;this.next=null;this.currentIndex=0;this.inputLen=0;this.currentContent=[];this.strings=[]}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}getCurrentIndex(){return this.currentIndex}incrementIndex(){this.currentIndex+=1}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}pushChar(t){this.currentContent.push(t)}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return""}static fromText(t){return new Zi().remove(t)}getStrings(){return this.strings}remove(t){for(this.strings=[],this.chars=t.split(""),this.inputLen=this.chars.length,this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),Ee(this.cur)){let i=qe(this);if(this.strings.push(i.value),this.currentIndex=i.endedOn,this.currentIndex==this.inputLen-1)break;continue}this.currentContent.push(this.cur)}let e=[];for(let i=0;i<this.currentContent.length;i++){let r=this.currentContent[i];if(i==0&&r=="@"){e.push(r);continue}if(r!="."&&F.ctypePunct(r))break;e.push(r)}return e.join("")}};var tn=ps(Vc(),1),Xb=tn.default.v1,jb=tn.default.v3,Gc=tn.default.v4,Kb=tn.default.v5,Qb=tn.default.NIL,$b=tn.default.version,Zb=tn.default.validate,tS=tn.default.stringify,eS=tn.default.parse;function ze(n,t){for(n.getCurrentIndex();n.getCurrentIndex()<n.inputLength()&&(n.checkCurrentOffsets(),t&&n.pushChar(n.getCurrent()),n.getCurrent()!=rt.NewLine);n.incrementIndex());}function Je(n,t){for(n.getCurrentIndex();n.getCurrentIndex()<n.inputLength();n.incrementIndex())if(n.checkCurrentOffsets(),t&&n.pushChar(n.getCurrent()),n.getCurrent()==rt.Punctuation_Asterisk&&n.getNext()==rt.Punctuation_ForwardSlash){t&&n.pushChar(rt.Punctuation_ForwardSlash),n.incrementIndex(),n.checkCurrentOffsets();break}}function qi(n,t="(",e=")"){let i=n.getCurrentIndex()+n.getSeedOffset(),r=n.getCurrentIndex(),o=0,h=0,f=!1;for(n.incrementIndex(),n.getCurrentIndex();n.getCurrentIndex()<n.inputLength();n.incrementIndex()){if(n.checkCurrentOffsets(),Ee(n.getCurrent())){let E=n.getCurrent(),d=n.getCurrentIndex();Yn(n),n.getNext()===null&&n.getCurrent()!==E&&(n.updateIndex(d+1),n.encounteredFailure());continue}if(n.getCurrent()==rt.Punctuation_ForwardSlash&&n.getNext()==rt.Punctuation_Asterisk){Je(n,!1);continue}if(n.getCurrent()==rt.Punctuation_ForwardSlash&&n.getNext()==rt.Punctuation_ForwardSlash){ze(n,!1);continue}if(n.getCurrent()==t){h+=1;continue}if(n.getCurrent()==e){if(h>0){h-=1;continue}o=n.getCurrentIndex()+n.getSeedOffset()+1,f=!0;break}if(n.getCurrent()==null)break}let p=n.getContentSubstring(i,o-i);return f||n.updateIndex(r-1),{start:i,end:o,content:p,foundEnd:f}}var ds=class{constructor(){this.chars=[];this.value="";this.cur=null;this.prev=null;this.next=null;this.currentIndex=0;this.inputLen=0;this.currentContent=[];this.returnStrings=[]}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}getCurrentIndex(){return this.currentIndex}incrementIndex(){this.currentIndex+=1}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}pushChar(t){this.currentContent.push(t)}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return this.value.substr(t,e)}static fromText(t){return new ds().split(t)}pushCurrentContent(){let t=this.currentContent.join("");t.trim().length>0&&this.returnStrings.push(t)}split(t){for(this.value=t,this.chars=t.split(""),this.returnStrings=[],this.inputLen=this.chars.length,this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur=="["){let e=qi(this,"[","]");this.returnStrings.push(e.content),this.currentContent=[];continue}else if(this.cur=="("){let e=qi(this,"(",")");this.returnStrings.push(e.content),this.currentContent=[];continue}else if(Ee(this.cur)){let e=qe(this);if(this.currentContent.push(this.cur),this.currentContent=this.currentContent.concat(e.value.split("")),this.currentContent.push(this.cur),this.currentIndex=e.endedOn,this.currentIndex==this.inputLen-1){this.pushCurrentContent();break}continue}if(this.cur==","||this.next==null){this.cur!=","&&this.currentContent.push(this.cur),this.pushCurrentContent(),this.currentContent=[];continue}this.currentContent.push(this.cur)}return this.returnStrings}};function qc(){return F.replaceAllInString(Gc(),"-","_")}var Xs=class{constructor(){this.startPosition=null;this.endPosition=null;this.index=0;this.embeddedIndex=0;this.refId=null;this.parameters=[];this.isSelfClosing=!1;this.isClosingFragment=!1;this.name="";this.containsStructures=!1;this.refId=qc()}},qr=class{constructor(){this.startPosition=null;this.endPosition=null}},Ce=class{constructor(){this.parser=null;this.refId=null;this.startPosition=null;this.endPosition=null;this.sourceContent="";this.index=0;this.parentIndex=-1;this.parentTypeIndex=-1;this.parent=null;this.originalAbstractNode=null;this.fragment=null;this.fragmentPosition=3;this.containsAnyFragments=!1;this.containsChildStructures=!1;this.offset=null;this.errors=[];this.isInScriptTag=!1;this.isInStyleTag=!1;this.prevNode=null;this.nextNode=null;this.refId=qc()}isPartOfHtmlTag(){return this.fragmentPosition==2||this.fragmentPosition==1||this.fragmentPosition==0}isEmbedded(){return this.isInScriptTag||this.isInStyleTag}hasNeighborsOnLine(){if(this.prevNode==null&&this.nextNode==null)return!1;if(this.prevNode==null||this.nextNode==null||!(this.prevNode instanceof Pt)||!(this.nextNode instanceof Pt))return!0;let t=this.prevNode.content,e=this.nextNode.content,i=F.breakByNewLine(t),r=F.breakByNewLine(e);return i.length>0&&i[i.length-1].trim().length>0||r.length>0&&r[0].trim().length>0}getErrors(){return this.errors}pushError(t){this.parent!=null?this.parent.pushError(t):this.parser!=null&&this.parser.pushError(t),this.errors.push(t)}relativeOffset(t){return t+(this.startPosition?.index??0)}withParser(t){return this.parser=t,this}getParser(){return this.parser}};var wn=class extends Ce{constructor(){super(...arguments);this.cachedHasValidPhp=null;this.cachedPhpLastError=null;this.name="";this.realName="";this.value="";this.terminatorStyle='"';this.wrappedValue="";this.content="";this.type=0;this.directive=null;this.inlineEcho=null;this.inlineComment=null;this.namePosition=null;this.valuePosition=null;this.isEscapedExpression=!1;this.isExpression=!1;this.overrideValue=""}hasValidPhpExpression(){if(this.cachedHasValidPhp==null){let e=this.getParser()?.getPhpValidator();e!=null?(this.cachedHasValidPhp=e.isValid(this.value,!1),this.cachedPhpLastError=e.getLastError()):this.cachedHasValidPhp=!1}return this.cachedHasValidPhp}},zr=class extends Ce{constructor(){super(...arguments);this.name="";this.inlineName=""}},Ie=class extends Ce{constructor(){super(...arguments);this.name=null;this.isClosingTag=!1;this.isSelfClosing=!1;this.innerContent="";this.parameterContent="";this.receivesAttributeBag=!1;this.hasParameters=!1;this.parameters=[];this.isOpenedBy=null;this.isClosedBy=null;this.isShorthandSlot=!1}getComponentName(){if(this.name==null)return"";let e=this.name.name.trim();return this.name.inlineName.trim().length>0&&(e+=":"+this.name.inlineName.trim()),e}hasParameter(e){for(let i=0;i<this.parameters.length;i++)if(this.parameters[i].realName==e)return!0;return!1}getParameter(e){for(let i=0;i<this.parameters.length;i++)if(this.parameters[i].realName==e)return this.parameters[i];return null}getParametersExcept(e){return this.parameters.filter(i=>!e.includes(i.realName))}},Pt=class extends Ce{constructor(){super(...arguments);this.content=""}getOutputContent(){let e=F.replaceAllInString(this.content,"@{","{");return e=F.replaceAllInString(e,"@@","@"),e}},pi=class extends Ce{constructor(){super(...arguments);this.innerContentPosition=null;this.innerContent=""}isMultiline(){return this.sourceContent.includes(`
`)}},Fe=class extends Ce{constructor(){super(...arguments);this.cachedHasValidPhp=null;this.cachedPhpLastError=null;this.isInline=!1;this.overrideContent=null}hasValidPhp(){if(this.cachedHasValidPhp==null){let e=this.getParser()?.getPhpValidator();e!=null?(this.cachedHasValidPhp=e.isValid(this.sourceContent,!1),this.cachedPhpLastError=e.getLastError()):this.cachedHasValidPhp=!1}return this.cachedHasValidPhp}getPhpError(){return this.cachedPhpLastError}},Jr=class extends Fe{},ut=class extends Ce{constructor(){super(...arguments);this.name="";this.directiveName="";this.namePosition=null;this.hasDirectiveParameters=!1;this.directiveParameters="";this.overrideParams=null;this.directiveParametersPosition=null;this.children=[];this.childrenDocument=null;this.childTypeCounts=new Map;this._conditionParserAbandonPairing=!1;this.hasJsonParameters=!1;this.ref=0;this.isClosedBy=null;this.isOpenedBy=null;this.isClosingDirective=!1;this.innerContent="";this.documentContent="";this.nodeContent="";this.cachedHasValidJson=null;this.cachedArgCount=null;this.cachedHasValidPhp=null;this.cachedPhpLastError=null}hasValidJson(){if(this.hasJsonParameters==!1&&(this.cachedHasValidJson=!1),this.cachedHasValidJson==null)try{let e=this.getPhpContent().trim();e.startsWith("(")&&e.endsWith(")")&&(e=e.substring(1),e=e.substring(0,e.length-1)),JSON.parse(e),this.cachedHasValidJson=!0}catch{this.cachedHasValidJson=!1}return this.cachedHasValidJson}hasValidPhp(){if(this.hasJsonParameters&&(this.cachedHasValidPhp=!1),this.cachedHasValidPhp==null){let e=this.getParser()?.getPhpValidator();e!=null?(this.cachedHasValidPhp=e.isValid(this.getPhpContent(),!0),this.cachedPhpLastError=e.getLastError()):this.cachedHasValidPhp=!1}return this.cachedHasValidPhp}getPhpError(){return this.cachedPhpLastError}isFirstOfType(){return this.parentTypeIndex==1}hasInnerExpression(){return this.hasDirectiveParameters?this.getInnerContent().length>0:!1}getInnerContent(){let e=this.directiveParameters.trim().substring(1);return e=e.substring(0,e.length-1),e}getImmediateChildren(){let e=[];for(let i=0;i<this.children.length;i++){let r=this.children[i];if(r.parent?.refId==this.refId){if(r==this.isClosedBy)break;e.push(r)}}return e}getArgCount(){if(this.cachedArgCount==null)try{let e=ds.fromText(this.getInnerContent());this.cachedArgCount=e.length}catch{this.cachedArgCount=1}return this.cachedArgCount}getPhpContent(){return this.hasJsonParameters?this.directiveParameters:this.directiveName.toLowerCase().match(/^for(each|else)$/)?"foreach ("+this.getInnerContent()+"):endforeach;":this.getArgCount()>1?`[${this.getInnerContent()}];`:this.directiveParameters}getChildren(){if(this.isClosedBy==null)return[];let e=[];for(let i=0;i<this.children.length;i++){let r=this.children[i];if(r instanceof ut&&r.refId==this.isClosedBy.refId)break;e.push(r)}return e}hasChildDirectiveOfType(e){return this.findFirstChildDirectiveOfType(e)!=null}findFirstChildDirectiveOfType(e){for(let i=0;i<this.children.length;i++){let r=this.children[i];if(r instanceof ut&&r.directiveName==e)return r}return null}findFirstDirectChildDirectiveOfType(e){for(let i=0;i<this.children.length;i++){let r=this.children[i];if(r instanceof ut&&r.directiveName==e&&r.parent!=null&&r.parent.refId==this.refId)return r}return null}findDirectivesOfType(e){let i=[];return this.children.forEach(r=>{r instanceof ut&&r.directiveName==e&&i.push(r)}),i}findDirectChildDirectivesOfType(e){let i=[];return this.children.forEach(r=>{r instanceof ut&&r.directiveName==e&&r.parent!=null&&r.parent.refId==this.refId&&i.push(r)}),i}clone(){let e=new ut;e.children=[...this.children],e.directiveName=this.directiveName,e.directiveParameters=this.directiveParameters,e.directiveParametersPosition=this.directiveParametersPosition,e.documentContent=this.documentContent,e.endPosition=this.endPosition,e.hasDirectiveParameters=this.hasDirectiveParameters,e.index=this.index,e.innerContent=this.innerContent,e.isClosedBy=this.isClosedBy,e.isClosingDirective=this.isClosingDirective,e.isOpenedBy=this.isOpenedBy,e.name=this.name,e.namePosition=this.namePosition,e.parent=this.parent,e.refId=this.refId,e.sourceContent=this.sourceContent,e.startPosition=this.startPosition,e.overrideParams=this.overrideParams;let i=this.getParser();return i!=null&&e.withParser(i),e.originalAbstractNode=this,e.containsAnyFragments=this.containsAnyFragments,e.containsChildStructures=this.containsChildStructures,e.isInScriptTag=this.isInScriptTag,e.isInStyleTag=this.isInStyleTag,e}getFinalClosingDirective(){return this.isClosedBy==null?this:this.isClosedBy.getFinalClosingDirective()}},jn=class extends Ce{constructor(){super(...arguments);this.head=null;this.tail=null;this.nodes=[];this.childDocument=null;this.documentContent="";this.innerContent="";this.innerOffset=null}},Ke=class extends ut{constructor(){super(...arguments);this.constructedFrom=null;this.nodeContent="";this.logicBranches=[];this.chain=[]}getParent(){return this.logicBranches.length>0&&this.logicBranches[0].head!=null&&this.logicBranches[0].head.parent!=null&&this.logicBranches[0].head.parent instanceof ut?this.logicBranches[0].head.parent:null}},di=class extends Ce{constructor(){super(...arguments);this.constructedFrom=null;this.nodeContent="";this.originalNode=null;this.tail=null;this.cases=[]}},js=class extends Ce{constructor(){super(...arguments);this.order=0;this.leadingNodes=[];this.leadingDocument=null;this.head=null;this.children=[];this.isDefault=!1;this.isClosedBy=null;this.childDocument=null;this.documentContent="";this.innerContent="";this.innerOffset=null}},mi=class extends Ce{constructor(){super(...arguments);this.constructedFrom=null;this.nodeContent="";this.originalNode=null;this.truthNodes=[];this.elseNode=null;this.falseNodes=[];this.tailNode=null;this.truthDocument=null;this.falseDocument=null;this.documentContent="";this.truthDocumentContent="";this.truthInnerContent="";this.truthDocumentOffset=null;this.truthInnerOffset=null;this.falseDocumentContent="";this.falseInnerContent="";this.falseDocumentOffset=null;this.falseInnerOffset=null}},de=class extends Ce{constructor(){super(...arguments);this.content="";this.cachedHasValidPhp=null;this.cachedPhpLastError=null;this.isInlineEcho=!1;this.overrideContent=null}hasValidPhp(){if(this.cachedHasValidPhp==null){let e=this.getParser()?.getPhpValidator();e!=null?(this.cachedHasValidPhp=e.isValid(this.content,!0),this.cachedPhpLastError=e.getLastError()):this.cachedHasValidPhp=!1}return this.cachedHasValidPhp}getPhpError(){return this.cachedPhpLastError}},en=class extends de{},nn=class extends de{};var Yr=class extends Ce{},Ks=class extends Ce{},On=class extends Ce{constructor(){super(...arguments);this.tokenLength=0}},Qs=class extends Ce{},ms=class extends Ce{},$s=class extends Ce{},Kn=class extends Ce{constructor(){super(...arguments);this.key=null;this.value=null;this.isLast=!1}},Qn=class extends Ce{constructor(){super(...arguments);this.elements=[];this.containsKeys=!1;this.maxKeyLength=0}};var vt=class{};vt.Verbatim="verbatim",vt.EndVerbatim="endverbatim",vt.Php="php",vt.EndPhp="endphp",vt.If="if",vt.ElseIf="elseif",vt.Else="else",vt.Unless="unless",vt.ForElse="forelse",vt.EndForElse="endforelse",vt.Switch="switch",vt.EndSwitch="endswitch",vt.Default="default",vt.Case="case";var Pe=class{static clearSpeculativeConditions(){this.speculativeConditions.clear()}static clearSpeculativeEndIfs(){this.speculativeEndIfs.clear()}static getSpeculativeConditions(){return this.speculativeConditions}static getSpeculativeEndIfs(){return this.speculativeEndIfs}static isSpeculativeCondition(t){return this.speculativeConditions.has(t)}static isSpeculativeEndIf(t){return this.speculativeEndIfs.has(t)}static registerSpeculativeCondition(t){this.speculativeConditions.set(t,1)}static registerSpeculativeEndIf(t){this.speculativeEndIfs.set(t,1)}static canClose(t){let e="end"+t.directiveName.toLowerCase();return this.possibleClosingNode.has(e)}static shouldRewrite(t){return!!(this.customIfs.has(t.name)||this.alwaysRewrite.includes(t.name)||this.speculativeEndIfs.has(t.directiveName)||this.speculativeConditions.has(t.name))}static determineCandidates(t){let e=new Map;t.forEach(i=>{if(!(i instanceof ut))return;let r=i;r.directiveName.toLowerCase().startsWith("end")||e.set(r.directiveName.toLowerCase(),1)}),t.forEach(i=>{if(!(i instanceof ut))return;let r=i;if(r.directiveName.toLowerCase().startsWith("unless")){let o=r.directiveName.substring(6);o.length>0&&(this.speculativeConditions.set(r.directiveName,1),this.speculativeEndIfs.set("end"+o,1))}if(this.speculativeEndIfs.has(r.directiveName)&&(r.isClosingDirective=!0),r.directiveName.toLowerCase().startsWith("else")){let o=r.directiveName.substring(4);o!="if"&&o.length>0&&this.speculativeConditions.set(o,1)}if(r.directiveName.toLowerCase().startsWith("end")){let o=r.directiveName.substring(3).toLowerCase();e.has(o)&&(this.possibleClosingNode.set(r.directiveName.toLowerCase(),1),r.isClosingDirective=!0)}})}};Pe.possibleClosingNode=new Map,Pe.alwaysRewrite=["unless","sectionMissing","hasSection","can","auth","env","isset","guest","cannot","canany","hasSection","production"],Pe.customIfs=new Map,Pe.speculativeConditions=new Map,Pe.speculativeEndIfs=new Map;var Xr=class{static getNewName(t){if(t.name==vt.Unless)return vt.If;if(Pe.isSpeculativeEndIf(t.directiveName))return vt.If;if(Pe.alwaysRewrite.includes(t.name))return vt.If;if(Pe.isSpeculativeCondition(t.name))return vt.If;if(Pe.customIfs.has(t.name)){let e=t.directiveName.toLowerCase();return e.startsWith("else")?(t.isClosingDirective=!0,vt.ElseIf):e.startsWith("end")?(t.isClosingDirective=!0,vt.If):vt.If}return t.directiveName=="auth"?vt.If:t.name}static rewrite(t){let e=[];return t.forEach(i=>{if(i instanceof ut)if(Pe.shouldRewrite(i)){let r=i.clone();r.name=this.getNewName(i),e.push(r)}else e.push(i);else e.push(i)}),e}};function Ti(n){return n.length==0?null:n[0].startPosition}function zc(n,t){let e=new Set(n),i=new Set(t),r=new Set([...e].filter(o=>i.has(o)));return Array.from(r)}var gs=class{static findClosingTag(t,e,i){let r=0;i.name?.inlineName!=null&&i.name.inlineName!=""&&(i.isShorthandSlot=!0);for(let o=e;o<t.length;o++){let h=t[o];if(h instanceof Ie){if(h.isClosedBy!=null||h.isOpenedBy!=null)continue;if(h.name?.name=="slot"){if(h.isSelfClosing==!1&&h.isClosingTag==!1){r+=1;continue}else if(h.isSelfClosing==!1&&h.isClosingTag){if(r-=1,r>0)continue;i.isClosedBy=h,h.isOpenedBy=i;break}}}}}static pairComponents(t){for(let e=0;e<t.length;e+=1){let i=t[e];i instanceof Ie&&i.name?.name=="slot"&&i.isSelfClosing==!1&&i.isClosingTag==!1&&gs.findClosingTag(t,e,i)}return t}};var ve=class{constructor(){this.node=null;this.errorCode="";this.message="";this.level=0;this.range=null}hash(){let t="";return this.node!=null&&(t=(this.node.endPosition?.offset??0).toString()+"|"+(this.node.startPosition?.offset??0).toString()+"|"),t+"|"+this.errorCode}static makeSyntaxError(t,e,i,r){r==null&&(r=0);let o=new ve;return o.errorCode=t,o.node=e,o.message=i,o.level=r,o}};var Ft=class{};Ft.TYPE_UNEXPECTED_END_OF_INPUT="BLADE_001",Ft.TYPE_PARSE_UNCLOSED_CONDITION="BLADE_002",Ft.TYPE_PARSE_UNCLOSED_SWITCH="BLADE_003",Ft.TYPE_UNPAIRED_CLOSING_DIRECTIVE="BLADE_004",Ft.TYPE_UNCLOSED_COMMENT="BLADE_005",Ft.TYPE_UNCLOSED_PHP_DIRECTIVE="BLADE_006",Ft.TYPE_UNPAIRED_PHP_CLOSING_DIRECTIVE="BLADE_007",Ft.TYPE_UNCLOSED_VERBATIM="BLADE_008",Ft.TYPE_UNPAIRED_VERBATIM_CLOSING_DIRECTIVE="BLADE_009",Ft.TYPE_UNCLOSED_FOR_DIRECTIVE="BLADE_010",Ft.TYPE_UNPAIRED_FOR_CLOSING_DIRECTIVE="BLADE_011",Ft.TYPE_UNCLOSED_FOR_ELSE_DIRECTIVE="BLADE_012",Ft.TYPE_UNPAIRED_FOR_ELSE_CLOSING_DIRECTIVE="BLADE_013",Ft.TYPE_FOR_ELSE_MISSING_EMPTY_DIRECTIVE="BLADE_014";var Fi=class{static isConditionalStructure(t){if(!(t instanceof ut))return!1;let e=t,i=e.name;return i==vt.If||i==vt.ElseIf||i==vt.Else}static requiresClose(t){let e=t.name;return e==vt.ElseIf||e==vt.Else?t.isClosedBy==null:!(t.isClosingDirective||t.isClosedBy!=null)}static getValidClosingPairs(t){return t==vt.If||t==vt.ElseIf?Fi.conditionClosingPairs:[]}static findClosestStructurePair(t,e,i){let r=[],o=t.length,h=new Map;r.push({node:e,index:i});for(let f=0;f<o;f+=1){let p=t[f];if(p instanceof ut){let E=p.name;if(p.isClosingDirective&&E==vt.If){h.set(f,f);continue}else if(E==vt.ElseIf||E==vt.Else){h.set(f,f);continue}}}for(;r.length>0;){let f=r.pop();if(f==null)continue;if(f.node._conditionParserAbandonPairing)break;let p=f.node,E=Fi.getValidClosingPairs(p.name),d=f.index,x=!1;for(let _=d;_<o;_++){let u=t[_];if(u instanceof ut&&Fi.isConditionalStructure(u)){if(Fi.requiresClose(u)){if(_==o-1){x=!1;break}r.push(f),r.push({node:u,index:_+1}),x=!0;break}if(p.isClosedBy!=null)continue;let c=u.name,g=!1;if(u.ref==0&&(u.isClosingDirective&&c==vt.If||E.includes(c))&&(g=!0),u.refId==p.refId&&(g=!1),g){h.delete(_),p.isClosedBy=u,u.isOpenedBy=p,u.ref+=1,x=!0;break}}}if(!x&&p instanceof ut){let _=p.name;(_==vt.ElseIf||_==vt.Else)&&p.isOpenedBy==null&&(p.pushError(ve.makeSyntaxError(Ft.TYPE_PARSE_UNCLOSED_CONDITION,p,"Unpaired condition control structure")),p._conditionParserAbandonPairing=!0),p.isClosedBy==null&&Fi.requiresClose(p)&&(p.pushError(ve.makeSyntaxError(Ft.TYPE_PARSE_UNCLOSED_CONDITION,p,"Unpaired condition control structure")),p._conditionParserAbandonPairing=!0)}}}static pairConditionals(t){for(let e=0;e<t.length;e+=1){let i=t[e];i instanceof ut&&Fi.isConditionalStructure(i)&&Fi.requiresClose(i)&&Fi.findClosestStructurePair(t,i,e+1)}return t.forEach(e=>{if(e instanceof ut&&Fi.isConditionalStructure(e)){let i=e.name;if((i==vt.ElseIf||i==vt.Else)&&e.isOpenedBy==null){e.pushError(ve.makeSyntaxError(Ft.TYPE_PARSE_UNCLOSED_CONDITION,e,"Unpaired condition control structure")),e._conditionParserAbandonPairing=!0;return}if(e.isClosedBy==null&&Fi.requiresClose(e)){e.pushError(ve.makeSyntaxError(Ft.TYPE_PARSE_UNCLOSED_CONDITION,e,"Unpaired condition control structure")),e._conditionParserAbandonPairing=!0;return}}}),t}},xs=Fi;xs.conditionClosingPairs=["elseif","else"];var jr=class{static associate(t,e){let i=[];return t.forEach(r=>{r instanceof ut&&r.name.toLowerCase()==vt.ForElse&&r.directiveName.toLowerCase()!=vt.EndForElse?i.push(this.createForElseNode(r,e)):i.push(r)}),i}static createForElseNode(t,e){let i=new mi;i.withParser(e),i.originalNode=t,i.startPosition=t.startPosition,i.endPosition=t.getFinalClosingDirective().endPosition,i.constructedFrom=t;let r=t.findFirstDirectChildDirectiveOfType("empty");if(r==null){i.tailNode=t.children.pop(),i.truthNodes=t.children;let p=(t.startPosition?.index??0)-1,E=(t.isClosedBy?.startPosition?.index??0)-1,d=E-p,x=(t.endPosition?.index??0)+1,_=(t.isClosedBy?.startPosition?.index??0)-1,u=_-x;i.truthDocumentContent=e.getText(p,E),i.truthDocumentOffset={start:p,end:E,length:d},i.truthInnerContent=e.getText(x,_),i.truthInnerOffset={start:x,end:_,length:u}}else{let p=t.children,E=[],d=[];i.elseNode=r;for(let j=0;j<p.length;j++){let ot=p[j];if(ot.refId==r.refId){d=p.slice(j+1);break}else E.push(ot)}i.truthNodes=E,d.length>0&&(i.tailNode=d.pop()),i.falseNodes=d;let x=(t.startPosition?.index??0)-1,_=(r.startPosition?.index??0)-1,u=_-x,c=(t.endPosition?.index??0)+1,g=(r.startPosition?.index??0)-1,y=g-c;i.truthDocumentContent=e.getText(x,_),i.truthDocumentOffset={start:x,end:_,length:u},i.truthInnerContent=e.getText(c,g),i.truthInnerOffset={start:c,end:g,length:y};let T=(r.startPosition?.index??0)-1,w=(t.isClosedBy?.startPosition?.index??0)-1,R=w-T,M=(r.endPosition?.index??0)+1,J=(t.isClosedBy?.startPosition?.index??0)-1,W=J-M;i.falseDocumentContent=e.getText(T,w),i.falseDocumentOffset={start:T,end:w,length:R},i.falseInnerContent=e.getText(M,J),i.falseInnerOffset={start:M,end:J,length:W}}i.truthDocument=$t.childFromText(e.getNodeText(i.truthNodes),e,Ti(i.truthNodes)),i.falseDocument=$t.childFromText(e.getNodeText(i.falseNodes),e,Ti(i.falseNodes));let o=(t.startPosition?.index??0)-1,h=t.isClosedBy?.endPosition?.index??0-(t.startPosition?.index??0),f=h-o;return i.nodeContent=e.getText(o,h),i.documentContent=e.getText(o,h),i.offset={start:o,end:h,length:f},i}};var Kr=class{static analyze(t,e){let i=[];return t.forEach(r=>{if(r instanceof ut&&r.isClosedBy!=null){let o=r.findFirstChildDirectiveOfType("else");o!=null&&o.isClosedBy==null?i.push(this.convertToConditionalNode(r,o,e)):i.push(r)}else i.push(r)}),i}static convertToConditionalNode(t,e,i){let r=new Ke,o=t.getFinalClosingDirective(),h=t.children,f=[],p=[],E=h.pop();r.withParser(i),r.parent=t.parent,r.startPosition=t.startPosition,r.endPosition=o.endPosition,r.constructedFrom=t;let d=(t.startPosition?.index??0)-1,x=o?.endPosition?.index??0-(t.startPosition?.index??0),_=d+x;r.nodeContent=i.getText(d,x),r.offset={start:d,end:_,length:x};for(let Vt=0;Vt<h.length;Vt++){let Jt=h[Vt];if(Jt instanceof ut&&Jt.refId==e.refId){p=h.slice(Vt+1);break}else f.push(Jt)}let u=new jn,c=new jn;u.withParser(i),c.withParser(i),t.isClosedBy=e,e.isOpenedBy=t,E.isOpenedBy=e,e.isClosedBy=E;let g=[...f],y=[...p];f.push(e),u.head=t,u.nodes=f,u.index=t.index;let T=t.endPosition?.index??0,w=(t.isClosedBy?.startPosition?.index??0)-1,R=w-T,M=(t.startPosition?.index??0)-1,J=(t.isClosedBy?.startPosition?.index??0)-1,W=J-M;u.innerContent=i.getText(T,w),u.documentContent=i.getText(M,J),u.innerOffset={start:T,end:w,length:R},u.offset={start:M,end:J,length:W},p.push(E),c.head=e,c.nodes=p,c.index=e.index;let j=e.endPosition?.index??0,ot=(e.isClosedBy?.startPosition?.index??0)-1,st=ot-j,kt=(e.startPosition?.index??0)-1,gt=(e.isClosedBy?.startPosition?.index??0)-1,qt=gt-kt;return c.innerContent=i.getText(j,ot),c.documentContent=i.getText(kt,gt),c.innerOffset={start:j,end:ot,length:st},c.offset={start:kt,end:gt,length:qt},r.chain=[t.index,e.index],r.logicBranches.push(u),r.logicBranches.push(c),u.startPosition=u.nodes[0].startPosition,u.endPosition=u.nodes[u.nodes.length-1].startPosition,u.childDocument=$t.childFromText(i.getNodeText(g),i,Ti(g)),c.childDocument=$t.childFromText(i.getNodeText(y),i,Ti(y)),c.startPosition=c.nodes[0].startPosition,c.endPosition=c.nodes[c.nodes.length-1].startPosition,Pe.registerSpeculativeCondition(t.directiveName),r}};var Qr=class{static associate(t,e){let i=[];return t.forEach(r=>{r instanceof ut&&r.directiveName.toLowerCase()==vt.Switch?i.push(this.createSwitchNode(r,e)):i.push(r)}),i}static createSwitchNode(t,e){let i=new di,r=t.children;i.originalNode=t,i.startPosition=t.startPosition,i.endPosition=t.getFinalClosingDirective().endPosition,i.parent=t.parent,i.withParser(e),i.constructedFrom=t;let o=[];for(let E=0;E<r.length;E++){let d=r[E];if(d instanceof ut&&d.name==vt.Switch&&(E+=d.children.length),d instanceof ut&&d.name==vt.Case){let x=this.collectUntil(t,r.slice(E+1),[vt.Case,vt.Default,vt.EndSwitch]),_=new js;if(_.parent=d.parent,i.cases.length==0&&o.length>0){if(_.leadingNodes=o,o.length>0){let R=o[0],M=o[o.length-1],J=R.startPosition?.index??0,W=(M.endPosition?.index??0)+1,j=e.getText(J,W);_.leadingDocument=$t.childFromText(j,e,R.startPosition)}o=[]}if(_.refId=d.refId,_.index=d.index,_.startPosition=d.startPosition,_.endPosition=d.endPosition,_.order=i.cases.length,_.head=d,_.isDefault=!1,_.children=x.children,_.withParser(e),_.isClosedBy=x.brokeOn,d.isClosedBy=x.brokeOn,_.children.length>0){let R=_.children[_.children.length-1];R instanceof ut&&R==t.isClosedBy&&_.children.pop()}_.childDocument=$t.childFromText(e.getNodeText(_.children),e,Ti(_.children)),x.brokeOn!=null&&(_.endPosition=x.brokeOn.startPosition);let u=(_.startPosition?.index??0)-1,c=(_.isClosedBy?.startPosition?.index??0)-1,g=c-u,y=(d.endPosition?.index??0)+1,T=(_.isClosedBy?.startPosition?.index??0)-1,w=T-y;_.documentContent=e.getText(u,c),_.innerContent=e.getText(y,T),_.offset={start:u,end:c,length:g},_.innerOffset={start:y,end:T,length:w},i.cases.push(_)}else if(d instanceof ut&&d.name==vt.Default){let x=r.slice(E+1),_=new js;_.parent=d.parent,_.refId=d.refId,_.index=d.index,_.startPosition=d.startPosition,_.endPosition=t.startPosition,_.order=i.cases.length,_.head=d,_.isDefault=!0,_.children=x,_.withParser(e),_.isClosedBy=t.isClosedBy,d.isClosedBy=t.isClosedBy;let u=[..._.children],c=u[u.length-1];c instanceof ut&&c.refId==t.isClosedBy?.refId&&u.pop();let g=(_.startPosition?.index??0)-1,y=(_.isClosedBy?.startPosition?.index??0)-1,T=y-g,w=(d.endPosition?.index??0)+1,R=(_.isClosedBy?.startPosition?.index??0)-1,M=R-w;_.documentContent=e.getText(g,y),_.innerContent=e.getText(w,R),_.offset={start:g,end:y,length:T},_.innerOffset={start:w,end:R,length:M},_.childDocument=$t.childFromText(e.getNodeText(u),e,Ti(u)),i.cases.push(_);break}else o.push(d)}if(i.cases.length>0){let E=i.cases[i.cases.length-1];E.children.length>0&&(i.tail=E.children.pop())}if(i.cases.length==0){let E=[...t.children];E.length>0&&E[E.length-1]==t.isClosedBy&&E.pop(),t.childrenDocument=$t.childFromText(e.getNodeText(E),e,Ti(E))}let h=(t.startPosition?.index??0)-1,f=t.isClosedBy?.endPosition?.index??0-(t.startPosition?.index??0),p=h+f;if(i.nodeContent=e.getText(h,f),i.offset={start:h,end:p,length:f},i.cases.length>0){let E=i.cases[i.cases.length-1];E.isClosedBy==null&&(E.isClosedBy=t.isClosedBy)}return i}static collectUntil(t,e,i){let r=[],o=null;for(let h=0;h<e.length;h++){let f=e[h];if(f instanceof ut&&i.includes(f.name)&&f.parent?.refId==t.refId){o=f;break}r.push(f)}return{children:r,brokeOn:o}}};var ua=class{constructor(){this.document=null;this.parentNode=null;this.openDirectiveIndexCount=new Map;this.closingDirectiveIndex=new Map;this.closingDirectiveIndexCount=new Map;this.closingDirectiveNames=new Map;this.createdExecutionBranches=[];this.pairsCreated=0;this.stackCount=0}buildCloseIndex(t){t.forEach(e=>{if(!(e instanceof ut))return;let i=e;if(i.isClosingDirective==!1)return;this.closingDirectiveIndex.has(this.stackCount)==!1&&this.closingDirectiveIndex.set(this.stackCount,new Map),this.closingDirectiveIndexCount.has(this.stackCount)==!1&&this.closingDirectiveIndexCount.set(this.stackCount,new Map);let r=i.name;this.closingDirectiveIndex.get(this.stackCount)?.has(r)==!1&&(this.closingDirectiveIndex.get(this.stackCount)?.set(r,[]),this.closingDirectiveIndexCount.get(this.stackCount)?.set(r,0)),this.closingDirectiveIndex.get(this.stackCount)?.get(r)?.push(e);let o=this.closingDirectiveIndexCount.get(this.stackCount)?.get(r)??0;this.closingDirectiveIndexCount.get(this.stackCount)?.set(r,o+1)}),this.closingDirectiveNames.has(this.stackCount)==!1&&this.closingDirectiveNames.set(this.stackCount,[]),this.closingDirectiveIndex.has(this.stackCount)&&(this.closingDirectiveNames.set(this.stackCount,Array.from(this.closingDirectiveIndex.get(this.stackCount)?.keys()??[])),this.closingDirectiveIndex.get(this.stackCount)?.forEach((e,i)=>{let r=e.length;if(r==0)return;let o=e[r-1];for(let h=0;h<r;h++){let f=t[h];if(f instanceof ut){if(f.index>=o.index)break;let p=f.name;if(f.isClosingDirective==!1&&p==i){this.openDirectiveIndexCount.has(this.stackCount)==!1&&this.openDirectiveIndexCount.set(this.stackCount,new Map),this.openDirectiveIndexCount.get(this.stackCount)?.has(i)==!1&&this.openDirectiveIndexCount.get(this.stackCount)?.set(i,0);let E=this.openDirectiveIndexCount.get(this.stackCount)?.get(i)??0;this.openDirectiveIndexCount.get(this.stackCount)?.set(i,E+1)}}}}))}getClosingCandidates(t){let e=[];return e.push(t.name),e}getScanForList(t){if(t.isClosingDirective==!1){let e=this.getClosingCandidates(t),i=this.closingDirectiveNames.get(this.stackCount);return zc(e,i)}return[]}associate(t,e,i=null){this.document=e;let r=[],o=[{documentNodes:t,parent:i}];for(;o.length>0;){let h=o.pop();if(h==null)continue;let f=h.documentNodes;this.parentNode=h.parent,this.stackCount+=1,this.buildCloseIndex(f),f=xs.pairConditionals(f),f=gs.pairComponents(f),f.forEach(x=>{if(x instanceof ut&&Pe.canClose(x)){if(xs.isConditionalStructure(x)){this.pairsCreated+=1;return}let _=this.getScanForList(x);this.findClosingPair(f,x,_)}});let p=f.length;for(let x=0;x<p;x++){let _=f[x];if(_ instanceof ut&&_.isClosedBy!=null)for(let u=x+1;u<p;u++){let c=f[u];if(c.index>_.isClosedBy.index)break;if(c.parent=_,_.children.push(c),c instanceof ut&&c.index==_.index){c.parent=_;break}}}f.forEach(x=>{if(x instanceof ut&&x.children.length>0){let _=[],u=[];x.children.forEach(c=>{if(c.parent!=null&&c.parent.index==x.index){let g=c.refId;if(!u.includes(g))c.parent=x,_.push(c),u.push(g);else return}}),o.push({documentNodes:_,parent:x})}});let E=[];f.forEach(x=>{this.parentNode==null?x.parent==null&&E.push(x):x.parent?.refId==this.parentNode.refId&&E.push(x)}),E=this.reduceConditions(E,e),E=Qr.associate(E,e),E=jr.associate(E,e),E=Kr.analyze(E,e),E=this.cleanNodes(E);let d=new Map;f.forEach(x=>{if(x instanceof ut&&x.isClosedBy!=null&&this.document!=null){let _=this.document.getText(x.endPosition?.index??0,(x.isClosedBy.startPosition?.index??0)-1);x.documentContent=_,(x.name=="php"||x.name=="verbatim")&&x.innerContent.trim().length==0&&(x.innerContent=x.documentContent)}});for(let x=0;x<E.length;x++){let _=E[x],u=_.refId??"";d.set(u,1)}if(this.parentNode!=null&&this.parentNode instanceof ut&&(this.parentNode.children=this.cleanNodes(E),this.parentNode.parent!=null&&this.parentNode.parent instanceof ut)){let x=this.parentNode.parent.children,_=[];x.forEach(u=>{d.has(u.refId??"")==!1&&_.push(u)}),this.parentNode.parent.children=this.cleanNodes(_)}this.stackCount<=1&&(r=this.cleanNodes(E))}return r}cleanNodes(t){let e=[],i=[];for(let r=0;r<t.length;r++){let o=t[r],h=o.refId;if(i.includes(h))break;e.push(o),i.push(h)}return e}reduceConditions(t,e){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(o instanceof ut&&o.isClosingDirective==!1&&o.isClosedBy!=null)if(o.name==vt.If){let f=new Ke,p=o.getFinalClosingDirective();f.withParser(e),f.index=o.index,f.chain.push(o.index),f.startPosition=o.startPosition,f.endPosition=p.endPosition,f.constructedFrom=o;let E=(o.startPosition?.index??0)-1,d=p?.endPosition?.index??0-(o.startPosition?.index??0),x=E+d;f.nodeContent=e.getText(E,d),f.offset={start:E,end:x,length:d},this.parentNode!=null&&(f.parent=this.parentNode);let _=null,u=!0,c=0;for(;u;){if(c+=1,c>ua.ForceBreakLimit){u=!1;break}if(o instanceof ut){let g=this.findEndOfBranch(t.slice(r+1),o,r),y=new jn;y.withParser(e);let T=g.tail;y.head=o,y.tail=T,y.nodes=this.cleanNodes(o.children);let w=[...y.nodes],R=w[w.length-1];R instanceof ut&&R.refId==o.isClosedBy?.refId&&w.pop();let M=o.endPosition?.index??0,J=(o.isClosedBy?.startPosition?.index??0)-1,W=J-M,j=(o.startPosition?.index??0)-1,ot=(o.isClosedBy?.startPosition?.index??0)-1,st=ot-j;if(y.innerContent=e.getText(M,J),y.documentContent=e.getText(j,ot),y.innerOffset={start:M,end:J,length:W},y.offset={start:j,end:ot,length:st},y.childDocument=$t.childFromText(e.getNodeText(w),e,Ti(w)),T==null&&(T=y.head.isClosedBy),T!=null&&T.startPosition!=null&&(y.startPosition=T.startPosition),T!=null&&(y.index=T.index),y.nodes.length>0){let kt=y.nodes[y.nodes.length-1];kt.endPosition!=null&&(y.endPosition=kt.endPosition)}else T!=null&&T.endPosition!=null&&(y.endPosition=T.endPosition);if(this.createdExecutionBranches.push(y),f.logicBranches.push(y),T?.isClosingDirective&&T.name==vt.If){_=g.offset,u=!1;break}else T!=null&&f.chain.push(T.index),r=g.offset,T instanceof ut&&(o=T)}else u=!1}if(i.push(f),_!=null&&_==t.length)break}else i.push(o);else i.push(o)}return i}findEndOfBranch(t,e,i){let r=[],o=i,h=null;for(let f=0;f<t.length;f++){let p=t[f];if(p instanceof ut&&p.isOpenedBy!=null&&p.isOpenedBy==e){h=p;break}else r.push(p)}return{children:r,tail:h,offset:o}}getPairsCreated(){return this.pairsCreated}findClosingPair(t,e,i){let r=t.length,o=0;for(let h=0;h<r;h++){let f=t[h];if(!(f instanceof ut)||f.startPosition==null||e.endPosition==null||!e.endPosition.isBefore(f.startPosition))continue;let p=f;if(p.isClosingDirective&&p.isOpenedBy!=null||!p.isClosingDirective&&p.isClosedBy!=null)continue;let E=p.name;if(!p.isClosingDirective&&i.includes(E)){o+=1;continue}if(i.includes(E)&&o>0){o-=1;continue}if(o==0&&i.includes(E)){p.isOpenedBy=e,e.isClosedBy=p,this.pairsCreated+=1;break}}}},Zs=ua;Zs.ForceBreakLimit=1e5;var $r=class{static setChildTypeCounts(t){t.forEach(e=>{if(!(e instanceof ut))return;let i=e;i.getImmediateChildren().forEach(r=>{let o="*unknown",h=0;r instanceof Pt?o="*literal":r instanceof nn?o="*entities_echo":r instanceof en?o="*escaped_echo":r instanceof de?o="*echo":r instanceof Yr?o="*verbatim":r instanceof ut&&(o=r.directiveName),i.childTypeCounts.has(o)==!1&&i.childTypeCounts.set(o,0);let f=i.childTypeCounts.get(o),p=f+1;i.childTypeCounts.set(o,p),r.parentTypeIndex=p,r.parentIndex=h,h+=1})})}};var Zr=class{constructor(t,e){this.documentParser=t,this.fragmentsParser=e}doesContainFragments(t){let e=t.endPosition?.index??0,i=t.isClosedBy?.startPosition?.index??0;return this.fragmentsParser.getFragmentsBetween(e,i).length>0}analyze(){let t=this.documentParser.getNodes();!this.fragmentsParser.hasFragments()||(this.fragmentsParser.getFragments().forEach(e=>{let i=e.name.toLowerCase();if(e.isClosingFragment==!1&&e.isSelfClosing==!1&&(i=="script"||i=="style")){let r=this.fragmentsParser.getClosingFragmentAfter(e);if(r==null)return;e.endPosition!=null&&r.startPosition!=null&&this.documentParser.getNodesBetween(e.endPosition,r.startPosition).forEach(h=>{(h instanceof Ke||h instanceof mi||h instanceof Ie||h instanceof di||h instanceof ut&&h.isClosedBy!=null)&&(e.containsStructures=!0),i=="style"?h.isInStyleTag=!0:h.isInScriptTag=!0})}}),t.forEach(e=>{if(e instanceof Pt||e.startPosition==null)return;e instanceof ut&&!e.isClosingDirective&&e.isClosedBy!=null&&(e.containsAnyFragments=this.doesContainFragments(e));let i=this.fragmentsParser.getFragmentContaining(e.startPosition);if(i==null)return;if(e.fragment=i,e.startPosition.index-(i.startPosition?.index??0)<=3){e.fragmentPosition=0;return}if(i.parameters.length==0){e.fragmentPosition=2;return}let o=!1;for(let h=0;h<i.parameters.length;h++){let f=i.parameters[h];if((f.startPosition?.index??0)<e.startPosition.index&&(f.endPosition?.index??0)>e.startPosition.index){e.fragmentPosition=1,o=!0;break}}o||(e.fragmentPosition=2)}))}};var to=class{static analyze(t){t.forEach(e=>{if(e instanceof de){let i=!1,r=!1;if(e.nextNode==null)i=!0;else if(e.nextNode instanceof Pt){let o=F.getFirstLine(e.nextNode.content);(F.trimLeft(o," ").startsWith(`
`)==!1&&o.trim().length>0||e.nextNode.nextNode instanceof de&&e.nextNode.nextNode.startPosition?.line==e.endPosition?.line)&&(i=!0)}else e.nextNode instanceof de&&(i=!0);if(e.prevNode==null)r=!0;else if(e.prevNode instanceof Pt){let o=F.getLastLine(e.prevNode.content);(F.trimRight(o," ").endsWith(`
`)==!1&&o.trim().length>0||e.prevNode.prevNode instanceof de&&e.prevNode.prevNode.endPosition?.line==e.startPosition?.line)&&(r=!0)}else e.prevNode instanceof de&&(r=!0);e.isInlineEcho=i||r}})}};var eo=class{static analyze(t){t.forEach(e=>{if(e instanceof Fe){if(e.startPosition?.line!=e.endPosition?.line)return;let i=!1,r=!1;if(e.nextNode==null)i=!0;else if(e.nextNode instanceof Pt){let o=F.getFirstLine(e.nextNode.content);F.trimLeft(o," ").startsWith(`
`)==!1&&o.trim().length>0&&(i=!0)}if(e.prevNode==null)r=!0;else if(e.prevNode instanceof Pt){let o=F.getLastLine(e.prevNode.content);F.trimRight(o," ").endsWith(`
`)==!1&&o.trim().length>0&&(r=!0)}e.isInline=i&&r}})}};var sn=class{static findRightBeighboringNextPunctuation(t,e,i=4){e=e.replace(" "," ".repeat(i));let r=!1;for(let o=t+1;o<e.length;o++){let h=e[o];if(F.ctypeSpace(h)&&(r=!0),r&&(F.ctypeAlpha(h)||F.ctypeDigit(h)))return null;if(F.ctypePunct(h)||h==rt.String_Terminator_SingleQuote||h==rt.String_Terminator_DoubleQuote)return h}return null}static findRightNeighboringNextAlphaNumeric(t,e,i=4){e=e.replace(" "," ".repeat(i));let r=!1;for(let o=t+1;o<e.length;o++){let h=e[o];if((F.ctypeSpace(h)||F.ctypePunct(h)&&h!=rt.Punctuation_Underscore)&&(r=!0),r&&(F.ctypeAlpha(h)||F.ctypeDigit(h)))return o+1}return null}static findLeftNeighboringNextPunctuation(t,e,i=4){e=e.replace(" "," ".repeat(i));let r=!1;for(let o=t-2;o>=0;o--){let h=e[o];if(F.ctypeSpace(h)&&(r=!0),r&&(F.ctypeAlpha(h)||F.ctypeDigit(h)))return null;if(F.ctypePunct(h))return h}return null}static findLeftNeighboringNextAlphaNumeric(t,e,i=4){e=e.replace(" "," ".repeat(i));let r=!1;for(let o=t-1;o>=0;o--){let h=e[o];if((F.ctypeSpace(h)||F.ctypePunct(h)&&h!=rt.Punctuation_Underscore)&&(r=!0),r&&(F.ctypeAlpha(h)||F.ctypeDigit(h)))return o+1}return null}static scanWordAt(t,e,i=4){if(e=e.replace(" "," ".repeat(i)),t<0||t>e.length)return null;let r=[],o=[];for(let h=t-1;h>=0;h--){let f=e[h];if(F.ctypePunct(f)&&f!=rt.Punctuation_Underscore||F.ctypeSpace(f))break;r.push(f)}for(let h=t;h<e.length;h++){let f=e[h];if(F.ctypePunct(f)&&f!=rt.Punctuation_Underscore||F.ctypeSpace(f))break;o.push(f)}return r.reverse().join("")+o.join("")}};var rn=class{constructor(){this.index=-1;this.offset=0;this.line=0;this.char=0}shiftRight(t){let e=new rn;return e.offset=this.offset+t,e.index=this.index+t,e.line=this.line,e.char=this.char+t,e}isBefore(t){return t==null?!1:t.line>this.line||t.line==this.line&&this.offset<t.offset}isWithin(t,e,i=0){return t==null||e==null?!1:this.index>=t.index&&this.index<=e.index+i}isWithinRange(t){return t==null?!1:t.start!=null&&t.end!=null?this.isWithin(t.start,t.end):!1}};function _s(n){for(let t=n.getCurrentIndex()+1;t<n.inputLength();t++){let e=n.getChar(t);if(!F.ctypeSpace(e))return{didFind:!0,index:t,char:e}}return{didFind:!1,index:null,char:""}}var io=class{constructor(t){this.content="";this.inputLen=0;this.chars=[];this.currentContent=[];this.prev=null;this.cur=null;this.next=null;this.currentIndex=0;this.hasFoundName=!1;this.nameStartsOn=0;this.nameEndsOn=-1;this.name="";this.parameterContent="";this.activeComponent=null;this.document=t}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){}pushChar(t){this.currentContent.push(t)}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}incrementIndex(){this.currentIndex+=1}getCurrentIndex(){return this.currentIndex}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return this.content.substr(t,e)}resetState(){return this.name="",this.parameterContent="",this.hasFoundName=!1,this.nameStartsOn=0,this.nameEndsOn=-1,this.currentIndex=0,this.content="",this.chars=[],this.currentContent=[],this.inputLen=0,this.prev=null,this.cur=null,this.next=null,this}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}makeDirective(t,e,i){let r=new ut,o=this.getComponentOffset();r.withParser(this.document),t.startsWith("@")&&(t=t.substring(1)),r.directiveName=t.trim(),r.name=t.trim(),t.startsWith("end")?r.name=t.substring(3):t.startsWith("else")&&t!="elseif"&&t!="else"&&(r.name="elseif");let h=this.document.positionFromOffset(o+e,o+e),f=this.document.positionFromOffset(o+i,o+i);if(r.startPosition=h,r.endPosition=f,r.namePosition={start:h,end:f},r.hasDirectiveParameters=!1,r.startPosition!=null&&r.endPosition!=null){let p=r.startPosition.index,E=r.endPosition.index-r.startPosition.index,d=p+E;r.sourceContent=this.document.getContentSubstring(p,E),r.offset={start:p,end:d,length:E}}return r}getComponentOffset(){return(this.activeComponent?.startPosition?.offset??0)+3}makeDirectiveWithParameters(t,e,i,r){let o=this.makeDirective(t,e,i),h=this.getComponentOffset();o.hasDirectiveParameters=!0,o.directiveParameters=r.content;let f=r.content.trim();f.startsWith("(")&&f.endsWith(")")&&(f=f.substring(1),f=f.substring(0,f.length-1),f=f.trim(),o.hasJsonParameters=f.startsWith("{")&&f.endsWith("}"));let p=this.document.positionFromOffset(r.start+h,r.start+h),E=this.document.positionFromOffset(r.end+h,r.end+h);if(o.startPosition=o.namePosition?.start??null,o.endPosition=E,o.directiveParametersPosition={start:p,end:E},o.startPosition!=null&&o.endPosition!=null){let d=o.startPosition.index,x=o.endPosition.index-o.startPosition.index,_=d+x;o.sourceContent=this.document.getContentSubstring(d,x),o.offset={start:d,end:_,length:x}}return o}prepare(t){return this.content=F.normalizeLineEndings(t),this.chars=this.content.split(""),this.inputLen=this.chars.length,this}peek(t){return this.chars[t]}peekRelative(t){return this.peek(this.currentIndex+t)}scanToEndOfComment(t){let e=this.getComponentOffset(),i=!1,r=!1,o=-1,h=-1;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==rt.NewLine&&!i&&(i=!0,o=this.currentIndex),F.ctypeSpace(this.cur)&&!r&&(r=!0,h=this.currentIndex),this.cur==rt.Punctuation_Minus&&this.next==rt.Punctuation_Minus||this.next==null){let f=this.peekRelative(2),p=this.peekRelative(3);if(f==rt.RightBrace&&p==rt.RightBrace||this.next==null){let E=new pi;return E.startPosition=this.document.positionFromOffset(t-2+e,t-2+e),E.endPosition=this.document.positionFromOffset(this.currentIndex+4+e,this.currentIndex+4+e),E.innerContent=this.chars.slice(t+2,this.currentIndex).join(""),E.sourceContent=this.chars.slice(t-2,this.currentIndex+4).join(""),E}else{this.cur!=null&&this.currentContent.push(this.cur);continue}}if(this.cur==null)break;this.currentContent.push(this.cur)}return null}scanToEndOfDirective(){let t=this.currentIndex,e=!1,i="",r=0,o=null;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_Asterisk){Je(this,!0);continue}if(this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_ForwardSlash){ze(this,!0);continue}if(this.cur==rt.NewLine){r=this.currentIndex,i=this.currentContent.join(""),this.currentContent=[],o=this.makeDirective(i,t,r);break}else if(this.next==null){this.currentContent.push(this.cur),r=this.currentIndex+1,i=this.currentContent.join(""),this.currentContent=[],o=this.makeDirective(i,t,r);break}let h=_s(this);if(this.cur!=rt.LeftParen&&h.didFind&&F.ctypePunct(h.char)&&h.char!=rt.LeftParen&&h.char!=rt.Punctuation_Minus&&h.char!="."){this.currentContent.push(this.cur),r=this.currentIndex+1,i=this.currentContent.join(""),this.currentContent=[],o=this.makeDirective(i,t,r);break}if(F.ctypeSpace(this.cur)){let f=_s(this);if(f.didFind&&f.char==rt.LeftParen){r=this.currentIndex-1,i=this.currentContent.join(""),this.currentContent=[],this.currentIndex=f.index,this.checkCurrentOffsets();let p=qi(this);o=this.makeDirectiveWithParameters(i,t,r,p);break}else{r=this.currentIndex,i=this.currentContent.join(""),this.currentContent=[],o=this.makeDirective(i,t,r);break}}else if(this.cur==rt.LeftParen){r=this.currentIndex-1,i=this.currentContent.join(""),this.currentContent=[];let f=qi(this);o=this.makeDirectiveWithParameters(i,t,r,f);break}if(this.cur==null)break;this.currentContent.push(this.cur)}return o}nextPunctuation(){for(let t=this.currentIndex+1;t<this.inputLen;t++){let e=this.chars[t];if(F.ctypePunct(e))return e}return null}scanToEndOfBladeEcho(t){let e=this.getComponentOffset(),i=new de;for(this.currentContent.unshift(),this.currentContent.unshift(),this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==rt.RightBrace&&this.next==rt.RightBrace){let r=this.currentIndex+1;i.startPosition=this.document.positionFromOffset(t+e,t+e),i.endPosition=this.document.positionFromOffset(r+e,r+e),i.withParser(this.document);let o=i.startPosition.index-5,h=i.endPosition.index-i.startPosition.index+3,f=o+h;i.sourceContent=this.content.substr(o,h),i.offset={start:o,end:f,length:h},i.content=this.currentContent.join("");break}if(this.cur==null)break;this.currentContent.push(this.cur)}return i}parse(t){this.resetState().prepare(t.innerContent),this.activeComponent=t;let e=t.getParser(),i=!1,r=-1,o=-1,h=-1,f='"';for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.hasFoundName&&this.cur==rt.LeftBrace&&this.next==rt.LeftBrace){this.currentIndex+=2;let p=this.peekRelative(0),E=this.peekRelative(1);if(p==rt.Punctuation_Minus&&E==rt.Punctuation_Minus){let d=this.scanToEndOfComment(this.currentIndex);if(d!=null){let x=new wn;x.type=1,x.startPosition=d.startPosition,x.endPosition=d.endPosition,x.inlineComment=d,x.type=4,t.hasParameters=!0,t.parameters.push(x),this.currentContent=[],this.currentIndex+=3;continue}debugger}else{let d=this.scanToEndOfBladeEcho(this.currentIndex);if(d!=null){let x=new wn;x.type=1,x.startPosition=d.startPosition,x.endPosition=d.endPosition,x.inlineEcho=d,x.type=3,t.hasParameters=!0,t.parameters.push(x),this.currentContent=[],this.currentIndex+=1;continue}}}if(this.hasFoundName&&this.next!=rt.AtChar&&this.cur==rt.AtChar&&this.currentContent.length==0&&this.nextPunctuation()!=rt.Punctuation_Equals){let p=this.scanToEndOfDirective();if(p!=null){let E=new wn;E.type=1,E.startPosition=p.startPosition,E.endPosition=p.endPosition,E.name=p.directiveName,E.directive=p,t.hasParameters=!0,t.parameters.push(E);continue}}if(this.hasFoundName){if(F.ctypeSpace(this.cur)||this.next==null){if(this.currentContent.length>0){let p=new wn,E=this.getComponentOffset();p.type=2,this.next==null&&!F.ctypeSpace(this.cur)&&this.currentContent.push(this.cur),p.name=this.currentContent.join("");let d=this.currentIndex+E-p.name.length;p.startPosition=this.document.positionFromCursor(d,d),p.endPosition=this.document.positionFromCursor(this.currentIndex+E,this.currentIndex+E),p.namePosition={start:p.startPosition,end:p.endPosition},t.parameters.push(p),t.hasParameters=!0,this.currentContent=[];continue}continue}else i||(i=!0,r=this.currentIndex);if(this.cur==rt.Punctuation_Equals&&Ee(this.next)){f=this.next,o=this.currentIndex-1,this.currentIndex+=1,this.checkCurrentOffsets(),h=this.currentIndex;let p=qe(this),E=new wn;E.withParser(e),E.name=this.currentContent.join(""),E.value=p.value;let d=t.relativeOffset(r+3),x=t.relativeOffset(o+3),_=t.relativeOffset(h+3),u=t.relativeOffset(p.endedOn+3);E.namePosition={start:e.positionFromOffset(d,d),end:e.positionFromOffset(x,x)},E.valuePosition={start:e.positionFromOffset(_,_),end:e.positionFromOffset(u,u)},E.terminatorStyle=f,E.wrappedValue=f+E.value+f,E.content=E.name+"="+E.wrappedValue,E.realName=E.name,E.realName.startsWith(":")&&(E.isExpression=!0,E.realName=E.realName.substring(1),E.realName.startsWith(":")&&(E.isExpression=!1,E.realName=E.realName.substring(1),E.isEscapedExpression=!0)),t.hasParameters=!0,t.parameters.push(E),this.currentContent=[],i=!1,r=-1,o=-1,h=-1,f='"';continue}}else if((F.ctypeSpace(this.cur)||this.next==null)&&this.hasFoundName==!1){this.next==null&&!F.ctypeSpace(this.cur)&&this.currentContent.push(this.cur),this.name=this.currentContent.join(""),this.nameEndsOn=this.currentIndex-1,this.hasFoundName=!0,this.currentContent=[],this.parameterContent=this.chars.slice(this.currentIndex).join("");continue}this.currentContent.push(this.cur)}if(t.name=this.makeComponentName(t),t.parameterContent=this.parameterContent,t.hasParameters)for(let p=0;p<t.parameters.length;p++){let E=t.parameters[p];if(E.type==3&&(E.inlineEcho?.content.trim()).toLowerCase().startsWith("$attributes")){t.receivesAttributeBag=!0;break}}}makeComponentName(t){let e=t.getParser(),i=new zr,r=t.relativeOffset(this.nameStartsOn+3),o=t.relativeOffset(this.nameEndsOn+3);if(i.withParser(e),i.name=this.name,t.isClosingTag&&(i.name=t.innerContent.trim().substring(1)),i.name.includes(":")){let h=i.name.split(":");i.name=h[0],i.inlineName=h.slice(1).join(":")}return i.startPosition=e.positionFromOffset(r,r),i.endPosition=e.positionFromOffset(o,o),i}};var Xc=["x-ref","is","ref"];var Ln=class{constructor(){this.content="";this.nodeIndex=[];this.nodeIndexSkipMap=new Map;this.fragmentStartIndex=[];this.charLen=0;this.documentOffsets=new Map;this.inputLen=0;this.seedOffset=0;this.shiftLine=0;this.chars=[];this.currentIndex=0;this.lastDocumentOffsetKey=null;this.cur=null;this.next=null;this.prev=null;this.chunkSize=5;this.currentChunkOffset=0;this.fragments=[];this.isScript=!1;this.fragmentOpeningIndex=new Map;this.indexedFragments=new Map;this.embeddedIndexedFragments=new Map;this.extractAttributePositions=!1;this.extractAttributeNames=[];this.excludeAttributeNames=[];this.extractedAttributes=[];this.lastFragmentEnded=-1;this.parsingTracedStringHitEof=!1}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}getParsingTracedStringHitEof(){return this.parsingTracedStringHitEof}encounteredFailure(){}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}incrementIndex(){this.currentIndex+=1}getCurrentIndex(){return this.currentIndex}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}pushChar(t){}getChar(t){return this.chars[t]}getSeedOffset(){return this.seedOffset}setDocumentOffsets(t,e){return this.documentOffsets=t,this.lastDocumentOffsetKey=e,this}getClosingFragmentAfter(t){let e=t.name.toLowerCase();for(let i=0;i<this.fragments.length;i++){let r=this.fragments[i];if(r.isClosingFragment&&!r.isSelfClosing&&r.name.toLowerCase()==e&&r.index>t.index)return r}return null}setExcludeAttributes(t){this.excludeAttributeNames=t}setExtractAttributes(t){this.extractAttributePositions=t}setExtractAttributeNames(t){this.extractAttributeNames=t}getContentSubstring(t,e){return this.content.substr(t,e)}getExtractedAttributes(){return this.extractedAttributes}resetState(){return this.fragments=[],this.inputLen=0,this.fragmentStartIndex=[],this.fragmentOpeningIndex.clear(),this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.seedOffset=0,this.cur=null,this.next=null,this.prev=null}positionFromOffset(t,e,i=!1){let r=0,o=0;if(this.documentOffsets.has(t)){let f=this.documentOffsets.get(t);r=f.line,o=f.char}else if(this.documentOffsets.size==0)r=1,o=t+1;else{let f=null,p=null,E=null,d=null;for(let x of this.documentOffsets.keys()){if(x>=t){d!=null&&t>d?(f=E,p=d):(f=this.documentOffsets.get(x),p=x);break}E=this.documentOffsets.get(x),d=x}f==null&&(f=E,p=d),f!=null?(o=t-(p??0),r=f.line,t<=(p??0)?(r=f.line,o=t+1):r=f.line+1):this.lastDocumentOffsetKey!=null&&(r=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,o=t+this.lastDocumentOffsetKey)}let h=new rn;return h.index=e,h.offset=t,h.line=r+this.shiftLine,h.char=o,h}getFragments(){return this.fragments}getFragmentsBetween(t,e){let i=[];return this.fragments.forEach(r=>{let o=r.startPosition?.index??0,h=r.endPosition?.index??0;o>t&&h<e&&i.push(r)}),i}getFragmentContaining(t){for(let e=0;e<this.fragments.length;e++){let i=this.fragments[e];if((i.startPosition?.index??0)<t.index&&(i.endPosition?.index??0)>t.index)return i}return null}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen){let t=!0;if(this.currentIndex==this.charLen-1){let e=F.split(F.substring(this.content,this.currentChunkOffset+this.chunkSize,this.chunkSize));this.currentChunkOffset+=this.chunkSize,this.currentChunkOffset==this.inputLen&&(t=!1),e.forEach(i=>{this.chars.push(i),this.charLen+=1})}t&&this.currentIndex+1<this.chars.length&&(this.next=this.chars[this.currentIndex+1])}}processInputText(t){this.content=t,this.inputLen=this.content.length;let e=[...this.content.matchAll(/(<(?!\?[php|\?=]))/gm)],i=[];e.forEach(r=>{let o=r.index??0;for(let f=0;f<this.nodeIndex.length;f++){let p=this.nodeIndex[f];if(o>=p.start&&o<=p.end)return}let h=this.fetchAt(o,2);h=="<="||h=="<>"||i.push(o)}),this.fragmentStartIndex=i}setIndexRanges(t){return this.nodeIndex=t,this.nodeIndex.forEach(e=>{this.nodeIndexSkipMap.set(e.start,e.end-e.start)}),this}fetchAt(t,e){return this.content.substr(t,e)}getEmbeddedDocumentStructures(){let t=[];return this.getEmbeddedFragments().forEach(e=>{if(!e.isClosingFragment&&!e.isSelfClosing){let i=this.getClosingFragmentAfter(e);i!=null&&t.push({start:e,end:i})}}),t}getFragmentsContainingStructures(){let t=[];return this.fragments.forEach(e=>{if(!e.isClosingFragment&&!e.isSelfClosing&&e.containsStructures){let i=this.getClosingFragmentAfter(e);i!=null&&t.push({start:e,end:i})}}),t}parse(t){if(this.resetState().processInputText(t),this.fragmentStartIndex.length==0)return[];for(let o=0;o<this.fragmentStartIndex.length;o++){let h=this.fragmentStartIndex[o];if(this.resetIntermediateState(),!(h<this.lastFragmentEnded)&&(this.seedOffset=h,this.currentChunkOffset=h,this.parseIntermediateText(),this.isScript)){let f=!1;for(let p=o+1;p<this.fragmentStartIndex.length;p++){let E=this.fragmentStartIndex[p];if(this.fetchAt(E,8).toLowerCase()=="<\/script"){o=p-1,this.isScript=!1,f=!0;break}}if(!f)break}}let i=0,r=0;return this.fragments.forEach(o=>{let h=o.name.toLowerCase();(h=="script"||h=="style")&&(o.embeddedIndex=r,this.embeddedIndexedFragments.set(r,o),r+=1),o.index=i,this.indexedFragments.set(i,o),i+=1}),this.fragments}getFragment(t){return this.indexedFragments.get(t)}getEmbeddedFragment(t){return this.embeddedIndexedFragments.get(t)}getEmbeddedFragments(){let t=[];return this.embeddedIndexedFragments.forEach(e=>{t.push(e)}),t}hasFragments(){return this.fragments.length>0}getCheckAttributeName(t){let e=t.indexOf("."),i=t.indexOf(":");return e!==-1&&(i===-1||e<i)?t.substring(0,e):i!==-1&&(e===-1||i<e)?t.substring(0,i):t}shouldSkip(t){let e=this.getCheckAttributeName(t).toLowerCase();return!!Xc.includes(e)}skipToEndOfPhp(){for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),Ee(this.cur)&&Yn(this),this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_ForwardSlash){ze(this,!0);continue}if(this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_Asterisk){Je(this,!0);continue}if(this.cur==rt.Punctuation_QuestionMark&&this.next==rt.Punctuation_GreaterThan||this.next==null)break}}scanBackToName(t){let e=[];for(let i=t;i>0;i--){let r=this.chars[i];if(F.ctypeSpace(r))break;e.push(r)}return e.reverse().join("")}shouldExtract(t){for(let e=0;e<this.excludeAttributeNames.length;e++)if(new RegExp(this.excludeAttributeNames[e]).test(t))return!1;if(this.extractAttributeNames.length>0){for(let e=0;e<this.extractAttributeNames.length;e++)if(new RegExp(this.extractAttributeNames[e]).test(t))return!0;return!1}return!0}parseIntermediateText(){this.chars=this.content.substr(this.currentChunkOffset,this.chunkSize).split(""),this.charLen=this.chars.length;let t=this.currentIndex,e=[],i=[],r=!1,o=!1,h=null,f=!1;for(this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),F.ctypeSpace(this.cur)&&(r=!0),!Ee(this.cur)&&this.next==rt.Punctuation_LessThan){let p=1;this.cur==rt.Punctuation_ForwardSlash&&(p=2);let E=this.fetchAt(this.currentChunkOffset+p,5);if(E.toLowerCase()=="<?php"||E.startsWith("<?=")){this.skipToEndOfPhp(),f=!0;continue}}if(this.currentIndex>0&&this.cur==rt.Punctuation_LessThan||this.next==null&&this.cur!=rt.Punctuation_GreaterThan)break;if(!r&&this.cur==rt.Punctuation_LessThan&&this.next==rt.Punctuation_ForwardSlash&&(o=!0),!r&&this.cur!=rt.Punctuation_LessThan&&this.cur!=rt.Punctuation_ForwardSlash&&this.cur!=rt.Punctuation_GreaterThan&&i.push(this.cur),r&&this.cur=="@"){let p=this.currentIndex+this.seedOffset+1;if(this.nodeIndexSkipMap.has(p)){let E=this.nodeIndexSkipMap.get(p);this.advance(E);continue}}if(r&&this.cur=="{"){let p=this.currentIndex+this.seedOffset;if(this.nodeIndexSkipMap.has(p)){let E=this.nodeIndexSkipMap.get(p),d=this.fetchAt(p,E+3);if(d.endsWith('"')||d.endsWith("'")){let x=this.scanBackToName(this.currentIndex-1);this.shouldExtract(x)&&(h=x+d.substring(0,d.length-2))}this.advance(E);continue}}if(Ee(this.cur)){let p=this.currentIndex;this.skipToEndOfStringWithIndex();let E=new qr;if(E.startPosition=this.positionFromOffset(p+this.seedOffset,p+this.seedOffset),E.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),e.push(E),this.extractAttributePositions==!0){let d=this.scanBackToName(p-2);if(h!=null&&(d=h),this.shouldExtract(d)){let x=this.getContentSubstring(E.startPosition.offset,E.endPosition.offset-E.startPosition.offset+1),_=$t.fromText(x),u=!0;this.nodeIndexSkipMap.has(E.startPosition.offset+2)&&this.nodeIndexSkipMap.get(E.startPosition.offset+2)+E.startPosition.offset+3==E.endPosition.offset&&(u=!1),x.trim()=="{}"&&(u=!1),this.shouldSkip(d)&&(u=!1),u&&!_.getParser().getHasPairedStructures()&&_.getParser().getFragmentsContainingStructures().length==0&&this.extractedAttributes.push({content:x,name:d,startedOn:E.startPosition.offset,endedOn:E.endPosition.offset+1})}}h=null;continue}if(this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_GreaterThan){let p=new Xs;p.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),p.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset+1,this.currentIndex+this.seedOffset+1),p.parameters=e,p.isSelfClosing=!0,p.name=i.join(""),p.isClosingFragment=o,this.fragments.push(p),o?this.fragmentOpeningIndex.set(p.startPosition.index+1,1):this.fragmentOpeningIndex.set(p.startPosition.index,1);break}if(this.cur==rt.Punctuation_GreaterThan){let p=new Xs;p.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),p.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),p.parameters=e,p.name=i.join(""),p.isClosingFragment=o,this.fragments.push(p),o?this.fragmentOpeningIndex.set(p.startPosition.index+1,1):this.fragmentOpeningIndex.set(p.startPosition.index,1),p.name.toLowerCase()=="script"&&p.isClosingFragment==!1&&(this.isScript=!0);break}}this.lastFragmentEnded=this.currentIndex+this.seedOffset}skipToEndOfStringWithIndex(){let t=this.cur;for(this.incrementIndex(),this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex++){this.checkCurrentOffsets();let e=this.currentIndex+this.seedOffset;if(this.nodeIndexSkipMap.has(e)){let i=this.nodeIndexSkipMap.get(e);this.advance(i-1),this.next==null&&(this.parsingTracedStringHitEof=!0);continue}if(this.cur==t&&this.prev!=rt.String_EscapeCharacter)break}}};var tr=["media","charset","import","namespace","supports","document","page","font-face","keyframes","viewport","counter-style","font-feature-values","swash","ornaments","annotation","stylistic","styleset","character-variant","font-variant-alternates","property","color-profile"];var no=["click","submit","scroll","keydown","keypress","keyup","blur","change","contextmenu","copy","cut","paste","dblclick","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","focus","focusin","focusout","input","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseout","mouseup","mousewheel","resize","select","touchcancel","touchend","touchmove","touchstart","wheel"];var LC={ignoreDirectives:[...tr,...no],directives:[],customIfs:[]};function so(){return LC}var ro=class{static transform(t,e){let i=e;return t.forEach(r=>{r instanceof de?i=i.replace(r.sourceContent,this.transformContent(r.sourceContent)):r instanceof ut&&r.hasDirectiveParameters?i=i.replace(r.sourceContent,this.transformContent(r.sourceContent)):r instanceof Fe&&(i=i.replace(r.sourceContent,F.replaceWithFillerExceptNewlines(r.sourceContent)))}),i}static transformContent(t){return t.replace(/>/g,"B").replace(/</g,"B")}};var _t=class{constructor(){this.nodes=[];this.renderNodes=[];this.chars=[];this.currentIndex=0;this.currentContent=[];this.cur=null;this.next=null;this.prev=null;this.charLen=0;this.inputLen=0;this.maxLine=1;this.chunkSize=5;this.currentChunkOffset=0;this.parsingOffset=0;this.isVerbatim=!1;this.isPhpNode=!1;this.bladeStartIndex=[];this.bladeStartPositionIndex=new Map;this.lastBladeEndIndex=-1;this.lastNode=null;this.documentOffsets=new Map;this.lineIndex=new Map;this.lastDocumentOffsetKey=null;this.content="";this.originalContent="";this.seedOffset=0;this.seedStartLine=1;this.shiftLine=0;this.isParsingComponent=!1;this.shouldIgnoreStructures=!1;this.pushedErrors=new Map;this.errors=[];this.structureErrors=[];this.doesHaveUnclosedIfStructures=!1;this.doesHaveUnclosedSwitchStructures=!1;this.doesHaveUnclosedComments=!1;this.doesHaveUnclosedRegions=!1;this.phpValidator=null;this.didRecoveryLogic=!1;this.parseFragments=!0;this.hasPairedStructures=!1;this.hasComponents=!1;this.hasPhpContent=!1;this.unclosedRegionErrors=[Ft.TYPE_UNEXPECTED_END_OF_INPUT,Ft.TYPE_UNCLOSED_PHP_DIRECTIVE,Ft.TYPE_UNPAIRED_PHP_CLOSING_DIRECTIVE,Ft.TYPE_UNCLOSED_VERBATIM,Ft.TYPE_UNPAIRED_VERBATIM_CLOSING_DIRECTIVE,Ft.TYPE_UNCLOSED_FOR_DIRECTIVE,Ft.TYPE_UNPAIRED_FOR_CLOSING_DIRECTIVE,Ft.TYPE_UNCLOSED_FOR_ELSE_DIRECTIVE,Ft.TYPE_UNPAIRED_FOR_ELSE_CLOSING_DIRECTIVE];this.componentParser=new io(this),this.fragmentsParser=new Ln,this.fragmentsAnalyzer=new Zr(this,this.fragmentsParser),this.parserOptions=so()}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){this.didRecoveryLogic=!0}withPhpValidator(t){return this.phpValidator=t,this}getPhpValidator(){return this.phpValidator}withParserOptions(t){return this.parserOptions=t,this}getParserOptions(){return this.parserOptions}hasUnclosedIfStructures(){return this.doesHaveUnclosedIfStructures}hasUnclosedSwitchStructures(){return this.doesHaveUnclosedSwitchStructures}hasUnclosedComments(){return this.doesHaveUnclosedComments}hasUnclosedRegions(){return this.doesHaveUnclosedRegions}hasUnclosedStructures(){return this.doesHaveUnclosedComments||this.doesHaveUnclosedIfStructures||this.doesHaveUnclosedSwitchStructures||this.doesHaveUnclosedRegions}getErrors(){return this.errors}getStructureErrors(){return this.structureErrors}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}incrementIndex(){this.currentIndex+=1}getCurrentIndex(){return this.currentIndex}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}getChar(t){return this.chars[t]}pushChar(t){this.currentContent.push(t)}getSeedOffset(){return this.seedOffset}getContentSubstring(t,e){return this.content.substr(t,e)}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.currentContent=[],this.cur=null,this.next=null,this.prev=null}setSeedPosition(t){return t==null?this.shiftLine=0:this.shiftLine=t.line,this}resetState(){this.nodes=[],this.renderNodes=[],this.charLen=0,this.bladeStartIndex=[],this.lastBladeEndIndex=-1}getHasPhpContent(){return this.hasPhpContent}getDidRecovery(){return this.didRecoveryLogic}isStartingPhp(){return this.cur==_t.Punctuation_LessThan&&this.next==_t.Punctuation_QuestionMark?this.fetchAt(this.currentChunkOffset,5).toLowerCase()=="<?php":!1}isStartingShorthandPhp(){return this.cur==_t.Punctuation_LessThan&&this.next==_t.Punctuation_QuestionMark?this.fetchAt(this.currentChunkOffset,3).toLowerCase()=="<?=":!1}isStartingDirective(){return this.next!=null&&!F.ctypeAlpha(this.next)?!1:this.cur==_t.AtChar&&this.next!=null&&this.prev!=_t.AtChar?!!F.ctypeSpace(this.prev):!1}isClosingComponent(){return this.cur==_t.Punctuation_GreaterThan&&this.prev!=_t.Punctuation_Minus&&this.prev!=_t.Punctuation_Equals}isStartingClosingComponentTag(){return this.cur==_t.Punctuation_LessThan&&this.next==_t.Punctuation_ForwardSlash&&this.peekRelative(2)=="x"&&(this.peekRelative(3)==_t.Punctuation_Minus||this.peekRelative(3)==_t.Punctuation_Colon)}isStartingOpeningComponentTag(){return this.cur==_t.Punctuation_LessThan&&this.next=="x"&&(this.peekRelative(2)==_t.Punctuation_Minus||this.peekRelative(2)==_t.Punctuation_Colon)}isStartingEscapedEcho(){return(this.prev==null||this.prev!=null&&this.prev!=_t.AtChar)&&this.next==_t.Punctuation_Exclamation&&this.cur==_t.LeftBrace&&this.peek(2)==_t.Punctuation_Exclamation}isStartingBladeNodeStructure(){return(this.prev==null||this.prev!=null&&this.prev!=_t.AtChar)&&this.next==_t.LeftBrace&&this.cur==_t.LeftBrace&&this.next==_t.LeftBrace}hasEncounteredAnotherStructure(){return this.shouldIgnoreStructures?!1:this.isStartingOpeningComponentTag()?!0:this.isParsingComponent?!1:!!(this.isStartingClosingComponentTag()||this.isStartingDirective()||this.isStartingEscapedEcho()||this.isStartingBladeNodeStructure())}endsWithTld(t){return/\.[a-z]{2,63}$/i.test(t)}processInputText(t){this.originalContent=t,this.content=F.normalizeLineEndings(t),this.inputLen=this.content.length;let e=[...this.content.matchAll(/(\n)/gm)],i=e.length,r=this.seedStartLine,o=null,h=0,f=0;for(let c=0;c<i;c++){let g=e[c],y=g.index??0,T=y;o!=null?T=y-o:T=T+1,this.documentOffsets.set(y,{char:T,line:r});let w=0,R=0;c==0?(R=T-1,w=0):(w=f+1,R=y),this.lineIndex.set(r,{char:T,line:r,startIndex:w,endIndex:R}),this.lastDocumentOffsetKey=y,this.maxLine=r,r+=1,o=y,f=R,h=w}this.maxLine+=1;let p=[...this.content.matchAll(/({{|<\?php|<\?=|@?{!!|@|<x-|<\/x-|<x:|<\/x:)/gm)],E=0,d=!1,x=!1,_,u=!1;return p.forEach(c=>{x?_!=null&&(c.index??0)-(_.index??0)>1&&(d=!1,x=!1,E=c.index??0):u&&c.index&&(E=c.index??0,u=!1);let g=c[0],y=this.content.indexOf(g,E),T=this.content.substr(y,10);if(T.startsWith("@@")||T.startsWith("@{{")){E=this.content.indexOf(g,E),d=!0,T.startsWith("@@")?x=!0:x=!1,_=c;return}let w=this.content.indexOf(g,E);if(d){if(_!=null)if((c.index??0)-(_.index??0)<=1){E=w,_=c;return}else d=!1;if(E==w||w-E<=1){E=w,_=c;return}else d=!1}let R=3,M=!1,J=!1,W=[],j=[];this.parserOptions.ignoreDirectives.length>0&&(this.parserOptions.ignoreDirectives.forEach(st=>{W.push(st.toLowerCase()),st.length>R&&(R=st.length)}),R+=5,M=!0),this.parserOptions.directives.length>0&&(R=3,this.parserOptions.directives.forEach(st=>{j.push(st.toLowerCase()),st.length>R&&(R=st.length)}),R+=5,M=!1,J=!0);let ot=this.fetchAt(w,R);if(ot.includes(".")){let st=ot;ot.includes(`
`)&&(st=F.breakByNewLine(st)[0]);let kt=Zi.fromText(st);if(kt.includes(".")&&this.endsWithTld(kt)){_=c,u=!0;return}}if(ot.startsWith("@{")==!1){let st=ot.substring(0,1),kt=ot.substring(1,2);if(st=="@"&&F.ctypeAlpha(kt))if(J){let gt=this.breakPreFetch(ot).toLowerCase();j.includes(gt)&&this.bladeStartIndex.push(w)}else if(M){let gt=this.breakPreFetch(ot).toLowerCase();W.includes(gt)||gt.endsWith("{")||this.bladeStartIndex.push(w)}else this.bladeStartIndex.push(w);else st!="@"&&this.bladeStartIndex.push(w)}this.bladeStartPositionIndex.set(w,1),E=w+2,d=!1,_=c}),this.fragmentsParser.setDocumentOffsets(this.documentOffsets,this.lastDocumentOffsetKey),!0}breakPreFetch(t){let r=F.replaceAllInString(F.normalizeLineEndings(t),`
`," ").split(" ")[0].split("(")[0].trim();return r.startsWith("@")&&(r=r.substring(1)),r.includes("=")&&(r=r.substring(0,r.indexOf("="))),r.includes("<")&&(r=r.substring(0,r.indexOf("<"))),r.includes(">")&&(r=r.substring(0,r.indexOf(">"))),r.toLowerCase()}fetchAt(t,e){return this.content.substr(t,e)}shouldSkipForward(){return this.lastNode==null?!0:!(this.lastNode instanceof ut&&(this.lastNode.directiveName==vt.Verbatim||this.lastNode.directiveName==vt.Php))}setParseFragments(t){this.parseFragments=t}pushError(t){let e=t.hash();this.pushedErrors.has(e)||(t.errorCode==Ft.TYPE_PARSE_UNCLOSED_CONDITION?(this.doesHaveUnclosedIfStructures=!0,this.structureErrors.push(t)):t.errorCode==Ft.TYPE_PARSE_UNCLOSED_SWITCH?(this.doesHaveUnclosedSwitchStructures=!0,this.structureErrors.push(t)):t.errorCode==Ft.TYPE_UNCLOSED_COMMENT?(this.doesHaveUnclosedComments=!0,this.structureErrors.push(t)):this.unclosedRegionErrors.includes(t.errorCode)&&(this.doesHaveUnclosedRegions=!0,this.structureErrors.push(t)),this.pushedErrors.set(e,t),this.errors.push(t))}getContent(){return this.content}getOriginalContent(){return this.originalContent}getFragments(){return this.fragmentsParser.getFragments()}getFragmentsParser(){return this.fragmentsParser}getFragmentsContainingStructures(){return this.fragmentsParser.getFragmentsContainingStructures()}charLeftAt(t){return t==null||t.char<=1?null:this.charAt(this.positionFromCursor(t.line,t.char-1))}charLeftAtCursor(t,e){return this.charLeftAt(this.positionFromCursor(t,e))}charRightAt(t){return t==null?null:this.charAt(this.positionFromCursor(t.line,t.char+1))}charRightAtCursor(t,e){return this.charRightAt(this.positionFromCursor(t,e))}punctuationLeftAt(t,e=4){if(t==null)return null;let i=this.getLineText(t.line);return i==null?null:sn.findLeftNeighboringNextPunctuation(t.char,i,e)}punctuationLeftAtCursor(t,e,i=4){return this.punctuationLeftAt(this.positionFromCursor(t,e),i)}punctuationRightAt(t,e=4){if(t==null)return null;let i=this.getLineText(t.line);return i==null?null:sn.findRightBeighboringNextPunctuation(t.char,i,e)}punctuationRightAtCursor(t,e,i=4){return this.punctuationRightAt(this.positionFromCursor(t,e),i)}wordRightAt(t,e=4){if(t==null)return null;let i=this.getLineText(t.line);if(i==null)return null;let r=sn.findRightNeighboringNextAlphaNumeric(t.char,i,e);return r==null?null:sn.scanWordAt(r,i,e)}wordRightAtCursor(t,e,i=4){return this.wordRightAt(this.positionFromCursor(t,e),i)}wordLeftAt(t,e=4){if(t==null)return null;let i=this.getLineText(t.line);if(i==null)return null;let r=sn.findLeftNeighboringNextAlphaNumeric(t.char,i,e);return r==null?null:sn.scanWordAt(r,i,e)}wordLeftAtCursor(t,e,i=4){return this.wordLeftAt(this.positionFromCursor(t,e),i)}wordAt(t,e=4){if(t==null)return null;let i=this.getLineText(t.line);return i==null?null:sn.scanWordAt(t.char,i,e)}getLineText(t){let e=this.getLineIndex(t);return e!=null?F.trimRight(this.getContent().substring(e.start,e.end+1)):null}wordAtCursor(t,e,i=4){return this.wordAt(this.positionFromCursor(t,e),i)}charAt(t){return t==null?null:this.content.substr(t.offset,1)}getLinesAround(t){let e=new Map,i=t-3,r=t+3;i<1&&(i=1),r>this.maxLine&&(r=this.maxLine);for(let o=i;o<=r;o++)e.set(o,this.getLineText(o)??"");return e}charAtCursor(t,e){return this.charAt(this.positionFromCursor(t,e))}getLineIndex(t){if(t==this.maxLine){let i=this.lineIndex.get(t-1);if(i!=null){let r=i.endIndex+1;return{end:this.inputLen-1,start:r}}return null}let e=this.lineIndex.get(t);return e!=null?{start:e.startIndex,end:e.endIndex}:null}getHasPairedStructures(){return this.hasPairedStructures}getHasComponents(){return this.hasComponents}positionFromCursor(t,e){if(t==this.maxLine){let r=this.lineIndex.get(t-1);if(r!=null){let o=r.endIndex+1,h=o+(e-1),f=new rn;return f.offset=h,f.line=t,f.char=e,f.index=h,f}return null}let i=this.lineIndex.get(t);if(i!=null){let r=new rn;return r.offset=i.startIndex+(e-1),r.line=i.line,r.char=e,r.index=i.startIndex+(e-1),r}return null}parse(t){if(Pe.customIfs.clear(),this.parserOptions.customIfs.forEach(f=>{Pe.customIfs.set(f,1)}),!this.processInputText(t))return[];let e=this.bladeStartIndex.length,i=e-1;if(e==0&&!this.isVerbatim){let f=new Pt;f.withParser(this),f.content=this.prepareLiteralContent(this.content),f.startPosition=this.positionFromOffset(0,0),f.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1),this.nodes.push(f)}else for(let f=0;f<e;f+=1){let p=this.bladeStartIndex[f];if(this.seedOffset=p,f==0&&p>0&&!this.isVerbatim){let d=new Pt;d.withParser(this),d.content=this.prepareLiteralContent(this.content.substr(0,p)),d.content.length>0&&(d.startPosition=this.positionFromOffset(0,0),d.endPosition=this.positionFromOffset(p,p-1),this.nodes.push(d))}if(p<this.lastBladeEndIndex)continue;if(this.currentChunkOffset=p,this.parsingOffset=p,this.resetIntermediateState(),this.parseIntermediateText(p),this.isVerbatim){let d=!1;for(let x=f+1;x<this.bladeStartIndex.length;x++){let _=this.bladeStartIndex[x];if(this.fetchAt(_,12)=="@endverbatim"){f=x-1,this.isVerbatim=!1,d=!0;break}}if(d)continue}if(this.isPhpNode){let d=!1;for(let x=f+1;x<this.bladeStartIndex.length;x++){let _=this.bladeStartIndex[x];if(this.fetchAt(_,7)=="@endphp"){f=x-1,this.isPhpNode=!1,d=!0;break}}if(d)continue}if(this.lastNode instanceof pi||this.lastNode instanceof Fe){let d=-1;for(let x=f;x<this.bladeStartIndex.length;x++){let _=this.bladeStartIndex[x];if(_>this.lastBladeEndIndex){d=_;break}}if(d!=-1){let x=1;this.lastNode instanceof Fe&&(x=0);let _=this.lastBladeEndIndex+x,u=this.content.substr(this.lastBladeEndIndex+x,d-this.lastBladeEndIndex-x),c=d-1,g=new Pt;g.withParser(this),g.startPosition=this.positionFromOffset(_,_),g.endPosition=this.positionFromOffset(c,c),g.content=u,this.nodes.push(g),this.lastNode=g,this.lastBladeEndIndex=c;continue}}this.lastNode instanceof Ie&&(p-=2);let E=!1;if(this.bladeStartPositionIndex.has(this.currentChunkOffset)?this.lastBladeEndIndex<this.currentChunkOffset&&(E=!0):E=!0,E){if(f+1<e){let d=this.bladeStartIndex[f+1],x=1;this.lastNode instanceof Fe&&(x=0);let _=this.lastBladeEndIndex+x;if(d<_)if(this.lastBladeEndIndex>d)f+2<e&&(d=this.bladeStartIndex[f+2]);else continue;if(this.shouldSkipForward())for(let u=f;u<this.bladeStartIndex.length;u++){let c=this.bladeStartIndex[u];if(c>this.lastBladeEndIndex){d=c;break}}if(f+1==i&&d<=this.lastBladeEndIndex){if(this.isVerbatim)break;let u=this.currentChunkOffset,c=this.content.substr(_),g=new Pt;g.withParser(this),g.content=this.prepareLiteralContent(c),g.content.length>0&&(g.startPosition=this.positionFromOffset(u,u),g.endPosition=this.positionFromOffset(d,d-1),this.nodes.push(g));break}else{let u=d-this.lastBladeEndIndex-1;if(u<0&&this.lastNode instanceof Ie){let w=!0;for(let R=f;R<this.bladeStartIndex.length;R++){let M=this.bladeStartIndex[R];if(M>this.lastBladeEndIndex){d=M,w=!1;break}}if(w){let R=this.currentIndex+p;if(R<this.inputLen&&!this.isVerbatim){let M=new Pt;M.withParser(this),M.content=this.prepareLiteralContent(this.content.substr(R)),M.content.length>0&&(M.startPosition=this.positionFromOffset(R,R),M.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1),this.nodes.push(M));break}}}if(u==0||this.isVerbatim)continue;let c=this.shiftIndexToWhitespace(_),g=_-c,y=this.content.substr(c,u+g),T=new Pt;T.withParser(this),T.content=this.prepareLiteralContent(y),T.content.length>0&&(T.startPosition=this.positionFromOffset(_,_),T.endPosition=this.positionFromOffset(d,d-1),this.nodes.push(T))}continue}if(f!==i&&this.lastNode!=null&&this.lastNode.endPosition!=null&&this.positionFromOffset(p,p).isBefore(this.lastNode.endPosition)){if(f+1<e){if(this.bladeStartIndex[f+1]<this.lastNode.endPosition.offset)continue}else if(f+1!=i)continue}if(f==i){let d=this.currentIndex+p;if(d<this.inputLen&&!this.isVerbatim){let x=new Pt;x.withParser(this),x.content=this.prepareLiteralContent(this.content.substr(this.shiftIndexToWhitespace(d))),x.content.length>0&&(x.startPosition=this.positionFromOffset(d,d),x.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1),this.nodes.push(x));break}}}}let r=0;this.nodes.forEach(f=>{f.index=r,r+=1});let o=null;for(let f=0;f<this.nodes.length;f++){let p=this.nodes[f],E=null;f+1<this.nodes.length&&(E=this.nodes[f+1]),p.prevNode=o,p.nextNode=E,o=p}Pe.determineCandidates(this.nodes),this.nodes=Xr.rewrite(this.nodes);let h=new Zs;return this.renderNodes=h.associate(this.nodes,this),this.hasPairedStructures=h.getPairsCreated()>0,to.analyze(this.nodes),eo.analyze(this.nodes),this.nodes.forEach(f=>{if(f instanceof ut){let p=f,E=p.directiveName.toLowerCase();if(p.isClosedBy!=null){let d=p.getImmediateChildren();for(let x=0;x<d.length;x++){let _=d[x];if(_ instanceof ut&&_!=p.isClosedBy&&_.isClosedBy!=null){p.containsChildStructures=!0;break}else if(_ instanceof Ke||_ instanceof di||_ instanceof mi){p.containsChildStructures=!0;break}}}E=="switch"&&p.isClosedBy==null||E=="endswitch"&&p.isOpenedBy==null?p.pushError(ve.makeSyntaxError(Ft.TYPE_PARSE_UNCLOSED_SWITCH,p,"Unclosed switch control structure",0)):E=="php"?p.hasDirectiveParameters==!1&&p.isClosedBy==null&&p.pushError(ve.makeSyntaxError(Ft.TYPE_UNCLOSED_PHP_DIRECTIVE,p,"Unclosed @php directive",0)):E=="endphp"&&p.isOpenedBy==null?p.pushError(ve.makeSyntaxError(Ft.TYPE_UNPAIRED_PHP_CLOSING_DIRECTIVE,p,"Unpaired @endphp directive",0)):E=="verbatim"&&p.isClosedBy==null?p.pushError(ve.makeSyntaxError(Ft.TYPE_UNCLOSED_VERBATIM,p,"Unclosed @verbatim directive",0)):E=="endverbatim"&&p.isOpenedBy==null?p.pushError(ve.makeSyntaxError(Ft.TYPE_UNPAIRED_VERBATIM_CLOSING_DIRECTIVE,p,"Unpaired @endverbatim directive",0)):E=="for"&&p.isClosedBy==null?p.pushError(ve.makeSyntaxError(Ft.TYPE_UNCLOSED_FOR_DIRECTIVE,p,"Unclosed @for directive",0)):E=="for"&&p.isClosingDirective==!0&&p.isOpenedBy==null?p.pushError(ve.makeSyntaxError(Ft.TYPE_UNPAIRED_FOR_CLOSING_DIRECTIVE,p,"Unpaired @endfor directive",0)):E=="forelse"?(p.isClosedBy==null&&p.pushError(ve.makeSyntaxError(Ft.TYPE_UNCLOSED_FOR_ELSE_DIRECTIVE,p,"Unclosed @forelse directive",0)),p.findFirstDirectChildDirectiveOfType("empty")==null&&p.pushError(ve.makeSyntaxError(Ft.TYPE_FOR_ELSE_MISSING_EMPTY_DIRECTIVE,p,"@forelse missing @empty directive",1))):E=="endforelse"&&p.isOpenedBy==null&&p.pushError(ve.makeSyntaxError(Ft.TYPE_UNPAIRED_FOR_ELSE_CLOSING_DIRECTIVE,p,"Unpaired @endforelse directive",0))}}),this.createChildDocuments(this.renderNodes),this.parseFragments&&this.content.length>0&&this.fragmentsParser.setIndexRanges(this.getNodeIndexRanges()).parse(ro.transform(this.nodes,this.content)),this.fragmentsAnalyzer.analyze(),this.renderNodes.forEach(f=>{f instanceof Ke?(f.fragment=f.constructedFrom?.fragment??null,f.fragmentPosition=f.constructedFrom?.fragmentPosition??3):f instanceof mi?(f.fragment=f.constructedFrom?.fragment??null,f.fragmentPosition=f.constructedFrom?.fragmentPosition??3):f instanceof di&&(f.fragment=f.constructedFrom?.fragment??null,f.fragmentPosition=f.constructedFrom?.fragmentPosition??3)}),$r.setChildTypeCounts(this.nodes),this.renderNodes}shiftIndexToWhitespace(t){let e=t,i=this.content[e];if(t>0){if(i=this.content[e-1],!F.ctypeSpace(i)||i===`
`)return t;for(;F.ctypeSpace(i);){if(e-=1,e<0)return 0;if(i=this.content[e],i===`
`){e+=1;break}}return e!=t?t-1:e+1}return t}getNodeIndexRanges(){let t=[];return this.nodes.forEach(e=>{e instanceof Pt||t.push({start:e.startPosition?.index??0,end:e.endPosition?.index??0})}),t}createChildDocuments(t){t.forEach(e=>{if(e instanceof ut&&e.isClosedBy!=null){let i=e.isClosedBy,r=(e.startPosition?.index??0)-1,o=(i.endPosition?.index??0)-r;e.nodeContent=this.content.substr(r,o);let h=e.endPosition?.index??0,f=(i.startPosition?.index??0)-1-h,p=this.content.substr(h,f);e.childrenDocument=$t.childFromText(p,this,Ti(e.getChildren()))}})}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}let t=Math.ceil(this.currentIndex/5);t>0&&(this.currentChunkOffset=this.parsingOffset+this.chunkSize*t),this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&this.currentIndex+1<this.chars.length&&(this.next=this.chars[this.currentIndex+1])}parseIntermediateText(t){this.currentContent=[],this.chars=this.content.substring(t).split(""),this.charLen=this.chars.length;let e=!1;for(this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.isStartingShorthandPhp()){this.scanToEndOfPhp(this.currentIndex,!0),this.currentIndex+=2,this.lastBladeEndIndex=this.currentIndex+this.seedOffset,this.currentContent=[];break}if(this.isStartingPhp()){this.scanToEndOfPhp(this.currentIndex),this.currentIndex+=2,this.lastBladeEndIndex=this.currentIndex+this.seedOffset,this.currentContent=[];break}if(this.isStartingDirective()){this.currentIndex+=1,this.scanToEndOfDirective(),this.currentContent=[],this.currentIndex+=1,e=!0;break}if(this.isStartingClosingComponentTag()){let i=this.currentIndex;this.currentIndex+=4,this.currentContent=[],this.checkCurrentOffsets(),this.isParsingComponent=!0,this.scanToEndOfComponentTag(i,!0),this.isParsingComponent=!1,this.currentIndex+=3,this.currentContent=[],e=!0;break}if(this.isStartingOpeningComponentTag()){let i=this.currentIndex;this.currentIndex+=3,this.currentContent=[],this.checkCurrentOffsets(),this.isParsingComponent=!0,this.scanToEndOfComponentTag(i,!1),this.isParsingComponent=!1,this.currentContent=[],this.currentIndex+=3,e=!0;break}if(this.isStartingEscapedEcho()){let i=this.currentIndex;this.currentIndex+=3,this.currentContent=[],this.checkCurrentOffsets(),this.scanToEndOfEscapedEcho(i),this.currentContent=[],this.currentIndex+=3,e=!0;break}if(this.isStartingBladeNodeStructure()){let i=this.peek(2),r=this.peek(3);if(i==_t.Punctuation_Minus&&r==_t.Punctuation_Minus){let o=this.currentIndex;this.currentIndex+=4,this.currentContent=[],this.checkCurrentOffsets(),this.scanToEndOfComment(o),this.currentContent=[],this.currentIndex+=4,e=!0;break}else if(i==_t.LeftBrace){let o=this.currentIndex;this.currentIndex+=3,this.scanToEndOfBladeEntitiesEcho(o+1),this.currentContent=[],this.currentIndex+=3,e=!0;break}else{let o=this.currentIndex;this.currentIndex+=2,this.scanToEndOfBladeEcho(o+1),this.currentContent=[],this.currentIndex+=2,e=!0;break}}}return e}peek(t){return this.chars[t]}peekRelative(t){return this.peek(this.currentIndex+t)}scanToEndOfPhp(t,e=!1){for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),Ee(this.cur)&&Yn(this),this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_ForwardSlash){this.shouldIgnoreStructures=!0,ze(this,!0),this.shouldIgnoreStructures=!1;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_Asterisk){this.shouldIgnoreStructures=!0,Je(this,!0),this.shouldIgnoreStructures=!1;continue}if(this.cur==_t.Punctuation_QuestionMark&&this.next==_t.Punctuation_GreaterThan||this.next==null){let i=new Fe;this.hasPhpContent=!0,e&&(i=new Jr),i.withParser(this),i.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),i.endPosition=this.positionFromOffset(this.currentIndex+1+this.seedOffset,this.currentIndex+1+this.seedOffset);let r=i.startPosition.index,o=i.endPosition.index-i.startPosition.index+1;i.sourceContent=this.content.substr(r,o),this.nodes.push(i),this.lastNode=i;break}}}scanToEndOfComponentTag(t,e){let i=!1,r=!1,o=-1,h=-1,f=!1;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==_t.NewLine&&!i&&(i=!0,o=this.currentIndex),F.ctypeSpace(this.cur)&&!r&&(r=!0,h=this.currentIndex),Ee(this.cur)){this.shouldIgnoreStructures=!0,Yn(this),this.shouldIgnoreStructures=!1;continue}let p=this.isClosingComponent();if((this.hasEncounteredAnotherStructure()||this.next==null&&!p)&&(f=!0,o!=-1?(this.currentIndex=o-2,this.currentContent=this.currentContent.slice(0,o-2),this.didRecoveryLogic=!0):h!=-1&&(this.currentIndex=h-2,this.currentContent=this.currentContent.slice(0,h-2),this.didRecoveryLogic=!0)),p||f){let E=new Ie;this.hasComponents=!0,E.withParser(this),E.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),E.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset);let d=E.startPosition.index,x=E.endPosition.index-E.startPosition.index+1,_=d+x;E.sourceContent=this.content.substr(d,x),E.isClosingTag=e,E.isSelfClosing=this.prev==_t.Punctuation_ForwardSlash,E.offset={start:d,end:_,length:x};let u=3;E.isSelfClosing&&(u+=1),E.innerContent=this.content.substr(E.startPosition.index+3,E.endPosition.index-E.startPosition.index-u),f&&E.pushError(ve.makeSyntaxError(Ft.TYPE_UNEXPECTED_END_OF_INPUT,E,"Unexpected end of input while parsing component tag",0)),this.componentParser.parse(E),this.currentContent=[],this.lastBladeEndIndex=this.currentIndex+this.seedOffset,this.lastNode=E,this.nodes.push(E);break}}}scanToEndOfEscapedEcho(t){let e=!1,i=!1,r=-1,o=-1,h=!1;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==_t.NewLine&&!e&&(e=!0,r=this.currentIndex),F.ctypeSpace(this.cur)&&!i&&(i=!0,o=this.currentIndex),Ee(this.cur)){let f=this.cur;this.shouldIgnoreStructures=!0;let p=qe(this);this.shouldIgnoreStructures=!1,this.currentIndex=p.endedOn,this.currentContent.push(f),this.currentContent=this.currentContent.concat(p.value.split("")),this.currentContent.push(f),this.currentIndex=p.endedOn;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_ForwardSlash){this.shouldIgnoreStructures=!0,ze(this,!0),this.shouldIgnoreStructures=!1;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_Asterisk){this.shouldIgnoreStructures=!0,Je(this,!0),this.shouldIgnoreStructures=!1;continue}if((this.hasEncounteredAnotherStructure()||this.next==null)&&(h=!0,r!=-1?(this.currentIndex=r-2,this.currentContent=this.currentContent.slice(0,r-2),this.didRecoveryLogic=!0):o!=-1&&(this.currentIndex=o-2,this.currentContent=this.currentContent.slice(0,o-2),this.didRecoveryLogic=!0)),this.cur==_t.Punctuation_Exclamation&&this.next==_t.Punctuation_Exclamation&&this.peekRelative(2)==_t.RightBrace||h){let f=this.currentIndex+2,p=new en;p.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),p.endPosition=this.positionFromOffset(f+this.seedOffset,f+this.seedOffset),p.withParser(this);let E=p.startPosition.index,d=p.endPosition.index-p.startPosition.index+1,x=E+d;p.sourceContent=this.content.substr(E,d),p.offset={start:E,end:x,length:d},h&&p.pushError(ve.makeSyntaxError(Ft.TYPE_UNEXPECTED_END_OF_INPUT,p,"Unexpected end of input while parsing echo",0)),p.content=this.currentContent.join(""),this.currentContent=[],this.lastBladeEndIndex=this.currentIndex+2+this.seedOffset,this.lastNode=p,this.nodes.push(p);break}if(this.cur==null)break;this.currentContent.push(this.cur)}}scanToEndOfComment(t){let e=!1,i=!1,r=-1,o=-1,h=!1;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==_t.NewLine&&!e&&(e=!0,r=this.currentIndex),F.ctypeSpace(this.cur)&&!i&&(i=!0,o=this.currentIndex),this.next==null&&(h=!0,r!=-1?(this.currentIndex=r-2,this.currentContent=this.currentContent.slice(0,r-2),this.didRecoveryLogic=!0):o!=-1&&(this.currentIndex=o-2,this.currentContent=this.currentContent.slice(0,o-2),this.didRecoveryLogic=!0)),this.cur==_t.Punctuation_Minus&&this.next==_t.Punctuation_Minus||this.next==null){let f=this.peekRelative(2),p=this.peekRelative(3);if(f==_t.RightBrace&&p==_t.RightBrace||this.next==null){let E=this.currentIndex+3,d=new pi;d.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),d.endPosition=this.positionFromOffset(E+this.seedOffset,E+this.seedOffset),d.innerContentPosition={start:this.positionFromOffset(t+4+this.seedOffset,t+4+this.seedOffset),end:this.positionFromOffset(E-4+this.seedOffset,E-4+this.seedOffset)},d.withParser(this);let x=d.startPosition.index,_=d.endPosition.index-d.startPosition.index+1,u=x+_;d.sourceContent=this.content.substr(x,_),d.offset={start:x,end:u,length:_},h&&d.pushError(ve.makeSyntaxError(Ft.TYPE_UNCLOSED_COMMENT,d,"Unexpected end of input while parsing comment",0)),d.innerContent=this.content.substr(d.innerContentPosition?.start?.index??0,(d.innerContentPosition?.end?.index??0)-(d.innerContentPosition?.start?.index??0)+1),this.currentContent=[],this.lastBladeEndIndex=this.currentIndex+3+this.seedOffset,this.lastNode=d,this.nodes.push(d);break}else{this.cur!=null&&this.currentContent.push(this.cur);continue}}if(this.cur==null)break;this.currentContent.push(this.cur)}}scanToEndOfBladeEntitiesEcho(t){let e=!1,i=!1,r=-1,o=-1,h=!1;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==_t.NewLine&&!e&&(e=!0,r=this.currentIndex),F.ctypeSpace(this.cur)&&!i&&(i=!0,o=this.currentIndex),Ee(this.cur)){let f=this.cur;this.shouldIgnoreStructures=!0;let p=qe(this);this.shouldIgnoreStructures=!1,this.currentIndex=p.endedOn,this.currentContent.push(f),this.currentContent=this.currentContent.concat(p.value.split("")),this.currentContent.push(f),this.currentIndex=p.endedOn;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_ForwardSlash){this.shouldIgnoreStructures=!0,ze(this,!0),this.shouldIgnoreStructures=!1;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_Asterisk){this.shouldIgnoreStructures=!0,Je(this,!0),this.shouldIgnoreStructures=!1;continue}if((this.hasEncounteredAnotherStructure()||this.next==null)&&(h=!0,r!=-1?(this.currentIndex=r-2,this.currentContent=this.currentContent.slice(0,r-2),this.didRecoveryLogic=!0):o!=-1&&(this.currentIndex=o-2,this.currentContent=this.currentContent.slice(0,o-2),this.didRecoveryLogic=!0)),this.cur==_t.RightBrace&&this.next==_t.RightBrace&&this.peekRelative(2)==_t.RightBrace||h){let f=this.currentIndex+1,p=new nn;p.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),p.endPosition=this.positionFromOffset(f+this.seedOffset,f+this.seedOffset),p.withParser(this);let E=p.startPosition.index-1,d=p.endPosition.index-p.startPosition.index+3,x=E+d;p.sourceContent=this.content.substr(E,d),p.offset={start:E,end:x,length:d},h&&p.pushError(ve.makeSyntaxError(Ft.TYPE_UNEXPECTED_END_OF_INPUT,p,"Unexpected end of input while parsing echo",0)),p.content=this.currentContent.join(""),this.currentContent=[],this.lastBladeEndIndex=this.currentIndex+2+this.seedOffset,this.lastNode=p,this.nodes.push(p);break}if(this.cur==null)break;this.currentContent.push(this.cur)}}scanToEndOfBladeEcho(t){let e=!1,i=!1,r=-1,o=-1,h=!1;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==_t.NewLine&&!e&&(e=!0,r=this.currentIndex),F.ctypeSpace(this.cur)&&!i&&(i=!0,o=this.currentIndex),Ee(this.cur)){let f=this.cur;this.shouldIgnoreStructures=!0;let p=qe(this);this.shouldIgnoreStructures=!1,this.currentIndex=p.endedOn,this.currentContent.push(f),this.currentContent=this.currentContent.concat(p.value.split("")),this.currentContent.push(f),this.currentIndex=p.endedOn;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_ForwardSlash){this.shouldIgnoreStructures=!0,ze(this,!0),this.shouldIgnoreStructures=!1;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_Asterisk){this.shouldIgnoreStructures=!0,Je(this,!0),this.shouldIgnoreStructures=!1;continue}if((this.hasEncounteredAnotherStructure()||this.next==null)&&(h=!0,r!=-1?(this.currentIndex=r-2,this.currentContent=this.currentContent.slice(0,r-2),this.didRecoveryLogic=!0):o!=-1&&(this.currentIndex=o-2,this.currentContent=this.currentContent.slice(0,o-2),this.didRecoveryLogic=!0)),this.cur==_t.RightBrace&&this.next==_t.RightBrace||h){let f=this.currentIndex+1,p=new de;p.startPosition=this.positionFromOffset(t+this.seedOffset,t+this.seedOffset),p.endPosition=this.positionFromOffset(f+this.seedOffset,f+this.seedOffset),p.withParser(this);let E=p.startPosition.index-1,d=p.endPosition.index-p.startPosition.index+2,x=E+d;p.sourceContent=this.content.substr(E,d),p.offset={start:E,end:x,length:d},h&&p.pushError(ve.makeSyntaxError(Ft.TYPE_UNEXPECTED_END_OF_INPUT,p,"Unexpected end of input while parsing echo",0)),p.content=this.currentContent.join(""),this.currentContent=[],this.lastBladeEndIndex=this.currentIndex+1+this.seedOffset,this.lastNode=p,this.nodes.push(p);break}if(this.cur==null)break;this.currentContent.push(this.cur)}}makeDirective(t,e,i){let r=new ut;if(r.withParser(this),t==vt.Verbatim)this.isVerbatim=!0;else if(t==vt.Php)this.isPhpNode=!0;else if((t==vt.EndVerbatim||t==vt.EndPhp)&&this.nodes[this.nodes.length-1]instanceof Pt){let E=this.nodes.pop();if(this.nodes[this.nodes.length-1]instanceof ut){let d=this.nodes[this.nodes.length-1];(d.directiveName==vt.Verbatim||d.directiveName==vt.Php)&&(d.innerContent=E.content)}}r.directiveName=t.trim(),r.name=t.trim();let o=r.name.toLowerCase();o=="endcan"||o=="endcannot"||o=="endauth"||o=="endguest"||o=="endenv"||o=="endproduction"||o=="endif"?(r.name="if",r.isClosingDirective=!0):t.startsWith("end")?r.name=t.substring(3):t.startsWith("else")&&t!="elseif"&&t!="else"&&(r.name="elseif");let h=this.positionFromOffset(this.seedOffset+e,this.seedOffset+e),f=this.positionFromOffset(this.seedOffset+i,this.seedOffset+i);if(r.startPosition=h,r.endPosition=f,r.namePosition={start:h,end:f},r.hasDirectiveParameters=!1,r.startPosition!=null&&r.endPosition!=null){let p=r.startPosition.index-1,E=r.endPosition.index-r.startPosition.index+1,d=p+E;r.sourceContent=this.content.substr(p,E),r.offset={start:p,end:d,length:E}}return r}makeDirectiveWithParameters(t,e,i,r){let o=this.makeDirective(t.trim(),e,i);this.isPhpNode&&t==vt.Php&&(this.isPhpNode=!1),o.hasDirectiveParameters=!0,o.directiveParameters=r.content;let h=r.content.trim();h.startsWith("(")&&h.endsWith(")")&&(h=h.substring(1),h=h.substring(0,h.length-1),h=h.trim(),o.hasJsonParameters=h.startsWith("{")&&h.endsWith("}"));let f=this.positionFromOffset(r.start,r.start),p=this.positionFromOffset(r.end,r.end);if(o.startPosition=o.namePosition?.start??null,o.endPosition=p,o.directiveParametersPosition={start:f,end:p},o.startPosition!=null&&o.endPosition!=null){let E=o.startPosition.index-1,d=o.endPosition.index-o.startPosition.index+1,x=E+d;o.sourceContent=this.content.substr(E,d),o.offset={start:E,end:x,length:d}}return o}scanToEndOfDirective(){let t=this.currentIndex,e="",i=0;for(this.currentIndex;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_Asterisk){this.shouldIgnoreStructures=!0,Je(this,!0),this.shouldIgnoreStructures=!1;continue}if(this.cur==_t.Punctuation_ForwardSlash&&this.next==_t.Punctuation_ForwardSlash){this.shouldIgnoreStructures=!0,ze(this,!0),this.shouldIgnoreStructures=!1;continue}if(this.cur==_t.NewLine){i=this.currentIndex,e=this.currentContent.join(""),this.currentContent=[];let o=this.makeDirective(e.trim(),t,i);this.lastNode=o,this.nodes.push(o),this.lastBladeEndIndex=this.currentIndex+this.seedOffset-1;break}else if(this.next==null){this.currentContent.push(this.cur),i=this.currentIndex+1,e=this.currentContent.join(""),this.currentContent=[];let o=this.makeDirective(e.trim(),t,i);this.lastNode=o,this.nodes.push(o),this.lastBladeEndIndex=this.currentIndex+this.seedOffset;break}let r=_s(this);if(this.cur!=_t.LeftParen&&r.didFind&&F.ctypePunct(r.char)&&r.char!=_t.LeftParen&&r.char!=_t.Punctuation_Minus&&r.char!="."&&r.char!="_"){let o=0,h=!1;F.ctypeSpace(this.cur)?(o=1,h=!0):this.currentContent.push(this.cur),i=this.currentIndex+1,e=this.currentContent.join(""),this.currentContent=[];let f=this.makeDirective(e.trim(),t,i-o);this.lastNode=f,this.nodes.push(f),this.lastBladeEndIndex=this.currentIndex+this.seedOffset-o,h&&(this.currentIndex-=1);break}if(F.ctypeSpace(this.cur)){let o=_s(this);if(o.didFind&&o.char==_t.LeftParen){i=this.currentIndex-1,e=this.currentContent.join(""),this.currentContent=[],this.currentIndex=o.index,this.checkCurrentOffsets();let h=qi(this),f;h.foundEnd?f=this.makeDirectiveWithParameters(e.trim(),t,i,h):(f=this.makeDirective(e.trim(),t,i),this.didRecoveryLogic=!0),this.lastNode=f,this.nodes.push(f),this.lastBladeEndIndex=this.currentIndex+this.seedOffset;break}else{i=this.currentIndex,e=this.currentContent.join(""),this.currentContent=[];let h=this.makeDirective(e.trim(),t,i);this.lastNode=h,this.nodes.push(h),this.lastBladeEndIndex=this.currentIndex+this.seedOffset;break}}else if(this.cur==_t.LeftParen){i=this.currentIndex-1,e=this.currentContent.join(""),this.currentContent=[];let o=qi(this),h;o.foundEnd?h=this.makeDirectiveWithParameters(e.trim(),t,i,o):h=this.makeDirective(e.trim(),t,i+1),this.lastNode=h,this.nodes.push(h),this.lastBladeEndIndex=this.currentIndex+this.seedOffset;break}if(this.cur==null)break;this.currentContent.push(this.cur)}}getText(t,e){return this.content.substr(t,e-t)}getNodeText(t){let e="";return t.forEach(i=>{if(i instanceof Pt)e+=i.content;else if(i instanceof mi)e+=i.nodeContent;else if(i instanceof di)e+=i.nodeContent;else if(i instanceof Ke)e+=i.nodeContent;else if(i instanceof ut)if((i.name=="php"||i.name=="verbatim")&&i.isClosedBy!=null){if(i.documentContent.trim().length==0){let r=i.getParser()?.getText(i.endPosition?.index??0,(i.isClosedBy.startPosition?.index??0)-1);e+=i.sourceContent,e+=r}}else e+=i.sourceContent;else e+=i.sourceContent}),e}getNodes(){return this.nodes}getNodesBetween(t,e){let i=[];return this.nodes.forEach(r=>{(r.startPosition?.offset??0)>t.offset&&(r.endPosition?.offset??0)<e.offset&&i.push(r)}),i}getRenderNodes(){return this.renderNodes}prepareLiteralContent(t){return t}positionFromOffset(t,e,i=!1){let r=0,o=0;if(this.documentOffsets.has(t)){let f=this.documentOffsets.get(t);r=f.line,o=f.char}else if(this.documentOffsets.size==0)r=1,o=t+1;else{let f=null,p=null,E=null,d=null;for(let x of this.documentOffsets.keys()){if(x>=t){d!=null&&t>d?(f=E,p=d):(f=this.documentOffsets.get(x),p=x);break}E=this.documentOffsets.get(x),d=x}f==null&&(f=E,p=d),f!=null?(o=t-(p??0),r=f.line,t<=(p??0)?(r=f.line,o=t+1):r=f.line+1):this.lastDocumentOffsetKey!=null&&(r=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,o=t+this.lastDocumentOffsetKey)}let h=new rn;return h.index=e,h.offset=t,h.line=r+this.shiftLine,h.char=o,h}},rt=_t;rt.K_CHAR="char",rt.K_LINE="line",rt.NewLine=`
`,rt.AtChar="@",rt.Punctuation_Colon=":",rt.Punctuation_QuestionMark="?",rt.LeftParen="(",rt.RightParen=")",rt.LeftBrace="{",rt.RightBrace="}",rt.String_Terminator_DoubleQuote='"',rt.String_Terminator_SingleQuote="'",rt.Punctuation_LessThan="<",rt.Punctuation_GreaterThan=">",rt.Punctuation_Equals="=",rt.Punctuation_Exclamation="!",rt.LeftBracket="[",rt.RightBracket="]",rt.Punctuation_Comma=",",rt.Punctuation_Minus="-",rt.Punctuation_Asterisk="*",rt.Punctuation_ForwardSlash="/",rt.Punctuation_Underscore="_",rt.String_EscapeCharacter="\\";var Re=class{static findNodeAfterPosition(t,e){if(t==null)return null;for(let i=0;i<e.length;i++){let r=e[i];if(!Re.isLiteralType(r)&&r.startPosition!=null&&r.startPosition.index>t.index)return r}return null}static findNodeBeforePosition(t,e){if(t==null)return null;let i=null;for(let r=0;r<e.length;r++){let o=e[r];if(!Re.isLiteralType(o)&&o.startPosition!=null){if(o.startPosition.index>t.index)break;i=o}}return i}static findNodeAtPosition(t,e){if(t==null)return null;for(let i=0;i<e.length;i++){let r=e[i];if(!Re.isLiteralType(r)&&r.startPosition!=null&&r.endPosition!=null&&t.index>=r.startPosition.index&&t.index<=r.endPosition.index)return r}return null}static isLiteralType(t){return t instanceof Pt}static findNodesBeforePosition(t,e){let i=[];if(t==null)return i;for(let r=0;r<e.length;r++){let o=e[r];if(!Re.isLiteralType(o)&&o.startPosition!=null&&o.endPosition!=null){if(o.startPosition.index>t.index)break;i.push(o)}}return i}static findNodesAfterPosition(t,e){let i=[];if(t==null)return i;for(let r=0;r<e.length;r++){let o=e[r];Re.isLiteralType(o)||o.startPosition!=null&&o.startPosition.index>t.index&&i.push(o)}return i}};var oo=class{constructor(t){this.doc=t}getNodeAt(t,e){return Re.findNodeAtPosition(this.position(t,e),this.doc.getParser().getNodes())}getNodeBefore(t,e){return Re.findNodeBeforePosition(this.position(t,e),this.doc.getParser().getNodes())}getNodeAfter(t,e){return Re.findNodeAfterPosition(this.position(t,e),this.doc.getParser().getNodes())}getNodesBefore(t,e){return Re.findNodesBeforePosition(this.position(t,e),this.doc.getParser().getNodes())}getNodesAfter(t,e){return Re.findNodesAfterPosition(this.position(t,e),this.doc.getParser().getNodes())}position(t,e){return this.doc.getParser().positionFromCursor(t,e)}charLeftAt(t,e){return this.doc.getParser().charLeftAtCursor(t,e)}charAt(t,e){return this.doc.getParser().charAtCursor(t,e)}charRightAt(t,e){return this.doc.getParser().charRightAtCursor(t,e)}wordLeftAt(t,e,i=4){return this.doc.getParser().wordLeftAtCursor(t,e,i)}wordRightAt(t,e,i=4){return this.doc.getParser().wordRightAtCursor(t,e,i)}wordAt(t,e,i=4){return this.doc.getParser().wordAtCursor(t,e,i)}punctuationLeftAt(t,e,i=4){return this.doc.getParser().punctuationLeftAtCursor(t,e,i)}punctuationRightAt(t,e,i=4){return this.doc.getParser().punctuationRightAtCursor(t,e,i)}};var ao=class{constructor(t){this.doc=t}hasStructureErrors(){return this.doc.getParser().getStructureErrors().length>0}getFirstStructureError(){return this.doc.getParser().getStructureErrors()[0]}hasAny(){return this.all().length>0}all(){let t=[],e=[];return this.doc.getAllNodes().forEach(i=>{i.getErrors().forEach(r=>{t.includes(r.hash())==!1&&(t.push(r.hash()),e.push(r))})}),this.doc.getParser().getErrors().forEach(i=>{t.includes(i.hash())==!1&&(t.push(i.hash()),e.push(i))}),e}};var ho=class{constructor(t){this.doc=t}firstDirectiveOfType(t){let e=this.doc.getAllNodes();for(let i=0;i<e.length;i++){let r=e[i];if(r instanceof ut&&r.directiveName==t)return r}return null}getNodeAt(t){return Re.findNodeAtPosition(t,this.doc.getParser().getNodes())}getNodesBefore(t){return Re.findNodesBeforePosition(t,this.doc.getParser().getNodes())}getNodeBefore(t){return Re.findNodeBeforePosition(t,this.doc.getParser().getNodes())}getNodeAfter(t){return Re.findNodeAfterPosition(t,this.doc.getParser().getNodes())}getNodesAfter(t){return Re.findNodesAfterPosition(t,this.doc.getParser().getNodes())}filter(t){return this.doc.getParser().getNodes().filter(t)}getComments(){let t=[];return this.doc.getAllNodes().forEach(e=>{e instanceof pi&&t.push(e)}),t}getAllLiteralNodes(){let t=[];return this.doc.getAllNodes().forEach(e=>{e instanceof Pt&&t.push(e)}),t}};var ie=class{static relativeIndentLevel(t,e){let i=F.breakByNewLine(e);for(let r=0;r<i.length;r++){let o=i[r];if(o.includes(t)){let h=o.trimLeft();return o.length-h.length}}return 0}static indentLast(t,e,i){let r=" ".repeat(e),o=F.breakByNewLine(t),h=[];if(o.length==3)return h.push(o[0]),h.push(r+" ".repeat(i)+o[1].trim()),h.push(r+o[2]),h.join(`
`);for(let f=0;f<o.length;f++){let p=o[f];f==0?h.push(p):f==o.length-1?h.push(r+p):p.includes("=")||p.trim().includes(" ")==!1&&!p.trimLeft().startsWith("@")?h.push(r+" ".repeat(i)+p.trimLeft()):h.push(r+p)}return h.join(`
`)}static indentRelative(t,e,i){let r=F.breakByNewLine(t),o=[];for(let p=0;p<r.length;p++)if(r[p].trim().length>0){o=r.slice(p);break}for(let p=o.length-1;p>=0&&o[p].trim().length==0;p--)o.pop();let h=-1,f="";for(let p=0;p<o.length;p++){let E=o[p],d=E.trimLeft(),x=E.length-d.length;E.trim().length!=0&&(p==0||x<h)&&(h=x,f=E)}if(h==i&&(h=0),h>=0){let p=" ".repeat(e);for(let E=0;E<o.length;E++){let d=o[E];if(d.trim().length==0){o[E]="";continue}let x=d.substring(h);if(E==0){o[E]=d.trimLeft();continue}else o[E]=p+x}}return o.join(`
`)}static shiftIndentWithLastLineInline(t,e,i,r=!1){let o=F.breakByNewLine(t.trim()),h=[];if(o.length>1){let f=!0;for(let p=1;p<o.length;p++){let E=o[p],d=E.length-E.trim().length;if(i-d!=0){f=!1;break}}if(f)return t.trim()}for(let f=0;f<o.length;f++){if(f==0&&r){h.push(o[f]);continue}let p=o[f];p.trim().length==0?h.push(""):h.push(" ".repeat(Math.max(0,i-e))+p)}return h.join(`
`)}static shiftHtmlAttributeContent(t,e,i){let r=F.breakByNewLine(t.trim()),o=[];for(let h=0;h<r.length;h++){let f=r[h];if(h==0){if(e==i){o.push(" ".repeat(e)+f.trimLeft());continue}o.push(" ".repeat(e-2*i)+f.trimLeft());continue}if(h==r.length-1){o.push(" ".repeat(e)+f.trimLeft());continue}o.push(" ".repeat(e)+f)}return o.join(`
`)}static shiftParameterContent(t,e,i){let r=F.breakByNewLine(t.trim()),o=[];for(let h=0;h<r.length;h++){let f=r[h];if(h==0){o.push(f);continue}if(h==r.length-1&&f.trim()=='"'){o.push(" ".repeat(e)+f.trimLeft());continue}f.length-f.trimLeft().length==i?o.push(" ".repeat(e+i*2)+f.trimLeft()):o.push(" ".repeat(i+e)+f.trimLeft())}return o.join(`
`)}static removeLeadingWhitespace(t,e,i){let r=F.breakByNewLine(t.trim()),o=[],h=-1,f=!0,p=!0,E=[];r.length>0&&r[r.length-1].trim()=='"'&&(r[r.length-1]='"');for(let d=0;d<r.length;d++){let x=r[d];if(d==0||x.trim().length==0||d==r.length-1)continue;let _=x.length-x.trimLeft().length;if(d<r.length-1&&_!=e&&(E.length>0?E.includes(_)==!1&&(p=!1):E.push(_),f=!1),h<0&&_>0){h=_;continue}_>0&&_<h&&(h=_)}if(h<=0)return t;if(!i&&(!f&&p&&E.length>0&&E[0]%e===0&&(f=!0),f)){for(let d=0;d<r.length;d++){let x=r[d];if(d==0||d==r.length-1){if(h>e&&d==r.length-1){o.push(x.trimLeft());continue}o.push(x);continue}o.push(x.trimLeft())}return o.join(`
`)}if(h==e)return t;for(let d=0;d<r.length;d++){let x=r[d];if(d==0){o.push(x);continue}if(d==r.length-1){o.push(x.trimLeft());continue}let _=x.length-x.trimLeft().length;if(_==e){o.push(x);continue}_>=h?o.push(x.substring(h)):o.push(x)}return o.join(`
`)}static shiftIndent(t,e,i=!1,r,o=!1,h=!1,f=!0){let p=t;f&&(p=t.trim());let E=F.breakByNewLine(p),d=[];if(E.length>1){let x=!0;for(let _=1;_<E.length;_++){let u=E[_],c=u.length-u.trim().length;if(e-c!=0){x=!1;break}}if(x){if(E[0].trimLeft().length==E[0].length&&e==r.tabSize&&o){let _=" ".repeat(r.tabSize);return E.forEach(u=>{d.push(_+u)}),d.join(`
`)}return t.trim()}}for(let x=0;x<E.length;x++){if(x==0&&i){d.push(E[x]);continue}let _=E[x];_.trim().length==0?d.push(""):h&&x==E.length-1?d.push(" ".repeat(e-r.tabSize)+_):d.push(" ".repeat(e)+_)}return d.join(`
`)}static shiftClean(t,e){let i=F.breakByNewLine(t),r=[],o=" ".repeat(e),h=!1;return i.forEach(f=>{f.trim().length>0&&(h=!0),h&&(f.trim().length==0?r.push(""):r.push(o+f))}),r.join(`
`)}static indentAll(t,e,i){let r=i*e,o=F.breakByNewLine(t)}static inferIndentLevel(t,e,i){let r=0,o=-1;for(let h=0;h<t.length;h++){let f=t[h];if(f.includes(e)){let p=f.trimLeft();r=f.length-p.length,o=h;break}}if(o>0)for(let h=o-1;h>=0;h--){let f=t[h],p=f.trim(),E=f.trimLeft(),d=f.length-p.length;if(E.length!=0&&d!=r&&d<r){let x=r-d;return{targetLevel:r,referenceLevel:d,sourceTabSize:x}}}return{targetLevel:r,referenceLevel:r,sourceTabSize:i}}static indent(t,e,i){let r=ie.inferIndentLevel(t,e,i);return" ".repeat(r.targetLevel)}};var er=class{constructor(){this.content="";this.chars=[];this.inputLen=0;this.prev=null;this.cur=null;this.next=null;this.currentIndex=0;this.currentContent=[];this.tokens=[]}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}getCurrentIndex(){return this.currentIndex}incrementIndex(){this.currentIndex+=1}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}pushChar(t){this.currentContent.push(t)}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return this.content.substr(t,e)}getTokens(){return this.tokens}static couldReflow(t){return er.breakOperators.some(e=>t.includes(e))}safeReflow(t){return er.couldReflow(t)?this.reflow(t):t}parse(t){for(this.tokens=[],this.content=F.normalizeLineEndings(t),this.chars=this.content.split(""),this.inputLen=this.chars.length,this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),F.ctypeSpace(this.cur)){this.currentContent.push(this.cur);continue}if(Ee(this.cur)){let e=this.cur,i=qe(this);this.pushChar(e),this.currentContent=this.currentContent.concat(i.value.split("")),this.pushChar(e),this.currentIndex=i.endedOn;continue}if(this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_ForwardSlash){ze(this,!0);continue}if(this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_Asterisk){Je(this,!0);continue}if(this.cur!=null)if(this.cur==="!"&&this.next!=="="){if(this.currentContent.length>0){let i=new Pt;i.content=this.currentContent.join(""),this.currentContent=[],this.tokens.push(i)}let e=new Ks;e.sourceContent=this.cur,this.tokens.push(e),this.currentContent=[];continue}else this.currentContent.push(this.cur)}if(this.currentContent.length>0){let e=new Pt;e.content=this.currentContent.join(""),this.currentContent=[],this.tokens.push(e)}}reflow(t){try{this.parse(t)}catch{return t}let e="",i=!1;return this.tokens.forEach(r=>{if(r instanceof Ks){i=!0,e+=r.sourceContent+" ";return}r instanceof Pt&&(i?e+=r.content.trimLeft():e+=r.content),i=!1}),e}},ke=er;ke.breakOperators=["!"],ke.instance=new er;import zi from"prettier";var _a=ps(Kc(),1),AA=ps(af(),1);import*as Zn from"fs";import*as Rn from"path";var Z=class{};Z.IfStatement="if",Z.CallStatement="call",Z.TernaryStatement="ternary",Z.Addition="addition",Z.Substraction="subtraction",Z.Multiplication="multiplication",Z.Division="division",Z.Modulus="modulus",Z.Exponentiation="exponentiation",Z.BinCompare="compare",Z.Concat="concat",Z.GreaterThan="greater_than",Z.GreaterThanEqual="greater_than_equal",Z.LessThan="less_than",Z.LessThanEqual="less_than_equal",Z.BitwiseAnd="bitwise_and",Z.BitwiseOr="bitiwse_or",Z.BitwiseXor="bitiwse_xor",Z.LeftShift="left_shift",Z.RightShift="right_shift",Z.Equality="equality",Z.Identity="identitiy",Z.Inequality="inequality",Z.NotIdentity="not_identity",Z.CompAnd="and",Z.CompOr="or",Z.Xor="xor",Z.Assignment="assign",Z.AdditionAssignment="assign_addition",Z.SubtractionAssignment="assign_subtraciton",Z.MultiplicationAssignment="assign_multiplication",Z.DivisionAssignment="assign_division",Z.ModulusAssignment="assign_modulus",Z.ConcatenationAssignment="assign_concat",Z.BitwiseAndAssignment="assign_bitwise_and",Z.BitwiseOrAssignment="assign_bitwise_or",Z.BitwiseXorAssignment="assign_bitwise_xor",Z.LeftShiftAssignment="assign_left_shift",Z.RightShiftAssignment="assign_right_shift";function ys(){return{enabled:!0,directivesEnabled:!0,excludedDirectives:["if","unless","elseif","for","forelse","foreach"],allowedMethodNames:["class"],directives:[],bladePhpEnabled:!0,phpTagsEnabled:!0,phpTagRules:[],ignoredLanguageStructures:[Z.CallStatement,Z.IfStatement,Z.TernaryStatement,Z.BinCompare,Z.Addition,Z.Substraction,Z.Multiplication,Z.Division,Z.Modulus,Z.Exponentiation,Z.Concat,Z.GreaterThan,Z.GreaterThanEqual,Z.LessThan,Z.LessThanEqual,Z.BitwiseAnd,Z.BitwiseOr,Z.BitwiseXor,Z.LeftShift,Z.RightShift,Z.Equality,Z.Identity,Z.Inequality,Z.NotIdentity,Z.CompAnd,Z.CompOr,Z.Xor,Z.AdditionAssignment,Z.SubtractionAssignment,Z.MultiplicationAssignment,Z.DivisionAssignment,Z.ModulusAssignment,Z.ConcatenationAssignment,Z.BitwiseAndAssignment,Z.BitwiseOrAssignment,Z.BitwiseXorAssignment,Z.LeftShiftAssignment,Z.RightShiftAssignment],bladeEchoEnabled:!0,bladeEchoRules:[],documentRules:{includeWhen:[],excludeWhen:[]},stringRules:{includeWhen:[],excludeWhen:[]}}}function hf(n){let t=ys();function e(r){return{includeWhen:r.includeWhen??[],excludeWhen:r.excludeWhen??[]}}function i(r,o){return!r||!r.includeWhen&&!r.excludeWhen?o:{excludeWhen:r.excludeWhen??[],includeWhen:r.includeWhen??[]}}return{enabled:n.enabled??t.enabled,allowedMethodNames:n.allowedMethodNames??t.allowedMethodNames,directivesEnabled:n.directivesEnabled??t.directivesEnabled,excludedDirectives:n.excludedDirectives??t.excludedDirectives,directives:(n.directives??t.directives).map(e),bladePhpEnabled:n.bladePhpEnabled??t.bladePhpEnabled,phpTagsEnabled:n.phpTagsEnabled??t.phpTagsEnabled,phpTagRules:(n.phpTagRules??t.phpTagRules).map(e),ignoredLanguageStructures:n.ignoredLanguageStructures??t.ignoredLanguageStructures,bladeEchoEnabled:n.bladeEchoEnabled??t.bladeEchoEnabled,bladeEchoRules:(n.bladeEchoRules??t.bladeEchoRules).map(e),documentRules:i(n.documentRules,t.documentRules),stringRules:i(n.stringRules,t.stringRules)}}var ks=class{constructor(t){this.directiveExcludeRules=[];this.directiveIncludeRules=[];this.phpTagExcludeRules=[];this.phpTagIncludeRules=[];this.echoExcludeRules=[];this.echoIncludeRules=[];this.documentExcludeRules=[];this.documentIncludeRules=[];this.stringExcludeRules=[];this.stringIncludeRules=[];this.config=t,this.directiveExcludeRules=this.getExcludeRules(t.directives),this.directiveIncludeRules=this.getIncludeRules(t.directives),this.phpTagExcludeRules=this.getExcludeRules(t.phpTagRules),this.phpTagIncludeRules=this.getIncludeRules(t.phpTagRules),this.echoExcludeRules=this.getExcludeRules(t.bladeEchoRules),this.echoIncludeRules=this.getIncludeRules(t.bladeEchoRules),this.documentExcludeRules=t.documentRules.excludeWhen,this.documentIncludeRules=t.documentRules.includeWhen,this.stringExcludeRules=t.stringRules.excludeWhen,this.stringIncludeRules=t.stringRules.includeWhen}getIncludeRules(t){let e=[];return t.forEach(i=>{e=e.concat(i.includeWhen)}),e}getExcludeRules(t){let e=[];return t.forEach(i=>{e=e.concat(i.excludeWhen)}),e}passes(t,e){if(e.length==0)return!0;for(let i=0;i<e.length;i++)if(new RegExp(e[i]).test(t))return!0;return!1}canTransformDocument(t){if(!this.config.enabled)return!1;let e=t.getContent();return this.documentExcludeRules.length>0&&!this.passes(e,this.documentExcludeRules)?!1:this.passes(e,this.documentIncludeRules)}canTransformString(t){return this.stringExcludeRules.length>0&&this.passes(t,this.stringExcludeRules)?!1:this.passes(t,this.stringIncludeRules)}canTransform(t,e,i){return e.length>0&&this.passes(t,e)||!this.passes(t,i)||this.stringExcludeRules.length>0&&this.passes(t,this.stringExcludeRules)?!1:this.passes(t,this.stringIncludeRules)}canTransformBladeEcho(t){return!this.config.enabled||!this.config.bladeEchoEnabled?!1:this.canTransform(t.content,this.echoExcludeRules,this.echoIncludeRules)}canTransformBladePhp(t){return!this.config.enabled||!this.config.bladePhpEnabled?!1:this.canTransform(t.documentContent,this.phpTagExcludeRules,this.phpTagIncludeRules)}canTransformInlinePhp(t){return!this.config.enabled||!this.config.phpTagsEnabled?!1:this.canTransform(t.sourceContent,this.phpTagExcludeRules,this.phpTagIncludeRules)}canTransformDirective(t){if(!this.config.enabled||!this.config.directivesEnabled)return!1;let e=t.directiveName;return t.originalAbstractNode!=null&&t.originalAbstractNode instanceof ut&&(e=t.originalAbstractNode.directiveName),e=e.toLowerCase(),this.config.excludedDirectives.length>0&&(this.config.excludedDirectives.includes(e)||this.config.excludedDirectives.includes(t.directiveName.toLocaleLowerCase()))?!1:this.canTransform(t.sourceContent,this.directiveExcludeRules,this.directiveIncludeRules)}};import{fileURLToPath as EA}from"url";var kA=EA(import.meta.url),uf=Rn.dirname(kA),ma=".blade.format.json",un={ignoreDirectives:[...tr,...no],spacesAfterDirective:0,spacesAfterControlDirective:1,tabSize:4,formatDirectiveJsonParameters:!0,formatDirectivePhpParameters:!0,formatInsideEcho:!0,customIfs:[],directives:[],echoStyle:"block",useLaravelPint:!1,pintCommand:"",phpOptions:{phpVersion:"8.0"},attributeJsOptions:null,pintCacheDirectory:"",pintTempDirectory:"",pintCacheEnabled:!0,pintConfigPath:"",classStrings:ys(),formatJsAttributes:!0,excludeJsAttributes:["^v-"],includeJsAttributes:["^x-","^ax-"],safeWrappingJsAttributes:["^x-data"],normalizeInlineSlotNames:!0};var ga,yA;function lf(n){ga=n}function cf(){return yA}function ff(n){if(ga!=null)return ga;let t=TA(n);if(t==null||Zn.existsSync(t)==!1)return un;let e=Zn.readFileSync(t,{encoding:"utf8"});try{let i=JSON.parse(e),r=vA(i);if(r.useLaravelPint){if(r.pintCommand.length==0){let o=t.substring(0,t.length-ma.length)+"/vendor/bin/pint";Zn.existsSync(o)?r.pintCommand=`php ${o} {file}`:r.pintCommand="pint {file}"}if(r.pintTempDirectory.trim().length==0&&(r.pintTempDirectory=uf+"/_temp/"),r.pintCacheDirectory.trim().length==0&&(r.pintCacheDirectory=uf+"/_cache/"),r.pintTempDirectory.trim().length>0&&(r.pintTempDirectory=da(r.pintTempDirectory.trim())),r.pintCacheDirectory.trim().length>0&&(r.pintCacheDirectory=da(r.pintCacheDirectory.trim())),r.pintConfigPath.trim().length>0)r.pintConfigPath=da(r.pintConfigPath.trim());else{let o=t.substring(0,t.length-ma.length)+"/pint.json";Zn.existsSync(o)&&(r.pintConfigPath=o)}}return r}catch(i){console.log(i)}return un}function vA(n){let t=tr,e=0,i=1,r=4,o=!0,h=!0,f=!0,p=[],E=[],d=null,x=null,_="block",u=!1,c="",g="",y="",T=!0,w="",R=ys(),M=un.formatJsAttributes,J=un.includeJsAttributes,W=un.excludeJsAttributes,j=un.safeWrappingJsAttributes,ot=un.normalizeInlineSlotNames;return typeof n.ignoreDirectives<"u"&&n.ignoreDirectives!==null&&(t=n.ignoreDirectives),typeof n.spacesAfterDirective<"u"&&n.spacesAfterDirective!==null&&(e=n.spacesAfterDirective),typeof n.spacesAfterControlDirective<"u"&&n.spacesAfterControlDirective!==null&&(i=n.spacesAfterControlDirective),typeof n.tabSize<"u"&&n.tabSize!==null&&(r=n.tabSize),typeof n.formatDirectivePhpParameters<"u"&&n.formatDirectivePhpParameters!==null&&(o=n.formatDirectivePhpParameters),typeof n.formatDirectiveJsonParameters<"u"&&n.formatDirectiveJsonParameters!==null&&(h=n.formatDirectiveJsonParameters),typeof n.customIfs<"u"&&n.customIfs!==null&&(p=n.customIfs),typeof n.useLaravelPint<"u"&&n.useLaravelPint!==null&&(u=n.useLaravelPint),typeof n.directives<"u"&&n.directives!==null&&(E=n.directives),typeof n.echoStyle<"u"&&n.echoStyle==="inline"&&(_="inline"),typeof n.formatInsideEcho<"u"&&n.formatInsideEcho!==null&&(f=n.formatInsideEcho),typeof n.phpOptions<"u"&&(d=n.phpOptions),typeof n.attributeJsOptions<"u"&&(x=n.attributeJsOptions),typeof n.pintCommand<"u"&&(c=n.pintCommand.trim()),typeof n.pintConfig<"u"&&(w=n.pintConfig.trim()),typeof n.pintTempDirectory<"u"&&(g=n.pintTempDirectory.trim()),typeof n.pintCacheDirectory<"u"&&(y=n.pintCacheDirectory.trim()),typeof n.pintCacheEnabled<"u"&&(T=n.pintCacheEnabled),typeof n.formatJsAttributes<"u"&&(M=n.formatJsAttributes),typeof n.includeJsAttributes<"u"&&(J=n.includeJsAttributes),typeof n.excludeJsAttributes<"u"&&(W=n.excludeJsAttributes),typeof n.safeWrappingJsAttributes<"u"&&(j=n.safeWrappingJsAttributes),typeof n.normalizeInlineSlotNames<"u"&&(ot=n.normalizeInlineSlotNames),e<0&&(e=0),i<0&&(i=1),e>3&&(e=3),i>3&&(i=3),typeof n.classStrings<"u"&&n.classStrings!=null&&(R=hf(n.classStrings)),{ignoreDirectives:t,spacesAfterDirective:e,spacesAfterControlDirective:i,tabSize:r,formatDirectivePhpParameters:o,formatDirectiveJsonParameters:h,formatInsideEcho:f,customIfs:p,directives:E,phpOptions:d,echoStyle:_,useLaravelPint:u,pintCommand:c,pintCacheDirectory:y,pintTempDirectory:g,pintCacheEnabled:T,pintConfigPath:w,classStrings:R,attributeJsOptions:x,formatJsAttributes:M,includeJsAttributes:J,excludeJsAttributes:W,safeWrappingJsAttributes:j,normalizeInlineSlotNames:ot}}function da(n){let t=/[\\/]+/g,e=n.replace(t,"/");return e.endsWith("/")||(e+="/"),e}function TA(n){let t=Rn.dirname(n);t=="."&&(t=process.cwd());let e=t.split(Rn.sep);for(;e.length>0;){let i=e.join(Rn.sep),r=Rn.join(i,ma);if(Zn.existsSync(r))return r;e.pop()}return null}var En=!0,kn=!1,nr=!0;function CA(n){nr=n}function ln(n){kn=n,CA(!n)}function sr(){En=!1}function Bn(){En=!0}var fo=class{constructor(){this.attributeMapping=new Map;this.slugs=[]}makeSlug(t){let e=F.makeSlug(t);return this.slugs.includes(e)?this.makeSlug(t+1):(this.slugs.push(e),e)}remove(t,e){e=e.sort((o,h)=>o.startedOn-h.startedOn);let i="",r=0;for(let o=0;o<e.length;o++){let h=e[o],f=this.makeSlug(h.content.length);if(this.attributeMapping.set(f,h),o==0){let p=t.substring(0,h.startedOn);r=h.startedOn+h.content.length,i+=p,i+='"'+f+'"',e.length==1&&(i+=t.substring(r))}else if(o==e.length-1){e.length==1&&(i+=t.substring(0,h.startedOn));let p=t.substring(r,h.startedOn);r=h.startedOn+h.content.length,i+=p,i+='"'+f+'"',i+=t.substring(r)}else{let p=t.substring(r,h.startedOn);r=h.startedOn+h.content.length,i+=p,i+='"'+f+'"'}}return i}getRemovedAttributes(){return this.attributeMapping}};import bA from"path";import{fileURLToPath as SA}from"url";var DA=SA(import.meta.url),po=bA.dirname(DA),mo,yn,ya,NA,pf=[];function df(){return ya}function vs(){return mo}function xa(n){return["cursorOffset","rangeEnd","rangeStart","locEnd","locStat","printer","originalText","astFormat"].forEach(t=>{delete n[t]}),n}function mf(){return yn}async function gf(n){return await zi.format(n,{parser:"JSONata",plugins:[AA],printWidth:20})}async function Ts(n,t=null,e=null){return lf(t),e==null?await zi.format(n,{parser:"blade",plugins:[ka]}):await zi.format(n,{...e,parser:"blade",plugins:[ka]})}async function rr(n,t=null,e=null,i=null){let r=po+"/../../../pint/pint",o=po+"/../../../pint/pint.json",h=po+"/../../../_test/_cache/",f=po+"/../../../_test/_temp/",p=`php ${r} {file}`;e!=null&&(p=e.pintCommand,h=e.pintCacheDirectory,f=e.pintTempDirectory,o=e.pintConfigPath);let E={...un,useLaravelPint:!0,pintCommand:p,pintCacheDirectory:h,pintTempDirectory:f,pintConfigPath:o};return t!=null&&(E={...E,...t,useLaravelPint:!0,pintCommand:p,pintCacheDirectory:h,pintTempDirectory:f,pintConfigPath:o}),await Ts(n,E,i)}var IA=null;function xf(){return IA}function go(n){NA=n,yn=xa(Object.assign({},n,{htmlWhitespaceSensitivity:"ignore",parser:"html",plugins:n.plugins})),mo=xa(Object.assign({},n,{parser:"php",plugins:[_a.default]})),ya=xa(Object.assign({},n,{parser:"php",plugins:[_a.default],printWidth:1/0}))}async function _f(n,t){return t.attributeJsOptions!=null?await zi.format(n,{...yn,...t.attributeJsOptions,parser:"babel",singleQuote:!0,trailingComma:"es5",quoteProps:"preserve"}):await zi.format(n,{...yn,parser:"babel",printWidth:80,singleQuote:!0,quoteProps:"preserve",semi:!1,trailingComma:"all"})}function Ea(){let n=[];return yn.plugins&&(n=yn.plugins),pf&&pf.forEach(t=>{n.push(t)}),n}async function Ef(n){if(kn){let t=n,e=[];try{let i=new Zi,r=new Map;i.remove(n),e=i.getStrings().reverse(),e.forEach((p,E)=>{let d=F.makeSlug(128);r.set(d,p),t=t.replace(`"${p}"`,`"${d}"`)});let o=await zi.format(t,{...yn,plugins:Ea(),printWidth:20,singleQuote:!0,singleAttributePerLine:!0,parser:"html"}),h=F.breakByNewLine(o),f=[];for(let p=0;p<h.length;p++){let E=h[p];if(vn.inlineComments.includes(E.trim()))if(f.length>0){f[f.length-1]=f[f.length-1]+" "+E.trim();continue}else f.push(E);if(E.includes("<"))f.push(E);else if(E.trim().includes(" ")){let d=E.split(" "),x=E.length-E.trimLeft().length;d.forEach(_=>{_.trim().length!=0&&f.push(" ".repeat(x)+_)})}else f.push(E)}return o=f.join(`
`),r.forEach((p,E)=>{o=o.replace(E,p)}),o}catch{return n}}return await zi.format(n,{...yn,plugins:Ea(),singleQuote:!0,parser:"html"})}async function kf(n){return await zi.format(n,{...yn,plugins:Ea(),proseWrap:"never",singleQuote:!0,parser:"html"})}function va(n,t,e=null){let i=n;if(e!=null&&(i=e),typeof t.phpOptions<"u"&&t.phpOptions!=null){let r=t.phpOptions;i={...i,...r}}else i={...i,phpVersion:"8.0"};return i}async function yf(n,t,e=null){let i=va(ya,t,e),r=(await zi.format(n,i)).trim();return r=r.substring(5),n.endsWith(";")==!1&&r.endsWith(";")&&(r=r.substring(0,r.length-1)),r.trim()}async function vf(n,t,e=null){let i=va(mo,t,e),r=(await zi.format(n,i)).trimLeft();r=r.substring(5);let o=r.trim();if(o.startsWith("/**")&&o.endsWith("*/")){let h=F.breakByNewLine(r),f=[],p=!0;for(let E=0;E<h.length;E++){let d=h[E],x=d.trimLeft();if(x.trim().length>0&&(x.startsWith("/*")||x.startsWith("*")||x.startsWith("*/"))==!1){p=!1;break}if(x.length==0){f.push("");continue}if(x.startsWith("/*")){f.push(x);continue}f.push(x)}if(p)return f.join(`
`)}return n.endsWith(";")==!1&&r.endsWith(";")&&(r=r.substring(0,r.length-1)),r}async function Tf(n,t,e=null){let i=va(mo,t,e);return(await zi.format(n,i)).trim().trim()}var Cf=["(",")","{","}",,":","->","<",">"];async function Af(n,t,e,i,r,o){let h=!1,f=n.content.substring(1,n.content.length-1).trim();if(f.includes(`
`)==!1&&f.startsWith("if ")&&!f.includes("{"))return n.content;let p=!1;for(let y=0;y<Cf.length;y++)if(f.includes(Cf[y])){p=!0;break}if(p&&n.content.includes("-")){let y=$t.fromText(f),T=y.getAllNodes();for(let w=0;w<T.length;w++){let R=T[w];if(R instanceof Pt&&(R.content.startsWith("-")||R.content.endsWith("-"))){p=!1;break}}}if((n.content.includes("{!!")||n.content.includes("!!}"))&&(p=!1),n.content.includes("\\'")&&$t.fromText(n.content).transform().removeBlade().includes("\\'")&&(p=!1),!p)return n.content;let E=`
`;f.startsWith("{")&&f.endsWith("}")&&(E+="let _tmpFormat = ",h=!0),E+=f,E+=`
`;let d=n.content,x="";try{let y=new $t;y.getParser().withParserOptions(o.getParser().getParserOptions()),y.getParser().withPhpValidator(o.getParser().getPhpValidator()),y.loadString("<script>"+E+"<\/script>"),y.getParser();let T=y.transform();T.setParentTransformer(r),T.withOptions(t),T.setFormattingOptions(r.getFormattingOptions()),T.withJsonFormatter(r.getJsonFormatter()),T.withBlockPhpFormatter(r.getBlockPhpFormatter()),T.withPhpTagFormatter(r.getPhpTagFormatter()),T.withPhpFormatter(r.getPhpFormatter()),x=T.toStructure().trim(),x=x.substring(8),x=x.trim(),x=x.substring(0,x.length-9),d=await _f(x,t),d=await T.fromStructure(d),h&&(d=d.trimLeft(),d=d.substring(3),d=d.trimLeft(),d=d.substring(10),d=d.trimLeft(),d=d.substring(1),d=d.trimLeft()),d=d.trim(),f.trim().endsWith(";")==!1&&d.endsWith(";")&&(d=d.substring(0,d.length-1)),d.startsWith(";")&&(d=d.substring(1)),d=await r.transformStructures(d)}catch{return n.content}let _=ie.relativeIndentLevel(e,i),u=d,c=" ".repeat(_),g=d.trim();return g.startsWith("{")&&g.endsWith("}")?u='"'+ie.shiftIndent(ke.instance.safeReflow(g),_,!0,t,!1,!1)+'"':u.includes(`
`)==!1?u='"'+ke.instance.safeReflow(u.trim())+'"':PA(n,t)?(_+=n.name.length+2,u='"'+ie.shiftIndent(ke.instance.safeReflow(g),_,!1,t,!1,!1).trim()+'"'):u=`"
`+ie.shiftIndent(ke.instance.safeReflow(g),_+t.tabSize,!1,t,!1,!1)+`
${c}"`,u}function PA(n,t){if(t.safeWrappingJsAttributes.length==0)return!1;for(let e=0;e<t.safeWrappingJsAttributes.length;e++)if(new RegExp(t.safeWrappingJsAttributes[e]).test(n.name))return!0;return!1}var or=class{static adjustInput(t){let e=$t.fromText(t),i=new Ln,r="Void"+F.makeSlug(15);i.setIndexRanges(e.getParser().getNodeIndexRanges());let o=!1,h=i.parse(t),f=[],p=[];if(h.forEach(x=>{let _=x.name.toLowerCase();_!=x.name&&or.voidElementNames.includes(_)&&(o=!0,p.push(_),f.push(x))}),!o)return t;let E="",d=0;for(let x=0;x<f.length;x++){let _=f[x],u=_.name.toLowerCase(),c=r+_.name;or.voidTagMapping.has(c)||or.voidTagMapping.set(c,_.name);let g=1;if(_.isClosingFragment&&(g=2),x==0){E+=t.substring(0,(_.startPosition?.offset??0)+g),E+=c,d=(_.startPosition?.offset??0)+g+u.length,f.length==1&&(E+=t.substring(d));continue}else if(x==f.length-1){f.length==1?E+=t.substring(0,(_.startPosition?.offset??0)+g):E+=t.substring(d,(_.startPosition?.offset??0)+g),E+=c,d=(_.startPosition?.offset??0)+g+u.length,E+=t.substring(d);break}else{E+=t.substring(d,(_.startPosition?.offset??0)+g),E+=c,d=(_.startPosition?.offset??0)+g+u.length;continue}}return E}},Tn=or;Tn.voidElementNames=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Tn.voidTagMapping=new Map;var Ta=class{constructor(){this.content="";this.chars=[];this.inputLen=0;this.prev=null;this.cur=null;this.next=null;this.currentIndex=0;this.currentContent=[];this.tokens=[]}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}getCurrentIndex(){return this.currentIndex}incrementIndex(){this.currentIndex+=1}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}pushChar(t){this.currentContent.push(t)}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return this.content.substr(t,e)}getTokens(){return this.tokens}static couldReflow(t){return t.includes("fn(")&&t.includes("=>")}parse(t){for(this.tokens=[],this.content=F.normalizeLineEndings(t),this.chars=this.content.split(""),this.inputLen=this.chars.length,this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),F.ctypeSpace(this.cur)){this.currentContent.push(this.cur);continue}if(Ee(this.cur)){let e=this.cur,i=qe(this);this.pushChar(e),this.currentContent=this.currentContent.concat(i.value.split("")),this.pushChar(e),this.currentIndex=i.endedOn;continue}if(this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_ForwardSlash){ze(this,!0);continue}if(this.cur==rt.Punctuation_ForwardSlash&&this.next==rt.Punctuation_Asterisk){Je(this,!0);continue}if(this.cur!=null)if(this.cur==="f"&&this.next=="n")if(F.ctypePunct(this.prev)||F.ctypeSpace(this.prev)||this.prev==null){this.currentContent.push(this.cur),this.currentContent.push(this.next),this.currentContent.push(" "),this.currentIndex+=1;continue}else this.currentContent.push(this.cur);else this.currentContent.push(this.cur)}if(this.currentContent.length>0){let e=new Pt;e.content=this.currentContent.join(""),this.currentContent=[],this.tokens.push(e)}}reflow(t){try{this.parse(t)}catch{return t}let e="";return this.tokens.forEach(i=>{i instanceof Pt&&(e+=i.content)}),e}},Be=Ta;Be.instance=new Ta;var Cs=class{constructor(){this.content="";this.chars=[];this.inputLen=0;this.prev=null;this.cur=null;this.next=null;this.currentIndex=0;this.currentContent=[];this.tokens=[];this.createdArrays=[];this.keyValueTokens=0;this.elements=0}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}getCurrentIndex(){return this.currentIndex}incrementIndex(){this.currentIndex+=1}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}pushChar(t){this.currentContent.push(t)}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return this.content.substr(t,e)}getNumberOfElements(){return this.elements}getNumberOfKeyValuePairs(){return this.keyValueTokens}getIsAssoc(){return this.elements==this.keyValueTokens}checkCurrentContent(){if(this.currentContent.length>0){let t=this.currentContent.join(""),e=new Ce;if(t.trim().length==0){this.currentContent=[];return}e.sourceContent=t,this.tokens.push(e),this.currentContent=[]}}parse(t){for(this.content=F.normalizeLineEndings(t),this.chars=this.content.split(""),this.inputLen=this.chars.length,this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1)if(this.checkCurrentOffsets(),!F.ctypeSpace(this.cur)){if(Ee(this.cur)){let i=this.cur,r=qe(this);this.pushChar(i),this.currentContent=this.currentContent.concat(r.value.split("")),this.pushChar(i),this.currentIndex=r.endedOn;continue}if(this.cur==rt.LeftBracket){this.checkCurrentContent(),this.tokens.push(new On);continue}else if(this.cur==rt.RightBracket)this.checkCurrentContent(),this.tokens.push(new Qs);else if(this.cur==rt.Punctuation_Comma)this.checkCurrentContent(),this.tokens.push(new ms),this.currentContent=[];else if(this.cur==rt.Punctuation_Equals&&this.next==rt.Punctuation_GreaterThan){this.checkCurrentContent(),this.currentIndex+=1,this.tokens.push(new $s);continue}else this.currentContent.push(this.cur)}let e=this.parseArrays(this.tokens);return this.fillArrayDetails(),e?.elements.filter(function(i){return!(i.value instanceof ms)}).forEach(i=>{this.elements+=1,i.key!=null&&i.value!=null&&(this.keyValueTokens+=1)}),e}fillArrayDetails(){this.createdArrays.forEach(t=>{t.elements.forEach((e,i)=>{e.key!=null&&(t.containsKeys=!0,e.key.sourceContent.length>t.maxKeyLength&&(t.maxKeyLength=e.key.sourceContent.length)),e.isLast=i==t.elements.length-1})})}parseArrays(t){for(let e=0;e<t.length;e++)if(t[e]instanceof On){let r=this.findEndOfArray(t.slice(e));return e+=r.length,r.shift(),r.pop(),this.createArray(r,!0)}return null}createArray(t,e){let i=new Qn;this.createdArrays.push(i);for(let r=0;r<t.length;r++){let o=t[r],h=null;if(r+1<t.length&&(h=t[r+1]),h instanceof ms||h==null){let f=new Kn;f.value=o,i.elements.push(f),r+=1;continue}else if(h instanceof $s){let f=t[r+2];if(f instanceof On){let p=this.findEndOfArray(t.slice(r+2)),E=new Kn;r+=p.length+1,p.shift(),p.pop(),E.key=o,E.value=this.createArray(p,!1),i.elements.push(E);continue}else{let p=new Kn;p.key=o,p.value=f,i.elements.push(p),r+=3;continue}}else if(o instanceof On){let f=this.findEndOfArray(t.slice(r)),p=new Kn;r+=f.length,f.shift(),f.pop(),p.value=this.createArray(f,!1);continue}}return i}findEndOfArray(t){let e=[],i=0;for(let r=0;r<t.length;r++){let o=t[r];if(e.push(o),o instanceof On){i+=1;continue}else if(o instanceof Qs){if(i-=1,i<=0)break;continue}}return e}};import*as _e from"fs";import*as Ca from"path";import{execSync as bf}from"child_process";import wA from"crypto";import*as As from"fs";var xo=class{constructor(t){this.cacheDir="";this.cacheVersion="5";this.cacheDir=t}generateSHA1Hash(t){let e=wA.createHash("sha1");return e.update(t),"_pint"+this.cacheVersion+"_"+e.digest("hex")}getCachePath(t){return this.cacheDir+this.generateSHA1Hash(t)+".json"}canCache(t){return typeof t>"u"?!1:t.trim().length>0}has(t){return typeof t>"u"?!1:As.existsSync(this.getCachePath(t))}serializeMap(t){return JSON.stringify(Array.from(t.entries()))}unserializeMap(t){let e=JSON.parse(t);return new Map(e)}put(t,e,i){let r=this.getCachePath(t),o={resultMapping:this.serializeMap(e),contentMapping:this.serializeMap(i)};As.writeFileSync(r,JSON.stringify(o))}get(t){let e=As.readFileSync(this.getCachePath(t),{encoding:"utf8"}),i=JSON.parse(e);return{contentMapping:this.unserializeMap(i.contentMapping),resultMapping:this.unserializeMap(i.resultMapping)}}isValid(t,e){if(t.size!==e.size)return!1;for(let[i,r]of t.entries())if(!e.has(i)||e.get(i)!==r)return!1;return!0}};var Mn=class{constructor(t,e,i,r,o){this.tmpDir="";this.cacheDir="";this.resultMapping=new Map;this.contentMapping=new Map;this.pintCommand="";this.templateFile="";this.wasCached=!1;this.outputPintResults=!1;this.markerSuffix="";this.pintConfigPath="";this.phpDocs=new Map;this.phpTagDocs=new Map;this.cleanupFiles=[];this.cleanupDirs=[];this.didFail=!1;this.pintCacheEnabled=!0;this.defaultConfig={preset:"laravel",rules:{concat_space:{spacing:"none"},no_unused_imports:!1,declare_strict_types:!1,method_argument_space:!0,single_trait_insert_per_statement:!0,types_spaces:{space:"single"}}};this.pintCacheEnabled=o,this.tmpDir=t,this.cacheDir=e,this.pintConfigPath=r,this.markerSuffix=this.markerSuffix+F.makeSlug(27);let h=this.tmpDir+"/pint.json";if(Mn.processConfigPath==null)if(this.pintConfigPath.trim().length==0||!_e.existsSync(this.pintConfigPath))_e.writeFileSync(h,JSON.stringify(this.defaultConfig),{encoding:"utf8"}),Mn.processConfigPath=h;else try{let f=JSON.parse(_e.readFileSync(this.pintConfigPath,{encoding:"utf8"}));typeof f.rules<"u"?(f.rules.no_unused_imports=!1,f.rules.declare_strict_types=!1):f.rules={no_unused_imports:!1,declare_strict_types:!1},_e.writeFileSync(h,JSON.stringify(f),{encoding:"utf8"}),Mn.processConfigPath=h}catch{_e.writeFileSync(h,JSON.stringify(this.defaultConfig),{encoding:"utf8"}),Mn.processConfigPath=h}_e.existsSync(this.cacheDir)||_e.mkdirSync(this.cacheDir),this.cache=new xo(this.cacheDir),_e.existsSync(this.tmpDir)||_e.mkdirSync(this.tmpDir),this.pintCommand=i}getDidFail(){return this.didFail}setTemplateFilePath(t){this.templateFile=t}getTemplateFile(){return this.templateFile}prepareContent(t){let e=/[^\S\n]/g,i=/['"`]/g,r=t.replace(e,"");return r=r.replace(i,""),r}getResultMapping(){return this.resultMapping}getPhpBlockContent(t){if(t.overrideContent!=null&&this.resultMapping.has(t.overrideContent))return this.resultMapping.get(t.overrideContent);let e=this.prepareContent(t.sourceContent);if(this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return this.resultMapping.get(i)}if(e=this.prepareContent(t.sourceContent.trim()),this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return this.resultMapping.get(i)}return t.sourceContent}getEchoContent(t){if(t.overrideContent!=null&&this.resultMapping.has(t.overrideContent))return this.resultMapping.get(t.overrideContent);let e=this.prepareContent(t.content);if(this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return this.resultMapping.get(i)}if(e=this.prepareContent(t.content.trim()),this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return this.resultMapping.get(i)}return t.content}getComponentParameterContent(t){if(t.overrideValue!=null&&this.resultMapping.has(t.overrideValue)){let i=this.resultMapping.get(t.overrideValue);return i.includes(`
`)?`${t.name}="
${i}
"`:t.name+'="'+i.trim()+'"'}let e=this.prepareContent(t.value);if(this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i)){let r=this.resultMapping.get(i);return r.includes(`
`)?`${t.name}="
${r}
"`:t.name+'="'+r.trim()+'"'}}if(e=this.prepareContent(t.value.trim()),this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i)){let r=this.resultMapping.get(i);return r.includes(`
`)?`${t.name}="
${r}
"`:t.name+'="'+r.trim()+'"'}}return t.content}getDirectiveContent(t){if(t.overrideParams!=null&&this.resultMapping.has(t.overrideParams))return"("+this.resultMapping.get(t.overrideParams)+")";let e=this.prepareContent(t.directiveParameters);if(this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return"("+this.resultMapping.get(i)+")"}if(e=this.prepareContent(t.directiveParameters.trim()),this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return"("+this.resultMapping.get(i)+")"}return t.directiveParameters}getDirectivePhpContent(t){if(t.overrideParams!=null&&this.resultMapping.has(t.overrideParams))return this.resultMapping.get(t.overrideParams);let e=this.prepareContent(t.documentContent);if(this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return this.resultMapping.get(i)}if(e=this.prepareContent(t.documentContent.trim()),this.contentMapping.has(e)){let i=this.contentMapping.get(e);if(this.resultMapping.has(i))return this.resultMapping.get(i)}return t.documentContent}transform(t){let e=`<?php
`,i=0,r=0;return t.getAllNodes().forEach(o=>{if(o instanceof ut){if(o.directiveName=="php"&&o.isClosedBy!=null&&o.hasValidPhp()){if(o.documentContent.trim().length==0)return;r+=1;let f="";f+=`<?php
`,f+=o.documentContent,f+=`
`,o.overrideParams="__pint"+i.toString();let p=this.prepareContent(o.documentContent);this.contentMapping.has(p)||this.contentMapping.set(p,o.overrideParams),this.phpDocs.set(o.overrideParams,f),i+=1}else if(o.hasDirectiveParameters&&!o.hasJsonParameters&&o.hasValidPhp())if(o.directiveName=="php"){let h=o.directiveParameters.substring(1,o.directiveParameters.length-1).trim();if(h.length==0)return;r+=1,e+="// "+i.toString()+"=IPD"+this.markerSuffix,e+=`
`,F.breakByNewLine(h).forEach(p=>{e+=p.trimLeft()+`
`}),e=e.trimRight(),e+=";",e+=`
`,o.overrideParams="__pint"+i.toString();let f=this.prepareContent(o.directiveParameters);this.contentMapping.has(f)||this.contentMapping.set(f,o.overrideParams),i+=1}else if(o.directiveName=="forelse"||o.directiveName=="foreach"){let h=o.directiveParameters.substring(1,o.directiveParameters.length-1).trim();if(h.length==0)return;r+=1,e+="// "+i.toString()+"=FRL"+this.markerSuffix,e+=`
`,e+="foreach(",F.breakByNewLine(h).forEach(p=>{e+=p.trimLeft()+`
`}),e+=") {}",e+=`
`,o.overrideParams="__pint"+i.toString();let f=this.prepareContent(o.directiveParameters);this.contentMapping.has(f)||this.contentMapping.set(f,o.overrideParams),i+=1}else{let h=o.directiveParameters.substring(1,o.directiveParameters.length-1).trim(),f="$tVar = ",p="=DIR";if(o.getArgCount()>1&&(h="["+h+"]",f="$tArrVar = ",p="=ADR"),h.length==0)return;r+=1,e+="// "+i.toString()+p+this.markerSuffix,e+=`
`,e+=f,F.breakByNewLine(h).forEach(d=>{e+=d.trimLeft()+`
`}),e+=";",e+=`
`,o.overrideParams="__pint"+i.toString();let E=this.prepareContent(o.directiveParameters);this.contentMapping.has(E)||this.contentMapping.set(E,o.overrideParams),i+=1}}else if(o instanceof de&&o.hasValidPhp()){let h=o.content.trim();if(h.length==0)return;r+=1,e+="// "+i.toString()+"=ECH"+this.markerSuffix,e+=`
`,e+="echo ",F.breakByNewLine(h).forEach(p=>{e+=p.trimLeft()+`
`}),e=e.trimRight(),e+=";",e+=`
`,o.overrideContent="__pint"+i.toString();let f=this.prepareContent(o.content);this.contentMapping.has(f)||this.contentMapping.set(f,o.overrideContent),i+=1}else if(o instanceof Ie)o.parameters.length&&o.parameters.forEach(h=>{if(h.type==1&&h.directive!=null&&!h.directive.hasJsonParameters&&h.directive.hasValidPhp()){let f=h.directive.directiveParameters.substring(1,h.directive.directiveParameters.length-1).trim();if(f.length==0)return;r+=1,e+="// "+i.toString()+"=DIR"+this.markerSuffix,e+=`
`,e+="$tVar = ",F.breakByNewLine(f).forEach(E=>{e+=E+`
`}),e+=";",e+=`
`,h.directive.overrideParams="__pint"+i.toString();let p=this.prepareContent(h.directive.directiveParameters);this.contentMapping.has(p)||this.contentMapping.set(p,h.directive.overrideParams),i+=1}else if(h.type==3&&h.inlineEcho!=null&&h.inlineEcho.hasValidPhp()){r+=1;let f=h.inlineEcho.content.trim();e+="// "+i.toString()+"=ECH"+this.markerSuffix,e+=`
`,e+="echo ",F.breakByNewLine(f).forEach(E=>{e+=E+`
`}),e=e.trimRight(),e+=";",e+=`
`,h.inlineEcho.overrideContent="__pint"+i.toString();let p=this.prepareContent(h.inlineEcho.content);this.contentMapping.has(p)||this.contentMapping.set(p,h.inlineEcho.overrideContent),i+=1}else if(h.isExpression&&!h.isEscapedExpression&&h.hasValidPhpExpression()){r+=1;let f=h.value.trim();e+="// "+i.toString()+"=CPV"+this.markerSuffix,e+=`
`,e+="echo ",F.breakByNewLine(f).forEach(E=>{e+=E+`
`}),e=e.trimRight(),e+=";",e+=`
`,h.overrideValue="__pint"+i.toString();let p=this.prepareContent(h.value);this.contentMapping.has(p)||this.contentMapping.set(p,h.overrideValue),i+=1}});else if(o instanceof Fe&&o.hasValidPhp()){let f=o.sourceContent.trim().substring(5).trimLeft();if(f=f.trimRight().substring(0,f.length-2).trim(),f.length==0)return;r+=1,o.overrideContent="__pint"+i.toString();let p=this.prepareContent(o.sourceContent);this.contentMapping.has(p)||this.contentMapping.set(p,o.overrideContent),this.phpTagDocs.set(o.overrideContent,o.sourceContent+"KEEP"),i+=1}}),r==0?null:e}format(t){let e=this.transform(t);if(e==null)return this.resultMapping;if(this.wasCached=!1,this.pintCacheEnabled&&this.cache.canCache(this.templateFile)&&this.cache.has(this.templateFile))try{let d=this.cache.get(this.templateFile);if(this.cache.isValid(d.contentMapping,this.contentMapping))return this.contentMapping=d.contentMapping,this.resultMapping=d.resultMapping,this.wasCached=!0,this.resultMapping}catch{}let i="";try{i=this.callLaravelPint(e)}catch(d){return this.didFail=!0,this.cleanupFiles.forEach(x=>{_e.unlinkSync(x)}),this.cleanupDirs.forEach(x=>{_e.rmdirSync(x,{recursive:!0})}),this.outputPintResults&&console.error(d),this.resultMapping}this.cleanupFiles.forEach(d=>{_e.unlinkSync(d)});let r=F.breakByNewLine(i),o=[],h=this.markerSuffix,f=-1,p="",E=!1;return r.forEach(d=>{if(d.endsWith(h)){E=!0;var x=parseInt(d.substring(2).trim().substring(0,d.indexOf("="))),_=d.substring(d.indexOf("=")+1,d.indexOf("=")+4);if(p==""&&(p=_),f==-1){f=x;return}else{this.resultMapping.set("__pint"+f.toString(),this.cleanPintOutput(o.join(`
`),p)),o=[],f=x,p=_;return}}E&&o.push(d)}),o.length>0&&(this.resultMapping.set("__pint"+f.toString(),this.cleanPintOutput(o.join(`
`),p)),o=[],f=-1),this.pintCacheEnabled&&this.cache.canCache(this.templateFile)&&this.cache.put(this.templateFile,this.resultMapping,this.contentMapping),this.resultMapping}cleanPintOutput(t,e){let i=t;return e=="DIR"?(i=i.trim().trimRight(),i=i.substring(7).trimLeft(),i.endsWith(";")&&(i=i.substring(0,i.length-1).trimRight())):e=="ADR"?(i=i.trim().trimRight(),i=i.substring(10).trimLeft(),i.endsWith(";")&&(i=i.substring(0,i.length-1).trimRight()),i=i.substring(1,i.length-1)):e=="PHP"?(i=t.trim().substring(5).trimLeft(),i=i.trimRight(),i=i.trimRight(),i.endsWith("?")&&(i=i.substring(0,i.length-1).trimRight())):e=="IPD"?(i=t.trim().trimRight(),i.endsWith("?")&&(i=i.substring(0,i.length-1).trimRight()),i.endsWith(";")&&(i=i.substring(0,i.length-1).trimRight())):e=="FRL"?(i=i.trimLeft().substring(8).trimLeft(),i.startsWith("$")==!1&&(i=i.substring(1).trimLeft()),i=i.trimRight(),i=i.trimRight(),i.endsWith("?")&&(i=i.substring(0,i.length-1).trimRight()),i.endsWith(";")&&(i=i.substring(0,i.length-1).trimRight()),i=i.substring(0,i.length-1).trimRight(),i=i.substring(0,i.length-1).trimRight(),i=i.substring(0,i.length-1).trimRight()):e=="ECH"||e=="CPV"?(i=t.trim(),i=i.substring(4).trimLeft(),i=i.trimRight(),i=i.trimRight(),i.endsWith("?")&&(i=i.substring(0,i.length-1).trimRight()),i.endsWith(";")&&(i=i.substring(0,i.length-1).trimRight())):e=="BHP"&&(i=t.trim()),i}callLaravelPint(t){if(this.wasCached)return"";let e=F.makeSlug(26),i="",r="",o="";if(this.phpDocs.size>0||this.phpTagDocs.size>0){let h=this.tmpDir+"/"+F.makeSlug(32)+"/";_e.mkdirSync(h);let f=h+e+".php";_e.writeFileSync(f,t,{encoding:"utf8"}),this.cleanupFiles.push(f),this.cleanupDirs.push(h),this.phpDocs.forEach((E,d)=>{let x=h+e+"php_"+d+".php";_e.writeFileSync(x,E,{encoding:"utf8"}),this.cleanupFiles.push(x)}),this.phpTagDocs.forEach((E,d)=>{let x=h+e+"tag_php_"+d+".php";_e.writeFileSync(x,E,{encoding:"utf8"}),this.cleanupFiles.push(x)});let p=this.pintCommand.replace("{file}",`"${h}"`)+` --config "${Mn.processConfigPath}"`;r=bf(p).toString(),this.phpDocs.forEach((E,d)=>{let x=h+e+"php_"+d+".php",u=_e.readFileSync(x,{encoding:"utf8"}).trim().substring(5);this.resultMapping.set(d,u)}),this.phpTagDocs.forEach((E,d)=>{let x=h+e+"tag_php_"+d+".php",u=_e.readFileSync(x,{encoding:"utf8"}).trim();u=u.substring(0,u.length-4),this.resultMapping.set(d,u)}),o=_e.readFileSync(f,{encoding:"utf8"})}else{let h=this.tmpDir+e+".php";_e.writeFileSync(h,t,{encoding:"utf8"});let f=this.pintCommand.replace("{file}",`"${h}"`)+` --config "${Mn.processConfigPath}"`;i=Ca.basename(h);try{r=bf(f).toString(),o=_e.readFileSync(h,{encoding:"utf8"})}catch(p){throw p}finally{this.cleanupFiles.push(h)}}if(this.outputPintResults&&typeof this.templateFile<"u"&&this.templateFile!=null&&r.includes(i)){let h=F.breakByNewLine(r),f=[];for(let p=0;p<h.length;p++){let E=h[p].trim();E.length==0||E=="\u2713"||(E.startsWith("\u2713")&&(E=E.substring(1).trim()),E.includes(i)&&(E=Ca.basename(this.templateFile)+E.substring(E.indexOf(i)+i.length)),f.push(E))}console.log(f.join(`
`))}return o}},ar=Mn;ar.processConfigPath=null;var _o=class{constructor(t,e){this.tabSize=0;this.content="";this.activeIndentLevel=0;this.tabSize=t,this.activeIndentLevel=e}appendNoRepeat(t){return this.content.trimEnd().endsWith(t)==!1?this.append(t):this}append(t){return this.content+=t,this}getContents(){return this.content}newLine(){return this.content+=`
`,this}indent(){return this.content+=" ".repeat(this.tabSize*this.activeIndentLevel),this}outdent(){let t=this.activeIndentLevel-1;return t<1&&(t=1),this.content+=" ".repeat(this.tabSize*t),this}};var Cn=class{static print(t,e,i){let r=new _o(e,i);if(r.append("[").newLine(),t.elements.length>0){let o="";r.indent(),t.elements.forEach(h=>{t.maxKeyLength>0&&h.key!=null&&(o=""),h.key!=null?(r.append(h.key.sourceContent+o).append(" => "),h.value!=null&&(h.value instanceof Qn?h.value.elements.length==0?r.append("[],"):r.append(Cn.print(h.value,e,i+1)):r.append(h.value.sourceContent))):h.value!=null&&(h.value instanceof Qn?r.append(Cn.print(h.value,e,i+1)):r.append(h.value.sourceContent)),r.appendNoRepeat(",").newLine(),h.isLast||r.indent()})}return i>1&&r.outdent(),r.append("]"),r.getContents()}};var ts=class{static printComment(t,e,i){if(t.isMultiline()){let r=F.breakByNewLine(t.innerContent.trim()),o=[];r.forEach(p=>{o.push(" ".repeat(e+i)+p.trim())});let h=o.join(`
`),f=`{{--
`;return f+=h,f+=`
`+" ".repeat(i)+"--}}",f}return"{{-- "+t.innerContent.trim()+" --}}"}};function bs(n,t){if(n.includes(`
`)&&(n.includes("match")||n.includes("=>")||n.includes("&&")||n.includes(",")||n.includes("("))){let e=F.breakByNewLine(n),i=0;return e.forEach(r=>{let o=r.trim().length;o>i&&(i=o)}),i+Math.ceil(i/2)}return t}function Eo(n){let t=F.breakByNewLine(n),e=[],i=!1;for(let r=0;r<t.length;r++){let o=t[r];if(o.trimRight().endsWith("//")&&!i){e.push(o.trimRight().substring(0,o.trimRight().length-2).trimRight()),i=!0;continue}e.push(o)}return e.join(`
`)}function ko(n){let t=F.breakByNewLine(n),e=[],i=!1,r=!1,o=!0;for(let h=0;h<t.length;h++){let f=t[h];if(!i&&f.trimRight().endsWith("[")){r=!0,e.push(f);continue}if(f.trimRight().endsWith(",")&&r&&!i)if(f.trimRight().endsWith("//")){o=!1;break}else e.push(f+"//"),i=!0;else e.push(f)}return o?{content:e.join(`
`),addedHack:i}:{content:n,addedHack:!1}}var yo=class{constructor(){this.chars=[];this.value="";this.cur=null;this.prev=null;this.next=null;this.currentIndex=0;this.inputLen=0;this.currentContent=[]}updateIndex(t){this.currentIndex=t}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}inputLength(){return this.inputLen}getCurrentIndex(){return this.currentIndex}incrementIndex(){this.currentIndex+=1}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}pushChar(t){this.currentContent.push(t)}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return this.value.substr(t,e)}encounteredFailure(){}unwrap(t){if(t=t.trim(),!(t.startsWith("(")&&t.endsWith(")")))return t;for(this.value=t,this.chars=t.split(""),this.inputLen=this.chars.length,this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur=="("&&this.currentIndex==0){let e=qi(this,"(",")");if(e.content==t){let i=e.content.substring(1);return this.unwrap(i.substring(0,i.length-1))}else break}break}return t}};var An=class{static canUseSimpleParser(t){return!(t.includes("//")||t.includes("/**")||t.includes("?")||t.includes(":")||t.includes("(")&&t.includes(")")||t.includes("{")&&t.includes("}"))}static getReasonableDirectivePhpOptions(t,e){return An.defaultControlDirectiveNames.includes(t.name)?{...e,trailingCommaPHP:!1}:e}static async printDirective(t,e,i,r,o,h){let f=t.directiveName.trim(),p="@"+f;if(t.hasDirectiveParameters){let E=t.directiveParameters;if(t.hasJsonParameters){if(e.formatDirectiveJsonParameters&&r&&t.hasValidJson()){let x=t.getPhpContent().trim();x.startsWith("(")&&x.endsWith(")")&&(x=x.substring(1),x=x.substring(0,x.length-1));let _=await r(x);_.includes(`
`)&&(_=ie.shiftIndent(_,o,!0,e)),E="("+_+")"}}else if(e.formatDirectivePhpParameters&&i!=null&&t.hasValidPhp()){if(h!=null){let T=e.spacesAfterDirective;An.defaultControlDirectiveNames.includes(f)&&(T=e.spacesAfterControlDirective);let w="@"+f+" ".repeat(T),R=h.getDirectiveContent(t);if(R=ie.shiftIndent(R,o,!0,e),An.defaultControlDirectiveNames.includes(f)&&R.includes(`
`)){let M=F.breakByNewLine(R),J=[];for(let W=0;W<M.length;W++){let j=M[W];if(W==0){J.push(j);continue}J.push(" ".repeat(w.length+1)+j)}R=J.join(`
`)}return w+R}let x=t.getPhpContent().trim(),_=new yo;for(;x.startsWith("(")&&x.endsWith(")");)x=_.unwrap(x);let u=x,c=!1,g=!0,y=vs();if(x.startsWith("[")&&x.endsWith("]")&&t.startPosition?.line!=t.endPosition?.line&&An.canUseSimpleParser(x)){let T="<?php "+x,w=ko(T);w.addedHack&&(T=w.content),u=await i(T,e,An.getReasonableDirectivePhpOptions(t,{...y,printWidth:bs(x,y.printWidth)})),w.addedHack&&(u=Eo(u));let R=new Cs,M=R.parse(F.replaceAllInString(u,`
`," ")),J=0;return R.getIsAssoc()||u.includes("match")||u.includes("=>")||u.includes("&&")?(u.includes(`
`)&&!c&&(u=ie.shiftIndent(u,o,!0,e)),ke.couldReflow(u)&&(u=ke.instance.reflow(u)),Be.couldReflow(u)&&(u=Be.instance.reflow(u)),u="@"+f+" ".repeat(e.spacesAfterDirective)+"("+u+")"):M!=null&&(u=Cn.print(M,e.tabSize,1),J>0&&(u=F.removeEmptyNewLines(ie.shiftIndent(u,J,!0,e))),u.includes(`
`)&&!c&&(u=ie.shiftIndent(u,o,!0,e)),u="@"+f+" ".repeat(e.spacesAfterDirective)+"("+u+")"),u}else try{let T=vs();t.startPosition?.line==t.endPosition?.line&&(T={...vs(),printWidth:1/0},c=!0),u=await i("<?php "+x,e,An.getReasonableDirectivePhpOptions(t,T))}catch{}if(t.directiveName.toLocaleLowerCase().match(/^for(each|else)$/)&&(u=u.substring(9),u=u.substring(0,u.length-14)),t.getArgCount()>1){let T=u;T.startsWith("[")&&T.endsWith("];")&&(T=u.substring(1,u.length-2)),u.trimStart().startsWith("[")&&u.trimEnd().endsWith("];")&&(g=!1,T=`
`+T.trimEnd(),T.endsWith(",")&&(T=T.substring(1,T.length-1),T+=`
`)),u=T}ke.couldReflow(u)&&(u=ke.instance.reflow(u)),Be.couldReflow(u)&&(u=Be.instance.reflow(u)),u.includes(`
`)&&!c?(E="("+ie.shiftIndent(u,o,!0,e,!1,!1,g),g||(E+=" ".repeat(o)),E+=")"):(c&&(u=OA(u,t)),u.startsWith("(")&&u.endsWith(")")&&(u=_.unwrap(u)),E="("+u+")")}let d=e.spacesAfterDirective;An.defaultControlDirectiveNames.includes(f)&&(d=e.spacesAfterControlDirective),p+=" ".repeat(d)+E}return p}},hr=An;hr.defaultControlDirectiveNames=["if","elseif","unless","while","for","foreach","forelse"];function OA(n,t){let e="",i=F.breakByNewLine(n);for(let r=0;r<i.length;r++){let h=i[r].trim();(t?.directiveName==="foreach"||t?.directiveName==="forelse")&&(h==="as"||h.startsWith("as "))&&(e+=" "),e+=h}return e}var bn=class{static async printEcho(t,e,i,r,o){let h="{{ ",f=" }}";t instanceof en?(h="{!! ",f=" !!}"):t instanceof nn&&(h="{{{ ",f=" }}}");let p=h,E=t.content.trim();if(e.formatInsideEcho&&i!=null&&t.hasValidPhp()){let d=df(),x=E;if(t.startPosition?.line!=t.endPosition?.line){if(d={...d,printWidth:bs(E,d.printWidth)},e.useLaravelPint)o!=null&&(x=o.getEchoContent(t));else{let u=ko(E);u.addedHack&&(E=u.content),x=await i("<?php "+E,e,d),u.addedHack&&(x=Eo(x)),ke.couldReflow(x)&&(x=ke.instance.reflow(x)),Be.couldReflow(x)&&(x=Be.instance.reflow(x))}if(e.echoStyle=="inline"){let u=ie.shiftIndentWithLastLineInline(x,e.tabSize,r+e.tabSize,!0).trim();return h.trimRight()+" "+u+" "+f.trim()}return h.trim()+`
`+ie.shiftIndent(x,r+e.tabSize,!1,e,!0)+`
`+" ".repeat(r)+f.trim()}else e.useLaravelPint?o!=null&&(x=o.getEchoContent(t)):(x=await i("<?php "+E+";",e,{...d,printWidth:1/0}),x=x.trimRight().substring(0,x.trimRight().length-1),ke.couldReflow(x)&&(x=ke.instance.reflow(x)),Be.couldReflow(x)&&(x=Be.instance.reflow(x))),x.includes(`
`)&&(x=F.collapse(x));E=x}return p+=E+f,p}};var cn=class{};cn.FormatIgnoreStart="format-ignore-start",cn.FormatIgnoreEnd="format-ignore-end";var le=class{constructor(t){this.isInsideIgnoreFormatter=!1;this.ignoredLiteralBlocks=new Map;this.activeLiteralSlug="";this.shadowDoc=null;this.inlineDirectiveBlocks=new Map;this.contentDirectives=new Map;this.dynamicEchoBlocks=new Map;this.dynamicAttributeEchoBlocks=new Map;this.pairedDirectives=new Map;this.dynamicInlineDirectives=new Map;this.inlineDirectives=new Map;this.attachedDirectives=new Map;this.inlineEchos=new Map;this.spanEchos=new Map;this.inlinePhpNodes=new Map;this.echoBlockSlugs=new Map;this.parentTransformer=null;this.forElseWithEmpty=[];this.forElseNoEmpty=[];this.conditions=[];this.switchStatements=[];this.removeLines=[];this.virtualStructureOpens=[];this.virtualStructureClose=[];this.inlineComments=new Map;this.htmlTagComments=new Map;this.blockComments=[];this.blockPhpNodes=new Map;this.breakDirectives=new Map;this.htmlTagDirectives=new Map;this.htmlTagSwitchStatements=new Map;this.dynamicElementDirectives=new Map;this.dynamicElementDirectiveNodes=new Map;this.dynamicElementConditions=new Map;this.dynamicElementConditionNodes=new Map;this.dynamicElementSwitch=new Map;this.dynamicElementSwitchNodes=new Map;this.dynamicElementForElse=new Map;this.dynamicElementForElseNodes=new Map;this.dynamicElementPhpNodes=new Map;this.dynamicElementPhp=new Map;this.embeddedEchos=new Map;this.inlineLiterals=new Map;this.embeddedDirectives=new Map;this.structureLines=[];this.directiveParameters=new Map;this.expressionParameters=new Map;this.echoParameters=new Map;this.commentParameters=new Map;this.slugs=[];this.extractedEmbeddedDocuments=new Map;this.propDirectives=new Map;this.useLaravelPint=!1;this.pintTransformer=null;this.filePath="";this.formattingOptions=null;this.didPintFail=!1;this.removedAttributes=new Map;this.shorthandSlotAttributes=new Map;this.shorthandSlotAttributeReference=new Map;this.phpFormatter=null;this.blockPhpFormatter=null;this.phpTagFormatter=null;this.jsonFormatter=null;this.transformOptions={spacesAfterDirective:0,spacesAfterControlDirective:1,tabSize:4,formatDirectiveJsonParameters:!0,formatDirectivePhpParameters:!0,formatInsideEcho:!0,phpOptions:null,attributeJsOptions:null,echoStyle:"block",useLaravelPint:!1,pintCommand:"pint {filename}",pintTempDirectory:"",pintCacheDirectory:"",pintCacheEnabled:!0,pintConfigPath:"",classStrings:ys(),formatJsAttributes:!0,excludeJsAttributes:[],safeWrappingJsAttributes:["^x-data"],includeJsAttributes:["^x-"],normalizeInlineSlotNames:!0};this.forceCleanLines=["@endphp","@elseif","@else","@endif","@endswitch","@endverbatim","@case","@default"];this.doc=t}withShadowDocument(t=null){return this.shadowDoc=t,this}getPintTransformer(){return this.pintTransformer}setPintTransformer(t){this.pintTransformer=t}setUsingLaravelPint(t){this.useLaravelPint=t}getUsingLaravelPint(){return this.useLaravelPint}withRemovedAttributes(t){return this.removedAttributes=t,this}setParentTransformer(t){return this.parentTransformer=t,this.cloneOptions(t),this}cloneOptions(t){return this.setUsingLaravelPint(t.getUsingLaravelPint()),this.setPintTransformer(t.getPintTransformer()),this}getFormattingOptions(){return this.formattingOptions}setFormattingOptions(t){return this.formattingOptions=t,this}withJsonFormatter(t){return this.jsonFormatter=t,this}getJsonFormatter(){return this.jsonFormatter}withFilePath(t){return this.filePath=t,this}withBlockPhpFormatter(t){return this.blockPhpFormatter=t,this}getBlockPhpFormatter(){return this.blockPhpFormatter}withPhpTagFormatter(t){return this.phpTagFormatter=t,this}getPhpTagFormatter(){return this.phpTagFormatter}withPhpFormatter(t){return this.phpFormatter=t,this}getPhpFormatter(){return this.phpFormatter}removeBlade(){let t=this.doc.getAllNodes(),e="";return t.forEach(i=>{i instanceof Pt?e+=i.getOutputContent():i instanceof Fe?e+=i.sourceContent:i instanceof ut&&i.directiveName=="verbatim"&&(e+=i.innerContent)}),e}close(t){return"</"+t+">"}open(t){return"<"+t+">"}selfClosing(t){return"<"+t+" />"}pair(t,e=""){return"<"+t+">"+e+"</"+t+">"}async printDirective(t,e){return await hr.printDirective(t,this.transformOptions,this.phpFormatter,this.jsonFormatter,e,this.pintTransformer??le.sharedPintTransformer)}makeSlug(t){let e=F.makeSlug(t);return this.slugs.includes(e)?this.makeSlug(t+1):(this.slugs.push(e),e)}registerDirectiveParameter(t,e){this.parentTransformer!=null?this.parentTransformer.registerDirectiveParameter(t,e):this.directiveParameters.set(t,e)}registerShorthandSlot(t){if(this.parentTransformer!=null)return this.parentTransformer.registerShorthandSlot(t);let e=this.makeSlug(20);return this.shorthandSlotAttributes.set(t.refId,e),this.shorthandSlotAttributeReference.set(e,t),e}getSlotSlug(t){return this.parentTransformer!=null?this.parentTransformer.getSlotSlug(t):this.shorthandSlotAttributes.has(t)?this.shorthandSlotAttributes.get(t):""}registerCommentParameter(t,e){this.parentTransformer!=null?this.parentTransformer.registerCommentParameter(t,e):this.commentParameters.set(t,e)}registerEchoParameter(t,e){this.parentTransformer!=null?this.parentTransformer.registerEchoParameter(t,e):this.echoParameters.set(t,e)}registerExpressionParameter(t,e){this.parentTransformer!=null?this.parentTransformer.registerExpressionParameter(t,e):this.expressionParameters.set(t,e)}registerCondition(t){this.parentTransformer!=null?this.parentTransformer.registerCondition(t):this.conditions.push(t)}registerInlineLiteral(t,e){this.parentTransformer!=null?this.parentTransformer.registerInlineLiteral(t,e):this.inlineLiterals.set(t,{content:e})}registerSwitchStatement(t){this.parentTransformer!=null?this.parentTransformer.registerSwitchStatement(t):this.switchStatements.push(t)}registerPairedDirective(t,e){this.parentTransformer!=null?this.parentTransformer.registerPairedDirective(t,e):e.isInline==!1?this.pairedDirectives.set(t,e):(this.inlineDirectives.set(e.slug,e),this.dynamicInlineDirectives.set(e.directive.nodeContent,e.slug))}registerAttachedDirective(t,e){this.parentTransformer!=null?this.parentTransformer.registerAttachedDirective(t,e):this.attachedDirectives.set(t,e)}registerInlineDirectiveBlock(t,e){this.parentTransformer!=null?this.parentTransformer.registerInlineDirectiveBlock(t,e):this.inlineDirectiveBlocks.set(t,e)}registerContentDirective(t,e){this.parentTransformer!=null?this.parentTransformer.registerContentDirective(t,e):this.contentDirectives.set(t,e)}registerComment(t,e){this.parentTransformer!=null?this.parentTransformer.registerComment(t,e):this.inlineComments.set(t,e)}registerDynamicDirective(t,e){this.parentTransformer!=null?(this.dynamicElementDirectives.set(e.nodeContent,t),this.parentTransformer.registerDynamicDirective(t,e)):(this.dynamicElementDirectives.set(e.nodeContent,t),this.dynamicElementDirectiveNodes.set(t,e))}prepareConditionalDirective(t){if(this.dynamicElementDirectives.has(t.nodeContent))return this.dynamicElementDirectives.get(t.nodeContent);let e=this.makeSlug(t.nodeContent.length);return this.registerDynamicDirective(e,t),e}prepareInlineBlockDirective(t){let e=this.makeSlug(t.sourceContent.length);return this.registerInlineDirectiveBlock(e,t),this.selfClosing(e)}prepareContentDirective(t){let e=this.makeSlug(t.sourceContent.length);if(this.registerContentDirective(e,t),t.nextNode!=null){let i=(t.nextNode.startPosition?.offset??0)-(t.endPosition?.offset??0);if(t.nextNode instanceof Pt){let r=t.nextNode;if(r.content.length-r.content.trimLeft().length>0)return e;if(r.content.length==0)return e;{let o=r.content[0];return F.ctypePunct(o)||F.ctypeSpace(o)?e:e+" "}}else return i>0?e+" ":e}return e}registerPhpBlock(t,e){this.parentTransformer!=null?this.parentTransformer.registerPhpBlock(t,e):(this.removeLines.push(this.close(t)),this.blockPhpNodes.set(t,e))}registerConditionalPhpBlock(t,e){this.parentTransformer!=null?(this.dynamicElementPhp.set(e.sourceContent,t),this.parentTransformer.registerConditionalPhpBlock(t,e)):(this.dynamicElementPhp.set(e.sourceContent,t),this.dynamicElementPhpNodes.set(t,e))}prepareConditionalPhpBlock(t){if(this.dynamicElementPhp.has(t.sourceContent))return this.dynamicElementPhp.get(t.sourceContent);let e=this.makeSlug(t.sourceContent.length);return this.registerConditionalPhpBlock(e,t),e}registerInlinePhpBlock(t){if(this.parentTransformer!=null)return this.parentTransformer.registerInlinePhpBlock(t);{let e=this.makeSlug(t.sourceContent.length);return this.inlinePhpNodes.set(e,t),e}}prepareInlinePhpBlock(t){return this.registerInlinePhpBlock(t)}transformComponentSlots(t){let e=t;return this.shorthandSlotAttributeReference.forEach((i,r)=>{let o=`<x-${r}`,h=`</x-${r}`,f=i.name?.inlineName,p=`<x-slot:${f}`,E=this.transformOptions.normalizeInlineSlotNames?"</x-slot":`</x-slot:${f}`;e=F.safeReplaceAllInString(e,h,E),e=F.safeReplaceAllInString(e,o,p)}),e}preparePhpBlock(t){if(t.fragmentPosition==0)return this.prepareConditionalPhpBlock(t);if(t.isInline||t.fragmentPosition==2||t.fragmentPosition==1)return this.prepareInlinePhpBlock(t);let e=this.makeSlug(35);this.registerPhpBlock(e,t);let i=this.open(e),r=this.close(e);return`
`+i+r+`
`}async transformPhpBlock(t){let e=t;for(let[i,r]of this.blockPhpNodes){let o=this.open(i),h=this.indentLevel(o),f=r.sourceContent;this.transformOptions.formatDirectivePhpParameters&&r.hasValidPhp()&&(this.useLaravelPint?this.pintTransformer!=null?f=this.pintTransformer.getPhpBlockContent(r):le.sharedPintTransformer!=null&&(f=le.sharedPintTransformer.getPhpBlockContent(r)):this.phpTagFormatter!=null&&(f=await this.phpTagFormatter(f,this.transformOptions,null),ke.couldReflow(f)&&(f=ke.instance.reflow(f)),Be.couldReflow(f)&&(f=Be.instance.reflow(f))),f=ie.shiftIndent(f,h,!0,this.transformOptions)),e=F.safeReplace(e,o,f)}for(let[i,r]of this.dynamicElementPhpNodes){let o=await this.printInlinePhp(r);e=F.safeReplaceAllInString(e,i,o)}for(let[i,r]of this.inlinePhpNodes){let o=await this.printInlinePhp(r);e=F.safeReplace(e,i,o)}return e}async printInlinePhp(t){let e=t.sourceContent;return this.phpTagFormatter&&t.hasValidPhp()&&(e=await this.phpTagFormatter(e,this.transformOptions,null),ke.couldReflow(e)&&(e=ke.instance.reflow(e)),Be.couldReflow(e)&&(e=Be.instance.reflow(e)),e=F.safeReplaceAllInString(e,`
`," ")),e}shouldCreateVirutal(t){let e=t.getImmediateChildren();if(e.length==0)return!0;let i=!0,r=!0,o=0,h=0,f=0,p=!0;for(let E=0;E<e.length;E++){let d=e[E];d instanceof de&&d.isInlineEcho?(i=!1,o+=1,h+=1):d instanceof Pt?(f+=1,d.content.trim().length>0&&(r=!1)):h+=1}return o==0&&(p=!0),h>0&&i==!0?!1:(r==!1&&h==0&&(p=!0),r==!0&&h==0&&(p=!0),p)}preparePairedDirective(t){let e=this.makeSlug(t.sourceContent.length),i=t.directiveName.toLowerCase(),r=t.childrenDocument?.document.transform().setParentTransformer(this).toStructure();if(t.fragmentPosition!=0){if(t.originalAbstractNode!=null&&t.originalAbstractNode.prevNode instanceof de&&t.originalAbstractNode instanceof ut&&t.originalAbstractNode.directiveName=="if"){let E=(t.originalAbstractNode.startPosition?.index??0)-(t.originalAbstractNode.prevNode.endPosition?.index??0);if(E>0&&E<3)return this.registerAttachedDirective(e,{directive:t,innerDoc:r,slug:e,isInline:!1,virtualElementSlug:""}),e}let h="",f=`${this.open(e)}`,p=!0;if(t.fragmentPosition==1?i!="php"&&i!="verbatim"&&(t.isClosedBy==null||t.startPosition?.line!=t.isClosedBy.startPosition?.line?f+=`
`:p=!1):f+=`
`,i=="php"||i=="verbatim")h=this.makeSlug(15),f+=this.pair(h);else{let E=this.isAllInlineNodes(t.children??[]),d=this.containsBladeStructures(t.children??[]);if(kn)f+=" "+r.trim()+" ";else if(this.shouldCreateVirutal(t)&&t.containsChildStructures==!1&&t.containsAnyFragments==!1&&!E&&!d||!t.containsAnyFragments&&E&&d)if(!t.containsAnyFragments&&!d&&t.documentContent.trim().length>0&&t.documentContent.trim().split(`
`).length==1)if(t.endPosition?.line!=t.isClosedBy?.startPosition?.line){let x=this.makeSlug(32);this.registerInlineLiteral(x,t.documentContent.trim()),f+=this.selfClosing(x)}else h=this.makeSlug(15),f+=this.pair(h,r);else h=this.makeSlug(15),f+=this.pair(h,r);else f+=r}return f+=`${this.close(e)}`,p&&(f+=`
`),this.virtualStructureOpens.push(this.open(h)),this.virtualStructureClose.push(this.close(h)),this.virtualStructureClose.push(this.close(e)),this.registerPairedDirective(e,{innerDoc:r,slug:e,directive:t,virtualElementSlug:h,isInline:!1}),f}if(this.dynamicInlineDirectives.has(t.nodeContent))return this.dynamicInlineDirectives.get(t.nodeContent)+" ";let o=this.makeSlug(t.nodeContent.length);return this.registerPairedDirective(e,{innerDoc:r,slug:o,directive:t,virtualElementSlug:"",isInline:!0}),o+" "}registerForElseWithEmpty(t){this.parentTransformer!=null?this.parentTransformer.registerForElseWithEmpty(t):this.forElseWithEmpty.push(t)}prepareForElse(t){if(t.fragmentPosition==3||t.fragmentPosition==2){if(t.elseNode!=null){let E=this.makeSlug(t.constructedFrom?.sourceContent.length??0),d=this.makeSlug(t.elseNode?.sourceContent.length??0),x=t.truthDocument?.document.transform().setParentTransformer(this).toStructure(),_=t.falseDocument?.document.transform().setParentTransformer(this).toStructure(),u={truthDoc:x,falseDoc:_,forElse:t,truthClose:this.close(E),emptyOpen:this.open(d),pairClose:this.close(d),truthSlug:E,falseSlug:d},c=this.open(E);if(c+=x,c+=u.truthClose,c+=`
`+u.emptyOpen+`
`,_.includes("<")==!1){let g=this.makeSlug(32);this.registerInlineLiteral(g,_.trim()),c+=this.selfClosing(g)}else c+=_;return c+=u.pairClose,this.registerForElseWithEmpty(u),c}let i=t.constructedFrom,r=t.truthDocument?.document.transform().setParentTransformer(this).toStructure(),o=this.makeSlug(i.sourceContent.length),h=this.makeSlug(i.isClosedBy?.sourceContent.length??0),f={truthDoc:r,falseDoc:"",forElse:t,truthSlug:o,falseSlug:"",pairClose:this.close(h),emptyOpen:"",truthClose:""};this.forElseNoEmpty.push(f);let p=this.open(o);return p+=r,p+=this.close(o),p}if(this.dynamicElementForElse.has(t.nodeContent))return this.dynamicElementForElse.get(t.nodeContent)+" ";let e=this.makeSlug(t.nodeContent.length);return this.registerDynamicElementForElse(e,t),e+" "}registerBreak(t,e){this.parentTransformer!=null?this.parentTransformer.registerBreak(t,e):this.breakDirectives.set(t,e)}registerProps(t,e){this.parentTransformer!=null?this.parentTransformer.registerProps(t,e):this.propDirectives.set(t,e)}preparePropsDirective(t){let e=this.makeSlug(10);return this.registerProps(e,t),`
${this.pair(e)}`}prepareBreakDirective(t){let e=this.makeSlug(10);return this.registerBreak(e,t),`
${this.pair(e)}`}registerEmbeddedDirective(t){if(this.parentTransformer!=null)return this.parentTransformer.registerEmbeddedDirective(t);let e=this.makeSlug(t.nodeContent.length);return this.embeddedDirectives.set(e,t),e}prepareHtmlSwitchStatement(t){if(le.rootTransformer!=null&&le.rootTransformer!=this)return le.rootTransformer.prepareHtmlSwitchStatement(t);let e=F.makeSlug(64);return this.htmlTagSwitchStatements.set(e,t),e}prepareHtmlTagDirective(t){if(le.rootTransformer!=null&&le.rootTransformer!=this)return le.rootTransformer.prepareHtmlTagDirective(t);let e=F.makeSlug(64);return this.htmlTagDirectives.set(e,t),e}registerEmbeddedDocument(t,e,i){return this.parentTransformer!=null?this.parentTransformer.registerEmbeddedDocument(t,e,i):(this.extractedEmbeddedDocuments.set(t,{slug:t,content:e,isScript:i}),t)}prepareDirective(t){return t.fragmentPosition==2&&t.isClosedBy!=null?`
`+this.prepareHtmlTagDirective(t):t.isEmbedded()?this.registerEmbeddedDirective(t):t.directiveName.trim().toLowerCase()=="break"?this.prepareBreakDirective(t):t.directiveName.trim().toLowerCase()=="props"?this.preparePropsDirective(t):t.isClosedBy!=null?this.preparePairedDirective(t):t.fragmentPosition==3?this.prepareInlineBlockDirective(t):t.fragmentPosition==0?this.prepareConditionalDirective(t):this.prepareContentDirective(t)}registerVirtualComment(t){this.parentTransformer!=null?this.parentTransformer.registerVirtualComment(t):this.blockComments.push(t)}registerHtmlTagComment(t){if(this.parentTransformer!=null)return this.parentTransformer.registerHtmlTagComment(t);let e=F.makeSlug(64);return this.htmlTagComments.set(e,t),e}prepareComment(t){if(!kn&&t.isPartOfHtmlTag())return this.registerHtmlTagComment(t);if(t.isMultiline()){let i=this.makeSlug(10),r=this.makeSlug(10),o={node:t,pairOpen:this.open(i),pairClose:this.close(i),virtualElement:this.selfClosing(r)};return this.registerVirtualComment(o),o.pairOpen+`
`+o.virtualElement+`
`+o.pairClose}let e=this.makeSlug(t.sourceContent.length);return kn&&t.hasNeighborsOnLine()&&le.inlineComments.push(this.selfClosing(e)),this.registerComment(e,t),this.selfClosing(e)}registerDynamicFragmentEcho(t){if(this.parentTransformer!=null)return this.parentTransformer.registerDynamicFragmentEcho(t);if(this.echoBlockSlugs.has(t.sourceContent))return this.echoBlockSlugs.get(t.sourceContent);{let e=this.makeSlug(t.sourceContent.length);return this.dynamicEchoBlocks.set(e,t),this.echoBlockSlugs.set(t.sourceContent,e),e}}registerDynamicAttributeFragmentEcho(t){if(this.parentTransformer!=null)return this.parentTransformer.registerDynamicFragmentEcho(t);{let e=this.makeSlug(t.sourceContent.length);return this.dynamicAttributeEchoBlocks.set(e,t),`${e}="${e}"`}}registerInlineEcho(t){if(this.parentTransformer!=null)return this.parentTransformer.registerInlineEcho(t);{let e=this.makeSlug(t.sourceContent.length);return t.isInlineEcho?(this.spanEchos.set(e,t),e):(this.inlineEchos.set(e,t),this.selfClosing(e))}}prepareComponent(t){if(t.isClosingTag){if(t.name?.name=="slot"){if(t.isOpenedBy!=null&&t.isOpenedBy.isShorthandSlot){let i=t.isOpenedBy.refId;return`</x-${this.getSlotSlug(i)}>`}return"</x-slot>"}return"</x-"+t.getComponentName()+">"}let e="<x-";if(t.name?.name=="slot"&&t.isSelfClosing==!1)if(t.name.inlineName.trim().length>0){let i=t.name.inlineName;i.startsWith(":")&&(i=i.substring(1)),t.isClosedBy!=null?e+=this.registerShorthandSlot(t):e+='slot name="'+i+'"'}else e+=t.getComponentName();else e+=t.getComponentName();return t.hasParameters&&(e+=" ",t.parameters.forEach(i=>{if(i.type==0)if(i.isExpression){let r=this.makeSlug(i.content.length);this.registerExpressionParameter(r,i),e+=r+" "}else e+=i.content+" ";else if(i.type==2)e+=i.name+" ";else if(i.type==1){let r=this.makeSlug(i.directive?.sourceContent.length??0);this.registerDirectiveParameter(r,i),e+=r+" "}else if(i.type==3&&i.inlineEcho!=null){let r=this.makeSlug(i.inlineEcho.content.length);this.registerEchoParameter(r,i),e+=r+" "}else if(i.type==4&&i.inlineComment!=null){let r=this.makeSlug(i.inlineComment.innerContent.length);this.registerCommentParameter(r,i),e+=r+" "}})),t.isSelfClosing?e+=" />":e+=">",e}registerEmbeddedEcho(t){if(this.parentTransformer!=null)return this.parentTransformer.registerEmbeddedEcho(t);let e=this.makeSlug(t.sourceContent.length);return this.embeddedEchos.set(e,t),e}prepareEcho(t){if(t.isEmbedded())return this.registerEmbeddedEcho(t);if(t.fragmentPosition==0)return this.registerDynamicFragmentEcho(t);if(t.fragmentPosition==1)return this.registerDynamicFragmentEcho(t);if(t.fragmentPosition==2){if(t.prevNode!=null&&!(t.prevNode instanceof Pt))return this.registerInlineEcho(t);if(t.nextNode!=null)if(t.nextNode instanceof Pt){let e=t.nextNode;if(e.content.length-e.content.trimLeft().length>0)return t.prevNode!=null&&t.prevNode instanceof Pt&&t.prevNode.content.endsWith("=")?this.registerDynamicFragmentEcho(t):this.registerDynamicAttributeFragmentEcho(t);if(e.content.length==0)return this.registerDynamicAttributeFragmentEcho(t);{let i=e.content[0];if(!F.ctypeSpace(i))return this.registerDynamicFragmentEcho(t)}}else return this.registerInlineEcho(t);return this.registerDynamicAttributeFragmentEcho(t)}return this.registerInlineEcho(t)}prepareSwitch(t){if(t.fragmentPosition==3||t.fragmentPosition==2){if(t.fragmentPosition==2)return this.prepareHtmlSwitchStatement(t);let i=[],r="";t.cases.forEach((_,u)=>{let c=_.head,g=_.childDocument?.document.transform().setParentTransformer(this).toStructure(),y=this.makeSlug(c.sourceContent.length),T=this.makeSlug(5),w={case:_,slug:y,doc:g,virtualOpen:this.selfClosing(T),virtualClose:this.close(T),pairOpen:this.open(y),pairClose:this.close(y),isFirst:u==0,isLast:u==t.cases.length-1,leadingClose:"",leadingOpen:""};if(_.leadingDocument!=null){let R=this.makeSlug(25);w.leadingOpen=this.open(R),w.leadingClose=this.close(R),r+=`
`+_.leadingDocument.document.transform().setParentTransformer(this).toStructure()+`
`}r+=w.pairOpen,_.head?.directiveName=="default"&&(r+=w.virtualOpen),r+=g,r+=w.pairClose,i.push(w)});let o=i[0].pairOpen,h=i[i.length-1].pairClose,f=this.makeSlug(10),p=this.open(f),E=this.close(f),d={switchNode:t,pairOpen:o,pairClose:h,structures:i,virtualSwitchClose:E,virtualSwitchOpen:p},x=`
`+p+`
`+r+`
`+E;return this.registerSwitchStatement(d),x}if(this.dynamicElementSwitch.has(t.nodeContent))return this.dynamicElementSwitch.get(t.nodeContent)+" ";let e=this.makeSlug(t.nodeContent.length);return this.registerDynamicElementSwitch(e,t),e+" "}registerDynamicElementSwitch(t,e){this.parentTransformer!=null?(this.dynamicElementSwitch.set(e.nodeContent,t),this.parentTransformer.registerDynamicElementSwitch(t,e)):(this.dynamicElementSwitch.set(e.nodeContent,t),this.dynamicElementSwitchNodes.set(t,e))}registerDynamicElementCondition(t,e){this.parentTransformer!=null?(this.dynamicElementConditions.set(e.nodeContent,t),this.parentTransformer.registerDynamicElementCondition(t,e)):(this.dynamicElementConditions.set(e.nodeContent,t),this.dynamicElementConditionNodes.set(t,e))}registerDynamicElementForElse(t,e){this.parentTransformer!=null?(this.dynamicElementForElse.set(e.nodeContent,t),this.parentTransformer.registerDynamicElementForElse(t,e)):(this.dynamicElementForElse.set(e.nodeContent,t),this.dynamicElementForElseNodes.set(t,e))}containsComponents(t){for(let e=0;e<t.length;e++)if(t[e]instanceof Ie)return!0;return!1}containsBladeStructures(t){for(let e=0;e<t.length;e++){let i=t[e];if(!(i instanceof Pt)){if(i instanceof ut&&(i.isClosingDirective||i.isClosingDirective||i.name=="elseif"||i.name=="else"))continue;return!0}}return!1}isAllInlineNodes(t){let e=0;for(let i=0;i<t.length;i++){let r=t[i];if(!(r instanceof Pt))if(r instanceof de){if(!r.isInlineEcho)return!1;e+=1}else if(r instanceof ut){if(r.isClosingDirective||r.name=="elseif"||r.name=="else")continue;return!1}else return!1}return e!=0}prepareConditions(t){if(t.fragmentPosition==3){if(t.chain.length==1&&t.constructedFrom!=null){let p=t.constructedFrom.clone();return p.childrenDocument=t.logicBranches[0].childDocument,this.preparePairedDirective(p)}let i=[],r="";t.logicBranches.forEach((p,E)=>{let d=p.head,x=p.childDocument?.document.transform().setParentTransformer(this).toStructure(),_=this.makeSlug(d.sourceContent.length),u=this.makeSlug(10),c={branch:p,slug:_,doc:x,pairOpen:this.open(_),pairClose:this.close(_),virtualOpen:this.open(u),virtualClose:this.close(u),isFirst:E==0,isLast:E==t.logicBranches.length-1,virtualBreakClose:"",virtualBreakOpen:"",isLiteralContent:!1};if(p.head?.directiveName=="else"){r+=`
`+c.pairOpen;let g=this.makeSlug(25),y=this.containsBladeStructures(p.head.children??[]);kn?(c.virtualBreakOpen=this.selfClosing(g),r+=c.virtualBreakOpen+`
`,r+=x,r+=`
`+c.pairClose):p.head.containsChildStructures==!1&&p.head.containsAnyFragments==!1&&(p.head?.children.length<=2||p.head?.children.length>4)&&!this.isAllInlineNodes(p.head.children)&&!y?(c.virtualBreakOpen=this.open(g),c.virtualBreakClose=this.close(g),r+=`
`+c.virtualBreakOpen+`
`,r+=x,r+=`
`+c.virtualBreakClose+`
`+c.pairClose):(c.virtualBreakOpen=this.selfClosing(g),r+=c.virtualBreakOpen+`
`,r+=x,r+=`
`+c.pairClose)}else{let g=this.isAllInlineNodes(p.head?.children??[]),y=this.containsBladeStructures(p.head?.children??[]);if(kn){r+=`
`+c.pairOpen;let T=this.makeSlug(25);c.virtualBreakOpen=this.selfClosing(T),r+=c.virtualBreakOpen+`
`,r+=x,r+=`
`+c.pairClose}else if(p.head?.containsAnyFragments==!1&&p.head?.containsChildStructures==!1&&(p.head?.children.length<=2||p.head?.children.length>4)&&!g&&!y){let T=this.makeSlug(25);c.virtualBreakOpen=this.open(T),c.virtualBreakClose=this.close(T),p.head?.children.length<=2&&p.head.children[0]instanceof Pt?(r+=c.pairOpen,r+=`
`+c.virtualBreakOpen,r+=`
`+c.virtualBreakClose,r+=c.pairClose,c.isLiteralContent=!0):(r+=c.pairOpen,r+=`
`+c.virtualBreakOpen,r+=x,r+=`
`+c.virtualBreakClose,r+=c.pairClose)}else if(g){r+=`
`+c.pairOpen;let T=this.makeSlug(25);c.virtualBreakOpen=this.selfClosing(T),r+=c.virtualBreakOpen+`
`,r+=x,r+=`
`+c.pairClose}else r+=c.pairOpen,r+=`
`,r+=x,r+=`
`,r+=c.pairClose}i.push(c)});let o=i[0].pairOpen,h=i[i.length-1].pairClose,f={pairOpen:o,pairClose:h,structures:i,condition:t};return this.registerCondition(f),r}if(this.dynamicElementConditions.has(t.nodeContent))return this.dynamicElementConditions.get(t.nodeContent)+" ";let e=this.makeSlug(t.nodeContent.length);if(t.startPosition?.line!=t.endPosition?.line&&(e=this.makeSlug(128)),this.registerDynamicElementCondition(e,t),t.fragmentPosition==1||t.fragmentPosition==2){if(t.logicBranches.length>0){let i=t.logicBranches[t.logicBranches.length-1];if(i.head!=null&&i.head.isClosedBy!=null&&i.head.isClosedBy.nextNode!=null){let r=(i.head.isClosedBy.nextNode.startPosition?.offset??0)-(i.head.isClosedBy.endPosition?.offset??0);if(i.head.isClosedBy.nextNode instanceof Pt){let o=i.head.isClosedBy.nextNode;if(o.content.length-o.content.trimLeft().length>0)return e;if(o.content.length==0)return e;{let h=o.content[0];return F.ctypePunct(h)||F.ctypeSpace(h)?e:e+" "}}else return r>0?e+" ":e}}return e}return e+" "}toStructure(){let t="";En&&this.parentTransformer==null&&le.rootTransformer==null&&(le.rootTransformer=this),En&&this.useLaravelPint&&this.parentTransformer==null&&(this.pintTransformer=new ar(this.transformOptions.pintTempDirectory,this.transformOptions.pintCacheDirectory,this.transformOptions.pintCommand,this.transformOptions.pintConfigPath,this.transformOptions.pintCacheEnabled),le.sharedPintTransformer=this.pintTransformer,this.pintTransformer.setTemplateFilePath(this.filePath),this.shadowDoc!=null?this.pintTransformer.format(this.shadowDoc):this.pintTransformer.format(this.doc),this.didPintFail=this.pintTransformer.getDidFail()),this.doc.getRenderNodes().forEach(r=>{if(this.isInsideIgnoreFormatter){if(this.pushLiteralBlock(this.activeLiteralSlug,r),r instanceof pi&&r.innerContent.trim().toLowerCase()==cn.FormatIgnoreEnd){this.isInsideIgnoreFormatter=!1;return}return}r instanceof Pt?t+=r.content:r instanceof di?r.cases.length>0?t+=this.prepareSwitch(r):t+=this.preparePairedDirective(r.constructedFrom):r instanceof Ke?t+=this.prepareConditions(r):r instanceof ut?t+=this.prepareDirective(r):r instanceof de?t+=this.prepareEcho(r):r instanceof mi?t+=this.prepareForElse(r):r instanceof pi?r.innerContent.trim()==cn.FormatIgnoreStart?(this.isInsideIgnoreFormatter=!0,this.activeLiteralSlug=this.makeSlug(16),this.pushStartLiteralBlock(this.activeLiteralSlug,r),t+=this.selfClosing(this.activeLiteralSlug)):t+=this.prepareComment(r):r instanceof Ie?t+=this.prepareComponent(r):r instanceof Fe&&(t+=this.preparePhpBlock(r))});let i=this.doc.getParser().getFragmentsContainingStructures();if(i.length>0){let r=$t.fromText(t);i.forEach(o=>{let h=this.doc.getParser().getText((o.start.endPosition?.offset??0)+1,o.end.startPosition?.offset??0),f=r.getParser().getFragmentsParser().getEmbeddedFragment(o.start.embeddedIndex),p=r.getParser().getFragmentsParser().getClosingFragmentAfter(f),E=r.getParser().getText((f.endPosition?.offset??0)+1,p?.startPosition?.offset??0),d=this.makeSlug(16),x=o.start.name.toLowerCase()=="script",_=d;x?_="//"+d:_="/*"+d+"*/",t=t.replace(E,_),this.registerEmbeddedDocument(d,h,x)})}return t}withOptions(t){return this.transformOptions=t,this.useLaravelPint=this.transformOptions.useLaravelPint,this}async transformInlineDirectives(t){let e=t;for(let[i,r]of this.inlineDirectiveBlocks){let o=this.selfClosing(i),h=await this.printDirective(r,this.indentLevel(o));e=await F.safeReplace(e,o,h)}return e}async transformHtmlSwitchStatements(t){let e=t;for(let[i,r]of this.htmlTagSwitchStatements){let o=r.nodeContent,h=o;if(nr){ln(!0);try{sr(),this.transformOptions.useLaravelPint?h=(await rr(o,this.formattingOptions,this.transformOptions)).trim():h=(await Ts(o,this.formattingOptions)).trim()}catch(E){throw Bn(),ln(!1),E}Bn(),ln(!1)}let f=ie.relativeIndentLevel(i,e),p=!1;f===0&&(p=!0,f=this.transformOptions.tabSize),o=ie.shiftHtmlAttributeContent(h,f,this.transformOptions.tabSize)+`
`,p&&(o=`
`+o),e=F.safeReplace(e,i,o)}return e}async transformHtmlTagDirectives(t){let e=t;for(let[i,r]of this.htmlTagDirectives){let o=`${r.sourceContent}
${r.documentContent}
${r.isClosedBy?.sourceContent}
`;if(this.transformOptions.formatJsAttributes&&nr){ln(!0);try{sr(),this.transformOptions.useLaravelPint?o=(await rr(o,this.formattingOptions,this.transformOptions)).trim():o=(await Ts(o,this.formattingOptions)).trim()}catch(f){throw Bn(),ln(!1),f}Bn(),ln(!1)}let h=ie.relativeIndentLevel(i,e);o=this.adjustAttributeFormattingResults(o),o=ie.shiftIndent(o,h,!0,this.transformOptions,!1,!1),e=F.safeReplace(e,i,o)}return e}async transformContentDirectives(t){let e=t;for(let[i,r]of this.contentDirectives){let o=await this.printDirective(r,0);if(o.includes(`
`)){let h=this.indentLevel(i);h>0&&(o=await ie.shiftIndent(o,h,!0,this.transformOptions))}e=F.safeReplace(e,i,o)}return e}async transformDynamicEcho(t){let e=t;for(let[i,r]of this.dynamicEchoBlocks){let o=await bn.printEcho(r,this.transformOptions,this.phpFormatter,this.indentLevel(i),this.pintTransformer??le.sharedPintTransformer);e=F.safeReplaceAllInString(e,i,o)}return e}async transformDynamicDirectives(t){let e=t;for(let[i,r]of this.dynamicElementDirectiveNodes){let o=await this.printDirective(r,this.indentLevel(i));e=F.safeReplaceAllInString(e,i,o)}return e}async transformBlockPhp(t,e){if(this.blockPhpFormatter==null)return t;let i=t.trim();i.startsWith("<?php")==!1&&(i=`<?php
`+i);let r=vs();return i=await this.blockPhpFormatter(i,this.transformOptions,{...r,printWidth:bs(t,r.printWidth)}),e&&(i=`
`+i+`
`),ke.couldReflow(i)&&(i=ke.instance.reflow(i)),Be.couldReflow(i)&&(i=Be.instance.reflow(i)),i}removeLeadingWhitespace(t,e){let i=t.indexOf(e);if(i===-1)return t;let r=t.slice(0,i),o=t.slice(i+e.length);return r.replace(/[\s\uFEFF\xA0]+$/g,"")+e+o}findNewLeadingStart(t,e){let i=F.breakByNewLine(t);for(let r=0;r<i.length;r++){let o=i[r];if(o.includes(e))return o.length-o.trim().length}return-1}async transformPairedDirectives(t){let e=t;for(let[i,r]of this.attachedDirectives){e=this.removeLeadingWhitespace(e,i);let o=r.directive.documentContent;sr(),this.transformOptions.useLaravelPint?o=(await rr(o,this.formattingOptions,this.transformOptions)).trim():o=(await Ts(o,this.formattingOptions)).trim(),Bn();let h=(await this.printDirective(r.directive,this.indentLevel(i))).trim(),f=this.findNewLeadingStart(e,i),p=h+o+`
`+(r.directive.isClosedBy?.sourceContent??""),E=ie.shiftIndent(p,f+this.transformOptions.tabSize,!0,this.transformOptions,!1,!0);e=F.safeReplace(e,i,E)}for(let[i,r]of this.pairedDirectives){let o=r.directive;if(r.virtualElementSlug.length>0){let E=this.open(r.virtualElementSlug),d=this.close(r.virtualElementSlug);this.virtualStructureOpens.push(E),this.removeLines.push(E),this.removeLines.push(d)}let h=this.open(i),f=this.close(i),p=!0;if(o.directiveName.trim().toLowerCase()=="php"){let E=this.open(r.virtualElementSlug),d=this.indentLevel(E),x=r.directive.sourceContent,_=o.documentContent;if(this.transformOptions.formatDirectivePhpParameters)if(this.useLaravelPint)if(this.pintTransformer!=null||le.sharedPintTransformer!=null){this.pintTransformer!=null?_=this.pintTransformer.getDirectivePhpContent(o).trim():le.sharedPintTransformer!=null&&(_=le.sharedPintTransformer.getDirectivePhpContent(o).trim());let u=F.breakByNewLine(_),c=[];for(let g=0;g<u.length;g++){if(u[g].trim().length==0){c.push("");continue}c.push(" ".repeat(d)+u[g])}_=c.join(`
`),e=F.safeReplace(e,h,x+`
`+_),e=F.safeReplace(e,E,"")}else e=F.safeReplace(e,h,x),e=F.safeReplace(e,E,_);else{_=await this.transformBlockPhp(o.innerContent,!0);let u=F.breakByNewLine(_),c=[],g=!1;for(let y=0;y<u.length;y++){let T=u[y];if(T.trim().length>0&&(g=!0),!!g){if(T.trim().length==0){c.push("");continue}c.push(" ".repeat(d)+T)}}_=c.join(`
`),e=F.safeReplace(e,h,x+`
`+_),e=F.safeReplace(e,E,"")}else e=F.safeReplace(e,h,x+`
`+_),e=F.safeReplace(e,E,"")}else if(o.directiveName.trim().toLowerCase()=="verbatim")if(o.isClosedBy!=null&&o.startPosition?.line==o.isClosedBy.startPosition?.line)e=F.safeReplace(e,h,r.directive.nodeContent),p=!1;else{let E=r.directive.sourceContent+`
`+ie.shiftClean(o.innerContent,this.transformOptions.tabSize);e=F.safeReplace(e,h,E)}else e=F.safeReplace(e,h,await this.printDirective(r.directive,this.indentLevel(h)));p?e=F.safeReplace(e,f,r.directive.isClosedBy?.sourceContent):e=F.safeReplace(e,f,"")}return this.inlineDirectives.forEach((i,r)=>{e=F.safeReplaceAllInString(e,r,i.directive.nodeContent)}),e}transformInlineLiterals(t){let e=t;return this.inlineLiterals.forEach((i,r)=>{let o=this.selfClosing(r);e=F.safeReplace(e,o,i.content)}),e}async transformForElseWithNoEmpty(t){let e=t;for(let i of this.forElseNoEmpty){let r=i.forElse.constructedFrom,o=this.open(i.truthSlug),h=this.close(i.truthSlug),f=await this.printDirective(r,this.indentLevel(o)),p=r.isClosedBy?.sourceContent;e=F.safeReplace(e,o,f),e=F.safeReplace(e,h,p)}return e}async transformForElseWithEmpty(t){let e=t;for(let i of this.forElseWithEmpty){let r=this.open(i.truthSlug),o=i.forElse.constructedFrom,h=await this.printDirective(o,this.indentLevel(r));e=F.safeReplace(e,r,h),e=F.safeReplace(e,i.pairClose,o.isClosedBy?.sourceContent),e=F.safeReplace(e,i.emptyOpen,i.forElse.elseNode?.sourceContent),this.removeLines.push(i.truthClose)}return e}async transformInlineEcho(t){let e=t;for(let[i,r]of this.inlineEchos){let o=this.selfClosing(i),h=await bn.printEcho(r,this.transformOptions,this.phpFormatter,this.indentLevel(i),this.pintTransformer??le.sharedPintTransformer);e=F.safeReplace(e,o,h)}for(let[i,r]of this.spanEchos){let o=await bn.printEcho(r,this.transformOptions,this.phpFormatter,this.indentLevel(i),this.pintTransformer??le.sharedPintTransformer);e=F.safeReplace(e,i,o)}return e}pushStartLiteralBlock(t,e){this.parentTransformer!=null?this.parentTransformer.pushStartLiteralBlock(t,e):(this.ignoredLiteralBlocks.set(t,[]),this.ignoredLiteralBlocks.get(t)?.push(e))}pushLiteralBlock(t,e){this.parentTransformer!=null?this.parentTransformer.pushLiteralBlock(t,e):this.ignoredLiteralBlocks.get(t)?.push(e)}async transformConditions(t){let e=t;for(let i of this.conditions)for(let r of i.structures){let o=r.branch.head;if(r.isLiteralContent&&(e=F.safeReplace(e,r.virtualBreakOpen,r.doc.trim())),r.virtualBreakOpen.length>0&&this.removeLines.push(r.virtualBreakOpen),r.virtualBreakClose.length>0&&(e=F.safeReplace(e,r.virtualBreakClose,r.virtualBreakClose+`
`),this.removeLines.push(r.virtualBreakClose)),this.virtualStructureOpens.push(r.virtualOpen),this.removeLines.push(r.virtualOpen),this.removeLines.push(r.virtualClose),!r.isLast)this.removeLines.push(r.pairClose),e=F.safeReplace(e,r.pairOpen,await this.printDirective(o,this.indentLevel(r.pairOpen)));else{e=F.safeReplace(e,r.pairOpen,await this.printDirective(o,this.indentLevel(r.pairOpen)));let h=o.isClosedBy;e=F.safeReplace(e,r.pairClose,await this.printDirective(h,this.indentLevel(r.pairClose)))}}return e}async transformSwitchStatements(t){let e=t;for(let i of this.switchStatements){let r=i.switchNode.constructedFrom;e=F.safeReplace(e,i.virtualSwitchOpen,await this.printDirective(r,this.indentLevel(i.virtualSwitchOpen)));let o=r.isClosedBy;e=F.safeReplace(e,i.virtualSwitchClose,o.sourceContent);for(let h of i.structures){let f=h.case.head;this.removeLines.push(h.virtualClose),this.removeLines.push(h.virtualOpen),h.isLast?(e=F.safeReplace(e,h.pairOpen,await this.printDirective(f,this.indentLevel(h.pairOpen))),this.removeLines.push(h.pairClose)):(this.removeLines.push(h.pairClose),e=F.safeReplace(e,h.pairOpen,await this.printDirective(f,this.indentLevel(h.pairOpen))))}}return e}async transformProps(t){let e=t;for(let[i,r]of this.propDirectives){let o=this.close(i),h=this.open(i);this.removeLines.push(o);let f=r.sourceContent;try{if(this.transformOptions.formatDirectivePhpParameters){if(this.useLaravelPint)f=await this.printDirective(r,this.indentLevel(h));else if(this.phpFormatter!=null&&r.hasValidPhp()){let p=r.getPhpContent().trim();p.startsWith("(")&&p.endsWith(")")&&(p=p.substring(1,p.length-1));let E=await this.phpFormatter("<?php "+p,this.transformOptions,null),d=new Cs,x=d.parse(F.safeReplaceAllInString(await E,`
`," ")),_=this.indentLevel(h);d.getIsAssoc()?f="@props"+" ".repeat(this.transformOptions.spacesAfterDirective)+"("+E+")":x!=null&&(E=Cn.print(x,this.transformOptions.tabSize,1),_>0&&(E=F.removeEmptyNewLines(ie.shiftIndent(await E,_,!0,this.transformOptions))),f="@props"+" ".repeat(this.transformOptions.spacesAfterDirective)+"("+E+")")}}}catch{f=r.sourceContent}e=F.safeReplace(e,h,f)}return e}transformBreaks(t){let e=t;return this.breakDirectives.forEach((i,r)=>{let o=this.close(r),h=this.open(r);this.removeLines.push(o),e=F.safeReplace(e,h,i.sourceContent)}),e}transformComments(t){let e=t;return this.inlineComments.forEach((i,r)=>{let o=this.selfClosing(r);e=F.safeReplace(e,o,ts.printComment(i,this.transformOptions.tabSize,0))}),this.htmlTagComments.forEach((i,r)=>{e=F.safeReplace(e,r,ts.printComment(i,this.transformOptions.tabSize,0))}),e}indentLevel(t){for(let e=0;e<this.structureLines.length;e++){let i=this.structureLines[e];if(i.includes(t)){let r=i.trimLeft();return i.length-r.length}}return 0}transformVirtualComments(t){let e=t;return this.blockComments.forEach(i=>{let r=i.node;e=F.safeReplace(e,i.pairOpen,ts.printComment(r,this.transformOptions.tabSize,this.indentLevel(i.pairOpen))),this.removeLines.push(i.pairClose),this.removeLines.push(i.virtualElement)}),e}adjustAttributeFormattingResults(t){let e=F.breakByNewLine(t),i=[];for(let r=0;r<e.length;r++){let o=e[r];if(o.trimRight().endsWith(":")&&r+1<e.length-1){i.push(o.trimRight()+" "+e[r+1].trimLeft()),r+=1;continue}else i.push(o)}return i.join(`
`)}transformDynamicElementForElse(t){let e=t;return this.dynamicElementForElseNodes.forEach((i,r)=>{e=F.safeReplaceAllInString(e,r,i.nodeContent)}),e}removeTrailingWhitespaceAfterSubstring(t,e){let i=F.breakByNewLine(t),r=[];for(let o=0;o<i.length;o++){let h=i[o];h.trimRight().endsWith(e)?r.push(h.trimRight()):r.push(h)}return r.join(`
`)}async transformDynamicElementConditions(t){let e=t;for(let[i,r]of this.dynamicElementConditionNodes)if(r.startPosition?.line!=r.endPosition?.line){let o=r.nodeContent;if(this.transformOptions.formatJsAttributes&&nr){sr(),ln(!0);try{this.transformOptions.useLaravelPint?o=(await rr(o,this.formattingOptions,this.transformOptions)).trim():o=(await Ts(o,this.formattingOptions)).trim()}catch(f){throw Bn(),ln(!1),f}Bn(),ln(!1)}let h=ie.relativeIndentLevel(i,e);o=this.adjustAttributeFormattingResults(o),o=ie.shiftIndent(o,h,!0,this.transformOptions,!1,!1),e=F.safeReplaceAllInString(e,i,o)}else e=this.removeTrailingWhitespaceAfterSubstring(e,i),e=F.safeReplaceAllInString(e,i,r.nodeContent);return e}transformDynamicElementSwitch(t){let e=t;return this.dynamicElementSwitchNodes.forEach((i,r)=>{e=F.safeReplaceAllInString(e,r,i.nodeContent)}),e}async transformDirectiveParameters(t){let e=t;for(let[i,r]of this.directiveParameters){let o=r.directive,h=await this.printDirective(o,this.indentLevel(i));e=F.safeReplace(e,i,h)}return e}transformExpressionParameters(t){let e=t;return this.expressionParameters.forEach((i,r)=>{let o=i.content,h=!1;if(this.transformOptions.useLaravelPint&&(this.pintTransformer!=null||le.sharedPintTransformer!=null)&&(this.pintTransformer!=null?(o=this.pintTransformer.getComponentParameterContent(i),h=!0):le.sharedPintTransformer!=null&&(o=le.sharedPintTransformer.getComponentParameterContent(i))),o.includes(`
`)){let f=this.indentLevel(r);o=ie.shiftIndent(ie.removeLeadingWhitespace(o,this.transformOptions.tabSize,h),f+this.transformOptions.tabSize,!0,this.transformOptions,!1,!0)}e=F.safeReplace(e,r,o)}),e}async transformEchoParameters(t){let e=t;this.commentParameters.forEach((i,r)=>{i.inlineComment!=null?e=F.safeReplace(e,r,ts.printComment(i.inlineComment,this.transformOptions.tabSize,0)):e=F.safeReplace(e,r,"")});for(let[i,r]of this.echoParameters)if(r.inlineEcho!=null){let o=r.inlineEcho.content.trim();if(o.startsWith("{{--")&&o.endsWith("--}}")){let h=o.substring(2,o.length-2);e=F.safeReplace(e,i,"{{"+h.trim()+"}}")}else if(o.startsWith("{--")&&o.endsWith("--}")){let h=o.substring(3,o.length-3);e=F.safeReplace(e,i,"{{-- "+h.trim()+" --}}")}else if(o.startsWith("--")&&o.endsWith("--")){let h=o.substring(2,o.length-2);e=F.safeReplace(e,i,"{{-- "+h.trim()+" --}}")}else e=F.safeReplace(e,i,await bn.printEcho(r.inlineEcho,this.transformOptions,this.phpFormatter,0,this.pintTransformer??le.sharedPintTransformer))}else e=F.safeReplace(e,i,"");return e}async transformEmbeddedEcho(t){let e=t;for(let[i,r]of this.embeddedEchos){let o=this.indentLevel(i);o===0&&(o=this.transformOptions.tabSize);let h=await bn.printEcho(r,this.transformOptions,this.phpFormatter,o,this.pintTransformer??le.sharedPintTransformer);e=F.safeReplace(e,i,h)}for(let[i,r]of this.dynamicAttributeEchoBlocks){let o=this.indentLevel(i),h=`${i}="${i}"`;o===0&&(o=this.transformOptions.tabSize);let f=await bn.printEcho(r,this.transformOptions,this.phpFormatter,o,this.pintTransformer??le.sharedPintTransformer);e=F.safeReplace(e,h,f)}return e}async transformEmbeddedDirectives(t){let e=t;for(let[i,r]of this.embeddedDirectives){let o=this.indentLevel(i);o===0&&r.sourceContent.includes(`
`)&&(o=ie.relativeIndentLevel(i,e)+2*this.transformOptions.tabSize);let h=await this.printDirective(r,o);e=F.safeReplace(e,i,h)}return e}transformExtractedDocuments(t){let e=t;return this.extractedEmbeddedDocuments.forEach((i,r)=>{let o="",h=0;i.isScript?o="//"+r:o="/*"+r+"*/",h=this.indentLevel(o),h==this.transformOptions.tabSize&&(h=0),e.includes(o)&&(e=F.safeReplace(e,o,ie.indentRelative(i.content,h,this.transformOptions.tabSize)))}),e}removeVirtualStructures(t){let e=t;return this.removeLines.forEach(i=>{e=F.safeReplace(e,i,"")}),e}shouldCleanAfter(t){for(let e=0;e<this.removeLines.length;e++)if(t.startsWith(this.removeLines[e]))return!0;return!1}shouldCleanLine(t){for(let e=0;e<this.forceCleanLines.length;e++)if(t.startsWith(this.forceCleanLines[e]))return!0;return!1}cleanVirtualStructures(t){let e=[],i=F.breakByNewLine(t),r=!1;for(let o=0;o<i.length;o++){let h=i[o].trim();if(r){if(h.length==0)continue;r=!1}else r=this.shouldCleanAfter(h);if(this.shouldCleanLine(h))for(let f=e.length-1;f>0&&e[f].trim().length==0;f--)e.pop();if(!this.removeLines.includes(h)){let f=i[o];this.removeLines.forEach(p=>{f.includes(p)&&(f=F.safeReplace(f,p,""))}),e.push(f)}}return e.join(`
`)}reflowSlugs(t){let e=t,i=F.breakByNewLine(e),r=[];for(let o=0;o<i.length;o++){let h=i[o].trimRight(),f=!1;for(let p=0;p<this.slugs.length;p++){let E=this.slugs[p];if(h.endsWith("<"+E)&&o+1<i.length){let d=i[o+1];if(d.trimLeft().startsWith("/>")){let x=d.indexOf("/>"),_=d.substring(x+2);r.push(h.trimRight()+" />");let u=h.indexOf("<"+E);r.push(" ".repeat(u)+_.trimLeft()),o+=1,f=!0;break}}}f||r.push(h)}return e=r.join(`
`),this.slugs.forEach(o=>{let h=this.open(o),f=this.close(o),p=this.selfClosing(o),E="/<"+o+"(.*?)>/gms",d="/</"+o+"(.*?)>/gms",x="/<"+o+"(.*?)/>/gms";e=e.replace(E,h),e=e.replace(d,f),e=e.replace(x,p)}),e}async transformRemovedAttibutes(t){let e=t;for(let[i,r]of this.removedAttributes){let o=await Af(r,this.transformOptions,i,e,this,this.doc);e=F.safeReplace(e,'"'+i+'"',o)}return e}reflowMultilineStrings(t){let e=F.breakByNewLine(t),i=[],r=!1;for(let o=0;o<e.length;o++){let h=e[o];if(i.push(h),h.trimLeft().startsWith("@")&&h.trimRight().endsWith('"')){let f=h.indexOf('"'),p=[];r=!1;for(let E=o;E<e.length;E++){let d=e[E];if(p.push(d),d.trim()==='"'){let x=d.indexOf('"');if(x>f){for(let _=0;_<p.length;_++){let u=p[_].substring(x);u.length!=0&&i.push(" ".repeat(f-1)+u)}o+=p.length-1}r=!0}}}}return r?i.join(`
`):t}async fromStructure(t){if(t=this.reflowMultilineStrings(t),this.didPintFail)return this.shadowDoc!=null?this.shadowDoc.getContent():this.doc.getContent();let e=this.reflowSlugs(t);this.structureLines=F.breakByNewLine(e);let i=await this.transformDynamicElementConditions(e);return i=await this.transformDynamicEcho(i),i=await this.transformDynamicElementForElse(i),i=await this.transformDynamicElementSwitch(i),i=await this.transformDynamicDirectives(i),i=await this.transformHtmlTagDirectives(i),i=await this.transformHtmlSwitchStatements(i),i=await this.transformRemovedAttibutes(i),this.parentTransformer==null&&Tn.voidTagMapping.size>0&&Tn.voidTagMapping.forEach((r,o)=>{i=F.safeReplaceAllInString(i,o,r)}),await this.transformStructures(i)}containsRemovedAttributes(t){if(this.removedAttributes.size==0)return!1;let e=Array.from(this.removedAttributes.keys());for(let i=0;i<e.length;i++){let r=e[i];if(t.includes(r))return!0}return!1}async transformStructures(t){let e=t;return e=await this.transformInlineDirectives(e),e=await this.transformContentDirectives(e),e=await this.transformDynamicEcho(e),e=await this.transformPairedDirectives(e),e=await this.transformForElseWithEmpty(e),e=await this.transformForElseWithNoEmpty(e),e=this.transformInlineLiterals(e),e=this.transformDynamicElementForElse(e),e=await this.transformInlineEcho(e),e=await this.transformConditions(e),e=await this.transformDynamicElementConditions(e),e=await this.transformSwitchStatements(e),e=this.transformDynamicElementSwitch(e),e=this.transformBreaks(e),e=await this.transformProps(e),e=this.transformComments(e),e=this.transformVirtualComments(e),e=await this.transformDirectiveParameters(e),e=this.transformExpressionParameters(e),e=await this.transformEchoParameters(e),e=await this.transformDynamicDirectives(e),e=this.cleanVirtualStructures(e),e=this.removeVirtualStructures(e),e=await this.transformEmbeddedEcho(e),e=await this.transformEmbeddedDirectives(e),e=this.transformExtractedDocuments(e),e=await this.transformPhpBlock(e),e=this.transformComponentSlots(e),this.ignoredLiteralBlocks.size>0&&(this.ignoredLiteralBlocks.forEach((i,r)=>{let o=this.selfClosing(r);e=F.safeReplace(e,o,this.dumpPreservedNodes(i))}),this.removedAttributes.size>0&&this.removedAttributes.forEach((i,r)=>{let o=i.content.substring(1,i.content.length-1);e=F.safeReplace(e,r,o)})),this.parentTransformer===null&&En&&(le.sharedPintTransformer=null,le.rootTransformer=null,le.inlineComments=[]),e}dumpPreservedNodes(t){let e="";return t.forEach(i=>{i instanceof Pt?e+=i.content:i instanceof di||i instanceof Ke?e+=i.nodeContent:i instanceof ut?i.isClosedBy!=null?e+=i.nodeContent:e+=i.sourceContent:i instanceof de?e+=i.sourceContent:i instanceof mi?e+=i.nodeContent:(i instanceof pi||i instanceof Ie||i instanceof Fe)&&(e+=i.sourceContent)}),e}},vn=le;vn.sharedPintTransformer=null,vn.rootTransformer=null,vn.inlineComments=[];var $t=class{constructor(){this.documentParser=new rt;this.transformer=null;this.cursor=new oo(this);this.nodes=new ho(this);this.errors=new ao(this)}static fromText(t,e=null){let i=new $t;return e!=null&&i.getParser().setSeedPosition(e),i.loadString(t)}static childFromText(t,e,i=null){let r=new $t;return i!=null&&r.getParser().setSeedPosition(i),r.getParser().withParserOptions(e.getParserOptions()).withPhpValidator(e.getPhpValidator()),r.loadString(t),{renderNodes:r.getRenderNodes(),content:t,document:r}}isValid(){return!this.documentParser.hasUnclosedStructures()}transform(){return this.transformer==null&&(this.transformer=new vn(this)),this.transformer}loadString(t){return this.documentParser.parse(t),this}getLinesAround(t){return this.documentParser.getLinesAround(t)}getContent(){return this.documentParser.getContent()}getOriginalContent(){return this.documentParser.getOriginalContent()}getAllNodes(){return this.documentParser.getNodes()}getRenderNodes(){return this.documentParser.getRenderNodes()}getFragments(){return this.documentParser.getFragments()}getParser(){return this.documentParser}getText(t,e){return this.documentParser.getText(t,e)}charLeftAt(t){return this.documentParser.charLeftAt(t)}charAt(t){return this.documentParser.charAt(t)}charRightAt(t){return this.documentParser.charRightAt(t)}getLineIndex(t){return this.documentParser.getLineIndex(t)}getLineText(t){return this.documentParser.getLineText(t)}wordAt(t,e=4){return this.documentParser.wordAt(t,e)}wordLeftAt(t,e=4){return this.documentParser.wordLeftAt(t,e)}wordRightAt(t,e=4){return this.documentParser.wordRightAt(t,e)}punctuationLeftAt(t,e=4){return this.documentParser.punctuationLeftAt(t,e)}punctuationRightAt(t,e=4){return this.documentParser.punctuationRightAt(t,e)}getLineChars(t){let e=this.getLineText(t);return e!=null?e.split(""):null}};var Qy=ps(Oa(),1),Ao=class{constructor(){this.lastError=null}isValid(t,e=!0){let i=new Qy.Engine({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}});try{e?i.parseEval(t):i.parseCode(t,"test.php")}catch(r){return r instanceof SyntaxError&&(this.lastError=r),!1}return this.lastError=null,!0}getLastError(){return this.lastError}};var bo=class{static printError(t,e){let i=t.message+`
`,r=t.node?.startPosition?.line,o=r;e.forEach((f,p)=>{o=p});let h=o.toString().length;return e.forEach((f,p)=>{let E=p.toString(),d="",x=0;x=h-E.length,r==p?d=" >"+"0".repeat(x)+E+"| ":d=" "+"0".repeat(x)+E+"| ",i+=d+f+`
`}),i}};var So=class{constructor(){this.filePath="";this.formattingOptions=null;this.transformOptions=null;this.htmlFormatter=null;this.phpFormatter=null;this.blockPhpFormatter=null;this.phpTagFormatter=null;this.jsonFormatter=null;this.preFormatter=null;this.removedAttributes=new Map}withRemovedAttributes(t){return this.removedAttributes=t,this}withTransformOptions(t){return this.transformOptions=t,this}withFilePath(t){return this.filePath=t,this}withFormattingOptions(t){return this.formattingOptions=t,this}withPreFormatter(t){return this.preFormatter=t,this}withHtmlFormatter(t){return this.htmlFormatter=t,this}withPhpFormatter(t){return this.phpFormatter=t,this}withBlockPhpFormatter(t){return this.blockPhpFormatter=t,this}withPhpTagFormatter(t){return this.phpTagFormatter=t,this}withJsonFormatter(t){return this.jsonFormatter=t,this}async formatText(t){return await this.formatDocument($t.fromText(t))}async formatDocument(t,e=null){if(this.preFormatter!=null){let o=await this.preFormatter(t);if(o!=null)return o}if(this.htmlFormatter==null||t.isValid()==!1)return t.getOriginalContent();t.transform().withShadowDocument(e).withFilePath(this.filePath).withBlockPhpFormatter(this.blockPhpFormatter).withPhpFormatter(this.phpFormatter).withPhpTagFormatter(this.phpTagFormatter).withJsonFormatter(this.jsonFormatter).withRemovedAttributes(this.removedAttributes),t.transform().setFormattingOptions(this.formattingOptions),this.transformOptions!=null&&t.transform().withOptions(this.transformOptions);let i=t.transform().toStructure(),r=await this.htmlFormatter(i);return t.transform().fromStructure(r)}};var Do=class extends So{constructor(t,e){super(),go(t),this.withHtmlFormatter(Ef).withFilePath(t.filepath).withPhpFormatter(yf).withBlockPhpFormatter(vf).withPhpTagFormatter(Tf).withJsonFormatter(gf).withTransformOptions(e).withPreFormatter(i=>{if(i.errors.hasStructureErrors()){let r=i.errors.getFirstStructureError(),o=i.getLinesAround(r.node?.startPosition?.line??1),h=bo.printError(r,o);throw new SyntaxError(h)}return null})}};var Zy=ps($y(),1);var No=class{constructor(){this.structures=[];this.hasStructuresWithUnknownLocations=!1;this.excludedStructures=[];this.allowedMethods=[]}hasUnknownLocations(){return this.hasStructuresWithUnknownLocations}getStructureLocations(t,e){try{let i=(0,Zy.parseScript)(t,{loc:!0});this.findStructureLocations(i,t,e)}catch{}}setExcludedStructures(t){this.excludedStructures=t}setAllowedMethods(t){this.allowedMethods=t}getStructures(){return this.structures}findStructureLocations(t,e,i){let r=[],o=this.excludedStructures,h=this.allowedMethods,f=!1;function p(d,x){let _=e.split(`
`),u=0;for(let c=0;c<d-1;c++)u+=_[c].length+1;return u+=x-1,u}function E(d){if(d.loc){let x=p(d.loc.start.line,d.loc.start.column)-i,_=p(d.loc.end.line,d.loc.end.column)-i;if(d.type==="IfStatement")d.test.loc==null&&(f=!0),o.includes(Z.IfStatement)&&r.push({label:Z.IfStatement,start:x,end:_});else if(d.type==="ConditionalExpression")d.test.loc==null&&(f=!0),o.includes(Z.TernaryStatement)&&r.push({label:Z.TernaryStatement,start:x,end:_});else if(d.type==="AssignmentExpression"){let u=!0;(d.left.loc==null||d.right.loc==null)&&(f=!0),o.includes(Z.Assignment)||(u=!1),u&&r.push({label:Z.Assignment,start:x,end:_})}else if(d.type==="BinaryExpression"){let u=!0;(d.left.loc==null||d.right.loc==null)&&(f=!0),o.includes(Z.BinCompare)||(u=!1),u&&r.push({label:Z.BinCompare,start:x,end:_})}else if(d.type==="CallExpression"){let u=!0;if(d.callee.type==="MemberExpression"){let c=d.callee;if(c.property.type==="Identifier"){let g=c.property;h.includes(g.name)&&(u=!1)}}o.includes(Z.CallStatement)||(u=!1),u&&(d.loc==null&&(f=!0),r.push({label:Z.CallStatement,start:x,end:_}))}}for(let x in d)ub(d[x])&&E(d[x])}E(t),this.hasStructuresWithUnknownLocations=f,this.structures=r}};function ub(n){return typeof n=="object"&&n!==null}var tv=ps(Oa(),1);var Io=class{constructor(){this.structures=[];this.hasStructuresWithUnknownLocations=!1;this.excludedStructures=[];this.allowedMethods=[];this.phpAssignToGeneric=new Map([["=",Z.Assignment],["+=",Z.AdditionAssignment],["-=",Z.SubtractionAssignment],["*=",Z.MultiplicationAssignment],["/=",Z.DivisionAssignment],["%=",Z.ModulusAssignment],[".=",Z.ConcatenationAssignment],["%=",Z.BitwiseAndAssignment],["|=",Z.BitwiseOrAssignment],["^=",Z.BitwiseXorAssignment],["<<=",Z.LeftShiftAssignment],[">>=",Z.RightShiftAssignment]]);this.phpOperatorsToGeneric=new Map([[".",Z.Concat],["+",Z.Addition],["-",Z.Substraction],["*",Z.Multiplication],["/",Z.Division],["%",Z.Modulus],["**",Z.Exponentiation],[">",Z.GreaterThan],["&",Z.BitwiseAnd],["|",Z.BitwiseOr],["^",Z.BitwiseXor],["<<",Z.LeftShift],[">>",Z.RightShift],["==",Z.Equality],["===",Z.Identity],["<",Z.LessThan],["<>",Z.Inequality],["!=",Z.Inequality],["!==",Z.NotIdentity],[">=",Z.GreaterThanEqual],["<=",Z.LessThanEqual],["&&",Z.CompAnd],["and",Z.CompAnd],["||",Z.CompOr],["or",Z.CompOr],["xor",Z.Xor]]);this.parser=new tv.Engine({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}})}hasUnknownLocations(){return this.hasStructuresWithUnknownLocations}getStructureLocations(t,e){let i=this.parser.parseCode(t,"code.php");this.findStructureLocations(i,e)}setExcludedStructures(t){this.excludedStructures=t}setAllowedMethods(t){this.allowedMethods=t}getStructures(){return this.structures}findStructureLocations(t,e){let i=[],r=this.excludedStructures,o=this.phpOperatorsToGeneric,h=this.phpAssignToGeneric,f=this.allowedMethods,p=!1;function E(d){if(d.kind==="if"){let x=d;x.test.loc==null&&(p=!0),r.includes(Z.IfStatement)&&i.push({label:Z.IfStatement,start:(x.test.loc?.start.offset??-1)-e,end:(x.test.loc?.end.offset??-1)-e})}else if(d.kind=="retif"){let x=d;x.test.loc==null&&(p=!0),r.includes(Z.TernaryStatement)&&i.push({label:Z.TernaryStatement,start:(x.test.loc?.start.offset??-1)-e,end:(x.test.loc?.end.offset??-1)-e+2})}else if(d.kind=="assign"){let x=d,_=!0;(x.left.loc==null||x.right.loc==null)&&(p=!0);let u=x.operator;h.has(u)?u=h.get(u):u=Z.Assignment,r.includes(u)||(_=!1),_&&i.push({label:u,start:(x.left.loc?.start.offset??-1)-e,end:(x.right.loc?.end.offset??-1)-e})}else if(d.kind=="bin"){let x=d,_=!0;(x.left.loc==null||x.right.loc==null)&&(p=!0);let u=x.kind.toLowerCase();o.has(u)?u=o.get(u):u=Z.BinCompare,r.includes(u)||(_=!1),_&&i.push({label:u,start:(x.left.loc?.start.offset??-1)-e,end:(x.right.loc?.end.offset??-1)-e})}else if(d.kind=="call"){let x=d,_=!0;if(x.what.kind=="propertylookup"){let u=x.what;if(u.offset.kind=="identifier"){let c=u.offset;f.includes(c.name)&&(_=!1)}}r.includes(Z.CallStatement)||(_=!1),_&&(x.loc==null&&(p=!0),i.push({label:Z.CallStatement,start:(x.loc?.start.offset??-1)-e,end:(x.loc?.end.offset??-1)-e}))}for(let x in d)d.hasOwnProperty(x)&&typeof d[x]=="object"&&d[x]&&E(d[x])}E(t),this.hasStructuresWithUnknownLocations=p,this.structures=i}};var Po=class{constructor(){this.ignoreRanges=[];this.strings=[];this.nodes=[];this.chars=[];this.cur=null;this.prev=null;this.next=null;this.currentIndex=0;this.inputLen=0;this.currentContent=[];this.nodeIndex=0;this.hasStringNodesInResult=!1}advance(t){for(let e=0;e<t;e++)this.currentIndex++,this.checkCurrentOffsets()}encounteredFailure(){}updateIndex(t){this.currentIndex=t}inputLength(){return this.inputLen}getCurrentIndex(){return this.currentIndex}incrementIndex(){this.currentIndex+=1}getCurrent(){return this.cur}getNext(){return this.next}getPrev(){return this.prev}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1<this.inputLen&&(this.next=this.chars[this.currentIndex+1])}pushChar(t){this.currentContent.push(t)}getChar(t){return this.chars[t]}getSeedOffset(){return 0}getContentSubstring(t,e){return""}setIgnoreRanges(t){this.ignoreRanges=t}hasStringNodes(){return this.hasStringNodesInResult}parse(t){for(this.nodes=[],this.strings=[],this.chars=t.split(""),this.inputLen=this.chars.length,this.currentIndex=0;this.currentIndex<this.inputLen;this.currentIndex+=1){if(this.checkCurrentOffsets(),this.cur=="/"&&this.next=="/"){ze(this,!0);continue}if(this.cur=="/"&&this.next=="*"){Je(this,!0);continue}if(Ee(this.cur)){let e=this.cur,i=this.currentIndex;if(this.currentContent.length>0){let h={content:this.currentContent.join(""),type:"literal",index:this.nodeIndex};this.nodeIndex++,this.nodes.push(h),this.currentContent=[]}let r=qe(this),o=!1;for(let h=0;h<this.ignoreRanges.length;h++){let f=this.ignoreRanges[h];if(i>=f.start&&this.currentIndex<=f.end){o=!0;break}}if(o){this.currentContent.push(e);for(let h=0;h<r.value.length;h++)this.currentContent.push(r.value[h]);this.currentContent.push(e)}else{this.strings.push(r.value);let h={content:e+r.value+e,type:"string",index:this.nodeIndex};this.hasStringNodesInResult=!0,this.nodeIndex++,this.nodes.push(h)}if(this.currentIndex=r.endedOn,this.currentIndex==this.inputLen-1)break;continue}this.currentContent.push(this.cur)}if(this.currentContent.length>0){let e={content:this.currentContent.join(""),type:"literal",index:this.nodeIndex};this.nodeIndex++,this.nodes.push(e),this.currentContent=[]}}getParsedNodes(){return this.nodes}};var Ds=class{constructor(t){this.mergeRanges=[];this.charsToAvoid=[`
`,"$","{",'"',"'"];this.foundAnyStrings=!0;this.classRuleEngine=t,this.phpStructuresAnalyzer=new Io,this.jsStructuresAnalyzer=new No,this.stringParser=new Po}setAllowedMethodNames(t){this.phpStructuresAnalyzer.setAllowedMethods(t),this.jsStructuresAnalyzer.setAllowedMethods(t)}setExcludedLanguageStructures(t){this.phpStructuresAnalyzer.setExcludedStructures(t),this.jsStructuresAnalyzer.setExcludedStructures(t)}withAdditionalRanges(t){this.mergeRanges=this.mergeRanges.concat(t)}isSafeToProcess(t){if(!t.includes(" ")||t.trim().length!=t.length||t.includes(", "))return!1;for(let e=0;e<this.charsToAvoid.length;e++)if(t.includes(this.charsToAvoid[e]))return!1;return this.classRuleEngine.canTransformString(t)}getFoundAnyStrings(){return this.foundAnyStrings}async emulateString(t){let e=F.makeSlug(32),i=`Emulate:${e}=`,r=this.phpStructuresAnalyzer.getStructures().concat(this.mergeRanges).concat(this.jsStructuresAnalyzer.getStructures());if(this.stringParser.setIgnoreRanges(r),!t.includes(`
`)&&r.length>0,this.stringParser.parse(t),!this.stringParser.hasStringNodes())return this.foundAnyStrings=!1,t;let o=this.stringParser.getParsedNodes(),h=new Map,f=new Map,p="",E=0;o.forEach(u=>{if(u.type=="string"){let c=u.content.substring(1,u.content.length-1);if(!this.isSafeToProcess(c))return;h.set(u.index,u.content[0]),p+=`<!-- "${i}${u.index}"-->
`,p+=`<div class="${c}"></div>
`,E+=2}});try{p=await kf(p)}catch{return t}let d=new Zi;d.remove(p);let x=d.getStrings();if(x.length!=E)return t;for(let u=0;u<x.length;u++){let c=x[u];if(c.startsWith(i)){c=c.substring(i.length).trim();let g=parseInt(c);if(u+1<x.length){let y=x[u+1];f.set(g,y),u++}}}let _="";return o.forEach(u=>{if(u.type=="literal"||!f.has(u.index)){_+=u.content;return}let c=h.get(u.index),g=f.get(u.index);_+=c+g+c}),_}async emulatePhpNode(t){let e="<?php "+t;return this.phpStructuresAnalyzer.getStructureLocations(e,0),(await this.emulateString(e)).trimLeft().substring(6)}async emulatePhpTag(t){return this.phpStructuresAnalyzer.getStructureLocations(t,0),await this.emulateString(t)}async emulateJavaScriptString(t){return this.jsStructuresAnalyzer.getStructureLocations(t,0),(await this.emulateString(t)).trimLeft()}};var wo=class{constructor(t){this.phpValidator=null;this.isIgnoring=!1;this.classStringConfig=t,this.classRuleEngine=new ks(this.classStringConfig),this.parserOptions=so()}withPhpValidator(t){return this.phpValidator=t,this}withParserOptions(t){return this.parserOptions=t,this}getEmulator(){let t=new Ds(this.classRuleEngine);return t.setExcludedLanguageStructures(this.classStringConfig.ignoredLanguageStructures),t.setAllowedMethodNames(this.classStringConfig.allowedMethodNames),t}async transform(t){let e=new $t;e.getParser().withParserOptions(this.parserOptions).withPhpValidator(this.phpValidator),e.loadString(t);let i=e.getAllNodes();if(e.getParser().getDidRecovery())return t;let r="";for(let o=0;o<i.length;o++){let h=i[o];if(h instanceof Pt)r+=h.content;else if(h instanceof di)r+=h.nodeContent;else if(h instanceof Ke)r+=h.nodeContent;else if(h instanceof ut){if(this.isIgnoring||this.classStringConfig.excludedDirectives.includes(h.directiveName.toLowerCase()))r+=h.sourceContent,h.directiveName=="php"&&(r+=h.documentContent);else if(h.directiveName=="php")if(h.isClosedBy!=null)if(this.isIgnoring||!this.classRuleEngine.canTransformBladePhp(h))r+=h.sourceContent+h.documentContent;else if(this.phpValidator?.isValid(h.documentContent,!0)){let f=this.getEmulator();r+="@php"+await f.emulatePhpNode(h.documentContent)}else r+=h.sourceContent+h.documentContent;else r+=h.sourceContent;else if(h.directiveName=="verbatim")r+=h.sourceContent+h.innerContent;else if(this.isIgnoring||h.hasJsonParameters||!this.classRuleEngine.canTransformDirective(h))r+=h.sourceContent;else if(!h.hasDirectiveParameters||!h.hasValidPhp()?r+=h.sourceContent:r+=await this.getEmulator().emulateString(h.sourceContent),o+1<i.length&&i[o+1]instanceof Pt){let f=i[o+1];if(f.content.length==0)continue;let p=f.content[0];if(F.ctypePunct(p))continue;F.ctypeSpace(p)||(r+=" ")}}else if(h instanceof de)if(this.isIgnoring||!this.classRuleEngine.canTransformBladeEcho(h)||!h.hasValidPhp())r+=h.sourceContent;else{let f=this.getEmulator(),p=(await f.emulatePhpNode(h.content)).trim(),E="{{ ",d=" }}";h instanceof en?(E="{!! ",d=" !!}"):h instanceof nn&&(E="{{{ ",d=" }}}"),r+=E+p+d}else h instanceof mi?r+=h.nodeContent:h instanceof pi?(r+=h.sourceContent,h.innerContent.trim()==cn.FormatIgnoreStart?this.isIgnoring=!0:h.innerContent.trim()==cn.FormatIgnoreEnd&&(this.isIgnoring=!1)):h instanceof Ie?r+=h.sourceContent:h instanceof Fe&&(this.isIgnoring||!this.classRuleEngine.canTransformInlinePhp(h)||!h.hasValidPhp()?r+=h.sourceContent:r+=await this.getEmulator().emulatePhpTag(h.sourceContent))}return r}};import cb from"path";import{fileURLToPath as fb}from"url";var lb=["x-mask"],ev=lb;var pb=fb(import.meta.url),db=cb.dirname(pb),iv,ns,dr,Fa=null,mb={languages:[{name:"Blade",parsers:["blade"],extensions:[".blade.php"],vscodeLanguageIds:["blade"]}],parsers:{blade:{parse:async function(n,t){let e=cf(),i=xf();i!=null&&(t=i(t)),e!=null&&(t.filepath=e),go(t),iv=t,Fa=ff(db),ns=Fa,dr=Fa,ns.tabSize=mf().tabWidth;let r=n;En&&(r=Tn.adjustInput(r));let o=r,h=r,f=ns.classStrings,p=new Ao,E=new Map,d=!0;if(ns.formatJsAttributes&&En){let T=new Ln,w=$t.fromText(o);if(T.setIndexRanges(w.getParser().getNodeIndexRanges()),T.setExtractAttributeNames(ns.includeJsAttributes),T.setExcludeAttributes(ns.excludeJsAttributes),T.setExtractAttributes(!0),T.parse(o),T.getParsingTracedStringHitEof()&&(d=!1),d){let R=T.getExtractedAttributes();if(w.getAllNodes().forEach(M=>{M instanceof Ie&&M.hasParameters&&M.parameters.forEach(J=>{J.isEscapedExpression&&J.valuePosition!=null&&J.valuePosition.start!=null&&J.valuePosition.end!=null&&R.push({content:J.wrappedValue,name:J.name,startedOn:J.valuePosition.start.offset,endedOn:J.valuePosition.end.offset})})}),R.length>0){let M=new fo,J=M.remove(o,R);E=M.getRemovedAttributes(),o=J}}}if(f.enabled){let T=new wo(f);if(o=await T.withParserOptions(dr).withPhpValidator(p).transform(o),h=await T.withParserOptions(dr).withPhpValidator(p).transform(h),E.size>0)for(let R of E)try{if(ev.includes(R[1].name.toLowerCase()))continue;let M=new ks(f),J=new Ds(M);J.setAllowedMethodNames(f.allowedMethodNames),J.setExcludedLanguageStructures(f.ignoredLanguageStructures);let W=R[1].content.substring(1,R[1].content.length-1),j=await J.emulateJavaScriptString(W);W===j&&!J.getFoundAnyStrings()?j.includes(" = ")?R[1].content='"'+W+'"':R[1].content=await J.emulateJavaScriptString(R[1].content):R[1].content='"'+W+'"'}catch{}}let x=new $t,_=new $t;x.getParser().withParserOptions(dr).withPhpValidator(p),_.getParser().withParserOptions(dr).withPhpValidator(p),x.loadString(o),_.loadString(h);let u={doc:x,attributeMap:E,shadowDocument:_,canSafelyContinue:d,originalText:n,formattedDocument:n},c=new Do(iv,ns);if(!d)return u.formattedDocument=n,u;var g=await c.withRemovedAttributes(E).formatDocument(x,_);let y=/^(\s*)<!doctype html>/im;return g=g.replace(y,"$1<!DOCTYPE html>"),u.formattedDocument=g,u},locStart:()=>0,locEnd:()=>0,astFormat:"blade"}},printers:{blade:{print:function(n){return n.stack[0].formattedDocument}}},defaultOptions:{tabWidth:4}},ka=mb;export{ka as default};