From 39710232992074c27556a56b36508c17c2bf49f3 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 22 Sep 2023 14:08:06 +0000 Subject: [PATCH] Add changes to dist and docs --- dist/floorplan-examples.js | 34 ++++++++-------- dist/floorplan.js | 34 ++++++++-------- docs/_docs/floorplan/floorplan-examples.js | 46 +++++++++++----------- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/dist/floorplan-examples.js b/dist/floorplan-examples.js index 4259a1de..43cc9eb1 100644 --- a/dist/floorplan-examples.js +++ b/dist/floorplan-examples.js @@ -1,4 +1,4 @@ -(()=>{var e={1: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;yy?(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;"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));return 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})}()},449:function(e,t,i){e.exports=function(e){"use strict";var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return Xe},get VariableDeclaration(){return Qe},get VariableDeclarator(){return Ze},get ClassDeclaration(){return et},get ClassBody(){return tt},get MethodDefinition(){return it}}),n=Object.freeze({__proto__:null,get FunctionDeclaration(){return ri},get VariableDeclaration(){return si},get VariableDeclarator(){return ai},get ClassDeclaration(){return oi},get ClassBody(){return ci},get MethodDefinition(){return li}}),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;function u(e,t){h?h(e,t):e.__proto__=t}var p=Object.getPrototypeOf;function d(e){return p?p(e):e.__proto__}var f=Object.getOwnPropertyDescriptor;function m(e,t,i){for(;t;){var n=f(t,i),r=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(r)return r;t=d(t)}}function g(e,t){return m("get",e,t)}function v(e,t){return m("set",e,t)}var y=Object.create;function b(e,t){u(e,t),e.prototype=y(t.prototype,{constructor:{value:e,writable:!0}})}function x(e){for(var t=1;t=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}var M="0.4.8",O={RES:void 0},N={RES:void 0},L=T("continue"),D=T("break"),$=T("super"),R=T("supercall"),j=T("noctor"),B=T("clsctor"),V=T("newtarget"),F=T("noinit"),U=T("deadzone"),H=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}(),q=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}(),z=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=y(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 q(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!==F&&n.set(t)}else i.context[e]=new H("var",t===F?void 0:t);if(!i.parent){var r=i.find("window").get();t!==F&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("let",t)},e.prototype.const=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("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 H("var",t)},e}(); +(()=>{var e={1: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;yy?(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;"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));return 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})}()},449:function(e,t,i){e.exports=function(e){"use strict";var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return Ke},get VariableDeclaration(){return Qe},get VariableDeclarator(){return Ze},get ClassDeclaration(){return et},get ClassBody(){return tt},get MethodDefinition(){return it}}),n=Object.freeze({__proto__:null,get FunctionDeclaration(){return ri},get VariableDeclaration(){return si},get VariableDeclarator(){return ai},get ClassDeclaration(){return oi},get ClassBody(){return ci},get MethodDefinition(){return li}}),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;function u(e,t){h?h(e,t):e.__proto__=t}var p=Object.getPrototypeOf;function d(e){return p?p(e):e.__proto__}var f=Object.getOwnPropertyDescriptor;function m(e,t,i){for(;t;){var n=f(t,i),r=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(r)return r;t=d(t)}}function g(e,t){return m("get",e,t)}function v(e,t){return m("set",e,t)}var y=Object.create;function b(e,t){u(e,t),e.prototype=y(t.prototype,{constructor:{value:e,writable:!0}})}function x(e){for(var t=1;t=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}var O="0.4.8",N={RES:void 0},M={RES:void 0},L=T("continue"),D=T("break"),$=T("super"),R=T("supercall"),j=T("noctor"),B=T("clsctor"),V=T("newtarget"),F=T("noinit"),U=T("deadzone"),H=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}(),q=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}(),z=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=y(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 q(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!==F&&n.set(t)}else i.context[e]=new H("var",t===F?void 0:t);if(!i.parent){var r=i.find("window").get();t!==F&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("let",t)},e.prototype.const=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("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 H("var",t)},e}(); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -13,7 +13,7 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -function W(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]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function Y(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 K(){for(var e=[],t=0;t":return i>n;case">=":return i>=n;case"<<":return i<>":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)}}function oe(e,t){var i,n=Je(e.right,t),r=e.left;if("Identifier"===r.type){if(!(i=J(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return bi(r,t,{feed:n});i=le(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()<>=":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)}}function ce(e,t){switch(e.operator){case"||":return Je(e.left,t)||Je(e.right,t);case"&&":return Je(e.left,t)&&Je(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function le(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?xe(e.object,t,{getProto:!0}):Je(e.object,t),o)return n;if(r=e.computed?Je(e.property,t):e.property.name,l){var h=v(n,r);if("Super"===e.object.type&&h){var u=t.find("this").get(),p=T(r);return s(u,p,{set:h}),new q(u,p)}return new q(n,r)}var d=g(n,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):n[r]}function he(e,t){return Je(e.test,t)?Je(e.consequent,t):Je(e.alternate,t)}function ue(e,t){var i,n;if("MemberExpression"===e.callee.type){n=le(e.callee,t,{getObj:!0});var r=void 0;if(r=e.callee.computed?Je(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[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(i=Je(e.callee,t))||"Super"!==e.callee.type&&i[B]){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":return[2,i>n];case">=":return[2,i>=n];case"<<":return[2,i<>":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)}}}))}function ft(e,t){var i,n,r,s;return W(this,(function(a){switch(a.label){case 0:return[5,G(ni(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,G(nt(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,G(gt(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,G(di(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()<>=":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)}}}))}function mt(e,t){var i,n;return W(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,G(ni(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,G(ni(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,G(ni(e.left,t))];case 6:return(n=r.sent())?[5,G(ni(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)}}))}function gt(e,t,i){var n,r,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),W(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,G(Ct(e.object,t,{getProto:!0}))];case 1:return c=f.sent(),[3,4];case 2:return[5,G(ni(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,G(ni(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=v(c,l),"Super"===e.object.type&&h?(d=t.find("this").get(),u=T(l),s(d,u,{set:h}),[2,new q(d,u)]):[2,new q(c,l)]):(p=g(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function vt(e,t){var i;return W(this,(function(n){switch(n.label){case 0:return[5,G(ni(e.test,t))];case 1:return n.sent()?[5,G(ni(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,G(ni(e.alternate,t))];case 4:i=n.sent(),n.label=5;case 5:return[2,i]}}))}function yt(e,t){var i,n,r,s,a,o,c,l,h,u,p,d;return W(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,G(gt(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,G(ni(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[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,G(ni(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[B]){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-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function pi(e,t){var i,n,r,s,a;return W(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,G(si(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,G(si(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,G(si(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,G(pi(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,G(pi(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,G(pi(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-1;o--)e.body.splice(a[o],1);e.body=s.concat(e.body)}}function yi(e,t){switch(e.type){case"VariableDeclaration":Qe(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&Qe(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&Qe(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":yi(e.body,t);break;case"IfStatement":yi(e.consequent,t),e.alternate&&yi(e.alternate,t);break;case"BlockStatement":for(var i=0;i{"use strict";i.r(t),i.d(t,{Node:()=>ne,Parser:()=>V,Position:()=>L,SourceLocation:()=>D,TokContext:()=>ae,Token:()=>Te,TokenType:()=>g,defaultOptions:()=>R,getLineInfo:()=>$,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>S,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Le,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>_,tokenizer:()=>$e,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;ne)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 _={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})},S=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(S.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 M(e,t){return T.call(e,t)}var O=Array.isArray||function(e){return"[object Array]"===P.call(e)};function N(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=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),O(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return O(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}function B(e,t){return 2|(e?4:0)|(t?8:0)}var V=function(e,t,i){this.options=e=j(e),this.sourceFile=e.sourceFile,this.keywords=N(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=N(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=N(o),this.reservedWordsStrictBind=N(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(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=_.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},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};V.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},F.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},F.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},F.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},F.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},F.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},V.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},V.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n-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")}},U.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")},U.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case _._class:return e&&this.unexpected(),this.parseClass(s,!0);case _._if:return this.parseIfStatement(s);case _._return:return this.parseReturnStatement(s);case _._switch:return this.parseSwitchStatement(s);case _._throw:return this.parseThrowStatement(s);case _._try:return this.parseTryStatement(s);case _._const:case _._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case _._while:return this.parseWhileStatement(s);case _._with:return this.parseWithStatement(s);case _.braceL:return this.parseBlock(!0,s);case _.semi:return this.parseEmptyStatement(s);case _._export:case _._import:if(this.options.ecmaVersion>10&&r===_._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===_._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===_.name&&"Identifier"===l.type&&this.eat(_.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}},z.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(_.semi)||this.insertSemicolon()?e.label=null:this.type!==_.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(_.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.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(W),this.enterScope(0),this.expect(_.parenL),this.type===_.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===_._var||this.type===_._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===_._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===_._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 q,a=this.parseExpression(!0,s);return this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===_._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))},z.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,K|(i?0:J),!1,t)},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(_._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},z.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(_.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},z.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(_.braceL),this.labels.push(G),this.enterScope(0);for(var i=!1;this.type!==_.braceR;)if(this.type===_._case||this.type===_._default){var n=this.type===_._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(_.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")},z.parseThrowStatement=function(e){return this.next(),S.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=[];z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===_._catch){var t=this.startNode();if(this.next(),this.eat(_.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(_.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(_._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(W),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.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")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,i,n){for(var r=0,s=this.labels;r=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")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.parseBlock=function(e,t){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(_.braceL),e&&this.enterScope(0);!this.eat(_.braceR);){var i=this.parseStatement(null);t.body.push(i)}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},z.parseFor=function(e,t){return e.init=t,this.expect(_.semi),e.test=this.type===_.semi?null:this.parseExpression(),this.expect(_.semi),e.update=this.type===_.parenR?null:this.parseExpression(),this.expect(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},z.parseForIn=function(e,t){var i=this.type===_._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(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},z.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(_.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===_._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(_.comma))break}return e},z.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var K=1,J=2;z.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===_.star&&t&J&&this.unexpected(),e.generator=this.eat(_.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&K&&(e.id=4&t&&this.type!==_.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(B(e.async,e.generator)),t&K||(e.id=this.type===_.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&K?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(_.parenL),e.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.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(_.braceL);!this.eat(_.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")},z.parseClassElement=function(e){var t=this;if(this.eat(_.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===_.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(_.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(_.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},z.parseClassMethod=function(e,t,i,n){return e.value=this.parseMethod(t,i,n),this.finishNode(e,"MethodDefinition")},z.parseClassId=function(e,t){this.type===_.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},z.parseClassSuper=function(e){e.superClass=this.eat(_._extends)?this.parseExprSubscripts():null},z.parseExport=function(e,t){if(this.next(),this.eat(_.star))return this.expectContextual("from"),this.type!==_.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(_._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===_._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|K,!1,i)}else if(this.type===_._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!==_.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s=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=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(_._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(_.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===_.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(_.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0)}return a;case _.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case _.num:case _.string:return this.parseLiteral(this.value);case _._null:case _._true:case _._false:return(t=this.startNode()).value=this.type===_._null?null:this.type===_._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case _.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 _.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(_.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case _.braceL:return this.parseObj(!1,e);case _._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case _._class:return this.parseClass(this.startNode(),!1);case _._new:return this.parseNew();case _.backQuote:return this.parseTemplate();case _._import:return this.options.ecmaVersion>10?this.parseDynamicImport():this.unexpected();default:this.unexpected()}},Q.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==_.parenL&&this.unexpected(),this.finishNode(e,"Import")},Q.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")},Q.parseParenExpression=function(){this.expect(_.parenL);var e=this.parseExpression();return this.expect(_.parenR),e},Q.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 q,p=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==_.parenR;){if(l?l=!1:this.expect(_.comma),r&&this.afterTrailingComma(_.parenR,!0)){h=!0;break}if(this.type===_.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===_.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(_.parenR),e&&!this.canInsertSemicolon()&&this.eat(_.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},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Z=[];Q.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(_.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(_.parenL)?e.arguments=this.parseExprList(_.parenR,this.options.ecmaVersion>=8&&"Import"!==e.callee.type,!1):e.arguments=Z,this.finishNode(e,"NewExpression")},Q.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===_.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===_.backQuote,this.finishNode(i,"TemplateElement")},Q.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===_.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(_.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(_.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},Q.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===_.name||this.type===_.num||this.type===_.string||this.type===_.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===_.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},Q.parseObj=function(e,t){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(_.braceR);){if(n)n=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.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")},Q.parseProperty=function(e,t){var i,n,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(_.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===_.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===_.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(_.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(_.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},Q.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&this.type===_.colon&&this.unexpected(),this.eat(_.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===_.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===_.comma||this.type===_.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===_.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")}},Q.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(_.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(_.bracketR),e.key;e.computed=!1}return e.key=this.type===_.num||this.type===_.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.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|B(t,n.generator)|(i?128:0)),this.expect(_.parenL),n.params=this.parseBindingList(_.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")},Q.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|B(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")},Q.parseFunctionBody=function(e,t,i){var n=t&&this.type!==_.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},Q.isSimpleParamList=function(e){for(var t=0,i=e;t-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")},te.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},te.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},te.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 ne=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])},re=V.prototype;function se(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}re.startNode=function(){return new ne(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ne(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,i,n){return se.call(this,e,t,i,n)};var ae=function(e,t,i,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!r},oe={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},ce=V.prototype;ce.initialContext=function(){return[oe.b_stat]},ce.braceIsBlock=function(e){var t=this.curContext();return t===oe.f_expr||t===oe.f_stat||(e!==_.colon||t!==oe.b_stat&&t!==oe.b_expr?e===_._return||e===_.name&&this.exprAllowed?S.test(this.input.slice(this.lastTokEnd,this.start)):e===_._else||e===_.semi||e===_.eof||e===_.parenR||e===_.arrow||(e===_.braceL?t===oe.b_stat:e!==_._var&&e!==_._const&&e!==_.name&&!this.exprAllowed):!t.isExpr)},ce.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},ce.updateContext=function(e){var t,i=this.type;i.keyword&&e===_.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},_.parenR.updateContext=_.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===oe.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},_.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?oe.b_stat:oe.b_expr),this.exprAllowed=!0},_.dollarBraceL.updateContext=function(){this.context.push(oe.b_tmpl),this.exprAllowed=!0},_.parenL.updateContext=function(e){var t=e===_._if||e===_._for||e===_._with||e===_._while;this.context.push(t?oe.p_stat:oe.p_expr),this.exprAllowed=!0},_.incDec.updateContext=function(){},_._function.updateContext=_._class.updateContext=function(e){!e.beforeExpr||e===_.semi||e===_._else||e===_._return&&S.test(this.input.slice(this.lastTokEnd,this.start))||(e===_.colon||e===_.braceL)&&this.curContext()===oe.b_stat?this.context.push(oe.f_stat):this.context.push(oe.f_expr),this.exprAllowed=!1},_.backQuote.updateContext=function(){this.curContext()===oe.q_tmpl?this.context.pop():this.context.push(oe.q_tmpl),this.exprAllowed=!1},_.star.updateContext=function(e){if(e===_._function){var t=this.context.length-1;this.context[t]===oe.f_expr?this.context[t]=oe.f_expr_gen:this.context[t]=oe.f_gen}this.exprAllowed=!0},_.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==_.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var le="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",he=le+" Extended_Pictographic",ue={9:le,10:he,11:"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 Extended_Pictographic"},pe="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",de="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",fe=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",me={9:de,10:fe,11:"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 Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ge={};function ve(e){var t=ge[e]={binary:N(ue[e]+" "+pe),nonBinary:{General_Category:N(pe),Script:N(me[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}ve(9),ve(10),ve(11);var ye=V.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ge[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 xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function _e(e){return e>=65&&e<=90||e>=97&&e<=122}function Se(e){return _e(e)||95===e}function ke(e){return Se(e)||Ee(e)}function Ee(e){return e>=48&&e<=57}function Ae(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.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},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.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},be.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},be.prototype.current=function(){return this.at(this.pos)},be.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},be.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},be.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ye.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ye.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=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},ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ye.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=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},ye.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)},ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!we(i);)e.advance();return e.pos!==t},ye.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)},ye.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")}},ye.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},ye.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},ye.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)},ye.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)},ye.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)},ye.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},ye.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},ye.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)},ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ye.regexp_eatZero=function(e){return 48===e.current()&&!Ee(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ye.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)},ye.regexp_eatControlLetter=function(e){var t=e.current();return!!_e(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.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)},ye.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},ye.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},ye.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},ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){M(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ke(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ye.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},ye.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")}}},ye.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||Ie(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)},ye.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)},ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ee(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ee(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ae(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(i),e.advance();return e.pos!==t},ye.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},ye.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ye.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}Pe.next=function(){this.options.onToken&&this.options.onToken(new Te(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Pe.getToken=function(){return this.next(),new Te(this)},"undefined"!=typeof Symbol&&(Pe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===_.eof,value:t}}}}),Pe.curContext=function(){return this.context[this.context.length-1]},Pe.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(_.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Pe.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Pe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Pe.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.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Pe.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)},Pe.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(_.ellipsis)):(++this.pos,this.finishToken(_.dot))},Pe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(_.assign,2):this.finishOp(_.slash,1)},Pe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?_.star:_.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=_.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(_.assign,i+1):this.finishOp(n,i)},Pe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?_.logicalOR:_.logicalAND,2):61===t?this.finishOp(_.assign,2):this.finishOp(124===e?_.bitwiseOR:_.bitwiseAND,1)},Pe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(_.assign,2):this.finishOp(_.bitwiseXOR,1)},Pe.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&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(_.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(_.assign,2):this.finishOp(_.plusMin,1)},Pe.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(_.assign,i+1):this.finishOp(_.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(_.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Pe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(_.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(_.arrow)):this.finishOp(61===e?_.eq:_.prefix,1)},Pe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(_.parenL);case 41:return++this.pos,this.finishToken(_.parenR);case 59:return++this.pos,this.finishToken(_.semi);case 44:return++this.pos,this.finishToken(_.comma);case 91:return++this.pos,this.finishToken(_.bracketL);case 93:return++this.pos,this.finishToken(_.bracketR);case 123:return++this.pos,this.finishToken(_.braceL);case 125:return++this.pos,this.finishToken(_.braceR);case 58:return++this.pos,this.finishToken(_.colon);case 63:return++this.pos,this.finishToken(_.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(_.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(_.prefix,1)}this.raise(this.pos,"Unexpected character '"+Me(e)+"'")},Pe.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Pe.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(S.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 be(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(_.regexp,{pattern:r,flags:a,value:c})},Pe.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,n=n*e+o}return this.pos===i||null!=t&&this.pos-i!==t?null:n},Pe.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(_.num,i)},Pe.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(_.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(_.num,o)},Pe.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},Pe.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(_.string,t)};var Oe={};Pe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Oe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Oe;this.raise(e,t)},Pe.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!==_.template&&this.type!==_.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(_.template,e)):36===i?(this.pos+=2,this.finishToken(_.dollarBraceL)):(++this.pos,this.finishToken(_.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}},Pe.readInvalidTemplateToken=function(){for(;this.pos=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)}},Pe.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{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"; +function W(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]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function G(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 J(){for(var e=[],t=0;t":return i>n;case">=":return i>=n;case"<<":return i<>":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)}}function oe(e,t){var i,n=Xe(e.right,t),r=e.left;if("Identifier"===r.type){if(!(i=X(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return bi(r,t,{feed:n});i=le(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()<>=":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)}}function ce(e,t){switch(e.operator){case"||":return Xe(e.left,t)||Xe(e.right,t);case"&&":return Xe(e.left,t)&&Xe(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function le(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?xe(e.object,t,{getProto:!0}):Xe(e.object,t),o)return n;if(r=e.computed?Xe(e.property,t):e.property.name,l){var h=v(n,r);if("Super"===e.object.type&&h){var u=t.find("this").get(),p=T(r);return s(u,p,{set:h}),new q(u,p)}return new q(n,r)}var d=g(n,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):n[r]}function he(e,t){return Xe(e.test,t)?Xe(e.consequent,t):Xe(e.alternate,t)}function ue(e,t){var i,n;if("MemberExpression"===e.callee.type){n=le(e.callee,t,{getObj:!0});var r=void 0;if(r=e.callee.computed?Xe(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[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(i=Xe(e.callee,t))||"Super"!==e.callee.type&&i[B]){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":return[2,i>n];case">=":return[2,i>=n];case"<<":return[2,i<>":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)}}}))}function ft(e,t){var i,n,r,s;return W(this,(function(a){switch(a.label){case 0:return[5,Y(ni(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,Y(nt(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,Y(gt(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,Y(di(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()<>=":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)}}}))}function mt(e,t){var i,n;return W(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,Y(ni(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,Y(ni(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,Y(ni(e.left,t))];case 6:return(n=r.sent())?[5,Y(ni(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)}}))}function gt(e,t,i){var n,r,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),W(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,Y(Ct(e.object,t,{getProto:!0}))];case 1:return c=f.sent(),[3,4];case 2:return[5,Y(ni(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,Y(ni(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=v(c,l),"Super"===e.object.type&&h?(d=t.find("this").get(),u=T(l),s(d,u,{set:h}),[2,new q(d,u)]):[2,new q(c,l)]):(p=g(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function vt(e,t){var i;return W(this,(function(n){switch(n.label){case 0:return[5,Y(ni(e.test,t))];case 1:return n.sent()?[5,Y(ni(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,Y(ni(e.alternate,t))];case 4:i=n.sent(),n.label=5;case 5:return[2,i]}}))}function yt(e,t){var i,n,r,s,a,o,c,l,h,u,p,d;return W(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,Y(gt(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,Y(ni(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[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,Y(ni(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[B]){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-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function pi(e,t){var i,n,r,s,a;return W(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,Y(si(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,Y(si(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,Y(si(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,Y(pi(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,Y(pi(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,Y(pi(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-1;o--)e.body.splice(a[o],1);e.body=s.concat(e.body)}}function yi(e,t){switch(e.type){case"VariableDeclaration":Qe(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&Qe(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&Qe(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":yi(e.body,t);break;case"IfStatement":yi(e.consequent,t),e.alternate&&yi(e.alternate,t);break;case"BlockStatement":for(var i=0;i{"use strict";i.r(t),i.d(t,{Node:()=>ne,Parser:()=>V,Position:()=>L,SourceLocation:()=>D,TokContext:()=>ae,Token:()=>Te,TokenType:()=>g,defaultOptions:()=>R,getLineInfo:()=>$,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>_,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Le,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>S,tokenizer:()=>$e,version:()=>Me});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;ne)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=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}function B(e,t){return 2|(e?4:0)|(t?8:0)}var V=function(e,t,i){this.options=e=j(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},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};V.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},F.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},F.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},F.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},F.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},F.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},V.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},V.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n-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")}},U.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")},U.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=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)}},z.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=6?this.eat(S.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.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(W),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 q,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))},z.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,J|(i?0:X),!1,t)},z.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")},z.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")},z.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(Y),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")},z.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 G=[];z.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")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(W),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.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")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,i,n){for(var r=0,s=this.labels;r=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")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.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")},z.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")},z.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")},z.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},z.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var J=1,X=2;z.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===S.star&&t&X&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&J&&(e.id=4&t&&this.type!==S.name?null:this.parseIdent(),!e.id||t&X||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(B(e.async,e.generator)),t&J||(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&J?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.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")},z.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},z.parseClassMethod=function(e,t,i,n){return e.value=this.parseMethod(t,i,n),this.finishNode(e,"MethodDefinition")},z.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)},z.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts():null},z.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|J,!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=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=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()}},Q.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==S.parenL&&this.unexpected(),this.finishNode(e,"Import")},Q.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")},Q.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},Q.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 q,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},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Z=[];Q.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=Z,this.finishNode(e,"NewExpression")},Q.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")},Q.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")},Q.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))},Q.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")},Q.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")},Q.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")}},Q.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)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.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|B(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")},Q.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|B(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")},Q.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},Q.isSimpleParamList=function(e){for(var t=0,i=e;t-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")},te.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},te.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},te.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 ne=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])},re=V.prototype;function se(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}re.startNode=function(){return new ne(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ne(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,i,n){return se.call(this,e,t,i,n)};var ae=function(e,t,i,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!r},oe={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},ce=V.prototype;ce.initialContext=function(){return[oe.b_stat]},ce.braceIsBlock=function(e){var t=this.curContext();return t===oe.f_expr||t===oe.f_stat||(e!==S.colon||t!==oe.b_stat&&t!==oe.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===oe.b_stat:e!==S._var&&e!==S._const&&e!==S.name&&!this.exprAllowed):!t.isExpr)},ce.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},ce.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===oe.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)?oe.b_stat:oe.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(oe.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?oe.p_stat:oe.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()===oe.b_stat?this.context.push(oe.f_stat):this.context.push(oe.f_expr),this.exprAllowed=!1},S.backQuote.updateContext=function(){this.curContext()===oe.q_tmpl?this.context.pop():this.context.push(oe.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===oe.f_expr?this.context[t]=oe.f_expr_gen:this.context[t]=oe.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 le="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",he=le+" Extended_Pictographic",ue={9:le,10:he,11:he},pe="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",de="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",fe=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",me={9:de,10:fe,11:fe+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ge={};function ve(e){var t=ge[e]={binary:M(ue[e]+" "+pe),nonBinary:{General_Category:M(pe),Script:M(me[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}ve(9),ve(10),ve(11);var ye=V.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ge[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 xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Se(e){return e>=65&&e<=90||e>=97&&e<=122}function _e(e){return Se(e)||95===e}function ke(e){return _e(e)||Ee(e)}function Ee(e){return e>=48&&e<=57}function Ae(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.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},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.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},be.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},be.prototype.current=function(){return this.at(this.pos)},be.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},be.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},be.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ye.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ye.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=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},ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ye.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=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},ye.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)},ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!we(i);)e.advance();return e.pos!==t},ye.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)},ye.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")}},ye.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},ye.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},ye.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)},ye.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)},ye.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)},ye.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},ye.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},ye.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)},ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ye.regexp_eatZero=function(e){return 48===e.current()&&!Ee(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ye.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)},ye.regexp_eatControlLetter=function(e){var t=e.current();return!!Se(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.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)},ye.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},ye.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},ye.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},ye.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")},ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";_e(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ke(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ye.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},ye.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")}}},ye.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||Ie(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)},ye.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)},ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ee(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ee(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ae(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(i),e.advance();return e.pos!==t},ye.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},ye.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ye.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}Pe.next=function(){this.options.onToken&&this.options.onToken(new Te(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Pe.getToken=function(){return this.next(),new Te(this)},"undefined"!=typeof Symbol&&(Pe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Pe.curContext=function(){return this.context[this.context.length-1]},Pe.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())},Pe.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Pe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Pe.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.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Pe.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)},Pe.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))},Pe.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)},Pe.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)},Pe.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)},Pe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Pe.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)},Pe.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())},Pe.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)},Pe.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 '"+Oe(e)+"'")},Pe.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Pe.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 be(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})},Pe.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,n=n*e+o}return this.pos===i||null!=t&&this.pos-i!==t?null:n},Pe.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)},Pe.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)},Pe.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},Pe.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 Ne={};Pe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ne)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ne;this.raise(e,t)},Pe.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}},Pe.readInvalidTemplateToken=function(){for(;this.pos=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)}},Pe.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{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 @@ -31,7 +31,7 @@ var c;const l=window,h=l.trustedTypes,u=h?h.emptyScript:"",p=l.reactiveElementPo * 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)}$`,_="?"+w,S=`<${_}>`,k=document,E=(e="")=>k.createComment(e),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,C=Array.isArray,I=e=>C(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,M=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),N=/'/g,L=/"/g,D=/^(?:script|style|textarea|title)$/i,$=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),R=$(1),j=($(2),Symbol.for("lit-noChange")),B=Symbol.for("lit-nothing"),V=new WeakMap,F=k.createTreeWalker(k,129,null,!1),U=(e,t)=>{const i=e.length-1,n=[];let r,s=2===t?"":"",a=T;for(let t=0;t"===c[0]?(a=null!=r?r:T,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]?L:N):a===L||a===N?a=O:a===P||a===M?a=T:(a=O,r=void 0);const u=a===O&&e[t+1].startsWith("/>")?" ":"";s+=a===T?i+S: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?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,n]};class H{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]=U(e,t);if(this.el=H.createElement(c,i),F.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=F.nextNode())&&o.length0){n.textContent=b?b.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=B}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=q(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==j,s&&(this._$AH=e);else{const n=e;let a,o;for(e=r[0],a=0;ae}):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=e=>C(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,O=/>/g,N=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),M=/'/g,L=/"/g,D=/^(?:script|style|textarea|title)$/i,$=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),R=$(1),j=($(2),Symbol.for("lit-noChange")),B=Symbol.for("lit-nothing"),V=new WeakMap,F=k.createTreeWalker(k,129,null,!1),U=(e,t)=>{const i=e.length-1,n=[];let r,s=2===t?"":"",a=T;for(let t=0;t"===c[0]?(a=null!=r?r:T,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?N:'"'===c[3]?L:M):a===L||a===M?a=N:a===P||a===O?a=T:(a=N,r=void 0);const u=a===N&&e[t+1].startsWith("/>")?" ":"";s+=a===T?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?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,n]};class H{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]=U(e,t);if(this.el=H.createElement(c,i),F.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=F.nextNode())&&o.length0){n.textContent=b?b.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=B}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=q(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==j,s&&(this._$AH=e);else{const n=e;let a,o;for(e=r[0],a=0;at=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t) * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var oe;null===(oe=window.HTMLSlotElement)||void 0===oe||oe.prototype.assignedElements;class ce{constructor(){this.states={}}callWS(e){return console.log(e),Promise.resolve(null)}callService(e,t,i){const n={context:{id:"",parent_id:void 0,user_id:void 0}};return Promise.resolve(n)}clone(){const e=new ce;return e.callService=this.callService,e.states=JSON.parse(JSON.stringify(this.states)),e}}class le{}let he=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/giu;function ue(e="",t="ms"){var i=null;return(e=(e+"").replace(/(\d)[,_](\d)/g,"$1$2")).replace(he,(function(e,t,n){(n=pe(n))&&(i=(i||0)+parseFloat(t,10)*n)})),i&&i/(pe(t)||1)}function pe(e){return ue[e]||ue[e.toLowerCase().replace(/s$/,"")]}ue.nanosecond=ue.ns=1e-6,ue["µs"]=ue["μs"]=ue.us=ue.microsecond=.001,ue.millisecond=ue.ms=ue[""]=1,ue.second=ue.sec=ue.s=1e3*ue.ms,ue.minute=ue.min=ue.m=60*ue.s,ue.hour=ue.hr=ue.h=60*ue.m,ue.day=ue.d=24*ue.h,ue.week=ue.wk=ue.w=7*ue.d,ue.month=ue.b=30.4375*ue.d,ue.year=ue.yr=ue.y=365.25*ue.d;const de=ue;class fe{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 me,ge=i(1),ve=i.n(ge);class ye{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;if(Math.abs(e)>=1)t="minute",i=e;else{t="second",i=n/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(i),t)}}ye.strftime=ve(),ye.MILLISECONDS_IN_SECOND=1e3,ye.MILLISECONDS_IN_MINUTE=6e4,ye.MILLISECONDS_IN_HOUR=36e5,ye.MILLISECONDS_IN_DAY=864e5,ye.MILLISECONDS_IN_YEAR=31536e6,ye.relativeTimeFormat=new Intl.RelativeTimeFormat(null!==(me=navigator.language)&&void 0!==me?me:"en",{numeric:"auto",style:"long"});var be=i(449),xe=i.n(be);function we(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 _e{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(">".length).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(we(e))}return this.interpreter.exports.result}}_e.cache={},_e.interpreter=new(xe())({ecmaVer:2019,sandBox:!0}),_e.util={color:fe,date:ye};class Se{constructor(e,t){this.hassChanged=t,this.simulationProcessors=[],this.hass=new ce,this.hass.callService=this.callService.bind(this);for(const t of e.simulations){const e=new ke(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":if("toggle"===t)this.homeAssistantToggle(i);break;case"media_player":switch(t){case"volume_up":this.homeAssistantVolumeUp(i);break;case"volume_down":this.homeAssistantVolumeDown(i)}}const n={context:{id:"",parent_id:void 0,user_id:void 0}};return Promise.resolve(n)}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 ke{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=_e.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:de(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 le,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])}} +var oe;null===(oe=window.HTMLSlotElement)||void 0===oe||oe.prototype.assignedElements;class ce{constructor(){this.states={}}callWS(e){return console.log(e),Promise.resolve(null)}callService(e,t,i){const n={context:{id:"",parent_id:void 0,user_id:void 0}};return Promise.resolve(n)}clone(){const e=new ce;return e.callService=this.callService,e.states=JSON.parse(JSON.stringify(this.states)),e}}class le{}let he=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/giu;function ue(e="",t="ms"){var i=null;return(e=(e+"").replace(/(\d)[,_](\d)/g,"$1$2")).replace(he,(function(e,t,n){(n=pe(n))&&(i=(i||0)+parseFloat(t,10)*n)})),i&&i/(pe(t)||1)}function pe(e){return ue[e]||ue[e.toLowerCase().replace(/s$/,"")]}ue.nanosecond=ue.ns=1e-6,ue["µs"]=ue["μs"]=ue.us=ue.microsecond=.001,ue.millisecond=ue.ms=ue[""]=1,ue.second=ue.sec=ue.s=1e3*ue.ms,ue.minute=ue.min=ue.m=60*ue.s,ue.hour=ue.hr=ue.h=60*ue.m,ue.day=ue.d=24*ue.h,ue.week=ue.wk=ue.w=7*ue.d,ue.month=ue.b=30.4375*ue.d,ue.year=ue.yr=ue.y=365.25*ue.d;const de=ue;class fe{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 me,ge=i(1),ve=i.n(ge);class ye{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;if(Math.abs(e)>=1)t="minute",i=e;else{t="second",i=n/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(i),t)}}ye.strftime=ve(),ye.MILLISECONDS_IN_SECOND=1e3,ye.MILLISECONDS_IN_MINUTE=6e4,ye.MILLISECONDS_IN_HOUR=36e5,ye.MILLISECONDS_IN_DAY=864e5,ye.MILLISECONDS_IN_YEAR=31536e6,ye.relativeTimeFormat=new Intl.RelativeTimeFormat(null!==(me=navigator.language)&&void 0!==me?me:"en",{numeric:"auto",style:"long"});var be=i(449),xe=i.n(be);function we(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 Se{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(we(e))}return this.interpreter.exports.result}}Se.cache={},Se.interpreter=new(xe())({ecmaVer:2019,sandBox:!0}),Se.util={color:fe,date:ye};class _e{constructor(e,t){this.hassChanged=t,this.simulationProcessors=[],this.hass=new ce,this.hass.callService=this.callService.bind(this);for(const t of e.simulations){const e=new ke(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":if("toggle"===t)this.homeAssistantToggle(i);break;case"media_player":switch(t){case"volume_up":this.homeAssistantVolumeUp(i);break;case"volume_down":this.homeAssistantVolumeDown(i)}}const n={context:{id:"",parent_id:void 0,user_id:void 0}};return Promise.resolve(n)}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 ke{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=Se.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:de(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 le,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 Ee(e){return null==e}var Ae={isNothing:Ee,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Ee(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;io&&(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 Me(e,t){return Ae.repeat(" ",t-e.length)+e}var Oe=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=Pe(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=Ae.repeat(" ",t.indent)+Me((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Pe(e.buffer,r[a],s[a],e.position,u),l+=Ae.repeat(" ",t.indent)+Me((e.line+1).toString(),h)+" | "+c.str+"\n",l+=Ae.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Pe(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=Ae.repeat(" ",t.indent)+Me((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},Ne=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Le=["scalar","sequence","mapping"];var De=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Ne.indexOf(t))throw new Te('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===Le.indexOf(this.kind))throw new Te('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function $e(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 Re(e){return this.extend(e)}Re.prototype.extend=function(e){var t=[],i=[];if(e instanceof De)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 Te("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 De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new Te("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 Te("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 De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Re.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=$e(n,"implicit"),n.compiledExplicit=$e(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=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"]}}),Ke=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Je=/^[-+]?[0-9]+e/;var Xe=new De("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Ke.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||Ae.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(Ae.isNegativeZero(e))return"-0.0";return i=e.toString(10),Je.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Qe=Ue.extend({implicit:[He,qe,Ye,Xe]}),Ze=Qe,et=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),tt=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]))?))?$");var it=new De("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==et.exec(e)||null!==tt.exec(e))},construct:function(e){var t,i,n,r,s,a,o,c,l=0,h=null;if(null===(t=et.exec(e))&&(t=tt.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()}});var nt=new De("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var st=new De("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=rt;for(i=0;i64)){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=rt,a=0,o=[];for(t=0;t>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=rt;for(t=0;t>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}}),at=Object.prototype.hasOwnProperty,ot=Object.prototype.toString;var ct=new De("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>10),56320+(e-65536&1023))}for(var Pt=new Array(256),Mt=new Array(256),Ot=0;Ot<256;Ot++)Pt[Ot]=It(Ot)?1:0,Mt[Ot]=It(Ot);function Nt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||dt,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 Lt(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=Oe(i),new Te(t,i)}function Dt(e,t){throw Lt(e,t)}function $t(e,t){e.onWarning&&e.onWarning.call(null,Lt(e,t))}var Rt={YAML:function(e,t,i){var n,r,s;null!==e.version&&Dt(e,"duplication of %YAML directive"),1!==i.length&&Dt(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Dt(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Dt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&$t(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Dt(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],yt.test(n)||Dt(e,"ill-formed tag handle (first argument) of the TAG directive"),ft.call(e.tagMap,n)&&Dt(e,'there is a previously declared suffix for "'+n+'" tag handle'),bt.test(r)||Dt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Dt(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function jt(e,t,i,n){var r,s,a,o;if(t1&&(e.result+=Ae.repeat("\n",t-1))}function zt(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,Dt(e,"tab characters must not be used in indentation")),45===n)&&St(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,Ut(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,Yt(e,t,3,!1,!0),a.push(e.result),Ut(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Dt(e,"bad indentation of a sequence entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt)&&(v&&(a=e.line,o=e.lineStart,c=e.position),Yt(e,t,4,!0,r)&&(v?m=e.result:g=e.result),v||(Vt(e,p,d,f,m,g,a,o,c),f=m=g=null),Ut(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Dt(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Dt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Dt(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(_t(s)){do{s=e.input.charCodeAt(++e.position)}while(_t(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!wt(s)&&0!==s)}for(;0!==s;){for(Ft(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),wt(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=Et(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Dt(e,"expected hexadecimal character");e.result+=Tt(s),e.position++}else Dt(e,"unknown escape sequence");i=n=e.position}else wt(o)?(jt(e,i,n,!0),qt(e,Ut(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Ht(e)?Dt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Dt(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&&!St(n)&&!kt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Dt(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),ft.call(e.anchorMap,i)||Dt(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],Ut(e,!0,-1),!0}(e)?function(e,t,i){var n,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(St(h=e.input.charCodeAt(e.position))||kt(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)&&(St(n=e.input.charCodeAt(e.position+1))||i&&kt(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(St(n=e.input.charCodeAt(e.position+1))||i&&kt(n))break}else if(35===h){if(St(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Ht(e)||i&&kt(h))break;if(wt(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,Ut(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&&(jt(e,r,s,!1),qt(e,e.line-o),r=s=e.position,a=!1),_t(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return jt(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,1===i)&&(g=!0,null===e.tag&&(e.tag="?")):(g=!0,null===e.tag&&null===e.anchor||Dt(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=o&&zt(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&&Dt(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c"),null!==e.result&&u.kind!==e.kind&&Dt(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)):Dt(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 Kt(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))&&(Ut(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&&!St(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Dt(e,"directive name must not be less than one character in length");0!==r;){for(;_t(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!wt(r));break}if(wt(r))break;for(t=e.position;0!==r&&!St(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&Ft(e),ft.call(Rt,i)?Rt[i](e,i,n):$t(e,'unknown document directive "'+i+'"')}Ut(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,Ut(e,!0,-1)):a&&Dt(e,"directives end mark is expected"),Yt(e,e.lineIndent-1,4,!1,!0),Ut(e,!0,-1),e.checkLineBreaks&>.test(e.input.slice(s,e.position))&&$t(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ht(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Ut(e,!0,-1)):e.position=55296&&n<=56319&&t+1=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function di(e){return/^\n* /.test(e)}function fi(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 li(e)&&e!==ei&&!ci(e)&&45!==e&&63!==e&&58!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&35!==e&&38!==e&&42!==e&&33!==e&&124!==e&&61!==e&&62!==e&&39!==e&&34!==e&&37!==e&&64!==e&&96!==e}(pi(e,0))&&function(e){return!ci(e)&&58!==e}(pi(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!li(l=pi(e,c)))return 5;m=m&&ui(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if(10===(l=pi(e,c)))u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!li(l))return 5;m=m&&ui(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&di(e)?5:a?2===s?5:2:p?4:3:!m||a||r(e)?2===s?5:2:1}function mi(e,t,i,n,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==ii.indexOf(t)||ni.test(t)))return 2===e.quotingType?'"'+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(fi(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i"+gi(t,e.indent)+vi(ai(function(e,t){var i,n,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,yi(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;n=r.exec(e);){var c=n[1],l=n[2];i=" "===l[0],s+=c+(a||i||""===l?"":"\n")+yi(l,t),a=i}return s}(t,a),s));case 5:return'"'+function(e){for(var t,i="",n=0,r=0;r=65536?r+=2:r++)n=pi(e,r),!(t=ti[n])&&li(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||ri(n);return i}(t)+'"';default:throw new Te("impossible error: invalid scalar style")}}()}function gi(e,t){var i=di(e)?String(t):"",n="\n"===e[e.length-1];return i+(n&&("\n"===e[e.length-2]||"\n"===e)?"+":n?"":"-")+"\n"}function vi(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function yi(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 bi(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function wi(e,t,i,n,r,s,a){e.tag=null,e.dump=i,xi(e,i,!1)||xi(e,i,!0);var o,c=Qt.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 Te("sortKeys must be a boolean or a function");for(r=0,s=p.length;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=oi(e,t)),wi(e,t+1,o,!0,c)&&(e.dump&&10===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;n1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),wi(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?bi(e,t-1,e.dump,r):bi(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",e.dump=o+" "+e.dump)}return!0}function _i(e,t){var i,n,r=[],s=[];for(Si(e,r,s),i=0,n=s.length;ie.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(n[0],n[1])}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n");if(n.length>1){const t=e.querySelector("tspan"),i=null==t?void 0:t.getAttribute("x"),n=null==t?void 0:t.getAttribute("y");i&&!e.getAttribute("x")&&e.setAttribute("x",i),n&&!e.getAttribute("y")&&e.setAttribute("y",n)}const r=e.querySelector("tspan")||!1;e.textContent="";const s=e.getAttribute("x")||"0",a=i||"1em";n.forEach(((t,i)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(o.textContent=t,n.length>1){if(o.setAttribute("x",s),o.setAttribute("dy",i>=1?a:"0"),r){const e=r.getAttribute("style");e&&o.setAttribute("style",e)}}else 1==n.length&&0==i&&r&&["x","y","style"].forEach((e=>{const t=null==r?void 0:r.getAttribute(e);null!=t&&o.setAttribute(e,t)}));e.appendChild(o)}))}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 Ei.load(e)}static fetchText(e,t,i,n){return Ai(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:Ci.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 Ai(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:Ci.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,${Ci.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;rMath.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class Ii{static closestElement(e,t){return function t(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(e);return n||t(i.getRootNode().host)}(t)}}const Ti=(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},Pi=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),Ti(window,"location-changed",{replace:i})};class Mi{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class Oi{constructor(e){this.rule=e,this.svgElementInfos={}}}class Ni{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 Li={},Di={};Di.click=Di.mousedown=Di.mouseup=Di.mousemove="MouseEvents";let $i=1;function Ri(e){return e._dtId||(e._dtId=$i++)}function ji(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function Bi(e,t,i,n){const r=ji(i).e;if(!e._dtId)return!1;const s=Li[Ri(e)],a=function(e,t,i,n){return i=ji(i),(Li[Ri(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 Vi(e,t,i,n,r,s){const a=ji(i).e,o=ji(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=Ri(e);(Li[c]||(Li[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const Fi={on(e,t,i,n=null){Vi(e,null,t,i,null,n)},off(e,t,i=null){Bi(e,null,t,i)},once(e,t,i){const n=e=>(Fi.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){Vi(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{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())};Hi.on(e,"mousedown",n.bind(this)),Hi.on(e,"tapstart",n.bind(this)),Hi.on(e,"touchstart",n.bind(this),{passive:!0}),Hi.on(e,"click",r.bind(this)),Hi.on(e,"mouseup",r.bind(this)),Hi.on(e,"tapend",r.bind(this)),Hi.on(e,"touchend",r.bind(this)),Hi.on(e,"tap",s.bind(this)),Hi.on(e,"touch",s.bind(this)),Hi.on(e,"mouseup",s.bind(this)),Hi.on(e,"tapend",s.bind(this)),Hi.on(e,"touchend",s.bind(this)),Hi.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const zi=Ui,Wi=new Set;class Gi{static observe(e){if(Wi.has(e))return;Wi.add(e);let t,i=0;zi.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))}}class Yi{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){this.expression=e.trim();const o=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[o],void 0===this.parsedFunction&&(this.functionBody=this.expression,this.isCodeBlock(this.functionBody)?this.functionBody=this.functionBody.slice(">".length).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[o]=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);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(we(e))}return this.interpreter.exports.result}}Yi.cache={},Yi.interpreter=new(xe())({ecmaVer:2019,sandBox:!0}),Yi.util={color:fe,date:ye};class Ki{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=`${Ci.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");Ci.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=`${Ci.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 Ji=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},Xi=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 Qi=Ui;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.37","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Zi=class extends ie{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 R` +function Ee(e){return null==e}var Ae={isNothing:Ee,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Ee(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;io&&(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 Oe(e,t){return Ae.repeat(" ",t-e.length)+e}var Ne=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=Pe(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=Ae.repeat(" ",t.indent)+Oe((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Pe(e.buffer,r[a],s[a],e.position,u),l+=Ae.repeat(" ",t.indent)+Oe((e.line+1).toString(),h)+" | "+c.str+"\n",l+=Ae.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Pe(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=Ae.repeat(" ",t.indent)+Oe((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},Me=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Le=["scalar","sequence","mapping"];var De=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Me.indexOf(t))throw new Te('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===Le.indexOf(this.kind))throw new Te('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function $e(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 Re(e){return this.extend(e)}Re.prototype.extend=function(e){var t=[],i=[];if(e instanceof De)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 Te("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 De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new Te("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 Te("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 De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Re.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=$e(n,"implicit"),n.compiledExplicit=$e(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=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"]}}),Je=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Xe=/^[-+]?[0-9]+e/;var Ke=new De("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Je.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||Ae.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(Ae.isNegativeZero(e))return"-0.0";return i=e.toString(10),Xe.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Qe=Ue.extend({implicit:[He,qe,Ge,Ke]}),Ze=Qe,et=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),tt=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]))?))?$");var it=new De("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==et.exec(e)||null!==tt.exec(e))},construct:function(e){var t,i,n,r,s,a,o,c,l=0,h=null;if(null===(t=et.exec(e))&&(t=tt.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()}});var nt=new De("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var st=new De("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=rt;for(i=0;i64)){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=rt,a=0,o=[];for(t=0;t>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=rt;for(t=0;t>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}}),at=Object.prototype.hasOwnProperty,ot=Object.prototype.toString;var ct=new De("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>10),56320+(e-65536&1023))}for(var Rt=new Array(256),jt=new Array(256),Bt=0;Bt<256;Bt++)Rt[Bt]=Dt(Bt)?1:0,jt[Bt]=Dt(Bt);function Vt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||dt,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 Ft(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=Ne(i),new Te(t,i)}function Ut(e,t){throw Ft(e,t)}function Ht(e,t){e.onWarning&&e.onWarning.call(null,Ft(e,t))}var qt={YAML:function(e,t,i){var n,r,s;null!==e.version&&Ut(e,"duplication of %YAML directive"),1!==i.length&&Ut(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Ut(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Ut(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Ht(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Ut(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],Et.test(n)||Ut(e,"ill-formed tag handle (first argument) of the TAG directive"),ft.call(e.tagMap,n)&&Ut(e,'there is a previously declared suffix for "'+n+'" tag handle'),At.test(r)||Ut(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Ut(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function zt(e,t,i,n){var r,s,a,o;if(t1&&(e.result+=Ae.repeat("\n",t-1))}function Qt(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,Ut(e,"tab characters must not be used in indentation")),45===n)&&Pt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,Jt(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,ti(e,t,vt,!1,!0),a.push(e.result),Jt(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Ut(e,"bad indentation of a sequence entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt)&&(v&&(a=e.line,o=e.lineStart,c=e.position),ti(e,t,yt,!0,r)&&(v?m=e.result:g=e.result),v||(Yt(e,p,d,f,m,g,a,o,c),f=m=g=null),Jt(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Ut(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Ut(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Ut(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(Tt(s)){do{s=e.input.charCodeAt(++e.position)}while(Tt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!It(s)&&0!==s)}for(;0!==s;){for(Gt(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),It(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=Nt(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Ut(e,"expected hexadecimal character");e.result+=$t(s),e.position++}else Ut(e,"unknown escape sequence");i=n=e.position}else It(o)?(zt(e,i,n,!0),Kt(e,Jt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Xt(e)?Ut(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Ut(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&&!Pt(n)&&!Ot(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ut(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),ft.call(e.anchorMap,i)||Ut(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],Jt(e,!0,-1),!0}(e)?function(e,t,i){var n,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(Pt(h=e.input.charCodeAt(e.position))||Ot(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)&&(Pt(n=e.input.charCodeAt(e.position+1))||i&&Ot(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(Pt(n=e.input.charCodeAt(e.position+1))||i&&Ot(n))break}else if(35===h){if(Pt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Xt(e)||i&&Ot(h))break;if(It(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,Jt(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&&(zt(e,r,s,!1),Kt(e,e.line-o),r=s=e.position,a=!1),Tt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return zt(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,mt===i)&&(g=!0,null===e.tag&&(e.tag="?")):(g=!0,null===e.tag&&null===e.anchor||Ut(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=o&&Qt(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&&Ut(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c"),null!==e.result&&u.kind!==e.kind&&Ut(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)):Ut(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 ii(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))&&(Jt(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&&!Pt(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Ut(e,"directive name must not be less than one character in length");0!==r;){for(;Tt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!It(r));break}if(It(r))break;for(t=e.position;0!==r&&!Pt(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&Gt(e),ft.call(qt,i)?qt[i](e,i,n):Ht(e,'unknown document directive "'+i+'"')}Jt(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,Jt(e,!0,-1)):a&&Ut(e,"directives end mark is expected"),ti(e,e.lineIndent-1,yt,!1,!0),Jt(e,!0,-1),e.checkLineBreaks&&_t.test(e.input.slice(s,e.position))&&Ht(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xt(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Jt(e,!0,-1)):e.position=55296&&n<=56319&&t+1=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function Wi(e){return/^\n* /.test(e)}var Yi=1,Gi=2,Ji=3,Xi=4,Ki=5;function Qi(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 Ui(e)&&e!==oi&&!Fi(e)&&e!==xi&&e!==ki&&e!==wi&&e!==bi&&e!==Ai&&e!==Ci&&e!==Ti&&e!==Oi&&e!==fi&&e!==gi&&e!==yi&&e!==pi&&e!==Pi&&e!==Si&&e!==_i&&e!==vi&&e!==di&&e!==mi&&e!==Ei&&e!==Ii}(zi(e,0))&&function(e){return!Fi(e)&&e!==wi}(zi(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!Ui(l=zi(e,c)))return Ki;m=m&&qi(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if((l=zi(e,c))===li)u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!Ui(l))return Ki;m=m&&qi(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&Wi(e)?Ki:a?s===Ri?Ki:Gi:p?Xi:Ji:!m||a||r(e)?s===Ri?Ki:Gi:Yi}function Zi(e,t,i,n,r){e.dump=function(){if(0===t.length)return e.quotingType===Ri?'""':"''";if(!e.noCompatMode&&(-1!==Mi.indexOf(t)||Li.test(t)))return e.quotingType===Ri?'"'+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(Qi(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i"+en(t,e.indent)+tn(Bi(function(e,t){var i,n,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,nn(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;n=r.exec(e);){var c=n[1],l=n[2];i=" "===l[0],s+=c+(a||i||""===l?"":"\n")+nn(l,t),a=i}return s}(t,a),s));case Ki:return'"'+function(e){for(var t,i="",n=0,r=0;r=65536?r+=2:r++)n=zi(e,r),!(t=Ni[n])&&Ui(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||Di(n);return i}(t)+'"';default:throw new Te("impossible error: invalid scalar style")}}()}function en(e,t){var i=Wi(e)?String(t):"",n="\n"===e[e.length-1];return i+(n&&("\n"===e[e.length-2]||"\n"===e)?"+":n?"":"-")+"\n"}function tn(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function nn(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 rn(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function an(e,t,i,n,r,s,a){e.tag=null,e.dump=i,sn(e,i,!1)||sn(e,i,!0);var o,c=si.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 Te("sortKeys must be a boolean or a function");for(r=0,s=p.length;r1024)&&(e.dump&&li===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Vi(e,t)),an(e,t+1,o,!0,c)&&(e.dump&&li===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;n1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),an(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?rn(e,t-1,e.dump,r):rn(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",e.dump=o+" "+e.dump)}return!0}function on(e,t){var i,n,r=[],s=[];for(cn(e,r,s),i=0,n=s.length;ie.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(n[0],n[1])}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n");if(n.length>1){const t=e.querySelector("tspan"),i=null==t?void 0:t.getAttribute("x"),n=null==t?void 0:t.getAttribute("y");i&&!e.getAttribute("x")&&e.setAttribute("x",i),n&&!e.getAttribute("y")&&e.setAttribute("y",n)}const r=e.querySelector("tspan")||!1;e.textContent="";const s=e.getAttribute("x")||"0",a=i||"1em";n.forEach(((t,i)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(o.textContent=t,n.length>1){if(o.setAttribute("x",s),o.setAttribute("dy",i>=1?a:"0"),r){const e=r.getAttribute("style");e&&o.setAttribute("style",e)}}else 1==n.length&&0==i&&r&&["x","y","style"].forEach((e=>{const t=null==r?void 0:r.getAttribute(e);null!=t&&o.setAttribute(e,t)}));e.appendChild(o)}))}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 hn.load(e)}static fetchText(e,t,i,n){return un(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:pn.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 un(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:pn.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,${pn.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;rMath.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class dn{static closestElement(e,t){return function t(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(e);return n||t(i.getRootNode().host)}(t)}}const fn=(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},mn=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),fn(window,"location-changed",{replace:i})};class gn{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class vn{constructor(e){this.rule=e,this.svgElementInfos={}}}class yn{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 bn={},xn={};xn.click=xn.mousedown=xn.mouseup=xn.mousemove="MouseEvents";let wn=1;function Sn(e){return e._dtId||(e._dtId=wn++)}function _n(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function kn(e,t,i,n){const r=_n(i).e;if(!e._dtId)return!1;const s=bn[Sn(e)],a=function(e,t,i,n){return i=_n(i),(bn[Sn(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 En(e,t,i,n,r,s){const a=_n(i).e,o=_n(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=Sn(e);(bn[c]||(bn[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const An={on(e,t,i,n=null){En(e,null,t,i,null,n)},off(e,t,i=null){kn(e,null,t,i)},once(e,t,i){const n=e=>(An.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){En(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{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())};In.on(e,"mousedown",n.bind(this)),In.on(e,"tapstart",n.bind(this)),In.on(e,"touchstart",n.bind(this),{passive:!0}),In.on(e,"click",r.bind(this)),In.on(e,"mouseup",r.bind(this)),In.on(e,"tapend",r.bind(this)),In.on(e,"touchend",r.bind(this)),In.on(e,"tap",s.bind(this)),In.on(e,"touch",s.bind(this)),In.on(e,"mouseup",s.bind(this)),In.on(e,"tapend",s.bind(this)),In.on(e,"touchend",s.bind(this)),In.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Pn=Cn,On=new Set;class Nn{static observe(e){if(On.has(e))return;On.add(e);let t,i=0;Pn.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))}}class Mn{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){this.expression=e.trim();const o=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[o],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[o]=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);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(we(e))}return this.interpreter.exports.result}}Mn.cache={},Mn.interpreter=new(xe())({ecmaVer:2019,sandBox:!0}),Mn.util={color:fe,date:ye};class Ln{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=`${pn.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");pn.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=`${pn.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 Dn=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},$n=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 Rn=Cn;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.37","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let jn=class extends ie{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 R`
@@ -128,23 +128,23 @@ function Ee(e){return null==e}var Ae={isNothing:Ee,isObject:function(e){return"o .debug { color: #000000; } - `}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return Xi(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 Xi(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return Xi(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=Ci.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 Xi(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 Ki(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.37"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage()}catch(e){this.handleError(e)}}))}initMultiPage(){return Xi(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return Xi(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 Xi(this,void 0,void 0,(function*(){if("string"==typeof e){let i;try{i=yield Ci.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return Ei.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:Ci.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 Xi(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 Xi(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 Xi(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;let i="",n=!0;if("string"==typeof e.image)i=Ci.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const t of e.image.sizes)if(screen.width>=t.min_width){i=t.location,n=!0===t.cache;break}}else Ci.isMobile&&e.image_mobile?(i=e.image_mobile.location,n=!0===e.image_mobile.cache):(i=e.image.location,n=!0===e.image.cache);return{location:i,cache:n}}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 Xi(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 Ci.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 Ci.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?Ci.getArray(o):[]}loadFloorplanSvg(e,t,i){var n;return Xi(this,void 0,void 0,(function*(){let r;try{r=yield Ci.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const s=document.createElement("div");s.innerHTML=r;const a=s.querySelector("svg");if(t&&a.setAttribute("id",t.config.page_id),a.setAttribute("height","100%"),a.setAttribute("width","100%"),a.style.height="100%",a.style.width="100%",a.style.margin="auto",a.style.cursor="default",a.style.opacity="0",a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&i){const e=i.config.page_id,r=i.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement.replaceChildren(a);else{const e=this.floorplanElement.querySelector("#"+r),t=Number.parseFloat(a.getAttribute("height")),i=Number.parseFloat(a.getAttribute("width"));a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${i} ${t}`),a.setAttribute("preserveAspectRatio","xMinYMin meet"),a.setAttribute("height",e.getAttribute("height")),a.setAttribute("width",e.getAttribute("width")),a.setAttribute("x",e.getAttribute("x")),a.setAttribute("y",e.getAttribute("y")),null===(n=e.parentElement)||void 0===n||n.replaceChildren(a)}}else this.floorplanElement.replaceChildren(a);return a}))}loadImage(e,t,i,n,r){return Xi(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 Xi(this,void 0,void 0,(function*(){e=r?e:Ci.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 Xi(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield Ci.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"),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,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=>{Qi.off(e,"click"),Qi.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}]:[]}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 Oi(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)),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 Oi(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 Ni(this,i,n,t,r,e);if(e&&!s&&Qi.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new Ni(this,i,n,t,r,s);Gi.observe(a),e&&Qi.on(a,"singleClick",this.onClick.bind(c)),Qi.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),Ci.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new Ni(this,i,n,t,r,e);qi.observe(a),Qi.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),Ci.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,i){const n=new Mi(t.id,t,t,t.getBBox());return i.svgElementInfos[t.id]=n,n}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 Xi(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=Ci.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 ${Ci.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r)):Ci.equal(i.lastState.attributes,n.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${Ci.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return Xi(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 Xi(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))Ci.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: ${ye.timeago(n.last_changed)}\n`,i+=`Last updated: ${ye.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){if("string"!=typeof e||!Yi.isCode(e))return e;try{return Yi.evaluate(e,this.hass,this.config,t,i,this.svgElements,this.functions)}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){const r=this.getActionConfigs(e);for(const e of r){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}`):Ti(this,"hass-more-info",{entityId:t});break;case"navigate":this.isDemo?this.notify(`Performing action: ${e.action} ${e.navigation_path}`):Pi(0,e.navigation_path);break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const t=e.same_tab?"_self":"_blank";window.open(e.url_path,t)}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":Ti(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){try{if("object"==typeof e.service_data)for(const n of Object.keys(e.service_data))this.evaluate(e.service_data[n],t,i);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,i):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);if("floorplan"===s)this.callFloorplanService(s,a,e,t,i,n);else 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,Ci.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,Ci.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)),Ci.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,Ci.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";Ci.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);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(i,n,e)}}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})`)}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("
");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}`)}};Ji([ae({type:String})],Zi.prototype,"examplespath",void 0),Ji([ae({type:Object})],Zi.prototype,"hass",void 0),Ji([ae({type:String||Object})],Zi.prototype,"_config",void 0),Ji([ae({type:Boolean})],Zi.prototype,"isDemo",void 0),Ji([ae({type:Boolean})],Zi.prototype,"isShowLog",void 0),Ji([ae({type:Function})],Zi.prototype,"notify",void 0),Zi=Ji([re("floorplan-element")],Zi); + `}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return $n(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 $n(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return $n(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=pn.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 $n(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 Ln(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.37"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage()}catch(e){this.handleError(e)}}))}initMultiPage(){return $n(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return $n(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 $n(this,void 0,void 0,(function*(){if("string"==typeof e){let i;try{i=yield pn.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return hn.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:pn.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 $n(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 $n(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 $n(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;let i="",n=!0;if("string"==typeof e.image)i=pn.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const t of e.image.sizes)if(screen.width>=t.min_width){i=t.location,n=!0===t.cache;break}}else pn.isMobile&&e.image_mobile?(i=e.image_mobile.location,n=!0===e.image_mobile.cache):(i=e.image.location,n=!0===e.image.cache);return{location:i,cache:n}}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 $n(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 pn.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 pn.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?pn.getArray(o):[]}loadFloorplanSvg(e,t,i){var n;return $n(this,void 0,void 0,(function*(){let r;try{r=yield pn.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const s=document.createElement("div");s.innerHTML=r;const a=s.querySelector("svg");if(t&&a.setAttribute("id",t.config.page_id),a.setAttribute("height","100%"),a.setAttribute("width","100%"),a.style.height="100%",a.style.width="100%",a.style.margin="auto",a.style.cursor="default",a.style.opacity="0",a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&i){const e=i.config.page_id,r=i.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement.replaceChildren(a);else{const e=this.floorplanElement.querySelector("#"+r),t=Number.parseFloat(a.getAttribute("height")),i=Number.parseFloat(a.getAttribute("width"));a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${i} ${t}`),a.setAttribute("preserveAspectRatio","xMinYMin meet"),a.setAttribute("height",e.getAttribute("height")),a.setAttribute("width",e.getAttribute("width")),a.setAttribute("x",e.getAttribute("x")),a.setAttribute("y",e.getAttribute("y")),null===(n=e.parentElement)||void 0===n||n.replaceChildren(a)}}else this.floorplanElement.replaceChildren(a);return a}))}loadImage(e,t,i,n,r){return $n(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 $n(this,void 0,void 0,(function*(){e=r?e:pn.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 $n(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield pn.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"),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=>{Rn.off(e,"click"),Rn.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}]:[]}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 vn(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)),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 vn(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 yn(this,i,n,t,r,e);if(e&&!s&&Rn.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new yn(this,i,n,t,r,s);Nn.observe(a),e&&Rn.on(a,"singleClick",this.onClick.bind(c)),Rn.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),pn.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new yn(this,i,n,t,r,e);Tn.observe(a),Rn.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),pn.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,i){const n=new gn(t.id,t,t,t.getBBox());return i.svgElementInfos[t.id]=n,n}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 $n(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=pn.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 ${pn.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r)):pn.equal(i.lastState.attributes,n.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${pn.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return $n(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 $n(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))pn.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: ${ye.timeago(n.last_changed)}\n`,i+=`Last updated: ${ye.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){if("string"!=typeof e||!Mn.isCode(e))return e;try{return Mn.evaluate(e,this.hass,this.config,t,i,this.svgElements,this.functions)}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){const r=this.getActionConfigs(e);for(const e of r){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}`):fn(this,"hass-more-info",{entityId:t});break;case"navigate":this.isDemo?this.notify(`Performing action: ${e.action} ${e.navigation_path}`):mn(0,e.navigation_path);break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const t=e.same_tab?"_self":"_blank";window.open(e.url_path,t)}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":fn(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){try{if("object"==typeof e.service_data)for(const n of Object.keys(e.service_data))this.evaluate(e.service_data[n],t,i);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,i):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);if("floorplan"===s)this.callFloorplanService(s,a,e,t,i,n);else 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,pn.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,pn.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)),pn.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,pn.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";pn.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);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(i,n,e)}}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})`)}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("
");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}`)}};Dn([ae({type:String})],jn.prototype,"examplespath",void 0),Dn([ae({type:Object})],jn.prototype,"hass",void 0),Dn([ae({type:String||Object})],jn.prototype,"_config",void 0),Dn([ae({type:Boolean})],jn.prototype,"isDemo",void 0),Dn([ae({type:Boolean})],jn.prototype,"isShowLog",void 0),Dn([ae({type:Function})],jn.prototype,"notify",void 0),jn=Dn([re("floorplan-element")],jn); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const en=1,tn=2,nn=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)}} +const Bn=1,Vn=2,Fn=e=>(...t)=>({_$litDirective$:e,values:t});class Un{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 sn=nn(class extends rn{constructor(e){var t;if(super(e),e.type!==en||"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 j}});var an,on=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 cn=an=class extends ie{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?R` +const Hn=Fn(class extends Un{constructor(e){var t;if(super(e),e.type!==Bn||"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 j}});var qn,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 Wn=qn=class extends ie{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?R` ${this.isDisplayCardHeader?R`

${null===(e=this.config)||void 0===e?void 0:e.title}

`:""} -
+
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)}};cn.cardHeaderHeight=76,on([ae({type:Object})],cn.prototype,"hass",void 0),on([ae({type:Boolean})],cn.prototype,"isPanel",void 0),on([ae({type:Boolean})],cn.prototype,"editMode",void 0),on([ae({type:Object})],cn.prototype,"config",void 0),on([ae({type:String})],cn.prototype,"examplespath",void 0),on([ae({type:Boolean})],cn.prototype,"isDemo",void 0),on([ae({type:Function})],cn.prototype,"notify",void 0),cn=an=on([re("floorplan-card")],cn);var ln,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 un=ln=class extends ie{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return R` + `}get isFullHeight(){var e;return null===(e=this.config)||void 0===e?void 0:e.full_height}get view(){return this._view||(this._view=dn.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?qn.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)}};Wn.cardHeaderHeight=76,zn([ae({type:Object})],Wn.prototype,"hass",void 0),zn([ae({type:Boolean})],Wn.prototype,"isPanel",void 0),zn([ae({type:Boolean})],Wn.prototype,"editMode",void 0),zn([ae({type:Object})],Wn.prototype,"config",void 0),zn([ae({type:String})],Wn.prototype,"examplespath",void 0),zn([ae({type:Boolean})],Wn.prototype,"isDemo",void 0),zn([ae({type:Function})],Wn.prototype,"notify",void 0),Wn=qn=zn([re("floorplan-card")],Wn);var Yn,Gn=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 Jn=Yn=class extends ie{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return R` @@ -178,7 +178,7 @@ const sn=nn(class extends rn{constructor(e){var t;if(super(e),e.type!==en||"styl -
+
@@ -197,13 +197,13 @@ const sn=nn(class extends rn{constructor(e){var t;if(super(e),e.type!==en||"styl [hidden] { display: none !important; } - `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?ln.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)}};un.appHeaderHeight=64,hn([ae({type:Object})],un.prototype,"hass",void 0),hn([ae({type:Boolean})],un.prototype,"narrow",void 0),hn([ae({type:Object})],un.prototype,"panel",void 0),hn([ae({type:Boolean})],un.prototype,"showSideBar",void 0),hn([ae({type:Boolean})],un.prototype,"showAppHeader",void 0),hn([ae({type:String})],un.prototype,"examplespath",void 0),hn([ae({type:Boolean})],un.prototype,"isDemo",void 0),hn([ae({type:Function})],un.prototype,"notify",void 0),un=ln=hn([re("floorplan-panel")],un); + `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Yn.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)}};Jn.appHeaderHeight=64,Gn([ae({type:Object})],Jn.prototype,"hass",void 0),Gn([ae({type:Boolean})],Jn.prototype,"narrow",void 0),Gn([ae({type:Object})],Jn.prototype,"panel",void 0),Gn([ae({type:Boolean})],Jn.prototype,"showSideBar",void 0),Gn([ae({type:Boolean})],Jn.prototype,"showAppHeader",void 0),Gn([ae({type:String})],Jn.prototype,"examplespath",void 0),Gn([ae({type:Boolean})],Jn.prototype,"isDemo",void 0),Gn([ae({type:Function})],Jn.prototype,"notify",void 0),Jn=Yn=Gn([re("floorplan-panel")],Jn); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class pn extends rn{constructor(e){if(super(e),this.it=B,e.type!==tn)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===B||null==e)return this._t=void 0,this.it=e;if(e===j)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:[]}}}pn.directiveName="unsafeHTML",pn.resultType=1;const dn=nn(pn);var fn=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 mn=class extends ie{constructor(){super(...arguments),this.lang="",this.code=""}render(){return R`
${dn(this.code)}
`}static get styles(){return a` +class Xn extends Un{constructor(e){if(super(e),this.it=B,e.type!==Vn)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===B||null==e)return this._t=void 0,this.it=e;if(e===j)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:[]}}}Xn.directiveName="unsafeHTML",Xn.resultType=1;const Kn=Fn(Xn);var Qn=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 Zn=class extends ie{constructor(){super(...arguments),this.lang="",this.code=""}render(){return R`
${Kn(this.code)}
`}static get styles(){return a` .hljs { display: block; overflow-x: auto; @@ -292,7 +292,7 @@ class pn extends rn{constructor(e){if(super(e),this.it=B,e.type!==tn)throw Error .hljs-strong { font-weight: bold; } - `}};fn([ae({type:String})],mn.prototype,"lang",void 0),fn([ae({type:String})],mn.prototype,"code",void 0),mn=fn([re("code-block")],mn);var gn=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},vn=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())}))};let yn=class extends ie{render(){return R` + `}};Qn([ae({type:String})],Zn.prototype,"lang",void 0),Qn([ae({type:String})],Zn.prototype,"code",void 0),Zn=Qn([re("code-block")],Zn);var er=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},tr=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())}))};let ir=class extends ie{render(){return R`
${this.example.isCard?R`
- `}static get styles(){return a``}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return vn(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 Ci.fetchText(e,!0,this.examplespath,!1);if(this.config=Ci.parseYaml(t),this.configYaml=t,this.example.simulationFile){const e=`${this.examplespath}/${this.example.dir}/${this.example.simulationFile}`,t=yield Ci.fetchText(e,!0,this.examplespath,!1),i=Ci.parseYaml(t);this.simulator=new Se(i,this.setHass.bind(this))}}}))}setHass(e){this.hass=e}};gn([ae({type:Object})],yn.prototype,"hass",void 0),gn([ae({type:Object})],yn.prototype,"config",void 0),gn([ae({type:String})],yn.prototype,"configYaml",void 0),gn([ae({type:String})],yn.prototype,"examplespath",void 0),gn([ae({type:Object})],yn.prototype,"example",void 0),gn([ae({type:Boolean})],yn.prototype,"isDemo",void 0),gn([ae({type:Function})],yn.prototype,"notify",void 0),yn=gn([re("floorplan-example")],yn);var bn=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 ie{constructor(){super(),this._toastText=""}render(){return R`
${this._toastText}
`}static get styles(){return a` + `}static get styles(){return a``}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return tr(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 pn.fetchText(e,!0,this.examplespath,!1);if(this.config=pn.parseYaml(t),this.configYaml=t,this.example.simulationFile){const e=`${this.examplespath}/${this.example.dir}/${this.example.simulationFile}`,t=yield pn.fetchText(e,!0,this.examplespath,!1),i=pn.parseYaml(t);this.simulator=new _e(i,this.setHass.bind(this))}}}))}setHass(e){this.hass=e}};er([ae({type:Object})],ir.prototype,"hass",void 0),er([ae({type:Object})],ir.prototype,"config",void 0),er([ae({type:String})],ir.prototype,"configYaml",void 0),er([ae({type:String})],ir.prototype,"examplespath",void 0),er([ae({type:Object})],ir.prototype,"example",void 0),er([ae({type:Boolean})],ir.prototype,"isDemo",void 0),er([ae({type:Function})],ir.prototype,"notify",void 0),ir=er([re("floorplan-example")],ir);var nr=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 rr=class extends ie{constructor(){super(),this._toastText=""}render(){return R`
${this._toastText}
`}static get styles(){return a` :host { display: none; justify-content: center; @@ -387,7 +387,7 @@ class pn extends rn{constructor(e){if(super(e),this.it=B,e.type!==tn)throw Error 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))}};bn([ae({type:String})],xn.prototype,"_toastText",void 0),xn=bn([re("lit-toast")],xn);var wn=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 _n=class extends ie{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 R` + `}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))}};nr([ae({type:String})],rr.prototype,"_toastText",void 0),rr=nr([re("lit-toast")],rr);var sr=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 ar=class extends ie{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 R` ${null===(e=this.examples)||void 0===e?void 0:e.map((e=>R` `))} - `}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)}};wn([ae({type:String})],_n.prototype,"examplespath",void 0),wn([ae({type:Array})],_n.prototype,"examples",void 0),_n=wn([re("floorplan-examples")],_n)})()})(); \ No newline at end of file + `}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)}};sr([ae({type:String})],ar.prototype,"examplespath",void 0),sr([ae({type:Array})],ar.prototype,"examples",void 0),ar=sr([re("floorplan-examples")],ar)})()})(); \ No newline at end of file diff --git a/dist/floorplan.js b/dist/floorplan.js index db130063..7cd180c1 100644 --- a/dist/floorplan.js +++ b/dist/floorplan.js @@ -1,4 +1,4 @@ -(()=>{var e={1: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,g=n||i,m=p||0,v=d||!1,y=0;function b(e,t,i,n){for(var l="",p=null,d=!1,f=e.length,g=!1,y=0;yy?(y=s,f=new Date(y),i=y,v&&(f=new Date(y+l(f)+m))):i=y,t=f}return b(e,t,g,i)};return x.localize=function(t){return new e(t||g,m,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=m,n=v,r=typeof t;"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));return new e(g,i,n)},x.utc=function(){return new e(g,m,!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})}()},449:function(e,t,i){e.exports=function(e){"use strict";var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return Xe},get VariableDeclaration(){return Qe},get VariableDeclarator(){return Ze},get ClassDeclaration(){return et},get ClassBody(){return tt},get MethodDefinition(){return it}}),n=Object.freeze({__proto__:null,get FunctionDeclaration(){return ri},get VariableDeclaration(){return si},get VariableDeclarator(){return ai},get ClassDeclaration(){return oi},get ClassBody(){return ci},get MethodDefinition(){return li}}),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;function u(e,t){h?h(e,t):e.__proto__=t}var p=Object.getPrototypeOf;function d(e){return p?p(e):e.__proto__}var f=Object.getOwnPropertyDescriptor;function g(e,t,i){for(;t;){var n=f(t,i),r=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(r)return r;t=d(t)}}function m(e,t){return g("get",e,t)}function v(e,t){return g("set",e,t)}var y=Object.create;function b(e,t){u(e,t),e.prototype=y(t.prototype,{constructor:{value:e,writable:!0}})}function x(e){for(var t=1;t=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}var M="0.4.8",N={RES:void 0},O={RES:void 0},L=T("continue"),D=T("break"),R=T("super"),$=T("supercall"),B=T("noctor"),V=T("clsctor"),j=T("newtarget"),F=T("noinit"),U=T("deadzone"),H=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}(),q=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}(),z=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=y(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 q(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!==F&&n.set(t)}else i.context[e]=new H("var",t===F?void 0:t);if(!i.parent){var r=i.find("window").get();t!==F&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("let",t)},e.prototype.const=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("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 H("var",t)},e}(); +(()=>{var e={1: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"}}},n=t.en_US,i=new function e(i,p,d){var f,g=i||n,m=p||0,v=d||!1,y=0;function b(e,t,n,i){for(var l="",p=null,d=!1,f=e.length,g=!1,y=0;yy?(y=s,f=new Date(y),n=y,v&&(f=new Date(y+l(f)+m))):n=y,t=f}return b(e,t,g,n)};return x.localize=function(t){return new e(t||g,m,v)},x.localizeByIdentifier=function(e){var n=t[e];return n?x.localize(n):(u('[WARNING] No locale found with identifier "'+e+'".'),x)},x.timezone=function(t){var n=m,i=v,r=typeof t;"number"!==r&&"string"!==r||(i=!0,"string"===r?n=("-"===t[0]?-1:1)*(60*parseInt(t.slice(1,3),10)+parseInt(t.slice(3,5),10))*60*1e3:"number"===r&&(n=60*t*1e3));return new e(g,n,i)},x.utc=function(){return new e(g,m,!0)},x}(n,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 n=e.getDay();"monday"===t&&(0===n?n=6:n--);var i=Date.UTC(e.getFullYear(),0,1),r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=(Math.floor((r-i)/864e5)+7-n)/7;return Math.floor(s)}function c(e){var t=e%10,n=e%100;if(n>=11&&n<=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 n=e.toLocaleString(t,{timeZoneName:"short"}).match(/\s([\w]+)$/);return n&&n[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=i,"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},449:function(e,t,n){e.exports=function(e){"use strict";var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return Ke},get VariableDeclaration(){return Qe},get VariableDeclarator(){return Ze},get ClassDeclaration(){return et},get ClassBody(){return tt},get MethodDefinition(){return nt}}),i=Object.freeze({__proto__:null,get FunctionDeclaration(){return sn},get VariableDeclaration(){return an},get VariableDeclarator(){return on},get ClassDeclaration(){return cn},get ClassBody(){return ln},get MethodDefinition(){return hn}}),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;function u(e,t){h?h(e,t):e.__proto__=t}var p=Object.getPrototypeOf;function d(e){return p?p(e):e.__proto__}var f=Object.getOwnPropertyDescriptor;function g(e,t,n){for(;t;){var i=f(t,n),r=void 0!==i&&void 0===i.writable&&"function"==typeof i[e]&&i[e];if(r)return r;t=d(t)}}function m(e,t){return g("get",e,t)}function v(e,t){return g("set",e,t)}var y=Object.create;function b(e,t){u(e,t),e.prototype=y(t.prototype,{constructor:{value:e,writable:!0}})}function x(e){for(var t=1;t=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}var M="0.4.8",N={RES:void 0},O={RES:void 0},L=T("continue"),D=T("break"),R=T("super"),$=T("supercall"),V=T("noctor"),B=T("clsctor"),j=T("newtarget"),F=T("noinit"),U=T("deadzone"),H=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}(),q=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}(),z=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=y(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 n in this.context){var i=this.context[n];t[i.kind](n,i.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 q(t,e):null},e.prototype.var=function(e,t){for(var n=this;n.parent&&!n.isolated;)n=n.parent;var i=n.context[e];if(i){if("var"!==i.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");t!==F&&i.set(t)}else n.context[e]=new H("var",t===F?void 0:t);if(!n.parent){var r=n.find("window").get();t!==F&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var n=this.context[e];if(n&&n.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("let",t)},e.prototype.const=function(e,t){var n=this.context[e];if(n&&n.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("const",t)},e.prototype.func=function(e,t){var n=this.context[e];if(n&&"var"!==n.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("var",t)},e}(); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -13,45 +13,45 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -function W(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]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function Y(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 K(){for(var e=[],t=0;t":return i>n;case">=":return i>=n;case"<<":return i<>":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)}}function oe(e,t){var i,n=Je(e.right,t),r=e.left;if("Identifier"===r.type){if(!(i=J(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return bi(r,t,{feed:n});i=le(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()<>=":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)}}function ce(e,t){switch(e.operator){case"||":return Je(e.left,t)||Je(e.right,t);case"&&":return Je(e.left,t)&&Je(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function le(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?xe(e.object,t,{getProto:!0}):Je(e.object,t),o)return n;if(r=e.computed?Je(e.property,t):e.property.name,l){var h=v(n,r);if("Super"===e.object.type&&h){var u=t.find("this").get(),p=T(r);return s(u,p,{set:h}),new q(u,p)}return new q(n,r)}var d=m(n,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):n[r]}function he(e,t){return Je(e.test,t)?Je(e.consequent,t):Je(e.alternate,t)}function ue(e,t){var i,n;if("MemberExpression"===e.callee.type){n=le(e.callee,t,{getObj:!0});var r=void 0;if(r=e.callee.computed?Je(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[V])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(i=Je(e.callee,t))||"Super"!==e.callee.type&&i[V]){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":return[2,i>n];case">=":return[2,i>=n];case"<<":return[2,i<>":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)}}}))}function ft(e,t){var i,n,r,s;return W(this,(function(a){switch(a.label){case 0:return[5,G(ni(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,G(nt(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,G(mt(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,G(di(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()<>=":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)}}}))}function gt(e,t){var i,n;return W(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,G(ni(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,G(ni(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,G(ni(e.left,t))];case 6:return(n=r.sent())?[5,G(ni(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)}}))}function mt(e,t,i){var n,r,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),W(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,G(Ct(e.object,t,{getProto:!0}))];case 1:return c=f.sent(),[3,4];case 2:return[5,G(ni(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,G(ni(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=v(c,l),"Super"===e.object.type&&h?(d=t.find("this").get(),u=T(l),s(d,u,{set:h}),[2,new q(d,u)]):[2,new q(c,l)]):(p=m(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function vt(e,t){var i;return W(this,(function(n){switch(n.label){case 0:return[5,G(ni(e.test,t))];case 1:return n.sent()?[5,G(ni(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,G(ni(e.alternate,t))];case 4:i=n.sent(),n.label=5;case 5:return[2,i]}}))}function yt(e,t){var i,n,r,s,a,o,c,l,h,u,p,d;return W(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,G(mt(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,G(ni(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[V])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,G(ni(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[V]){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-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function pi(e,t){var i,n,r,s,a;return W(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,G(si(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,G(si(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,G(si(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,G(pi(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,G(pi(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,G(pi(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-1;o--)e.body.splice(a[o],1);e.body=s.concat(e.body)}}function yi(e,t){switch(e.type){case"VariableDeclaration":Qe(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&Qe(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&Qe(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":yi(e.body,t);break;case"IfStatement":yi(e.consequent,t),e.alternate&&yi(e.alternate,t);break;case"BlockStatement":for(var i=0;i{"use strict";i.r(t),i.d(t,{Node:()=>ne,Parser:()=>j,Position:()=>L,SourceLocation:()=>D,TokContext:()=>ae,Token:()=>Te,TokenType:()=>m,defaultOptions:()=>$,getLineInfo:()=>R,isIdentifierChar:()=>g,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>S,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Le,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>_,tokenizer:()=>Re,version:()=>Oe});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;ne)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 g(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 m=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 m(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 m(e,t)}var _={num:new m("num",b),regexp:new m("regexp",b),string:new m("string",b),name:new m("name",b),eof:new m("eof"),bracketL:new m("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new m("]"),braceL:new m("{",{beforeExpr:!0,startsExpr:!0}),braceR:new m("}"),parenL:new m("(",{beforeExpr:!0,startsExpr:!0}),parenR:new m(")"),comma:new m(",",y),semi:new m(";",y),colon:new m(":",y),dot:new m("."),question:new m("?",y),arrow:new m("=>",y),template:new m("template"),invalidTemplate:new m("invalidTemplate"),ellipsis:new m("...",y),backQuote:new m("`",b),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m("=",{beforeExpr:!0,isAssign:!0}),assign:new m("_=",{beforeExpr:!0,isAssign:!0}),incDec:new m("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m("!/~",{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 m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new m("**",{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})},S=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(S.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 M(e,t){return T.call(e,t)}var N=Array.isArray||function(e){return"[object Array]"===P.call(e)};function O(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 R(e,t){for(var i=1,n=0;;){k.lastIndex=n;var r=k.exec(e);if(!(r&&r.index=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}function V(e,t){return 2|(e?4:0)|(t?8:0)}var j=function(e,t,i){this.options=e=B(e),this.sourceFile=e.sourceFile,this.keywords=O(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=O(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=O(o),this.reservedWordsStrictBind=O(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(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=_.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},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};j.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},F.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},F.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},F.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},F.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},F.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},j.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},j.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n-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")}},U.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")},U.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case _._class:return e&&this.unexpected(),this.parseClass(s,!0);case _._if:return this.parseIfStatement(s);case _._return:return this.parseReturnStatement(s);case _._switch:return this.parseSwitchStatement(s);case _._throw:return this.parseThrowStatement(s);case _._try:return this.parseTryStatement(s);case _._const:case _._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case _._while:return this.parseWhileStatement(s);case _._with:return this.parseWithStatement(s);case _.braceL:return this.parseBlock(!0,s);case _.semi:return this.parseEmptyStatement(s);case _._export:case _._import:if(this.options.ecmaVersion>10&&r===_._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===_._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===_.name&&"Identifier"===l.type&&this.eat(_.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}},z.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(_.semi)||this.insertSemicolon()?e.label=null:this.type!==_.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(_.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.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(W),this.enterScope(0),this.expect(_.parenL),this.type===_.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===_._var||this.type===_._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===_._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===_._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 q,a=this.parseExpression(!0,s);return this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===_._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))},z.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,K|(i?0:J),!1,t)},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(_._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},z.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(_.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},z.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(_.braceL),this.labels.push(G),this.enterScope(0);for(var i=!1;this.type!==_.braceR;)if(this.type===_._case||this.type===_._default){var n=this.type===_._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(_.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")},z.parseThrowStatement=function(e){return this.next(),S.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=[];z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===_._catch){var t=this.startNode();if(this.next(),this.eat(_.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(_.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(_._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(W),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.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")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,i,n){for(var r=0,s=this.labels;r=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")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.parseBlock=function(e,t){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(_.braceL),e&&this.enterScope(0);!this.eat(_.braceR);){var i=this.parseStatement(null);t.body.push(i)}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},z.parseFor=function(e,t){return e.init=t,this.expect(_.semi),e.test=this.type===_.semi?null:this.parseExpression(),this.expect(_.semi),e.update=this.type===_.parenR?null:this.parseExpression(),this.expect(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},z.parseForIn=function(e,t){var i=this.type===_._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(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},z.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(_.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===_._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(_.comma))break}return e},z.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var K=1,J=2;z.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===_.star&&t&J&&this.unexpected(),e.generator=this.eat(_.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&K&&(e.id=4&t&&this.type!==_.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(V(e.async,e.generator)),t&K||(e.id=this.type===_.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&K?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(_.parenL),e.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.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(_.braceL);!this.eat(_.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")},z.parseClassElement=function(e){var t=this;if(this.eat(_.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===_.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(_.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(_.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},z.parseClassMethod=function(e,t,i,n){return e.value=this.parseMethod(t,i,n),this.finishNode(e,"MethodDefinition")},z.parseClassId=function(e,t){this.type===_.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},z.parseClassSuper=function(e){e.superClass=this.eat(_._extends)?this.parseExprSubscripts():null},z.parseExport=function(e,t){if(this.next(),this.eat(_.star))return this.expectContextual("from"),this.type!==_.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(_._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===_._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|K,!1,i)}else if(this.type===_._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!==_.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s=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=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(_._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(_.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===_.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(_.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0)}return a;case _.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case _.num:case _.string:return this.parseLiteral(this.value);case _._null:case _._true:case _._false:return(t=this.startNode()).value=this.type===_._null?null:this.type===_._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case _.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 _.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(_.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case _.braceL:return this.parseObj(!1,e);case _._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case _._class:return this.parseClass(this.startNode(),!1);case _._new:return this.parseNew();case _.backQuote:return this.parseTemplate();case _._import:return this.options.ecmaVersion>10?this.parseDynamicImport():this.unexpected();default:this.unexpected()}},Q.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==_.parenL&&this.unexpected(),this.finishNode(e,"Import")},Q.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")},Q.parseParenExpression=function(){this.expect(_.parenL);var e=this.parseExpression();return this.expect(_.parenR),e},Q.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 q,p=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==_.parenR;){if(l?l=!1:this.expect(_.comma),r&&this.afterTrailingComma(_.parenR,!0)){h=!0;break}if(this.type===_.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===_.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,g=this.startLoc;if(this.expect(_.parenR),e&&!this.canInsertSemicolon()&&this.eat(_.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,g)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var m=this.startNodeAt(i,n);return m.expression=t,this.finishNode(m,"ParenthesizedExpression")}return t},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Z=[];Q.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(_.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(_.parenL)?e.arguments=this.parseExprList(_.parenR,this.options.ecmaVersion>=8&&"Import"!==e.callee.type,!1):e.arguments=Z,this.finishNode(e,"NewExpression")},Q.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===_.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===_.backQuote,this.finishNode(i,"TemplateElement")},Q.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===_.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(_.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(_.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},Q.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===_.name||this.type===_.num||this.type===_.string||this.type===_.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===_.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},Q.parseObj=function(e,t){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(_.braceR);){if(n)n=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.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")},Q.parseProperty=function(e,t){var i,n,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(_.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===_.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===_.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(_.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(_.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},Q.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&this.type===_.colon&&this.unexpected(),this.eat(_.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===_.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===_.comma||this.type===_.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===_.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")}},Q.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(_.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(_.bracketR),e.key;e.computed=!1}return e.key=this.type===_.num||this.type===_.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.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|V(t,n.generator)|(i?128:0)),this.expect(_.parenL),n.params=this.parseBindingList(_.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")},Q.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|V(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")},Q.parseFunctionBody=function(e,t,i){var n=t&&this.type!==_.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},Q.isSimpleParamList=function(e){for(var t=0,i=e;t-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")},te.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},te.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},te.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 ne=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])},re=j.prototype;function se(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}re.startNode=function(){return new ne(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ne(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,i,n){return se.call(this,e,t,i,n)};var ae=function(e,t,i,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!r},oe={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},ce=j.prototype;ce.initialContext=function(){return[oe.b_stat]},ce.braceIsBlock=function(e){var t=this.curContext();return t===oe.f_expr||t===oe.f_stat||(e!==_.colon||t!==oe.b_stat&&t!==oe.b_expr?e===_._return||e===_.name&&this.exprAllowed?S.test(this.input.slice(this.lastTokEnd,this.start)):e===_._else||e===_.semi||e===_.eof||e===_.parenR||e===_.arrow||(e===_.braceL?t===oe.b_stat:e!==_._var&&e!==_._const&&e!==_.name&&!this.exprAllowed):!t.isExpr)},ce.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},ce.updateContext=function(e){var t,i=this.type;i.keyword&&e===_.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},_.parenR.updateContext=_.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===oe.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},_.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?oe.b_stat:oe.b_expr),this.exprAllowed=!0},_.dollarBraceL.updateContext=function(){this.context.push(oe.b_tmpl),this.exprAllowed=!0},_.parenL.updateContext=function(e){var t=e===_._if||e===_._for||e===_._with||e===_._while;this.context.push(t?oe.p_stat:oe.p_expr),this.exprAllowed=!0},_.incDec.updateContext=function(){},_._function.updateContext=_._class.updateContext=function(e){!e.beforeExpr||e===_.semi||e===_._else||e===_._return&&S.test(this.input.slice(this.lastTokEnd,this.start))||(e===_.colon||e===_.braceL)&&this.curContext()===oe.b_stat?this.context.push(oe.f_stat):this.context.push(oe.f_expr),this.exprAllowed=!1},_.backQuote.updateContext=function(){this.curContext()===oe.q_tmpl?this.context.pop():this.context.push(oe.q_tmpl),this.exprAllowed=!1},_.star.updateContext=function(e){if(e===_._function){var t=this.context.length-1;this.context[t]===oe.f_expr?this.context[t]=oe.f_expr_gen:this.context[t]=oe.f_gen}this.exprAllowed=!0},_.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==_.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var le="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",he=le+" Extended_Pictographic",ue={9:le,10:he,11:"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 Extended_Pictographic"},pe="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",de="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",fe=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ge={9:de,10:fe,11:"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 Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},me={};function ve(e){var t=me[e]={binary:O(ue[e]+" "+pe),nonBinary:{General_Category:O(pe),Script:O(ge[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}ve(9),ve(10),ve(11);var ye=j.prototype,be=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 xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function _e(e){return e>=65&&e<=90||e>=97&&e<=122}function Se(e){return _e(e)||95===e}function ke(e){return Se(e)||Ee(e)}function Ee(e){return e>=48&&e<=57}function Ae(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.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},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.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},be.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},be.prototype.current=function(){return this.at(this.pos)},be.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},be.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},be.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ye.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ye.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=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},ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ye.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=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},ye.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)},ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!we(i);)e.advance();return e.pos!==t},ye.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)},ye.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")}},ye.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},ye.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},ye.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)},ye.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 g(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ye.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)},ye.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},ye.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},ye.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)},ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ye.regexp_eatZero=function(e){return 48===e.current()&&!Ee(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ye.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)},ye.regexp_eatControlLetter=function(e){var t=e.current();return!!_e(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.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)},ye.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},ye.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},ye.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},ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){M(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ke(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ye.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},ye.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")}}},ye.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||Ie(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)},ye.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)},ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ee(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ee(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ae(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(i),e.advance();return e.pos!==t},ye.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},ye.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ye.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}Pe.next=function(){this.options.onToken&&this.options.onToken(new Te(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Pe.getToken=function(){return this.next(),new Te(this)},"undefined"!=typeof Symbol&&(Pe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===_.eof,value:t}}}}),Pe.curContext=function(){return this.context[this.context.length-1]},Pe.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(_.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Pe.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Pe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Pe.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.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Pe.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)},Pe.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(_.ellipsis)):(++this.pos,this.finishToken(_.dot))},Pe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(_.assign,2):this.finishOp(_.slash,1)},Pe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?_.star:_.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=_.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(_.assign,i+1):this.finishOp(n,i)},Pe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?_.logicalOR:_.logicalAND,2):61===t?this.finishOp(_.assign,2):this.finishOp(124===e?_.bitwiseOR:_.bitwiseAND,1)},Pe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(_.assign,2):this.finishOp(_.bitwiseXOR,1)},Pe.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&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(_.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(_.assign,2):this.finishOp(_.plusMin,1)},Pe.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(_.assign,i+1):this.finishOp(_.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(_.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Pe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(_.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(_.arrow)):this.finishOp(61===e?_.eq:_.prefix,1)},Pe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(_.parenL);case 41:return++this.pos,this.finishToken(_.parenR);case 59:return++this.pos,this.finishToken(_.semi);case 44:return++this.pos,this.finishToken(_.comma);case 91:return++this.pos,this.finishToken(_.bracketL);case 93:return++this.pos,this.finishToken(_.bracketR);case 123:return++this.pos,this.finishToken(_.braceL);case 125:return++this.pos,this.finishToken(_.braceR);case 58:return++this.pos,this.finishToken(_.colon);case 63:return++this.pos,this.finishToken(_.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(_.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(_.prefix,1)}this.raise(this.pos,"Unexpected character '"+Me(e)+"'")},Pe.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Pe.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(S.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 be(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(_.regexp,{pattern:r,flags:a,value:c})},Pe.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,n=n*e+o}return this.pos===i||null!=t&&this.pos-i!==t?null:n},Pe.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(_.num,i)},Pe.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(_.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(_.num,o)},Pe.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},Pe.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(_.string,t)};var Ne={};Pe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ne)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ne;this.raise(e,t)},Pe.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!==_.template&&this.type!==_.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(_.template,e)):36===i?(this.pos+=2,this.finishToken(_.dollarBraceL)):(++this.pos,this.finishToken(_.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}},Pe.readInvalidTemplateToken=function(){for(;this.pos=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)}},Pe.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{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"; +function W(e,t){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function G(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return a}function J(){for(var e=[],t=0;t":return n>i;case">=":return n>=i;case"<<":return n<>":return n>>i;case">>>":return n>>>i;case"+":return n+i;case"-":return n-i;case"*":return n*i;case"**":return Math.pow(n,i);case"/":return n/i;case"%":return n%i;case"|":return n|i;case"^":return n^i;case"&":return n&i;case"in":return n in i;case"instanceof":return n instanceof i;default:throw new SyntaxError("Unexpected token "+e.operator)}}function oe(e,t){var n,i=Xe(e.right,t),r=e.left;if("Identifier"===r.type){if(!(n=X(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();n=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return xn(r,t,{feed:i});n=le(r,t,{getVar:!0})}switch(e.operator){case"=":return n.set(i),n.get();case"+=":return n.set(n.get()+i),n.get();case"-=":return n.set(n.get()-i),n.get();case"*=":return n.set(n.get()*i),n.get();case"/=":return n.set(n.get()/i),n.get();case"%=":return n.set(n.get()%i),n.get();case"**=":return n.set(Math.pow(n.get(),i)),n.get();case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>i),n.get();case">>>=":return n.set(n.get()>>>i),n.get();case"|=":return n.set(n.get()|i),n.get();case"^=":return n.set(n.get()^i),n.get();case"&=":return n.set(n.get()&i),n.get();default:throw new SyntaxError("Unexpected token "+e.operator)}}function ce(e,t){switch(e.operator){case"||":return Xe(e.left,t)||Xe(e.right,t);case"&&":return Xe(e.left,t)&&Xe(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function le(e,t,n){void 0===n&&(n={});var i,r,a=n.getObj,o=void 0!==a&&a,c=n.getVar,l=void 0!==c&&c;if(i="Super"===e.object.type?xe(e.object,t,{getProto:!0}):Xe(e.object,t),o)return i;if(r=e.computed?Xe(e.property,t):e.property.name,l){var h=v(i,r);if("Super"===e.object.type&&h){var u=t.find("this").get(),p=T(r);return s(u,p,{set:h}),new q(u,p)}return new q(i,r)}var d=m(i,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):i[r]}function he(e,t){return Xe(e.test,t)?Xe(e.consequent,t):Xe(e.alternate,t)}function ue(e,t){var n,i;if("MemberExpression"===e.callee.type){i=le(e.callee,t,{getObj:!0});var r=void 0;if(r=e.callee.computed?Xe(e.callee.property,t):e.callee.property.name,"Super"===e.callee.object.type){var s=t.find("this").get();n=i[r].bind(s)}else n=i[r];if("function"!=typeof n)throw new TypeError(r+" is not a function");if(n[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(i=t.find("this").get(),"function"!=typeof(n=Xe(e.callee,t))||"Super"!==e.callee.type&&n[B]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(n)}catch(e){a=""+n}throw"function"!=typeof n?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}for(var o=[],c=0;c":return[2,n>i];case">=":return[2,n>=i];case"<<":return[2,n<>":return[2,n>>i];case">>>":return[2,n>>>i];case"+":return[2,n+i];case"-":return[2,n-i];case"*":return[2,n*i];case"**":return[2,Math.pow(n,i)];case"/":return[2,n/i];case"%":return[2,n%i];case"|":return[2,n|i];case"^":return[2,n^i];case"&":return[2,n&i];case"in":return[2,n in i];case"instanceof":return[2,n instanceof i];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function ft(e,t){var n,i,r,s;return W(this,(function(a){switch(a.label){case 0:return[5,Y(rn(e.right,t))];case 1:return n=a.sent(),"Identifier"!==(i=e.left).type?[3,3]:[5,Y(it(i,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,i.name)),[3,7];case 3:return"MemberExpression"!==i.type?[3,5]:[5,Y(mt(i,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,Y(fn(i,t,{feed:n}))];case 6:return[2,a.sent()];case 7:switch(e.operator){case"=":return r.set(n),[2,r.get()];case"+=":return r.set(r.get()+n),[2,r.get()];case"-=":return r.set(r.get()-n),[2,r.get()];case"*=":return r.set(r.get()*n),[2,r.get()];case"/=":return r.set(r.get()/n),[2,r.get()];case"%=":return r.set(r.get()%n),[2,r.get()];case"**=":return r.set(Math.pow(r.get(),n)),[2,r.get()];case"<<=":return r.set(r.get()<>=":return r.set(r.get()>>n),[2,r.get()];case">>>=":return r.set(r.get()>>>n),[2,r.get()];case"|=":return r.set(r.get()|n),[2,r.get()];case"^=":return r.set(r.get()^n),[2,r.get()];case"&=":return r.set(r.get()&n),[2,r.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function gt(e,t){var n,i;return W(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,Y(rn(e.left,t))];case 2:return(n=r.sent())?[3,4]:[5,Y(rn(e.right,t))];case 3:n=r.sent(),r.label=4;case 4:return[2,n];case 5:return[5,Y(rn(e.left,t))];case 6:return(i=r.sent())?[5,Y(rn(e.right,t))]:[3,8];case 7:i=r.sent(),r.label=8;case 8:return[2,i];case 9:throw new SyntaxError("Unexpected token "+e.operator)}}))}function mt(e,t,n){var i,r,a,o,c,l,h,u,p,d;return void 0===n&&(n={}),W(this,(function(f){switch(f.label){case 0:return i=n.getObj,r=void 0!==i&&i,a=n.getVar,o=void 0!==a&&a,"Super"!==e.object.type?[3,2]:[5,Y(Ct(e.object,t,{getProto:!0}))];case 1:return c=f.sent(),[3,4];case 2:return[5,Y(rn(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,Y(rn(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=v(c,l),"Super"===e.object.type&&h?(d=t.find("this").get(),u=T(l),s(d,u,{set:h}),[2,new q(d,u)]):[2,new q(c,l)]):(p=m(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function vt(e,t){var n;return W(this,(function(i){switch(i.label){case 0:return[5,Y(rn(e.test,t))];case 1:return i.sent()?[5,Y(rn(e.consequent,t))]:[3,3];case 2:return n=i.sent(),[3,5];case 3:return[5,Y(rn(e.alternate,t))];case 4:n=i.sent(),i.label=5;case 5:return[2,n]}}))}function yt(e,t){var n,i,r,s,a,o,c,l,h,u,p,d;return W(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,Y(mt(e.callee,t,{getObj:!0}))];case 1:return i=f.sent(),r=void 0,e.callee.computed?[5,Y(rn(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(),n=i[r].bind(s)):n=i[r],"function"!=typeof n)throw new TypeError(r+" is not a function");if(n[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return i=t.find("this").get(),[5,Y(rn(e.callee,t))];case 6:if("function"!=typeof(n=f.sent())||"Super"!==e.callee.type&&n[B]){if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(n)}catch(e){a=""+n}throw"function"!=typeof n?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-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function dn(e,t){var n,i,r,s,a;return W(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,Y(an(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,Y(an(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,Y(an(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,Y(dn(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,Y(dn(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,Y(dn(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-1;o--)e.body.splice(a[o],1);e.body=s.concat(e.body)}}function bn(e,t){switch(e.type){case"VariableDeclaration":Qe(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&Qe(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&Qe(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":bn(e.body,t);break;case"IfStatement":bn(e.consequent,t),e.alternate&&bn(e.alternate,t);break;case"BlockStatement":for(var n=0;n{"use strict";n.r(t),n.d(t,{Node:()=>ie,Parser:()=>j,Position:()=>L,SourceLocation:()=>D,TokContext:()=>ae,Token:()=>Te,TokenType:()=>m,defaultOptions:()=>$,getLineInfo:()=>R,isIdentifierChar:()=>g,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>k,lineBreakG:()=>_,nonASCIIwhitespace:()=>A,parse:()=>Le,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>S,tokenizer:()=>Re,version:()=>Oe});var i={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 n=65536,i=0;ie)return!1;if((n+=t[i+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 g(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 m=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 m(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 m(e,t)}var S={num:new m("num",b),regexp:new m("regexp",b),string:new m("string",b),name:new m("name",b),eof:new m("eof"),bracketL:new m("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new m("]"),braceL:new m("{",{beforeExpr:!0,startsExpr:!0}),braceR:new m("}"),parenL:new m("(",{beforeExpr:!0,startsExpr:!0}),parenR:new m(")"),comma:new m(",",y),semi:new m(";",y),colon:new m(":",y),dot:new m("."),question:new m("?",y),arrow:new m("=>",y),template:new m("template"),invalidTemplate:new m("invalidTemplate"),ellipsis:new m("...",y),backQuote:new m("`",b),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m("=",{beforeExpr:!0,isAssign:!0}),assign:new m("_=",{beforeExpr:!0,isAssign:!0}),incDec:new m("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m("!/~",{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 m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new m("**",{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})},k=/\r\n?|\n|\u2028|\u2029/,_=new RegExp(k.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 M(e,t){return T.call(e,t)}var N=Array.isArray||function(e){return"[object Array]"===P.call(e)};function O(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,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function R(e,t){for(var n=1,i=0;;){_.lastIndex=i;var r=_.exec(e);if(!(r&&r.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),N(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return N(t.onComment)&&(t.onComment=function(e,t){return function(n,i,r,s,a,o){var c={type:n?"Block":"Line",value:i,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}function B(e,t){return 2|(e?4:0)|(t?8:0)}var j=function(e,t,n){this.options=e=V(e),this.sourceFile=e.sourceFile,this.keywords=O(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var a=e.ecmaVersion;!(r=i[a]);a--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=O(r);var o=(r?r+" ":"")+i.strict;this.reservedWordsStrict=O(o),this.reservedWordsStrictBind=O(o+" "+i.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(k).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},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};j.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},F.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},F.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},F.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},F.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},F.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},j.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},j.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,i=0;i-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},U.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,i=e.doubleProto;if(!t)return n>=0||i>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},U.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=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 i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(s,i);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,n);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)}},z.parseBreakContinueStatement=function(e,t){var n="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 i=0;i=6?this.eat(S.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.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(W),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===S._var||this.type===S._const||n){var i=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===i.declarations.length?(this.options.ecmaVersion>=9&&(this.type===S._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var s=new q,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))},z.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,J|(n?0:X),!1,t)},z.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")},z.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")},z.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(Y),this.enterScope(0);for(var n=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var i=this.type===S._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!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")},z.parseThrowStatement=function(e){return this.next(),k.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 G=[];z.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 n="Identifier"===t.param.type;this.enterScope(n?32:0),this.checkLVal(t.param,n?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")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(W),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.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")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,n,i){for(var r=0,s=this.labels;r=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(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.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 n=this.parseStatement(null);t.body.push(n)}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},z.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")},z.parseForIn=function(e,t){var n=this.type===S._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(n?"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=n?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},z.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(S.eq)?i.init=this.parseMaybeAssign(t):"const"!==n||this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===i.id.type||t&&(this.type===S._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(S.comma))break}return e},z.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var J=1,X=2;z.parseFunction=function(e,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===S.star&&t&X&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&J&&(e.id=4&t&&this.type!==S.name?null:this.parseIdent(),!e.id||t&X||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(B(e.async,e.generator)),t&J||(e.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,t&J?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.startNode(),r=!1;for(i.body=[],this.expect(S.braceL);!this.eat(S.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(i.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(i,"ClassBody"),this.strict=n,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(e){var t=this;if(this.eat(S.semi))return null;var n=this.startNode(),i=function(e,i){void 0===i&&(i=!1);var r=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===S.parenL||i&&t.canInsertSemicolon())||(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(r,s),n.key.name=e,t.finishNode(n.key,"Identifier"),!1))};n.kind="method",n.static=i("static");var r=this.eat(S.star),s=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(S.star)):i("get")?n.kind="get":i("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var a=n.key,o=!1;return n.computed||n.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?n.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==n.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"),n.kind="constructor",o=e),this.parseClassMethod(n,r,s,o),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},z.parseClassMethod=function(e,t,n,i){return e.value=this.parseMethod(t,n,i),this.finishNode(e,"MethodDefinition")},z.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)},z.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts():null},z.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 n;if(this.checkExport(t,"default",this.lastTokStart),this.type===S._function||(n=this.isAsyncFunction())){var i=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(i,4|J,!1,n)}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=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",n&&this.checkPatternErrors(n,!0);for(var i=0,r=e.properties;i=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(S._function))return this.parseFunction(this.startNodeAt(i,r),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(i,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(i,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(n);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()}},Q.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==S.parenL&&this.unexpected(),this.finishNode(e,"Import")},Q.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")},Q.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},Q.parseParenAndDistinguishExpression=function(e){var t,n=this.start,i=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 q,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,g=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(n,i,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,g)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var m=this.startNodeAt(n,i);return m.expression=t,this.finishNode(m,"ParenthesizedExpression")}return t},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var Z=[];Q.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(S.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||n)&&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 i=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,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=Z,this.finishNode(e,"NewExpression")},Q.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===S.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===S.backQuote,this.finishNode(n,"TemplateElement")},Q.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(n.quasis=[i];!i.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(S.braceR),n.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},Q.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)&&!k.test(this.input.slice(this.lastTokEnd,this.start))},Q.parseObj=function(e,t){var n=this.startNode(),i=!0,r={};for(n.properties=[],this.next();!this.eat(S.braceR);){if(i)i=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},Q.parseProperty=function(e,t){var n,i,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||(n=this.eat(S.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(a)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(a,t)):i=!1,this.parsePropertyValue(a,e,n,i,r,s,t,o),this.finishNode(a,"Property")},Q.parsePropertyValue=function(e,t,n,i,r,s,a,o){if((n||i)&&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(n,i);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?((n||i)&&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{(n||i)&&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")}},Q.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)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.parseMethod=function(e,t,n){var i=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|B(t,i.generator)|(n?128:0)),this.expect(S.parenL),i.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")},Q.parseArrowExpression=function(e,t,n){var i=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|B(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=i,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},Q.parseFunctionBody=function(e,t,n){var i=t&&this.type!==S.braceL,r=this.strict,s=!1;if(i)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&&!n&&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},Q.isSimpleParamList=function(e){for(var t=0,n=e;t-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();i=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){i=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}i&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},te.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},te.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},te.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,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},re=j.prototype;function se(e,t,n,i){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=n),e}re.startNode=function(){return new ie(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ie(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,n,i){return se.call(this,e,t,n,i)};var ae=function(e,t,n,i,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=i,this.generator=!!r},oe={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},ce=j.prototype;ce.initialContext=function(){return[oe.b_stat]},ce.braceIsBlock=function(e){var t=this.curContext();return t===oe.f_expr||t===oe.f_stat||(e!==S.colon||t!==oe.b_stat&&t!==oe.b_expr?e===S._return||e===S.name&&this.exprAllowed?k.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===oe.b_stat:e!==S._var&&e!==S._const&&e!==S.name&&!this.exprAllowed):!t.isExpr)},ce.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},ce.updateContext=function(e){var t,n=this.type;n.keyword&&e===S.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},S.parenR.updateContext=S.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===oe.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)?oe.b_stat:oe.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(oe.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?oe.p_stat:oe.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&&k.test(this.input.slice(this.lastTokEnd,this.start))||(e===S.colon||e===S.braceL)&&this.curContext()===oe.b_stat?this.context.push(oe.f_stat):this.context.push(oe.f_expr),this.exprAllowed=!1},S.backQuote.updateContext=function(){this.curContext()===oe.q_tmpl?this.context.pop():this.context.push(oe.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===oe.f_expr?this.context[t]=oe.f_expr_gen:this.context[t]=oe.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 le="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",he=le+" Extended_Pictographic",ue={9:le,10:he,11:he},pe="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",de="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",fe=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ge={9:de,10:fe,11:fe+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},me={};function ve(e){var t=me[e]={binary:O(ue[e]+" "+pe),nonBinary:{General_Category:O(pe),Script:O(ge[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}ve(9),ve(10),ve(11);var ye=j.prototype,be=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 xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Se(e){return e>=65&&e<=90||e>=97&&e<=122}function ke(e){return Se(e)||95===e}function _e(e){return ke(e)||Ee(e)}function Ee(e){return e>=48&&e<=57}function Ae(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.prototype.reset=function(e,t,n){var i=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.prototype.at=function(e){var t=this.source,n=t.length;if(e>=n)return-1;var i=t.charCodeAt(e);if(!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var r=t.charCodeAt(e+1);return r>=56320&&r<=57343?(i<<10)+r-56613888:i},be.prototype.nextIndex=function(e){var t=this.source,n=t.length;if(e>=n)return n;var i,r=t.charCodeAt(e);return!this.switchU||r<=55295||r>=57344||e+1>=n||(i=t.charCodeAt(e+1))<56320||i>57343?e+1:e+2},be.prototype.current=function(){return this.at(this.pos)},be.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},be.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},be.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ye.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,i=0;i-1&&this.raise(e.start,"Duplicate regular expression flag")}},ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ye.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,n=e.backReferenceNames;t=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ye.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var i=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r=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},ye.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)},ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!we(n);)e.advance();return e.pos!==t},ye.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)},ye.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")}},ye.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},ye.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},ye.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return g(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.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)},ye.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},ye.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},ye.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)},ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ye.regexp_eatZero=function(e){return 48===e.current()&&!Ee(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ye.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)},ye.regexp_eatControlLetter=function(e){var t=e.current();return!!Se(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t,n=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(e.switchU&&i>=55296&&i<=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*(i-55296)+(s-56320)+65536,!0}e.pos=r,e.lastIntValue=i}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=n}return!1},ye.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)},ye.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},ye.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},ye.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){M(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";ke(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";_e(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ye.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},ye.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},ye.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||Ie(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},ye.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)},ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ee(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ee(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ae(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(n),e.advance();return e.pos!==t},ye.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},ye.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ye.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var i=0;i>10),56320+(1023&e)))}Pe.next=function(){this.options.onToken&&this.options.onToken(new Te(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Pe.getToken=function(){return this.next(),new Te(this)},"undefined"!=typeof Symbol&&(Pe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Pe.curContext=function(){return this.context[this.context.length-1]},Pe.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())},Pe.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Pe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Pe.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),n=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(_.lastIndex=n;(e=_.exec(this.input))&&e.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Pe.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Pe.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))},Pe.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)},Pe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,i=42===e?S.star:S.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,i=S.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(S.assign,n+1):this.finishOp(i,n)},Pe.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)},Pe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Pe.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&&!k.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)},Pe.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(S.assign,n+1):this.finishOp(S.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(S.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Pe.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)},Pe.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 '"+Me(e)+"'")},Pe.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Pe.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(k.test(i)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new be(this));o.reset(n,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})},Pe.readInt=function(e,t){for(var n=this.pos,i=0,r=0,s=null==t?1/0:t;r=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,i=i*e+o}return this.pos===n||null!=t&&this.pos-n!==t?null:i},Pe.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n="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,n)},Pe.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number"),n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1);var i=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===i){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!==i||n||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||n||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++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=n?parseInt(a,8):parseFloat(a);return this.finishToken(S.num,o)},Pe.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},Pe.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(E(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(S.string,t)};var Ne={};Pe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ne)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ne;this.raise(e,t)},Pe.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&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===n?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Pe.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return E(t)?"":String.fromCharCode(t)}},Pe.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,i=this.options.ecmaVersion>=6;this.pos{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.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; +const e=window,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),r=new WeakMap;class s{constructor(e,t,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=r.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}}const a=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,i)=>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.")})(n)+e[i+1]),e[0]);return new s(n,e,i)},o=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,i))(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),g={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f};class m 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=g){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)||g}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=g){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){}} +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 n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},f=(e,t)=>t!==e&&(t==t||e==e),g={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f};class m 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,n)=>{const i=this._$Ep(n,t);void 0!==i&&(this._$Ev.set(i,n),e.push(i))})),e}static createProperty(e,t=g){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const r=this[e];this[t]=i,this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||g}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 n of t)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(o(e))}else void 0!==e&&t.push(o(e));return t}static _$Ep(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"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,n;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.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 n;const i=null!==(n=this.shadowRoot)&&void 0!==n?n:this.attachShadow(this.constructor.shadowRootOptions);return((n,i)=>{t?n.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):i.forEach((t=>{const i=document.createElement("style"),r=e.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}))})(i,this.constructor.elementStyles),i}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,n){this._$AK(e,n)}_$EO(e,t,n=g){var i;const r=this.constructor._$Ep(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:d).toAttribute(t,n.type);this._$El=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,r=i._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=i.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(n=e.converter)||void 0===n?void 0:n.fromAttribute)?e.converter:d;this._$El=r,this[r]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||f)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(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 n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),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(n)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(n)}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;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:m}),(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)}$`,_="?"+w,S=`<${_}>`,k=document,E=(e="")=>k.createComment(e),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,C=Array.isArray,I=e=>C(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,M=/>/g,N=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,L=/"/g,D=/^(?:script|style|textarea|title)$/i,R=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),$=R(1),B=(R(2),Symbol.for("lit-noChange")),V=Symbol.for("lit-nothing"),j=new WeakMap,F=k.createTreeWalker(k,129,null,!1),U=(e,t)=>{const i=e.length-1,n=[];let r,s=2===t?"":"",a=T;for(let t=0;t"===c[0]?(a=null!=r?r:T,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?N:'"'===c[3]?L:O):a===L||a===O?a=N:a===P||a===M?a=T:(a=N,r=void 0);const u=a===N&&e[t+1].startsWith("/>")?" ":"";s+=a===T?i+S: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?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,n]};class H{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]=U(e,t);if(this.el=H.createElement(c,i),F.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=F.nextNode())&&o.length0){n.textContent=b?b.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}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=q(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==B,s&&(this._$AH=e);else{const n=e;let a,o;for(e=r[0],a=0;ae}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,S="?"+w,k=`<${S}>`,_=document,E=(e="")=>_.createComment(e),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,C=Array.isArray,I=e=>C(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,M=/>/g,N=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,L=/"/g,D=/^(?:script|style|textarea|title)$/i,R=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),$=R(1),V=(R(2),Symbol.for("lit-noChange")),B=Symbol.for("lit-nothing"),j=new WeakMap,F=_.createTreeWalker(_,129,null,!1),U=(e,t)=>{const n=e.length-1,i=[];let r,s=2===t?"":"",a=T;for(let t=0;t"===c[0]?(a=null!=r?r:T,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?N:'"'===c[3]?L:O):a===L||a===O?a=N:a===P||a===M?a=T:(a=N,r=void 0);const u=a===N&&e[t+1].startsWith("/>")?" ":"";s+=a===T?n+k:l>=0?(i.push(o),n.slice(0,l)+"$lit$"+n.slice(l)+w+u):n+w+(-2===l?(i.push(void 0),t):u)}const o=s+(e[n]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,i]};class H{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let r=0,s=0;const a=e.length-1,o=this.parts,[c,l]=U(e,t);if(this.el=H.createElement(c,n),F.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(i=F.nextNode())&&o.length0){i.textContent=b?b.emptyScript:"";for(let n=0;n2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=B}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const r=this.strings;let s=!1;if(void 0===r)e=q(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==V,s&&(this._$AH=e);else{const i=e;let a,o;for(e=r[0],a=0;a{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 W(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 B}}ie.finalized=!0,ie._$litElement$=!0,null===(ee=globalThis.litElementHydrateSupport)||void 0===ee||ee.call(globalThis,{LitElement:ie});const ne=globalThis.litElementPolyfillSupport;null==ne||ne({LitElement:ie});(null!==(te=globalThis.litElementVersions)&&void 0!==te?te:globalThis.litElementVersions=[]).push("3.2.2"); +var ee,te;class ne extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{var i,r;const s=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t;let a=s._$litPart$;if(void 0===a){const e=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new W(t.insertBefore(E(),e),e,void 0,null!=n?n:{})}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 V}}ne.finalized=!0,ne._$litElement$=!0,null===(ee=globalThis.litElementHydrateSupport)||void 0===ee||ee.call(globalThis,{LitElement:ne});const ie=globalThis.litElementPolyfillSupport;null==ie||ie({LitElement:ne});(null!==(te=globalThis.litElementVersions)&&void 0!==te?te:globalThis.litElementVersions=[]).push("3.2.2"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const re=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),se=(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 ae(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):se(e,t)} +const re=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:i}=t;return{kind:n,elements:i,finisher(t){customElements.define(e,t)}}})(e,t),se=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(n){n.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(n){n.createProperty(t.key,e)}};function ae(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):se(e,t)} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -var oe;null===(oe=window.HTMLSlotElement)||void 0===oe||oe.prototype.assignedElements;class ce{static closestElement(e,t){return function t(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(e);return n||t(i.getRootNode().host)}(t)}}const le=(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},he=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),le(window,"location-changed",{replace:i})};class ue{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class pe{constructor(e){this.rule=e,this.svgElementInfos={}}}class de{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 fe={},ge={};ge.click=ge.mousedown=ge.mouseup=ge.mousemove="MouseEvents";let me=1;function ve(e){return e._dtId||(e._dtId=me++)}function ye(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function be(e,t,i,n){const r=ye(i).e;if(!e._dtId)return!1;const s=fe[ve(e)],a=function(e,t,i,n){return i=ye(i),(fe[ve(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 xe(e,t,i,n,r,s){const a=ye(i).e,o=ye(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=ve(e);(fe[c]||(fe[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const we={on(e,t,i,n=null){xe(e,null,t,i,null,n)},off(e,t,i=null){be(e,null,t,i)},once(e,t,i){const n=e=>(we.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){xe(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{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())};Se.on(e,"mousedown",n.bind(this)),Se.on(e,"tapstart",n.bind(this)),Se.on(e,"touchstart",n.bind(this),{passive:!0}),Se.on(e,"click",r.bind(this)),Se.on(e,"mouseup",r.bind(this)),Se.on(e,"tapend",r.bind(this)),Se.on(e,"touchend",r.bind(this)),Se.on(e,"tap",s.bind(this)),Se.on(e,"touch",s.bind(this)),Se.on(e,"mouseup",s.bind(this)),Se.on(e,"tapend",s.bind(this)),Se.on(e,"touchend",s.bind(this)),Se.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Ee=_e,Ae=new Set;class Ce{static observe(e){if(Ae.has(e))return;Ae.add(e);let t,i=0;Ee.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))}}var Ie,Te=i(1),Pe=i.n(Te);class Me{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;if(Math.abs(e)>=1)t="minute",i=e;else{t="second",i=n/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(i),t)}}Me.strftime=Pe(),Me.MILLISECONDS_IN_SECOND=1e3,Me.MILLISECONDS_IN_MINUTE=6e4,Me.MILLISECONDS_IN_HOUR=36e5,Me.MILLISECONDS_IN_DAY=864e5,Me.MILLISECONDS_IN_YEAR=31536e6,Me.relativeTimeFormat=new Intl.RelativeTimeFormat(null!==(Ie=navigator.language)&&void 0!==Ie?Ie:"en",{numeric:"auto",style:"long"});var Ne=i(449),Oe=i.n(Ne);function Le(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 De{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){this.expression=e.trim();const o=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[o],void 0===this.parsedFunction&&(this.functionBody=this.expression,this.isCodeBlock(this.functionBody)?this.functionBody=this.functionBody.slice(">".length).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[o]=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);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(Le(e))}return this.interpreter.exports.result}} +var oe;null===(oe=window.HTMLSlotElement)||void 0===oe||oe.prototype.assignedElements;class ce{static closestElement(e,t){return function t(n){if(!n||n===document||n===window)return null;n.assignedSlot&&(n=n.assignedSlot);const i=n.closest(e);return i||t(n.getRootNode().host)}(t)}}const le=(e,t,n,i)=>{i=i||{},n=null==n?{}:n;const r=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=n,e.dispatchEvent(r),r},he=(e,t,n=!1)=>{n?history.replaceState(null,"",t):history.pushState(null,"",t),le(window,"location-changed",{replace:n})};class ue{constructor(e,t,n,i){this.entityId=e,this.svgElement=t,this.originalSvgElement=n,this.originalBBox=i}}class pe{constructor(e){this.rule=e,this.svgElementInfos={}}}class de{constructor(e,t,n,i,r,s){this.instance=e,this.entityId=t,this.elementId=n,this.svgElementInfo=i,this.ruleInfo=r,this.actions=s}}const fe={},ge={};ge.click=ge.mousedown=ge.mouseup=ge.mousemove="MouseEvents";let me=1;function ve(e){return e._dtId||(e._dtId=me++)}function ye(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function be(e,t,n,i){const r=ye(n).e;if(!e._dtId)return!1;const s=fe[ve(e)],a=function(e,t,n,i){return n=ye(n),(fe[ve(e)]||[]).filter((e=>e&&(!n.e||e.e===n.e)&&(!n.ns||e.ns===n.ns)&&(!i||e.callback===i)&&(!t||e.selector===t)))}(e,t,n,i);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 xe(e,t,n,i,r,s){const a=ye(n).e,o=ye(n).ns;e.addEventListener?e.addEventListener(a,r||i,s):e.attachEvent&&e.attachEvent("on"+a,r||i);const c=ve(e);(fe[c]||(fe[c]=[])).push({delegator:r,callback:i,e:a,ns:o,selector:t})}const we={on(e,t,n,i=null){xe(e,null,t,n,null,i)},off(e,t,n=null){be(e,null,t,n)},once(e,t,n){const i=e=>(we.off(e.currentTarget,e.type,i),n(e));this.on(e,t,i)},delegate(e,t,n,i,r=null){xe(e,t,n,i,(function(n){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{n=!1,t=setTimeout((()=>{n=!0,e.dispatchEvent(new Event("longClick"))}),400)},r=i=>{clearTimeout(t),n||e.dispatchEvent(new Event("short"+i.type[0].toUpperCase()+i.type.slice(1)))},s=e=>{n&&(e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation())};ke.on(e,"mousedown",i.bind(this)),ke.on(e,"tapstart",i.bind(this)),ke.on(e,"touchstart",i.bind(this),{passive:!0}),ke.on(e,"click",r.bind(this)),ke.on(e,"mouseup",r.bind(this)),ke.on(e,"tapend",r.bind(this)),ke.on(e,"touchend",r.bind(this)),ke.on(e,"tap",s.bind(this)),ke.on(e,"touch",s.bind(this)),ke.on(e,"mouseup",s.bind(this)),ke.on(e,"tapend",s.bind(this)),ke.on(e,"touchend",s.bind(this)),ke.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Ee=Se,Ae=new Set;class Ce{static observe(e){if(Ae.has(e))return;Ae.add(e);let t,n=0;Ee.on(e,"click",(()=>{n++,t=setTimeout((()=>{1===n&&(n=0,e.dispatchEvent(new Event("singleClick")))}),400),2===n&&(clearTimeout(t),n=0,e.dispatchEvent(new Event("doubleClick")))}).bind(this))}}var Ie,Te=n(1),Pe=n.n(Te);class Me{static timeago(e){let t="second",n=0;const i=("string"==typeof e?new Date(e):e).getTime()-(new Date).getTime(),r=i/this.MILLISECONDS_IN_YEAR;if(Math.abs(r)>=1)t="year",n=r;else{const e=i/this.MILLISECONDS_IN_DAY;if(Math.abs(e)>=1)t="day",n=e;else{const e=i/this.MILLISECONDS_IN_HOUR;if(Math.abs(e)>=1)t="hour",n=e;else{const e=i/this.MILLISECONDS_IN_MINUTE;if(Math.abs(e)>=1)t="minute",n=e;else{t="second",n=i/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(n),t)}}Me.strftime=Pe(),Me.MILLISECONDS_IN_SECOND=1e3,Me.MILLISECONDS_IN_MINUTE=6e4,Me.MILLISECONDS_IN_HOUR=36e5,Me.MILLISECONDS_IN_DAY=864e5,Me.MILLISECONDS_IN_YEAR=31536e6,Me.relativeTimeFormat=new Intl.RelativeTimeFormat(null!==(Ie=navigator.language)&&void 0!==Ie?Ie:"en",{numeric:"auto",style:"long"});var Ne=n(449),Oe=n.n(Ne);function Le(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 De{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,n,i,r,s,a){this.expression=e.trim();const o=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[o],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[o]=this.parsedFunction,this.interpreter.import("config",n),this.interpreter.import("util",this.util)),this.entityState=i?t.states[i]: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);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(Le(e))}return this.interpreter.exports.result}} /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ -function Re(e){return null==e}De.cache={},De.interpreter=new(Oe())({ecmaVer:2019,sandBox:!0}),De.util={color:class{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)]}},date:Me};var $e={isNothing:Re,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Re(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;io&&(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 Ue(e,t){return $e.repeat(" ",t-e.length)+e}var He=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=Fe(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=$e.repeat(" ",t.indent)+Ue((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Fe(e.buffer,r[a],s[a],e.position,u),l+=$e.repeat(" ",t.indent)+Ue((e.line+1).toString(),h)+" | "+c.str+"\n",l+=$e.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Fe(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=$e.repeat(" ",t.indent)+Ue((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},qe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ze=["scalar","sequence","mapping"];var We=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===qe.indexOf(t))throw new je('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===ze.indexOf(this.kind))throw new je('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function Ge(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 Ye(e){return this.extend(e)}Ye.prototype.extend=function(e){var t=[],i=[];if(e instanceof We)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 je("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 We))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new je("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 je("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 We))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Ye.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=Ge(n,"implicit"),n.compiledExplicit=Ge(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=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"]}}),at=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var ot=/^[-+]?[0-9]+e/;var ct=new We("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!at.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||$e.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($e.isNegativeZero(e))return"-0.0";return i=e.toString(10),ot.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),lt=Ze.extend({implicit:[et,tt,st,ct]}),ht=lt,ut=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),pt=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]))?))?$");var dt=new We("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==ut.exec(e)||null!==pt.exec(e))},construct:function(e){var t,i,n,r,s,a,o,c,l=0,h=null;if(null===(t=ut.exec(e))&&(t=pt.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()}});var ft=new We("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var mt=new We("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=gt;for(i=0;i64)){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=gt,a=0,o=[];for(t=0;t>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=gt;for(t=0;t>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}}),vt=Object.prototype.hasOwnProperty,yt=Object.prototype.toString;var bt=new We("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>10),56320+(e-65536&1023))}for(var Ft=new Array(256),Ut=new Array(256),Ht=0;Ht<256;Ht++)Ft[Ht]=Vt(Ht)?1:0,Ut[Ht]=Vt(Ht);function qt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||kt,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 zt(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=He(i),new je(t,i)}function Wt(e,t){throw zt(e,t)}function Gt(e,t){e.onWarning&&e.onWarning.call(null,zt(e,t))}var Yt={YAML:function(e,t,i){var n,r,s;null!==e.version&&Wt(e,"duplication of %YAML directive"),1!==i.length&&Wt(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Wt(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Wt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Gt(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Wt(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],Tt.test(n)||Wt(e,"ill-formed tag handle (first argument) of the TAG directive"),Et.call(e.tagMap,n)&&Wt(e,'there is a previously declared suffix for "'+n+'" tag handle'),Pt.test(r)||Wt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Wt(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function Kt(e,t,i,n){var r,s,a,o;if(t1&&(e.result+=$e.repeat("\n",t-1))}function ii(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,Wt(e,"tab characters must not be used in indentation")),45===n)&&Lt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,Zt(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,si(e,t,3,!1,!0),a.push(e.result),Zt(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Wt(e,"bad indentation of a sequence entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt)&&(v&&(a=e.line,o=e.lineStart,c=e.position),si(e,t,4,!0,r)&&(v?g=e.result:m=e.result),v||(Xt(e,p,d,f,g,m,a,o,c),f=g=m=null),Zt(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Wt(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Wt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Wt(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(Ot(s)){do{s=e.input.charCodeAt(++e.position)}while(Ot(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!Nt(s)&&0!==s)}for(;0!==s;){for(Qt(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),Nt(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=Rt(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Wt(e,"expected hexadecimal character");e.result+=jt(s),e.position++}else Wt(e,"unknown escape sequence");i=n=e.position}else Nt(o)?(Kt(e,i,n,!0),ti(e,Zt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&ei(e)?Wt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Wt(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!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&&!Lt(n)&&!Dt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Wt(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),Et.call(e.anchorMap,i)||Wt(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],Zt(e,!0,-1),!0}(e)?function(e,t,i){var n,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(Lt(h=e.input.charCodeAt(e.position))||Dt(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)&&(Lt(n=e.input.charCodeAt(e.position+1))||i&&Dt(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(Lt(n=e.input.charCodeAt(e.position+1))||i&&Dt(n))break}else if(35===h){if(Lt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&ei(e)||i&&Dt(h))break;if(Nt(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,Zt(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&&(Kt(e,r,s,!1),ti(e,e.line-o),r=s=e.position,a=!1),Ot(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return Kt(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,1===i)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||Wt(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(m=o&&ii(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&&Wt(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c"),null!==e.result&&u.kind!==e.kind&&Wt(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)):Wt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function ai(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))&&(Zt(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&&!Lt(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Wt(e,"directive name must not be less than one character in length");0!==r;){for(;Ot(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!Nt(r));break}if(Nt(r))break;for(t=e.position;0!==r&&!Lt(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&Qt(e),Et.call(Yt,i)?Yt[i](e,i,n):Gt(e,'unknown document directive "'+i+'"')}Zt(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,Zt(e,!0,-1)):a&&Wt(e,"directives end mark is expected"),si(e,e.lineIndent-1,4,!1,!0),Zt(e,!0,-1),e.checkLineBreaks&&Ct.test(e.input.slice(s,e.position))&&Gt(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ei(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Zt(e,!0,-1)):e.position=55296&&n<=56319&&t+1=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function ki(e){return/^\n* /.test(e)}function Ei(e,t,i,n,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==n,f=-1,g=function(e){return xi(e)&&e!==ui&&!bi(e)&&45!==e&&63!==e&&58!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&35!==e&&38!==e&&42!==e&&33!==e&&124!==e&&61!==e&&62!==e&&39!==e&&34!==e&&37!==e&&64!==e&&96!==e}(Si(e,0))&&function(e){return!bi(e)&&58!==e}(Si(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!xi(l=Si(e,c)))return 5;g=g&&_i(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if(10===(l=Si(e,c)))u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!xi(l))return 5;g=g&&_i(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&ki(e)?5:a?2===s?5:2:p?4:3:!g||a||r(e)?2===s?5:2:1}function Ai(e,t,i,n,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==di.indexOf(t)||fi.test(t)))return 2===e.quotingType?'"'+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(Ei(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i"+Ci(t,e.indent)+Ii(vi(function(e,t){var i,n,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,Ti(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;n=r.exec(e);){var c=n[1],l=n[2];i=" "===l[0],s+=c+(a||i||""===l?"":"\n")+Ti(l,t),a=i}return s}(t,a),s));case 5:return'"'+function(e){for(var t,i="",n=0,r=0;r=65536?r+=2:r++)n=Si(e,r),!(t=pi[n])&&xi(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||gi(n);return i}(t)+'"';default:throw new je("impossible error: invalid scalar style")}}()}function Ci(e,t){var i=ki(e)?String(t):"",n="\n"===e[e.length-1];return i+(n&&("\n"===e[e.length-2]||"\n"===e)?"+":n?"":"-")+"\n"}function Ii(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Ti(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 Pi(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function Ni(e,t,i,n,r,s,a){e.tag=null,e.dump=i,Mi(e,i,!1)||Mi(e,i,!0);var o,c=li.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 je("sortKeys must be a boolean or a function");for(r=0,s=p.length;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=yi(e,t)),Ni(e,t+1,o,!0,c)&&(e.dump&&10===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;n1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ni(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?Pi(e,t-1,e.dump,r):Pi(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",e.dump=o+" "+e.dump)}return!0}function Oi(e,t){var i,n,r=[],s=[];for(Li(e,r,s),i=0,n=s.length;ie.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(n[0],n[1])}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n");if(n.length>1){const t=e.querySelector("tspan"),i=null==t?void 0:t.getAttribute("x"),n=null==t?void 0:t.getAttribute("y");i&&!e.getAttribute("x")&&e.setAttribute("x",i),n&&!e.getAttribute("y")&&e.setAttribute("y",n)}const r=e.querySelector("tspan")||!1;e.textContent="";const s=e.getAttribute("x")||"0",a=i||"1em";n.forEach(((t,i)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(o.textContent=t,n.length>1){if(o.setAttribute("x",s),o.setAttribute("dy",i>=1?a:"0"),r){const e=r.getAttribute("style");e&&o.setAttribute("style",e)}}else 1==n.length&&0==i&&r&&["x","y","style"].forEach((e=>{const t=null==r?void 0:r.getAttribute(e);null!=t&&o.setAttribute(e,t)}));e.appendChild(o)}))}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 Ri.load(e)}static fetchText(e,t,i,n){return $i(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:Bi.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 $i(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:Bi.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,${Bi.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;rMath.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class Vi{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=`${Bi.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");Bi.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=`${Bi.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 ji=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},Fi=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 Ui=_e;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.37","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Hi=class extends ie{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 $` +function Re(e){return null==e}De.cache={},De.interpreter=new(Oe())({ecmaVer:2019,sandBox:!0}),De.util={color:class{static miredToRGB(e){return this.kelvinToRGB(1e6/e)}static kelvinToRGB(e){const t=e/100;let n,i,r;return t<=66?(n=255,i=t,i=99.4708025861*Math.log(i)-161.1195681661,t<=19?r=0:(r=t-10,r=138.5177312231*Math.log(r)-305.0447927307)):(n=t-60,n=329.698727446*Math.pow(n,-.1332047592),i=t-60,i=288.1221695283*Math.pow(i,-.0755148492),r=255),[Math.min(Math.max(Math.round(n),0),255),Math.min(Math.max(Math.round(i),0),255),Math.min(Math.max(Math.round(r),0),255)]}},date:Me};var $e={isNothing:Re,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Re(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;no&&(t=i-o+(s=" ... ").length),n-i>o&&(n=i+o-(a=" ...").length),{str:s+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Ue(e,t){return $e.repeat(" ",t-e.length)+e}var He=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 n,i=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;n=i.exec(e.buffer);)s.push(n.index),r.push(n.index+n[0].length),e.position<=n.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=Fe(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=$e.repeat(" ",t.indent)+Ue((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Fe(e.buffer,r[a],s[a],e.position,u),l+=$e.repeat(" ",t.indent)+Ue((e.line+1).toString(),h)+" | "+c.str+"\n",l+=$e.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Fe(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=$e.repeat(" ",t.indent)+Ue((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},qe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ze=["scalar","sequence","mapping"];var We=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===qe.indexOf(t))throw new je('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(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===ze.indexOf(this.kind))throw new je('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function Ye(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function Ge(e){return this.extend(e)}Ge.prototype.extend=function(e){var t=[],n=[];if(e instanceof We)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new je("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof We))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new je("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 je("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof We))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(Ge.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Ye(i,"implicit"),i.compiledExplicit=Ye(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;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"]}}),at=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var ot=/^[-+]?[0-9]+e/;var ct=new We("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!at.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||$e.isNegativeZero(e))},represent:function(e,t){var n;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($e.isNegativeZero(e))return"-0.0";return n=e.toString(10),ot.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),lt=Ze.extend({implicit:[et,tt,st,ct]}),ht=lt,ut=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),pt=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]))?))?$");var dt=new We("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==ut.exec(e)||null!==pt.exec(e))},construct:function(e){var t,n,i,r,s,a,o,c,l=0,h=null;if(null===(t=ut.exec(e))&&(t=pt.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,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(n,i,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var ft=new We("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var mt=new We("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,s=gt;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=gt,a=0,o=[];for(t=0;t>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(i.charAt(t));return 0===(n=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===n?(o.push(a>>10&255),o.push(a>>2&255)):12===n&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,s=e.length,a=gt;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=s%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),vt=Object.prototype.hasOwnProperty,yt=Object.prototype.toString;var bt=new We("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,s,a=[],o=e;for(t=0,n=o.length;t>10),56320+(e-65536&1023))}for(var Gt=new Array(256),Jt=new Array(256),Xt=0;Xt<256;Xt++)Gt[Xt]=Wt(Xt)?1:0,Jt[Xt]=Wt(Xt);function Kt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||_t,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 Qt(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=He(n),new je(t,n)}function Zt(e,t){throw Qt(e,t)}function en(e,t){e.onWarning&&e.onWarning.call(null,Qt(e,t))}var tn={YAML:function(e,t,n){var i,r,s;null!==e.version&&Zt(e,"duplication of %YAML directive"),1!==n.length&&Zt(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Zt(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&Zt(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&en(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&Zt(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],Rt.test(i)||Zt(e,"ill-formed tag handle (first argument) of the TAG directive"),Et.call(e.tagMap,i)&&Zt(e,'there is a previously declared suffix for "'+i+'" tag handle'),$t.test(r)||Zt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Zt(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function nn(e,t,n,i){var r,s,a,o;if(t1&&(e.result+=$e.repeat("\n",t-1))}function hn(e,t){var n,i,r=e.tag,s=e.anchor,a=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Zt(e,"tab characters must not be used in indentation")),45===i)&&Ft(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,on(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,dn(e,t,It,!1,!0),a.push(e.result),on(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)Zt(e,"bad indentation of a sequence entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt)&&(v&&(a=e.line,o=e.lineStart,c=e.position),dn(e,t,Tt,!0,r)&&(v?g=e.result:m=e.result),v||(sn(e,p,d,f,g,m,a,o,c),f=g=m=null),on(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Zt(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Zt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Zt(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(jt(s)){do{s=e.input.charCodeAt(++e.position)}while(jt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!Bt(s)&&0!==s)}for(;0!==s;){for(an(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),Bt(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=Ht(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Zt(e,"expected hexadecimal character");e.result+=Yt(s),e.position++}else Zt(e,"unknown escape sequence");n=i=e.position}else Bt(o)?(nn(e,n,i,!0),ln(e,on(e,!1,t)),n=i=e.position):e.position===e.lineStart&&cn(e)?Zt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Zt(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!Ft(i)&&!Ut(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Zt(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Et.call(e.anchorMap,n)||Zt(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],on(e,!0,-1),!0}(e)?function(e,t,n){var i,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(Ft(h=e.input.charCodeAt(e.position))||Ut(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)&&(Ft(i=e.input.charCodeAt(e.position+1))||n&&Ut(i)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(Ft(i=e.input.charCodeAt(e.position+1))||n&&Ut(i))break}else if(35===h){if(Ft(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&cn(e)||n&&Ut(h))break;if(Bt(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,on(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&&(nn(e,r,s,!1),ln(e,e.line-o),r=s=e.position,a=!1),jt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return nn(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,At===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||Zt(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(m=o&&hn(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&&Zt(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c"),null!==e.result&&u.kind!==e.kind&&Zt(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)):Zt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function fn(e){var t,n,i,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))&&(on(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&&!Ft(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&Zt(e,"directive name must not be less than one character in length");0!==r;){for(;jt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!Bt(r));break}if(Bt(r))break;for(t=e.position;0!==r&&!Ft(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&an(e),Et.call(tn,n)?tn[n](e,n,i):en(e,'unknown document directive "'+n+'"')}on(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,on(e,!0,-1)):a&&Zt(e,"directives end mark is expected"),dn(e,e.lineIndent-1,Tt,!1,!0),on(e,!0,-1),e.checkLineBreaks&&Lt.test(e.input.slice(s,e.position))&&en(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&cn(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,on(e,!0,-1)):e.position=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function ri(e){return/^\n* /.test(e)}var si=1,ai=2,oi=3,ci=4,li=5;function hi(e,t,n,i,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==i,f=-1,g=function(e){return ei(e)&&e!==bn&&!Zn(e)&&e!==Nn&&e!==Rn&&e!==On&&e!==Mn&&e!==Vn&&e!==Bn&&e!==Fn&&e!==Hn&&e!==An&&e!==In&&e!==Pn&&e!==_n&&e!==Un&&e!==Ln&&e!==Dn&&e!==Tn&&e!==En&&e!==Cn&&e!==$n&&e!==jn}(ii(e,0))&&function(e){return!Zn(e)&&e!==On}(ii(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!ei(l=ii(e,c)))return li;g=g&&ni(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if((l=ii(e,c))===wn)u=!0,d&&(p=p||c-f-1>i&&" "!==e[f+1],f=c);else if(!ei(l))return li;g=g&&ni(l,h,o),h=l}p=p||d&&c-f-1>i&&" "!==e[f+1]}return u||p?n>9&&ri(e)?li:a?s===Jn?li:ai:p?ci:oi:!g||a||r(e)?s===Jn?li:ai:si}function ui(e,t,n,i,r){e.dump=function(){if(0===t.length)return e.quotingType===Jn?'""':"''";if(!e.noCompatMode&&(-1!==zn.indexOf(t)||Wn.test(t)))return e.quotingType===Jn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=i||e.flowLevel>-1&&n>=e.flowLevel;switch(hi(t,o,e.indent,a,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+pi(t,e.indent)+di(Kn(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,fi(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;i=r.exec(e);){var c=i[1],l=i[2];n=" "===l[0],s+=c+(a||n||""===l?"":"\n")+fi(l,t),a=n}return s}(t,a),s));case li:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=ii(e,r),!(t=qn[i])&&ei(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||Yn(i);return n}(t)+'"';default:throw new je("impossible error: invalid scalar style")}}()}function pi(e,t){var n=ri(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function di(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function fi(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,s=0,a=0,o=0,c="";n=r.exec(e);)(o=n.index)-s>t&&(i=a>s?a:o,c+="\n"+e.slice(s,i),s=i+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 gi(e,t,n,i){var r,s,a,o="",c=e.tag;for(r=0,s=n.length;r tag resolver accepts not "'+c+'" style');i=o.represent[c](t,c)}e.dump=i}return!0}return!1}function vi(e,t,n,i,r,s,a){e.tag=null,e.dump=n,mi(e,n,!1)||mi(e,n,!0);var o,c=vn.call(e.dump),l=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===c||"[object Array]"===c;if(p&&(u=-1!==(h=e.duplicates.indexOf(n))),(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)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,s,a,o,c,l,h="",u=e.tag,p=Object.keys(n);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new je("sortKeys must be a boolean or a function");for(r=0,s=p.length;r1024)&&(e.dump&&wn===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Qn(e,t)),vi(e,t+1,o,!0,c)&&(e.dump&&wn===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,n){var i,r,s,a,o,c="",l=e.tag,h=Object.keys(n);for(i=0,r=h.length;i1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),vi(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)i&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?gi(e,t-1,e.dump,r):gi(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,n){var i,r,s,a="",o=e.tag;for(i=0,r=n.length;i",e.dump=o+" "+e.dump)}return!0}function yi(e,t){var n,i,r=[],s=[];for(bi(e,r,s),n=0,i=s.length;ne.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(i[0],i[1])}}static setText(e,t,n){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const i=t.replace(/\\n/g,"\n").split("\n");if(i.length>1){const t=e.querySelector("tspan"),n=null==t?void 0:t.getAttribute("x"),i=null==t?void 0:t.getAttribute("y");n&&!e.getAttribute("x")&&e.setAttribute("x",n),i&&!e.getAttribute("y")&&e.setAttribute("y",i)}const r=e.querySelector("tspan")||!1;e.textContent="";const s=e.getAttribute("x")||"0",a=n||"1em";i.forEach(((t,n)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(o.textContent=t,i.length>1){if(o.setAttribute("x",s),o.setAttribute("dy",n>=1?a:"0"),r){const e=r.getAttribute("style");e&&o.setAttribute("style",e)}}else 1==i.length&&0==n&&r&&["x","y","style"].forEach((e=>{const t=null==r?void 0:r.getAttribute(e);null!=t&&o.setAttribute(e,t)}));e.appendChild(o)}))}static waitForChildNodes(e,t,n){return new Promise(((i,r)=>{const s=setTimeout((()=>r("Timeout waiting for child element(s) to load")),n);new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&t.addedNodes.length)return clearTimeout(s),i()})).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 wi.load(e)}static fetchText(e,t,n,i){return Si(this,void 0,void 0,(function*(){n&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${n}/`)),e=i?e:ki.cacheBuster(e);const r=new Request(e,{cache:i?"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,n,i){return Si(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${n}/`)),e=i?e:ki.cacheBuster(e);const r=new Request(e,{cache:i?"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,${ki.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 n=window.btoa(t);for(;n.length%4>0;)n+="=";return n}static cacheBuster(e){return`${e}${e.includes("?")?"&":"?"}_=${(new Date).getTime()}`}static equal(e,t){if(e===t)return!0;const n=Array.isArray(e),i=Array.isArray(t);let r=0;if(n&&i){if(e.length!=t.length)return!1;for(r=0;rMath.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class _i{constructor(e,t,n){this.element=e,this.logLevel=t,this.consoleLogLevel=n,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,n=!1){var i;const r=`${ki.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((n||a)&&this.element){const t=document.createElement("li");ki.addClass(t,e),t.textContent=r,null===(i=this.element.querySelector("ul"))||void 0===i||i.prepend(t),this.element.style.display="block"}this.consoleLog(e,t,n)}consoleLog(e,t,n=!1){const i=`${ki.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(n||s)switch(e){case"error":console.error(i);break;case"warn":case"warning":console.warn(i);break;case"info":console.info(i);break;default:console.log(i)}}}var Ei=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a},Ai=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function a(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))};const Ci=Se;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.37","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Ii=class extends ne{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 $`
@@ -128,23 +128,23 @@ function Re(e){return null==e}De.cache={},De.interpreter=new(Oe())({ecmaVer:2019 .debug { color: #000000; } - `}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return Fi(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 Fi(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return Fi(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=Bi.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 Fi(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 Vi(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.37"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage()}catch(e){this.handleError(e)}}))}initMultiPage(){return Fi(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return Fi(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 Fi(this,void 0,void 0,(function*(){if("string"==typeof e){let i;try{i=yield Bi.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return Ri.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:Bi.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 Fi(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 Fi(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 Fi(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;let i="",n=!0;if("string"==typeof e.image)i=Bi.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const t of e.image.sizes)if(screen.width>=t.min_width){i=t.location,n=!0===t.cache;break}}else Bi.isMobile&&e.image_mobile?(i=e.image_mobile.location,n=!0===e.image_mobile.cache):(i=e.image.location,n=!0===e.image.cache);return{location:i,cache:n}}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 Fi(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 Bi.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 Bi.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?Bi.getArray(o):[]}loadFloorplanSvg(e,t,i){var n;return Fi(this,void 0,void 0,(function*(){let r;try{r=yield Bi.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const s=document.createElement("div");s.innerHTML=r;const a=s.querySelector("svg");if(t&&a.setAttribute("id",t.config.page_id),a.setAttribute("height","100%"),a.setAttribute("width","100%"),a.style.height="100%",a.style.width="100%",a.style.margin="auto",a.style.cursor="default",a.style.opacity="0",a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&i){const e=i.config.page_id,r=i.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement.replaceChildren(a);else{const e=this.floorplanElement.querySelector("#"+r),t=Number.parseFloat(a.getAttribute("height")),i=Number.parseFloat(a.getAttribute("width"));a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${i} ${t}`),a.setAttribute("preserveAspectRatio","xMinYMin meet"),a.setAttribute("height",e.getAttribute("height")),a.setAttribute("width",e.getAttribute("width")),a.setAttribute("x",e.getAttribute("x")),a.setAttribute("y",e.getAttribute("y")),null===(n=e.parentElement)||void 0===n||n.replaceChildren(a)}}else this.floorplanElement.replaceChildren(a);return a}))}loadImage(e,t,i,n,r){return Fi(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 Fi(this,void 0,void 0,(function*(){e=r?e:Bi.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 Fi(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield Bi.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"),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,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=>{Ui.off(e,"click"),Ui.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}]:[]}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 pe(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)),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 pe(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 de(this,i,n,t,r,e);if(e&&!s&&Ui.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new de(this,i,n,t,r,s);Ce.observe(a),e&&Ui.on(a,"singleClick",this.onClick.bind(c)),Ui.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),Bi.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new de(this,i,n,t,r,e);ke.observe(a),Ui.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),Bi.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,i){const n=new ue(t.id,t,t,t.getBBox());return i.svgElementInfos[t.id]=n,n}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 Fi(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=Bi.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 ${Bi.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r)):Bi.equal(i.lastState.attributes,n.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${Bi.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return Fi(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 Fi(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))Bi.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: ${Me.timeago(n.last_changed)}\n`,i+=`Last updated: ${Me.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){if("string"!=typeof e||!De.isCode(e))return e;try{return De.evaluate(e,this.hass,this.config,t,i,this.svgElements,this.functions)}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){const r=this.getActionConfigs(e);for(const e of r){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}`):le(this,"hass-more-info",{entityId:t});break;case"navigate":this.isDemo?this.notify(`Performing action: ${e.action} ${e.navigation_path}`):he(0,e.navigation_path);break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const t=e.same_tab?"_self":"_blank";window.open(e.url_path,t)}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":le(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){try{if("object"==typeof e.service_data)for(const n of Object.keys(e.service_data))this.evaluate(e.service_data[n],t,i);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,i):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);if("floorplan"===s)this.callFloorplanService(s,a,e,t,i,n);else 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,g,m,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,Bi.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,Bi.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)),Bi.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,Bi.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";Bi.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,g="object"==typeof x?x.image_refresh_interval:0,m=!(g>0)&&("object"!=typeof x||!0===x.cache),s.imageLoader&&clearInterval(s.imageLoader),g&&(s.imageLoader=setInterval(this.loadImage.bind(this),1e3*g,f,r,n,s,m)),this.loadImage(f,r,n,s,m));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);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(i,n,e)}}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})`)}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("
");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}`)}};ji([ae({type:String})],Hi.prototype,"examplespath",void 0),ji([ae({type:Object})],Hi.prototype,"hass",void 0),ji([ae({type:String||Object})],Hi.prototype,"_config",void 0),ji([ae({type:Boolean})],Hi.prototype,"isDemo",void 0),ji([ae({type:Boolean})],Hi.prototype,"isShowLog",void 0),ji([ae({type:Function})],Hi.prototype,"notify",void 0),Hi=ji([re("floorplan-element")],Hi); + `}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return Ai(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 Ai(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return Ai(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=ki.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 Ai(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 _i(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.37"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage()}catch(e){this.handleError(e)}}))}initMultiPage(){return Ai(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return Ai(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 Ai(this,void 0,void 0,(function*(){if("string"==typeof e){let n;try{n=yield ki.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return wi.load(n)}return JSON.parse(JSON.stringify(e))}))}loadScript(e,t){return e?new Promise(((n,i)=>{var r;const s=document.createElement("script");s.src=t?e:ki.cacheBuster(e),s.onload=()=>n(),s.onerror=e=>{i(new URIError(`${e.target.src}`))},null===(r=this.shadowRoot)||void 0===r||r.appendChild(s)})):Promise.resolve()}loadPages(){return Ai(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 n=e.find((e=>void 0===e.config.master_page));n&&(n.isDefault=!0),yield this.loadPageFloorplanSvg(t,t);const i=e.filter((e=>e!==t));for(const e of i)yield this.loadPageFloorplanSvg(e,t);this.svg=t.svg}))}loadPageConfig(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.loadConfig(e,!1),i=this.createPageInfo(n);return i.index=t,i}))}loadPageFloorplanSvg(e,t){return Ai(this,void 0,void 0,(function*(){const n=this.getBestImage(e.config),i=yield this.loadFloorplanSvg(n,e,t);i.id=e.config.page_id,e.svg=i,yield this.loadStyleSheet(e.config.stylesheet),this.initFloorplanRules(e.svg,e.config)}))}getBestImage(e){var t;let n="",i=!0;if("string"==typeof e.image)n=ki.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const t of e.image.sizes)if(screen.width>=t.min_width){n=t.location,i=!0===t.cache;break}}else ki.isMobile&&e.image_mobile?(n=e.image_mobile.location,i=!0===e.image_mobile.cache):(n=e.image.location,i=!0===e.image.cache);return{location:n,cache:i}}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 Ai(this,void 0,void 0,(function*(){const t="string"==typeof e?e:e.location,n="string"!=typeof e&&!0===e.cache;if(!t)return;let i;try{i=yield ki.fetchText(t,this.isDemo,this.examplespath,n)}catch(e){throw this.logError("STYLESHEET",`Error loading stylesheet: ${t}`),e}const r=document.createElement("style"),s=()=>{var e;r.innerHTML=i,null===(e=this.shadowRoot)||void 0===e||e.appendChild(r)};try{yield ki.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,n,i,r,s,a;let o;if(e.sheet)o=null!==(n=null===(t=e.sheet)||void 0===t?void 0:t.cssRules)&&void 0!==n?n:null===(i=e.sheet)||void 0===i?void 0:i.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?ki.getArray(o):[]}loadFloorplanSvg(e,t,n){var i;return Ai(this,void 0,void 0,(function*(){let r;try{r=yield ki.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const s=document.createElement("div");s.innerHTML=r;const a=s.querySelector("svg");if(t&&a.setAttribute("id",t.config.page_id),a.setAttribute("height","100%"),a.setAttribute("width","100%"),a.style.height="100%",a.style.width="100%",a.style.margin="auto",a.style.cursor="default",a.style.opacity="0",a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&n){const e=n.config.page_id,r=n.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement.replaceChildren(a);else{const e=this.floorplanElement.querySelector("#"+r),t=Number.parseFloat(a.getAttribute("height")),n=Number.parseFloat(a.getAttribute("width"));a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${n} ${t}`),a.setAttribute("preserveAspectRatio","xMinYMin meet"),a.setAttribute("height",e.getAttribute("height")),a.setAttribute("width",e.getAttribute("width")),a.setAttribute("x",e.getAttribute("x")),a.setAttribute("y",e.getAttribute("y")),null===(i=e.parentElement)||void 0===i||i.replaceChildren(a)}}else this.floorplanElement.replaceChildren(a);return a}))}loadImage(e,t,n,i,r){return Ai(this,void 0,void 0,(function*(){return e.toLowerCase().includes(".svg")||"svg"===t.svgElement.nodeName||t.svgElement.querySelector("svg")?yield this.loadSvgImage(e,t,n,i,r):yield this.loadBitmapImage(e,t,n,i,r)}))}loadBitmapImage(e,t,n,i,r){return Ai(this,void 0,void 0,(function*(){e=r?e:ki.cacheBuster(e),this.logDebug("IMAGE",`${n} (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,n,void 0,i),s.onmouseover=()=>{this.handleEntityIdSetHoverOver(n,t)}),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),s}))}loadSvgImage(e,t,n,i,r){return Ai(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield ki.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",`${n} (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"),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,n,void 0,i),t.svgElement.onmouseover=()=>{this.handleEntityIdSetHoverOver(n,t)},o}))}_querySelectorAll(e,t=void 0,n){let i=t?Array.from(e.querySelectorAll(t).values()):[];return i=n?[e].concat(i):i,i}replaceElement(e,t){const n=e.parentElement;for(const n of Array.from(e.classList))t.classList.add(n);return this._querySelectorAll(e,"*",!0).forEach((e=>{Ci.off(e,"click"),Ci.off(e,"longClick"),e.remove()})),e.remove(),null==n||n.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,n;if("string"==typeof e?t=e:(t=e.name,n=e.value,e.value&&(n=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:n,last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{},context:{}}),this.setVariable(t,n,{},!0)}getActionConfigs(e){var t,n;if(null==e)return[];if(Array.isArray(e)){for(const n of e)n.action=null!==(t=n.action)&&void 0!==t?t:"call-service";return e}return"object"==typeof e?(e.action=null!==(n=e.action)&&void 0!==n?n:"call-service",[e]):"string"==typeof e?e.includes(".")?[{action:"call-service",service:e}]:[{action:e}]:[]}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 n=this._querySelectorAll(e,"*",!0);for(const e of n)e.id&&(this.svgElements[e.id]=e);this.initRules(t,e,n)}initRules(e,t,n){if(e.functions&&(this.functions=this.evaluate(e.functions)),e.defaults){const t=e.defaults;for(const n of e.rules)n.hover_action=void 0===n.hover_action?t.hover_action:n.hover_action,n.tap_action=void 0===n.tap_action?t.tap_action:n.tap_action,n.hold_action=void 0===n.hold_action?t.hold_action:n.hold_action,n.hover_info_filter=void 0===n.hover_info_filter?t.hover_info_filter:n.hover_info_filter}for(const i of e.rules)i.entity||i.entities?this.initEntityRule(i,t,n):(i.element||i.elements)&&this.initElementRule(i,t,n)}initEntityRule(e,t,n){const i=this.initGetEntityRuleEntities(e);for(const r of i){const i=r.entityId;let s=this.entityInfos[i];s||(s={entityId:i,ruleInfos:[],lastState:void 0},this.entityInfos[i]=s);const a=new pe(e);s.ruleInfos.push(a);for(const e of r.elementIds){const r=n.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,i,void 0,a)}}}initGetEntityRuleEntities(e){const t=[];e.groups=e.groups?e.groups:[];for(const n of e.groups){const e=this.hass.states[n];if(e)for(const n of e.attributes.entity_id)this.addTargetEntity(n,[n],t);else this.logWarning("CONFIG",`Cannot find '${n}' in Home Assistant groups`)}e.entities=e.entities?e.entities:[],e.entities=e.entity?e.entities.concat(e.entity):e.entities;const n=e.entities.filter((e=>"string"==typeof e));for(const i of n){let n=[];e.elements?n=n.concat(e.elements):e.element?n=n.concat(this.evaluate(e.element,i,void 0)):null!==e.element&&(n=n.concat(i)),this.addTargetEntity(i,n,t)}const i=e.entities.filter((e=>"string"!=typeof e));for(const e of i){const n=e;this.addTargetEntity(n.entity,[n.element],t)}return t}addTargetEntity(e,t,n){const i=this.hass.states[e],r="floorplan"===e.split(".")[0];i||r?n.push({entityId:e,elementIds:t}):this.logWarning("CONFIG",`Cannot find '${e}' in Home Assistant entities`)}initElementRule(e,t,n){if(e.element||e.elements){e.elements=e.elements?e.elements:[],e.elements=e.element?e.elements.concat(e.element):e.elements;for(const i of e.elements){const r=n.find((e=>e.id===i));if(r){let n=this.elementInfos[i];n||(n={ruleInfos:[],lastState:void 0},this.elementInfos[i]=n);const s=new pe(e);n.ruleInfos.push(s);const a=this.addSvgElementToRule(t,r,s);this.attachClickHandlers(r,a,void 0,i,s)}else this.logWarning("CONFIG",`Cannot find '${i}' in SVG file`)}}}attachClickHandlers(e,t,n,i,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 de(this,n,i,t,r,e);if(e&&!s&&Ci.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new de(this,n,i,t,r,s);Ce.observe(a),e&&Ci.on(a,"singleClick",this.onClick.bind(c)),Ci.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),ki.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new de(this,n,i,t,r,e);_e.observe(a),Ci.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),ki.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,n){const i=new ue(t.id,t,t,t.getBBox());return n.svgElementInfos[t.id]=i,i}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 Ai(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,n=Object.keys(this.hass.states),i=ki.deviceId();for(const r of n)if(r!==`sensor.ha_floorplan_${i}`||t.has(r)){const n=this.entityInfos[r];if(n){const i=this.hass.states[r];if(e)this.logDebug("STATE",`${r}: ${i.state} (initial load)`),t.has(r)||t.add(r);else if(n.lastState){const e=i.state;i.last_changed!==n.lastState.last_changed?(this.logDebug("STATE",`${r}: ${e} (last changed ${ki.formatDate(n.lastState.last_changed)})`),t.has(r)||t.add(r)):ki.equal(n.lastState.attributes,i.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${ki.formatDate(n.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return Ai(this,void 0,void 0,(function*(){const t=this.hass.states[e],n=this.entityInfos[e];if(n){n.lastState=Object.assign({},t);for(const e of n.ruleInfos){const t=Object.values(e.svgElementInfos);if(t.length)for(const i of t)i.svgElement&&this.handleActions(e.rule.state_action,n.entityId,i,e);else this.handleActions(e.rule.state_action,n.entityId,void 0,e)}}}))}handleElements(){return Ai(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 n=this.entityInfos[e];n&&this.handleEntitySetHoverOver(n,t)}handleEntitySetHoverOver(e,t){const n=e.entityId,i=this.hass.states[n];for(const n of e.ruleInfos)if(n.rule.hover_action){let r="string"==typeof n.rule.hover_action&&"hover-info"===n.rule.hover_action;if(r=r||"object"==typeof n.rule.hover_action&&"hover-info"===n.rule.hover_action.action,r=r||Array.isArray(n.rule.hover_action)&&n.rule.hover_action.some((e=>"hover-info"===e.action)),r){const e=new Set(n.rule.hover_info_filter);for(const t of Object.values(n.svgElementInfos))ki.addClass(t.svgElement,"floorplan-hover"),t.svgElement.style.cursor="pointer",t.svgElement.querySelectorAll("title").forEach((t=>{let n=`${i.attributes.friendly_name}\n`;n+=`State: ${i.state}\n\n`,Object.keys(i.attributes).map((t=>{e.has(t)||(n+=`${t}: ${i.attributes[t]}\n`)})),n+="\n",n+=`Last changed: ${Me.timeago(i.last_changed)}\n`,n+=`Last updated: ${Me.timeago(i.last_updated)}`,t.textContent=n}))}else n.rule.hover_action&&this.handleActions(n.rule.hover_action,e.entityId,t,n)}}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 n=e.rules.filter((e=>e.entities&&e.elements));n.length&&(this.logError("CONFIG","A rule cannot contain both 'entities' and 'elements' in floorplan configuration"),t=!1),n=e.rules.filter((e=>!(e.entity||e.entities||e.element||e.elements))),n.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,n){if("string"!=typeof e||!De.isCode(e))return e;try{return De.evaluate(e,this.hass,this.config,t,n,this.svgElements,this.functions)}catch(i){return this.handleError(i,{expression:e,entityId:t,hass:this.hass,svgElement:n})}}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,n=t.instance;setTimeout((()=>{n.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}),300)}handleActions(e,t,n,i){const r=this.getActionConfigs(e);for(const e of r){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}`):le(this,"hass-more-info",{entityId:t});break;case"navigate":this.isDemo?this.notify(`Performing action: ${e.action} ${e.navigation_path}`):he(0,e.navigation_path);break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const t=e.same_tab?"_self":"_blank";window.open(e.url_path,t)}break;case"toggle":if(t){const e={action:"call-service",service:"homeassistant.toggle",service_data:{entity_id:t}};this.callService(e,t,n,i)}break;case"call-service":if(!e.service)return;this.callService(e,t,n,i);break;case"fire-dom-event":le(this,"ll-custom",e)}}}getSvgElementsFromServiceData(e,t){let n=[],i=[];if(Array.isArray(null==e?void 0:e.elements)&&(i=i.concat(null==e?void 0:e.elements)),"string"==typeof(null==e?void 0:e.element)&&(i=i.concat([null==e?void 0:e.element])),i.length)for(const e of i)n=n.concat(this._querySelectorAll(this.svg,`#${e.replace(/\./g,"\\.")}`,!1));else t&&(n=[t]);return n}getServiceData(e,t,n){let i={};if("object"==typeof e.service_data)for(const r of Object.keys(e.service_data))i[r]=this.evaluate(e.service_data[r],t,n);else if("string"==typeof e.service_data){const r=this.evaluate(e.service_data,t,n);i="string"==typeof r&&r.trim().startsWith("{")?JSON.parse(r):r}else void 0!==e.service_data&&(i=e.service_data);return i}executeServiceData(e,t,n){try{if("object"==typeof e.service_data)for(const i of Object.keys(e.service_data))this.evaluate(e.service_data[i],t,n);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,n):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,n,i){const r=this.evaluate(e.service,t,null==n?void 0:n.svgElement),[s,a]=r.split(".",2);if("floorplan"===s)this.callFloorplanService(s,a,e,t,n,i);else this.callHomeAssistantService(s,a,e,t,n)}callFloorplanService(e,t,n,i,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,g,m,v,y,b=[],x=null;switch(x=!["execute"].includes(t)?this.getServiceData(n,i,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(n,i,e)),p="string"==typeof x?x:x.class,ki.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(n,i,e)),p="string"==typeof x?x:x.class,ki.setClass(e,p);break;case"dataset_set":{let e,t;if("string"==typeof x){const n=x.split(":");if(n.length<2){this.logError("FLOORPLAN_ACTION",`Service data "${x}" is not a valid dataset key value pair.`);break}e=n[1],t=n[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(n,i,s)),ki.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(n,i,e)),d="string"==typeof x?x:x.style,ki.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(n,i,e)),v="string"==typeof x?x:x.text;const t=(null===(o=n.service_data)||void 0===o?void 0:o.shift_y_axis)?null===(c=n.service_data)||void 0===c?void 0:c.shift_y_axis:"1em";ki.setText(e,v,t)}break;case"image_set":r&&s&&(x=this.getServiceData(n,i,null==r?void 0:r.svgElement),f="string"==typeof x?x:x.image,g="object"==typeof x?x.image_refresh_interval:0,m=!(g>0)&&("object"!=typeof x||!0===x.cache),s.imageLoader&&clearInterval(s.imageLoader),g&&(s.imageLoader=setInterval(this.loadImage.bind(this),1e3*g,f,r,i,s,m)),this.loadImage(f,r,i,s,m));break;case"page_navigate":x=this.getServiceData(n,i,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(n,i,null==r?void 0:r.svgElement),x.variable){const e={};if(x.attributes){const t=x.attributes;for(const n of Object.keys(t))e[n]=this.getActionValue(t[n],i,l)}const t=x,n=this.getActionValue(t,i,l);this.setVariable(x.variable,n,e,!1)}break;case"execute":this.executeServiceData(n,i,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(n,i,e)}}getActionValue(e,t,n){let i=e.value;return e.value&&(i=this.evaluate(e.value,t,n)),i}setVariable(e,t,n,i){if(this.variables[e]=t,this.hass.states[e]){this.hass.states[e].state=t.toString();for(const t of Object.keys(n))this.hass.states[e].attributes[t]=n[t]}for(const e of Object.keys(this.variables)){const t=this.hass.states[e];t&&(t.last_changed=(new Date).toString())}i||this.handleEntities()}callHomeAssistantService(e,t,n,i,r){const s=this.getServiceData(n,i,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&&i&&(s.entity_id=i)),this.hass.callService(e,t,s),this.isDemo&&this.notify(`Calling service: ${e}.${t} (${s.entity_id})`)}handleWindowError(e,t,n,i,r){if(e.toLowerCase().includes("script error"))this.logError("SCRIPT","Script error: See browser console for detail");else{const s=[e,"URL: "+t,"Line: "+n+", column: "+i,"Error: "+JSON.stringify(r)].join("
");this.logError("ERROR",s)}return!1}handleError(e,t){console.error(e,t);let n="Error";"string"==typeof e&&(n=e),e.message?n=`${e.message} (See console for more info)`:e.stack&&(n=`${e.stack}`),this.logger.log("error",n)}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}`)}};Ei([ae({type:String})],Ii.prototype,"examplespath",void 0),Ei([ae({type:Object})],Ii.prototype,"hass",void 0),Ei([ae({type:String||Object})],Ii.prototype,"_config",void 0),Ei([ae({type:Boolean})],Ii.prototype,"isDemo",void 0),Ei([ae({type:Boolean})],Ii.prototype,"isShowLog",void 0),Ei([ae({type:Function})],Ii.prototype,"notify",void 0),Ii=Ei([re("floorplan-element")],Ii); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const qi=1;class zi{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)}} +const Ti=1;class Pi{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$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 Wi=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends zi{constructor(e){var t;if(super(e),e.type!==qi||"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 B}});var Gi,Yi=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 Ki=Gi=class extends ie{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?$` +const Mi=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends Pi{constructor(e){var t;if(super(e),e.type!==Ti||"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,n)=>{const i=e[n];return null==i?t:t+`${n=n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:n}=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("-")?n.removeProperty(e):n[e]="")}));for(const e in t){const i=t[e];null!=i&&(this.vt.add(e),e.includes("-")?n.setProperty(e,i):n[e]=i)}return V}});var Ni,Oi=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};let Li=Ni=class extends ne{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?$` ${this.isDisplayCardHeader?$`

${null===(e=this.config)||void 0===e?void 0:e.title}

`:""} -
+
(...t)=>({_$litDirective$:e,values:t}))(class extends zi{constructo 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=ce.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?Gi.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)}};Ki.cardHeaderHeight=76,Yi([ae({type:Object})],Ki.prototype,"hass",void 0),Yi([ae({type:Boolean})],Ki.prototype,"isPanel",void 0),Yi([ae({type:Boolean})],Ki.prototype,"editMode",void 0),Yi([ae({type:Object})],Ki.prototype,"config",void 0),Yi([ae({type:String})],Ki.prototype,"examplespath",void 0),Yi([ae({type:Boolean})],Ki.prototype,"isDemo",void 0),Yi([ae({type:Function})],Ki.prototype,"notify",void 0),Ki=Gi=Yi([re("floorplan-card")],Ki);var Ji,Xi=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 Qi=Ji=class extends ie{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return $` + `}get isFullHeight(){var e;return null===(e=this.config)||void 0===e?void 0:e.full_height}get view(){return this._view||(this._view=ce.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?Ni.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)}};Li.cardHeaderHeight=76,Oi([ae({type:Object})],Li.prototype,"hass",void 0),Oi([ae({type:Boolean})],Li.prototype,"isPanel",void 0),Oi([ae({type:Boolean})],Li.prototype,"editMode",void 0),Oi([ae({type:Object})],Li.prototype,"config",void 0),Oi([ae({type:String})],Li.prototype,"examplespath",void 0),Oi([ae({type:Boolean})],Li.prototype,"isDemo",void 0),Oi([ae({type:Function})],Li.prototype,"notify",void 0),Li=Ni=Oi([re("floorplan-card")],Li);var Di,Ri=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};let $i=Di=class extends ne{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,n;return $` @@ -178,9 +178,9 @@ const Wi=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends zi{constructo -
+
+ ._config=${null===(n=null===(t=this.panel)||void 0===t?void 0:t.config)||void 0===n?void 0:n.config} .isDemo=${this.isDemo} .notify=${this.notify}>
@@ -197,4 +197,4 @@ const Wi=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends zi{constructo [hidden] { display: none !important; } - `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Ji.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)}};Qi.appHeaderHeight=64,Xi([ae({type:Object})],Qi.prototype,"hass",void 0),Xi([ae({type:Boolean})],Qi.prototype,"narrow",void 0),Xi([ae({type:Object})],Qi.prototype,"panel",void 0),Xi([ae({type:Boolean})],Qi.prototype,"showSideBar",void 0),Xi([ae({type:Boolean})],Qi.prototype,"showAppHeader",void 0),Xi([ae({type:String})],Qi.prototype,"examplespath",void 0),Xi([ae({type:Boolean})],Qi.prototype,"isDemo",void 0),Xi([ae({type:Function})],Qi.prototype,"notify",void 0),Qi=Ji=Xi([re("floorplan-panel")],Qi)})()})(); \ No newline at end of file + `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Di.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)}};$i.appHeaderHeight=64,Ri([ae({type:Object})],$i.prototype,"hass",void 0),Ri([ae({type:Boolean})],$i.prototype,"narrow",void 0),Ri([ae({type:Object})],$i.prototype,"panel",void 0),Ri([ae({type:Boolean})],$i.prototype,"showSideBar",void 0),Ri([ae({type:Boolean})],$i.prototype,"showAppHeader",void 0),Ri([ae({type:String})],$i.prototype,"examplespath",void 0),Ri([ae({type:Boolean})],$i.prototype,"isDemo",void 0),Ri([ae({type:Function})],$i.prototype,"notify",void 0),$i=Di=Ri([re("floorplan-panel")],$i)})()})(); \ No newline at end of file diff --git a/docs/_docs/floorplan/floorplan-examples.js b/docs/_docs/floorplan/floorplan-examples.js index b42ab479..6c32f1d0 100644 --- a/docs/_docs/floorplan/floorplan-examples.js +++ b/docs/_docs/floorplan/floorplan-examples.js @@ -1,4 +1,4 @@ -(()=>{var e={1: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 c="",p=null,d=!1,f=e.length,m=!1,y=0;yy?(y=s,f=new Date(y),i=y,v&&(f=new Date(y+c(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 l(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 c(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})}()},449: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 $e},get VariableDeclaration(){return je},get VariableDeclarator(){return Ve},get ClassDeclaration(){return Fe},get ClassBody(){return He},get MethodDefinition(){return Ue}}),r=Object.freeze,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.prototype.hasOwnProperty;function l(e,t){return o.call(e,t)}var c=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{var e={1: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;yy?(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})}()},449: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;t0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function U(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":return i>n;case">=":return i>=n;case"<<":return i<>":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=W(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new j(s,r.name)}}else{if("MemberExpression"!==r.type)return Ze(r,t,{feed:n});i=K(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()<>=":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:K,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=K(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[N])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[N]){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=[],l=0;l":return[2,i>n];case">=":return[2,i>=n];case"<<":return[2,i<>":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,H(Re(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,H(ye(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new j(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,H(we(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,H(ze(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()<>=":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,H(Re(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,H(Re(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,H(Re(e.left,t))];case 6:return(n=r.sent())?[5,H(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:we,ConditionalExpression:function(e,t){var i;return F(this,(function(n){switch(n.label){case 0:return[5,H(Re(e.test,t))];case 1:return n.sent()?[5,H(Re(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,H(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,l,c,h,u,p,d;return F(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,H(we(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,H(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[N])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,H(Re(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[N]){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=[],l=0,f.label=8;case 8:return l=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,H(Je(e,t,{value:r.value}))];case 4:if((l=p.sent())===P)return[3,7];if(l===T)return[3,5];if(l===I)return[2,l];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=H(i),a=s.next(),p.label=9;case 9:return a.done?[3,12]:(o=a.value,[5,H(Je(e,t,{value:o}))]);case 10:if((l=p.sent())===P)return[3,12];if(l===T)return[3,11];if(l===I)return[2,l];p.label=11;case 11:return a=s.next(),[3,9];case 12:return[3,15];case 13:return c=p.sent(),h={error:c},[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 Me(e,t,i){var n,r,s,a,o,l,c,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,l=void 0!==o&&o,c=i.feed,h=void 0===c?{}:c,u=[],p=0,y.label=1;case 1:return p-1;l--)e.body.splice(a[l],1);e.body=s.concat(e.body)}return[2]}}))}function Ge(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,H(je(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,H(je(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,H(je(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,H(Ge(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,H(Ge(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,H(Ge(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-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{"use strict";i.r(t),i.d(t,{Node:()=>ie,Parser:()=>j,Position:()=>N,SourceLocation:()=>D,TokContext:()=>se,Token:()=>Ae,TokenType:()=>g,defaultOptions:()=>R,getLineInfo:()=>B,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>S,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Me,parseExpressionAt:()=>Oe,tokContexts:()=>ae,tokTypes:()=>w,tokenizer:()=>Le,version:()=>Pe});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ヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",l="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",c=new RegExp("["+o+"]"),h=new RegExp("["+o+l+"]");o=l=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;ne)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&&c.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 _(e,t){return void 0===t&&(t={}),t.keyword=e,x[e]=new g(e,t)}var w={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:_("break"),_case:_("case",y),_catch:_("catch"),_continue:_("continue"),_debugger:_("debugger"),_default:_("default",y),_do:_("do",{isLoop:!0,beforeExpr:!0}),_else:_("else",y),_finally:_("finally"),_for:_("for",{isLoop:!0}),_function:_("function",b),_if:_("if"),_return:_("return",y),_switch:_("switch"),_throw:_("throw",y),_try:_("try"),_var:_("var"),_const:_("const"),_while:_("while",{isLoop:!0}),_with:_("with"),_new:_("new",{beforeExpr:!0,startsExpr:!0}),_this:_("this",b),_super:_("super",b),_class:_("class",b),_extends:_("extends",y),_export:_("export"),_import:_("import",b),_null:_("null",b),_true:_("true",b),_false:_("false",b),_in:_("in",{beforeExpr:!0,binop:7}),_instanceof:_("instanceof",{beforeExpr:!0,binop:7}),_typeof:_("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},S=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(S.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 M(e,t){return T.call(e,t)}var O=Array.isArray||function(e){return"[object Array]"===P.call(e)};function L(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var N=function(e,t){this.line=e,this.column=t};N.prototype.offset=function(e){return new N(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 B(e,t){for(var i=1,n=0;;){k.lastIndex=n;var r=k.exec(e);if(!(r&&r.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),O(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return O(t.onComment)&&(t.onComment=function(e,t){return function(i,n,r,s,a,o){var l={type:i?"Block":"Line",value:n,start:r,end:s};e.locations&&(l.loc=new D(this,a,o)),e.ranges&&(l.range=[r,s]),t.push(l)}}(t,t.onComment)),t}(e),this.sourceFile=e.sourceFile,this.keywords=L(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=L(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=L(o),this.reservedWordsStrictBind=L(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(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=w.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}};j.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())},j.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},j.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n-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=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case w._class:return e&&this.unexpected(),this.parseClass(s,!0);case w._if:return this.parseIfStatement(s);case w._return:return this.parseReturnStatement(s);case w._switch:return this.parseSwitchStatement(s);case w._throw:return this.parseThrowStatement(s);case w._try:return this.parseTryStatement(s);case w._const:case w._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case w._while:return this.parseWhileStatement(s);case w._with:return this.parseWithStatement(s);case w.braceL:return this.parseBlock(!0,s);case w.semi:return this.parseEmptyStatement(s);case w._export:case w._import:if(this.options.ecmaVersion>10&&r===w._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===w._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,c=this.parseExpression();return r===w.name&&"Identifier"===c.type&&this.eat(w.colon)?this.parseLabeledStatement(s,l,c,e):this.parseExpressionStatement(s,c)}},q.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(w.semi)||this.insertSemicolon()?e.label=null:this.type!==w.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(w.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(W),this.enterScope(0),this.expect(w.parenL),this.type===w.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===w._var||this.type===w._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===w._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===w._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 U,a=this.parseExpression(!0,s);return this.type===w._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===w._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,Y|(i?0:K),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(w._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(w.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(w.braceL),this.labels.push(G),this.enterScope(0);for(var i=!1;this.type!==w.braceR;)if(this.type===w._case||this.type===w._default){var n=this.type===w._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(w.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(),S.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 z=[];q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===w._catch){var t=this.startNode();if(this.next(),this.eat(w.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(w.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(w._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(W),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=0;o--){var l=this.labels[o];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.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(w.braceL),e&&this.enterScope(0);!this.eat(w.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(w.semi),e.test=this.type===w.semi?null:this.parseExpression(),this.expect(w.semi),e.update=this.type===w.parenR?null:this.parseExpression(),this.expect(w.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},q.parseForIn=function(e,t){var i=this.type===w._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(w.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(w.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===w._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===w._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(w.comma))break}return e},q.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var Y=1,K=2;q.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===w.star&&t&K&&this.unexpected(),e.generator=this.eat(w.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&Y&&(e.id=4&t&&this.type!==w.name?null:this.parseIdent(),!e.id||t&K||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($(e.async,e.generator)),t&Y||(e.id=this.type===w.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&Y?"FunctionDeclaration":"FunctionExpression")},q.parseFunctionParams=function(e){this.expect(w.parenL),e.params=this.parseBindingList(w.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(w.braceL);!this.eat(w.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(w.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===w.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(w.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(w.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===w.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(w._extends)?this.parseExprSubscripts():null},q.parseExport=function(e,t){if(this.next(),this.eat(w.star))return this.expectContextual("from"),this.type!==w.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(w._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===w._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|Y,!1,i)}else if(this.type===w._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!==w.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s=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=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(w._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(w.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===w.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(w.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0)}return a;case w.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case w.num:case w.string:return this.parseLiteral(this.value);case w._null:case w._true:case w._false:return(t=this.startNode()).value=this.type===w._null?null:this.type===w._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case w.parenL:var l=this.start,c=this.parseParenAndDistinguishExpression(i);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),c;case w.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(w.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case w.braceL:return this.parseObj(!1,e);case w._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case w._class:return this.parseClass(this.startNode(),!1);case w._new:return this.parseNew();case w.backQuote:return this.parseTemplate();case w._import:return this.options.ecmaVersion>10?this.parseDynamicImport():this.unexpected();default:this.unexpected()}},X.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==w.parenL&&this.unexpected(),this.finishNode(e,"Import")},X.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")},X.parseParenExpression=function(){this.expect(w.parenL);var e=this.parseExpression();return this.expect(w.parenR),e},X.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,l=[],c=!0,h=!1,u=new U,p=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==w.parenR;){if(c?c=!1:this.expect(w.comma),r&&this.afterTrailingComma(w.parenR,!0)){h=!0;break}if(this.type===w.ellipsis){s=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===w.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}l.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(w.parenR),e&&!this.canInsertSemicolon()&&this.eat(w.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(i,n,l);l.length&&!h||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(u,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,l.length>1?((t=this.startNodeAt(a,o)).expressions=l,this.finishNodeAt(t,"SequenceExpression",f,m)):t=l[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},X.parseParenItem=function(e){return e},X.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Q=[];X.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(w.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(w.parenL)?e.arguments=this.parseExprList(w.parenR,this.options.ecmaVersion>=8&&"Import"!==e.callee.type,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},X.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===w.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===w.backQuote,this.finishNode(i,"TemplateElement")},X.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===w.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(w.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(w.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},X.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===w.name||this.type===w.num||this.type===w.string||this.type===w.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===w.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},X.parseObj=function(e,t){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(w.braceR);){if(n)n=!1;else if(this.expect(w.comma),this.afterTrailingComma(w.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")},X.parseProperty=function(e,t){var i,n,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(w.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===w.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===w.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===w.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(w.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(w.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},X.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&this.type===w.colon&&this.unexpected(),this.eat(w.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===w.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===w.comma||this.type===w.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===w.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 l="get"===e.kind?0:1;if(e.value.params.length!==l){var c=e.value.start;"get"===e.kind?this.raiseRecoverable(c,"getter should have no params"):this.raiseRecoverable(c,"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")}},X.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(w.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(w.bracketR),e.key;e.computed=!1}return e.key=this.type===w.num||this.type===w.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},X.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},X.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|$(t,n.generator)|(i?128:0)),this.expect(w.parenL),n.params=this.parseBindingList(w.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")},X.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|$(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")},X.parseFunctionBody=function(e,t,i){var n=t&&this.type!==w.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},X.isSimpleParamList=function(e){for(var t=0,i=e;t-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=j.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=j.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!==w.colon||t!==ae.b_stat&&t!==ae.b_expr?e===w._return||e===w.name&&this.exprAllowed?S.test(this.input.slice(this.lastTokEnd,this.start)):e===w._else||e===w.semi||e===w.eof||e===w.parenR||e===w.arrow||(e===w.braceL?t===ae.b_stat:e!==w._var&&e!==w._const&&e!==w.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===w.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},w.parenR.updateContext=w.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},w.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ae.b_stat:ae.b_expr),this.exprAllowed=!0},w.dollarBraceL.updateContext=function(){this.context.push(ae.b_tmpl),this.exprAllowed=!0},w.parenL.updateContext=function(e){var t=e===w._if||e===w._for||e===w._with||e===w._while;this.context.push(t?ae.p_stat:ae.p_expr),this.exprAllowed=!0},w.incDec.updateContext=function(){},w._function.updateContext=w._class.updateContext=function(e){!e.beforeExpr||e===w.semi||e===w._else||e===w._return&&S.test(this.input.slice(this.lastTokEnd,this.start))||(e===w.colon||e===w.braceL)&&this.curContext()===ae.b_stat?this.context.push(ae.f_stat):this.context.push(ae.f_expr),this.exprAllowed=!1},w.backQuote.updateContext=function(){this.curContext()===ae.q_tmpl?this.context.pop():this.context.push(ae.q_tmpl),this.exprAllowed=!1},w.star.updateContext=function(e){if(e===w._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},w.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==w.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var le="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",ce={9:le,10:"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 Extended_Pictographic",11:"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 Extended_Pictographic"},he="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",ue="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",pe={9:ue,10:"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 Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",11:"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 Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},de={};function fe(e){var t=de[e]={binary:L(ce[e]+" "+he),nonBinary:{General_Category:L(he),Script:L(pe[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}fe(9),fe(10),fe(11);var me=j.prototype,ge=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=de[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 ve(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function ye(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function be(e){return e>=65&&e<=90||e>=97&&e<=122}function xe(e){return be(e)||95===e}function _e(e){return xe(e)||we(e)}function we(e){return e>=48&&e<=57}function Se(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ke(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ee(e){return e>=48&&e<=55}ge.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},ge.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},ge.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},ge.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},ge.prototype.current=function(){return this.at(this.pos)},ge.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},ge.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},ge.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},me.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},me.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},me.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=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},me.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},me.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},me.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=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},me.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)},me.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},me.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!ye(t)&&(e.lastIntValue=t,e.advance(),!0)},me.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!ye(i);)e.advance();return e.pos!==t},me.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))},me.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")}},me.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},me.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ve(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ve(e.lastIntValue);return!0}return!1},me.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)},me.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)},me.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)},me.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},me.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},me.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)},me.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},me.regexp_eatZero=function(e){return 48===e.current()&&!we(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},me.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)},me.regexp_eatControlLetter=function(e){var t=e.current();return!!be(t)&&(e.lastIntValue=t%32,e.advance(),!0)},me.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},me.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))},me.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},me.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},me.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},me.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){M(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},me.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},me.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";xe(t=e.current());)e.lastStringValue+=ve(t),e.advance();return""!==e.lastStringValue},me.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";_e(t=e.current());)e.lastStringValue+=ve(t),e.advance();return""!==e.lastStringValue},me.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},me.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},me.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")}}},me.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||Ee(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)},me.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)},me.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!we(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},me.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},me.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;we(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},me.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Se(i=e.current());)e.lastIntValue=16*e.lastIntValue+ke(i),e.advance();return e.pos!==t},me.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},me.regexp_eatOctalDigit=function(e){var t=e.current();return Ee(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},me.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}Ce.next=function(){this.options.onToken&&this.options.onToken(new Ae(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ce.getToken=function(){return this.next(),new Ae(this)},"undefined"!=typeof Symbol&&(Ce[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===w.eof,value:t}}}}),Ce.curContext=function(){return this.context[this.context.length-1]},Ce.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(w.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ce.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Ce.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Ce.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.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Ce.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)},Ce.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(w.ellipsis)):(++this.pos,this.finishToken(w.dot))},Ce.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(w.assign,2):this.finishOp(w.slash,1)},Ce.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?w.star:w.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=w.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(w.assign,i+1):this.finishOp(n,i)},Ce.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?w.logicalOR:w.logicalAND,2):61===t?this.finishOp(w.assign,2):this.finishOp(124===e?w.bitwiseOR:w.bitwiseAND,1)},Ce.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(w.assign,2):this.finishOp(w.bitwiseXOR,1)},Ce.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&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(w.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(w.assign,2):this.finishOp(w.plusMin,1)},Ce.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(w.assign,i+1):this.finishOp(w.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(w.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Ce.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(w.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(w.arrow)):this.finishOp(61===e?w.eq:w.prefix,1)},Ce.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(w.parenL);case 41:return++this.pos,this.finishToken(w.parenR);case 59:return++this.pos,this.finishToken(w.semi);case 44:return++this.pos,this.finishToken(w.comma);case 91:return++this.pos,this.finishToken(w.bracketL);case 93:return++this.pos,this.finishToken(w.bracketR);case 123:return++this.pos,this.finishToken(w.braceL);case 125:return++this.pos,this.finishToken(w.braceR);case 58:return++this.pos,this.finishToken(w.colon);case 63:return++this.pos,this.finishToken(w.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(w.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(w.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ie(e)+"'")},Ce.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Ce.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(S.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 ge(this));o.reset(i,r,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(r,a)}catch(e){}return this.finishToken(w.regexp,{pattern:r,flags:a,value:l})},Ce.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r=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},Ce.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(w.num,i)},Ce.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(w.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(w.num,o)},Ce.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},Ce.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(w.string,t)};var Te={};Ce.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Te)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ce.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Te;this.raise(e,t)},Ce.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!==w.template&&this.type!==w.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(w.template,e)):36===i?(this.pos+=2,this.finishToken(w.dollarBraceL)):(++this.pos,this.finishToken(w.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}},Ce.readInvalidTemplateToken=function(){for(;this.pos=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)}},Ce.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Ce.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{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"; + ***************************************************************************** */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]=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":return i>n;case">=":return i>=n;case"<<":return i<>":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=K(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()<>=":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:K,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=K(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":return[2,i>n];case">=":return[2,i>=n];case"<<":return[2,i<>":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(_e(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,U(Ge(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()<>=":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:_e,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(_e(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.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(Je(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(Je(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 Me(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-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-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{"use strict";i.r(t),i.d(t,{Node:()=>ie,Parser:()=>B,Position:()=>L,SourceLocation:()=>D,TokContext:()=>se,Token:()=>Ae,TokenType:()=>g,defaultOptions:()=>R,getLineInfo:()=>$,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>S,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Me,parseExpressionAt:()=>Oe,tokContexts:()=>ae,tokTypes:()=>_,tokenizer:()=>Ne,version:()=>Pe});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;ne)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 _={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})},S=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(S.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 M(e,t){return T.call(e,t)}var O=Array.isArray||function(e){return"[object Array]"===P.call(e)};function N(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=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),O(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return O(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=N(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=N(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=N(o),this.reservedWordsStrictBind=N(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(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=_.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-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=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case _._class:return e&&this.unexpected(),this.parseClass(s,!0);case _._if:return this.parseIfStatement(s);case _._return:return this.parseReturnStatement(s);case _._switch:return this.parseSwitchStatement(s);case _._throw:return this.parseThrowStatement(s);case _._try:return this.parseTryStatement(s);case _._const:case _._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case _._while:return this.parseWhileStatement(s);case _._with:return this.parseWithStatement(s);case _.braceL:return this.parseBlock(!0,s);case _.semi:return this.parseEmptyStatement(s);case _._export:case _._import:if(this.options.ecmaVersion>10&&r===_._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===_._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===_.name&&"Identifier"===l.type&&this.eat(_.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}},q.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(_.semi)||this.insertSemicolon()?e.label=null:this.type!==_.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(_.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(_.parenL),this.type===_.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===_._var||this.type===_._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===_._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===_._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===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===_._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,Y|(i?0:K),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(_._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(_.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(_.braceL),this.labels.push(W),this.enterScope(0);for(var i=!1;this.type!==_.braceR;)if(this.type===_._case||this.type===_._default){var n=this.type===_._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(_.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(),S.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 G=[];q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===_._catch){var t=this.startNode();if(this.next(),this.eat(_.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(_.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(_._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=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(_.braceL),e&&this.enterScope(0);!this.eat(_.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(_.semi),e.test=this.type===_.semi?null:this.parseExpression(),this.expect(_.semi),e.update=this.type===_.parenR?null:this.parseExpression(),this.expect(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},q.parseForIn=function(e,t){var i=this.type===_._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(_.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(_.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===_._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(_.comma))break}return e},q.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var Y=1,K=2;q.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===_.star&&t&K&&this.unexpected(),e.generator=this.eat(_.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&Y&&(e.id=4&t&&this.type!==_.name?null:this.parseIdent(),!e.id||t&K||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&Y||(e.id=this.type===_.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&Y?"FunctionDeclaration":"FunctionExpression")},q.parseFunctionParams=function(e){this.expect(_.parenL),e.params=this.parseBindingList(_.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(_.braceL);!this.eat(_.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(_.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===_.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(_.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(_.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===_.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(_._extends)?this.parseExprSubscripts():null},q.parseExport=function(e,t){if(this.next(),this.eat(_.star))return this.expectContextual("from"),this.type!==_.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(_._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===_._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|Y,!1,i)}else if(this.type===_._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!==_.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s=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=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(_._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(_.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===_.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(_.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0)}return a;case _.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case _.num:case _.string:return this.parseLiteral(this.value);case _._null:case _._true:case _._false:return(t=this.startNode()).value=this.type===_._null?null:this.type===_._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case _.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 _.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(_.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case _.braceL:return this.parseObj(!1,e);case _._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case _._class:return this.parseClass(this.startNode(),!1);case _._new:return this.parseNew();case _.backQuote:return this.parseTemplate();case _._import:return this.options.ecmaVersion>10?this.parseDynamicImport():this.unexpected();default:this.unexpected()}},X.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==_.parenL&&this.unexpected(),this.finishNode(e,"Import")},X.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")},X.parseParenExpression=function(){this.expect(_.parenL);var e=this.parseExpression();return this.expect(_.parenR),e},X.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!==_.parenR;){if(l?l=!1:this.expect(_.comma),r&&this.afterTrailingComma(_.parenR,!0)){h=!0;break}if(this.type===_.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===_.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(_.parenR),e&&!this.canInsertSemicolon()&&this.eat(_.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},X.parseParenItem=function(e){return e},X.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Q=[];X.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(_.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(_.parenL)?e.arguments=this.parseExprList(_.parenR,this.options.ecmaVersion>=8&&"Import"!==e.callee.type,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},X.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===_.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===_.backQuote,this.finishNode(i,"TemplateElement")},X.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===_.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(_.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(_.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},X.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===_.name||this.type===_.num||this.type===_.string||this.type===_.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===_.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},X.parseObj=function(e,t){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(_.braceR);){if(n)n=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.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")},X.parseProperty=function(e,t){var i,n,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(_.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===_.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===_.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(_.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(_.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},X.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&this.type===_.colon&&this.unexpected(),this.eat(_.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===_.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===_.comma||this.type===_.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===_.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")}},X.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(_.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(_.bracketR),e.key;e.computed=!1}return e.key=this.type===_.num||this.type===_.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},X.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},X.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(_.parenL),n.params=this.parseBindingList(_.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")},X.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")},X.parseFunctionBody=function(e,t,i){var n=t&&this.type!==_.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},X.isSimpleParamList=function(e){for(var t=0,i=e;t-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!==_.colon||t!==ae.b_stat&&t!==ae.b_expr?e===_._return||e===_.name&&this.exprAllowed?S.test(this.input.slice(this.lastTokEnd,this.start)):e===_._else||e===_.semi||e===_.eof||e===_.parenR||e===_.arrow||(e===_.braceL?t===ae.b_stat:e!==_._var&&e!==_._const&&e!==_.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===_.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},_.parenR.updateContext=_.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},_.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ae.b_stat:ae.b_expr),this.exprAllowed=!0},_.dollarBraceL.updateContext=function(){this.context.push(ae.b_tmpl),this.exprAllowed=!0},_.parenL.updateContext=function(e){var t=e===_._if||e===_._for||e===_._with||e===_._while;this.context.push(t?ae.p_stat:ae.p_expr),this.exprAllowed=!0},_.incDec.updateContext=function(){},_._function.updateContext=_._class.updateContext=function(e){!e.beforeExpr||e===_.semi||e===_._else||e===_._return&&S.test(this.input.slice(this.lastTokEnd,this.start))||(e===_.colon||e===_.braceL)&&this.curContext()===ae.b_stat?this.context.push(ae.f_stat):this.context.push(ae.f_expr),this.exprAllowed=!1},_.backQuote.updateContext=function(){this.curContext()===ae.q_tmpl?this.context.pop():this.context.push(ae.q_tmpl),this.exprAllowed=!1},_.star.updateContext=function(e){if(e===_._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},_.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==_.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={9:ce,10:ce+" Extended_Pictographic",11:"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 Extended_Pictographic"},he="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",ue="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",pe={9:ue,10:ue+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",11:"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 Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},de={};function fe(e){var t=de[e]={binary:N(le[e]+" "+he),nonBinary:{General_Category:N(he),Script:N(pe[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}fe(9),fe(10),fe(11);var me=B.prototype,ge=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=de[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 ve(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function ye(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function be(e){return e>=65&&e<=90||e>=97&&e<=122}function xe(e){return be(e)||95===e}function we(e){return xe(e)||_e(e)}function _e(e){return e>=48&&e<=57}function Se(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ke(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ee(e){return e>=48&&e<=55}ge.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},ge.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},ge.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},ge.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},ge.prototype.current=function(){return this.at(this.pos)},ge.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},ge.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},ge.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},me.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},me.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},me.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=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},me.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},me.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},me.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=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},me.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)},me.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},me.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!ye(t)&&(e.lastIntValue=t,e.advance(),!0)},me.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!ye(i);)e.advance();return e.pos!==t},me.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))},me.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")}},me.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},me.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ve(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ve(e.lastIntValue);return!0}return!1},me.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)},me.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)},me.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)},me.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},me.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},me.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)},me.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},me.regexp_eatZero=function(e){return 48===e.current()&&!_e(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},me.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)},me.regexp_eatControlLetter=function(e){var t=e.current();return!!be(t)&&(e.lastIntValue=t%32,e.advance(),!0)},me.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},me.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))},me.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},me.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},me.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},me.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){M(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},me.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},me.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";xe(t=e.current());)e.lastStringValue+=ve(t),e.advance();return""!==e.lastStringValue},me.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";we(t=e.current());)e.lastStringValue+=ve(t),e.advance();return""!==e.lastStringValue},me.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},me.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},me.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")}}},me.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||Ee(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)},me.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)},me.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!_e(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},me.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},me.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;_e(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},me.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Se(i=e.current());)e.lastIntValue=16*e.lastIntValue+ke(i),e.advance();return e.pos!==t},me.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},me.regexp_eatOctalDigit=function(e){var t=e.current();return Ee(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},me.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}Ce.next=function(){this.options.onToken&&this.options.onToken(new Ae(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ce.getToken=function(){return this.next(),new Ae(this)},"undefined"!=typeof Symbol&&(Ce[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===_.eof,value:t}}}}),Ce.curContext=function(){return this.context[this.context.length-1]},Ce.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(_.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ce.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Ce.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Ce.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.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Ce.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)},Ce.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(_.ellipsis)):(++this.pos,this.finishToken(_.dot))},Ce.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(_.assign,2):this.finishOp(_.slash,1)},Ce.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?_.star:_.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=_.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(_.assign,i+1):this.finishOp(n,i)},Ce.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?_.logicalOR:_.logicalAND,2):61===t?this.finishOp(_.assign,2):this.finishOp(124===e?_.bitwiseOR:_.bitwiseAND,1)},Ce.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(_.assign,2):this.finishOp(_.bitwiseXOR,1)},Ce.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&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(_.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(_.assign,2):this.finishOp(_.plusMin,1)},Ce.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(_.assign,i+1):this.finishOp(_.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(_.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Ce.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(_.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(_.arrow)):this.finishOp(61===e?_.eq:_.prefix,1)},Ce.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(_.parenL);case 41:return++this.pos,this.finishToken(_.parenR);case 59:return++this.pos,this.finishToken(_.semi);case 44:return++this.pos,this.finishToken(_.comma);case 91:return++this.pos,this.finishToken(_.bracketL);case 93:return++this.pos,this.finishToken(_.bracketR);case 123:return++this.pos,this.finishToken(_.braceL);case 125:return++this.pos,this.finishToken(_.braceR);case 58:return++this.pos,this.finishToken(_.colon);case 63:return++this.pos,this.finishToken(_.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(_.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(_.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ie(e)+"'")},Ce.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Ce.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(S.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 ge(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(_.regexp,{pattern:r,flags:a,value:c})},Ce.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r=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},Ce.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(_.num,i)},Ce.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(_.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(_.num,o)},Ce.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},Ce.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(_.string,t)};var Te={};Ce.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Te)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ce.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Te;this.raise(e,t)},Ce.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!==_.template&&this.type!==_.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(_.template,e)):36===i?(this.pos+=2,this.finishToken(_.dollarBraceL)):(++this.pos,this.finishToken(_.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}},Ce.readInvalidTemplateToken=function(){for(;this.pos=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)}},Ce.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Ce.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{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 @@ -22,12 +22,12 @@ * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;var l;const c=window,h=c.trustedTypes,u=h?h.emptyScript:"",p=c.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){}} + */;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!==(l=c.reactiveElementVersions)&&void 0!==l?l:c.reactiveElementVersions=[]).push("1.4.2");const y=window,b=y.trustedTypes,x=b?b.createPolicy("lit-html",{createHTML:e=>e}):void 0,_=`lit$${(Math.random()+"").slice(9)}$`,w="?"+_,S=`<${w}>`,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,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,L=/"/g,N=/^(?:script|style|textarea|title)$/i,D=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),B=D(1),R=(D(2),Symbol.for("lit-noChange")),$=Symbol.for("lit-nothing"),j=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,[l,c]=((e,t)=>{const i=e.length-1,n=[];let r,s=2===t?"":"",a=I;for(let t=0;t"===l[0]?(a=null!=r?r:I,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,o=l[1],a=void 0===l[3]?M:'"'===l[3]?L:O):a===L||a===O?a=M:a===T||a===P?a=I:(a=M,r=void 0);const u=a===M&&e[t+1].startsWith("/>")?" ":"";s+=a===I?i+S:c>=0?(n.push(o),i.slice(0,c)+"$lit$"+i.slice(c)+_+u):i+_+(-2===c?(n.push(void 0),t):u)}const o=s+(e[i]||"")+(2===t?"":"");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(l,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.length0){n.textContent=b?b.emptyScript:"";for(let i=0;iC(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!==$&&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 U(r,this),t=e.v(this.options);e.p(i),this.T(t),this._$AH=e}}_$AC(e){let t=j.get(e.strings);return void 0===t&&j.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++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$}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=H(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;ae}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,_="?"+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,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,N=/"/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?"":"",a=I;for(let t=0;t"===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]?M:'"'===c[3]?N:O):a===N||a===O?a=M:a===T||a===P?a=I:(a=M,r=void 0);const u=a===M&&e[t+1].startsWith("/>")?" ":"";s+=a===I?i+S: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?"":"");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.length0){n.textContent=b?b.emptyScript:"";for(let i=0;iC(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++;n2||""!==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;at=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(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 le=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/giu;function ce(e="",t="ms"){var i=null;return(e=(e+"").replace(/(\d)[,_](\d)/g,"$1$2")).replace(le,(function(e,t,n){(n=he(n))&&(i=(i||0)+parseFloat(t,10)*n)})),i&&i/(he(t)||1)}function he(e){return ce[e]||ce[e.toLowerCase().replace(/s$/,"")]}ce.nanosecond=ce.ns=1e-6,ce["µs"]=ce["μs"]=ce.us=ce.microsecond=.001,ce.millisecond=ce.ms=ce[""]=1,ce.second=ce.sec=ce.s=1e3*ce.ms,ce.minute=ce.min=ce.m=60*ce.s,ce.hour=ce.hr=ce.h=60*ce.m,ce.day=ce.d=24*ce.h,ce.week=ce.wk=ce.w=7*ce.d,ce.month=ce.b=30.4375*ce.d,ce.year=ce.yr=ce.y=365.25*ce.d;const ue=ce;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(1),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(449),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(">".length).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 _e{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 we(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 we{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 Se(e){return null==e}var ke={isNothing:Se,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Se(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;io&&(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=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Me=["scalar","sequence","mapping"],Oe=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Pe.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===Me.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 Ne(e){return this.extend(e)}Ne.prototype.extend=function(e){var t=[],i=[];if(e instanceof Oe)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 Oe))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 Oe))throw new Ce("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Ne.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=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"]}}),Ge=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),ze=/^[-+]?[0-9]+e/,Ye=new Oe("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Ge.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),ze.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Ke=je.extend({implicit:[Ve,Fe,We,Ye]}),Je=Ke,Xe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Qe=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]))?))?$"),Ze=new Oe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Xe.exec(e)||null!==Qe.exec(e))},construct:function(e){var t,i,n,r,s,a,o,l,c=0,h=null;if(null===(t=Xe.exec(e))&&(t=Qe.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(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(h=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(h=-h)),l=new Date(Date.UTC(i,n,r,s,a,o,c)),h&&l.setTime(l.getTime()-h),l},instanceOf:Date,represent:function(e){return e.toISOString()}}),et=new Oe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",it=new Oe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=tt;for(i=0;i64)){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=tt,a=0,o=[];for(t=0;t>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=tt;for(t=0;t>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}}),nt=Object.prototype.hasOwnProperty,rt=Object.prototype.toString,st=new Oe("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>10),56320+(e-65536&1023))}for(var Ct=new Array(256),It=new Array(256),Tt=0;Tt<256;Tt++)Ct[Tt]=Et(Tt)?1:0,It[Tt]=Et(Tt);function Pt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ht,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 Mt(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=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,l,c="",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++)l=Ie(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),c=ke.repeat(" ",t.indent)+Te((e.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=Ie(e.buffer,r[a],s[a],e.position,u),c+=ke.repeat(" ",t.indent)+Te((e.line+1).toString(),h)+" | "+l.str+"\n",c+=ke.repeat("-",t.indent+h+3+l.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)l=Ie(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),c+=ke.repeat(" ",t.indent)+Te((e.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}(i),new Ce(t,i)}function Ot(e,t){throw Mt(e,t)}function Lt(e,t){e.onWarning&&e.onWarning.call(null,Mt(e,t))}var Nt={YAML:function(e,t,i){var n,r,s;null!==e.version&&Ot(e,"duplication of %YAML directive"),1!==i.length&&Ot(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Ot(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Ot(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Lt(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Ot(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],mt.test(n)||Ot(e,"ill-formed tag handle (first argument) of the TAG directive"),ut.call(e.tagMap,n)&&Ot(e,'there is a previously declared suffix for "'+n+'" tag handle'),gt.test(r)||Ot(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Ot(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function Dt(e,t,i,n){var r,s,a,o;if(t1&&(e.result+=ke.repeat("\n",t-1))}function Ht(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,Ot(e,"tab characters must not be used in indentation")),45===n)&&xt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,jt(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,Wt(e,t,3,!1,!0),a.push(e.result),jt(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Ot(e,"bad indentation of a sequence entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt)&&(v&&(a=e.line,o=e.lineStart,l=e.position),Wt(e,t,4,!0,r)&&(v?m=e.result:g=e.result),v||(Rt(e,p,d,f,m,g,a,o,l),f=m=g=null),jt(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==c)Ot(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Ot(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?Ot(e,"repeat of an indentation width identifier"):(c=t+r-1,l=!0)}if(bt(s)){do{s=e.input.charCodeAt(++e.position)}while(bt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!yt(s)&&0!==s)}for(;0!==s;){for($t(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!l||e.lineIndentc&&(c=e.lineIndent),yt(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=wt(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Ot(e,"expected hexadecimal character");e.result+=At(s),e.position++}else Ot(e,"unknown escape sequence");i=n=e.position}else yt(o)?(Dt(e,i,n,!0),Ft(e,jt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Vt(e)?Ot(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Ot(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&&!xt(n)&&!_t(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ot(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),ut.call(e.anchorMap,i)||Ot(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],jt(e,!0,-1),!0}(e)?(g=!0,null===e.tag&&null===e.anchor||Ot(e,"alias node should not have any properties")):function(e,t,i){var n,r,s,a,o,l,c,h,u=e.kind,p=e.result;if(xt(h=e.input.charCodeAt(e.position))||_t(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)&&(xt(n=e.input.charCodeAt(e.position+1))||i&&_t(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(xt(n=e.input.charCodeAt(e.position+1))||i&&_t(n))break}else if(35===h){if(xt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Vt(e)||i&&_t(h))break;if(yt(h)){if(o=e.line,l=e.lineStart,c=e.lineIndent,jt(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}e.position=s,e.line=o,e.lineStart=l,e.lineIndent=c;break}}a&&(Dt(e,r,s,!1),Ft(e,e.line-o),r=s=e.position,a=!1),bt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return Dt(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,1===i)&&(g=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=o&&Ht(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&&Ot(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),l=0,c=e.implicitTypes.length;l"),null!==e.result&&u.kind!==e.kind&&Ot(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)):Ot(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 Gt(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))&&(jt(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&&!xt(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Ot(e,"directive name must not be less than one character in length");0!==r;){for(;bt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!yt(r));break}if(yt(r))break;for(t=e.position;0!==r&&!xt(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&$t(e),ut.call(Nt,i)?Nt[i](e,i,n):Lt(e,'unknown document directive "'+i+'"')}jt(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,jt(e,!0,-1)):a&&Ot(e,"directives end mark is expected"),Wt(e,e.lineIndent-1,4,!1,!0),jt(e,!0,-1),e.checkLineBreaks&&dt.test(e.input.slice(s,e.position))&&Lt(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Vt(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,jt(e,!0,-1)):e.position=55296&&n<=56319&&t+1=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function hi(e){return/^\n* /.test(e)}function ui(e,t,i,n,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Zt.indexOf(t)||ei.test(t)))return 2===e.quotingType?'"'+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 l,c=0,h=null,u=!1,p=!1,d=-1!==n,f=-1,m=function(e){return ai(e)&&e!==Xt&&!si(e)&&45!==e&&63!==e&&58!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&35!==e&&38!==e&&42!==e&&33!==e&&124!==e&&61!==e&&62!==e&&39!==e&&34!==e&&37!==e&&64!==e&&96!==e}(ci(e,0))&&function(e){return!si(e)&&58!==e}(ci(e,e.length-1));if(t||a)for(l=0;l=65536?l+=2:l++){if(!ai(c=ci(e,l)))return 5;m=m&&li(c,h,o),h=c}else{for(l=0;l=65536?l+=2:l++){if(10===(c=ci(e,l)))u=!0,d&&(p=p||l-f-1>n&&" "!==e[f+1],f=l);else if(!ai(c))return 5;m=m&&li(c,h,o),h=c}p=p||d&&l-f-1>n&&" "!==e[f+1]}return u||p?i>9&&hi(e)?5:a?2===s?5:2:p?4:3:!m||a||r(e)?2===s?5:2:1}(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i"+pi(t,e.indent)+di(ni(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,fi(e.slice(0,r),t)),o="\n"===e[0]||" "===e[0];n=s.exec(e);){var l=n[1],c=n[2];i=" "===c[0],a+=l+(o||i||""===c?"":"\n")+fi(c,t),o=i}return a}(t,a),s));case 5:return'"'+function(e){for(var t,i="",n=0,r=0;r=65536?r+=2:r++)n=ci(e,r),!(t=Qt[n])&&ai(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||ti(n);return i}(t)+'"';default:throw new Ce("impossible error: invalid scalar style")}}()}function pi(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 di(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function fi(e,t){if(""===e||" "===e[0])return e;for(var i,n,r=/ [^ ]/g,s=0,a=0,o=0,l="";i=r.exec(e);)(o=i.index)-s>t&&(n=a>s?a:o,l+="\n"+e.slice(s,n),s=n+1),a=o;return l+="\n",e.length-s>t&&a>s?l+=e.slice(s,a)+"\n"+e.slice(a+1):l+=e.slice(s),l.slice(1)}function mi(e,t,i,n){var r,s,a,o="",l=e.tag;for(r=0,s=i.length;r tag resolver accepts not "'+l+'" style');n=o.represent[l](t,l)}e.dump=n}return!0}return!1}function vi(e,t,i,n,r,s,a){e.tag=null,e.dump=i,gi(e,i,!1)||gi(e,i,!0);var o,l=Kt.call(e.dump),c=n;n&&(n=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===l||"[object Array]"===l;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]"===l)n&&0!==Object.keys(e.dump).length?(function(e,t,i,n){var r,s,a,o,l,c,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;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,l&&(c+=ri(e,t)),vi(e,t+1,o,!0,l)&&(e.dump&&10===e.dump.charCodeAt(0)?c+=":":c+=": ",h+=c+=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,l="",c=e.tag,h=Object.keys(i);for(n=0,r=h.length;n1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),vi(e,t,a,!1,!1)&&(l+=o+=e.dump));e.tag=c,e.dump="{"+l+"}"}(e,t,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else if("[object Array]"===l)n&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?mi(e,t-1,e.dump,r):mi(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",e.dump=o+" "+e.dump)}return!0}function yi(e,t){var i,n,r=[],s=[];for(bi(e,r,s),i=0,n=s.length;ie.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(n[0],n[1])}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n");if(n.length>1){const t=e.querySelector("tspan"),i=null==t?void 0:t.getAttribute("x"),n=null==t?void 0:t.getAttribute("y");i&&!e.getAttribute("x")&&e.setAttribute("x",i),n&&!e.getAttribute("y")&&e.setAttribute("y",n)}const r=e.querySelector("tspan")||!1;e.textContent="";const s=e.getAttribute("x")||"0",a=i||"1em";n.forEach(((t,i)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(o.textContent=t,n.length>1){if(o.setAttribute("x",s),o.setAttribute("dy",i>=1?a:"0"),r){const e=r.getAttribute("style");e&&o.setAttribute("style",e)}}else 1==n.length&&0==i&&r&&["x","y","style"].forEach((e=>{const t=null==r?void 0:r.getAttribute(e);null!=t&&o.setAttribute(e,t)}));e.appendChild(o)}))}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 _i.load(e)}static fetchText(e,t,i,n){return wi(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:Si.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 wi(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:Si.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,${Si.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;rMath.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class ki{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 Ei=(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},Ai=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),Ei(window,"location-changed",{replace:i})};class Ci{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class Ii{constructor(e){this.rule=e,this.svgElementInfos={}}}class Ti{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 Pi={},Mi={};Mi.click=Mi.mousedown=Mi.mouseup=Mi.mousemove="MouseEvents";let Oi=1;function Li(e){return e._dtId||(e._dtId=Oi++)}function Ni(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function Di(e,t,i,n){const r=Ni(i).e;if(!e._dtId)return!1;const s=Pi[Li(e)],a=function(e,t,i,n){return i=Ni(i),(Pi[Li(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 Bi(e,t,i,n,r,s){const a=Ni(i).e,o=Ni(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const l=Li(e);(Pi[l]||(Pi[l]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const Ri={on(e,t,i,n=null){Bi(e,null,t,i,null,n)},off(e,t,i=null){Di(e,null,t,i)},once(e,t,i){const n=e=>(Ri.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){Bi(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{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())};ji.on(e,"mousedown",n.bind(this)),ji.on(e,"tapstart",n.bind(this)),ji.on(e,"touchstart",n.bind(this),{passive:!0}),ji.on(e,"click",r.bind(this)),ji.on(e,"mouseup",r.bind(this)),ji.on(e,"tapend",r.bind(this)),ji.on(e,"touchend",r.bind(this)),ji.on(e,"tap",s.bind(this)),ji.on(e,"touch",s.bind(this)),ji.on(e,"mouseup",s.bind(this)),ji.on(e,"tapend",s.bind(this)),ji.on(e,"touchend",s.bind(this)),ji.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Fi=$i,Hi=new Set;class Ui{static observe(e){if(Hi.has(e))return;Hi.add(e);let t,i=0;Fi.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))}}class qi{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){this.expression=e.trim();const o=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[o],void 0===this.parsedFunction&&(this.functionBody=this.expression,this.isCodeBlock(this.functionBody)?this.functionBody=this.functionBody.slice(">".length).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[o]=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);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(be(e))}return this.interpreter.exports.result}}qi.cache={},qi.interpreter=new(ye())({ecmaVer:2019,sandBox:!0}),qi.util={color:pe,date:ge};class Wi{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=`${Si.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");Si.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=`${Si.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 Gi=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},zi=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};const Yi=$i;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.37","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Ki=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 B` + */}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(1),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(449),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 _e(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 _e{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 Se(e){return null==e}var ke={isNothing:Se,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Se(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;io&&(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$/,"")},Me=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Oe=["scalar","sequence","mapping"],Ne=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Me.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===Oe.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 Ne)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 Ne))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 Ne))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=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"]}}),Ge=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Ye=/^[-+]?[0-9]+e/,Ke=new Ne("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Ge.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),Ye.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Je=Ve.extend({implicit:[Fe,Ue,We,Ke]}),Xe=Je,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 Ne("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 Ne("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),it="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",nt=new Ne("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;i64)){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>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>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 Ne("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>10),56320+(e-65536&1023))}for(var It=new Array(256),Tt=new Array(256),Pt=0;Pt<256;Pt++)It[Pt]=At(Pt)?1:0,Tt[Pt]=At(Pt);function Mt(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 Ot(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 Nt(e,t){throw Ot(e,t)}function Lt(e,t){e.onWarning&&e.onWarning.call(null,Ot(e,t))}var Dt={YAML:function(e,t,i){var n,r,s;null!==e.version&&Nt(e,"duplication of %YAML directive"),1!==i.length&&Nt(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Nt(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Nt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Lt(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Nt(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],gt.test(n)||Nt(e,"ill-formed tag handle (first argument) of the TAG directive"),pt.call(e.tagMap,n)&&Nt(e,'there is a previously declared suffix for "'+n+'" tag handle'),vt.test(r)||Nt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Nt(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function $t(e,t,i,n){var r,s,a,o;if(t1&&(e.result+=ke.repeat("\n",t-1))}function Ht(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,Nt(e,"tab characters must not be used in indentation")),45===n)&&wt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,Vt(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,Wt(e,t,3,!1,!0),a.push(e.result),Vt(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Nt(e,"bad indentation of a sequence entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt)&&(v&&(a=e.line,o=e.lineStart,c=e.position),Wt(e,t,4,!0,r)&&(v?m=e.result:g=e.result),v||(jt(e,p,d,f,m,g,a,o,c),f=m=g=null),Vt(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Nt(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Nt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Nt(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(xt(s)){do{s=e.input.charCodeAt(++e.position)}while(xt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!bt(s)&&0!==s)}for(;0!==s;){for(Bt(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),bt(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=St(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Nt(e,"expected hexadecimal character");e.result+=Ct(s),e.position++}else Nt(e,"unknown escape sequence");i=n=e.position}else bt(o)?($t(e,i,n,!0),Ut(e,Vt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Ft(e)?Nt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Nt(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&&!wt(n)&&!_t(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Nt(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),pt.call(e.anchorMap,i)||Nt(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],Vt(e,!0,-1),!0}(e)?(g=!0,null===e.tag&&null===e.anchor||Nt(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(wt(h=e.input.charCodeAt(e.position))||_t(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)&&(wt(n=e.input.charCodeAt(e.position+1))||i&&_t(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(wt(n=e.input.charCodeAt(e.position+1))||i&&_t(n))break}else if(35===h){if(wt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Ft(e)||i&&_t(h))break;if(bt(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,Vt(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&&($t(e,r,s,!1),Ut(e,e.line-o),r=s=e.position,a=!1),xt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return $t(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,1===i)&&(g=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=o&&Ht(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&&Nt(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c"),null!==e.result&&u.kind!==e.kind&&Nt(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)):Nt(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 Gt(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))&&(Vt(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&&!wt(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Nt(e,"directive name must not be less than one character in length");0!==r;){for(;xt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!bt(r));break}if(bt(r))break;for(t=e.position;0!==r&&!wt(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&Bt(e),pt.call(Dt,i)?Dt[i](e,i,n):Lt(e,'unknown document directive "'+i+'"')}Vt(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,Vt(e,!0,-1)):a&&Nt(e,"directives end mark is expected"),Wt(e,e.lineIndent-1,4,!1,!0),Vt(e,!0,-1),e.checkLineBreaks&&ft.test(e.input.slice(s,e.position))&&Lt(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ft(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Vt(e,!0,-1)):e.position=55296&&n<=56319&&t+1=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function ui(e){return/^\n* /.test(e)}function pi(e,t,i,n,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==ei.indexOf(t)||ti.test(t)))return 2===e.quotingType?'"'+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 oi(e)&&e!==Qt&&!ai(e)&&45!==e&&63!==e&&58!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&35!==e&&38!==e&&42!==e&&33!==e&&124!==e&&61!==e&&62!==e&&39!==e&&34!==e&&37!==e&&64!==e&&96!==e}(hi(e,0))&&function(e){return!ai(e)&&58!==e}(hi(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!oi(l=hi(e,c)))return 5;m=m&&li(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if(10===(l=hi(e,c)))u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!oi(l))return 5;m=m&&li(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&ui(e)?5:a?2===s?5:2:p?4:3:!m||a||r(e)?2===s?5:2:1}(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i"+di(t,e.indent)+fi(ri(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,mi(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")+mi(l,t),o=i}return a}(t,a),s));case 5:return'"'+function(e){for(var t,i="",n=0,r=0;r=65536?r+=2:r++)n=hi(e,r),!(t=Zt[n])&&oi(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||ii(n);return i}(t)+'"';default:throw new Ce("impossible error: invalid scalar style")}}()}function di(e,t){var i=ui(e)?String(t):"",n="\n"===e[e.length-1];return i+(!n||"\n"!==e[e.length-2]&&"\n"!==e?n?"":"-":"+")+"\n"}function fi(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function mi(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 gi(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function yi(e,t,i,n,r,s,a){e.tag=null,e.dump=i,vi(e,i,!1)||vi(e,i,!0);var o,c=Jt.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;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=si(e,t)),yi(e,t+1,o,!0,c)&&(e.dump&&10===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;n1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),yi(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?gi(e,t-1,e.dump,r):gi(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",e.dump=o+" "+e.dump)}return!0}function bi(e,t){var i,n,r=[],s=[];for(xi(e,r,s),i=0,n=s.length;ie.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(n[0],n[1])}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n");if(n.length>1){const t=e.querySelector("tspan"),i=null==t?void 0:t.getAttribute("x"),n=null==t?void 0:t.getAttribute("y");i&&!e.getAttribute("x")&&e.setAttribute("x",i),n&&!e.getAttribute("y")&&e.setAttribute("y",n)}const r=e.querySelector("tspan")||!1;e.textContent="";const s=e.getAttribute("x")||"0",a=i||"1em";n.forEach(((t,i)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(o.textContent=t,n.length>1){if(o.setAttribute("x",s),o.setAttribute("dy",i>=1?a:"0"),r){const e=r.getAttribute("style");e&&o.setAttribute("style",e)}}else 1==n.length&&0==i&&r&&["x","y","style"].forEach((e=>{const t=null==r?void 0:r.getAttribute(e);null!=t&&o.setAttribute(e,t)}));e.appendChild(o)}))}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 _i.load(e)}static fetchText(e,t,i,n){return Si(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:ki.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 Si(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:ki.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,${ki.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;rMath.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class Ei{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 Ai=(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},Ci=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),Ai(window,"location-changed",{replace:i})};class Ii{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class Ti{constructor(e){this.rule=e,this.svgElementInfos={}}}class Pi{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 Mi={},Oi={};Oi.click=Oi.mousedown=Oi.mouseup=Oi.mousemove="MouseEvents";let Ni=1;function Li(e){return e._dtId||(e._dtId=Ni++)}function Di(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function $i(e,t,i,n){const r=Di(i).e;if(!e._dtId)return!1;const s=Mi[Li(e)],a=function(e,t,i,n){return i=Di(i),(Mi[Li(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 Ri(e,t,i,n,r,s){const a=Di(i).e,o=Di(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=Li(e);(Mi[c]||(Mi[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const ji={on(e,t,i,n=null){Ri(e,null,t,i,null,n)},off(e,t,i=null){$i(e,null,t,i)},once(e,t,i){const n=e=>(ji.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){Ri(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{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())};Vi.on(e,"mousedown",n.bind(this)),Vi.on(e,"tapstart",n.bind(this)),Vi.on(e,"touchstart",n.bind(this),{passive:!0}),Vi.on(e,"click",r.bind(this)),Vi.on(e,"mouseup",r.bind(this)),Vi.on(e,"tapend",r.bind(this)),Vi.on(e,"touchend",r.bind(this)),Vi.on(e,"tap",s.bind(this)),Vi.on(e,"touch",s.bind(this)),Vi.on(e,"mouseup",s.bind(this)),Vi.on(e,"tapend",s.bind(this)),Vi.on(e,"touchend",s.bind(this)),Vi.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Ui=Bi,Hi=new Set;class qi{static observe(e){if(Hi.has(e))return;Hi.add(e);let t,i=0;Ui.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))}}class zi{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){this.expression=e.trim();const o=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[o],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[o]=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);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(be(e))}return this.interpreter.exports.result}}zi.cache={},zi.interpreter=new(ye())({ecmaVer:2019,sandBox:!0}),zi.util={color:pe,date:ge};class Wi{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=`${ki.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");ki.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=`${ki.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 Gi=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},Yi=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 Ki=Bi;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.37","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Ji=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 $`
@@ -122,22 +122,22 @@ const ie=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t) .debug { color: #000000; } - `}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return zi(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 zi(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return zi(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=Si.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 zi(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 Wi(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.37"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage()}catch(e){this.handleError(e)}}))}initMultiPage(){return zi(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return zi(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 zi(this,void 0,void 0,(function*(){if("string"==typeof e){let i;try{i=yield Si.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return _i.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:Si.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 zi(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 zi(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 zi(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;let i="",n=!0;if("string"==typeof e.image)i=Si.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const t of e.image.sizes)if(screen.width>=t.min_width){i=t.location,n=!0===t.cache;break}}else Si.isMobile&&e.image_mobile?(i=e.image_mobile.location,n=!0===e.image_mobile.cache):(i=e.image.location,n=!0===e.image.cache);return{location:i,cache:n}}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 zi(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 Si.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 Si.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?Si.getArray(o):[]}loadFloorplanSvg(e,t,i){var n;return zi(this,void 0,void 0,(function*(){let r;try{r=yield Si.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const s=document.createElement("div");s.innerHTML=r;const a=s.querySelector("svg");if(t&&a.setAttribute("id",t.config.page_id),a.setAttribute("height","100%"),a.setAttribute("width","100%"),a.style.height="100%",a.style.width="100%",a.style.margin="auto",a.style.cursor="default",a.style.opacity="0",a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&i){const e=i.config.page_id,r=i.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement.replaceChildren(a);else{const e=this.floorplanElement.querySelector("#"+r),t=Number.parseFloat(a.getAttribute("height")),i=Number.parseFloat(a.getAttribute("width"));a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${i} ${t}`),a.setAttribute("preserveAspectRatio","xMinYMin meet"),a.setAttribute("height",e.getAttribute("height")),a.setAttribute("width",e.getAttribute("width")),a.setAttribute("x",e.getAttribute("x")),a.setAttribute("y",e.getAttribute("y")),null===(n=e.parentElement)||void 0===n||n.replaceChildren(a)}}else this.floorplanElement.replaceChildren(a);return a}))}loadImage(e,t,i,n,r){return zi(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 zi(this,void 0,void 0,(function*(){e=r?e:Si.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 zi(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield Si.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"),l=Number.parseFloat(o.getAttribute("height")),c=Number.parseFloat(o.getAttribute("width"));if(o.getAttribute("viewBox")||o.setAttribute("viewBox",`0 0 ${c} ${l}`),o.id=t.svgElement.id,o.setAttribute("preserveAspectRatio","xMinYMin meet"),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,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=>{Yi.off(e,"click"),Yi.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}]:[]}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 Ii(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)),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 Ii(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),l=!!e&&new Ti(this,i,n,t,r,e);if(e&&!s&&Yi.on(a,"click",this.onClick.bind(l)),s){const o=!!s&&new Ti(this,i,n,t,r,s);Ui.observe(a),e&&Yi.on(a,"singleClick",this.onClick.bind(l)),Yi.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),Si.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new Ti(this,i,n,t,r,e);Vi.observe(a),Yi.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),Si.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,i){const n=new Ci(t.id,t,t,t.getBBox());return i.svgElementInfos[t.id]=n,n}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 zi(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=Si.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 ${Si.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r)):Si.equal(i.lastState.attributes,n.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${Si.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return zi(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 zi(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))Si.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){if("string"!=typeof e||!qi.isCode(e))return e;try{return qi.evaluate(e,this.hass,this.config,t,i,this.svgElements,this.functions)}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){const r=this.getActionConfigs(e);for(const e of r){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}`):Ei(this,"hass-more-info",{entityId:t});break;case"navigate":this.isDemo?this.notify(`Performing action: ${e.action} ${e.navigation_path}`):Ai(0,e.navigation_path);break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const t=e.same_tab?"_self":"_blank";window.open(e.url_path,t)}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":Ei(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){try{if("object"==typeof e.service_data)for(const n of Object.keys(e.service_data))this.evaluate(e.service_data[n],t,i);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,i):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,l;const c=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,c),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,Si.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,Si.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)),Si.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,Si.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===(l=i.service_data)||void 0===l?void 0:l.shift_y_axis:"1em";Si.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,c)}const t=x,i=this.getActionValue(t,n,c);this.setVariable(x.variable,i,e,!1)}break;case"execute":this.executeServiceData(i,n,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(i,n,e)}}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})`)}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("
");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}`)}};Gi([re({type:String})],Ki.prototype,"examplespath",void 0),Gi([re({type:Object})],Ki.prototype,"hass",void 0),Gi([re({type:String||Object})],Ki.prototype,"_config",void 0),Gi([re({type:Boolean})],Ki.prototype,"isDemo",void 0),Gi([re({type:Boolean})],Ki.prototype,"isShowLog",void 0),Gi([re({type:Function})],Ki.prototype,"notify",void 0),Ki=Gi([ie("floorplan-element")],Ki); + `}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return Yi(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 Yi(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return Yi(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=ki.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 Yi(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 Wi(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.37"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage()}catch(e){this.handleError(e)}}))}initMultiPage(){return Yi(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return Yi(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 Yi(this,void 0,void 0,(function*(){if("string"==typeof e){let i;try{i=yield ki.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return _i.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:ki.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 Yi(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 Yi(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 Yi(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;let i="",n=!0;if("string"==typeof e.image)i=ki.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const t of e.image.sizes)if(screen.width>=t.min_width){i=t.location,n=!0===t.cache;break}}else ki.isMobile&&e.image_mobile?(i=e.image_mobile.location,n=!0===e.image_mobile.cache):(i=e.image.location,n=!0===e.image.cache);return{location:i,cache:n}}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 Yi(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 ki.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 ki.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?ki.getArray(o):[]}loadFloorplanSvg(e,t,i){var n;return Yi(this,void 0,void 0,(function*(){let r;try{r=yield ki.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const s=document.createElement("div");s.innerHTML=r;const a=s.querySelector("svg");if(t&&a.setAttribute("id",t.config.page_id),a.setAttribute("height","100%"),a.setAttribute("width","100%"),a.style.height="100%",a.style.width="100%",a.style.margin="auto",a.style.cursor="default",a.style.opacity="0",a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&i){const e=i.config.page_id,r=i.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement.replaceChildren(a);else{const e=this.floorplanElement.querySelector("#"+r),t=Number.parseFloat(a.getAttribute("height")),i=Number.parseFloat(a.getAttribute("width"));a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${i} ${t}`),a.setAttribute("preserveAspectRatio","xMinYMin meet"),a.setAttribute("height",e.getAttribute("height")),a.setAttribute("width",e.getAttribute("width")),a.setAttribute("x",e.getAttribute("x")),a.setAttribute("y",e.getAttribute("y")),null===(n=e.parentElement)||void 0===n||n.replaceChildren(a)}}else this.floorplanElement.replaceChildren(a);return a}))}loadImage(e,t,i,n,r){return Yi(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 Yi(this,void 0,void 0,(function*(){e=r?e:ki.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 Yi(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield ki.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"),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,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=>{Ki.off(e,"click"),Ki.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}]:[]}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 Ti(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)),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 Ti(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 Pi(this,i,n,t,r,e);if(e&&!s&&Ki.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new Pi(this,i,n,t,r,s);qi.observe(a),e&&Ki.on(a,"singleClick",this.onClick.bind(c)),Ki.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),ki.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new Pi(this,i,n,t,r,e);Fi.observe(a),Ki.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),ki.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,i){const n=new Ii(t.id,t,t,t.getBBox());return i.svgElementInfos[t.id]=n,n}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 Yi(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=ki.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 ${ki.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r)):ki.equal(i.lastState.attributes,n.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${ki.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return Yi(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 Yi(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))ki.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){if("string"!=typeof e||!zi.isCode(e))return e;try{return zi.evaluate(e,this.hass,this.config,t,i,this.svgElements,this.functions)}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){const r=this.getActionConfigs(e);for(const e of r){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}`):Ai(this,"hass-more-info",{entityId:t});break;case"navigate":this.isDemo?this.notify(`Performing action: ${e.action} ${e.navigation_path}`):Ci(0,e.navigation_path);break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const t=e.same_tab?"_self":"_blank";window.open(e.url_path,t)}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":Ai(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){try{if("object"==typeof e.service_data)for(const n of Object.keys(e.service_data))this.evaluate(e.service_data[n],t,i);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,i):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,ki.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,ki.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)),ki.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,ki.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";ki.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);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(i,n,e)}}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})`)}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("
");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}`)}};Gi([re({type:String})],Ji.prototype,"examplespath",void 0),Gi([re({type:Object})],Ji.prototype,"hass",void 0),Gi([re({type:String||Object})],Ji.prototype,"_config",void 0),Gi([re({type:Boolean})],Ji.prototype,"isDemo",void 0),Gi([re({type:Boolean})],Ji.prototype,"isShowLog",void 0),Gi([re({type:Function})],Ji.prototype,"notify",void 0),Ji=Gi([ie("floorplan-element")],Ji); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const Ji=e=>(...t)=>({_$litDirective$:e,values:t});class Xi{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)}} +const Xi=e=>(...t)=>({_$litDirective$:e,values:t});class Qi{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 Qi=Ji(class extends Xi{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 Zi,en=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 tn=Zi=class extends ee{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?B` + */const Zi=Xi(class extends Qi{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 en,tn=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 nn=en=class extends ee{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?$` - ${this.isDisplayCardHeader?B`

${null===(e=this.config)||void 0===e?void 0:e.title}

`:""} + ${this.isDisplayCardHeader?$`

${null===(e=this.config)||void 0===e?void 0:e.title}

`:""} -
+
(...t)=>({_$litDirective$:e,values:t});class Xi{constructor(e){}get >
- `:B``}static get styles(){return a` + `:$``}static get styles(){return a` /* header (main toolbar) */ /* --header-height: 56px; */ @@ -161,7 +161,7 @@ const Ji=e=>(...t)=>({_$litDirective$:e,values:t});class Xi{constructor(e){}get 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=ki.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?Zi.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)}};tn.cardHeaderHeight=76,en([re({type:Object})],tn.prototype,"hass",void 0),en([re({type:Boolean})],tn.prototype,"isPanel",void 0),en([re({type:Boolean})],tn.prototype,"editMode",void 0),en([re({type:Object})],tn.prototype,"config",void 0),en([re({type:String})],tn.prototype,"examplespath",void 0),en([re({type:Boolean})],tn.prototype,"isDemo",void 0),en([re({type:Function})],tn.prototype,"notify",void 0),tn=Zi=en([ie("floorplan-card")],tn);var nn,rn=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 sn=nn=class extends ee{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return B` + `}get isFullHeight(){var e;return null===(e=this.config)||void 0===e?void 0:e.full_height}get view(){return this._view||(this._view=Ei.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?en.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)}};nn.cardHeaderHeight=76,tn([re({type:Object})],nn.prototype,"hass",void 0),tn([re({type:Boolean})],nn.prototype,"isPanel",void 0),tn([re({type:Boolean})],nn.prototype,"editMode",void 0),tn([re({type:Object})],nn.prototype,"config",void 0),tn([re({type:String})],nn.prototype,"examplespath",void 0),tn([re({type:Boolean})],nn.prototype,"isDemo",void 0),tn([re({type:Function})],nn.prototype,"notify",void 0),nn=en=tn([ie("floorplan-card")],nn);var rn,sn=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 an=rn=class extends ee{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return $` @@ -171,7 +171,7 @@ const Ji=e=>(...t)=>({_$litDirective$:e,values:t});class Xi{constructor(e){}get -
+
@@ -190,13 +190,13 @@ const Ji=e=>(...t)=>({_$litDirective$:e,values:t});class Xi{constructor(e){}get [hidden] { display: none !important; } - `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?nn.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)}};sn.appHeaderHeight=64,rn([re({type:Object})],sn.prototype,"hass",void 0),rn([re({type:Boolean})],sn.prototype,"narrow",void 0),rn([re({type:Object})],sn.prototype,"panel",void 0),rn([re({type:Boolean})],sn.prototype,"showSideBar",void 0),rn([re({type:Boolean})],sn.prototype,"showAppHeader",void 0),rn([re({type:String})],sn.prototype,"examplespath",void 0),rn([re({type:Boolean})],sn.prototype,"isDemo",void 0),rn([re({type:Function})],sn.prototype,"notify",void 0),sn=nn=rn([ie("floorplan-panel")],sn); + `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?rn.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)}};an.appHeaderHeight=64,sn([re({type:Object})],an.prototype,"hass",void 0),sn([re({type:Boolean})],an.prototype,"narrow",void 0),sn([re({type:Object})],an.prototype,"panel",void 0),sn([re({type:Boolean})],an.prototype,"showSideBar",void 0),sn([re({type:Boolean})],an.prototype,"showAppHeader",void 0),sn([re({type:String})],an.prototype,"examplespath",void 0),sn([re({type:Boolean})],an.prototype,"isDemo",void 0),sn([re({type:Function})],an.prototype,"notify",void 0),an=rn=sn([ie("floorplan-panel")],an); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class an extends Xi{constructor(e){if(super(e),this.it=$,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===$||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:[]}}}an.directiveName="unsafeHTML",an.resultType=1;const on=Ji(an);var ln=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 cn=class extends ee{constructor(){super(...arguments),this.lang="",this.code=""}render(){return B`
${on(this.code)}
`}static get styles(){return a` +class on extends Qi{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:[]}}}on.directiveName="unsafeHTML",on.resultType=1;const cn=Xi(on);var ln=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 hn=class extends ee{constructor(){super(...arguments),this.lang="",this.code=""}render(){return $`
${cn(this.code)}
`}static get styles(){return a` .hljs { display: block; overflow-x: auto; @@ -285,16 +285,16 @@ class an extends Xi{constructor(e){if(super(e),this.it=$,2!==e.type)throw Error( .hljs-strong { font-weight: bold; } - `}};ln([re({type:String})],cn.prototype,"lang",void 0),ln([re({type:String})],cn.prototype,"code",void 0),cn=ln([ie("code-block")],cn);var 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 un=class extends ee{render(){return B` + `}};ln([re({type:String})],hn.prototype,"lang",void 0),ln([re({type:String})],hn.prototype,"code",void 0),hn=ln([ie("code-block")],hn);var un=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 pn=class extends ee{render(){return $`
- ${this.example.isCard?B``:B` `:$`
- `}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{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}l((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 Si.fetchText(e,!0,this.examplespath,!1);if(this.config=Si.parseYaml(t),this.configYaml=t,this.example.simulationFile){const e=`${this.examplespath}/${this.example.dir}/${this.example.simulationFile}`,t=yield Si.fetchText(e,!0,this.examplespath,!1),i=Si.parseYaml(t);this.simulator=new _e(i,this.setHass.bind(this))}}}))}setHass(e){this.hass=e}};hn([re({type:Object})],un.prototype,"hass",void 0),hn([re({type:Object})],un.prototype,"config",void 0),hn([re({type:String})],un.prototype,"configYaml",void 0),hn([re({type:String})],un.prototype,"examplespath",void 0),hn([re({type:Object})],un.prototype,"example",void 0),hn([re({type:Boolean})],un.prototype,"isDemo",void 0),hn([re({type:Function})],un.prototype,"notify",void 0),un=hn([ie("floorplan-example")],un);var pn=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 dn=class extends ee{constructor(){super(),this._toastText=""}render(){return B`
${this._toastText}
`}static get styles(){return a` + `}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 ki.fetchText(e,!0,this.examplespath,!1);if(this.config=ki.parseYaml(t),this.configYaml=t,this.example.simulationFile){const e=`${this.examplespath}/${this.example.dir}/${this.example.simulationFile}`,t=yield ki.fetchText(e,!0,this.examplespath,!1),i=ki.parseYaml(t);this.simulator=new we(i,this.setHass.bind(this))}}}))}setHass(e){this.hass=e}};un([re({type:Object})],pn.prototype,"hass",void 0),un([re({type:Object})],pn.prototype,"config",void 0),un([re({type:String})],pn.prototype,"configYaml",void 0),un([re({type:String})],pn.prototype,"examplespath",void 0),un([re({type:Object})],pn.prototype,"example",void 0),un([re({type:Boolean})],pn.prototype,"isDemo",void 0),un([re({type:Function})],pn.prototype,"notify",void 0),pn=un([ie("floorplan-example")],pn);var dn=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=class extends ee{constructor(){super(),this._toastText=""}render(){return $`
${this._toastText}
`}static get styles(){return a` :host { display: none; justify-content: center; @@ -380,8 +380,8 @@ class an extends Xi{constructor(e){if(super(e),this.it=$,2!==e.type)throw Error( 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))}};pn([re({type:String})],dn.prototype,"_toastText",void 0),dn=pn([ie("lit-toast")],dn);var fn=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 mn=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 B` - ${null===(e=this.examples)||void 0===e?void 0:e.map((e=>B` {this.className=this.className.replace("show","")}),3e3))}};dn([re({type:String})],fn.prototype,"_toastText",void 0),fn=dn([ie("lit-toast")],fn);var mn=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(),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=>$` `))} - `}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)}};fn([re({type:String})],mn.prototype,"examplespath",void 0),fn([re({type:Array})],mn.prototype,"examples",void 0),mn=fn([ie("floorplan-examples")],mn)})()})(); \ No newline at end of file + `}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)}};mn([re({type:String})],gn.prototype,"examplespath",void 0),mn([re({type:Array})],gn.prototype,"examples",void 0),gn=mn([ie("floorplan-examples")],gn)})()})(); \ No newline at end of file