-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
392 lines (346 loc) · 276 KB
/
script.js
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
(()=>{var e={625:e=>{!function(){var t={de_DE:{identifier:"de-DE",days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{identifier:"en-CA",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{identifier:"en-US",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{identifier:"es-MX",days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre"," diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{identifier:"fr-FR",days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{identifier:"it-IT",days:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],shortDays:["dom","lun","mar","mer","gio","ven","sab"],months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortMonths:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{identifier:"nl-NL",days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{identifier:"pt-BR",days:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{identifier:"ru-RU",days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],shortDays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{identifier:"tr-TR",days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shortDays:["Paz","Pzt","Sal","Çrş","Prş","Cum","Cts"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],shortMonths:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{identifier:"zh-CN",days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["日","一","二","三","四","五","六"],months:["一月份","二月份","三月份","四月份","五月份","六月份","七月份","八月份","九月份","十月份","十一月份","十二月份"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],AM:"上午",PM:"下午",am:"上午",pm:"下午",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},i=t.en_US,n=new function e(n,p,d){var f,m=n||i,g=p||0,v=d||!1,y=0;function b(e,t,i,n){for(var l="",p=null,d=!1,f=e.length,m=!1,y=0;y<f;y++){var x=e.charCodeAt(y);if(!0!==d)37!==x?l+=e[y]:d=!0;else{if(45===x){p="";continue}if(95===x){p=" ";continue}if(48===x){p="0";continue}if(58===x){m&&u("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),m=!0;continue}switch(x){case 37:l+="%";break;case 65:l+=i.days[t.getDay()];break;case 66:l+=i.months[t.getMonth()];break;case 67:l+=r(Math.floor(t.getFullYear()/100),p);break;case 68:l+=b(i.formats.D,t,i,n);break;case 70:l+=b(i.formats.F,t,i,n);break;case 72:l+=r(t.getHours(),p);break;case 73:l+=r(a(t.getHours()),p);break;case 76:l+=s(Math.floor(n%1e3));break;case 77:l+=r(t.getMinutes(),p);break;case 80:l+=t.getHours()<12?i.am:i.pm;break;case 82:l+=b(i.formats.R,t,i,n);break;case 83:l+=r(t.getSeconds(),p);break;case 84:l+=b(i.formats.T,t,i,n);break;case 85:l+=r(o(t,"sunday"),p);break;case 87:l+=r(o(t,"monday"),p);break;case 88:l+=b(i.formats.X,t,i,n);break;case 89:l+=t.getFullYear();break;case 90:l+=v&&0===g?"GMT":h(t)||"";break;case 97:l+=i.shortDays[t.getDay()];break;case 98:case 104:l+=i.shortMonths[t.getMonth()];break;case 99:l+=b(i.formats.c,t,i,n);break;case 100:l+=r(t.getDate(),p);break;case 101:l+=r(t.getDate(),null==p?" ":p);break;case 106:var w=new Date(t.getFullYear(),0,1);l+=s(S=Math.ceil((t.getTime()-w.getTime())/864e5));break;case 107:l+=r(t.getHours(),null==p?" ":p);break;case 108:l+=r(a(t.getHours()),null==p?" ":p);break;case 109:l+=r(t.getMonth()+1,p);break;case 110:l+="\n";break;case 111:var S=t.getDate();i.ordinalSuffixes?l+=String(S)+(i.ordinalSuffixes[S-1]||c(S)):l+=String(S)+c(S);break;case 112:l+=t.getHours()<12?i.AM:i.PM;break;case 114:l+=b(i.formats.r,t,i,n);break;case 115:l+=Math.floor(n/1e3);break;case 116:l+="\t";break;case 117:l+=0===(S=t.getDay())?7:S;break;case 118:l+=b(i.formats.v,t,i,n);break;case 119:l+=t.getDay();break;case 120:l+=b(i.formats.x,t,i,n);break;case 121:l+=(""+t.getFullYear()).slice(2);break;case 122:if(v&&0===g)l+=m?"+00:00":"+0000";else{var _,k=(_=0!==g?g/6e4:-t.getTimezoneOffset())<0?"-":"+",E=m?":":"",A=Math.floor(Math.abs(_/60)),C=Math.abs(_%60);l+=k+r(A)+E+r(C)}break;default:d&&(l+="%"),l+=e[y]}p=null,d=!1}}return l}var x=function(e,t){var i;if(t){if(i=t.getTime(),v){var n=l(t);if(l(t=new Date(i+n+g))!==n){var r=l(t);t=new Date(i+r+g)}}}else{var s=Date.now();s>y?(y=s,f=new Date(y),i=y,v&&(f=new Date(y+l(f)+g))):i=y,t=f}return b(e,t,m,i)};return x.localize=function(t){return new e(t||m,g,v)},x.localizeByIdentifier=function(e){var i=t[e];return i?x.localize(i):(u('[WARNING] No locale found with identifier "'+e+'".'),x)},x.timezone=function(t){var i=g,n=v,r=typeof t;return"number"!==r&&"string"!==r||(n=!0,"string"===r?i=("-"===t[0]?-1:1)*(60*parseInt(t.slice(1,3),10)+parseInt(t.slice(3,5),10))*60*1e3:"number"===r&&(i=60*t*1e3)),new e(m,i,n)},x.utc=function(){return new e(m,g,!0)},x}(i,0,!1);function r(e,t){return""===t||e>9?e:(null==t&&(t="0"),t+e)}function s(e){return e>99?e:e>9?"0"+e:"00"+e}function a(e){return 0===e?12:e>12?e-12:e}function o(e,t){t=t||"sunday";var i=e.getDay();"monday"===t&&(0===i?i=6:i--);var n=Date.UTC(e.getFullYear(),0,1),r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=(Math.floor((r-n)/864e5)+7-i)/7;return Math.floor(s)}function c(e){var t=e%10,i=e%100;if(i>=11&&i<=13||0===t||t>=4)return"th";switch(t){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function l(e){return 6e4*(e.getTimezoneOffset()||0)}function h(e,t){return function(e,t){if(null==t)return null;var i=e.toLocaleString(t,{timeZoneName:"short"}).match(/\s([\w]+)$/);return i&&i[1]}(e,t)||function(e){var t=e.toString().match(/\(([\w\s]+)\)/);return t&&t[1]}(e)}function u(e){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e)}e.exports=n,"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},156:function(e,t,i){e.exports=function(e){"use strict";var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return pe},get VariableDeclaration(){return de},get VariableDeclarator(){return fe},get ClassDeclaration(){return me},get ClassBody(){return ge},get MethodDefinition(){return ve}}),n=Object.freeze({__proto__:null,get FunctionDeclaration(){return je},get VariableDeclaration(){return Be},get VariableDeclarator(){return Ve},get ClassDeclaration(){return Fe},get ClassBody(){return Ue},get MethodDefinition(){return He}}),r=Object.freeze,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.prototype.hasOwnProperty;function c(e,t){return o.call(e,t)}var l=Object.getOwnPropertyNames,h=Object.setPrototypeOf;var u=Object.getPrototypeOf;function p(e){return u?u(e):e.__proto__}var d=Object.getOwnPropertyDescriptor;function f(e,t,i){for(;t;){var n=d(t,i),r=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(r)return r;t=p(t)}}function m(e,t){return f("get",e,t)}function g(e,t){return f("set",e,t)}var v=Object.create;function y(e,t){(function(e,t){h?h(e,t):e.__proto__=t})(e,t),e.prototype=v(t.prototype,{constructor:{value:e,writable:!0}})}var b=Object.assign||function(e){for(var t=1;t<arguments.length;++t){var i=arguments[t];for(var n in i)c(i,n)&&(e[n]=i[n])}return e},x=[],w=v(null);try{if(!window.Object)throw 0;x=l(w=window).filter((function(e){return"webkitStorageInfo"!==e}))}catch(e){try{if(!i.g.Object)throw 0;x=l(w=i.g).filter((function(e){return"GLOBAL"!==e&&"root"!==e}))}catch(e){try{w.Object=Object}catch(e){}try{w.Function=Function}catch(e){}try{w.Array=Array}catch(e){}try{w.Number=Number}catch(e){}try{w.parseFloat=parseFloat}catch(e){}try{w.parseInt=parseInt}catch(e){}try{w.Infinity=1/0}catch(e){}try{w.NaN=NaN}catch(e){}try{w.undefined=void 0}catch(e){}try{w.Boolean=Boolean}catch(e){}try{w.String=String}catch(e){}try{w.Symbol=Symbol}catch(e){}try{w.Date=Date}catch(e){}try{w.Promise=Promise}catch(e){}try{w.RegExp=RegExp}catch(e){}try{w.Error=Error}catch(e){}try{w.EvalError=EvalError}catch(e){}try{w.RangeError=RangeError}catch(e){}try{w.ReferenceError=ReferenceError}catch(e){}try{w.SyntaxError=SyntaxError}catch(e){}try{w.TypeError=TypeError}catch(e){}try{w.URIError=URIError}catch(e){}try{w.JSON=JSON}catch(e){}try{w.Math=Math}catch(e){}try{w.console=console}catch(e){}try{w.Intl=Intl}catch(e){}try{w.ArrayBuffer=ArrayBuffer}catch(e){}try{w.Uint8Array=Uint8Array}catch(e){}try{w.Int8Array=Int8Array}catch(e){}try{w.Uint16Array=Uint16Array}catch(e){}try{w.Int16Array=Int16Array}catch(e){}try{w.Uint32Array=Uint32Array}catch(e){}try{w.Int32Array=Int32Array}catch(e){}try{w.Float32Array=Float32Array}catch(e){}try{w.Float64Array=Float64Array}catch(e){}try{w.Uint8ClampedArray=Uint8ClampedArray}catch(e){}try{w.DataView=DataView}catch(e){}try{w.Map=Map}catch(e){}try{w.Set=Set}catch(e){}try{w.WeakMap=WeakMap}catch(e){}try{w.WeakSet=WeakSet}catch(e){}try{w.Proxy=Proxy}catch(e){}try{w.Reflect=Reflect}catch(e){}try{w.decodeURI=decodeURI}catch(e){}try{w.decodeURIComponent=decodeURIComponent}catch(e){}try{w.encodeURI=encodeURI}catch(e){}try{w.encodeURIComponent=encodeURIComponent}catch(e){}try{w.escape=escape}catch(e){}try{w.unescape=unescape}catch(e){}try{w.eval=eval}catch(e){}try{w.isFinite=isFinite}catch(e){}try{w.isNaN=isNaN}catch(e){}try{w.SharedArrayBuffer=SharedArrayBuffer}catch(e){}try{w.Atomics=Atomics}catch(e){}try{w.WebAssembly=WebAssembly}catch(e){}try{w.clearInterval=clearInterval}catch(e){}try{w.clearTimeout=clearTimeout}catch(e){}try{w.setInterval=setInterval}catch(e){}try{w.setTimeout=setTimeout}catch(e){}try{w.crypto=crypto}catch(e){}x=l(w)}}w.Symbol&&(!w.Symbol.iterator&&(w.Symbol.iterator=A("iterator")),!w.Symbol.asyncIterator&&(w.Symbol.asyncIterator=A("asynciterator")));for(var S=v({}),_=0;_<x.length;_++){var k=x[_];try{S[k]=w[k]}catch(e){}}var E=A("window");function A(e){return e+Math.random().toString(36).substring(2)}var C={RES:void 0},I={RES:void 0},T=A("continue"),P=A("break"),O=A("super"),N=A("supercall"),M=A("noctor"),L=A("clsctor"),D=A("newtarget"),$=A("noinit"),R=A("deadzone"),j=function(){function e(e,t){this.kind=e,this.value=t}return e.prototype.get=function(){return this.value},e.prototype.set=function(e){if("const"===this.kind)throw new TypeError("Assignment to constant variable");return this.value=e},e}(),B=function(){function e(e,t){this.object=e,this.property=t}return e.prototype.get=function(){return this.object[this.property]},e.prototype.set=function(e){return this.object[this.property]=e,!0},e.prototype.del=function(){return delete this.object[this.property]},e}(),V=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=v(null),this.parent=e,this.isolated=t}return e.prototype.global=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.clone=function(){var t=new e(this.parent,this.isolated);for(var i in this.context){var n=this.context[i];t[n.kind](i,n.get())}return t},e.prototype.find=function(e){if(this.context[e])return this.context[e];if(this.parent)return this.parent.find(e);var t=this.global().find("window").get();return e in t?new B(t,e):null},e.prototype.var=function(e,t){for(var i=this;i.parent&&!i.isolated;)i=i.parent;var n=i.context[e];if(n){if("var"!==n.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");t!==$&&n.set(t)}else i.context[e]=new j("var",t===$?void 0:t);if(!i.parent){var r=i.find("window").get();t!==$&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var i=this.context[e];if(i&&i.get()!==R)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new j("let",t)},e.prototype.const=function(e,t){var i=this.context[e];if(i&&i.get()!==R)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new j("const",t)},e.prototype.func=function(e,t){var i=this.context[e];if(i&&"var"!==i.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new j("var",t)},e}();
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function F(e,t){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return c([e,t])}}function c(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function U(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function H(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function q(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(H(arguments[t]));return e}function z(e,t,i){void 0===i&&(i={});var n=i.getVar,r=void 0!==n&&n,s=i.throwErr,a=void 0===s||s;if("undefined"!==e.name){var o=t.find(e.name);if(o){if(r)return o;var c=o.get();if(c===R)throw new ReferenceError(e.name+" is not defined");return c}if(a)throw new ReferenceError(e.name+" is not defined")}}var W=Object.freeze({__proto__:null,Identifier:z});function Y(e,t){return e.value}var G=Object.freeze({__proto__:null,Literal:Y});function J(e,t,i){void 0===i&&(i={});var n,r,a=i.getObj,o=void 0!==a&&a,c=i.getVar,l=void 0!==c&&c;if(n="Super"===e.object.type?K(e.object,t,{getProto:!0}):ue(e.object,t),o)return n;if(r=e.computed?ue(e.property,t):e.property.name,l){var h=g(n,r);if("Super"===e.object.type&&h){var u=t.find("this").get(),p=A(r);return s(u,p,{set:h}),new B(u,p)}return new B(n,r)}var d=m(n,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):n[r]}function X(e,t){return e.value.raw}function K(e,t,i){void 0===i&&(i={});var n=i.getProto,r=void 0!==n&&n,s=t.find(O).get();return r?s.prototype:s}function Q(e,t){return ue(e.argument,t)}var Z=Object.freeze({__proto__:null,ThisExpression:function(e,t){var i=t.find(N);if(i&&!i.get())throw new ReferenceError("Must call super constructor in derived class before accessing 'this' or returning from derived constructor");return t.find("this").get()},ArrayExpression:function(e,t){for(var i=[],n=0;n<e.elements.length;n++){var r=e.elements[n];"SpreadElement"===r.type?i=i.concat(Q(r,t)):i.push(ue(r,t))}return i},ObjectExpression:function(e,t){for(var i={},n=0;n<e.properties.length;n++){var r=e.properties[n];if("SpreadElement"===r.type)b(i,Q(r,t));else{var o,c=r.key;o=r.computed?ue(c,t):"Identifier"===c.type?c.name:""+Y(c);var l=ue(r.value,t),h=r.kind;if("init"===h)i[o]=l;else if("get"===h){var u=a(i,o);s(i,o,{get:l,set:u&&u.set,enumerable:!0,configurable:!0})}else u=a(i,o),s(i,o,{get:u&&u.get,set:l,enumerable:!0,configurable:!0})}}return i},FunctionExpression:function(e,t){if(e.id&&e.id.name){var i=new V(t),n=et(e,i);return i.const(e.id.name,n),n}return et(e,t)},UnaryExpression:function(e,t){var i=e.argument;switch(e.operator){case"+":return+ue(i,t);case"-":return-ue(i,t);case"!":return!ue(i,t);case"~":return~ue(i,t);case"void":return void ue(i,t);case"typeof":return"Identifier"===i.type?typeof z(i,t,{throwErr:!1}):typeof ue(i,t);case"delete":if("MemberExpression"===i.type)return J(i,t,{getVar:!0}).del();if("Identifier"===i.type)throw new SyntaxError("Delete of an unqualified identifier in strict mode");return ue(i,t),!0;default:throw new SyntaxError("Unexpected token "+e.operator)}},UpdateExpression:function(e,t){var i,n=e.argument;if("Identifier"===n.type)i=z(n,t,{getVar:!0});else{if("MemberExpression"!==n.type)throw new SyntaxError("Unexpected token");i=J(n,t,{getVar:!0})}var r=i.get();if("++"===e.operator)return i.set(r+1),e.prefix?i.get():r;if("--"===e.operator)return i.set(r-1),e.prefix?i.get():r;throw new SyntaxError("Unexpected token "+e.operator)},BinaryExpression:function(e,t){var i=ue(e.left,t),n=ue(e.right,t);switch(e.operator){case"==":return i==n;case"!=":return i!=n;case"===":return i===n;case"!==":return i!==n;case"<":return i<n;case"<=":return i<=n;case">":return i>n;case">=":return i>=n;case"<<":return i<<n;case">>":return i>>n;case">>>":return i>>>n;case"+":return i+n;case"-":return i-n;case"*":return i*n;case"**":return Math.pow(i,n);case"/":return i/n;case"%":return i%n;case"|":return i|n;case"^":return i^n;case"&":return i&n;case"in":return i in n;case"instanceof":return i instanceof n;default:throw new SyntaxError("Unexpected token "+e.operator)}},AssignmentExpression:function(e,t){var i,n=ue(e.right,t),r=e.left;if("Identifier"===r.type){if(!(i=z(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new B(s,r.name)}}else{if("MemberExpression"!==r.type)return Ze(r,t,{feed:n});i=J(r,t,{getVar:!0})}switch(e.operator){case"=":return i.set(n),i.get();case"+=":return i.set(i.get()+n),i.get();case"-=":return i.set(i.get()-n),i.get();case"*=":return i.set(i.get()*n),i.get();case"/=":return i.set(i.get()/n),i.get();case"%=":return i.set(i.get()%n),i.get();case"**=":return i.set(Math.pow(i.get(),n)),i.get();case"<<=":return i.set(i.get()<<n),i.get();case">>=":return i.set(i.get()>>n),i.get();case">>>=":return i.set(i.get()>>>n),i.get();case"|=":return i.set(i.get()|n),i.get();case"^=":return i.set(i.get()^n),i.get();case"&=":return i.set(i.get()&n),i.get();default:throw new SyntaxError("Unexpected token "+e.operator)}},LogicalExpression:function(e,t){switch(e.operator){case"||":return ue(e.left,t)||ue(e.right,t);case"&&":return ue(e.left,t)&&ue(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}},MemberExpression:J,ConditionalExpression:function(e,t){return ue(e.test,t)?ue(e.consequent,t):ue(e.alternate,t)},CallExpression:function(e,t){var i,n;if("MemberExpression"===e.callee.type){n=J(e.callee,t,{getObj:!0});var r;if(r=e.callee.computed?ue(e.callee.property,t):e.callee.property.name,"Super"===e.callee.object.type){var s=t.find("this").get();i=n[r].bind(s)}else i=n[r];if("function"!=typeof i)throw new TypeError(r+" is not a function");if(i[L])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(i=ue(e.callee,t))||"Super"!==e.callee.type&&i[L]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}for(var o=[],c=0;c<e.arguments.length;c++){var l=e.arguments[c];"SpreadElement"===l.type?o=o.concat(Q(l,t)):o.push(ue(l,t))}if("Super"===e.callee.type){if(t.find(N).get())throw new ReferenceError("Super constructor may only be called once");t.find(N).set(!0)}return n&&n[E]&&-1!==i.toString().indexOf("[native code]")?i.apply(n[E],o):i.apply(n,o)},NewExpression:function(e,t){var i=ue(e.callee,t);if("function"!=typeof i){var n;if("Identifier"===e.callee.type)n=e.callee.name;else try{n=JSON.stringify(i)}catch(e){n=""+i}throw new TypeError(n+" is not a constructor")}if(i[M])throw new TypeError((i.name||"(intermediate value)")+" is not a constructor");for(var r=[],s=0;s<e.arguments.length;s++){var a=e.arguments[s];"SpreadElement"===a.type?r=r.concat(Q(a,t)):r.push(ue(a,t))}return new(i.bind.apply(i,q([void 0],r)))},MetaProperty:function(e,t){return t.find(D).get()},SequenceExpression:function(e,t){for(var i,n=0;n<e.expressions.length;n++)i=ue(e.expressions[n],t);return i},ArrowFunctionExpression:function(e,t){return et(e,t)},TemplateLiteral:function(e,t){for(var i,n,r=e.quasis.slice(),s=e.expressions.slice(),a="";i=r.shift();)a+=X(i),(n=s.shift())&&(a+=ue(n,t));return a},TaggedTemplateExpression:function(e,t){var i=ue(e.tag,t),n=e.quasi.quasis,a=n.map((function(e){return e.value.cooked})),o=n.map((function(e){return e.value.raw}));s(a,"raw",{value:r(o)});var c=e.quasi.expressions,l=[];if(c)for(var h=0;h<c.length;h++)l.push(ue(c[h],t));return i.apply(void 0,q([r(a)],l))},TemplateElement:X,ClassExpression:function(e,t){if(e.id&&e.id.name){var i=new V(t),n=tt(e,i);return i.const(e.id.name,n),n}return tt(e,t)},Super:K,SpreadElement:Q});function ee(e,t,i){void 0===i&&(i={});var n=i.invasived,r=void 0!==n&&n,s=i.hoisted,a=void 0!==s&&s,o=r?t:new V(t);a||Ke(e,o,{onlyBlock:!0});for(var c=0;c<e.body.length;c++){var l=ue(e.body[c],o);if(l===P||l===T||l===I)return l}}function te(e,t){for(var i=0;i<e.consequent.length;i++){var n=ue(e.consequent[i],t);if(n===P||n===T||n===I)return n}}function ie(e,t){return ee(e.body,t,{invasived:!0})}var ne=Object.freeze({__proto__:null,ExpressionStatement:function(e,t){ue(e.expression,t)},BlockStatement:ee,EmptyStatement:function(){},DebuggerStatement:function(){},ReturnStatement:function(e,t){return I.RES=e.argument?ue(e.argument,t):void 0,I},BreakStatement:function(){return P},ContinueStatement:function(){return T},IfStatement:function(e,t){return ue(e.test,t)?ue(e.consequent,t):ue(e.alternate,t)},SwitchStatement:function(e,t){for(var i=ue(e.discriminant,t),n=!1,r=0;r<e.cases.length;r++){var s=e.cases[r];if(n||s.test&&ue(s.test,t)!==i||(n=!0),n){var a=te(s,t);if(a===P)break;if(a===T||a===I)return a}}},SwitchCase:te,ThrowStatement:function(e,t){throw ue(e.argument,t)},TryStatement:function(e,t){try{return ee(e.block,t)}catch(s){if(e.handler){var i=new V(t),n=e.handler.param;if(n)if("Identifier"===n.type){var r=n.name;i.var(r,s)}else Ze(n,t,{feed:s});return ie(e.handler,i)}throw s}finally{if(e.finalizer){var s=ee(e.finalizer,t);if(s===P||s===T||s===I)return s}}},CatchClause:ie,WhileStatement:function(e,t){for(;ue(e.test,t);){var i=ue(e.body,t);if(i===P)break;if(i!==T&&i===I)return i}},DoWhileStatement:function(e,t){do{var i=ue(e.body,t);if(i===P)break;if(i!==T&&i===I)return i}while(ue(e.test,t))},ForStatement:function(e,t){var i=new V(t);for(ue(e.init,i);!e.test||ue(e.test,i);ue(e.update,i)){var n,r=new V(i);if((n="BlockStatement"===e.body.type?ee(e.body,r,{invasived:!0}):ue(e.body,r))===P)break;if(n!==T&&n===I)return n}},ForInStatement:function(e,t){for(var i in ue(e.right,t)){var n=it(e,t,{value:i});if(n===P)break;if(n!==T&&n===I)return n}},ForOfStatement:function(e,t){var i,n,r=ue(e.right,t);try{for(var s=U(r),a=s.next();!a.done;a=s.next()){var o=it(e,t,{value:a.value});if(o===P)break;if(o!==T&&o===I)return o}}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}}});function re(e,t,i){void 0===i&&(i={});for(var n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,l=i.feed,h=void 0===l?{}:l,u=[],p=0;p<e.properties.length;p++){var d=e.properties[p];if(a)(c||"var"===r)&&("Property"===d.type?"Identifier"===(f=d.value).type?t[r](f.name,c?R:"var"===r?$:void 0):Ze(f,t,{kind:r,hoist:a,onlyBlock:c}):ae(d,t,{kind:r,hoist:a,onlyBlock:c}));else if("Property"===d.type){var f,m;m=d.computed?ue(d.key,t):d.key.name,u.push(m),"Identifier"===(f=d.value).type?t[r](f.name,h[m]):Ze(f,t,{kind:r,feed:h[m]})}else{for(var g=b({},h),v=0;v<u.length;v++)delete g[u[v]];ae(d,t,{kind:r,feed:g})}}}function se(e,t,i){void 0===i&&(i={});for(var n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=[],u=0;u<e.elements.length;u++){var p=e.elements[u];if(p)if(s)(o||"var"===n)&&("Identifier"===p.type?t[n](p.name,o?R:"var"===n?$:void 0):Ze(p,t,{kind:n,hoist:s,onlyBlock:o}));else if("Identifier"===p.type)if(n)t[n](p.name,l[u]);else{var d=z(p,t,{getVar:!0});d.set(l[u]),h.push(d.get())}else"RestElement"===p.type?ae(p,t,{kind:n,feed:l.slice(u)}):Ze(p,t,{kind:n,feed:l[u]})}if(h.length)return h}function ae(e,t,i){void 0===i&&(i={});var n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=e.argument;s?(o||"var"===n)&&("Identifier"===h.type?t[n](h.name,o?R:"var"===n?$:void 0):Ze(h,t,{kind:n,hoist:s,onlyBlock:o})):"Identifier"===h.type?n?t[n](h.name,l):z(h,t,{getVar:!0}).set(l):Ze(h,t,{kind:n,feed:l})}function oe(e,t,i){void 0===i&&(i={});var n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,l=i.feed,h=void 0===l?ue(e.right,t):l,u=e.left;a?(c||"var"===r)&&("Identifier"===u.type?t[r](u.name,c?R:"var"===r?$:void 0):Ze(u,t,{kind:r,hoist:a,onlyBlock:c})):"Identifier"===u.type?t[r](u.name,h):Ze(u,t,{kind:r,feed:h})}var ce=Object.freeze({__proto__:null,ObjectPattern:re,ArrayPattern:se,RestElement:ae,AssignmentPattern:oe});var le,he=Object.freeze({__proto__:null,Program:function(e,t){for(var i=0;i<e.body.length;i++)ue(e.body[i],t)}});function ue(e,i){if(e){le||(le=b({},t,Z,W,ne,G,ce,he));var n=le[e.type];if(n)return n(e,i);throw new Error(e.type+" isn't implemented")}}function pe(e,t){t.func(e.id.name,et(e,t))}function de(e,t,i){void 0===i&&(i={});for(var n=0;n<e.declarations.length;n++)fe(e.declarations[n],t,b({kind:e.kind},i))}function fe(e,t,i){void 0===i&&(i={});var n=i.kind,r=void 0===n?"var":n,a=i.hoist,o=void 0!==a&&a,c=i.onlyBlock,l=void 0!==c&&c,h=i.feed;if(o)(l||"var"===r)&&("Identifier"===e.id.type?t[r](e.id.name,l?R:"var"===r?$:void 0):Ze(e.id,t,{kind:r,hoist:o,onlyBlock:l}));else{var u="feed"in i,p=u?h:ue(e.init,t);if("Identifier"===e.id.type){var d=e.id.name;"var"!==r||e.init||u?t[r](d,p):t.var(d,$),e.init&&-1!==["ClassExpression","FunctionExpression","ArrowFunctionExpression"].indexOf(e.init.type)&&!p.name&&s(p,"name",{value:d,configurable:!0})}else Ze(e.id,t,{kind:r,feed:p})}}function me(e,t){t.func(e.id.name,tt(e,t))}function ge(e,t,i){void 0===i&&(i={});for(var n=i.klass,r=i.superClass,s=0;s<e.body.length;s++)ve(e.body[s],t,{klass:n,superClass:r})}function ve(e,t,i){void 0===i&&(i={});var n,r=i.klass,o=i.superClass;if(e.computed)n=ue(e.key,t);else{if("Identifier"!==e.key.type)throw new SyntaxError("Unexpected token");n=e.key.name}var c=e.static?r:r.prototype,l=et(e.value,t,{superClass:o});switch(e.kind){case"constructor":break;case"method":s(c,n,{value:l,writable:!0,configurable:!0});break;case"get":var h=a(c,n);s(c,n,{get:l,set:h&&h.set,configurable:!0});break;case"set":h=a(c,n),s(c,n,{get:h&&h.get,set:l,configurable:!0});break;default:throw new SyntaxError("Unexpected token")}}function ye(e,t,i){var n,r,s,a,o,c;return void 0===i&&(i={}),F(this,(function(l){if(n=i.getVar,r=void 0!==n&&n,s=i.throwErr,a=void 0===s||s,"undefined"===e.name)return[2,void 0];if(o=t.find(e.name)){if(r)return[2,o];if((c=o.get())===R)throw new ReferenceError(e.name+" is not defined");return[2,c]}if(a)throw new ReferenceError(e.name+" is not defined");return[2,void 0]}))}var be=Object.freeze({__proto__:null,Identifier:ye});function xe(e,t){return F(this,(function(t){return[2,e.value]}))}var we=Object.freeze({__proto__:null,Literal:xe});function Se(e,t,i){var n,r,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),F(this,(function(f){switch(f.label){case 0:return n=i.getObj,r=void 0!==n&&n,a=i.getVar,o=void 0!==a&&a,"Super"!==e.object.type?[3,2]:[5,U(ke(e.object,t,{getProto:!0}))];case 1:return c=f.sent(),[3,4];case 2:return[5,U(Re(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,U(Re(e.property,t))]:[3,6];case 5:return l=f.sent(),[3,7];case 6:l=e.property.name,f.label=7;case 7:return o?(h=g(c,l),"Super"===e.object.type&&h?(d=t.find("this").get(),u=A(l),s(d,u,{set:h}),[2,new B(d,u)]):[2,new B(c,l)]):(p=m(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function _e(e,t){return F(this,(function(t){return[2,e.value.raw]}))}function ke(e,t,i){var n,r,s;return void 0===i&&(i={}),F(this,(function(e){return n=i.getProto,r=void 0!==n&&n,s=t.find(O).get(),[2,r?s.prototype:s]}))}function Ee(e,t){return F(this,(function(i){switch(i.label){case 0:return[5,U(Re(e.argument,t))];case 1:return[2,i.sent()]}}))}var Ae=Object.freeze({__proto__:null,ThisExpression:function(e,t){var i;return F(this,(function(e){if((i=t.find(N))&&!i.get())throw new ReferenceError("Must call super constructor in derived class before accessing 'this' or returning from derived constructor");return[2,t.find("this").get()]}))},ArrayExpression:function(e,t){var i,n,r,s,a,o,c;return F(this,(function(l){switch(l.label){case 0:i=[],n=0,l.label=1;case 1:return n<e.elements.length?"SpreadElement"!==(r=e.elements[n]).type?[3,3]:(a=(s=i).concat,[5,U(Ee(r,t))]):[3,6];case 2:return i=a.apply(s,[l.sent()]),[3,5];case 3:return c=(o=i).push,[5,U(Re(r,t))];case 4:c.apply(o,[l.sent()]),l.label=5;case 5:return n++,[3,1];case 6:return[2,i]}}))},ObjectExpression:function(e,t){var i,n,r,o,c,l,h,u,p,d,f;return F(this,(function(m){switch(m.label){case 0:i={},n=0,m.label=1;case 1:return n<e.properties.length?"SpreadElement"!==(r=e.properties[n]).type?[3,3]:(o=b,c=[i],[5,U(Ee(r,t))]):[3,11];case 2:return o.apply(void 0,c.concat([m.sent()])),[3,10];case 3:return l=void 0,h=r.key,r.computed?[5,U(Re(h,t))]:[3,5];case 4:return l=m.sent(),[3,8];case 5:return"Identifier"!==h.type?[3,6]:(l=h.name,[3,8]);case 6:return u="",[5,U(xe(h))];case 7:l=u+m.sent(),m.label=8;case 8:return[5,U(Re(r.value,t))];case 9:p=m.sent(),"init"===(d=r.kind)?i[l]=p:"get"===d?(f=a(i,l),s(i,l,{get:p,set:f&&f.set,enumerable:!0,configurable:!0})):(f=a(i,l),s(i,l,{get:f&&f.get,set:p,enumerable:!0,configurable:!0})),m.label=10;case 10:return n++,[3,1];case 11:return[2,i]}}))},FunctionExpression:function(e,t){var i,n;return F(this,(function(r){return e.id&&e.id.name?(i=new V(t),n=Ge(e,i),i.const(e.id.name,n),[2,n]):[2,Ge(e,t)]}))},UnaryExpression:function(e,t){var i;return F(this,(function(n){switch(n.label){case 0:switch(i=e.argument,e.operator){case"+":return[3,1];case"-":return[3,3];case"!":return[3,5];case"~":return[3,7];case"void":return[3,9];case"typeof":return[3,11];case"delete":return[3,15]}return[3,20];case 1:case 3:case 5:case 7:case 9:case 13:case 18:return[5,U(Re(i,t))];case 2:return[2,+n.sent()];case 4:return[2,-n.sent()];case 6:return[2,!n.sent()];case 8:return[2,~n.sent()];case 10:return[2,void n.sent()];case 11:return"Identifier"!==i.type?[3,13]:[5,U(ye(i,t,{throwErr:!1}))];case 12:case 14:return[2,typeof n.sent()];case 15:return"MemberExpression"!==i.type?[3,17]:[5,U(Se(i,t,{getVar:!0}))];case 16:return[2,n.sent().del()];case 17:if("Identifier"!==i.type)return[3,18];throw new SyntaxError("Delete of an unqualified identifier in strict mode");case 19:return n.sent(),[2,!0];case 20:throw new SyntaxError("Unexpected token "+e.operator)}}))},UpdateExpression:function(e,t){var i,n,r;return F(this,(function(s){switch(s.label){case 0:return"Identifier"!==(i=e.argument).type?[3,2]:[5,U(ye(i,t,{getVar:!0}))];case 1:case 3:return n=s.sent(),[3,5];case 2:return"MemberExpression"!==i.type?[3,4]:[5,U(Se(i,t,{getVar:!0}))];case 4:throw new SyntaxError("Unexpected token");case 5:if(r=n.get(),"++"===e.operator)return n.set(r+1),[2,e.prefix?n.get():r];if("--"===e.operator)return n.set(r-1),[2,e.prefix?n.get():r];throw new SyntaxError("Unexpected token "+e.operator)}}))},BinaryExpression:function(e,t){var i,n;return F(this,(function(r){switch(r.label){case 0:return[5,U(Re(e.left,t))];case 1:return i=r.sent(),[5,U(Re(e.right,t))];case 2:switch(n=r.sent(),e.operator){case"==":return[2,i==n];case"!=":return[2,i!=n];case"===":return[2,i===n];case"!==":return[2,i!==n];case"<":return[2,i<n];case"<=":return[2,i<=n];case">":return[2,i>n];case">=":return[2,i>=n];case"<<":return[2,i<<n];case">>":return[2,i>>n];case">>>":return[2,i>>>n];case"+":return[2,i+n];case"-":return[2,i-n];case"*":return[2,i*n];case"**":return[2,Math.pow(i,n)];case"/":return[2,i/n];case"%":return[2,i%n];case"|":return[2,i|n];case"^":return[2,i^n];case"&":return[2,i&n];case"in":return[2,i in n];case"instanceof":return[2,i instanceof n];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))},AssignmentExpression:function(e,t){var i,n,r,s;return F(this,(function(a){switch(a.label){case 0:return[5,U(Re(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,U(ye(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new B(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,U(Se(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,U(Ye(n,t,{feed:i}))];case 6:return[2,a.sent()];case 7:switch(e.operator){case"=":return r.set(i),[2,r.get()];case"+=":return r.set(r.get()+i),[2,r.get()];case"-=":return r.set(r.get()-i),[2,r.get()];case"*=":return r.set(r.get()*i),[2,r.get()];case"/=":return r.set(r.get()/i),[2,r.get()];case"%=":return r.set(r.get()%i),[2,r.get()];case"**=":return r.set(Math.pow(r.get(),i)),[2,r.get()];case"<<=":return r.set(r.get()<<i),[2,r.get()];case">>=":return r.set(r.get()>>i),[2,r.get()];case">>>=":return r.set(r.get()>>>i),[2,r.get()];case"|=":return r.set(r.get()|i),[2,r.get()];case"^=":return r.set(r.get()^i),[2,r.get()];case"&=":return r.set(r.get()&i),[2,r.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))},LogicalExpression:function(e,t){var i,n;return F(this,(function(r){switch(r.label){case 0:switch(e.operator){case"||":return[3,1];case"&&":return[3,5]}return[3,9];case 1:return[5,U(Re(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,U(Re(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,U(Re(e.left,t))];case 6:return(n=r.sent())?[5,U(Re(e.right,t))]:[3,8];case 7:n=r.sent(),r.label=8;case 8:return[2,n];case 9:throw new SyntaxError("Unexpected token "+e.operator)}}))},MemberExpression:Se,ConditionalExpression:function(e,t){var i;return F(this,(function(n){switch(n.label){case 0:return[5,U(Re(e.test,t))];case 1:return n.sent()?[5,U(Re(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,U(Re(e.alternate,t))];case 4:i=n.sent(),n.label=5;case 5:return[2,i]}}))},CallExpression:function(e,t){var i,n,r,s,a,o,c,l,h,u,p,d;return F(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,U(Se(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,U(Re(e.callee.property,t))]:[3,3];case 2:return r=f.sent(),[3,4];case 3:r=e.callee.property.name,f.label=4;case 4:if("Super"===e.callee.object.type?(s=t.find("this").get(),i=n[r].bind(s)):i=n[r],"function"!=typeof i)throw new TypeError(r+" is not a function");if(i[L])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,U(Re(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[L]){if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}f.label=7;case 7:o=[],c=0,f.label=8;case 8:return c<e.arguments.length?"SpreadElement"!==(l=e.arguments[c]).type?[3,10]:(u=(h=o).concat,[5,U(Ee(l,t))]):[3,13];case 9:return o=u.apply(h,[f.sent()]),[3,12];case 10:return d=(p=o).push,[5,U(Re(l,t))];case 11:d.apply(p,[f.sent()]),f.label=12;case 12:return c++,[3,8];case 13:if("Super"===e.callee.type){if(t.find(N).get())throw new ReferenceError("Super constructor may only be called once");t.find(N).set(!0)}return n&&n[E]&&-1!==i.toString().indexOf("[native code]")?[2,i.apply(n[E],o)]:[2,i.apply(n,o)]}}))},NewExpression:function(e,t){var i,n,r,s,a,o,c,l,h;return F(this,(function(u){switch(u.label){case 0:return[5,U(Re(e.callee,t))];case 1:if("function"!=typeof(i=u.sent())){if("Identifier"===e.callee.type)n=e.callee.name;else try{n=JSON.stringify(i)}catch(e){n=""+i}throw new TypeError(n+" is not a constructor")}if(i[M])throw new TypeError((i.name||"(intermediate value)")+" is not a constructor");r=[],s=0,u.label=2;case 2:return s<e.arguments.length?"SpreadElement"!==(a=e.arguments[s]).type?[3,4]:(c=(o=r).concat,[5,U(Ee(a,t))]):[3,7];case 3:return r=c.apply(o,[u.sent()]),[3,6];case 4:return h=(l=r).push,[5,U(Re(a,t))];case 5:h.apply(l,[u.sent()]),u.label=6;case 6:return s++,[3,2];case 7:return[2,new(i.bind.apply(i,q([void 0],r)))]}}))},MetaProperty:function(e,t){return F(this,(function(e){return[2,t.find(D).get()]}))},SequenceExpression:function(e,t){var i,n;return F(this,(function(r){switch(r.label){case 0:n=0,r.label=1;case 1:return n<e.expressions.length?[5,U(Re(e.expressions[n],t))]:[3,4];case 2:i=r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2,i]}}))},ArrowFunctionExpression:function(e,t){return F(this,(function(i){return[2,Ge(e,t)]}))},TemplateLiteral:function(e,t){var i,n,r,s,a,o,c;return F(this,(function(l){switch(l.label){case 0:i=e.quasis.slice(),n=e.expressions.slice(),r="",l.label=1;case 1:return(s=i.shift())?(o=r,[5,U(_e(s))]):[3,5];case 2:return r=o+l.sent(),(a=n.shift())?(c=r,[5,U(Re(a,t))]):[3,4];case 3:r=c+l.sent(),l.label=4;case 4:return[3,1];case 5:return[2,r]}}))},TaggedTemplateExpression:function(e,t){var i,n,a,o,c,l,h,u,p;return F(this,(function(d){switch(d.label){case 0:return[5,U(Re(e.tag,t))];case 1:if(i=d.sent(),n=e.quasi.quasis,a=n.map((function(e){return e.value.cooked})),o=n.map((function(e){return e.value.raw})),s(a,"raw",{value:r(o)}),c=e.quasi.expressions,l=[],!c)return[3,5];h=0,d.label=2;case 2:return h<c.length?(p=(u=l).push,[5,U(Re(c[h],t))]):[3,5];case 3:p.apply(u,[d.sent()]),d.label=4;case 4:return h++,[3,2];case 5:return[2,i.apply(void 0,q([r(a)],l))]}}))},TemplateElement:_e,ClassExpression:function(e,t){var i,n;return F(this,(function(r){switch(r.label){case 0:return e.id&&e.id.name?(i=new V(t),[5,U(Je(e,i))]):[3,2];case 1:return n=r.sent(),i.const(e.id.name,n),[2,n];case 2:return[5,U(Je(e,t))];case 3:return[2,r.sent()]}}))},Super:ke,SpreadElement:Ee,YieldExpression:function(e,t){var i,n;return F(this,(function(r){switch(r.label){case 0:return[5,U(Re(e.argument,t))];case 1:return i=r.sent(),e.delegate?[5,U(i)]:[3,3];case 2:return n=r.sent(),[3,5];case 3:return[4,i];case 4:n=r.sent(),r.label=5;case 5:return[2,n]}}))},AwaitExpression:function(e,t){var i;return F(this,(function(n){switch(n.label){case 0:return i=C,[5,U(Re(e.argument,t))];case 1:return i.RES=n.sent(),[4,C];case 2:return[2,n.sent()]}}))}});function Ce(e,t,i){var n,r,s,a,o,c,l;return void 0===i&&(i={}),F(this,(function(h){switch(h.label){case 0:return n=i.invasived,r=void 0!==n&&n,s=i.hoisted,a=void 0!==s&&s,o=r?t:new V(t),a?[3,2]:[5,U(ze(e,o,{onlyBlock:!0}))];case 1:h.sent(),h.label=2;case 2:c=0,h.label=3;case 3:return c<e.body.length?[5,U(Re(e.body[c],o))]:[3,6];case 4:if((l=h.sent())===P||l===T||l===I)return[2,l];h.label=5;case 5:return c++,[3,3];case 6:return[2]}}))}function Ie(e,t){var i,n;return F(this,(function(r){switch(r.label){case 0:i=0,r.label=1;case 1:return i<e.consequent.length?[5,U(Re(e.consequent[i],t))]:[3,4];case 2:if((n=r.sent())===P||n===T||n===I)return[2,n];r.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}function Te(e,t){return F(this,(function(i){switch(i.label){case 0:return[5,U(Ce(e.body,t,{invasived:!0}))];case 1:return[2,i.sent()]}}))}var Pe=Object.freeze({__proto__:null,ExpressionStatement:function(e,t){return F(this,(function(i){switch(i.label){case 0:return[5,U(Re(e.expression,t))];case 1:return i.sent(),[2]}}))},BlockStatement:Ce,EmptyStatement:function(){return F(this,(function(e){return[2]}))},DebuggerStatement:function(){return F(this,(function(e){return[2]}))},ReturnStatement:function(e,t){var i,n;return F(this,(function(r){switch(r.label){case 0:return i=I,e.argument?[5,U(Re(e.argument,t))]:[3,2];case 1:return n=r.sent(),[3,3];case 2:n=void 0,r.label=3;case 3:return i.RES=n,[2,I]}}))},BreakStatement:function(){return F(this,(function(e){return[2,P]}))},ContinueStatement:function(){return F(this,(function(e){return[2,T]}))},IfStatement:function(e,t){return F(this,(function(i){switch(i.label){case 0:return[5,U(Re(e.test,t))];case 1:return i.sent()?[5,U(Re(e.consequent,t))]:[3,3];case 2:case 4:return[2,i.sent()];case 3:return[5,U(Re(e.alternate,t))]}}))},SwitchStatement:function(e,t){var i,n,r,s,a,o,c;return F(this,(function(l){switch(l.label){case 0:return[5,U(Re(e.discriminant,t))];case 1:i=l.sent(),n=!1,r=0,l.label=2;case 2:return r<e.cases.length?(s=e.cases[r],(a=!n)?(o=!s.test)?[3,4]:[5,U(Re(s.test,t))]:[3,5]):[3,8];case 3:o=l.sent()===i,l.label=4;case 4:a=o,l.label=5;case 5:return a&&(n=!0),n?[5,U(Ie(s,t))]:[3,7];case 6:if((c=l.sent())===P)return[3,8];if(c===T||c===I)return[2,c];l.label=7;case 7:return r++,[3,2];case 8:return[2]}}))},SwitchCase:Ie,ThrowStatement:function(e,t){return F(this,(function(i){switch(i.label){case 0:return[5,U(Re(e.argument,t))];case 1:throw i.sent()}}))},TryStatement:function(e,t){var i,n,r,s,a;return F(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,9,12]),[5,U(Ce(e.block,t))];case 1:return[2,o.sent()];case 2:return i=o.sent(),e.handler?(n=new V(t),(r=e.handler.param)?"Identifier"!==r.type?[3,3]:(s=r.name,n.var(s,i),[3,5]):[3,5]):[3,7];case 3:return[5,U(Ye(r,t,{feed:i}))];case 4:o.sent(),o.label=5;case 5:return[5,U(Te(e.handler,n))];case 6:return[2,o.sent()];case 7:throw i;case 8:return[3,12];case 9:return e.finalizer?[5,U(Ce(e.finalizer,t))]:[3,11];case 10:if((a=o.sent())===P||a===T||a===I)return[2,a];o.label=11;case 11:return[7];case 12:return[2]}}))},CatchClause:Te,WhileStatement:function(e,t){var i;return F(this,(function(n){switch(n.label){case 0:return[5,U(Re(e.test,t))];case 1:return n.sent()?[5,U(Re(e.body,t))]:[3,3];case 2:return(i=n.sent())===P?[3,3]:i===T?[3,0]:i===I?[2,i]:[3,0];case 3:return[2]}}))},DoWhileStatement:function(e,t){var i;return F(this,(function(n){switch(n.label){case 0:return[5,U(Re(e.body,t))];case 1:if((i=n.sent())===P)return[3,4];if(i===T)return[3,2];if(i===I)return[2,i];n.label=2;case 2:return[5,U(Re(e.test,t))];case 3:if(n.sent())return[3,0];n.label=4;case 4:return[2]}}))},ForStatement:function(e,t){var i,n,r,s;return F(this,(function(a){switch(a.label){case 0:return i=new V(t),[5,U(Re(e.init,i))];case 1:a.sent(),a.label=2;case 2:return e.test?[5,U(Re(e.test,i))]:[3,4];case 3:return n=a.sent(),[3,5];case 4:n=!0,a.label=5;case 5:return n?(r=new V(i),s=void 0,"BlockStatement"!==e.body.type?[3,7]:[5,U(Ce(e.body,r,{invasived:!0}))]):[3,12];case 6:return s=a.sent(),[3,9];case 7:return[5,U(Re(e.body,r))];case 8:s=a.sent(),a.label=9;case 9:if(s===P)return[3,12];if(s===T)return[3,10];if(s===I)return[2,s];a.label=10;case 10:return[5,U(Re(e.update,i))];case 11:return a.sent(),[3,2];case 12:return[2]}}))},ForInStatement:function(e,t){var i,n,r,s,a;return F(this,(function(o){switch(o.label){case 0:return i=[],[5,U(Re(e.right,t))];case 1:for(n in o.sent())i.push(n);r=0,o.label=2;case 2:return r<i.length?(s=i[r],[5,U(Xe(e,t,{value:s}))]):[3,5];case 3:if((a=o.sent())===P)return[3,5];if(a===T)return[3,4];if(a===I)return[2,a];o.label=4;case 4:return r++,[3,2];case 5:return[2]}}))},ForOfStatement:function(e,t){var i,n,r,s,a,o,c,l,h,u;return F(this,(function(p){switch(p.label){case 0:return[5,U(Re(e.right,t))];case 1:return i=p.sent(),e.await?(n=function(e){var t;if("function"==typeof Symbol&&!(t=e[Symbol.asyncIterator])&&(t=e[Symbol.iterator]),t)return t.call(e);if("function"==typeof e.next)return e;var i=0;return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}(i),r=void 0,C.RES=n.next(),[4,C]):[3,8];case 2:r=p.sent(),p.label=3;case 3:return r.done?[3,7]:[5,U(Xe(e,t,{value:r.value}))];case 4:if((c=p.sent())===P)return[3,7];if(c===T)return[3,5];if(c===I)return[2,c];p.label=5;case 5:return C.RES=n.next(),[4,C];case 6:return r=p.sent(),[3,3];case 7:return[3,15];case 8:p.trys.push([8,13,14,15]),s=U(i),a=s.next(),p.label=9;case 9:return a.done?[3,12]:(o=a.value,[5,U(Xe(e,t,{value:o}))]);case 10:if((c=p.sent())===P)return[3,12];if(c===T)return[3,11];if(c===I)return[2,c];p.label=11;case 11:return a=s.next(),[3,9];case 12:return[3,15];case 13:return l=p.sent(),h={error:l},[3,15];case 14:try{a&&!a.done&&(u=s.return)&&u.call(s)}finally{if(h)throw h.error}return[7];case 15:return[2]}}))}});function Oe(e,t,i){var n,r,s,a,o,c,l,h,u,p,d,f,m,g,v;return void 0===i&&(i={}),F(this,(function(y){switch(y.label){case 0:n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,l=i.feed,h=void 0===l?{}:l,u=[],p=0,y.label=1;case 1:return p<e.properties.length?(d=e.properties[p],a?c||"var"===r?"Property"!==d.type?[3,5]:"Identifier"!==(m=d.value).type?[3,2]:(t[r](m.name,c?R:"var"===r?$:void 0),[3,4]):[3,7]:[3,8]):[3,18];case 2:return[5,U(Ye(m,t,{kind:r,hoist:a,onlyBlock:c}))];case 3:y.sent(),y.label=4;case 4:return[3,7];case 5:return[5,U(Me(d,t,{kind:r,hoist:a,onlyBlock:c}))];case 6:y.sent(),y.label=7;case 7:return[3,17];case 8:return"Property"!==d.type?[3,15]:(f=void 0,d.computed?[5,U(Re(d.key,t))]:[3,10]);case 9:return f=y.sent(),[3,11];case 10:f=d.key.name,y.label=11;case 11:return u.push(f),"Identifier"!==(m=d.value).type?[3,12]:(t[r](m.name,h[f]),[3,14]);case 12:return[5,U(Ye(m,t,{kind:r,feed:h[f]}))];case 13:y.sent(),y.label=14;case 14:return[3,17];case 15:for(g=b({},h),v=0;v<u.length;v++)delete g[u[v]];return[5,U(Me(d,t,{kind:r,feed:g}))];case 16:y.sent(),y.label=17;case 17:return p++,[3,1];case 18:return[2]}}))}function Ne(e,t,i){var n,r,s,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),F(this,(function(f){switch(f.label){case 0:n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=[],u=0,f.label=1;case 1:return u<e.elements.length?(p=e.elements[u])?s?o||"var"===n?"Identifier"!==p.type?[3,2]:(t[n](p.name,o?R:"var"===n?$:void 0),[3,4]):[3,4]:[3,5]:[3,13]:[3,14];case 2:return[5,U(Ye(p,t,{kind:n,hoist:s,onlyBlock:o}))];case 3:f.sent(),f.label=4;case 4:return[3,13];case 5:return"Identifier"!==p.type?[3,9]:n?(t[n](p.name,l[u]),[3,8]):[3,6];case 6:return[5,U(ye(p,t,{getVar:!0}))];case 7:(d=f.sent()).set(l[u]),h.push(d.get()),f.label=8;case 8:return[3,13];case 9:return"RestElement"!==p.type?[3,11]:[5,U(Me(p,t,{kind:n,feed:l.slice(u)}))];case 10:return f.sent(),[3,13];case 11:return[5,U(Ye(p,t,{kind:n,feed:l[u]}))];case 12:f.sent(),f.label=13;case 13:return u++,[3,1];case 14:return h.length?[2,h]:[2]}}))}function Me(e,t,i){var n,r,s,a,o,c,l,h;return void 0===i&&(i={}),F(this,(function(u){switch(u.label){case 0:return n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=e.argument,s?o||"var"===n?"Identifier"!==h.type?[3,1]:(t[n](h.name,o?R:"var"===n?$:void 0),[3,3]):[3,3]:[3,4];case 1:return[5,U(Ye(h,t,{kind:n,hoist:s,onlyBlock:o}))];case 2:u.sent(),u.label=3;case 3:return[3,10];case 4:return"Identifier"!==h.type?[3,8]:n?(t[n](h.name,l),[3,7]):[3,5];case 5:return[5,U(ye(h,t,{getVar:!0}))];case 6:u.sent().set(l),u.label=7;case 7:return[3,10];case 8:return[5,U(Ye(h,t,{kind:n,feed:l}))];case 9:u.sent(),u.label=10;case 10:return[2]}}))}function Le(e,t,i){var n,r,s,a,o,c,l,h,u,p;return void 0===i&&(i={}),F(this,(function(d){switch(d.label){case 0:return n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,void 0!==(l=i.feed)?[3,2]:[5,U(Re(e.right,t))];case 1:return u=d.sent(),[3,3];case 2:u=l,d.label=3;case 3:return h=u,p=e.left,a?c||"var"===r?"Identifier"!==p.type?[3,4]:(t[r](p.name,c?R:"var"===r?$:void 0),[3,6]):[3,6]:[3,7];case 4:return[5,U(Ye(p,t,{kind:r,hoist:a,onlyBlock:c}))];case 5:d.sent(),d.label=6;case 6:return[3,10];case 7:return"Identifier"!==p.type?[3,8]:(t[r](p.name,h),[3,10]);case 8:return[5,U(Ye(p,t,{kind:r,feed:h}))];case 9:d.sent(),d.label=10;case 10:return[2]}}))}var De,$e=Object.freeze({__proto__:null,ObjectPattern:Oe,ArrayPattern:Ne,RestElement:Me,AssignmentPattern:Le});function Re(e,t){var i;return F(this,(function(r){switch(r.label){case 0:return e?(De||(De=b({},n,Ae,be,Pe,we,$e)),(i=De[e.type])?[5,U(i(e,t))]:[3,2]):[2];case 1:return[2,r.sent()];case 2:throw new Error(e.type+" isn't implemented")}}))}function je(e,t){return F(this,(function(i){return t.func(e.id.name,Ge(e,t)),[2]}))}function Be(e,t,i){var n;return void 0===i&&(i={}),F(this,(function(r){switch(r.label){case 0:n=0,r.label=1;case 1:return n<e.declarations.length?[5,U(Ve(e.declarations[n],t,b({kind:e.kind},i)))]:[3,4];case 2:r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}function Ve(e,t,i){var n,r,a,o,c,l,h,u,p,d,f;return void 0===i&&(i={}),F(this,(function(m){switch(m.label){case 0:return n=i.kind,r=void 0===n?"var":n,a=i.hoist,o=void 0!==a&&a,c=i.onlyBlock,l=void 0!==c&&c,h=i.feed,o?l||"var"===r?"Identifier"!==e.id.type?[3,1]:(t[r](e.id.name,l?R:"var"===r?$:void 0),[3,3]):[3,3]:[3,4];case 1:return[5,U(Ye(e.id,t,{kind:r,hoist:o,onlyBlock:l}))];case 2:m.sent(),m.label=3;case 3:return[3,10];case 4:return(u="feed"in i)?(d=h,[3,7]):[3,5];case 5:return[5,U(Re(e.init,t))];case 6:d=m.sent(),m.label=7;case 7:return p=d,"Identifier"!==e.id.type?[3,8]:(f=e.id.name,"var"!==r||e.init||u?t[r](f,p):t.var(f,$),e.init&&-1!==["ClassExpression","FunctionExpression","ArrowFunctionExpression"].indexOf(e.init.type)&&!p.name&&s(p,"name",{value:f,configurable:!0}),[3,10]);case 8:return[5,U(Ye(e.id,t,{kind:r,feed:p}))];case 9:m.sent(),m.label=10;case 10:return[2]}}))}function Fe(e,t){var i,n,r;return F(this,(function(s){switch(s.label){case 0:return n=(i=t).func,r=[e.id.name],[5,U(Je(e,t))];case 1:return n.apply(i,r.concat([s.sent()])),[2]}}))}function Ue(e,t,i){var n,r,s;return void 0===i&&(i={}),F(this,(function(a){switch(a.label){case 0:n=i.klass,r=i.superClass,s=0,a.label=1;case 1:return s<e.body.length?[5,U(He(e.body[s],t,{klass:n,superClass:r}))]:[3,4];case 2:a.sent(),a.label=3;case 3:return s++,[3,1];case 4:return[2]}}))}function He(e,t,i){var n,r,o,c,l,h;return void 0===i&&(i={}),F(this,(function(u){switch(u.label){case 0:return n=i.klass,r=i.superClass,e.computed?[5,U(Re(e.key,t))]:[3,2];case 1:return o=u.sent(),[3,3];case 2:if("Identifier"!==e.key.type)throw new SyntaxError("Unexpected token");o=e.key.name,u.label=3;case 3:switch(c=e.static?n:n.prototype,l=Ge(e.value,t,{superClass:r}),e.kind){case"constructor":break;case"method":s(c,o,{value:l,writable:!0,configurable:!0});break;case"get":h=a(c,o),s(c,o,{get:l,set:h&&h.set,configurable:!0});break;case"set":h=a(c,o),s(c,o,{get:h&&h.get,set:l,configurable:!0});break;default:throw new SyntaxError("Unexpected token")}return[2]}}))}function qe(e,t){void 0===t&&(t={});var i=t.res,n=t.err,r=t.ret,s=t.fullRet;return new Promise((function(a,o){if("ret"in t)return a(e.return(r));function c(t){var i;try{i=e.next(t)}catch(e){return o(e)}return h(i),null}function l(t){var i;try{i=e.throw(t)}catch(e){return o(e)}h(i)}function h(e){if(e.done)return a(s?e:e.value);if(e.value!==C)return a(e);var t=e.value.RES;return(t&&"function"===t.then?t:Promise.resolve(t)).then(c,l)}"err"in t?l(n):c(i)}))}function ze(e,t,i){var n,r,s,a,o,c;return void 0===i&&(i={}),F(this,(function(l){switch(l.label){case 0:n=i.onlyBlock,r=void 0!==n&&n,s=[],a=[],c=0,l.label=1;case 1:return c<e.body.length?"FunctionDeclaration"!==(o=e.body[c]).type?[3,2]:(s.push(o),a.push(c),[3,6]):[3,7];case 2:return"VariableDeclaration"!==o.type||-1===["const","let"].indexOf(o.kind)?[3,4]:[5,U(Be(o,t,{hoist:!0,onlyBlock:!0}))];case 3:return l.sent(),[3,6];case 4:return r?[3,6]:[5,U(We(o,t))];case 5:l.sent(),l.label=6;case 6:return c++,[3,1];case 7:if(a.length){for(c=a.length-1;c>-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function We(e,t){var i,n,r,s,a;return F(this,(function(o){switch(o.label){case 0:switch(e.type){case"VariableDeclaration":return[3,1];case"ForInStatement":case"ForOfStatement":return[3,3];case"ForStatement":return[3,5];case"WhileStatement":case"DoWhileStatement":return[3,7];case"IfStatement":return[3,9];case"BlockStatement":return[3,13];case"SwitchStatement":return[3,18];case"TryStatement":return[3,25]}return[3,38];case 1:return[5,U(Be(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,U(Be(e.left,t,{hoist:!0}))];case 4:o.sent(),o.label=5;case 5:return"ForStatement"!==e.type||"VariableDeclaration"!==e.init.type?[3,7]:[5,U(Be(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,U(We(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,U(We(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,U(We(e.alternate,t))]:[3,12];case 11:o.sent(),o.label=12;case 12:return[3,38];case 13:a=0,o.label=14;case 14:return a<e.body.length?[5,U(We(e.body[a],t))]:[3,17];case 15:o.sent(),o.label=16;case 16:return a++,[3,14];case 17:return[3,38];case 18:a=0,o.label=19;case 19:if(!(a<e.cases.length))return[3,24];i=0,o.label=20;case 20:return i<e.cases[a].consequent.length?[5,U(We(e.cases[a].consequent[i],t))]:[3,23];case 21:o.sent(),o.label=22;case 22:return i++,[3,20];case 23:return a++,[3,19];case 24:return[3,38];case 25:n=e.block.body,a=0,o.label=26;case 26:return a<n.length?[5,U(We(n[a],t))]:[3,29];case 27:o.sent(),o.label=28;case 28:return a++,[3,26];case 29:if(!(r=e.handler&&e.handler.body.body))return[3,33];a=0,o.label=30;case 30:return a<r.length?[5,U(We(r[a],t))]:[3,33];case 31:o.sent(),o.label=32;case 32:return a++,[3,30];case 33:if(!(s=e.finalizer&&e.finalizer.body))return[3,37];a=0,o.label=34;case 34:return a<s.length?[5,U(We(s[a],t))]:[3,37];case 35:o.sent(),o.label=36;case 36:return a++,[3,34];case 37:return[3,38];case 38:return[2]}}))}function Ye(e,t,i){return void 0===i&&(i={}),F(this,(function(n){switch(n.label){case 0:switch(e.type){case"ObjectPattern":return[3,1];case"ArrayPattern":return[3,3];case"RestElement":return[3,5];case"AssignmentPattern":return[3,7]}return[3,9];case 1:return[5,U(Oe(e,t,i))];case 2:case 4:case 6:case 8:return[2,n.sent()];case 3:return[5,U(Ne(e,t,i))];case 5:return[5,U(Me(e,t,i))];case 7:return[5,U(Le(e,t,i))];case 9:throw new SyntaxError("Unexpected token")}}))}function Ge(e,t,i){if(void 0===i&&(i={}),!e.generator&&!e.async)return et(e,t,i);var n,r=i.superClass,a=i.isCtor,o=e.params,c=function i(){var n,s,c,l,h,u=this&&this instanceof i?this.constructor:void 0,p=[];for(n=0;n<arguments.length;n++)p[n]=arguments[n];return F(this,(function(i){switch(i.label){case 0:s=new V(t,!0),"ArrowFunctionExpression"!==e.type&&(s.const("this",this),s.let("arguments",arguments),s.const(D,u),r&&(s.const(O,r),a&&s.let(N,!1))),c=0,i.label=1;case 1:return c<o.length?"Identifier"!==(l=o[c]).type?[3,2]:(s.var(l.name,p[c]),[3,6]):[3,7];case 2:return"RestElement"!==l.type?[3,4]:[5,U(Me(l,s,{kind:"var",feed:p.slice(c)}))];case 3:return i.sent(),[3,6];case 4:return[5,U(Ye(l,s,{feed:p[c]}))];case 5:i.sent(),i.label=6;case 6:return c++,[3,1];case 7:return"BlockStatement"!==e.body.type?[3,10]:[5,U(ze(e.body,s))];case 8:return i.sent(),[5,U(Ce(e.body,s,{invasived:!0,hoisted:!0}))];case 9:return h=i.sent(),[3,12];case 10:return[5,U(Re(e.body,s))];case 11:h=i.sent(),"ArrowFunctionExpression"===e.type&&(I.RES=h,h=I),i.label=12;case 12:return h===I?[2,h.RES]:[2]}}))};return n=e.async&&e.generator?function(){var e=c.apply(this,arguments),t=Promise.resolve(),i=!1,n=function(n){return t=t.then((function(){return qe(e,b({fullRet:!0},n))})).catch((function(e){if(!i)return i=!0,Promise.reject(e)}))},r={next:function(e){return n({res:e})},throw:function(e){return n({err:e})},return:function(e){return n({ret:e})}};return"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r}:e.async?function(){return qe(c.apply(this,arguments))}:c,s(n,M,{value:!0}),s(n,"name",{value:e.id&&e.id.name||"",configurable:!0}),s(n,"length",{value:o.length,configurable:!0}),n}function Je(e,t){var i,n,r,a,o;return F(this,(function(c){switch(c.label){case 0:return[5,U(Re(e.superClass,t))];case 1:for(i=c.sent(),n=function(){i&&i.apply(this)},r=e.body.body,a=0;a<r.length;a++)if("constructor"===(o=r[a]).kind){n=Ge(o.value,t,{superClass:i,isCtor:!0});break}return i&&y(n,i),[5,U(Ue(e.body,t,{klass:n,superClass:i}))];case 2:return c.sent(),s(n,L,{value:!0}),s(n,"name",{value:e.id&&e.id.name||"",configurable:!0}),[2,n]}}))}function Xe(e,t,i){var n,r,s,a;return F(this,(function(o){switch(o.label){case 0:return n=i.value,r=e.left,s=new V(t),"VariableDeclaration"!==r.type?[3,2]:[5,U(Be(r,s,{feed:n}))];case 1:return o.sent(),[3,6];case 2:return"Identifier"!==r.type?[3,4]:[5,U(z(r,t,{getVar:!0}))];case 3:return o.sent().set(n),[3,6];case 4:return[5,U(Ye(r,t,{feed:n}))];case 5:o.sent(),o.label=6;case 6:return"BlockStatement"!==e.body.type?[3,8]:[5,U(Ce(e.body,s,{invasived:!0}))];case 7:return a=o.sent(),[3,10];case 8:return[5,U(Re(e.body,s))];case 9:a=o.sent(),o.label=10;case 10:return[2,a]}}))}function Ke(e,t,i){void 0===i&&(i={});for(var n=i.onlyBlock,r=void 0!==n&&n,s=[],a=[],o=0;o<e.body.length;o++){var c=e.body[o];"FunctionDeclaration"===c.type?(s.push(c),a.push(o)):"VariableDeclaration"===c.type&&-1!==["const","let"].indexOf(c.kind)?de(c,t,{hoist:!0,onlyBlock:!0}):r||Qe(c,t)}if(a.length){for(o=a.length-1;o>-1;o--)e.body.splice(a[o],1);e.body=s.concat(e.body)}}function Qe(e,t){switch(e.type){case"VariableDeclaration":de(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&de(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&de(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":Qe(e.body,t);break;case"IfStatement":Qe(e.consequent,t),e.alternate&&Qe(e.alternate,t);break;case"BlockStatement":for(var i=0;i<e.body.length;i++)Qe(e.body[i],t);break;case"SwitchStatement":for(i=0;i<e.cases.length;i++)for(var n=0;n<e.cases[i].consequent.length;n++)Qe(e.cases[i].consequent[n],t);break;case"TryStatement":var r=e.block.body;for(i=0;i<r.length;i++)Qe(r[i],t);var s=e.handler&&e.handler.body.body;if(s)for(i=0;i<s.length;i++)Qe(s[i],t);var a=e.finalizer&&e.finalizer.body;if(a)for(i=0;i<a.length;i++)Qe(a[i],t)}}function Ze(e,t,i){switch(void 0===i&&(i={}),e.type){case"ObjectPattern":return re(e,t,i);case"ArrayPattern":return se(e,t,i);case"RestElement":return ae(e,t,i);case"AssignmentPattern":return oe(e,t,i);default:throw new SyntaxError("Unexpected token")}}function et(e,t,i){if(void 0===i&&(i={}),e.generator||e.async)return Ge(e,t,i);var n=i.superClass,r=i.isCtor,a=e.params,o=function i(){for(var s=this&&this instanceof i?this.constructor:void 0,o=[],c=0;c<arguments.length;c++)o[c]=arguments[c];var l,h=new V(t,!0);"ArrowFunctionExpression"!==e.type&&(h.const("this",this),h.let("arguments",arguments),h.const(D,s),n&&(h.const(O,n),r&&h.let(N,!1)));for(var u=0;u<a.length;u++){var p=a[u];"Identifier"===p.type?h.var(p.name,o[u]):"RestElement"===p.type?ae(p,h,{kind:"var",feed:o.slice(u)}):Ze(p,h,{feed:o[u]})}if("BlockStatement"===e.body.type?(Ke(e.body,h),l=ee(e.body,h,{invasived:!0,hoisted:!0})):(l=ue(e.body,h),"ArrowFunctionExpression"===e.type&&(I.RES=l,l=I)),l===I)return l.RES};return"ArrowFunctionExpression"===e.type&&s(o,M,{value:!0}),s(o,"name",{value:e.id&&e.id.name||"",configurable:!0}),s(o,"length",{value:a.length,configurable:!0}),o}function tt(e,t){for(var i=ue(e.superClass,t),n=function(){i&&i.apply(this)},r=e.body.body,a=0;a<r.length;a++){var o=r[a];if("constructor"===o.kind){n=et(o.value,t,{superClass:i,isCtor:!0});break}}return i&&y(n,i),ge(e.body,t,{klass:n,superClass:i}),s(n,L,{value:!0}),s(n,"name",{value:e.id&&e.id.name||"",configurable:!0}),n}function it(e,t,i){var n=i.value,r=e.left,s=new V(t);return"VariableDeclaration"===r.type?de(r,s,{feed:n}):"Identifier"===r.type?z(r,t,{getVar:!0}).set(n):Ze(r,t,{feed:n}),"BlockStatement"===e.body.type?ee(e.body,s,{invasived:!0}):ue(e.body,s)}return function(){function t(e){void 0===e&&(e={}),this.options={},this.scope=new V(null,!0),this.exports={};var t=e.ecmaVer,i=void 0===t?9:t,n=e.sandBox,r=void 0===n||n;if(-1===[3,5,6,7,8,9,10].indexOf(i-=i<2015?0:2009))throw new Error("unsupported ecmaVer");if(this.options.ecmaVersion=i,r){var s=function(){var e;return b(v(((e={})[E]=w,e)),S)}();this.scope.let("window",s),this.scope.let("this",s)}else this.scope.let("window",w),this.scope.let("this",w);this.scope.const("exports",this.exports={})}return t.prototype.import=function(e,t){var i;if("string"==typeof e&&((i={})[e]=t,e=i),"object"==typeof e)for(var n=l(e),r=0;r<n.length;r++){var s=n[r];this.scope.var(s,e[s])}},t.prototype.parse=function(t,i){return"function"==typeof i?i(t,b({},this.options)):e.parse(t,this.options)},t.prototype.run=function(t){var i="string"==typeof t?e.parse(t,this.options):t;Ke(i,this.scope),ue(i,this.scope)},t.version="0.4.8",t}()}(i(94))},94:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Node:()=>ie,Parser:()=>B,Position:()=>L,SourceLocation:()=>D,TokContext:()=>se,Token:()=>Ie,TokenType:()=>g,defaultOptions:()=>R,getLineInfo:()=>$,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>_,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Me,parseExpressionAt:()=>Le,tokContexts:()=>ae,tokTypes:()=>S,tokenizer:()=>De,version:()=>Ne});var n={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",s={5:r,"5module":r+" export import",6:r+" const class extends export import super"},a=/^in(stanceof)?$/,o="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-Ᶎꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭧꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",c="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",l=new RegExp("["+o+"]"),h=new RegExp("["+o+c+"]");o=c=null;var u=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],p=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];function d(e,t){for(var i=65536,n=0;n<t.length;n+=2){if((i+=t[n])>e)return!1;if((i+=t[n+1])>=e)return!0}}function f(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&d(e,u)))}function m(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&h.test(String.fromCharCode(e)):!1!==t&&(d(e,u)||d(e,p)))))}var g=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function v(e,t){return new g(e,{beforeExpr:!0,binop:t})}var y={beforeExpr:!0},b={startsExpr:!0},x={};function w(e,t){return void 0===t&&(t={}),t.keyword=e,x[e]=new g(e,t)}var S={num:new g("num",b),regexp:new g("regexp",b),string:new g("string",b),name:new g("name",b),eof:new g("eof"),bracketL:new g("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new g("]"),braceL:new g("{",{beforeExpr:!0,startsExpr:!0}),braceR:new g("}"),parenL:new g("(",{beforeExpr:!0,startsExpr:!0}),parenR:new g(")"),comma:new g(",",y),semi:new g(";",y),colon:new g(":",y),dot:new g("."),question:new g("?",y),arrow:new g("=>",y),template:new g("template"),invalidTemplate:new g("invalidTemplate"),ellipsis:new g("...",y),backQuote:new g("`",b),dollarBraceL:new g("${",{beforeExpr:!0,startsExpr:!0}),eq:new g("=",{beforeExpr:!0,isAssign:!0}),assign:new g("_=",{beforeExpr:!0,isAssign:!0}),incDec:new g("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new g("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:v("||",1),logicalAND:v("&&",2),bitwiseOR:v("|",3),bitwiseXOR:v("^",4),bitwiseAND:v("&",5),equality:v("==/!=/===/!==",6),relational:v("</>/<=/>=",7),bitShift:v("<</>>/>>>",8),plusMin:new g("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new g("**",{beforeExpr:!0}),_break:w("break"),_case:w("case",y),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",y),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",y),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",b),_if:w("if"),_return:w("return",y),_switch:w("switch"),_throw:w("throw",y),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",b),_super:w("super",b),_class:w("class",b),_extends:w("extends",y),_export:w("export"),_import:w("import",b),_null:w("null",b),_true:w("true",b),_false:w("false",b),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},_=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(_.source,"g");function E(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var A=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,C=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=Object.prototype,T=I.hasOwnProperty,P=I.toString;function O(e,t){return T.call(e,t)}var N=Array.isArray||function(e){return"[object Array]"===P.call(e)};function M(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var L=function(e,t){this.line=e,this.column=t};L.prototype.offset=function(e){return new L(this.line,this.column+e)};var D=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function $(e,t){for(var i=1,n=0;;){k.lastIndex=n;var r=k.exec(e);if(!(r&&r.index<t))return new L(i,t-n);++i,n=r.index+r[0].length}}var R={ecmaVersion:9,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function j(e,t){return 2|(e?4:0)|(t?8:0)}var B=function(e,t,i){this.options=e=function(e){var t={};for(var i in R)t[i]=e&&O(e,i)?e[i]:R[i];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),N(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return N(t.onComment)&&(t.onComment=function(e,t){return function(i,n,r,s,a,o){var c={type:i?"Block":"Line",value:n,start:r,end:s};e.locations&&(c.loc=new D(this,a,o)),e.ranges&&(c.range=[r,s]),t.push(c)}}(t,t.onComment)),t}(e),this.sourceFile=e.sourceFile,this.keywords=M(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var a=e.ecmaVersion;!(r=n[a]);a--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=M(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=M(o),this.reservedWordsStrictBind=M(o+" "+n.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(_).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=S.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},V={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};B.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},V.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},V.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},V.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},V.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},V.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},V.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},B.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},B.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n<e.length;n++)i=e[n](i);return i},B.parse=function(e,t){return new this(t,e).parse()},B.parseExpressionAt=function(e,t,i){var n=new this(i,e,t);return n.nextToken(),n.parseExpression()},B.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(B.prototype,V);var F=B.prototype,U=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function H(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}F.strictDirective=function(e){for(;;){C.lastIndex=e,e+=C.exec(this.input)[0].length;var t=U.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2]))return!0;e+=t[0].length,C.lastIndex=e,e+=C.exec(this.input)[0].length,";"===this.input[e]&&e++}},F.eat=function(e){return this.type===e&&(this.next(),!0)},F.isContextual=function(e){return this.type===S.name&&this.value===e&&!this.containsEsc},F.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},F.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},F.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||_.test(this.input.slice(this.lastTokEnd,this.start))},F.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},F.semicolon=function(){this.eat(S.semi)||this.insertSemicolon()||this.unexpected()},F.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},F.expect=function(e){this.eat(e)||this.unexpected()},F.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},F.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},F.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},F.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},F.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var q=B.prototype;q.parseTopLevel=function(e){var t={};for(e.body||(e.body=[]);this.type!==S.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,r=Object.keys(this.undefinedExports);n<r.length;n+=1){var s=r[n];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var z={kind:"loop"},W={kind:"switch"};q.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;C.lastIndex=this.pos;var t=C.exec(this.input),i=this.pos+t[0].length,n=this.input.charCodeAt(i);if(91===n)return!0;if(e)return!1;if(123===n)return!0;if(f(n,!0)){for(var r=i+1;m(this.input.charCodeAt(r),!0);)++r;var s=this.input.slice(i,r);if(!a.test(s))return!0}return!1},q.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;C.lastIndex=this.pos;var e=C.exec(this.input),t=this.pos+e[0].length;return!(_.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&m(this.input.charAt(t+8)))},q.parseStatement=function(e,t,i){var n,r=this.type,s=this.startNode();switch(this.isLet(e)&&(r=S._var,n="let"),r){case S._break:case S._continue:return this.parseBreakContinueStatement(s,r.keyword);case S._debugger:return this.parseDebuggerStatement(s);case S._do:return this.parseDoStatement(s);case S._for:return this.parseForStatement(s);case S._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case S._class:return e&&this.unexpected(),this.parseClass(s,!0);case S._if:return this.parseIfStatement(s);case S._return:return this.parseReturnStatement(s);case S._switch:return this.parseSwitchStatement(s);case S._throw:return this.parseThrowStatement(s);case S._try:return this.parseTryStatement(s);case S._const:case S._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case S._while:return this.parseWhileStatement(s);case S._with:return this.parseWithStatement(s);case S.braceL:return this.parseBlock(!0,s);case S.semi:return this.parseEmptyStatement(s);case S._export:case S._import:if(this.options.ecmaVersion>10&&r===S._import){C.lastIndex=this.pos;var a=C.exec(this.input),o=this.pos+a[0].length;if(40===this.input.charCodeAt(o))return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===S._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var c=this.value,l=this.parseExpression();return r===S.name&&"Identifier"===l.type&&this.eat(S.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}},q.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(S.semi)||this.insertSemicolon()?e.label=null:this.type!==S.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var r=this.labels[n];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(i||"loop"===r.kind))break;if(e.label&&i)break}}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},q.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},q.parseDoStatement=function(e){return this.next(),this.labels.push(z),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(S._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(S.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},q.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(z),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===S._var||this.type===S._const||i){var n=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===S._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}var s=new H,a=this.parseExpression(!0,s);return this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===S._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(a,!1,s),this.checkLVal(a),this.parseForIn(e,a)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,a))},q.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,G|(i?0:J),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(S._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},q.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(S.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},q.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(W),this.enterScope(0);for(var i=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var n=this.type===S._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(S.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},q.parseThrowStatement=function(e){return this.next(),_.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Y=[];q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===S._catch){var t=this.startNode();if(this.next(),this.eat(S.parenL)){t.param=this.parseBindingAtom();var i="Identifier"===t.param.type;this.enterScope(i?32:0),this.checkLVal(t.param,i?4:2),this.expect(S.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(S._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},q.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},q.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(z),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},q.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},q.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},q.parseLabeledStatement=function(e,t,i,n){for(var r=0,s=this.labels;r<s.length;r+=1)s[r].name===t&&this.raise(i.start,"Label '"+t+"' is already declared");for(var a=this.type.isLoop?"loop":this.type===S._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var c=this.labels[o];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},q.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},q.parseBlock=function(e,t){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(S.braceL),e&&this.enterScope(0);!this.eat(S.braceR);){var i=this.parseStatement(null);t.body.push(i)}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},q.parseFor=function(e,t){return e.init=t,this.expect(S.semi),e.test=this.type===S.semi?null:this.parseExpression(),this.expect(S.semi),e.update=this.type===S.parenR?null:this.parseExpression(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},q.parseForIn=function(e,t){var i=this.type===S._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},q.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(S.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===S._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(S.comma))break}return e},q.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var G=1,J=2;q.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===S.star&&t&J&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&G&&(e.id=4&t&&this.type!==S.name?null:this.parseIdent(),!e.id||t&J||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(j(e.async,e.generator)),t&G||(e.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,t&G?"FunctionDeclaration":"FunctionExpression")},q.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},q.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),r=!1;for(n.body=[],this.expect(S.braceL);!this.eat(S.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(n.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(r&&this.raise(s.start,"Duplicate constructor in the same class"),r=!0))}return e.body=this.finishNode(n,"ClassBody"),this.strict=i,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},q.parseClassElement=function(e){var t=this;if(this.eat(S.semi))return null;var i=this.startNode(),n=function(e,n){void 0===n&&(n=!1);var r=t.start,s=t.startLoc;return!(!t.eatContextual(e)||(t.type===S.parenL||n&&t.canInsertSemicolon())&&(i.key&&t.unexpected(),i.computed=!1,i.key=t.startNodeAt(r,s),i.key.name=e,t.finishNode(i.key,"Identifier"),1))};i.kind="method",i.static=n("static");var r=this.eat(S.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(S.star)):n("get")?i.kind="get":n("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var a=i.key,o=!1;return i.computed||i.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?i.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==i.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),r&&this.raise(a.start,"Constructor can't be a generator"),s&&this.raise(a.start,"Constructor can't be an async method"),i.kind="constructor",o=e),this.parseClassMethod(i,r,s,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},q.parseClassMethod=function(e,t,i,n){return e.value=this.parseMethod(t,i,n),this.finishNode(e,"MethodDefinition")},q.parseClassId=function(e,t){this.type===S.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},q.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts():null},q.parseExport=function(e,t){if(this.next(),this.eat(S.star))return this.expectContextual("from"),this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(S._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===S._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|G,!1,i)}else if(this.type===S._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s<a.length;s+=1){var o=a[s];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},q.checkExport=function(e,t,i){e&&(O(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},q.checkPatternExport=function(e,t){var i=t.type;if("Identifier"===i)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===i)for(var n=0,r=t.properties;n<r.length;n+=1){var s=r[n];this.checkPatternExport(e,s)}else if("ArrayPattern"===i)for(var a=0,o=t.elements;a<o.length;a+=1){var c=o[a];c&&this.checkPatternExport(e,c)}else"Property"===i?this.checkPatternExport(e,t.value):"AssignmentPattern"===i?this.checkPatternExport(e,t.left):"RestElement"===i?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===i&&this.checkPatternExport(e,t.expression)},q.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var r=n[i];this.checkPatternExport(e,r.id)}},q.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},q.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(S.braceL);!this.eat(S.braceR);){if(i)i=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var n=this.startNode();n.local=this.parseIdent(!0),n.exported=this.eatContextual("as")?this.parseIdent(!0):n.local,this.checkExport(e,n.exported.name,n.exported.start),t.push(this.finishNode(n,"ExportSpecifier"))}return t},q.parseImport=function(e){return this.next(),this.type===S.string?(e.specifiers=Y,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===S.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},q.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===S.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLVal(i.local,2),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(S.comma))return e}if(this.type===S.star){var n=this.startNode();return this.next(),this.expectContextual("as"),n.local=this.parseIdent(),this.checkLVal(n.local,2),e.push(this.finishNode(n,"ImportNamespaceSpecifier")),e}for(this.expect(S.braceL);!this.eat(S.braceR);){if(t)t=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var r=this.startNode();r.imported=this.parseIdent(!0),this.eatContextual("as")?r.local=this.parseIdent():(this.checkUnreserved(r.imported),r.local=r.imported),this.checkLVal(r.local,2),e.push(this.finishNode(r,"ImportSpecifier"))}return e},q.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},q.isDirectiveCandidate=function(e){return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var X=B.prototype;X.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,r=e.properties;n<r.length;n+=1){var s=r[n];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},X.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var r=e[n];r&&this.toAssignable(r,t)}if(i){var s=e[i-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},X.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},X.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==S.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},X.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case S.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(S.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case S.braceL:return this.parseObj(!0)}return this.parseIdent()},X.parseBindingList=function(e,t,i){for(var n=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(S.comma),t&&this.type===S.comma)n.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===S.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),n.push(s),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),n.push(a)}return n},X.parseBindingListItem=function(e){return e},X.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(S.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},X.checkLVal=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"Identifier":2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(O(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),0!==t&&5!==t&&this.declareName(e.name,t,e.start);break;case"MemberExpression":t&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ObjectPattern":for(var n=0,r=e.properties;n<r.length;n+=1){var s=r[n];this.checkLVal(s,t,i)}break;case"Property":this.checkLVal(e.value,t,i);break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var c=o[a];c&&this.checkLVal(c,t,i)}break;case"AssignmentPattern":this.checkLVal(e.left,t,i);break;case"RestElement":this.checkLVal(e.argument,t,i);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,i);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var K=B.prototype;K.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,r=e.key;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===s&&(t.proto&&(i&&i.doubleProto<0?i.doubleProto=r.start:this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var a=t[n="$"+n];a?("init"===s?this.strict&&a.init||a.get||a.set:a.init||a[s])&&this.raiseRecoverable(r.start,"Redefinition of property"):a=t[n]={init:!1,get:!1,set:!1},a[s]=!0}}},K.parseExpression=function(e,t){var i=this.start,n=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===S.comma){var s=this.startNodeAt(i,n);for(s.expressions=[r];this.eat(S.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return r},K.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,r=-1,s=-1,a=-1;t?(r=t.parenthesizedAssign,s=t.trailingComma,a=t.shorthandAssign,t.parenthesizedAssign=t.trailingComma=t.shorthandAssign=-1):(t=new H,n=!0);var o=this.start,c=this.startLoc;this.type!==S.parenL&&this.type!==S.name||(this.potentialArrowAt=this.start);var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,o,c)),this.type.isAssign){var h=this.startNodeAt(o,c);return h.operator=this.value,h.left=this.type===S.eq?this.toAssignable(l,!1,t):l,n||H.call(t),t.shorthandAssign=-1,this.checkLVal(l),this.next(),h.right=this.parseMaybeAssign(e),this.finishNode(h,"AssignmentExpression")}return n&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),s>-1&&(t.trailingComma=s),a>-1&&(t.shorthandAssign=a),l},K.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(S.question)){var s=this.startNodeAt(i,n);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect(S.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return r},K.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,r=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||r.start===i&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,i,n,-1,e)},K.parseExprOp=function(e,t,i,n,r){var s=this.type.binop;if(null!=s&&(!r||this.type!==S._in)&&s>n){var a=this.type===S.logicalOR||this.type===S.logicalAND,o=this.value;this.next();var c=this.start,l=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1),c,l,s,r),u=this.buildBinary(t,i,e,h,o,a);return this.parseExprOp(u,t,i,n,r)}return e},K.buildBinary=function(e,t,i,n,r,s){var a=this.startNodeAt(e,t);return a.left=i,a.operator=r,a.right=n,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")},K.parseMaybeUnary=function(e,t){var i,n=this.start,r=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),t=!0;else if(this.type.prefix){var s=this.startNode(),a=this.type===S.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),a?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):t=!0,i=this.finishNode(s,a?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(n,r);o.operator=this.value,o.prefix=!1,o.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(o,"UpdateExpression")}}return!t&&this.eat(S.starstar)?this.buildBinary(n,r,i,this.parseMaybeUnary(null,!1),"**",!1):i},K.parseExprSubscripts=function(e){var t=this.start,i=this.startLoc,n=this.parseExprAtom(e),r="ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(e)||r)return n;var s=this.parseSubscripts(n,t,i);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1)),s},K.parseSubscripts=function(e,t,i,n){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(e.start,e.end);;){var s=this.parseSubscript(e,t,i,n,r);if(s===e||"ArrowFunctionExpression"===s.type)return s;e=s}},K.parseSubscript=function(e,t,i,n,r){var s=this.eat(S.bracketL);if(s||this.eat(S.dot)){var a=this.startNodeAt(t,i);a.object=e,a.property=s?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),a.computed=!!s,s&&this.expect(S.bracketR),e=this.finishNode(a,"MemberExpression")}else if(!n&&this.eat(S.parenL)){var o=new H,c=this.yieldPos,l=this.awaitPos,h=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var u=this.parseExprList(S.parenR,this.options.ecmaVersion>=8&&"Import"!==e.type,!1,o);if(r&&!this.canInsertSemicolon()&&this.eat(S.arrow))return this.checkPatternErrors(o,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=c,this.awaitPos=l,this.awaitIdentPos=h,this.parseArrowExpression(this.startNodeAt(t,i),u,!0);this.checkExpressionErrors(o,!0),this.yieldPos=c||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=h||this.awaitIdentPos;var p=this.startNodeAt(t,i);if(p.callee=e,p.arguments=u,"Import"===p.callee.type){1!==p.arguments.length&&this.raise(p.start,"import() requires exactly one argument");var d=p.arguments[0];d&&"SpreadElement"===d.type&&this.raise(d.start,"... is not allowed in import()")}e=this.finishNode(p,"CallExpression")}else if(this.type===S.backQuote){var f=this.startNodeAt(t,i);f.tag=e,f.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(f,"TaggedTemplateExpression")}return e},K.parseExprAtom=function(e){this.type===S.slash&&this.readRegexp();var t,i=this.potentialArrowAt===this.start;switch(this.type){case S._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),t=this.startNode(),this.next(),this.type!==S.parenL||this.allowDirectSuper||this.raise(t.start,"super() call outside constructor of a subclass"),this.type!==S.dot&&this.type!==S.bracketL&&this.type!==S.parenL&&this.unexpected(),this.finishNode(t,"Super");case S._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case S.name:var n=this.start,r=this.startLoc,s=this.containsEsc,a=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(S._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===S.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(S.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0)}return a;case S.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return(t=this.startNode()).value=this.type===S._null?null:this.type===S._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case S.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(i);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case S.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(S.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case S.braceL:return this.parseObj(!1,e);case S._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case S._class:return this.parseClass(this.startNode(),!1);case S._new:return this.parseNew();case S.backQuote:return this.parseTemplate();case S._import:return this.options.ecmaVersion>10?this.parseDynamicImport():this.unexpected();default:this.unexpected()}},K.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==S.parenL&&this.unexpected(),this.finishNode(e,"Import")},K.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1)),this.next(),this.finishNode(t,"Literal")},K.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},K.parseParenAndDistinguishExpression=function(e){var t,i=this.start,n=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,a=this.start,o=this.startLoc,c=[],l=!0,h=!1,u=new H,p=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;){if(l?l=!1:this.expect(S.comma),r&&this.afterTrailingComma(S.parenR,!0)){h=!0;break}if(this.type===S.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(S.parenR),e&&!this.canInsertSemicolon()&&this.eat(S.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(i,n,c);c.length&&!h||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(u,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,c.length>1?((t=this.startNodeAt(a,o)).expressions=c,this.finishNodeAt(t,"SequenceExpression",f,m)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(i,n);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},K.parseParenItem=function(e){return e},K.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Q=[];K.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(S.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||i)&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty")}var n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0),this.options.ecmaVersion>10&&"Import"===e.callee.type&&this.raise(e.callee.start,"Cannot use new with import(...)"),this.eat(S.parenL)?e.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8&&"Import"!==e.callee.type,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},K.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===S.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===S.backQuote,this.finishNode(i,"TemplateElement")},K.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(S.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},K.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===S.name||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===S.star)&&!_.test(this.input.slice(this.lastTokEnd,this.start))},K.parseObj=function(e,t){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(S.braceR);){if(n)n=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},K.parseProperty=function(e,t){var i,n,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===S.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===S.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(r=this.start,s=this.startLoc),e||(i=this.eat(S.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(a)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},K.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===S.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,n);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===S.comma||this.type===S.braceR)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,s,e.key):this.type===S.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(i||n)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c="get"===e.kind?0:1;if(e.value.params.length!==c){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},K.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(S.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(S.bracketR),e.key;e.computed=!1}return e.key=this.type===S.num||this.type===S.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},K.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},K.parseMethod=function(e,t,i){var n=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|j(t,n.generator)|(i?128:0)),this.expect(S.parenL),n.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(n,"FunctionExpression")},K.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|j(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},K.parseFunctionBody=function(e,t,i){var n=t&&this.type!==S.braceL,r=this.strict,s=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!a||(s=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!r&&!s&&!t&&!i&&this.isSimpleParamList(e.params)),e.body=this.parseBlock(!1),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope(),this.strict&&e.id&&this.checkLVal(e.id,5),this.strict=r},K.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1)if("Identifier"!==i[t].type)return!1;return!0},K.checkParams=function(e,t){for(var i={},n=0,r=e.params;n<r.length;n+=1){var s=r[n];this.checkLVal(s,1,t?null:i)}},K.parseExprList=function(e,t,i,n){for(var r=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(S.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===S.comma?a=null:this.type===S.ellipsis?(a=this.parseSpread(n),n&&this.type===S.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):a=this.parseMaybeAssign(!1,n),r.push(a)}return r},K.checkUnreserved=function(e){var t=e.start,i=e.end,n=e.name;this.inGenerator&&"yield"===n&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===n&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,i).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(n)&&(this.inAsync||"await"!==n||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))},K.parseIdent=function(e,t){var i=this.startNode();return this.type===S.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(),this.finishNode(i,"Identifier"),e||(this.checkUnreserved(i),"await"!==i.name||this.awaitIdentPos||(this.awaitIdentPos=i.start)),i},K.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===S.semi||this.canInsertSemicolon()||this.type!==S.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(S.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},K.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0),this.finishNode(e,"AwaitExpression")};var Z=B.prototype;Z.raise=function(e,t){var i=$(this.input,e);t+=" ("+i.line+":"+i.column+")";var n=new SyntaxError(t);throw n.pos=e,n.loc=i,n.raisedAt=this.pos,n},Z.raiseRecoverable=Z.raise,Z.curPosition=function(){if(this.options.locations)return new L(this.curLine,this.pos-this.lineStart)};var ee=B.prototype,te=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};ee.enterScope=function(e){this.scopeStack.push(new te(e))},ee.exitScope=function(){this.scopeStack.pop()},ee.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},ee.declareName=function(e,t,i){var n=!1;if(2===t){var r=this.currentScope();n=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var s=this.currentScope();n=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){n=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}n&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},ee.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ee.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ee.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},ee.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var ie=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},ne=B.prototype;function re(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}ne.startNode=function(){return new ie(this,this.start,this.startLoc)},ne.startNodeAt=function(e,t){return new ie(this,e,t)},ne.finishNode=function(e,t){return re.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},ne.finishNodeAt=function(e,t,i,n){return re.call(this,e,t,i,n)};var se=function(e,t,i,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!r},ae={b_stat:new se("{",!1),b_expr:new se("{",!0),b_tmpl:new se("${",!1),p_stat:new se("(",!1),p_expr:new se("(",!0),q_tmpl:new se("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new se("function",!1),f_expr:new se("function",!0),f_expr_gen:new se("function",!0,!1,null,!0),f_gen:new se("function",!1,!1,null,!0)},oe=B.prototype;oe.initialContext=function(){return[ae.b_stat]},oe.braceIsBlock=function(e){var t=this.curContext();return t===ae.f_expr||t===ae.f_stat||(e!==S.colon||t!==ae.b_stat&&t!==ae.b_expr?e===S._return||e===S.name&&this.exprAllowed?_.test(this.input.slice(this.lastTokEnd,this.start)):e===S._else||e===S.semi||e===S.eof||e===S.parenR||e===S.arrow||(e===S.braceL?t===ae.b_stat:e!==S._var&&e!==S._const&&e!==S.name&&!this.exprAllowed):!t.isExpr)},oe.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},oe.updateContext=function(e){var t,i=this.type;i.keyword&&e===S.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},S.parenR.updateContext=S.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ae.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},S.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ae.b_stat:ae.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(ae.b_tmpl),this.exprAllowed=!0},S.parenL.updateContext=function(e){var t=e===S._if||e===S._for||e===S._with||e===S._while;this.context.push(t?ae.p_stat:ae.p_expr),this.exprAllowed=!0},S.incDec.updateContext=function(){},S._function.updateContext=S._class.updateContext=function(e){!e.beforeExpr||e===S.semi||e===S._else||e===S._return&&_.test(this.input.slice(this.lastTokEnd,this.start))||(e===S.colon||e===S.braceL)&&this.curContext()===ae.b_stat?this.context.push(ae.f_stat):this.context.push(ae.f_expr),this.exprAllowed=!1},S.backQuote.updateContext=function(){this.curContext()===ae.q_tmpl?this.context.pop():this.context.push(ae.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===ae.f_expr?this.context[t]=ae.f_expr_gen:this.context[t]=ae.f_gen}this.exprAllowed=!0},S.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==S.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ce="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",le=ce+" Extended_Pictographic",he={9:ce,10:le,11:le},ue="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",pe="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",de=pe+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",fe={9:pe,10:de,11:de+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},me={};function ge(e){var t=me[e]={binary:M(he[e]+" "+ue),nonBinary:{General_Category:M(ue),Script:M(fe[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}ge(9),ge(10),ge(11);var ve=B.prototype,ye=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=me[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function be(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function xe(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function we(e){return e>=65&&e<=90||e>=97&&e<=122}function Se(e){return we(e)||95===e}function _e(e){return Se(e)||ke(e)}function ke(e){return e>=48&&e<=57}function Ee(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ae(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ce(e){return e>=48&&e<=55}ye.prototype.reset=function(e,t,i){var n=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},ye.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},ye.prototype.at=function(e){var t=this.source,i=t.length;if(e>=i)return-1;var n=t.charCodeAt(e);if(!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=t.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},ye.prototype.nextIndex=function(e){var t=this.source,i=t.length;if(e>=i)return i;var n,r=t.charCodeAt(e);return!this.switchU||r<=55295||r>=57344||e+1>=i||(n=t.charCodeAt(e+1))<56320||n>57343?e+1:e+2},ye.prototype.current=function(){return this.at(this.pos)},ye.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},ye.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},ye.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ve.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n<i.length;n++){var r=i.charAt(n);-1===t.indexOf(r)&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(r,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}},ve.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ve.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var n=i[t];-1===e.groupNames.indexOf(n)&&e.raise("Invalid named capture referenced")}},ve.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},ve.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},ve.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},ve.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},ve.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ve.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ve.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var n=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},ve.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},ve.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},ve.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1},ve.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},ve.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},ve.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ve.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!xe(t)&&(e.lastIntValue=t,e.advance(),!0)},ve.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!xe(i);)e.advance();return e.pos!==t},ve.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},ve.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},ve.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},ve.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=be(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=be(e.lastIntValue);return!0}return!1},ve.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ve.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return m(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ve.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},ve.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},ve.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},ve.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},ve.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ve.regexp_eatZero=function(e){return 48===e.current()&&!ke(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ve.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},ve.regexp_eatControlLetter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ve.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t,i=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(e.switchU&&n>=55296&&n<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=1024*(n-55296)+(s-56320)+65536,!0}e.pos=r,e.lastIntValue=n}return!0}if(e.switchU&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&(t=e.lastIntValue)>=0&&t<=1114111)return!0;e.switchU&&e.raise("Invalid unicode escape"),e.pos=i}return!1},ve.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},ve.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},ve.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},ve.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},ve.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){O(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},ve.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ve.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=be(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";_e(t=e.current());)e.lastStringValue+=be(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ve.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},ve.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},ve.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||Ce(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},ve.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},ve.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!ke(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},ve.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},ve.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ke(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},ve.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ee(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ae(i),e.advance();return e.pos!==t},ve.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},ve.regexp_eatOctalDigit=function(e){var t=e.current();return Ce(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ve.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var r=e.current();if(!Ee(r))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Ae(r),e.advance()}return!0};var Ie=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new D(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Te=B.prototype;function Pe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}Te.next=function(){this.options.onToken&&this.options.onToken(new Ie(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Te.getToken=function(){return this.next(),new Ie(this)},"undefined"!=typeof Symbol&&(Te[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Te.curContext=function(){return this.context[this.context.length-1]},Te.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(S.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Te.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Te.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Te.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),i=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(k.lastIndex=i;(e=k.exec(this.input))&&e.index<this.pos;)++this.curLine,this.lineStart=e.index+e[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(i+2,n),i,this.pos,t,this.curPosition())},Te.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!E(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},Te.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Te.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},Te.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))},Te.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(S.assign,2):this.finishOp(S.slash,1)},Te.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?S.star:S.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=S.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(S.assign,i+1):this.finishOp(n,i)},Te.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?S.logicalOR:S.logicalAND,2):61===t?this.finishOp(S.assign,2):this.finishOp(124===e?S.bitwiseOR:S.bitwiseAND,1)},Te.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Te.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!_.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(S.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)},Te.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(S.assign,i+1):this.finishOp(S.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(S.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Te.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(S.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(61===e?S.eq:S.prefix,1)},Te.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(S.parenL);case 41:return++this.pos,this.finishToken(S.parenR);case 59:return++this.pos,this.finishToken(S.semi);case 44:return++this.pos,this.finishToken(S.comma);case 91:return++this.pos,this.finishToken(S.bracketL);case 93:return++this.pos,this.finishToken(S.bracketR);case 123:return++this.pos,this.finishToken(S.braceL);case 125:return++this.pos,this.finishToken(S.braceR);case 58:return++this.pos,this.finishToken(S.colon);case 63:return++this.pos,this.finishToken(S.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(S.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(S.prefix,1)}this.raise(this.pos,"Unexpected character '"+Pe(e)+"'")},Te.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Te.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(_.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new ye(this));o.reset(i,r,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(r,a)}catch(e){}return this.finishToken(S.regexp,{pattern:r,flags:a,value:c})},Te.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r<s;++r){var a,o=this.input.charCodeAt(this.pos);if((a=o>=97?o-97+10:o>=65?o-65+10:o>=48&&o<=57?o-48:1/0)>=e)break;++this.pos,n=n*e+a}return this.pos===i||null!=t&&this.pos-i!==t?null:n},Te.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i="undefined"!=typeof BigInt?BigInt(this.input.slice(t,this.pos)):null,++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,i)},Te.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number"),i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1);var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){var r=this.input.slice(t,this.pos),s="undefined"!=typeof BigInt?BigInt(r):null;return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,s)}46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=this.input.slice(t,this.pos),o=i?parseInt(a,8):parseFloat(a);return this.finishToken(S.num,o)},Te.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Te.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(S.string,t)};var Oe={};Te.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Oe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Te.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Oe;this.raise(e,t)},Te.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==S.template&&this.type!==S.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(S.template,e)):36===i?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Te.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(S.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},Te.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Pe(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return E(t)?"":String.fromCharCode(t)}},Te.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Te.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(m(r,n))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(i,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?f:m)(a,n)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=Pe(a),i=this.pos}t=!1}return e+this.input.slice(i,this.pos)},Te.readWord=function(){var e=this.readWord1(),t=S.name;return this.keywords.test(e)&&(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+e),t=x[e]),this.finishToken(t,e)};var Ne="6.4.2";function Me(e,t){return B.parse(e,t)}function Le(e,t,i){return B.parseExpressionAt(e,t,i)}function De(e,t){return B.tokenizer(e,t)}B.acorn={Parser:B,version:Ne,defaultOptions:R,Position:L,SourceLocation:D,getLineInfo:$,Node:ie,TokenType:g,tokTypes:S,keywordTypes:x,TokContext:se,tokContexts:ae,isIdentifierChar:m,isIdentifierStart:f,Token:Ie,isNewLine:E,lineBreak:_,lineBreakG:k,nonASCIIwhitespace:A}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const e=window,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;class s{constructor(e,t,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const i=this.t;if(t&&void 0===e){const t=void 0!==i&&1===i.length;t&&(e=r.get(i)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(i,e))}return e}toString(){return this.cssText}}const a=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[n+1]),e[0]);return new s(i,e,n)},o=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,n))(t)})(e):e
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/;var c;const l=window,h=l.trustedTypes,u=h?h.emptyScript:"",p=l.reactiveElementPolyfillSupport,d={toAttribute(e,t){switch(t){case Boolean:e=e?u:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},f=(e,t)=>t!==e&&(t==t||e==e),m={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f};class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=m){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||m}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(o(e))}else void 0!==e&&t.push(o(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var i;const n=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,n)=>{t?i.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):n.forEach((t=>{const n=document.createElement("style"),r=e.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=t.cssText,i.appendChild(n)}))})(n,this.constructor.elementStyles),n}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=m){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:d).toAttribute(t,i.type);this._$El=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:d;this._$El=r,this[r]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||f)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/var v;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:g}),(null!==(c=l.reactiveElementVersions)&&void 0!==c?c:l.reactiveElementVersions=[]).push("1.4.2");const y=window,b=y.trustedTypes,x=b?b.createPolicy("lit-html",{createHTML:e=>e}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,S="?"+w,_=`<${S}>`,k=document,E=(e="")=>k.createComment(e),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,C=Array.isArray,I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,P=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),N=/'/g,M=/"/g,L=/^(?:script|style|textarea|title)$/i,D=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),$=D(1),R=(D(2),Symbol.for("lit-noChange")),j=Symbol.for("lit-nothing"),B=new WeakMap,V=k.createTreeWalker(k,129,null,!1);class F{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,s=0;const a=e.length-1,o=this.parts,[c,l]=((e,t)=>{const i=e.length-1,n=[];let r,s=2===t?"<svg>":"",a=I;for(let t=0;t<i;t++){const i=e[t];let o,c,l=-1,h=0;for(;h<i.length&&(a.lastIndex=h,c=a.exec(i),null!==c);)h=a.lastIndex,a===I?"!--"===c[1]?a=T:void 0!==c[1]?a=P:void 0!==c[2]?(L.test(c[2])&&(r=RegExp("</"+c[2],"g")),a=O):void 0!==c[3]&&(a=O):a===O?">"===c[0]?(a=null!=r?r:I,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?O:'"'===c[3]?M:N):a===M||a===N?a=O:a===T||a===P?a=I:(a=O,r=void 0);const u=a===O&&e[t+1].startsWith("/>")?" ":"";s+=a===I?i+_:l>=0?(n.push(o),i.slice(0,l)+"$lit$"+i.slice(l)+w+u):i+w+(-2===l?(n.push(void 0),t):u)}const o=s+(e[i]||"<?>")+(2===t?"</svg>":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,n]})(e,t);if(this.el=F.createElement(c,i),V.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=V.nextNode())&&o.length<a;){if(1===n.nodeType){if(n.hasAttributes()){const e=[];for(const t of n.getAttributeNames())if(t.endsWith("$lit$")||t.startsWith(w)){const i=l[s++];if(e.push(t),void 0!==i){const e=n.getAttribute(i.toLowerCase()+"$lit$").split(w),t=/([.?@])?(.*)/.exec(i);o.push({type:1,index:r,name:t[2],strings:e,ctor:"."===t[1]?W:"?"===t[1]?G:"@"===t[1]?J:z})}else o.push({type:6,index:r})}for(const t of e)n.removeAttribute(t)}if(L.test(n.tagName)){const e=n.textContent.split(w),t=e.length-1;if(t>0){n.textContent=b?b.emptyScript:"";for(let i=0;i<t;i++)n.append(e[i],E()),V.nextNode(),o.push({type:2,index:++r});n.append(e[t],E())}}}else if(8===n.nodeType)if(n.data===S)o.push({type:2,index:r});else{let e=-1;for(;-1!==(e=n.data.indexOf(w,e+1));)o.push({type:7,index:r}),e+=w.length-1}r++}}static createElement(e,t){const i=k.createElement("template");return i.innerHTML=e,i}}function U(e,t,i=e,n){var r,s,a,o;if(t===R)return t;let c=void 0!==n?null===(r=i._$Co)||void 0===r?void 0:r[n]:i._$Cl;const l=A(t)?void 0:t._$litDirective$;return(null==c?void 0:c.constructor)!==l&&(null===(s=null==c?void 0:c._$AO)||void 0===s||s.call(c,!1),void 0===l?c=void 0:(c=new l(e),c._$AT(e,i,n)),void 0!==n?(null!==(a=(o=i)._$Co)&&void 0!==a?a:o._$Co=[])[n]=c:i._$Cl=c),void 0!==c&&(t=U(e,c._$AS(e,t.values),c,n)),t}class H{constructor(e,t){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var t;const{el:{content:i},parts:n}=this._$AD,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:k).importNode(i,!0);V.currentNode=r;let s=V.nextNode(),a=0,o=0,c=n[0];for(;void 0!==c;){if(a===c.index){let t;2===c.type?t=new q(s,s.nextSibling,this,e):1===c.type?t=new c.ctor(s,c.name,c.strings,this,e):6===c.type&&(t=new X(s,this,e)),this.u.push(t),c=n[++o]}a!==(null==c?void 0:c.index)&&(s=V.nextNode(),a++)}return r}p(e){let t=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class q{constructor(e,t,i,n){var r;this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cm=null===(r=null==n?void 0:n.isConnected)||void 0===r||r}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cm}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=U(this,e,t),A(e)?e===j||null==e||""===e?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==R&&this.g(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>C(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==j&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=F.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.p(i);else{const e=new H(r,this),t=e.v(this.options);e.p(i),this.T(t),this._$AH=e}}_$AC(e){let t=B.get(e.strings);return void 0===t&&B.set(e.strings,t=new F(e)),t}k(e){C(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new q(this.O(E()),this.O(E()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cm=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}class z{constructor(e,t,i,n,r){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=j}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let s=!1;if(void 0===r)e=U(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==R,s&&(this._$AH=e);else{const n=e;let a,o;for(e=r[0],a=0;a<r.length-1;a++)o=U(this,n[i+a],t,a),o===R&&(o=this._$AH[a]),s||(s=!A(o)||o!==this._$AH[a]),o===j?e=j:e!==j&&(e+=(null!=o?o:"")+r[a+1]),this._$AH[a]=o}s&&!n&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class W extends z{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}}const Y=b?b.emptyScript:"";class G extends z{constructor(){super(...arguments),this.type=4}j(e){e&&e!==j?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class J extends z{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){var i;if((e=null!==(i=U(this,e,t,0))&&void 0!==i?i:j)===R)return;const n=this._$AH,r=e===j&&n!==j||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==j&&(n===j||r);r&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==i?i:this.element,e):this._$AH.handleEvent(e)}}class X{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){U(this,e)}}const K=y.litHtmlPolyfillSupport;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
var Q,Z;null==K||K(F,q),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.4.0");class ee extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{var n,r;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let a=s._$litPart$;if(void 0===a){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new q(t.insertBefore(E(),e),e,void 0,null!=i?i:{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return R}}ee.finalized=!0,ee._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:ee});const te=globalThis.litElementPolyfillSupport;null==te||te({LitElement:ee}),(null!==(Z=globalThis.litElementVersions)&&void 0!==Z?Z:globalThis.litElementVersions=[]).push("3.2.2");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const ie=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:i,elements:n}=t;return{kind:i,elements:n,finisher(t){customElements.define(e,t)}}})(e,t),ne=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function re(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):ne(e,t)
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/}var se;null===(se=window.HTMLSlotElement)||void 0===se||se.prototype.assignedElements;class ae{constructor(){this.states={}}callWS(e){return console.log(e),Promise.resolve(null)}callService(e,t,i){return Promise.resolve({context:{id:"",parent_id:void 0,user_id:void 0}})}clone(){const e=new ae;return e.callService=this.callService,e.states=JSON.parse(JSON.stringify(this.states)),e}}class oe{}let ce=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/giu;function le(e="",t="ms"){var i=null;return(e=(e+"").replace(/(\d)[,_](\d)/g,"$1$2")).replace(ce,(function(e,t,n){(n=he(n))&&(i=(i||0)+parseFloat(t,10)*n)})),i&&i/(he(t)||1)}function he(e){return le[e]||le[e.toLowerCase().replace(/s$/,"")]}le.nanosecond=le.ns=1e-6,le["µs"]=le["μs"]=le.us=le.microsecond=.001,le.millisecond=le.ms=le[""]=1,le.second=le.sec=le.s=1e3*le.ms,le.minute=le.min=le.m=60*le.s,le.hour=le.hr=le.h=60*le.m,le.day=le.d=24*le.h,le.week=le.wk=le.w=7*le.d,le.month=le.b=30.4375*le.d,le.year=le.yr=le.y=365.25*le.d;const ue=le;class pe{static miredToRGB(e){return this.kelvinToRGB(1e6/e)}static kelvinToRGB(e){const t=e/100;let i,n,r;return t<=66?(i=255,n=t,n=99.4708025861*Math.log(n)-161.1195681661,t<=19?r=0:(r=t-10,r=138.5177312231*Math.log(r)-305.0447927307)):(i=t-60,i=329.698727446*Math.pow(i,-.1332047592),n=t-60,n=288.1221695283*Math.pow(n,-.0755148492),r=255),[Math.min(Math.max(Math.round(i),0),255),Math.min(Math.max(Math.round(n),0),255),Math.min(Math.max(Math.round(r),0),255)]}}var de,fe=i(625),me=i.n(fe);class ge{static timeago(e){let t="second",i=0;const n=("string"==typeof e?new Date(e):e).getTime()-(new Date).getTime(),r=n/this.MILLISECONDS_IN_YEAR;if(Math.abs(r)>=1)t="year",i=r;else{const e=n/this.MILLISECONDS_IN_DAY;if(Math.abs(e)>=1)t="day",i=e;else{const e=n/this.MILLISECONDS_IN_HOUR;if(Math.abs(e)>=1)t="hour",i=e;else{const e=n/this.MILLISECONDS_IN_MINUTE;Math.abs(e)>=1?(t="minute",i=e):(t="second",i=n/this.MILLISECONDS_IN_SECOND)}}}return this.relativeTimeFormat.format(Math.round(i),t)}}ge.strftime=me(),ge.MILLISECONDS_IN_SECOND=1e3,ge.MILLISECONDS_IN_MINUTE=6e4,ge.MILLISECONDS_IN_HOUR=36e5,ge.MILLISECONDS_IN_DAY=864e5,ge.MILLISECONDS_IN_YEAR=31536e6,ge.relativeTimeFormat=new Intl.RelativeTimeFormat(null!==(de=navigator.language)&&void 0!==de?de:"en",{numeric:"auto",style:"long"});var ve=i(156),ye=i.n(ve);function be(e){return(e=>{if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}})(e).message}class xe{static isCode(e){return this.isCodeBlock(e)||this.isCodeLine(e)}static isCodeBlock(e){return e.trim().startsWith(">")}static isCodeLine(e){return e.includes("${")&&e.includes("}")}static evaluate(e,t){var i;this.expression=e.trim();const n=`${this.expression}_${null!==(i=t.entity_id)&&void 0!==i?i:""}`;this.parsedFunction=this.cache[n],void 0===this.parsedFunction&&(this.functionBody=this.expression,this.isCodeBlock(this.functionBody)?this.functionBody=this.functionBody.slice(1).trim():this.isCodeLine(this.functionBody)&&(this.functionBody.startsWith('"')&&this.functionBody.endsWith('"')&&(this.functionBody=this.functionBody.slice(1,this.functionBody.length-2)),this.functionBody=this.functionBody.replace(/\\"/g,'"'),this.functionBody=`\`${this.functionBody}\`;`,this.functionBody.includes("return")||(this.functionBody=`return ${this.functionBody}`)),this.parsedFunction=this.interpreter.parse(`exports.result = (() => { ${this.functionBody} })();`),this.cache[n]=this.parsedFunction,this.interpreter.import("util",this.util)),this.entityState=t,this.interpreter.import("entity",this.entityState);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(be(e))}return this.interpreter.exports.result}}xe.cache={},xe.interpreter=new(ye())({ecmaVer:2019,sandBox:!0}),xe.util={color:pe,date:ge};class we{constructor(e,t){this.hassChanged=t,this.simulationProcessors=[],this.hass=new ae,this.hass.callService=this.callService.bind(this);for(const t of e.simulations){const e=new Se(t,this.hass,this.onEntityStatesChanged.bind(this));this.simulationProcessors.push(e)}}onEntityStatesChanged(e){for(const t of e)this.hass.states[t.entity_id]=t;this.hassChanged(this.hass.clone())}callService(e,t,i){switch(console.log("HassSimulator.callService()",e,t,i),e){case"homeassistant":case"light":case"fan":"toggle"===t&&this.homeAssistantToggle(i);break;case"media_player":switch(t){case"volume_up":this.homeAssistantVolumeUp(i);break;case"volume_down":this.homeAssistantVolumeDown(i)}}return Promise.resolve({context:{id:"",parent_id:void 0,user_id:void 0}})}homeAssistantToggle(e){if(e.entity_id){const t=e.entity_id.split(".")[0],i=this.hass.states[e.entity_id];switch(t){case"switch":case"light":case"fan":case"binary_sensor":case"sensor":case"media_player":i.state="on"===i.state?"off":"on";for(const t of this.simulationProcessors)t.updateEntityState(e.entity_id,i)}}}homeAssistantVolumeUp(e){if(e.entity_id){const t=e.entity_id.split(".")[0],i=this.hass.states[e.entity_id];let n;if("media_player"===t){n=i.attributes.volume_level,i.attributes.volume_level=Math.min(1,n+.1);for(const t of this.simulationProcessors)t.updateEntityState(e.entity_id,i)}}}homeAssistantVolumeDown(e){if(e.entity_id){const t=e.entity_id.split(".")[0],i=this.hass.states[e.entity_id];let n;if("media_player"===t){n=i.attributes.volume_level,i.attributes.volume_level=Math.max(0,n-.1);for(const t of this.simulationProcessors)t.updateEntityState(e.entity_id,i)}}}}class Se{constructor(e,t,i){var n,r;this.simulation=e,this.hass=t,this.onEntityStatesChanged=i,this.currentIndex=0,this.entities=[],this.simulation.entities&&(this.entities=this.entities.concat(this.simulation.entities)),this.simulation.entity&&(this.entities=this.entities.concat(this.simulation.entity)),this.entities.length||console.error("Simulation must contain at least one entity",e),(null===(n=this.simulation.states)||void 0===n?void 0:n.length)||this.simulation.state||console.error("Simulation must contain at least one state",e),this.triggerState(null!==(r=this.simulation.state)&&void 0!==r?r:this.simulation.states[0])}triggerState(e){var t;if(this.simulation.enabled||void 0===this.simulation.enabled)for(const t of this.entities)this.updateEntityState(t,e);if(this.simulation.states){let i;if("string"==typeof this.simulation.states){const e=null!==(t=this.simulation.state)&&void 0!==t?t:{entity_id:this.simulation.entity};i=xe.evaluate(this.simulation.states,e),this.simulation.state=i}else{const t=(this.simulation.states.indexOf(e)+1)%this.simulation.states.length;i=this.simulation.states[t]}if(null==i?void 0:i.duration){const t=e,n="number"==typeof t.duration?1e3*t.duration:ue(t.duration);setTimeout(this.triggerState.bind(this),n,i)}}}updateEntityState(e,t){var i,n,r;const s="string"==typeof e?e:e.entity_id,a=this.hass.states[s];let o;a?(o=Object.assign({},a),o.attributes=Object.assign({},a.attributes)):(o=new oe,o.entity_id=s),"string"==typeof t?o.state="string"==typeof t?t:t.state:"object"==typeof t&&(o.state=t.state,t.attributes&&(o.attributes=Object.assign({},o.attributes,t.attributes))),o.attributes=null!==(i=o.attributes)&&void 0!==i?i:{},o.attributes.friendly_name=null!==(r=null===(n=o.attributes)||void 0===n?void 0:n.friendly_name)&&void 0!==r?r:s,o.last_changed=(new Date).toString(),o.last_updated=(new Date).toString(),this.onEntityStatesChanged([o])}}
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function _e(e){return null==e}var ke={isNothing:_e,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:_e(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;i<t;i+=1)n+=e;return n},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var i,n,r,s;if(t)for(i=0,n=(s=Object.keys(t)).length;i<n;i+=1)e[r=s[i]]=t[r];return e}};function Ee(e,t){var i="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(i+="\n\n"+e.mark.snippet),n+" "+i):n}function Ae(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ee(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}Ae.prototype=Object.create(Error.prototype),Ae.prototype.constructor=Ae,Ae.prototype.toString=function(e){return this.name+": "+Ee(this,e)};var Ce=Ae;function Ie(e,t,i,n,r){var s="",a="",o=Math.floor(r/2)-1;return n-t>o&&(t=n-o+(s=" ... ").length),i-n>o&&(i=n+o-(a=" ...").length),{str:s+e.slice(t,i).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Te(e,t){return ke.repeat(" ",t-e.length)+e}var Pe=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var i,n=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;i=n.exec(e.buffer);)s.push(i.index),r.push(i.index+i[0].length),e.position<=i.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var o,c,l="",h=Math.min(e.line+t.linesAfter,s.length).toString().length,u=t.maxLength-(t.indent+h+3);for(o=1;o<=t.linesBefore&&!(a-o<0);o++)c=Ie(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=ke.repeat(" ",t.indent)+Te((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Ie(e.buffer,r[a],s[a],e.position,u),l+=ke.repeat(" ",t.indent)+Te((e.line+1).toString(),h)+" | "+c.str+"\n",l+=ke.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Ie(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=ke.repeat(" ",t.indent)+Te((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},Oe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ne=["scalar","sequence","mapping"],Me=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Oe.indexOf(t))throw new Ce('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(i){e[i].forEach((function(e){t[String(e)]=i}))})),t}(t.styleAliases||null),-1===Ne.indexOf(this.kind))throw new Ce('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function Le(e,t){var i=[];return e[t].forEach((function(e){var t=i.length;i.forEach((function(i,n){i.tag===e.tag&&i.kind===e.kind&&i.multi===e.multi&&(t=n)})),i[t]=e})),i}function De(e){return this.extend(e)}De.prototype.extend=function(e){var t=[],i=[];if(e instanceof Me)i.push(e);else if(Array.isArray(e))i=i.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new Ce("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof Me))throw new Ce("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new Ce("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new Ce("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),i.forEach((function(e){if(!(e instanceof Me))throw new Ce("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(De.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=Le(n,"implicit"),n.compiledExplicit=Le(n,"explicit"),n.compiledTypeMap=function(){var e,t,i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(e){e.multi?(i.multi[e.kind].push(e),i.multi.fallback.push(e)):i[e.kind][e.tag]=i.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(n);return i}(n.compiledImplicit,n.compiledExplicit),n};var $e=De,Re=new Me("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),je=new Me("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),Be=new Me("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),Ve=new $e({explicit:[Re,je,Be]}),Fe=new Me("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Ue=new Me("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function He(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function qe(e){return 48<=e&&e<=55}function ze(e){return 48<=e&&e<=57}var We=new Me("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i=e.length,n=0,r=!1;if(!i)return!1;if("-"!==(t=e[n])&&"+"!==t||(t=e[++n]),"0"===t){if(n+1===i)return!0;if("b"===(t=e[++n])){for(n++;n<i;n++)if("_"!==(t=e[n])){if("0"!==t&&"1"!==t)return!1;r=!0}return r&&"_"!==t}if("x"===t){for(n++;n<i;n++)if("_"!==(t=e[n])){if(!He(e.charCodeAt(n)))return!1;r=!0}return r&&"_"!==t}if("o"===t){for(n++;n<i;n++)if("_"!==(t=e[n])){if(!qe(e.charCodeAt(n)))return!1;r=!0}return r&&"_"!==t}}if("_"===t)return!1;for(;n<i;n++)if("_"!==(t=e[n])){if(!ze(e.charCodeAt(n)))return!1;r=!0}return!(!r||"_"===t)},construct:function(e){var t,i=e,n=1;if(-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),"-"!==(t=i[0])&&"+"!==t||("-"===t&&(n=-1),t=(i=i.slice(1))[0]),"0"===i)return 0;if("0"===t){if("b"===i[1])return n*parseInt(i.slice(2),2);if("x"===i[1])return n*parseInt(i.slice(2),16);if("o"===i[1])return n*parseInt(i.slice(2),8)}return n*parseInt(i,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!ke.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ye=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Ge=/^[-+]?[0-9]+e/,Je=new Me("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Ye.test(e)||"_"===e[e.length-1])},construct:function(e){var t,i;return i="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:i*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||ke.isNegativeZero(e))},represent:function(e,t){var i;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ke.isNegativeZero(e))return"-0.0";return i=e.toString(10),Ge.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Xe=Ve.extend({implicit:[Fe,Ue,We,Je]}),Ke=Xe,Qe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ze=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),et=new Me("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Qe.exec(e)||null!==Ze.exec(e))},construct:function(e){var t,i,n,r,s,a,o,c,l=0,h=null;if(null===(t=Qe.exec(e))&&(t=Ze.exec(e)),null===t)throw new Error("Date resolve error");if(i=+t[1],n=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(i,n,r));if(s=+t[4],a=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(h=-h)),c=new Date(Date.UTC(i,n,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(e){return e.toISOString()}}),tt=new Me("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),it="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",nt=new Me("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=it;for(i=0;i<r;i++)if(!((t=s.indexOf(e.charAt(i)))>64)){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){var t,i,n=e.replace(/[\r\n=]/g,""),r=n.length,s=it,a=0,o=[];for(t=0;t<r;t++)t%4==0&&t&&(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(n.charAt(t));return 0==(i=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===i?(o.push(a>>10&255),o.push(a>>2&255)):12===i&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,i,n="",r=0,s=e.length,a=it;for(t=0;t<s;t++)t%3==0&&t&&(n+=a[r>>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]),r=(r<<8)+e[t];return 0==(i=s%3)?(n+=a[r>>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]):2===i?(n+=a[r>>10&63],n+=a[r>>4&63],n+=a[r<<2&63],n+=a[64]):1===i&&(n+=a[r>>2&63],n+=a[r<<4&63],n+=a[64],n+=a[64]),n}}),rt=Object.prototype.hasOwnProperty,st=Object.prototype.toString,at=new Me("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,i,n,r,s,a=[],o=e;for(t=0,i=o.length;t<i;t+=1){if(n=o[t],s=!1,"[object Object]"!==st.call(n))return!1;for(r in n)if(rt.call(n,r)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==a.indexOf(r))return!1;a.push(r)}return!0},construct:function(e){return null!==e?e:[]}}),ot=Object.prototype.toString,ct=new Me("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,i,n,r,s,a=e;for(s=new Array(a.length),t=0,i=a.length;t<i;t+=1){if(n=a[t],"[object Object]"!==ot.call(n))return!1;if(1!==(r=Object.keys(n)).length)return!1;s[t]=[r[0],n[r[0]]]}return!0},construct:function(e){if(null===e)return[];var t,i,n,r,s,a=e;for(s=new Array(a.length),t=0,i=a.length;t<i;t+=1)n=a[t],r=Object.keys(n),s[t]=[r[0],n[r[0]]];return s}}),lt=Object.prototype.hasOwnProperty,ht=new Me("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,i=e;for(t in i)if(lt.call(i,t)&&null!==i[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),ut=Ke.extend({implicit:[et,tt],explicit:[nt,at,ct,ht]}),pt=Object.prototype.hasOwnProperty,dt=1,ft=2,mt=3,gt=4,vt=1,yt=2,bt=3,xt=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,wt=/[\x85\u2028\u2029]/,St=/[,\[\]\{\}]/,_t=/^(?:!|!!|![a-z\-]+!)$/i,kt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Et(e){return Object.prototype.toString.call(e)}function At(e){return 10===e||13===e}function Ct(e){return 9===e||32===e}function It(e){return 9===e||32===e||10===e||13===e}function Tt(e){return 44===e||91===e||93===e||123===e||125===e}function Pt(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function Ot(e){return 120===e?2:117===e?4:85===e?8:0}function Nt(e){return 48<=e&&e<=57?e-48:-1}function Mt(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function Lt(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var Dt=new Array(256),$t=new Array(256),Rt=0;Rt<256;Rt++)Dt[Rt]=Mt(Rt)?1:0,$t[Rt]=Mt(Rt);function jt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ut,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Bt(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=Pe(i),new Ce(t,i)}function Vt(e,t){throw Bt(e,t)}function Ft(e,t){e.onWarning&&e.onWarning.call(null,Bt(e,t))}var Ut={YAML:function(e,t,i){var n,r,s;null!==e.version&&Vt(e,"duplication of %YAML directive"),1!==i.length&&Vt(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Vt(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Vt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Ft(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Vt(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],_t.test(n)||Vt(e,"ill-formed tag handle (first argument) of the TAG directive"),pt.call(e.tagMap,n)&&Vt(e,'there is a previously declared suffix for "'+n+'" tag handle'),kt.test(r)||Vt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Vt(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function Ht(e,t,i,n){var r,s,a,o;if(t<i){if(o=e.input.slice(t,i),n)for(r=0,s=o.length;r<s;r+=1)9===(a=o.charCodeAt(r))||32<=a&&a<=1114111||Vt(e,"expected valid JSON character");else xt.test(o)&&Vt(e,"the stream contains non-printable characters");e.result+=o}}function qt(e,t,i,n){var r,s,a,o;for(ke.isObject(i)||Vt(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,o=(r=Object.keys(i)).length;a<o;a+=1)s=r[a],pt.call(t,s)||(t[s]=i[s],n[s]=!0)}function zt(e,t,i,n,r,s,a,o,c){var l,h;if(Array.isArray(r))for(l=0,h=(r=Array.prototype.slice.call(r)).length;l<h;l+=1)Array.isArray(r[l])&&Vt(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===Et(r[l])&&(r[l]="[object Object]");if("object"==typeof r&&"[object Object]"===Et(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(s))for(l=0,h=s.length;l<h;l+=1)qt(e,t,s[l],i);else qt(e,t,s,i);else e.json||pt.call(i,r)||!pt.call(t,r)||(e.line=a||e.line,e.lineStart=o||e.lineStart,e.position=c||e.position,Vt(e,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[r]=s,delete i[r];return t}function Wt(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):Vt(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Yt(e,t,i){for(var n=0,r=e.input.charCodeAt(e.position);0!==r;){for(;Ct(r);)9===r&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!At(r))break;for(Wt(e),r=e.input.charCodeAt(e.position),n++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==i&&0!==n&&e.lineIndent<i&&Ft(e,"deficient indentation"),n}function Gt(e){var t,i=e.position;return!(45!==(t=e.input.charCodeAt(i))&&46!==t||t!==e.input.charCodeAt(i+1)||t!==e.input.charCodeAt(i+2)||(i+=3,0!==(t=e.input.charCodeAt(i))&&!It(t)))}function Jt(e,t){1===t?e.result+=" ":t>1&&(e.result+=ke.repeat("\n",t-1))}function Xt(e,t){var i,n,r=e.tag,s=e.anchor,a=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),n=e.input.charCodeAt(e.position);0!==n&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Vt(e,"tab characters must not be used in indentation")),45===n)&&It(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,Yt(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,Zt(e,t,mt,!1,!0),a.push(e.result),Yt(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Vt(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!o&&(e.tag=r,e.anchor=s,e.kind="sequence",e.result=a,!0)}function Kt(e){var t,i,n,r,s=!1,a=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&Vt(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(s=!0,r=e.input.charCodeAt(++e.position)):33===r?(a=!0,i="!!",r=e.input.charCodeAt(++e.position)):i="!",t=e.position,s){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(n=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):Vt(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!It(r);)33===r&&(a?Vt(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),_t.test(i)||Vt(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);n=e.input.slice(t,e.position),St.test(n)&&Vt(e,"tag suffix cannot contain flow indicator characters")}n&&!kt.test(n)&&Vt(e,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n)}catch(t){Vt(e,"tag name is malformed: "+n)}return s?e.tag=n:pt.call(e.tagMap,i)?e.tag=e.tagMap[i]+n:"!"===i?e.tag="!"+n:"!!"===i?e.tag="tag:yaml.org,2002:"+n:Vt(e,'undeclared tag handle "'+i+'"'),!0}function Qt(e){var t,i;if(38!==(i=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&Vt(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!It(i)&&!Tt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Vt(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Zt(e,t,i,n,r){var s,a,o,c,l,h,u,p,d,f=1,m=!1,g=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=o=gt===i||mt===i,n&&Yt(e,!0,-1)&&(m=!0,e.lineIndent>t?f=1:e.lineIndent===t?f=0:e.lineIndent<t&&(f=-1)),1===f)for(;Kt(e)||Qt(e);)Yt(e,!0,-1)?(m=!0,o=s,e.lineIndent>t?f=1:e.lineIndent===t?f=0:e.lineIndent<t&&(f=-1)):o=!1;if(o&&(o=m||r),1!==f&>!==i||(p=dt===i||ft===i?t:t+1,d=e.position-e.lineStart,1===f?o&&(Xt(e,d)||function(e,t,i){var n,r,s,a,o,c,l,h=e.tag,u=e.anchor,p={},d=Object.create(null),f=null,m=null,g=null,v=!1,y=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),l=e.input.charCodeAt(e.position);0!==l;){if(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,Vt(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,63!==l&&58!==l||!It(n)){if(a=e.line,o=e.lineStart,c=e.position,!Zt(e,i,ft,!1,!0))break;if(e.line===s){for(l=e.input.charCodeAt(e.position);Ct(l);)l=e.input.charCodeAt(++e.position);if(58===l)It(l=e.input.charCodeAt(++e.position))||Vt(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(zt(e,p,d,f,m,null,a,o,c),f=m=g=null),y=!0,v=!1,r=!1,f=e.tag,m=e.result;else{if(!y)return e.tag=h,e.anchor=u,!0;Vt(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=h,e.anchor=u,!0;Vt(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(v&&(zt(e,p,d,f,m,null,a,o,c),f=m=g=null),y=!0,v=!0,r=!0):v?(v=!1,r=!0):Vt(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=n;if((e.line===s||e.lineIndent>t)&&(v&&(a=e.line,o=e.lineStart,c=e.position),Zt(e,t,gt,!0,r)&&(v?m=e.result:g=e.result),v||(zt(e,p,d,f,m,g,a,o,c),f=m=g=null),Yt(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Vt(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&zt(e,p,d,f,m,null,a,o,c),y&&(e.tag=h,e.anchor=u,e.kind="mapping",e.result=p),y}(e,d,p))||function(e,t){var i,n,r,s,a,o,c,l,h,u,p,d,f=!0,m=e.tag,g=e.anchor,v=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,l=!1,s=[];else{if(123!==d)return!1;a=125,l=!0,s={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),d=e.input.charCodeAt(++e.position);0!==d;){if(Yt(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=m,e.anchor=g,e.kind=l?"mapping":"sequence",e.result=s,!0;f?44===d&&Vt(e,"expected the node content, but found ','"):Vt(e,"missed comma between flow collection entries"),p=null,o=c=!1,63===d&&It(e.input.charCodeAt(e.position+1))&&(o=c=!0,e.position++,Yt(e,!0,t)),i=e.line,n=e.lineStart,r=e.position,Zt(e,t,dt,!1,!0),u=e.tag,h=e.result,Yt(e,!0,t),d=e.input.charCodeAt(e.position),!c&&e.line!==i||58!==d||(o=!0,d=e.input.charCodeAt(++e.position),Yt(e,!0,t),Zt(e,t,dt,!1,!0),p=e.result),l?zt(e,s,v,u,h,p,i,n,r):o?s.push(zt(e,null,v,u,h,p,i,n,r)):s.push(h),Yt(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(f=!0,d=e.input.charCodeAt(++e.position)):f=!1}Vt(e,"unexpected end of the stream within a flow collection")}(e,p)?g=!0:(a&&function(e,t){var i,n,r,s,a=vt,o=!1,c=!1,l=t,h=0,u=!1;if(124===(s=e.input.charCodeAt(e.position)))n=!1;else{if(62!==s)return!1;n=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)vt===a?a=43===s?bt:yt:Vt(e,"repeat of a chomping mode identifier");else{if(!((r=Nt(s))>=0))break;0===r?Vt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Vt(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(Ct(s)){do{s=e.input.charCodeAt(++e.position)}while(Ct(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!At(s)&&0!==s)}for(;0!==s;){for(Wt(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndent<l)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>l&&(l=e.lineIndent),At(s))h++;else{if(e.lineIndent<l){a===bt?e.result+=ke.repeat("\n",o?1+h:h):a===vt&&o&&(e.result+="\n");break}for(n?Ct(s)?(u=!0,e.result+=ke.repeat("\n",o?1+h:h)):u?(u=!1,e.result+=ke.repeat("\n",h+1)):0===h?o&&(e.result+=" "):e.result+=ke.repeat("\n",h):e.result+=ke.repeat("\n",o?1+h:h),o=!0,c=!0,h=0,i=e.position;!At(s)&&0!==s;)s=e.input.charCodeAt(++e.position);Ht(e,i,e.position,!1)}}return!0}(e,p)||function(e,t){var i,n,r;if(39!==(i=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(i=e.input.charCodeAt(e.position));)if(39===i){if(Ht(e,n,e.position,!0),39!==(i=e.input.charCodeAt(++e.position)))return!0;n=e.position,e.position++,r=e.position}else At(i)?(Ht(e,n,r,!0),Jt(e,Yt(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Gt(e)?Vt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);Vt(e,"unexpected end of the stream within a single quoted scalar")}(e,p)||function(e,t){var i,n,r,s,a,o;if(34!==(o=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;0!==(o=e.input.charCodeAt(e.position));){if(34===o)return Ht(e,i,e.position,!0),e.position++,!0;if(92===o){if(Ht(e,i,e.position,!0),At(o=e.input.charCodeAt(++e.position)))Yt(e,!1,t);else if(o<256&&Dt[o])e.result+=$t[o],e.position++;else if((a=Ot(o))>0){for(r=a,s=0;r>0;r--)(a=Pt(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Vt(e,"expected hexadecimal character");e.result+=Lt(s),e.position++}else Vt(e,"unknown escape sequence");i=n=e.position}else At(o)?(Ht(e,i,n,!0),Jt(e,Yt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Gt(e)?Vt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Vt(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?g=!0:function(e){var t,i,n;if(42!==(n=e.input.charCodeAt(e.position)))return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!It(n)&&!Tt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Vt(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),pt.call(e.anchorMap,i)||Vt(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],Yt(e,!0,-1),!0}(e)?(g=!0,null===e.tag&&null===e.anchor||Vt(e,"alias node should not have any properties")):function(e,t,i){var n,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(It(h=e.input.charCodeAt(e.position))||Tt(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(It(n=e.input.charCodeAt(e.position+1))||i&&Tt(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(It(n=e.input.charCodeAt(e.position+1))||i&&Tt(n))break}else if(35===h){if(It(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Gt(e)||i&&Tt(h))break;if(At(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,Yt(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}e.position=s,e.line=o,e.lineStart=c,e.lineIndent=l;break}}a&&(Ht(e,r,s,!1),Jt(e,e.line-o),r=s=e.position,a=!1),Ct(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return Ht(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,dt===i)&&(g=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=o&&Xt(e,d))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&Vt(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c<l;c+=1)if((u=e.implicitTypes[c]).resolve(e.result)){e.result=u.construct(e.result),e.tag=u.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(pt.call(e.typeMap[e.kind||"fallback"],e.tag))u=e.typeMap[e.kind||"fallback"][e.tag];else for(u=null,c=0,l=(h=e.typeMap.multi[e.kind||"fallback"]).length;c<l;c+=1)if(e.tag.slice(0,h[c].tag.length)===h[c].tag){u=h[c];break}u||Vt(e,"unknown tag !<"+e.tag+">"),null!==e.result&&u.kind!==e.kind&&Vt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+u.kind+'", not "'+e.kind+'"'),u.resolve(e.result,e.tag)?(e.result=u.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):Vt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||g}function ei(e){var t,i,n,r,s=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(Yt(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!It(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Vt(e,"directive name must not be less than one character in length");0!==r;){for(;Ct(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!At(r));break}if(At(r))break;for(t=e.position;0!==r&&!It(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&Wt(e),pt.call(Ut,i)?Ut[i](e,i,n):Ft(e,'unknown document directive "'+i+'"')}Yt(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,Yt(e,!0,-1)):a&&Vt(e,"directives end mark is expected"),Zt(e,e.lineIndent-1,gt,!1,!0),Yt(e,!0,-1),e.checkLineBreaks&&wt.test(e.input.slice(s,e.position))&&Ft(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Gt(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Yt(e,!0,-1)):e.position<e.length-1&&Vt(e,"end of the stream or a document separator is expected")}function ti(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var i=new jt(e,t),n=e.indexOf("\0");for(-1!==n&&(i.position=n,Vt(i,"null byte is not allowed in input")),i.input+="\0";32===i.input.charCodeAt(i.position);)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)ei(i);return i.documents}var ii={loadAll:function(e,t,i){null!==t&&"object"==typeof t&&void 0===i&&(i=t,t=null);var n=ti(e,i);if("function"!=typeof t)return n;for(var r=0,s=n.length;r<s;r+=1)t(n[r])},load:function(e,t){var i=ti(e,t);if(0!==i.length){if(1===i.length)return i[0];throw new Ce("expected a single document in the stream, but found more")}}},ni=Object.prototype.toString,ri=Object.prototype.hasOwnProperty,si=65279,ai=9,oi=10,ci=13,li=32,hi=33,ui=34,pi=35,di=37,fi=38,mi=39,gi=42,vi=44,yi=45,bi=58,xi=61,wi=62,Si=63,_i=64,ki=91,Ei=93,Ai=96,Ci=123,Ii=124,Ti=125,Pi={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Oi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ni=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Mi(e){var t,i,n;if(t=e.toString(16).toUpperCase(),e<=255)i="x",n=2;else if(e<=65535)i="u",n=4;else{if(!(e<=4294967295))throw new Ce("code point within a string may not be greater than 0xFFFFFFFF");i="U",n=8}return"\\"+i+ke.repeat("0",n-t.length)+t}var Li=2;function Di(e){this.schema=e.schema||ut,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ke.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var i,n,r,s,a,o,c;if(null===t)return{};for(i={},r=0,s=(n=Object.keys(t)).length;r<s;r+=1)a=n[r],o=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&ri.call(c.styleAliases,o)&&(o=c.styleAliases[o]),i[a]=o;return i}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?Li:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function $i(e,t){for(var i,n=ke.repeat(" ",t),r=0,s=-1,a="",o=e.length;r<o;)-1===(s=e.indexOf("\n",r))?(i=e.slice(r),r=o):(i=e.slice(r,s+1),r=s+1),i.length&&"\n"!==i&&(a+=n),a+=i;return a}function Ri(e,t){return"\n"+ke.repeat(" ",e.indent*t)}function ji(e){return e===li||e===ai}function Bi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==si||65536<=e&&e<=1114111}function Vi(e){return Bi(e)&&e!==si&&e!==ci&&e!==oi}function Fi(e,t,i){var n=Vi(e),r=n&&!ji(e);return(i?n:n&&e!==vi&&e!==ki&&e!==Ei&&e!==Ci&&e!==Ti)&&e!==pi&&!(t===bi&&!r)||Vi(t)&&!ji(t)&&e===pi||t===bi&&r}function Ui(e,t){var i,n=e.charCodeAt(t);return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1))>=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function Hi(e){return/^\n* /.test(e)}var qi=1,zi=2,Wi=3,Yi=4,Gi=5;function Ji(e,t,i,n,r){e.dump=function(){if(0===t.length)return e.quotingType===Li?'""':"''";if(!e.noCompatMode&&(-1!==Oi.indexOf(t)||Ni.test(t)))return e.quotingType===Li?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,i),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=n||e.flowLevel>-1&&i>=e.flowLevel;switch(function(e,t,i,n,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==n,f=-1,m=function(e){return Bi(e)&&e!==si&&!ji(e)&&e!==yi&&e!==Si&&e!==bi&&e!==vi&&e!==ki&&e!==Ei&&e!==Ci&&e!==Ti&&e!==pi&&e!==fi&&e!==gi&&e!==hi&&e!==Ii&&e!==xi&&e!==wi&&e!==mi&&e!==ui&&e!==di&&e!==_i&&e!==Ai}(Ui(e,0))&&function(e){return!ji(e)&&e!==bi}(Ui(e,e.length-1));if(t||a)for(c=0;c<e.length;l>=65536?c+=2:c++){if(!Bi(l=Ui(e,c)))return Gi;m=m&&Fi(l,h,o),h=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if((l=Ui(e,c))===oi)u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!Bi(l))return Gi;m=m&&Fi(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&Hi(e)?Gi:a?s===Li?Gi:zi:p?Yi:Wi:!m||a||r(e)?s===Li?Gi:zi:qi}(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i<n;i+=1)if(e.implicitTypes[i].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!n,r)){case qi:return t;case zi:return"'"+t.replace(/'/g,"''")+"'";case Wi:return"|"+Xi(t,e.indent)+Ki($i(t,s));case Yi:return">"+Xi(t,e.indent)+Ki($i(function(e,t){for(var i,n,r,s=/(\n+)([^\n]*)/g,a=(r=-1!==(r=e.indexOf("\n"))?r:e.length,s.lastIndex=r,Qi(e.slice(0,r),t)),o="\n"===e[0]||" "===e[0];n=s.exec(e);){var c=n[1],l=n[2];i=" "===l[0],a+=c+(o||i||""===l?"":"\n")+Qi(l,t),o=i}return a}(t,a),s));case Gi:return'"'+function(e){for(var t,i="",n=0,r=0;r<e.length;n>=65536?r+=2:r++)n=Ui(e,r),!(t=Pi[n])&&Bi(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||Mi(n);return i}(t)+'"';default:throw new Ce("impossible error: invalid scalar style")}}()}function Xi(e,t){var i=Hi(e)?String(t):"",n="\n"===e[e.length-1];return i+(!n||"\n"!==e[e.length-2]&&"\n"!==e?n?"":"-":"+")+"\n"}function Ki(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Qi(e,t){if(""===e||" "===e[0])return e;for(var i,n,r=/ [^ ]/g,s=0,a=0,o=0,c="";i=r.exec(e);)(o=i.index)-s>t&&(n=a>s?a:o,c+="\n"+e.slice(s,n),s=n+1),a=o;return c+="\n",e.length-s>t&&a>s?c+=e.slice(s,a)+"\n"+e.slice(a+1):c+=e.slice(s),c.slice(1)}function Zi(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r<s;r+=1)a=i[r],e.replacer&&(a=e.replacer.call(i,String(r),a)),(tn(e,t+1,a,!0,!0,!1,!0)||void 0===a&&tn(e,t+1,null,!0,!0,!1,!0))&&(n&&""===o||(o+=Ri(e,t)),e.dump&&oi===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=c,e.dump=o||"[]"}function en(e,t,i){var n,r,s,a,o,c;for(s=0,a=(r=i?e.explicitTypes:e.implicitTypes).length;s<a;s+=1)if(((o=r[s]).instanceOf||o.predicate)&&(!o.instanceOf||"object"==typeof t&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(i?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(c=e.styleMap[o.tag]||o.defaultStyle,"[object Function]"===ni.call(o.represent))n=o.represent(t,c);else{if(!ri.call(o.represent,c))throw new Ce("!<"+o.tag+'> tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function tn(e,t,i,n,r,s,a){e.tag=null,e.dump=i,en(e,i,!1)||en(e,i,!0);var o,c=ni.call(e.dump),l=n;n&&(n=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===c||"[object Array]"===c;if(p&&(u=-1!==(h=e.duplicates.indexOf(i))),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(r=!1),u&&e.usedDuplicates[h])e.dump="*ref_"+h;else{if(p&&u&&!e.usedDuplicates[h]&&(e.usedDuplicates[h]=!0),"[object Object]"===c)n&&0!==Object.keys(e.dump).length?(function(e,t,i,n){var r,s,a,o,c,l,h="",u=e.tag,p=Object.keys(i);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new Ce("sortKeys must be a boolean or a function");for(r=0,s=p.length;r<s;r+=1)l="",n&&""===h||(l+=Ri(e,t)),o=i[a=p[r]],e.replacer&&(o=e.replacer.call(i,a,o)),tn(e,t+1,a,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&oi===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Ri(e,t)),tn(e,t+1,o,!0,c)&&(e.dump&&oi===e.dump.charCodeAt(0)?l+=":":l+=": ",h+=l+=e.dump));e.tag=u,e.dump=h||"{}"}(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(function(e,t,i){var n,r,s,a,o,c="",l=e.tag,h=Object.keys(i);for(n=0,r=h.length;n<r;n+=1)o="",""!==c&&(o+=", "),e.condenseFlow&&(o+='"'),a=i[s=h[n]],e.replacer&&(a=e.replacer.call(i,s,a)),tn(e,t,s,!1,!1)&&(e.dump.length>1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),tn(e,t,a,!1,!1)&&(c+=o+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else if("[object Array]"===c)n&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?Zi(e,t-1,e.dump,r):Zi(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(function(e,t,i){var n,r,s,a="",o=e.tag;for(n=0,r=i.length;n<r;n+=1)s=i[n],e.replacer&&(s=e.replacer.call(i,String(n),s)),(tn(e,t,s,!1,!1)||void 0===s&&tn(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=o,e.dump="["+a+"]"}(e,t,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else{if("[object String]"!==c){if("[object Undefined]"===c)return!1;if(e.skipInvalid)return!1;throw new Ce("unacceptable kind of an object to dump "+c)}"?"!==e.tag&&Ji(e,e.dump,t,s,l)}null!==e.tag&&"?"!==e.tag&&(o=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),o="!"===e.tag[0]?"!"+o:"tag:yaml.org,2002:"===o.slice(0,18)?"!!"+o.slice(18):"!<"+o+">",e.dump=o+" "+e.dump)}return!0}function nn(e,t){var i,n,r=[],s=[];for(rn(e,r,s),i=0,n=s.length;i<n;i+=1)t.duplicates.push(r[s[i]]);t.usedDuplicates=new Array(n)}function rn(e,t,i){var n,r,s;if(null!==e&&"object"==typeof e)if(-1!==(r=t.indexOf(e)))-1===i.indexOf(r)&&i.push(r);else if(t.push(e),Array.isArray(e))for(r=0,s=e.length;r<s;r+=1)rn(e[r],t,i);else for(r=0,s=(n=Object.keys(e)).length;r<s;r+=1)rn(e[n[r]],t,i)}function sn(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}const an={Type:Me,Schema:$e,FAILSAFE_SCHEMA:Ve,JSON_SCHEMA:Xe,CORE_SCHEMA:Ke,DEFAULT_SCHEMA:ut,load:ii.load,loadAll:ii.loadAll,dump:function(e,t){var i=new Di(t=t||{});i.noRefs||nn(e,i);var n=e;return i.replacer&&(n=i.replacer.call({"":n},"",n)),tn(i,0,n,!0,!0)?i.dump+"\n":""},YAMLException:Ce,types:{binary:nt,float:Je,map:Be,null:Fe,pairs:ct,set:ht,timestamp:et,bool:Ue,int:We,merge:tt,omap:at,seq:je,str:Re},safeLoad:sn("safeLoad","load"),safeLoadAll:sn("safeLoadAll","loadAll"),safeDump:sn("safeDump","dump")};var on=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}c((n=n.apply(e,t||[])).next())}))};class cn{static hasClass(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}static removeClass(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}static hassClass(e,t){return e.classList.contains(t)}static addClass(e,t){e.classList.add(t)}static setClass(e,t){e.setAttribute("class",t)}static toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}static datasetSet(e,t,i){e.dataset[t]=i}static getStyles(e){const t={};let i;for(let n=0;n<e.style.length;n++)i=e.style.item(n),t[i]=e.style.getPropertyValue(i);return t}static setStyle(e,t){const i=(null!=t?t:[]).split(";").map((e=>e.trim())).filter((e=>e.length));for(let t=0;t<i.length;t++){const n=i[t].split(":").map((e=>e.trim())),r=n[1].includes("!important");n[1]=n[1].replace(/!important/g,"").trim(),e.style.setProperty(n[0],n[1],r?"important":"")}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n"),r=n.length>1,s=e.querySelector("tspan");if(r){const t=null==s?void 0:s.getAttribute("x"),r=null==s?void 0:s.getAttribute("y");t&&!e.getAttribute("x")&&e.setAttribute("x",t),r&&!e.getAttribute("y")&&e.setAttribute("y",r);const a=e.querySelector("tspan")||!1;e.textContent="",e.dataset.ha_floorplan_notice="The text_set function split your text into multiple tspans. Only the style of the first tspan is preserved. The style from the original tspan is reused on every tspan. The x and y are calculated on the basis of the first tspan or text-element.";const o=e.getAttribute("x")||"0",c=i||"1em";n.forEach(((t,i)=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(n.textContent=t,n.setAttribute("x",o),n.setAttribute("dy",i>=1?c:"0"),a){const e=a.getAttribute("style");e&&n.setAttribute("style",e)}e.appendChild(n)}))}else(s||e).textContent=t}static waitForChildNodes(e,t,i){return new Promise(((n,r)=>{const s=setTimeout((()=>r("Timeout waiting for child element(s) to load")),i);new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&t.addedNodes.length)return clearTimeout(s),n()})).observe(e,{childList:!0,subtree:!0}),t()}))}static formatDate(e){return e?"string"==typeof e?new Date(e).toLocaleString():e.toLocaleString():""}static parseYaml(e){return an.load(e)}static fetchText(e,t,i,n){return on(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:cn.cacheBuster(e);const r=new Request(e,{cache:n?"default":"no-store",mode:t?"no-cors":void 0});try{const e=yield fetch(r);if(e.ok||t&&"opaque"===e.type)return yield e.text();throw new Error("Error fetching resource")}catch(t){throw new URIError(`${e}: ${t.message}`)}}))}static fetchImage(e,t,i,n){return on(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:cn.cacheBuster(e);const r=new Request(e,{cache:n?"default":"no-store",headers:new Headers({"Content-Type":"text/plain; charset=x-user-defined"}),mode:t?"no-cors":void 0});try{const e=yield fetch(r);if(e.ok||t&&"opaque"===e.type){const t=yield e.arrayBuffer();return`data:image/jpeg;base64,${cn.arrayBufferToBase64(t)}`}throw new Error("Error fetching resource")}catch(t){throw new URIError(`${e}: ${t.message}`)}}))}static singleToArray(e){return null==e?[]:Array.isArray(e)?e:[e]}static getArray(e){if(null==e)return[];if(Array.isArray(e))return e;{const t=e;return Object.values(t)}}static getSet(e){if(Array.isArray(e))return new Set(e);{const t=e;return new Set(Object.values(t))}}static arrayBufferToBase64(e){let t="";[].slice.call(new Uint8Array(e)).forEach((e=>t+=String.fromCharCode(e)));let i=window.btoa(t);for(;i.length%4>0;)i+="=";return i}static cacheBuster(e){return`${e}${e.includes("?")?"&":"?"}_=${(new Date).getTime()}`}static equal(e,t){if(e===t)return!0;const i=Array.isArray(e),n=Array.isArray(t);let r=0;if(i&&n){if(e.length!=t.length)return!1;for(r=0;r<e.length;r++)if(!cn.equal(e[r],t[r]))return!1;return!0}if(i!=n)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;const n=e instanceof Date,s=t instanceof Date;if(n&&s)return e.getTime()==t.getTime();if(n!=s)return!1;const a=e instanceof RegExp,o=t instanceof RegExp;if(a&&o)return e.toString()==t.toString();if(a!=o)return!1;for(r=0;r<i.length;r++)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=0;r<i.length;r++)if(!cn.equal(e[i[r]],t[i[r]]))return!1;return!0}return!1}static get isMobile(){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))}static deviceId(){const e="ha-floorplan-device-id";if(!localStorage[e]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class ln{static closestElement(e,t){return function t(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);return i.closest(e)||t(i.getRootNode().host)}(t)}}const hn=(e,t,i,n)=>{n=n||{},i=null==i?{}:i;const r=new Event(t,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,e.dispatchEvent(r),r},un=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),hn(window,"location-changed",{replace:i})};class pn{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class dn{constructor(e){this.rule=e,this.svgElementInfos={}}}class fn{constructor(e,t,i,n,r,s){this.instance=e,this.entityId=t,this.elementId=i,this.svgElementInfo=n,this.ruleInfo=r,this.actions=s}}const mn={},gn={};gn.click=gn.mousedown=gn.mouseup=gn.mousemove="MouseEvents";let vn=1;function yn(e){return e._dtId||(e._dtId=vn++)}function bn(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function xn(e,t,i,n){const r=bn(i).e;if(!e._dtId)return!1;const s=mn[yn(e)],a=function(e,t,i,n){return i=bn(i),(mn[yn(e)]||[]).filter((e=>e&&(!i.e||e.e===i.e)&&(!i.ns||e.ns===i.ns)&&(!n||e.callback===n)&&(!t||e.selector===t)))}(e,t,i,n);a.forEach((t=>{e.removeEventListener?e.removeEventListener(r,t.delegator||t.callback):e.detachEvent&&e.detachEvent("on"+r,t.delegator||t.callback),s.splice(s.indexOf(t),1)}))}function wn(e,t,i,n,r,s){const a=bn(i).e,o=bn(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=yn(e);(mn[c]||(mn[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const Sn={on(e,t,i,n=null){wn(e,null,t,i,null,n)},off(e,t,i=null){xn(e,null,t,i)},once(e,t,i){const n=e=>(Sn.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){wn(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e<r.length;e++){const t=r[e];if(t===i.target||t.contains(i.target)){s=t;break}}s&&n.apply(s,[].slice.call(arguments))}),r)},undelegate(e,t,i,n){xn(e,t,i,n)},trigger(e,t,i){const n=document.createEvent(gn[t]||"Events");let r=!0;if(i)for(const e in i)({}).hasOwnProperty.call(i,e)&&("bubbles"===e?r=!!i[e]:n[e]=i[e]);n.initEvent(t,r,!0),e.dispatchEvent(n)}},_n=Sn,kn=_n;class En{static observe(e){let t,i=!1;const n=()=>{i=!1,t=setTimeout((()=>{i=!0,e.dispatchEvent(new Event("longClick"))}),400)},r=n=>{clearTimeout(t),i||e.dispatchEvent(new Event("short"+n.type[0].toUpperCase()+n.type.slice(1)))},s=e=>{i&&(e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation())};kn.on(e,"mousedown",n.bind(this)),kn.on(e,"tapstart",n.bind(this)),kn.on(e,"touchstart",n.bind(this),{passive:!0}),kn.on(e,"click",r.bind(this)),kn.on(e,"mouseup",r.bind(this)),kn.on(e,"tapend",r.bind(this)),kn.on(e,"touchend",r.bind(this)),kn.on(e,"tap",s.bind(this)),kn.on(e,"touch",s.bind(this)),kn.on(e,"mouseup",s.bind(this)),kn.on(e,"tapend",s.bind(this)),kn.on(e,"touchend",s.bind(this)),kn.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const An=_n,Cn=new Set;class In{static observe(e){if(Cn.has(e))return;Cn.add(e);let t,i=0;An.on(e,"click",(()=>{i++,t=setTimeout((()=>{1===i&&(i=0,e.dispatchEvent(new Event("singleClick")))}),400),2===i&&(clearTimeout(t),i=0,e.dispatchEvent(new Event("doubleClick")))}).bind(this))}}const Tn="ha-floorplan-service-call";class Pn{static isCode(e){return this.isCodeBlock(e)||this.isCodeLine(e)}static isCodeBlock(e){return e.trim().startsWith(">")}static isCodeLine(e){return e.includes("${")&&e.includes("}")}static evaluate(e,t,i,n,r,s,a,o,c){this.expression=e.trim();const l=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[l],void 0===this.parsedFunction&&(this.functionBody=this.expression,this.isCodeBlock(this.functionBody)?this.functionBody=this.functionBody.slice(1).trim():this.isCodeLine(this.functionBody)&&(this.functionBody.startsWith('"')&&this.functionBody.endsWith('"')&&(this.functionBody=this.functionBody.slice(1,this.functionBody.length-2)),this.functionBody=this.functionBody.replace(/\\"/g,'"'),this.functionBody=`\`${this.functionBody}\`;`,this.functionBody.includes("return")||(this.functionBody=`return ${this.functionBody}`)),this.parsedFunction=this.interpreter.parse(`exports.result = (() => { ${this.functionBody} })();`),this.cache[l]=this.parsedFunction,this.interpreter.import("config",i),this.interpreter.import("util",this.util)),this.entityState=n?t.states[n]:void 0,this.interpreter.import("functions",a),this.interpreter.import("entity",this.entityState),this.interpreter.import("entities",t.states),this.interpreter.import("states",t.states),this.interpreter.import("hass",t),this.interpreter.import("element",r),this.interpreter.import("elements",s),this.interpreter.import("action",(e=>{e.action=(null==e?void 0:e.action)||"call-service",function(e,t){const i=new CustomEvent(Tn,{detail:t,bubbles:!0,composed:!0});e.dispatchEvent(i)}(r,{actionConfig:e,entityId:n,svgElementInfo:o,ruleInfo:c})}));try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(be(e))}return this.interpreter.exports.result}}Pn.cache={},Pn.interpreter=new(ye())({ecmaVer:2019,sandBox:!0}),Pn.util={color:pe,date:ge};class On{constructor(e,t,i){this.element=e,this.logLevel=t,this.consoleLogLevel=i,this.logLevelGroups={error:["error"],warn:["error","warning","warn"],warning:["error","warning","warn"],info:["error","warning","warn","info"],debug:["error","warning","warn","info","debug"]}}log(e,t,i=!1){var n;const r=`${cn.formatDate(new Date)} ${e.toUpperCase()} ${t}`,s=this.logLevel&&this.logLevelGroups[this.logLevel.toLowerCase()],a=(null==s?void 0:s.length)&&s.includes(e.toLowerCase());if((i||a)&&this.element){const t=document.createElement("li");cn.addClass(t,e),t.textContent=r,null===(n=this.element.querySelector("ul"))||void 0===n||n.prepend(t),this.element.style.display="block"}this.consoleLog(e,t,i)}consoleLog(e,t,i=!1){const n=`${cn.formatDate(new Date)} ${e.toUpperCase()} ${t}`,r=this.consoleLogLevel&&this.logLevelGroups[this.consoleLogLevel.toLowerCase()],s=(null==r?void 0:r.length)&&r.includes(e.toLowerCase());if(i||s)switch(e){case"error":console.error(n);break;case"warn":case"warning":console.warn(n);break;case"info":console.info(n);break;default:console.log(n)}}}var Nn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a},Mn=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}c((n=n.apply(e,t||[])).next())}))};const Ln=_n;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.45","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Dn=class extends ee{constructor(){super(),this.pageInfos={},this.entityInfos={},this.elementInfos={},this.cssRules=[],this.functions={},this.variables={},this.svgElements={},this.isRulesLoaded=!1,window.onerror=this.handleWindowError.bind(this)}render(){return $`
<div id="floorplan-container">
<div id="floorplan"></div>
<div id="log" style="display: ${this.isShowLog?"block":"none"};">
<a href="#" onclick="return false;" @click=${this.clearLog}>Clear log<a/>
<ul></ul>
</div>
</div>
`}static get styles(){return a`
:host #floorplan-container {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
:host #floorplan {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
:host #log {
max-height: 150px;
overflow: auto;
background-color: #eee;
padding: 10px;
}
:host #log ul {
list-style-type: none;
padding-left: 0px;
text-align: left;
}
:host svg,
:host svg * {
/* vector-effect: non-scaling-stroke !important; */
pointer-events: all !important;
}
ha-circular-progress {
margin: auto;
}
#log {
min-height: 100px;
max-height: 100px;
overflow: auto;
background-color: #eee;
display: none;
padding: 10px;
}
#log ul {
list-style-type: none;
padding-left: 0px;
text-align: left;
}
.error {
color: #ff0000;
}
.warning {
color: #ff851b;
}
.info {
color: #0000ff;
}
.debug {
color: #000000;
}
`}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return Mn(this,void 0,void 0,(function*(){t.updated.call(this,e),e.has("_config")&&(yield this._configChanged(),yield this.hassChanged()),e.has("hass")&&(yield this.hassChanged())}))}_configChanged(){return Mn(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return Mn(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=cn.deviceId();this.hass.states[`sensor.ha_floorplan_${e}`]={entity_id:`sensor.ha_floorplan_${e}`,state:"on",last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{device_class:"ha-floorplan",friendly_name:"ha-floorplan - Floorplan for Home Assistant",icon:"mdi:floor-plan",assumed_state:!1,hidden:!0},context:{}},this.isRulesLoaded?this.handleEntities():(this.initFloorplanRules(this.svg,this.config),this.isRulesLoaded=!0,yield this.handleEntities(!0))}))}get floorplanElement(){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("floorplan")}get logElement(){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("log")}init(){return Mn(this,void 0,void 0,(function*(){try{const e=yield this.loadConfig(this._config,!1);if(this.isShowLog=void 0!==e.log_level,this.logger=new On(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.45"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage(),this.initEventListeners()}catch(e){this.handleError(e)}}))}initMultiPage(){return Mn(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return Mn(this,void 0,void 0,(function*(){try{yield this.loadStyleSheet(this.config.stylesheet);const e=this.getBestImage(this.config);this.svg=yield this.loadFloorplanSvg(e),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}loadConfig(e,t){return Mn(this,void 0,void 0,(function*(){if("string"==typeof e){let i;try{i=yield cn.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return an.load(i)}return JSON.parse(JSON.stringify(e))}))}loadScript(e,t){return e?new Promise(((i,n)=>{var r;const s=document.createElement("script");s.src=t?e:cn.cacheBuster(e),s.onload=()=>i(),s.onerror=e=>{n(new URIError(`${e.target.src}`))},null===(r=this.shadowRoot)||void 0===r||r.appendChild(s)})):Promise.resolve()}loadPages(){return Mn(this,void 0,void 0,(function*(){for(const e of this.config.pages)yield this.loadPageConfig(e,this.config.pages.indexOf(e));const e=Object.keys(this.pageInfos).map((e=>this.pageInfos[e]));e.sort(((e,t)=>e.index-t.index));const t=e.find((e=>void 0!==e.config.master_page));if(!t)throw new Error("A master page is required");t.isMaster=!0;const i=e.find((e=>void 0===e.config.master_page));i&&(i.isDefault=!0),yield this.loadPageFloorplanSvg(t,t);const n=e.filter((e=>e!==t));for(const e of n)yield this.loadPageFloorplanSvg(e,t);this.svg=t.svg}))}loadPageConfig(e,t){return Mn(this,void 0,void 0,(function*(){const i=yield this.loadConfig(e,!1),n=this.createPageInfo(i);return n.index=t,n}))}loadPageFloorplanSvg(e,t){return Mn(this,void 0,void 0,(function*(){const i=this.getBestImage(e.config),n=yield this.loadFloorplanSvg(i,e,t);n.id=e.config.page_id,e.svg=n,yield this.loadStyleSheet(e.config.stylesheet),this.initFloorplanRules(e.svg,e.config)}))}getBestImage(e){var t,i;let n="",r=!0;if("string"==typeof e.image)n=cn.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){const t=!0===(null===(i=null==e?void 0:e.image)||void 0===i?void 0:i.use_screen_width)?screen.width:window.innerWidth;e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const i of e.image.sizes)if(t>=i.min_width){n=i.location,r=!0===i.cache;break}}else cn.isMobile&&e.image_mobile?(n=e.image_mobile.location,r=!0===e.image_mobile.cache):(n=e.image.location,r=!0===e.image.cache);return{location:n,cache:r}}createPageInfo(e){const t={config:e};return t.config.rules&&this.config.rules&&(t.config.rules=t.config.rules.concat(this.config.rules)),this.pageInfos[t.config.page_id]=t,t}loadStyleSheet(e){return Mn(this,void 0,void 0,(function*(){const t="string"==typeof e?e:e.location,i="string"!=typeof e&&!0===e.cache;if(!t)return;let n;try{n=yield cn.fetchText(t,this.isDemo,this.examplespath,i)}catch(e){throw this.logError("STYLESHEET",`Error loading stylesheet: ${t}`),e}const r=document.createElement("style"),s=()=>{var e;r.innerHTML=n,null===(e=this.shadowRoot)||void 0===e||e.appendChild(r)};try{yield cn.waitForChildNodes(r,s,1e4)}catch(e){this.logError("STYLESHEET","Error loading stylesheet")}const a=this.getCssRules(r);this.cssRules=this.cssRules.concat(a)}))}getCssRules(e){var t,i,n,r,s,a;let o;if(e.sheet)o=null!==(i=null===(t=e.sheet)||void 0===t?void 0:t.cssRules)&&void 0!==i?i:null===(n=e.sheet)||void 0===n?void 0:n.rules;else{const t=e;t.styleSheet&&(o=null!==(s=null===(r=t.styleSheet)||void 0===r?void 0:r.cssRules)&&void 0!==s?s:null===(a=t.styleSheet)||void 0===a?void 0:a.rules)}return o?cn.getArray(o):[]}loadFloorplanSvg(e,t,i){return Mn(this,void 0,void 0,(function*(){let n;try{n=yield cn.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const r=document.createElement("div");r.innerHTML=n;const s=r.querySelector("svg");if(t&&s.setAttribute("id",t.config.page_id),s.setAttribute("height","100%"),s.setAttribute("width","100%"),s.style.height="100%",s.style.width="100%",s.style.margin="auto",s.style.cursor="default",s.style.opacity="0",s.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&i){const e=i.config.page_id,n=i.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement&&this.replaceChildrenUtil(this.floorplanElement,s);else{const e=this.floorplanElement.querySelector("#"+n),t=Number.parseFloat(s.getAttribute("height")),i=Number.parseFloat(s.getAttribute("width"));s.getAttribute("viewBox")||s.setAttribute("viewBox",`0 0 ${i} ${t}`),s.setAttribute("preserveAspectRatio","xMinYMin meet"),s.setAttribute("height",e.getAttribute("height")),s.setAttribute("width",e.getAttribute("width")),s.setAttribute("x",e.getAttribute("x")),s.setAttribute("y",e.getAttribute("y")),(null==e?void 0:e.parentElement)&&this.replaceChildrenUtil(e.parentElement,s)}}else this.floorplanElement&&this.replaceChildrenUtil(this.floorplanElement,s);return s}))}replaceChildrenUtil(e,t){return Mn(this,void 0,void 0,(function*(){if(null==e?void 0:e.replaceChildren)e.replaceChildren(t);else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(t)}}))}loadImage(e,t,i,n,r){return Mn(this,void 0,void 0,(function*(){return e.toLowerCase().includes(".svg")||"svg"===t.svgElement.nodeName||t.svgElement.querySelector("svg")?yield this.loadSvgImage(e,t,i,n,r):yield this.loadBitmapImage(e,t,i,n,r)}))}loadBitmapImage(e,t,i,n,r){return Mn(this,void 0,void 0,(function*(){e=r?e:cn.cacheBuster(e),this.logDebug("IMAGE",`${i} (setting image: ${e})`);let s=t.svgElement;return"image"!==s.nodeName&&(s=this.createImageElement(t.originalSvgElement),t.svgElement=this.replaceElement(t.svgElement,s),this.attachClickHandlers(s,t,i,void 0,n),s.onmouseover=()=>{this.handleEntityIdSetHoverOver(i,t)}),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),s}))}loadSvgImage(e,t,i,n,r){return Mn(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield cn.fetchText(e,this.isDemo,this.examplespath,r)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e}`),t}else{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 0 0"),s=e.outerHTML}this.logDebug("IMAGE",`${i} (setting image: ${e})`);const a="g"===t.svgElement.nodeName?t.svgElement:document.createElement("div");a.innerHTML=s;const o=a.querySelector("svg"),c=Number.parseFloat(o.getAttribute("height")),l=Number.parseFloat(o.getAttribute("width"));if(o.getAttribute("viewBox")||o.setAttribute("viewBox",`0 0 ${l} ${c}`),o.id=t.svgElement.id,o.setAttribute("preserveAspectRatio","xMinYMin meet"),null!==t.originalBBox&&(o.setAttribute("height",t.originalBBox.height.toString()),o.setAttribute("width",t.originalBBox.width.toString()),o.setAttribute("x",t.originalBBox.x.toString()),o.setAttribute("y",t.originalBBox.y.toString())),"g"!==t.svgElement.nodeName){const e=t.svgElement.getAttribute("transform");e&&o.setAttribute("transform",e),t.svgElement=this.replaceElement(t.svgElement,o)}return this.attachClickHandlers(o,t,i,void 0,n),t.svgElement.onmouseover=()=>{this.handleEntityIdSetHoverOver(i,t)},o}))}_querySelectorAll(e,t=void 0,i){let n=t?Array.from(e.querySelectorAll(t).values()):[];return n=i?[e].concat(n):n,n}replaceElement(e,t){const i=e.parentElement;for(const i of Array.from(e.classList))t.classList.add(i);return this._querySelectorAll(e,"*",!0).forEach((e=>{Ln.off(e,"click"),Ln.off(e,"longClick"),e.remove()})),e.remove(),null==i||i.appendChild(t),t}initPageDisplay(){if(this.config.pages)for(const e of Object.values(this.pageInfos))e.svg.style.opacity="1",e.svg.style.display=e.isMaster||e.isDefault?"initial":"none";else this.svg.style.opacity="1",this.svg.style.display="block"}initVariables(){if(this.config.variables)for(const e of this.config.variables)this.initVariable(e);if(this.config.pages)for(const e of Object.values(this.pageInfos))if(e.config.variables)for(const t of e.config.variables)this.initVariable(t)}initVariable(e){let t,i;if("string"==typeof e?t=e:(t=e.name,i=e.value,e.value&&(i=this.evaluate(e.value,t,void 0))),!this.entityInfos[t]){const e={entityId:t,ruleInfos:[],lastState:void 0};this.entityInfos[t]=e}this.hass.states[t]||(this.hass.states[t]={entity_id:t,state:i,last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{},context:{}}),this.setVariable(t,i,{},!0)}getActionConfigs(e){var t,i;if(null==e)return[];if(Array.isArray(e)){for(const i of e)i.action=null!==(t=i.action)&&void 0!==t?t:"call-service";return e}return"object"==typeof e?(e.action=null!==(i=e.action)&&void 0!==i?i:"call-service",[e]):"string"==typeof e?e.includes(".")?[{action:"call-service",service:e}]:[{action:e}]:[]}initEventListeners(){this.addEventListener(Tn,this.handleEventActionCall)}initStartupActions(){if(this.handleActions(this.config.startup_action,void 0,void 0,void 0),this.config.pages)for(const e of Object.values(this.pageInfos))this.handleActions(e.config.startup_action,void 0,void 0,void 0)}initFloorplanRules(e,t){if(!t.rules)return;const i=this._querySelectorAll(e,"*",!0);for(const e of i)e.id&&(this.svgElements[e.id]=e);this.initRules(t,e,i)}initRules(e,t,i){if(e.functions&&(this.functions=this.evaluate(e.functions)),e.defaults){const t=e.defaults;for(const i of e.rules)i.hover_action=void 0===i.hover_action?t.hover_action:i.hover_action,i.tap_action=void 0===i.tap_action?t.tap_action:i.tap_action,i.hold_action=void 0===i.hold_action?t.hold_action:i.hold_action,i.hover_info_filter=void 0===i.hover_info_filter?t.hover_info_filter:i.hover_info_filter}for(const n of e.rules)n.entity||n.entities?this.initEntityRule(n,t,i):(n.element||n.elements)&&this.initElementRule(n,t,i)}initEntityRule(e,t,i){const n=this.initGetEntityRuleEntities(e);for(const r of n){const n=r.entityId;let s=this.entityInfos[n];s||(s={entityId:n,ruleInfos:[],lastState:void 0},this.entityInfos[n]=s);const a=new dn(e);s.ruleInfos.push(a);for(const e of r.elementIds){const r=i.find((t=>t.id===e));if(!r){this.logWarning("CONFIG",`Cannot find element '${e}' in SVG file`);continue}const o=this.addSvgElementToRule(t,r,a);o.svgElement=r,r.querySelector("title")||r.appendChild(document.createElementNS("http://www.w3.org/2000/svg","title")),r.onmouseenter=()=>{this.handleEntitySetHoverOver(s,o)},r.onmouseleave=()=>{this.handleEntitySetHoverOver(s,o)},this.attachClickHandlers(r,o,n,void 0,a)}}}initGetEntityRuleEntities(e){const t=[];e.groups=e.groups?e.groups:[];for(const i of e.groups){const e=this.hass.states[i];if(e)for(const i of e.attributes.entity_id)this.addTargetEntity(i,[i],t);else this.logWarning("CONFIG",`Cannot find '${i}' in Home Assistant groups`)}e.entities=e.entities?e.entities:[],e.entities=e.entity?e.entities.concat(e.entity):e.entities;const i=e.entities.filter((e=>"string"==typeof e));for(const n of i){let i=[];e.elements?i=i.concat(e.elements):e.element?i=i.concat(this.evaluate(e.element,n,void 0)):null!==e.element&&(i=i.concat(n)),n&&"*"===n||this.addTargetEntity(n,i,t)}const n=e.entities.filter((e=>"string"!=typeof e));for(const e of n){const i=e;this.addTargetEntity(i.entity,[i.element],t)}return t}addTargetEntity(e,t,i){const n=this.hass.states[e],r="floorplan"===e.split(".")[0];n||r?i.push({entityId:e,elementIds:t}):this.logWarning("CONFIG",`Cannot find '${e}' in Home Assistant entities`)}initElementRule(e,t,i){if(e.element||e.elements){e.elements=e.elements?e.elements:[],e.elements=e.element?e.elements.concat(e.element):e.elements;for(const n of e.elements){const r=i.find((e=>e.id===n));if(r){let i=this.elementInfos[n];i||(i={ruleInfos:[],lastState:void 0},this.elementInfos[n]=i);const s=new dn(e);i.ruleInfos.push(s);const a=this.addSvgElementToRule(t,r,s);this.attachClickHandlers(r,a,void 0,n,s)}else this.logWarning("CONFIG",`Cannot find '${n}' in SVG file`)}}}attachClickHandlers(e,t,i,n,r){this._querySelectorAll(e,void 0,!0).forEach((s=>{const a=s,o=s===e;if(a.querySelector("title")||a.appendChild(document.createElementNS("http://www.w3.org/2000/svg","title")),r.rule.tap_action||r.rule.double_tap_action){const e=!!r.rule.tap_action&&this.getActionConfigs(r.rule.tap_action),s=!!r.rule.double_tap_action&&this.getActionConfigs(r.rule.double_tap_action),c=!!e&&new fn(this,i,n,t,r,e);if(e&&!s&&Ln.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new fn(this,i,n,t,r,s);In.observe(a),e&&Ln.on(a,"singleClick",this.onClick.bind(c)),Ln.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),cn.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new fn(this,i,n,t,r,e);En.observe(a),Ln.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),cn.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,i){const n=t.getBBox?t.getBBox():null,r=new pn(t.id,t,t,n);return i.svgElementInfos[t.id]=r,r}createImageElement(e){const t=document.createElementNS("http://www.w3.org/2000/svg","image");return t.setAttribute("id",e.getAttribute("id")),t.setAttribute("x",e.getAttribute("x")),t.setAttribute("y",e.getAttribute("y")),t.setAttribute("height",e.getAttribute("height")),t.setAttribute("width",e.getAttribute("width")),t}handleEntities(e=!1){return Mn(this,void 0,void 0,(function*(){this.handleElements();const t=this.getChangedEntities(e);for(const e of Object.keys(this.variables))t.add(e);if(t.size)for(const e of t)yield this.handleEntity(e)}))}getChangedEntities(e){const t=new Set,i=Object.keys(this.hass.states),n=cn.deviceId();for(const r of i)if(r!==`sensor.ha_floorplan_${n}`||t.has(r)){const i=this.entityInfos[r];if(i){const n=this.hass.states[r];if(e)this.logDebug("STATE",`${r}: ${n.state} (initial load)`),t.has(r)||t.add(r);else if(i.lastState){const e=n.state;n.last_changed!==i.lastState.last_changed?(this.logDebug("STATE",`${r}: ${e} (last changed ${cn.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r)):cn.equal(i.lastState.attributes,n.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${cn.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return Mn(this,void 0,void 0,(function*(){const t=this.hass.states[e],i=this.entityInfos[e];if(i){i.lastState=Object.assign({},t);for(const e of i.ruleInfos){const t=Object.values(e.svgElementInfos);if(t.length)for(const n of t)n.svgElement&&this.handleActions(e.rule.state_action,i.entityId,n,e);else this.handleActions(e.rule.state_action,i.entityId,void 0,e)}}}))}handleElements(){return Mn(this,void 0,void 0,(function*(){for(const e of Object.values(this.elementInfos))for(const t of e.ruleInfos)for(const e of Object.values(t.svgElementInfos))this.handleActions(t.rule.state_action,void 0,e,t)}))}handleEntityIdSetHoverOver(e,t){const i=this.entityInfos[e];i&&this.handleEntitySetHoverOver(i,t)}handleEntitySetHoverOver(e,t){const i=e.entityId,n=this.hass.states[i];for(const i of e.ruleInfos)if(i.rule.hover_action){let r="string"==typeof i.rule.hover_action&&"hover-info"===i.rule.hover_action;if(r=r||"object"==typeof i.rule.hover_action&&"hover-info"===i.rule.hover_action.action,r=r||Array.isArray(i.rule.hover_action)&&i.rule.hover_action.some((e=>"hover-info"===e.action)),r){const e=new Set(i.rule.hover_info_filter);for(const t of Object.values(i.svgElementInfos))cn.addClass(t.svgElement,"floorplan-hover"),t.svgElement.style.cursor="pointer",t.svgElement.querySelectorAll("title").forEach((t=>{let i=`${n.attributes.friendly_name}\n`;i+=`State: ${n.state}\n\n`,Object.keys(n.attributes).map((t=>{e.has(t)||(i+=`${t}: ${n.attributes[t]}\n`)})),i+="\n",i+=`Last changed: ${ge.timeago(n.last_changed)}\n`,i+=`Last updated: ${ge.timeago(n.last_updated)}`,t.textContent=i}))}else i.rule.hover_action&&this.handleActions(i.rule.hover_action,e.entityId,t,i)}}isOptionEnabled(e){return null===e||void 0!==e}validateConfig(e){let t=!0;if(e.pages||e.rules)if(e.pages)e.pages.length||this.logWarning("CONFIG","The 'pages' section must contain one or more pages in floorplan configuration");else{e.rules||this.logWarning("CONFIG","Cannot find 'rules' in floorplan configuration");let i=e.rules.filter((e=>e.entities&&e.elements));i.length&&(this.logError("CONFIG","A rule cannot contain both 'entities' and 'elements' in floorplan configuration"),t=!1),i=e.rules.filter((e=>!(e.entity||e.entities||e.element||e.elements))),i.length&&(this.logError("CONFIG","A rule must contain either 'entities' or 'elements' in floorplan configuration"),t=!1)}else this.logWarning("CONFIG","Cannot find 'pages' nor 'rules' in floorplan configuration");return t}evaluate(e,t,i,n,r){if("string"!=typeof e||!Pn.isCode(e))return e;try{return Pn.evaluate(e,this.hass,this.config,t,i,this.svgElements,this.functions,n,r)}catch(n){return this.handleError(n,{expression:e,entityId:t,hass:this.hass,svgElement:i})}}onClick(e){e.stopPropagation(),e.preventDefault();const t=this;t.instance.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}onLongClick(e){e.stopPropagation(),e.preventDefault();const t=this,i=t.instance;setTimeout((()=>{i.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}),300)}handleActions(e,t,i,n){var r;const s=this.getActionConfigs(e);for(const e of s){if(e.confirmation&&(!e.confirmation.exemptions||!e.confirmation.exemptions.some((e=>e.user===this.hass.user.id)))&&!confirm(e.confirmation.text||`Are you sure you want to ${e.action}?`))return;switch(e.action){case"more-info":this.isDemo?this.notify(`Performing action: ${e.action} ${t}`):hn(this,"hass-more-info",{entityId:t});break;case"navigate":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.navigation_path}`);else{const n=this.evaluate(e.navigation_path,t,null==i?void 0:i.svgElement);un(0,n,null!==(r=e.navigation_replace)&&void 0!==r&&r)}break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const n=e.same_tab?"_self":"_blank",r=this.evaluate(e.url_path,t,null==i?void 0:i.svgElement);window.open(r,n)}break;case"toggle":if(t){const e={action:"call-service",service:"homeassistant.toggle",service_data:{entity_id:t}};this.callService(e,t,i,n)}break;case"call-service":if(!e.service)return;this.callService(e,t,i,n);break;case"fire-dom-event":hn(this,"ll-custom",e)}}}getSvgElementsFromServiceData(e,t){let i=[],n=[];if(Array.isArray(null==e?void 0:e.elements)&&(n=n.concat(null==e?void 0:e.elements)),"string"==typeof(null==e?void 0:e.element)&&(n=n.concat([null==e?void 0:e.element])),n.length)for(const e of n)i=i.concat(this._querySelectorAll(this.svg,`#${e.replace(/\./g,"\\.")}`,!1));else t&&(i=[t]);return i}getServiceData(e,t,i){let n={};if("object"==typeof e.service_data)for(const r of Object.keys(e.service_data))n[r]=this.evaluate(e.service_data[r],t,i);else if("string"==typeof e.service_data){const r=this.evaluate(e.service_data,t,i);n="string"==typeof r&&r.trim().startsWith("{")?JSON.parse(r):r}else void 0!==e.service_data&&(n=e.service_data);return n}executeServiceData(e,t,i,n,r){try{if("object"==typeof e.service_data)for(const s of Object.keys(e.service_data))this.evaluate(e.service_data[s],t,i,n,r);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,i,n,r):void 0!==e.service_data&&this.logWarning("CONFIG","Invalid execution data");return!0}catch(e){return this.logWarning("CONFIG","Error thrown while executing service"),!1}}callService(e,t,i,n){const r=this.evaluate(e.service,t,null==i?void 0:i.svgElement),[s,a]=r.split(".",2);"floorplan"===s?this.callFloorplanService(s,a,e,t,i,n):this.callHomeAssistantService(s,a,e,t,i)}callFloorplanService(e,t,i,n,r,s){var a,o,c;const l=null!==(a=null==r?void 0:r.svgElement)&&void 0!==a?a:void 0;let h,u,p,d,f,m,g,v,y,b=[],x=null;switch(x=["execute"].includes(t)?{}:this.getServiceData(i,n,l),t){case"class_toggle":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(i,n,e)),p="string"==typeof x?x:x.class,cn.toggleClass(e,p);break;case"class_set":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(i,n,e)),p="string"==typeof x?x:x.class,cn.setClass(e,p);break;case"dataset_set":{let e,t;if("string"==typeof x){const i=x.split(":");if(i.length<2){this.logError("FLOORPLAN_ACTION",`Service data "${x}" is not a valid dataset key value pair.`);break}e=i[1],t=i[0]}else e=x.value,t=x.key;b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const s of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(i,n,s)),cn.datasetSet(s,t,e);break}case"style_set":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(i,n,e)),d="string"==typeof x?x:x.style,cn.setStyle(e,d);break;case"text_set":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b){y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(i,n,e)),v="string"==typeof x?x:x.text;const t=(null===(o=i.service_data)||void 0===o?void 0:o.shift_y_axis)?null===(c=i.service_data)||void 0===c?void 0:c.shift_y_axis:"1em";cn.setText(e,v,t)}break;case"image_set":r&&s&&(x=this.getServiceData(i,n,null==r?void 0:r.svgElement),f="string"==typeof x?x:x.image,m="object"==typeof x?x.image_refresh_interval:0,g=!(m>0||"object"==typeof x&&!0!==x.cache),s.imageLoader&&clearInterval(s.imageLoader),m&&(s.imageLoader=setInterval(this.loadImage.bind(this),1e3*m,f,r,n,s,g)),this.loadImage(f,r,n,s,g));break;case"page_navigate":x=this.getServiceData(i,n,null==r?void 0:r.svgElement),h=x.page_id,u=h?this.pageInfos[h]:void 0,u&&(Object.keys(this.pageInfos).map((e=>{const t=this.pageInfos[e];t.isMaster||"none"===t.svg.style.display||(t.svg.style.display="none")})),u.svg.style.display="block");break;case"variable_set":if(x=this.getServiceData(i,n,null==r?void 0:r.svgElement),x.variable){const e={};if(x.attributes){const t=x.attributes;for(const i of Object.keys(t))e[i]=this.getActionValue(t[i],n,l)}const t=x,i=this.getActionValue(t,n,l);this.setVariable(x.variable,i,e,!1)}break;case"execute":this.executeServiceData(i,n,null==r?void 0:r.svgElement,r,s);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(i,n,e,r,s)}}getActionValue(e,t,i){let n=e.value;return e.value&&(n=this.evaluate(e.value,t,i)),n}setVariable(e,t,i,n){if(this.variables[e]=t,this.hass.states[e]){this.hass.states[e].state=t.toString();for(const t of Object.keys(i))this.hass.states[e].attributes[t]=i[t]}for(const e of Object.keys(this.variables)){const t=this.hass.states[e];t&&(t.last_changed=(new Date).toString())}n||this.handleEntities()}callHomeAssistantService(e,t,i,n,r){const s=this.getServiceData(i,n,null==r?void 0:r.svgElement);"object"==typeof s&&(null===s.entity_id||Array.isArray(s.entity_id)&&!s.entity_id.length||!s.entity_id&&n&&(s.entity_id=n)),this.hass.callService(e,t,s),this.isDemo&&this.notify(`Calling service: ${e}.${t} (${s.entity_id})`)}handleEventActionCall(e){const t=e,{actionConfig:i,entityId:n,svgElementInfo:r,ruleInfo:s}=t.detail;this.handleActions(i,n,r,s)}handleWindowError(e,t,i,n,r){if(e.toLowerCase().includes("script error"))this.logError("SCRIPT","Script error: See browser console for detail");else{const s=[e,"URL: "+t,"Line: "+i+", column: "+n,"Error: "+JSON.stringify(r)].join("<br>");this.logError("ERROR",s)}return!1}handleError(e,t){console.error(e,t);let i="Error";"string"==typeof e&&(i=e),e.message?i=`${e.message} (See console for more info)`:e.stack&&(i=`${e.stack}`),this.logger.log("error",i)}logError(e,t){this.logger.log("error",`${e} ${t}`)}logWarning(e,t){this.logger.log("warning",`${e} ${t}`)}logInfo(e,t){this.logger.log("info",`${e} ${t}`)}logDebug(e,t){this.logger.log("debug",`${e} ${t}`)}};Nn([re({type:String})],Dn.prototype,"examplespath",void 0),Nn([re({type:Object})],Dn.prototype,"hass",void 0),Nn([re({type:String||Object})],Dn.prototype,"_config",void 0),Nn([re({type:Boolean})],Dn.prototype,"isDemo",void 0),Nn([re({type:Boolean})],Dn.prototype,"isShowLog",void 0),Nn([re({type:Function})],Dn.prototype,"notify",void 0),Dn=Nn([ie("floorplan-element")],Dn);
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const $n=e=>(...t)=>({_$litDirective$:e,values:t});class Rn{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const jn=$n(class extends Rn{constructor(e){var t;if(super(e),1!==e.type||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const n=e[i];return null==n?t:t+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.vt){this.vt=new Set;for(const e in t)this.vt.add(e);return this.render(t)}this.vt.forEach((e=>{null==t[e]&&(this.vt.delete(e),e.includes("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const n=t[e];null!=n&&(this.vt.add(e),e.includes("-")?i.setProperty(e,n):i[e]=n)}return R}});var Bn,Vn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Fn=Bn=class extends ee{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?$`
<ha-card>
${this.isDisplayCardHeader?$` <h1 class="card-header">${null===(e=this.config)||void 0===e?void 0:e.title}</h1> `:""}
<div class="content" style=${jn(this.styles)}>
<floorplan-element
.examplespath=${this.examplespath}
.hass=${this.hass}
._config=${null===(t=this.config)||void 0===t?void 0:t.config}
.isDemo=${this.isDemo}
.notify=${this.notify}
></floorplan-element>
</div>
</ha-card>
`:$``}static get styles(){return a`
/* header (main toolbar) */
/* --header-height: 56px; */
/* card header */
/* height: 76px; */
:host .content,
:host .content floorplan-element {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
`}get isFullHeight(){var e;return null===(e=this.config)||void 0===e?void 0:e.full_height}get view(){return this._view||(this._view=ln.closestElement("#view",this)),this._view}get appHeader(){var e;return this._appHeader||(this._appHeader=null===(e=this.view)||void 0===e?void 0:e.previousElementSibling),this._appHeader}get appHeaderHeight(){if(this.isDemo)return 0;const e=this.appHeader;return e?e.clientHeight:0}get cardHeaderHeight(){return this.isDemo?0:this.isDisplayCardHeader?Bn.cardHeaderHeight:0}get isDisplayCardHeader(){var e,t;return!this.isDemo&&(null===(t=null===(e=this.config)||void 0===e?void 0:e.title)||void 0===t?void 0:t.trim().length)>0}getCardSize(){return 1}setConfig(e){this.config=e}update(e){this.isFullHeight?this.styles={height:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}:this.styles={dummy:""},super.update(e)}};Fn.cardHeaderHeight=76,Vn([re({type:Object})],Fn.prototype,"hass",void 0),Vn([re({type:Boolean})],Fn.prototype,"isPanel",void 0),Vn([re({type:Boolean})],Fn.prototype,"editMode",void 0),Vn([re({type:Object})],Fn.prototype,"config",void 0),Vn([re({type:String})],Fn.prototype,"examplespath",void 0),Vn([re({type:Boolean})],Fn.prototype,"isDemo",void 0),Vn([re({type:Function})],Fn.prototype,"notify",void 0),Fn=Bn=Vn([ie("floorplan-card")],Fn);var Un,Hn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let qn=Un=class extends ee{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return $`
<ha-app-layout>
<app-header fixed slot="header" ?hidden=${!this.showAppHeader}>
<app-toolbar>
<ha-menu-button .hass=${this.hass} .narrow=${this.narrow}"></ha-menu-button>
<div main-title>${null===(e=this.panel)||void 0===e?void 0:e.title}</div>
</app-toolbar>
</app-header>
<div class="content" style=${jn(this.styles)}>
<floorplan-element .examplespath=${this.examplespath} .hass=${this.hass}
._config=${null===(i=null===(t=this.panel)||void 0===t?void 0:t.config)||void 0===i?void 0:i.config} .isDemo=${this.isDemo} .notify=${this.notify}>
</floorplan-element>
</div>
</ha-app-layout>
`}static get styles(){return a`
:host .content,
:host .content floorplan-element {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
[hidden] {
display: none !important;
}
`}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Un.appHeaderHeight:0}update(e){this.panel&&(this.showSideBar=!1!==this.panel.config.show_side_bar,this.showAppHeader=!1!==this.panel.config.show_app_header&&!this.isDemo,this.hass&&!1===this.panel.config.show_side_bar&&(this.hass.dockedSidebar="always_hidden"),this.styles={height:`calc(100vh - ${this.appHeaderHeight}px)`}),super.update(e)}};qn.appHeaderHeight=64,Hn([re({type:Object})],qn.prototype,"hass",void 0),Hn([re({type:Boolean})],qn.prototype,"narrow",void 0),Hn([re({type:Object})],qn.prototype,"panel",void 0),Hn([re({type:Boolean})],qn.prototype,"showSideBar",void 0),Hn([re({type:Boolean})],qn.prototype,"showAppHeader",void 0),Hn([re({type:String})],qn.prototype,"examplespath",void 0),Hn([re({type:Boolean})],qn.prototype,"isDemo",void 0),Hn([re({type:Function})],qn.prototype,"notify",void 0),qn=Un=Hn([ie("floorplan-panel")],qn);
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
class zn extends Rn{constructor(e){if(super(e),this.it=j,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===j||null==e)return this._t=void 0,this.it=e;if(e===R)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}zn.directiveName="unsafeHTML",zn.resultType=1;const Wn=$n(zn);var Yn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Gn=class extends ee{constructor(){super(...arguments),this.lang="",this.code=""}render(){return $` <pre><code>${Wn(this.code)}</code></pre> `}static get styles(){return a`
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #f0f0f0;
}
/* Base color: saturation 0; */
.hljs,
.hljs-subst {
color: #444;
}
.hljs-comment {
color: #888888;
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
font-weight: bold;
}
/* User color: hue: 0 */
.hljs-type,
.hljs-string,
.hljs-number,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
color: #880000;
}
.hljs-title,
.hljs-section {
color: #880000;
font-weight: bold;
}
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #bc6060;
}
/* Language color: hue: 90; */
.hljs-literal {
color: #78a960;
}
.hljs-built_in,
.hljs-bullet,
.hljs-code,
.hljs-addition {
color: #397300;
}
/* Meta color: hue: 200 */
.hljs-meta {
color: #1f7199;
}
.hljs-meta-string {
color: #4d99bf;
}
/* Misc effects */
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
`}};Yn([re({type:String})],Gn.prototype,"lang",void 0),Yn([re({type:String})],Gn.prototype,"code",void 0),Gn=Yn([ie("code-block")],Gn);var Jn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Xn=class extends ee{render(){return $`
<div>
<div>
${this.example.isCard?$`<floorplan-card
.examplespath=${this.examplespath}
.hass=${this.hass}
.config=${this.config}
.isDemo=${this.isDemo}
.notify=${this.notify}
></floorplan-card>`:$` <floorplan-panel
.examplespath=${this.examplespath}
.hass=${this.hass}
.panel=${this.config}
.isDemo=${this.isDemo}
.notify=${this.notify}
></floorplan-panel>`}
</div>
<!--div>
<code-block lang="yaml" code=${this.configYaml}></code-block>
</div-->
</div>
`}static get styles(){return a``}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}c((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(t.update.call(this,e),(e.has("example")||e.has("examplespath"))&&this.example&&this.examplespath){const e=`${this.examplespath}/${this.example.dir}/${this.example.configFile}`,t=yield cn.fetchText(e,!0,this.examplespath,!1);if(this.config=cn.parseYaml(t),this.configYaml=t,this.example.simulationFile){const e=`${this.examplespath}/${this.example.dir}/${this.example.simulationFile}`,t=yield cn.fetchText(e,!0,this.examplespath,!1),i=cn.parseYaml(t);this.simulator=new we(i,this.setHass.bind(this))}}}))}setHass(e){this.hass=e}};Jn([re({type:Object})],Xn.prototype,"hass",void 0),Jn([re({type:Object})],Xn.prototype,"config",void 0),Jn([re({type:String})],Xn.prototype,"configYaml",void 0),Jn([re({type:String})],Xn.prototype,"examplespath",void 0),Jn([re({type:Object})],Xn.prototype,"example",void 0),Jn([re({type:Boolean})],Xn.prototype,"isDemo",void 0),Jn([re({type:Function})],Xn.prototype,"notify",void 0),Xn=Jn([ie("floorplan-example")],Xn);var Kn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Qn=class extends ee{constructor(){super(),this._toastText=""}render(){return $` <div role="alert">${this._toastText}</div> `}static get styles(){return a`
:host {
display: none;
justify-content: center;
width: 100%;
/*visibility: hidden;*/
position: fixed;
z-index: var(--lt-z-index, 2);
bottom: var(--lt-bottom, 40px);
}
:host(.show) {
display: flex;
/*visibility: visible;*/
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
div {
min-width: 100px;
background-color: var(--lt-background-color, #292929);
color: var(--lt-color, #dddddd);
text-align: center;
border-radius: var(--lt-border-radius, 2px);
padding: var(--lt-padding, 16px);
border: var(--lt-border, none);
font-size: var(--lt-font-size, 1em);
font-family: var(--lt-font-family, sans-serif);
}
@-webkit-keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
to {
bottom: var(--lt-bottom, 40px);
opacity: 1;
}
}
@keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
to {
bottom: var(--lt-bottom, 40px);
opacity: 1;
}
}
@-webkit-keyframes fadeout {
from {
bottom: var(--lt-bottom, 40px);
opacity: 1;
}
to {
bottom: 0;
opacity: 0;
}
}
@keyframes fadeout {
from {
bottom: var(--lt-bottom, 40px);
opacity: 1;
}
to {
bottom: 0;
opacity: 0;
}
}
`}firstUpdated(){this.style.setProperty("aria-live","assertive"),this.style.setProperty("aria-atomic","true"),this.style.setProperty("aria-relevant","all")}show(e=""){"show"===this.className||(this._toastText=e,this.className="show",setTimeout((()=>{this.className=this.className.replace("show","")}),3e3))}};Kn([re({type:String})],Qn.prototype,"_toastText",void 0),Qn=Kn([ie("lit-toast")],Qn);var Zn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let er=class extends ee{constructor(){super(),this.floorplanExamples=[{name:"remote",dir:"remote",configFile:"remote.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"light",dir:"light",configFile:"light.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"ring",dir:"ring",configFile:"ring.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"rinnai",dir:"rinnai",configFile:"rinnai.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"floorplanner_home",dir:"floorplanner_home",configFile:"floorplanner_home.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"home",dir:"home",configFile:"home.yaml",simulationFile:"simulations.yaml",isCard:!1},{name:"multi_floor",dir:"multi_floor",configFile:"multi_floor.yaml",simulationFile:"simulations.yaml",isCard:!1}]}render(){var e;return $`
${null===(e=this.examples)||void 0===e?void 0:e.map((e=>$` <floorplan-example
.examplespath=${this.examplespath}
.example=${e}
.isDemo="${!0}"
.notify=${this.notify.bind(this)}
></floorplan-example>`))}
<lit-toast></lit-toast>
`}static get styles(){return a``}connectedCallback(){if(super.connectedCallback(),this.dataset.include&&!this.examples){const e=this.dataset.include.split(",").map((e=>e.trim()));this.examples=this.floorplanExamples.filter((t=>e.includes(t.name.toLocaleLowerCase())))}}get litToast(){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("lit-toast")}notify(e){this.litToast.show(e)}};Zn([re({type:String})],er.prototype,"examplespath",void 0),Zn([re({type:Array})],er.prototype,"examples",void 0),er=Zn([ie("floorplan-examples")],er)})()})();