diff --git a/dist/scheduler-card.js b/dist/scheduler-card.js index d85ba9cf..52274e51 100644 --- a/dist/scheduler-card.js +++ b/dist/scheduler-card.js @@ -169,8 +169,7 @@ const W=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t) found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol();class ee{constructor(e,t){if(t!==X)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(Z?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const te=(e,...t)=>{const r=t.reduce((t,r,i)=>t+(e=>{if(e instanceof ee)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(r)+e[i+1],e[0]);return new ee(r,X)}; + */const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol();class ee{constructor(e,t){if(t!==X)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(Z?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const te=(e,...t)=>{const r=t.reduce((t,r,i)=>t+(e=>{if(e instanceof ee)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(r)+e[i+1],e[0]);return new ee(r,X)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -184,9 +183,9 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const re={};class ie extends G{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,r)=>e.reduceRight((e,r)=>Array.isArray(r)?t(r,e):(e.add(r),e),r),r=t(e,new Set),i=[];r.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!Z){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new ee(String(t),X)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Z?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==re&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return re}}ie.finalized=!0,ie.render=(e,t,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const s=r.scopeName,a=R.has(t),n=L&&11===t.nodeType&&!!t.host,o=n&&!q.has(s),c=o?document.createDocumentFragment():t;if(((e,t,r)=>{let s=R.get(t);void 0===s&&(i(t,t.firstChild),R.set(t,s=new $(Object.assign({templateFactory:T},r))),s.appendInto(t)),s.setValue(e),s.commit()})(e,c,Object.assign({templateFactory:V(s)},r)),o){const e=R.get(c);R.delete(c);const r=e.value instanceof _?e.value.template:void 0;H(s,c,r),i(t,t.firstChild),t.appendChild(c),R.set(t,e)}!a&&n&&window.ShadyCSS.styleElement(t.host)};var se=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ae="[^\\s]+",ne=/\[([^]*?)\]/gm;function oe(e,t){for(var r=[],i=0,s=e.length;i-1?i:null}};function le(e){for(var t=[],r=1;r3?0:(e-e%10!=10?1:0)*e%10]}},me=le({},pe),ve=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length0?"-":"+")+ve(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+ve(Math.floor(Math.abs(t)/60),2)+":"+ve(Math.abs(t)%60,2)}},ge=function(e){return+e-1},ye=[null,"[1-9]\\d?"],_e=[null,ae],be=["isPm",ae,function(e,t){var r=e.toLowerCase();return r===t.amPm[0]?0:r===t.amPm[1]?1:null}],we=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var r=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?r:-r}return 0}],Ee=(ce("monthNamesShort"),ce("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var Pe=function(e,t,r){if(void 0===t&&(t=Ee.default),void 0===r&&(r={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var i=[];t=(t=Ee[t]||t).replace(ne,(function(e,t){return i.push(t),"@@@"}));var s=le(le({},me),r);return(t=t.replace(se,(function(t){return fe[t](e,s)}))).replace(/@@@/g,(function(){return i.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}})(),function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}}();function Se(e){return e.substr(0,e.indexOf("."))}function ke(e){return e.substr(e.indexOf(".")+1)}var xe,$e,Oe,je=function(e,t,r,i){i=i||{},r=null==r?{}:r;var s=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return s.detail=r,e.dispatchEvent(s),s};!function(e){e.Level="LEVEL",e.List="LIST"}(xe||(xe={})),function(e){e.Equal="is",e.Unequal="not",e.Below="below",e.Above="above"}($e||($e={})),function(e){e.Any="or",e.All="and"}(Oe||(Oe={}));var Ce={add:"přidat plán",cancel:"zrušit",next:"další",save:"uložit",delete:"smazat"},De={no_group_selected:"Vyberte skupinu",no_entity_selected:"Vyberte entitu",no_groups_defined:"Nejsou definovány žádné skupiny",no_entities_for_group:"V této skupině nejsou žádné entity",no_actions_for_entity:"Pro tuto entitu neexistují žádné akce",no_entries_defined:"Nejsou žádné položky k zobrazení"},ze={group:"Skupiny",entity:"Entity",action:"Akce",days:"Dny",time:"Čas",options:"Možnosti",day_type_daily:"denně",day_type_workday:"pracovní dny",day_type_weekend:"víkend",day_type_custom:"možnosti"},Ae={mon:"po",tue:"út",wed:"st",thu:"čt",fri:"pá",sat:"so",sun:"ne"},Te={mon:"Pondělí",tue:"Úterý",wed:"Středa",thu:"Čtvrtek",fri:"Pátek",sat:"Sobota",sun:"Neděle"},Ne={and:"a",before:"před",after:"po"},Re={turn_on:"zapnout",turn_on_brightness:"zapnout {at brightness}",turn_off:"vypnout",close_cover:"zavřít",open_cover:"otevřít",set_temperature:"nastavená teplota {to temperature}",set_temperature_hvac_mode_heat:"topení {to temperature}",set_temperature_hvac_mode_cool:"chlazení {to temperature}",set_cover_position:"nastavit pozici {to position}",set_hvac_mode:"nastavit režim {to hvac_mode}",set_hvac_mode_hvac_mode_off:"vypnout",set_preset_mode:"předvolba {to preset_mode}",set_value:"nastavená hodnota {to value}",select_option:"vyberte možnost {option}",select_source:"vyberte zdroj {source}",start:"start",run_script:"běží"},Fe={brightness:"jas",temperature:"teplota",position:"pozice",hvac_mode:"režim",preset_mode:"přednastavení"},Ie={camera:"kamery",climate:"klima",cover:"kryty",fan:"ventilátory",group:"skupiny",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"světla",media_player:"media přehrávače",scene:"scény",switch:"spínače",vacuum:"vysavače"},Me={tomorrow:"zítra",daily:"denně",daily_except_days:"každý den kromě {days}",working_days:"pracovní dny",weekend:"víkend",interval:"{startDay} do {endDay}"},Le={absolute:"o {time}",relative:"za {time}",interval:"od {startTime} do {endTime}",seconds:"{seconds} vteřin",hour:"1 hodina",hours:"{hours} hodin",minute:"1 minuta",minutes:"{minutes} minut",now:"nyní",midnight:"půlnoc",noon:"poledne",at_sun_event:"při {sunEvent}",sun_event_sunrise:"svítání",sun_event_sunset:"západu slunce"},Ve={one_additional_task:"1 další úkol",x_additional_tasks:"{count} úkolů"},Ue={scheduler:"Plánovač",actions:Ce,instructions:De,fields:ze,days_short:Ae,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve},qe=Object.freeze({__proto__:null,scheduler:"Plánovač",actions:Ce,instructions:De,fields:ze,days_short:Ae,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve,default:Ue}),He={add:"hinzufügen",cancel:"abbrechen",next:"weiter",save:"speichern",delete:"löschen"},Qe={no_group_selected:"Wähle zuerst eine Gruppe aus",no_entity_selected:"Wähle zuerst eine Entity aus",no_groups_defined:"Es gibt keine Gruppe",no_entities_for_group:"Es gibt keine Entities in dieser Gruppe",no_actions_for_entity:"Es gibt keine Aktionen für diese Entity",no_entries_defined:"Es gibt keine Einträge"},Be={group:"Gruppe",entity:"Entity",action:"Aktion",days:"Tage",time:"Zeit",options:"Optionen",day_type_daily:"jeden Tag",day_type_workday:"Werktags",day_type_weekend:"Wochenende",day_type_custom:"benutzerdefiniert"},Ke={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"},Ge={mon:"Montag",tue:"Dienstag",wed:"Mittwoch",thu:"Donnerstag",fri:"Freitag",sat:"Samstag",sun:"Sonntag"},We={and:"und",before:"vor",after:"nach"},Ye={turn_on:"anschalten",turn_on_brightness:"anschalten {auf brightness}",turn_off:"ausschalten",close_cover:"schließen",open_cover:"öffnen",set_temperature:"Temperatur einstellen {auf temperature}",set_temperature_hvac_mode_heat:"aufwärmen {auf temperature}",set_temperature_hvac_mode_cool:"kühlen {auf temperature}",set_cover_position:"Position setzen {nach position}",set_hvac_mode:"Modus setzen {zu hvac_mode}",set_hvac_mode_hvac_mode_off:"ausschalten",set_preset_mode:"Voreinstellung setzen {zu preset_mode}",set_value:"Wert setzen {zu value}",select_option:"Option {option} auswählen",select_source:"Quelle {source} auswählen",start:"start",run_script:"ausführen"},Je={brightness:"Helligkeit",temperature:"Temperatur",position:"Position",hvac_mode:"Modus",preset_mode:"Voreinstellung"},Ze={camera:"Kameras",climate:"Heizung",cover:"Beschattung",fan:"Lüfter",group:"Gruppen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"Licht",media_player:"Media Player",scene:"Szene",switch:"Schalter",vacuum:"Staubsauger"},Xe={tomorrow:"morgen",daily:"täglich",daily_except_days:"täglich außer {days}",working_days:"Werktags",weekend:"Wochenende",interval:"{startDay} bis {endDay}"},et={absolute:"um {time}",relative:"in {time}",interval:"von {startTime} bis {endTime}",seconds:"{seconds} Sekunden",hour:"1 Stunde",hours:"{hours} Stunden",minute:"1 Minute",minutes:"{minutes} Minuten",now:"jetzt",midnight:"Mitternacht",noon:"Mittag",at_sun_event:"am {sunEvent}",sun_event_sunrise:"Sonnenaufgang",sun_event_sunset:"Sonnenuntergang"},tt={one_additional_task:"1 weitere Aufgabe",x_additional_tasks:"{count} weitere Aufgaben"},rt={scheduler:"Zeitplaner",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt},it=Object.freeze({__proto__:null,scheduler:"Zeitplaner",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt,default:rt}),st={add:"add item",cancel:"cancel",next:"next",save:"save",delete:"delete"},at={no_group_selected:"Select a group first",no_entity_selected:"Select an entity first",no_groups_defined:"There are no groups defined",no_entities_for_group:"There are no entities in this group",no_actions_for_entity:"There are no actions for this entity",no_entries_defined:"There are no items to show"},nt={group:"Group",entity:"Entity",action:"Action",days:"Days",time:"Time",options:"Options",day_type_daily:"daily",day_type_workday:"workdays",day_type_weekend:"weekend",day_type_custom:"custom"},ot={mon:"mon",tue:"tue",wed:"wed",thu:"thu",fri:"fri",sat:"sat",sun:"sun"},ct={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},lt={and:"and",before:"before",after:"after"},dt={turn_on:"turn on",turn_on_brightness:"turn on {at brightness}",turn_off:"turn off",close_cover:"close",open_cover:"open",set_temperature:"set temperature {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"set position {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ut={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},ht={camera:"cameras",climate:"climate",cover:"covers",fan:"fans",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lights",media_player:"media players",scene:"scenes",switch:"switches",vacuum:"vacuum"},pt={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},mt={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},vt={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},ft={scheduler:"Scheduler",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt},gt=Object.freeze({__proto__:null,scheduler:"Scheduler",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt,default:ft}),yt={add:"Agregar",cancel:"cancelar",next:"siguiente",save:"guardar",delete:"borrar"},_t={no_group_selected:"Selecciona un grupo primero",no_entity_selected:"Selecciona una entidad primero",no_groups_defined:"No hay grupos definidos",no_entities_for_group:"No hay entidades en este grupo",no_actions_for_entity:"No hay acciones para esta entidad",no_entries_defined:"No hay dispositivos definidos"},bt={group:"Grupo",entity:"Entidad",action:"Acción",days:"Días",time:"Hora",options:"Opciones",day_type_daily:"cada día",day_type_weekdays:"dias semanales",day_type_weekend:"fin de semana",day_type_custom:"personalizado"},wt={mon:"lun",tue:"mar",wed:"mie",thu:"jue",fri:"vie",sat:"sab",sun:"dom"},Et={mon:"lunes",tue:"martes",wed:"miércoles",thu:"jueves",fri:"viernes",sat:"sábado",sun:"domingo"},Pt={and:"y",before:"antes",after:"después"},St={turn_on:"encender",turn_on_brightness:"encender {a brightness}",turn_off:"apagar",close_cover:"cerrar",open_cover:"abrir",set_temperature:"establecer temperatura {a temperature}",set_temperature_hvac_mode_heat:"calentar {a temperature}",set_temperature_hvac_mode_cool:"enfriar {a temperature}",set_to:"establecer a",set_cover_position:"establecer posición {a position}",set_hvac_mode:"establecer modo {a hvac_mode}",set_hvac_mode_hvac_mode_off:"apagar",set_preset_mode:"establecer modo {a preset_mode}",set_value:"establecer valor {value}",select_option:"seleccionar opción {option}",select_source:"seleccionar fuente {source}",start:"empezar",run_script:"ejecutar"},kt={brightness:"brillo",temperature:"temperatura",position:"posición",hvac_mode:"modo",preset_mode:"pre-ajuste"},xt={camera:"cámaras",climate:"climatización",cover:"persiana",fan:"ventilador",group:"grupo",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luces",media_player:"reproductor multimedia",scene:"escena",switch:"interruptor",vacuum:"aspirador"},$t={tomorrow:"mañana",daily:"a diario",daily_except_days:"todos los dias excepto {days}",working_days:"días hábiles",weekend:"fin de semana",interval:"{startDay} a {endDay}"},Ot={absolute:"a las {time}",relative:"en {time}",interval:"desde las {startTime} a las {endTime}",seconds:"{seconds} segundos",hour:"1 hora",hours:"{hours} horas",minute:"1 minuto",minutes:"{minutes} minutos",now:"ahora",midnight:"medianoche",noon:"mediodía",at_sun_event:"al {sunEvent}",sun_event_sunrise:"amanecer",sun_event_sunset:"atardecer"},jt={one_additional_task:"1 tarea más",x_additional_tasks:"{count} tareas más"},Ct={scheduler:"Programador",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt},Dt=Object.freeze({__proto__:null,scheduler:"Programador",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt,default:Ct}),zt={add:"lisa",cancel:"loobu",next:"edasi",save:"salvesta",delete:"kustuta"},At={no_group_selected:"Vali grupp",no_entity_selected:"Vali olem",no_groups_defined:"Gruppe pole määratud",no_entities_for_group:"Antud grupis puuduvad olemid",no_actions_for_entity:"Selles olemis puuduvad tegevused",no_entries_defined:"Pole midagi kuvada"},Tt={group:"Grupp",entity:"Olem",action:"Tegevus",days:"Päevad",time:"Aeg",options:"Suvandid",day_type_daily:"iga päev",day_type_weekdays:"tööpäevadel",day_type_weekend:"nädalavahetus",day_type_custom:"valikuline"},Nt={mon:"E",tue:"T",wed:"K",thu:"N",fri:"R",sat:"L",sun:"P"},Rt={mon:"Esmaspäev",tue:"Teisipäev",wed:"Kolmapäev",thu:"Neljapäev",fri:"Reede",sat:"Laupäev",sun:"Pühapäev"},Ft={and:"ja",before:"enne",after:"pärast"},It={turn_on:"lülita sisse",turn_on_brightness:"turn on {at brightness}",turn_off:"lülita välja",close_cover:"sulge",open_cover:"ava",set_temperature:"määra temperatuur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"seadista asendisse {to position}",set_hvac_mode:"vali töörežiim {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"eelseadistatud {to preset_mode}",set_value:"määra väärtus {value}",select_option:"valikud {option}",select_source:"vali allikas {source}",start:"alusta",run_script:"alusta"},Mt={brightness:"heledus",temperature:"temperatuur",position:"asend",hvac_mode:"töörežiim",preset_mode:"eelseadistus"},Lt={camera:"kaamerad",climate:"kliimaseade",cover:"(akna)katted",fan:"ventilaatorid",group:"grupid",input_boolean:"binaarsisestus",input_number:"arvsisestus",input_select:"sisendivalik",light:"valgustid",media_player:"media players",scene:"stseenid",switch:"lülitid",vacuum:"tolmuimejad"},Vt={tomorrow:"homme",daily:"iga päev",daily_except_days:"iga päev välja arvatud {days}",working_days:"tööpäevadel",weekend:"nädalavahetusel",interval:"{startDay} kuni {endDay}"},Ut={absolute:"kell {time}",relative:"{time} pärast",interval:"alates {startTime} kuni {endTime}",seconds:"{seconds} sekundit",hour:"1 tund",hours:"{hours} tundi",minute:"1 minut",minutes:"{minutes} minutit",now:"kohe",midnight:"keskööl",noon:"keskpäeval",at_sun_event:"{sunEvent}",sun_event_sunrise:"päikesetõusu",sun_event_sunset:"loojangut"},qt={one_additional_task:"veel 1 ajastus",x_additional_tasks:"{count} ajastust"},Ht={scheduler:"Ajastaja",actions:zt,instructions:At,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt},Qt=Object.freeze({__proto__:null,scheduler:"Ajastaja",actions:zt,instructions:At,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt,default:Ht}),Bt={add:"ajouter un item",cancel:"annuler",next:"suivant",save:"sauvegarder",delete:"effacer"},Kt={no_group_selected:"Sélectionner un groupe en premier",no_entity_selected:"Sélectionner une entité en premier",no_groups_defined:"Il n'y a pas de groupe défini",no_entities_for_group:"Il n'y a pas d'entité dans ce groupe",no_actions_for_entity:"Il n'y a pas d'action pour cette entité",no_entries_defined:"Il n'y a pas d'item à afficher"},Gt={group:"Groupe",entity:"Entité",action:"Action",days:"Jours",time:"Temps",options:"Options",day_type_daily:"chaque jour",day_type_weekdays:"en semaine",day_type_weekend:"weekend",day_type_custom:"sur mesure"},Wt={mon:"lun",tue:"mar",wed:"mer",thu:"jeu",fri:"ven",sat:"sam",sun:"dim"},Yt={mon:"lundi",tue:"mardi",wed:"mercredi",thu:"jeudi",fri:"vendredi",sat:"samedi",sun:"dimanche"},Jt={and:"et",before:"avant",after:"après"},Zt={turn_on:"allumer",turn_on_brightness:"allumer {à brightness}",turn_off:"éteindre",close_cover:"fermer",open_cover:"ouvrir",set_temperature:"régler la température {à temperature}",set_temperature_hvac_mode_heat:"heat {à temperature}",set_temperature_hvac_mode_cool:"cool {à temperature}",set_cover_position:"position définie {à position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},Xt={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},er={camera:"cameras",climate:"climat",cover:"contrôleur",fan:"ventilateur",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lumière",media_player:"media players",scene:"scenes",switch:"interrupteurs",vacuum:"aspirateur"},tr={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},rr={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},ir={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},sr={scheduler:"Planificateur",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir},ar=Object.freeze({__proto__:null,scheduler:"Planificateur",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir,default:sr}),nr={add:"új időzítés",cancel:"mégse",next:"tovább",save:"mentés",delete:"törlés"},or={no_group_selected:"Előbb egy csoportot szükséges választani",no_entity_selected:"Előbb egy entitást szükséges választani",no_groups_defined:"Nincsenek deffiniált csoportok",no_entities_for_group:"Ebben a csoportban nem találhatók entitások",no_actions_for_entity:"Ehhez az entitáshoz nem tartoznak műveletek",no_entries_defined:"Nincs megjeleníthető elem"},cr={group:"Csoport",entity:"Entitás",action:"Művelet",days:"Napokon",time:"Időpontban",options:"Opciók",day_type_daily:"minden nap",day_type_workday:"munkanapokon",day_type_weekend:"hétvégén",day_type_custom:"egyedi"},lr={mon:"hét",tue:"ked",wed:"sze",thu:"csü",fri:"pén",sat:"szo",sun:"vas"},dr={mon:"hétfő",tue:"kedd",wed:"szerda",thu:"csütörtök",fri:"péntek",sat:"szombat",sun:"vasárnap"},ur={and:"és",before:"előtt",after:"után"},hr={turn_on:"bekapcsolás",turn_on_brightness:"bekapcsolás {at brightness}",turn_off:"kikapcsolás",close_cover:"zárás",open_cover:"nyitás",set_temperature:"hőmérséklet {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"változtass pozíciót {to position}",set_hvac_mode:"mód beállítása {to hvac_mode}",set_hvac_mode_hvac_mode_off:"kikapcsolás",set_preset_mode:"preset beállítása {to preset_mode}",set_value:"érték beállítása {value}",select_option:"opció kiválasztása {option}",select_source:"forrás kiválasztása {source}",start:"kezdés",run_script:"kezdés"},pr={brightness:"világosság",temperature:"hőmérséklet",position:"pozíció",hvac_mode:"mód",preset_mode:"preset"},mr={camera:"kamera",climate:"termosztát",cover:"redőny",fan:"ventilátor",group:"csoportok",input_boolean:"logikai bemenet",input_number:"szám bemenet",input_select:"legördülő bemenet",light:"lámpa",media_player:"lejátszó",scene:"jelenetek",switch:"kapcsoló",vacuum:"pórszívó"},vr={tomorrow:"holnap",daily:"minden nap",daily_except_days:"minden nap, kivéve {days}",working_days:"munkanapokon",weekend:"hétvégén",interval:"{startDay} - {endDay}"},fr={absolute:"{time}-kor",relative:"{time} múlva",interval:"{startTime} - {endTime}",seconds:"{seconds} másodperc",hour:"1 óra",hours:"{hours} óra",minute:"1 perc",minutes:"{minutes} perc",now:"most",midnight:"éjfél",noon:"dél",at_sun_event:"{sunEvent}kor",sun_event_sunrise:"napfelkelte",sun_event_sunset:"napnyugta"},gr={one_additional_task:"még egy feladat",x_additional_tasks:"még {count} feladat"},yr={scheduler:"Időzítések",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr},_r=Object.freeze({__proto__:null,scheduler:"Időzítések",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr,default:yr}),br={add:"aggiungi oggetto",cancel:"annulla",next:"avanti",save:"salva",delete:"elimina"},wr={no_group_selected:"Seleziona prima un gruppo",no_entity_selected:"Seleziona prima un'entità",no_groups_defined:"Non ci sono gruppi definiti",no_entities_for_group:"Non ci sono entità in questo gruppo",no_actions_for_entity:"Non ci sono azioni per questa entità",no_entries_defined:"Non ci sono oggetti da visualizzare"},Er={group:"Gruppo",entity:"Entità",action:"Azione",days:"Giorni",time:"Ora",options:"Opzioni",day_type_daily:"giornaliero",day_type_workday:"giorni lavorativi",day_type_weekend:"weekend",day_type_custom:"personalizzato"},Pr={mon:"lun",tue:"mar",wed:"mer",thu:"gio",fri:"ven",sat:"sab",sun:"dom"},Sr={mon:"lunedì",tue:"martedì",wed:"mercoledì",thu:"giovedì",fri:"venerdì",sat:"sabato",sun:"domenica"},kr={and:"e",before:"prima",after:"dopo"},xr={turn_on:"accendi",turn_on_brightness:"accendi {at brightness}",turn_off:"spegni",close_cover:"chiudi",open_cover:"apri",set_temperature:"imposta temperatura {to temperature}",set_temperature_hvac_mode_heat:"aumenta {to temperature}",set_temperature_hvac_mode_cool:"diminuisci {to temperature}",set_cover_position:"imposta posizione {to position}",set_hvac_mode:"imposta modalità {to hvac_mode}",set_hvac_mode_hvac_mode_off:"spegni",set_preset_mode:"imposta programmazione {to preset_mode}",set_value:"imposta valore {value}",select_option:"seleziona opzione {option}",select_source:"seleziona sorgente {source}",start:"avvia",run_script:"esegui"},$r={brightness:"luminosità",temperature:"temperatura",position:"posizione",hvac_mode:"modalità",preset_mode:"programmazione"},Or={camera:"telecamere",climate:"clima",cover:"cover",fan:"ventole",group:"gruppi",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luci",media_player:"media player",scene:"scene",switch:"interruttori",vacuum:"aspirapolvere"},jr={tomorrow:"domani",daily:"giornaliero",daily_except_days:"tutti i giorni eccetto {days}",working_days:"giorni lavorativi",weekend:"weekend",interval:"{startDay} a {endDay}"},Cr={absolute:"alle {time}",relative:"entro {time}",interval:"dalle {startTime} alle {endTime}",seconds:"{seconds} secondi",hour:"1 ora",hours:"{hours} ore",minute:"1 minuto",minutes:"{minutes} minuti",now:"ora",midnight:"mezzanotte",noon:"mezzogiorno",at_sun_event:"al {sunEvent}",sun_event_sunrise:"l' alba",sun_event_sunset:"tramonto"},Dr={one_additional_task:"un altro task",x_additional_tasks:"{count} altri task"},zr={scheduler:"Schedulatore",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr},Ar=Object.freeze({__proto__:null,scheduler:"Schedulatore",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr,default:zr}),Tr={add:"Nieuw item",cancel:"annuleren",next:"verder",save:"opslaan",delete:"verwijder"},Nr={no_group_selected:"Selecteer eerst een groep",no_entity_selected:"Selecteer eerst een entiteit",no_groups_defined:"Er zijn geen groepen gedefinieerd",no_entities_for_group:"Deze groep heeft geen entiteiten",no_actions_for_entity:"Deze entiteit heeft geen acties",no_entries_defined:"Er zijn geen items aangemaakt"},Rr={group:"Groep",entity:"Entiteit",action:"Actie",days:"Dagen",time:"Tijdstip",options:"Opties",day_type_daily:"dagelijks",day_type_workday:"werkdagen",day_type_weekend:"weekend",day_type_custom:"anders"},Fr={mon:"ma",tue:"di",wed:"wo",thu:"do",fri:"vr",sat:"za",sun:"zo"},Ir={mon:"maandag",tue:"dinsdag",wed:"woensdag",thu:"donderdag",fri:"vrijdag",sat:"zaterdag",sun:"zondag"},Mr={and:"en",before:"voor",after:"na"},Lr={turn_on:"aanzetten",turn_on_brightness:"aanzetten {op brightness}",turn_off:"uitzetten",close_cover:"sluiten",open_cover:"openen",set_temperature:"temperatuur instellen {naar temperature}",set_temperature_hvac_mode_heat:"verwarmen {naar temperature}",set_temperature_hvac_mode_cool:"koelen {naar temperature}",set_cover_position:"positie instellen {naar position}",set_hvac_mode:"stand aanpassen {naar hvac_mode}",set_hvac_mode_hvac_mode_off:"uitzetten",set_preset_mode:"kies voorinstelling {preset_mode}",set_value:"waarde {value} instellen",select_option:"optie {option} selecteren",select_source:"ingang {source} selecteren",start:"starten",run_script:"uitvoeren"},Vr={brightness:"helderheid",temperature:"temperatuur",position:"positie",hvac_mode:"stand",preset_mode:"voorinstelling"},Ur={camera:"cameras",climate:"verwarming",cover:"zonwering",fan:"ventilatie",group:"groepen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"verlichting",media_player:"mediaspelers",scene:"scènes",switch:"schakelaars",vacuum:"stofzuigers"},qr={tomorrow:"morgen",daily:"dagelijks",daily_except_days:"elke dag behalve {days}",working_days:"op werkdagen",weekend:"in het weekend",interval:"{startDay} t/m {endDay}"},Hr={absolute:"om {time}",relative:"over {time}",interval:"van {startTime} tot {endTime}",seconds:"{seconds} seconden",hour:"1 uur",hours:"{hours} uur",minute:"1 minuut",minutes:"{minutes} minuten",now:"nu",midnight:"middernacht",noon:"12 uur",at_sun_event:"bij {sunEvent}",sun_event_sunrise:"zonsopgang",sun_event_sunset:"zonsondergang"},Qr={one_additional_task:"1 overige taak",x_additional_tasks:"{count} overige taken"},Br={scheduler:"Tijdplanner",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr},Kr=Object.freeze({__proto__:null,scheduler:"Tijdplanner",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr,default:Br}),Gr={add:"legg til",cancel:"avbryt",next:"neste",save:"lagre",delete:"slett"},Wr={no_group_selected:"Velg en gruppe først",no_entity_selected:"Velg en entitet først",no_groups_defined:"Ingen grupper definert",no_entities_for_group:"Det finnes ingen entiteter i denne gruppen",no_actions_for_entity:"Det finnes ingen handlinger for denne entiteten",no_entries_defined:"Det er ingen definerte tidsplaner å vise"},Yr={group:"Gruppe",entity:"Entitet",action:"Handling",days:"Dager",time:"Tid",options:"Valg",day_type_daily:"hver dag",day_type_weekdays:"ukedager",day_type_weekend:"weekend",day_type_custom:"egendefinert"},Jr={mon:"man",tue:"tir",wed:"ons",thu:"tor",fri:"fre",sat:"lør",sun:"søn"},Zr={mon:"mandag",tue:"tirsdag",wed:"onsdag",thu:"torsdag",fri:"fredag",sat:"lørdag",sun:"søndag"},Xr={and:"og",before:"før",after:"etter"},ei={turn_on:"slå på",turn_on_brightness:"slå på {at brightness}",turn_off:"slå av",close_cover:"lukk",open_cover:"åpne",set_temperature:"sett temperatur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"sett posisjon {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"slå av",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ti={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},ri={camera:"cameras",climate:"klima",cover:"cover",fan:"vifter",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"lys",switch:"brytere",vacuum:"støvsugere"},ii={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},si={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},ai={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},ni={scheduler:"Tidsplan",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai},oi=Object.freeze({__proto__:null,scheduler:"Tidsplan",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai,default:ni}),ci={add:"dodaj",cancel:"anuluj",next:"dalej",save:"zapisz",delete:"usuń"},li={no_group_selected:"Najpierw wybierz grupę",no_entity_selected:"Najpierw wybierz encję",no_groups_defined:"Nie ma zdefiniowanych grup",no_entities_for_group:"Nie ma encji w tej grupie",no_actions_for_entity:"Nie ma akcji dla tej encji",no_entries_defined:"Nie ma elementów do pokazania"},di={group:"Grupa",entity:"Encja",action:"Akcja",days:"Dni",time:"Czas",options:"Opcje",day_type_daily:"codziennie",day_type_workday:"dni robocze",day_type_weekend:"weekend",day_type_custom:"niestandardowy"},ui={mon:"pon.",tue:"wt.",wed:"śr.",thu:"czw.",fri:"pt.",sat:"sob.",sun:"niedz."},hi={mon:"poniedziałek",tue:"wtorek",wed:"środa",thu:"czwartek",fri:"piątek",sat:"sobota",sun:"niedziela"},pi={and:"oraz",before:"przed",after:"po"},mi={turn_on:"włącz",turn_on_brightness:"włącz {at brightness}",turn_off:"wyłącz",close_cover:"zamknij",open_cover:"otwórz",set_temperature:"ustaw temperaturę {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ustaw pozycję {to position}",set_hvac_mode:"ustaw tryb {to hvac_mode}",set_hvac_mode_hvac_mode_off:"wyłącz",set_preset_mode:"ustaw preset {preset_mode}",set_value:"ustaw wartość {value}",select_option:"wybierz opcję {option}",select_source:"wybierz źródło {source}",start:"start",run_script:"start"},vi={brightness:"jasność",temperature:"temperatura",position:"pozycja",hvac_mode:"tryb",preset_mode:"preset"},fi={camera:"kamera",climate:"termostat",cover:"roleta",fan:"wentylator",group:"grupa",input_boolean:"wejście logiczne",input_number:"wejście liczbowe",input_select:"wybór wejścia",media_player:"odtwarzacz av",scene:"scena",light:"światło",switch:"włącznik",vacuum:"odkurzacz"},gi={tomorrow:"jutro",daily:"codziennie",daily_except_days:"codziennie za wyjątkiem {days}",working_days:"dni robocze",weekend:"weekend",interval:"{startDay} do {endDay}"},yi={absolute:"o {time}",relative:"za {time}",interval:"od {startTime} do {endTime}",seconds:"{seconds} sekund(a/y)",hour:"1 godzina",hours:"{hours} godzin(y)",minute:"1 minuta",minutes:"{minutes} minut(y)",now:"teraz",midnight:"północ",noon:"południe",at_sun_event:"o {sunEvent}",sun_event_sunrise:"wschodzie",sun_event_sunset:"zachodzie"},_i={one_additional_task:"jeszcze 1 zadanie",x_additional_tasks:"{count} więcej zadań"},bi={scheduler:"Harmonogram",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i},wi=Object.freeze({__proto__:null,scheduler:"Harmonogram",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i,default:bi}),Ei={add:"adicionar item",cancel:"cancelar",next:"próximo",save:"gravar",delete:"apagar"},Pi={no_group_selected:"Selecione um grupo primeiro",no_entity_selected:"Selecione uma entidade primeiro",no_groups_defined:"Não tem grupo definido",no_entities_for_group:"Não tem entidade no grupo",no_actions_for_entity:"Não há ações para esta entidade",no_entries_defined:"Não tem item pra mostar"},Si={group:"Grupo",entity:"Entidade",action:"Ação",days:"Dias",time:"Hora",options:"Opções",day_type_daily:"todos os dias",day_type_weekdays:"dias da semana",day_type_weekend:"final da semana",day_type_custom:"personalizado"},ki={mon:"seg",tue:"ter",wed:"qua",thu:"qui",fri:"sex",sat:"sab",sun:"dom"},xi={mon:"segunda",tue:"terça",wed:"quarta",thu:"quinta",fri:"sexta",sat:"sabádo",sun:"domingo"},$i={and:"e",before:"antes",after:"depois"},Oi={turn_on:"ligar",turn_on_brightness:"ligar {a brightness}",turn_off:"desligar",close_cover:"fechar",open_cover:"abrir",set_temperature:"ajustar temperatura {a temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ajustar posição {a position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ji={brightness:"Brilho",temperature:"Temperatura",position:"Posição",hvac_mode:"mode",preset_mode:"preset"},Ci={camera:"cameras",climate:"ar condicionado",cover:"persiana",fan:"ventilador",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"luz",switch:"interruptor",vacuum:"aspirador"},Di={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},zi={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},Ai={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},Ti={scheduler:"Agenda",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:zi,misc:Ai},Ni=Object.freeze({__proto__:null,scheduler:"Agenda",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:zi,misc:Ai,default:Ti}),Ri={add:"adaugă element",cancel:"abandon",next:"următorul",save:"salvează",delete:"șterge"},Fi={no_group_selected:"Prima dată selectați un grup",no_entity_selected:"Prima dată selectați o entitate",no_groups_defined:"Nu există grupuri definite",no_entities_for_group:"Nu există entități definite în acest grup",no_actions_for_entity:"Nu există acțiuni pentru această entitate",no_entries_defined:"Nu există elemente de afișat"},Ii={group:"Grup",entity:"Entitate",action:"Acțiune",days:"Zile",time:"Timp",options:"Opțiuni",day_type_daily:"zilnic",day_type_workday:"zile lucrătoare",day_type_weekend:"sfârșit de săptămână",day_type_custom:"personalizat"},Mi={mon:"lun",tue:"mar",wed:"mie",thu:"joi",fri:"vin",sat:"sâm",sun:"dum"},Li={mon:"Luni",tue:"Marți",wed:"Miercuri",thu:"Joi",fri:"Vineri",sat:"Sâmbătă",sun:"Duminică"},Vi={and:"și",before:"înainte",after:"după"},Ui={turn_on:"pornire",turn_on_brightness:"pornire {la brightness}",turn_off:"oprire",close_cover:"închidere",open_cover:"deschidere",set_temperature:"setare temperatură {la temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"setare poziție",set_hvac_mode:"setare mod {hvac_mode}",set_hvac_mode_hvac_mode_off:"oprire",set_preset_mode:"setare preset {preset_mode}",set_value:"setare valoare {value}",select_option:"selectare opțiune {option}",select_source:"selectare sursă {source}",start:"start",run_script:"run"},qi={brightness:"intensitate luminoasă",temperature:"temperatură",position:"poziție",hvac_mode:"mod",preset_mode:"preset"},Hi={camera:"camere",climate:"climat",cover:"jaluzele",fan:"ventilatoare",group:"grupuri",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lumini",media_player:"media playere",scene:"scene",switch:"întrerupătpare",vacuum:"aspiratoare"},Qi={tomorrow:"mâine",daily:"zilnic",daily_except_days:"zilnic cu excepția {days}",working_days:"zile lucrătoare",weekend:"sfârșit de săptămână",interval:"{startDay} până la {endDay}"},Bi={absolute:"la {time}",relative:"în {time}",interval:"de la {startTime} la {endTime}",seconds:"{seconds} secunde",hour:"1 oră",hours:"{hours} ore",minute:"1 minut",minutes:"{minutes} minute",now:"acum",midnight:"miezul nopții",noon:"amiază",at_sun_event:"la {sunEvent}",sun_event_sunrise:"răsărit",sun_event_sunset:"apus"},Ki={one_additional_task:"încă o sarcină",x_additional_tasks:"încă {count} sarcini"},Gi={scheduler:"Planificator",actions:Ri,instructions:Fi,fields:Ii,days_short:Mi,days_long:Li,words:Vi,services:Ui,service_parameters:qi,domains:Hi,days:Qi,time:Bi,misc:Ki},Wi={add:"добавить",cancel:"отменить",next:"далее",save:"сохранить",delete:"удалить"},Yi={no_group_selected:"Необходимо выбрать группу",no_entity_selected:"Необходимо выбрать объект",no_groups_defined:"Ни одной группы не создано",no_entities_for_group:"В этой группе нет объектов",no_actions_for_entity:"Для этого объекта нет действий",no_entries_defined:"Объекты отсутствуют"},Ji={group:"Группа",entity:"Объект",action:"Действие",days:"Дни",time:"Время",options:"Опции",day_type_daily:"ежедневно",day_type_weekdays:"по будням",day_type_weekend:"weekend",day_type_custom:"выбрать дни"},Zi={mon:"пн",tue:"вт",wed:"ср",thu:"чт",fri:"пт",sat:"сб",sun:"вс"},Xi={mon:"понедельник",tue:"вторник",wed:"среда",thu:"четверг",fri:"пятница",sat:"суббота",sun:"воскресенье"},es={and:"и",before:"до",after:"после"},ts={turn_on:"включить",turn_on_brightness:"включить {на brightness}",turn_off:"выключить",close_cover:"закрыть",open_cover:"открыть",set_temperature:"задать температуру {к temperature}",set_temperature_hvac_mode_heat:"обогрев {к temperature}",set_temperature_hvac_mode_cool:"охлаждение {к temperature}",set_cover_position:"установить позицию {position}",set_hvac_mode:"установить режим {hvac_mode}",set_hvac_mode_hvac_mode_off:"выключить",set_preset_mode:"выбрать набор настроек {preset_mode}",set_value:"установить значение {value}",select_option:"выбрать вариант {option}",select_source:"выбрать источник {source}",start:"запуск",run_script:"запустить"},rs={brightness:"Яркость",temperature:"Температура",position:"Позицию",hvac_mode:"режим",preset_mode:"предуставновлено"},is={camera:"Камеры",climate:"Климат",cover:"Жалюзи",fan:"Вентиляторы",group:"Группы",input_boolean:"Переключатели",input_number:"Числа",input_select:"Списки",media_player:"Медиаплееры",scene:"Сцены",light:"Освещение",switch:"Выключатели",vacuum:"Пылесосы"},ss={tomorrow:"завтра",daily:"ежедневно",daily_except_days:"каждый день исключая {days}",working_days:"рабочие дни",weekend:"выходные",interval:"{startDay} до {endDay}"},as={absolute:"в {time}",relative:"через {time}",interval:"с {startTime} до {endTime}",seconds:"{seconds} секунд",hour:"1 час",hours:"{hours} часа",minute:"1 минуту",minutes:"{minutes} минут",now:"сейчас",midnight:"полночь",noon:"полдень",at_sun_event:"на {sunEvent}",sun_event_sunrise:"восходе",sun_event_sunset:"закате"},ns={one_additional_task:"1 задача",x_additional_tasks:"{count} задач"},os={scheduler:"Планирование",actions:Wi,instructions:Yi,fields:Ji,days_short:Zi,days_long:Xi,words:es,services:ts,service_parameters:rs,domains:is,days:ss,time:as,misc:ns},cs={cs:qe,de:it,en:gt,es:Dt,et:Qt,es_419:Dt,fr:ar,hu:_r,it:Ar,nb:oi,nl:Kr,nn:oi,no:oi,pl:wi,pt:Ni,pt_BR:Ni,ro:Object.freeze({__proto__:null,scheduler:"Planificator",actions:Ri,instructions:Fi,fields:Ii,days_short:Mi,days_long:Li,words:Vi,services:Ui,service_parameters:qi,domains:Hi,days:Qi,time:Bi,misc:Ki,default:Gi}),ru:Object.freeze({__proto__:null,scheduler:"Планирование",actions:Wi,instructions:Yi,fields:Ji,days_short:Zi,days_long:Xi,words:es,services:ts,service_parameters:rs,domains:is,days:ss,time:as,misc:ns,default:os})};function ls(e,t="",r=""){const i=ds();var s;try{if("test"==i)return"TRANSLATED";s=e.split(".").reduce((e,t)=>e[t],cs[i])}catch(t){s=e.split(".").reduce((e,t)=>e[t],cs.en)}if(void 0===s&&(s=e.split(".").reduce((e,t)=>e[t],cs.en)),""!==t&&""!==r)if(Array.isArray(t)||Array.isArray(r))for(var a=0;a=0?Math.floor(e/60):Math.ceil(e/60),i=e-60*r;return i%t!=0&&(i=Math.round(i/t)*t),i>=60&&(r++,i-=60),r>=24&&(r-=24),60*r+i}function fs(e,t={}){const r=!!t.amPm&&t.amPm,i=!!t.absolute&&t.absolute;e>=1440&&(e-=1440);let s=e>=0?Math.floor(e/60):Math.ceil(e/60);const a=e-60*s;let n="";r&&(n=s>=12?"PM":"AM",(s>12||12==s&&a>0)&&(s-=12));const o=String(Math.abs(s)).padStart(2,"0"),c=String(Math.abs(a)).padStart(2,"0"),l=s<0||a<0;return{hours:o,minutes:c,time:`${l&&!i?"-":""}${o}:${c}${r?" "+n:""}`,signed:l,amPm:n}}function gs(e,t={}){const r=t.stepSize?t.stepSize:1,i=!!t.signed&&t.signed,s=t.max?t.max:1440,a=vs(e,r);return a<0&&!i?e+=1440:a>=1440&&(e-=1440),a<-s?-s:a>s?s:e}function ys(e){let t,r,i;if("object"==typeof e)return ys(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`);if(null!==(i=/^([0-9]{2}):([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else if(null!==(i=/^([0-9]{2})([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else{if(null!==(i=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\+|\-][0-9]{2}:[0-9]{2}$/.exec(e))){const e=new Date(i[0]);return ys(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`)}console.log(`failed to parse timestamp '${e}'`)}return 60*t+r}function _s(e){return e.type==ms.Daily?[1,2,3,4,5,6,7]:e.type==ms.Workday?[1,2,3,4,5]:e.type==ms.Weekend?[6,7]:e.type==ms.Custom?e.custom_days:[]}function bs(e){return e==ps.Sunrise?"sunrise":"sunset"}function ws(e){let t=e.getDay();return 0==t&&(t=7),t}function Es(e,t){const r=new Date,i=Math.round((e.valueOf()-r.valueOf())/1e3);if(i<5)return ls("time.now");if(i<60)return ls("time.relative","{time}",ls("time.seconds","{seconds}",String(i)));if(i<3300){const e=i%60,t=Math.round(i/60);if(e<5||e>55)return ls("time.relative","{time}",1==t?ls("time.minute"):ls("time.minutes","{minutes}",String(t)));if(1==Math.floor(i/60)){const e=Math.round(i-60);return ls("time.relative","{time}",`${ls("time.minute")} ${ls("words.and")} ${ls("time.seconds","{seconds}",String(e))}`)}return ls("time.relative","{time}",ls("time.minutes","{minutes}",String(t)))}if(1==Math.floor(i/3600)){const e=Math.round(i/60-60);return ls("time.relative","{time}",`${ls("time.hour")} ${ls("words.and")} ${ls("time.minutes","{minutes}",String(e))}`)}const s=Math.round(i/3600);if(s<=6)return ls("time.relative","{time}",1==s?ls("time.hour"):ls("time.hours","{hours}",String(s)));const a=new Date;a.setHours(0,0,0,0);const n=Math.floor((e.valueOf()-a.valueOf())/864e5),o=""+fs(ys(e),{amPm:null==t?void 0:t.amPm}).time;return 0==n?12==e.getHours()&&0==e.getMinutes()?ls("time.absolute","{time}",ls("time.noon")):ls("time.absolute","{time}",o):1==n?0==e.getHours()&&0==e.getMinutes()?ls("time.absolute","{time}",ls("time.midnight")):12==e.getHours()&&0==e.getMinutes()?`${ls("days.tomorrow")} ${ls("time.absolute","{time}",ls("time.noon"))}`:`${ls("days.tomorrow")} ${ls("time.absolute","{time}",o)}`:`${function(e){switch(e){case 1:return ls("days_long.mon");case 2:return ls("days_long.tue");case 3:return ls("days_long.wed");case 4:return ls("days_long.thu");case 5:return ls("days_long.fri");case 6:return ls("days_long.sat");case 7:return ls("days_long.sun");default:return""}}(ws(e))} ${ls("time.absolute","{time}",o)}`}!function(e){e.Sunrise="SUNRISE",e.Sunset="SUNSET"}(ps||(ps={})),function(e){e.Daily="DAILY",e.Workday="WORKDAY",e.Weekend="WEEKEND",e.Custom="CUSTOM"}(ms||(ms={}));const Ps=[{id:1,name:ls("days_short.mon")},{id:2,name:ls("days_short.tue")},{id:3,name:ls("days_short.wed")},{id:4,name:ls("days_short.thu")},{id:5,name:ls("days_short.fri")},{id:6,name:ls("days_short.sat")},{id:7,name:ls("days_short.sun")}],Ss=[{id:ms.Daily,name:ls("fields.day_type_daily")},{id:ms.Workday,name:ls("fields.day_type_workday")},{id:ms.Weekend,name:ls("fields.day_type_weekend")},{id:ms.Custom,name:ls("fields.day_type_custom")}];var ks;!function(e){e.Overview="OVERVIEW",e.NewSchedule="NEW_SCHEDULE",e.TimePicker="TIME_PICKER",e.TimeScheme="TIME_SCHEME",e.Options="OPTIONS"}(ks||(ks={}));const xs={service:"turn_on",icon:"power"},$s={service:"turn_off",icon:"power-off"},Os=/^([0-9]+)?D([0-7]+)?T([0-9SRDUW]+)T?([0-9SRDUW]+)?(A[A0-9]+)+(C([C0-9]+))?(F([F0-9]+))?$/,js=/^([0-9]{4})?([SRDUW]{2})([0-9]{4})?$/;function Cs(e){var t,r,i;const s=Os.exec(e),a={time:{value:0},days:{type:ms.Daily},actions:[]};if(s[1])"15"==s[1]?Object.assign(a,{days:{type:ms.Workday}}):"67"==s[1]&&Object.assign(a,{days:{type:ms.Weekend}});else{const e=s[2].split("").map(Number);e.sort(),1==e.length&&0==e[0]||Object.assign(a,{days:{type:ms.Custom,custom_days:e.filter(e=>0!=e)}})}const n=js.exec(s[3]);if(n?Object.assign(a,{time:{event:"SR"==n[2]?ps.Sunrise:ps.Sunset,value:n[1]?-ys(n[1]):ys(n[3])}}):Object.assign(a,{time:{value:ys(s[3])}}),s[4]){const e=js.exec(s[4]);e?Object.assign(a,{endTime:{event:"SR"==e[2]?ps.Sunrise:ps.Sunset,value:e[1]?-ys(e[1]):ys(e[4])}}):Object.assign(a,{endTime:{value:ys(s[4])}})}const o=null===(t=s[5].match(/A[0-9]+/g))||void 0===t?void 0:t.map(e=>Number(e.substring(1)));if(Object.assign(a,{actions:o}),s[6]){let e=null===(r=s[6].match(/C[0-9]+/g))||void 0===r?void 0:r.map(e=>Number(e.substring(1)));1==(null==e?void 0:e.length)&&s[7].length>1?(e=s[7].split("").map(Number),Object.assign(a,{conditions:{type:Oe.All,items:e}})):Object.assign(a,{conditions:{type:Oe.Any,items:e}})}if(s[8]){const e=null===(i=s[8].match(/F[0-9]+/g))||void 0===i?void 0:i.map(e=>Number(e.substring(1)));Object.assign(a,{options:e})}return a}const Ds=["disarmed","armed_away","armed_home","armed_night"];function zs(e){return{type:xe.Level,field:e.field,min:e.min||0,max:e.max||255,step:e.step||1,optional:e.optional||!1,unit:e.unit||""}}function As(e){return{type:xe.List,field:e.field,options:e.options}}function Ts(e,t={}){let r={value:String(e)};return t.icons&&e in t.icons&&(r=Object.assign(Object.assign({},r),{icon:t.icons[e]})),t.name&&(r=Object.assign(Object.assign({},r),{name:t.name})),r}const Ns={heat:"fire",cool:"snowflake",heat_cool:"thermometer",auto:"autorenew",dry:"water-percent",fan_only:"fan"};const Rs=e=>{switch(e.attributes.device_class){case"garage":return"garage";case"door":return"door-closed";case"shutter":return"window-shutter";case"blind":return"blinds";case"window":return"window-closed";default:return"window-shutter"}},Fs=e=>{switch(e.attributes.device_class){case"garage":return"garage-open";case"door":return"door-open";case"shutter":return"window-shutter-open";case"blind":return"blinds-open";case"window":return"window-open";default:return"window-shutter-open"}},Is=["open","closed"],Ms={off:"fan-off",low:"fan-speed-1",medium:"fan-speed-2",high:"fan-speed-3"};const Ls={normal:"account-outline",eco:"leaf",away:"car-traction-control",boost:"rocket-launch-outline",comfort:"car-seat-cooler",home:"home-outline",sleep:"sleep",auto:"autorenew",baby:"baby-bottle-outline"};const Vs=[{service:"unlock",icon:"lock-open-variant-outline"},{service:"lock",icon:"lock-outline"}],Us=["locked","unlocked"];function qs(e){const t=Se(e.entity_id);e.attributes.supported_features;switch(t){case"alarm_control_panel":return(e=>{const t=e.attributes.supported_features;let r=[{service:"alarm_disarm",icon:"lock-open-variant-outline"}];return 1&t&&r.push({service:"alarm_arm_home",icon:"home-outline"}),2&t&&r.push({service:"alarm_arm_away",icon:"exit-run"}),4&t&&r.push({service:"alarm_arm_night",icon:"power-sleep"}),16&t&&r.push({service:"alarm_arm_custom_bypass",icon:"shield-lock-outline"}),r})(e);case"climate":return function(e){const t=e.attributes.supported_features,r=e.attributes.preset_modes,i=e.attributes.hvac_modes,s=i.filter(e=>!["off","heat","cool","heat_cool"].includes(e)),a=zs({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let n=[];return i.includes("off")?n.push({service:"set_hvac_mode",service_data:{hvac_mode:"off"},icon:"power"}):n.push($s),i.includes("heat")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"heat"},variable:a,icon:Ns.heat}),i.includes("cool")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"cool"},variable:a,icon:Ns.cool}),!i.includes("heat")&&!i.includes("cool")&&1&t&&n.push({service:"set_temperature",variable:a,icon:"thermometer"}),i.length>1&&s.length&&n.push({service:"set_hvac_mode",variable:As({field:"hvac_mode",options:s.map(e=>Ts(e,{icons:Ns}))}),icon:"cog-transfer-outline"}),r&&r.length&&16&t&&n.push({service:"set_preset_mode",variable:As({field:"preset_mode",options:r.map(e=>Ts(e))}),icon:"cloud-download-outline"}),n}(e);case"cover":return function(e){const t=e.attributes.supported_features;let r=[{service:"open_cover",icon:Fs(e)},{service:"close_cover",icon:Rs(e)}];return 4&t&&r.push({supported_feature:4,service:"set_cover_position",variable:zs({field:"position",min:0,max:100,unit:"%"}),icon:"ray-vertex"}),r}(e);case"fan":return function(e){const t=e.attributes.supported_features,r=e.attributes.speed_list;let i=[xs,$s];return 1&t&&r&&r.length>1&&i.push({service:"set_speed",variable:As({field:"speed",options:r.map(e=>Ts(e,{icons:Ms}))}),icon:"weather-windy"}),2&t&&i.push({service:"oscillate",variable:As({field:"oscillating",options:[{value:"True"},{value:"False"}]}),icon:"arrow-left-right"}),4&t&&i.push({service:"set_direction",variable:As({field:"direction",options:[{value:"forward"},{value:"reverse"}]}),icon:"cog-clockwise"}),i}(e);case"group":return function(e){return e.attributes.entity_id,[xs,$s]}(e);case"humidifer":return function(e){const t=e.attributes.supported_features,r=e.attributes.available_modes,i=zs({field:"humidity",min:e.attributes.min_humidity,max:e.attributes.max_humidity,step:1,unit:"%"});let s=[];return s.push({service:"set_humidity",variable:i}),r&&r.length>1&&1&t&&s.push({service:"set_mode",variable:As({field:"mode",options:r.map(e=>Ts(e,{icons:Ls}))})}),s}(e);case"input_boolean":return[Object.assign(Object.assign({},xs),{icon:"flash"}),Object.assign(Object.assign({},$s),{icon:"flash-off"})];case"input_number":return function(e){return[{service:"set_value",variable:zs({field:"value",min:Number(e.attributes.min),max:Number(e.attributes.max),step:Number(e.attributes.step)}),icon:"counter"}]}(e);case"input_select":return function(e){const t=e.attributes.options;return t.length<2?[]:[{service:"select_option",variable:As({field:"option",options:t.map(e=>({value:e}))}),icon:"counter"}]}(e);case"light":return function(e){const t=e.attributes.supported_features,r=zs({field:"brightness",min:0,max:255,unit:"%",optional:!0});let i=[];return i.push(Object.assign(Object.assign({},$s),{icon:"lightbulb-off"})),1&t?i.push(Object.assign(Object.assign({},xs),{icon:"lightbulb",variable:r})):i.push(Object.assign(Object.assign({},xs),{icon:"lightbulb"})),i}(e);case"lock":return Vs;case"media_player":return function(e){const t=Array(e.attributes.source_list),r=e.attributes.supported_features;let i=[];return 128&r&&i.push(xs),256&r&&i.push($s),2048&r&&t.length>1&&i.push({service:"select_source",variable:As({field:"source",options:t.map(e=>({value:e}))}),icon:"music-box-multiple-outline"}),i}(e);case"scene":return[Object.assign(Object.assign({},xs),{icon:"play"})];case"script":return function(e){let t=[xs,$s];return t.push({service:ke(e.entity_id),icon:"play",name:ls("services.run_script")}),t}(e);case"switch":return[Object.assign(Object.assign({},xs),{icon:"flash"}),Object.assign(Object.assign({},$s),{icon:"flash-off"})];case"vacuum":return function(e){const t=e.attributes.supported_features;let r=[];return 1&t&&r.push(xs),8192&t&&r.push({service:"start",icon:"play-circle-outline"}),4&t&&r.push({service:"start_pause",icon:"play-circle-outline"}),r}(e);case"water_heater":return function(e){const t=e.attributes.supported_features,r=e.attributes.operation_list,i=zs({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let s=[];return 1&t&&s.push({service:"set_temperature",variable:i,icon:"thermometer"}),2&t&&s.push({service:"set_operation_mode",variable:As({field:"operation_mode",options:r.map(e=>({value:e}))}),icon:"cog-transfer-outline"}),4&t&&s.push({service:"set_away_mode",variable:As({field:"mode",options:[{value:"on",icon:"toggle-switch-outline"},{value:"off",icon:"toggle-switch-off-outline"}]}),icon:"car-traction-control"}),s}(e);default:return[]}}function Hs(e,t){let r=!1;if(e.match(/^[a-z0-9_\.]+$/))r=e.includes(".")?e==t:e==Se(t);else try{if(e.startsWith("/")&&e.endsWith("/")||-1!==e.indexOf("*")){e.startsWith("/")||(e=`/^${e=e.replace(/\./g,".").replace(/\*/g,".*")}$/`);r=new RegExp(e.slice(1,-1)).test(t)}}catch(e){}return r}function Qs(e,t){return!(!t.include||!t.include.length)&&(!(t.include&&!t.include.find(t=>Hs(t,e)))&&(!t.exclude||!t.exclude.find(t=>Hs(t,e))))}const Bs={alarm_control_panel:"alarm-light-outline",automation:"playlist-play",binary_sensor:"radiobox-blank",camera:"camera",climate:"home-thermometer-outline",cover:"window-shutter",device_tracker:"account",fan:"fan",group:"google-circles-communities",humidifier:"air-humidifier",input_boolean:"drawing",input_number:"ray-vertex",input_select:"format-list-bulleted",input_text:"textbox",light:"lightbulb-outline",lock:"lock-open-outline",media_player:"cast-connected",notify:"comment-alert",person:"account-outline",remote:"remote",scene:"palette-outline",script:"file-document",sensor:"eye",switch:"flash",timer:"timer",vacuum:"robot-vacuum",water_heater:"water-boiler"},Ks=e=>{const t=Se(e.entity_id);switch(t){case"binary_sensor":return(e=>{switch(e.attributes.device_class){case"battery":return"battery-outline";case"cold":return"snowflake";case"connectivity":return"server-network";case"door":return"door-closed";case"garage_door":return"hass:garage";case"gas":case"power":case"problem":case"safety":case"smoke":return"shield-check";case"heat":return"fire";case"light":return"brightness-5";case"lock":return"lock";case"moisture":return"water";case"motion":return"walk";case"occupancy":case"presence":return"home-outline";case"opening":return"hass:square";case"plug":return"hass:power-plug-outline";case"sound":return"music-note";case"vibration":return"vibrate";case"window":return"window-closed";default:return"radiobox-blank"}})(e);case"cover":return Rs(e);case"sensor":return(e=>{switch(e.attributes.device_class){case"humidity":return"water-percent";case"illuminance":return"brightness-5";case"temperature":return"thermometer";case"power":return"flash";case"pressure":return"gauge";case"signal_strength":return"wifi";default:return"°C"==e.attributes.unit_of_measurement||"°F"==e.attributes.unit_of_measurement?"thermometer":"eye"}})(e);default:return t in Bs?Bs[t]:"folder-outline"}},Gs=e=>{switch(Se(e.entity_id)){case"alarm_control_panel":return Ds;case"binary_sensor":case"cover":return Is;case"input_boolean":case"switch":return["on","off"];case"lock":return Us;case"person":return["home","not_home"];default:return}};function Ws(e,t){return e?Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Ys(e,t){return e?Object.entries(e).filter(([e])=>!t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Js(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Zs(e){return"string"!=typeof e&&(e=String(e)),Js(e.replace(/_/g," "))}function Xs(e){if(e)return"string"!=typeof e&&(e=String(e)),e.match(/^[a-z]+:[a-z0-9-]+$/i)?e:"hass:"+e}function ea(e){const t=e=>Object.entries(e).sort((e,t)=>e[0]>t[0]?1:-1).map(([e,r])=>[e,"object"==typeof r&&null!==r?t(r):r]).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{});let r=Ws(e,["service","service_data"]);r=t(r);return Object.values(r).map(e=>JSON.stringify(e).replace(/[\W]/g," ").split(" ").filter(e=>" "!=e&&""!=e).join("_")).join("_")}function ta(e){const t=e.service;let r={id:"",name:e.name,icon:e.icon||"flash",service:t};return e.service_data&&Object.keys(e.service_data).length&&Object.assign(r,{service_data:e.service_data}),e.variable&&("options"in e.variable?Object.assign(r,{variable:As(e.variable)}):Object.assign(r,{variable:zs(e.variable)})),Object.assign(r,{id:ea(r)}),r}function ra(e){let t=e.entity,r=e.service;const i=Se(t),s=Se(r);i&&s?i==s&&(r=ke(r)):i||(t=s+"."+t,r=ke(r));let a=Ys(e,["service","entity","service_data"]),n={entity:t,service:r};return a=Object.assign(Object.assign({},a),e.service_data),Object.keys(a).length&&(n=Object.assign(Object.assign({},n),{service_data:a})),n}function ia(e,t){const r=e.actions.map(ta),i=ea(Ys(t,["entity"]));return r.map(e=>{if(e.id==i)return!0;if(e.variable&&t.service_data&&Object.keys(t.service_data).includes(e.variable.field)){let r=Object.entries(t.service_data).filter(([t])=>t!=e.variable.field).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}),i=Object.keys(r).length?Object.assign(Object.assign({},t),{service_data:r}):Ys(t,["service_data"]);return e.id==ea(i)}return!1}).map((e,t)=>e?t:null).filter(e=>null!==e)}function sa(e,t){const r=ia(e,t);return r.length?ta(e.actions[r[0]]):ta(Ys(t,["entity"]))}function aa(e){return e.match(/^switch.schedule_[0-9a-f]{6}$/)}function na(e,t){if(!e)return;const r="string"==typeof e?e:e.entity_id;let i={id:r,name:e.attributes.friendly_name||ke(r),icon:"folder-outline",actions:[]};if((void 0===t.standard_configuration||t.standard_configuration)&&(i=Object.assign(Object.assign({},i),{actions:[...qs(e)],icon:Ks(e),states:Gs(e)})),i=Object.assign(Object.assign({},i),{icon:e.attributes.icon||i.icon}),t.customize){Object.entries(t.customize).filter(([e])=>Hs(e,r)).map(([,e])=>e).forEach(e=>{if(i=Object.assign(Object.assign({},i),Ys(e,["actions","exclude_actions"])),e.actions&&e.actions.forEach(e=>{const t=ia(i,e);let r=i.actions;t.length?r=i.actions.map((r,i)=>t.includes(i)?Object.assign(r,e):r):i.actions.push(e),i=Object.assign(Object.assign({},i),{actions:r})}),e.exclude_actions){let t=e.exclude_actions.map(e=>e.replace(/_/g," ").trim().toLowerCase());i.exclude_actions&&(t=t.concat(i.exclude_actions).filter((e,t,r)=>r.indexOf(e)===t)),i=Object.assign(Object.assign({},i),{exclude_actions:t})}})}return i}function oa(e,t,r){const i="object"==typeof e?e.entity_id:e;if(aa(i))return!1;if(!(Qs(i,t)||t.groups&&t.groups.some(e=>Qs(i,e))))return!1;if(r&&"object"==typeof e){const i=na(e,t);if(!i)return!1;if(r.states&&!i.states)return!1;if(r.actions&&!i.actions.length)return!1}return!0}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ca(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var la=ca((function(e,t){ +(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const re={};class ie extends G{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,r)=>e.reduceRight((e,r)=>Array.isArray(r)?t(r,e):(e.add(r),e),r),r=t(e,new Set),i=[];r.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!Z){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new ee(String(t),X)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Z?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==re&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return re}}ie.finalized=!0,ie.render=(e,t,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const s=r.scopeName,a=R.has(t),n=L&&11===t.nodeType&&!!t.host,o=n&&!q.has(s),c=o?document.createDocumentFragment():t;if(((e,t,r)=>{let s=R.get(t);void 0===s&&(i(t,t.firstChild),R.set(t,s=new $(Object.assign({templateFactory:T},r))),s.appendInto(t)),s.setValue(e),s.commit()})(e,c,Object.assign({templateFactory:V(s)},r)),o){const e=R.get(c);R.delete(c);const r=e.value instanceof _?e.value.template:void 0;H(s,c,r),i(t,t.firstChild),t.appendChild(c),R.set(t,e)}!a&&n&&window.ShadyCSS.styleElement(t.host)};var se=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ae="[^\\s]+",ne=/\[([^]*?)\]/gm;function oe(e,t){for(var r=[],i=0,s=e.length;i-1?i:null}};function le(e){for(var t=[],r=1;r3?0:(e-e%10!=10?1:0)*e%10]}},me=le({},pe),ve=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length0?"-":"+")+ve(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+ve(Math.floor(Math.abs(t)/60),2)+":"+ve(Math.abs(t)%60,2)}},ge=function(e){return+e-1},ye=[null,"[1-9]\\d?"],_e=[null,ae],be=["isPm",ae,function(e,t){var r=e.toLowerCase();return r===t.amPm[0]?0:r===t.amPm[1]?1:null}],we=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var r=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?r:-r}return 0}],Ee=(ce("monthNamesShort"),ce("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var Pe=function(e,t,r){if(void 0===t&&(t=Ee.default),void 0===r&&(r={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var i=[];t=(t=Ee[t]||t).replace(ne,(function(e,t){return i.push(t),"@@@"}));var s=le(le({},me),r);return(t=t.replace(se,(function(t){return fe[t](e,s)}))).replace(/@@@/g,(function(){return i.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}})(),function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}}();function Se(e){return e.substr(0,e.indexOf("."))}function ke(e){return e.substr(e.indexOf(".")+1)}var xe,$e,Oe,je=function(e,t,r,i){i=i||{},r=null==r?{}:r;var s=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return s.detail=r,e.dispatchEvent(s),s};!function(e){e.Level="LEVEL",e.List="LIST"}(xe||(xe={})),function(e){e.Equal="is",e.Unequal="not",e.Below="below",e.Above="above"}($e||($e={})),function(e){e.Any="or",e.All="and"}(Oe||(Oe={}));var Ce={add:"přidat plán",cancel:"zrušit",next:"další",save:"uložit",delete:"smazat"},De={no_group_selected:"Vyberte skupinu",no_entity_selected:"Vyberte entitu",no_groups_defined:"Nejsou definovány žádné skupiny",no_entities_for_group:"V této skupině nejsou žádné entity",no_actions_for_entity:"Pro tuto entitu neexistují žádné akce",no_entries_defined:"Nejsou žádné položky k zobrazení"},ze={group:"Skupiny",entity:"Entity",action:"Akce",days:"Dny",time:"Čas",options:"Možnosti",day_type_daily:"denně",day_type_workday:"pracovní dny",day_type_weekend:"víkend",day_type_custom:"možnosti"},Ae={mon:"po",tue:"út",wed:"st",thu:"čt",fri:"pá",sat:"so",sun:"ne"},Te={mon:"Pondělí",tue:"Úterý",wed:"Středa",thu:"Čtvrtek",fri:"Pátek",sat:"Sobota",sun:"Neděle"},Ne={and:"a",before:"před",after:"po"},Re={turn_on:"zapnout",turn_on_brightness:"zapnout {at brightness}",turn_off:"vypnout",close_cover:"zavřít",open_cover:"otevřít",set_temperature:"nastavená teplota {to temperature}",set_temperature_hvac_mode_heat:"topení {to temperature}",set_temperature_hvac_mode_cool:"chlazení {to temperature}",set_cover_position:"nastavit pozici {to position}",set_hvac_mode:"nastavit režim {to hvac_mode}",set_hvac_mode_hvac_mode_off:"vypnout",set_preset_mode:"předvolba {to preset_mode}",set_value:"nastavená hodnota {to value}",select_option:"vyberte možnost {option}",select_source:"vyberte zdroj {source}",start:"start",run_script:"běží"},Fe={brightness:"jas",temperature:"teplota",position:"pozice",hvac_mode:"režim",preset_mode:"přednastavení"},Ie={camera:"kamery",climate:"klima",cover:"kryty",fan:"ventilátory",group:"skupiny",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"světla",media_player:"media přehrávače",scene:"scény",switch:"spínače",vacuum:"vysavače"},Me={tomorrow:"zítra",daily:"denně",daily_except_days:"každý den kromě {days}",working_days:"pracovní dny",weekend:"víkend",interval:"{startDay} do {endDay}"},Le={absolute:"v {time}",relative:"za {time}",interval:"od {startTime} do {endTime}",seconds:"{seconds} vteřin",hour:"1 hodina",hours:"{hours} hodin",minute:"1 minuta",minutes:"{minutes} minut",now:"nyní",midnight:"půlnoc",noon:"poledne",at_sun_event:"při {sunEvent}",sun_event_sunrise:"svítání",sun_event_sunset:"západu slunce"},Ve={one_additional_task:"1 další úkol",x_additional_tasks:"{count} úkolů"},Ue={scheduler:"Plánovač",actions:Ce,instructions:De,fields:ze,days_short:Ae,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve},qe=Object.freeze({__proto__:null,scheduler:"Plánovač",actions:Ce,instructions:De,fields:ze,days_short:Ae,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve,default:Ue}),He={add:"hinzufügen",cancel:"abbrechen",next:"weiter",save:"speichern",delete:"löschen"},Qe={no_group_selected:"Wähle zuerst eine Gruppe aus",no_entity_selected:"Wähle zuerst eine Entity aus",no_groups_defined:"Es gibt keine Gruppe",no_entities_for_group:"Es gibt keine Entities in dieser Gruppe",no_actions_for_entity:"Es gibt keine Aktionen für diese Entity",no_entries_defined:"Es gibt keine Einträge"},Be={group:"Gruppe",entity:"Entity",action:"Aktion",days:"Tage",time:"Zeit",options:"Optionen",day_type_daily:"jeden Tag",day_type_workday:"Werktags",day_type_weekend:"Wochenende",day_type_custom:"benutzerdefiniert"},Ke={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"},Ge={mon:"Montag",tue:"Dienstag",wed:"Mittwoch",thu:"Donnerstag",fri:"Freitag",sat:"Samstag",sun:"Sonntag"},We={and:"und",before:"vor",after:"nach"},Ye={turn_on:"anschalten",turn_on_brightness:"anschalten {auf brightness}",turn_off:"ausschalten",close_cover:"schließen",open_cover:"öffnen",set_temperature:"Temperatur einstellen {auf temperature}",set_temperature_hvac_mode_heat:"aufwärmen {auf temperature}",set_temperature_hvac_mode_cool:"kühlen {auf temperature}",set_cover_position:"Position setzen {nach position}",set_hvac_mode:"Modus setzen {zu hvac_mode}",set_hvac_mode_hvac_mode_off:"ausschalten",set_preset_mode:"Voreinstellung setzen {zu preset_mode}",set_value:"Wert setzen {zu value}",select_option:"Option {option} auswählen",select_source:"Quelle {source} auswählen",start:"start",run_script:"ausführen"},Je={brightness:"Helligkeit",temperature:"Temperatur",position:"Position",hvac_mode:"Modus",preset_mode:"Voreinstellung"},Ze={camera:"Kameras",climate:"Heizung",cover:"Beschattung",fan:"Lüfter",group:"Gruppen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"Licht",media_player:"Media Player",scene:"Szene",switch:"Schalter",vacuum:"Staubsauger"},Xe={tomorrow:"morgen",daily:"täglich",daily_except_days:"täglich außer {days}",working_days:"Werktags",weekend:"Wochenende",interval:"{startDay} bis {endDay}"},et={absolute:"um {time}",relative:"in {time}",interval:"von {startTime} bis {endTime}",seconds:"{seconds} Sekunden",hour:"1 Stunde",hours:"{hours} Stunden",minute:"1 Minute",minutes:"{minutes} Minuten",now:"jetzt",midnight:"Mitternacht",noon:"Mittag",at_sun_event:"am {sunEvent}",sun_event_sunrise:"Sonnenaufgang",sun_event_sunset:"Sonnenuntergang"},tt={one_additional_task:"1 weitere Aufgabe",x_additional_tasks:"{count} weitere Aufgaben"},rt={scheduler:"Zeitplaner",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt},it=Object.freeze({__proto__:null,scheduler:"Zeitplaner",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt,default:rt}),st={add:"add item",cancel:"cancel",next:"next",save:"save",delete:"delete"},at={no_group_selected:"Select a group first",no_entity_selected:"Select an entity first",no_groups_defined:"There are no groups defined",no_entities_for_group:"There are no entities in this group",no_actions_for_entity:"There are no actions for this entity",no_entries_defined:"There are no items to show"},nt={group:"Group",entity:"Entity",action:"Action",days:"Days",time:"Time",options:"Options",day_type_daily:"daily",day_type_workday:"workdays",day_type_weekend:"weekend",day_type_custom:"custom"},ot={mon:"mon",tue:"tue",wed:"wed",thu:"thu",fri:"fri",sat:"sat",sun:"sun"},ct={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},lt={and:"and",before:"before",after:"after"},dt={turn_on:"turn on",turn_on_brightness:"turn on {at brightness}",turn_off:"turn off",close_cover:"close",open_cover:"open",set_temperature:"set temperature {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"set position {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ut={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},ht={camera:"cameras",climate:"climate",cover:"covers",fan:"fans",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lights",media_player:"media players",scene:"scenes",switch:"switches",vacuum:"vacuum"},pt={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},mt={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},vt={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},ft={scheduler:"Scheduler",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt},gt=Object.freeze({__proto__:null,scheduler:"Scheduler",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt,default:ft}),yt={add:"Agregar",cancel:"cancelar",next:"siguiente",save:"guardar",delete:"borrar"},_t={no_group_selected:"Selecciona un grupo primero",no_entity_selected:"Selecciona una entidad primero",no_groups_defined:"No hay grupos definidos",no_entities_for_group:"No hay entidades en este grupo",no_actions_for_entity:"No hay acciones para esta entidad",no_entries_defined:"No hay dispositivos definidos"},bt={group:"Grupo",entity:"Entidad",action:"Acción",days:"Días",time:"Hora",options:"Opciones",day_type_daily:"cada día",day_type_weekdays:"dias semanales",day_type_weekend:"fin de semana",day_type_custom:"personalizado"},wt={mon:"lun",tue:"mar",wed:"mie",thu:"jue",fri:"vie",sat:"sab",sun:"dom"},Et={mon:"lunes",tue:"martes",wed:"miércoles",thu:"jueves",fri:"viernes",sat:"sábado",sun:"domingo"},Pt={and:"y",before:"antes",after:"después"},St={turn_on:"encender",turn_on_brightness:"encender {a brightness}",turn_off:"apagar",close_cover:"cerrar",open_cover:"abrir",set_temperature:"establecer temperatura {a temperature}",set_temperature_hvac_mode_heat:"calentar {a temperature}",set_temperature_hvac_mode_cool:"enfriar {a temperature}",set_to:"establecer a",set_cover_position:"establecer posición {a position}",set_hvac_mode:"establecer modo {a hvac_mode}",set_hvac_mode_hvac_mode_off:"apagar",set_preset_mode:"establecer modo {a preset_mode}",set_value:"establecer valor {value}",select_option:"seleccionar opción {option}",select_source:"seleccionar fuente {source}",start:"empezar",run_script:"ejecutar"},kt={brightness:"brillo",temperature:"temperatura",position:"posición",hvac_mode:"modo",preset_mode:"pre-ajuste"},xt={camera:"cámaras",climate:"climatización",cover:"persiana",fan:"ventilador",group:"grupo",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luces",media_player:"reproductor multimedia",scene:"escena",switch:"interruptor",vacuum:"aspirador"},$t={tomorrow:"mañana",daily:"a diario",daily_except_days:"todos los dias excepto {days}",working_days:"días hábiles",weekend:"fin de semana",interval:"{startDay} a {endDay}"},Ot={absolute:"a las {time}",relative:"en {time}",interval:"desde las {startTime} a las {endTime}",seconds:"{seconds} segundos",hour:"1 hora",hours:"{hours} horas",minute:"1 minuto",minutes:"{minutes} minutos",now:"ahora",midnight:"medianoche",noon:"mediodía",at_sun_event:"al {sunEvent}",sun_event_sunrise:"amanecer",sun_event_sunset:"atardecer"},jt={one_additional_task:"1 tarea más",x_additional_tasks:"{count} tareas más"},Ct={scheduler:"Programador",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt},Dt=Object.freeze({__proto__:null,scheduler:"Programador",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt,default:Ct}),zt={add:"lisa",cancel:"loobu",next:"edasi",save:"salvesta",delete:"kustuta"},At={no_group_selected:"Vali grupp",no_entity_selected:"Vali olem",no_groups_defined:"Gruppe pole määratud",no_entities_for_group:"Antud grupis puuduvad olemid",no_actions_for_entity:"Selles olemis puuduvad tegevused",no_entries_defined:"Pole midagi kuvada"},Tt={group:"Grupp",entity:"Olem",action:"Tegevus",days:"Päevad",time:"Aeg",options:"Suvandid",day_type_daily:"iga päev",day_type_weekdays:"tööpäevadel",day_type_weekend:"nädalavahetus",day_type_custom:"valikuline"},Nt={mon:"E",tue:"T",wed:"K",thu:"N",fri:"R",sat:"L",sun:"P"},Rt={mon:"Esmaspäev",tue:"Teisipäev",wed:"Kolmapäev",thu:"Neljapäev",fri:"Reede",sat:"Laupäev",sun:"Pühapäev"},Ft={and:"ja",before:"enne",after:"pärast"},It={turn_on:"lülita sisse",turn_on_brightness:"turn on {at brightness}",turn_off:"lülita välja",close_cover:"sulge",open_cover:"ava",set_temperature:"määra temperatuur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"seadista asendisse {to position}",set_hvac_mode:"vali töörežiim {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"eelseadistatud {to preset_mode}",set_value:"määra väärtus {value}",select_option:"valikud {option}",select_source:"vali allikas {source}",start:"alusta",run_script:"alusta"},Mt={brightness:"heledus",temperature:"temperatuur",position:"asend",hvac_mode:"töörežiim",preset_mode:"eelseadistus"},Lt={camera:"kaamerad",climate:"kliimaseade",cover:"(akna)katted",fan:"ventilaatorid",group:"grupid",input_boolean:"binaarsisestus",input_number:"arvsisestus",input_select:"sisendivalik",light:"valgustid",media_player:"media players",scene:"stseenid",switch:"lülitid",vacuum:"tolmuimejad"},Vt={tomorrow:"homme",daily:"iga päev",daily_except_days:"iga päev välja arvatud {days}",working_days:"tööpäevadel",weekend:"nädalavahetusel",interval:"{startDay} kuni {endDay}"},Ut={absolute:"kell {time}",relative:"{time} pärast",interval:"alates {startTime} kuni {endTime}",seconds:"{seconds} sekundit",hour:"1 tund",hours:"{hours} tundi",minute:"1 minut",minutes:"{minutes} minutit",now:"kohe",midnight:"keskööl",noon:"keskpäeval",at_sun_event:"{sunEvent}",sun_event_sunrise:"päikesetõusu",sun_event_sunset:"loojangut"},qt={one_additional_task:"veel 1 ajastus",x_additional_tasks:"{count} ajastust"},Ht={scheduler:"Ajastaja",actions:zt,instructions:At,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt},Qt=Object.freeze({__proto__:null,scheduler:"Ajastaja",actions:zt,instructions:At,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt,default:Ht}),Bt={add:"ajouter un item",cancel:"annuler",next:"suivant",save:"sauvegarder",delete:"effacer"},Kt={no_group_selected:"Sélectionner un groupe en premier",no_entity_selected:"Sélectionner une entité en premier",no_groups_defined:"Il n'y a pas de groupe défini",no_entities_for_group:"Il n'y a pas d'entité dans ce groupe",no_actions_for_entity:"Il n'y a pas d'action pour cette entité",no_entries_defined:"Il n'y a pas d'item à afficher"},Gt={group:"Groupe",entity:"Entité",action:"Action",days:"Jours",time:"Temps",options:"Options",day_type_daily:"chaque jour",day_type_weekdays:"en semaine",day_type_weekend:"weekend",day_type_custom:"sur mesure"},Wt={mon:"lun",tue:"mar",wed:"mer",thu:"jeu",fri:"ven",sat:"sam",sun:"dim"},Yt={mon:"lundi",tue:"mardi",wed:"mercredi",thu:"jeudi",fri:"vendredi",sat:"samedi",sun:"dimanche"},Jt={and:"et",before:"avant",after:"après"},Zt={turn_on:"allumer",turn_on_brightness:"allumer {à brightness}",turn_off:"éteindre",close_cover:"fermer",open_cover:"ouvrir",set_temperature:"régler la température {à temperature}",set_temperature_hvac_mode_heat:"chauffage {à temperature}",set_temperature_hvac_mode_cool:"climatisation {à temperature}",set_cover_position:"position définie {à position}",set_hvac_mode:"choisir le mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"éteindre",set_preset_mode:"choisir le programme {to preset_mode}",set_value:"ajuster {to value}",select_option:"choisir l'option {option}",select_source:"choisir la source {source}",start:"démarrer",run_script:"lancer le script"},Xt={brightness:"luminosité",temperature:"température",position:"position",hvac_mode:"mode",preset_mode:"programme"},er={camera:"caméras",climate:"climat",cover:"contrôleur",fan:"ventilateur",group:"groupe",input_boolean:"sélection logique",input_number:"sélection numérique",input_select:"sélection d'entrée",light:"lumière",media_player:"lecteurs multimédias",scene:"scènes",switch:"interrupteurs",vacuum:"aspirateur"},tr={tomorrow:"demain",daily:"quotidien",daily_except_days:"chaque jour sauf {days}",working_days:"jours de travail",weekend:"fin de semaine",interval:"{startDay} à {endDay}"},rr={absolute:"à {time}",relative:"dans {time}",interval:"de {startTime} à {endTime}",seconds:"{seconds} secondes",hour:"1 heure",hours:"{hours} heures",minute:"1 minute",minutes:"{minutes} minutes",now:"maintenant",midnight:"minuit",noon:"midi",at_sun_event:"à {sunEvent}",sun_event_sunrise:"lever du soleil",sun_event_sunset:"coucher du soleil"},ir={one_additional_task:"1 tâche de plus",x_additional_tasks:"{count} autres tâches"},sr={scheduler:"Planificateur",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir},ar=Object.freeze({__proto__:null,scheduler:"Planificateur",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir,default:sr}),nr={add:"új időzítés",cancel:"mégse",next:"tovább",save:"mentés",delete:"törlés"},or={no_group_selected:"Előbb egy csoportot szükséges választani",no_entity_selected:"Előbb egy entitást szükséges választani",no_groups_defined:"Nincsenek deffiniált csoportok",no_entities_for_group:"Ebben a csoportban nem találhatók entitások",no_actions_for_entity:"Ehhez az entitáshoz nem tartoznak műveletek",no_entries_defined:"Nincs megjeleníthető elem"},cr={group:"Csoport",entity:"Entitás",action:"Művelet",days:"Napokon",time:"Időpontban",options:"Opciók",day_type_daily:"minden nap",day_type_workday:"munkanapokon",day_type_weekend:"hétvégén",day_type_custom:"egyedi"},lr={mon:"hét",tue:"ked",wed:"sze",thu:"csü",fri:"pén",sat:"szo",sun:"vas"},dr={mon:"hétfő",tue:"kedd",wed:"szerda",thu:"csütörtök",fri:"péntek",sat:"szombat",sun:"vasárnap"},ur={and:"és",before:"előtt",after:"után"},hr={turn_on:"bekapcsolás",turn_on_brightness:"bekapcsolás {at brightness}",turn_off:"kikapcsolás",close_cover:"zárás",open_cover:"nyitás",set_temperature:"hőmérséklet {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"változtass pozíciót {to position}",set_hvac_mode:"mód beállítása {to hvac_mode}",set_hvac_mode_hvac_mode_off:"kikapcsolás",set_preset_mode:"preset beállítása {to preset_mode}",set_value:"érték beállítása {value}",select_option:"opció kiválasztása {option}",select_source:"forrás kiválasztása {source}",start:"kezdés",run_script:"kezdés"},pr={brightness:"világosság",temperature:"hőmérséklet",position:"pozíció",hvac_mode:"mód",preset_mode:"preset"},mr={camera:"kamera",climate:"termosztát",cover:"redőny",fan:"ventilátor",group:"csoportok",input_boolean:"logikai bemenet",input_number:"szám bemenet",input_select:"legördülő bemenet",light:"lámpa",media_player:"lejátszó",scene:"jelenetek",switch:"kapcsoló",vacuum:"pórszívó"},vr={tomorrow:"holnap",daily:"minden nap",daily_except_days:"minden nap, kivéve {days}",working_days:"munkanapokon",weekend:"hétvégén",interval:"{startDay} - {endDay}"},fr={absolute:"{time}-kor",relative:"{time} múlva",interval:"{startTime} - {endTime}",seconds:"{seconds} másodperc",hour:"1 óra",hours:"{hours} óra",minute:"1 perc",minutes:"{minutes} perc",now:"most",midnight:"éjfél",noon:"dél",at_sun_event:"{sunEvent}kor",sun_event_sunrise:"napfelkelte",sun_event_sunset:"napnyugta"},gr={one_additional_task:"még egy feladat",x_additional_tasks:"még {count} feladat"},yr={scheduler:"Időzítések",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr},_r=Object.freeze({__proto__:null,scheduler:"Időzítések",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr,default:yr}),br={add:"aggiungi oggetto",cancel:"annulla",next:"avanti",save:"salva",delete:"elimina"},wr={no_group_selected:"Seleziona prima un gruppo",no_entity_selected:"Seleziona prima un'entità",no_groups_defined:"Non ci sono gruppi definiti",no_entities_for_group:"Non ci sono entità in questo gruppo",no_actions_for_entity:"Non ci sono azioni per questa entità",no_entries_defined:"Non ci sono oggetti da visualizzare"},Er={group:"Gruppo",entity:"Entità",action:"Azione",days:"Giorni",time:"Ora",options:"Opzioni",day_type_daily:"giornaliero",day_type_workday:"giorni lavorativi",day_type_weekend:"weekend",day_type_custom:"personalizzato"},Pr={mon:"lun",tue:"mar",wed:"mer",thu:"gio",fri:"ven",sat:"sab",sun:"dom"},Sr={mon:"lunedì",tue:"martedì",wed:"mercoledì",thu:"giovedì",fri:"venerdì",sat:"sabato",sun:"domenica"},kr={and:"e",before:"prima",after:"dopo"},xr={turn_on:"accendi",turn_on_brightness:"accendi {at brightness}",turn_off:"spegni",close_cover:"chiudi",open_cover:"apri",set_temperature:"imposta temperatura {to temperature}",set_temperature_hvac_mode_heat:"aumenta {to temperature}",set_temperature_hvac_mode_cool:"diminuisci {to temperature}",set_cover_position:"imposta posizione {to position}",set_hvac_mode:"imposta modalità {to hvac_mode}",set_hvac_mode_hvac_mode_off:"spegni",set_preset_mode:"imposta programmazione {to preset_mode}",set_value:"imposta valore {value}",select_option:"seleziona opzione {option}",select_source:"seleziona sorgente {source}",start:"avvia",run_script:"esegui"},$r={brightness:"luminosità",temperature:"temperatura",position:"posizione",hvac_mode:"modalità",preset_mode:"programmazione"},Or={camera:"telecamere",climate:"clima",cover:"cover",fan:"ventole",group:"gruppi",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luci",media_player:"media player",scene:"scene",switch:"interruttori",vacuum:"aspirapolvere"},jr={tomorrow:"domani",daily:"giornaliero",daily_except_days:"tutti i giorni eccetto {days}",working_days:"giorni lavorativi",weekend:"weekend",interval:"{startDay} a {endDay}"},Cr={absolute:"alle {time}",relative:"entro {time}",interval:"dalle {startTime} alle {endTime}",seconds:"{seconds} secondi",hour:"1 ora",hours:"{hours} ore",minute:"1 minuto",minutes:"{minutes} minuti",now:"ora",midnight:"mezzanotte",noon:"mezzogiorno",at_sun_event:"al {sunEvent}",sun_event_sunrise:"l' alba",sun_event_sunset:"tramonto"},Dr={one_additional_task:"un altro task",x_additional_tasks:"{count} altri task"},zr={scheduler:"Schedulatore",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr},Ar=Object.freeze({__proto__:null,scheduler:"Schedulatore",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr,default:zr}),Tr={add:"Nieuw item",cancel:"annuleren",next:"verder",save:"opslaan",delete:"verwijder"},Nr={no_group_selected:"Selecteer eerst een groep",no_entity_selected:"Selecteer eerst een entiteit",no_groups_defined:"Er zijn geen groepen gedefinieerd",no_entities_for_group:"Deze groep heeft geen entiteiten",no_actions_for_entity:"Deze entiteit heeft geen acties",no_entries_defined:"Er zijn geen items aangemaakt"},Rr={group:"Groep",entity:"Entiteit",action:"Actie",days:"Dagen",time:"Tijdstip",options:"Opties",day_type_daily:"dagelijks",day_type_workday:"werkdagen",day_type_weekend:"weekend",day_type_custom:"anders"},Fr={mon:"ma",tue:"di",wed:"wo",thu:"do",fri:"vr",sat:"za",sun:"zo"},Ir={mon:"maandag",tue:"dinsdag",wed:"woensdag",thu:"donderdag",fri:"vrijdag",sat:"zaterdag",sun:"zondag"},Mr={and:"en",before:"voor",after:"na"},Lr={turn_on:"aanzetten",turn_on_brightness:"aanzetten {op brightness}",turn_off:"uitzetten",close_cover:"sluiten",open_cover:"openen",set_temperature:"temperatuur instellen {naar temperature}",set_temperature_hvac_mode_heat:"verwarmen {naar temperature}",set_temperature_hvac_mode_cool:"koelen {naar temperature}",set_cover_position:"positie instellen {naar position}",set_hvac_mode:"stand aanpassen {naar hvac_mode}",set_hvac_mode_hvac_mode_off:"uitzetten",set_preset_mode:"kies voorinstelling {preset_mode}",set_value:"waarde {value} instellen",select_option:"optie {option} selecteren",select_source:"ingang {source} selecteren",start:"starten",run_script:"uitvoeren"},Vr={brightness:"helderheid",temperature:"temperatuur",position:"positie",hvac_mode:"stand",preset_mode:"voorinstelling"},Ur={camera:"cameras",climate:"verwarming",cover:"zonwering",fan:"ventilatie",group:"groepen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"verlichting",media_player:"mediaspelers",scene:"scènes",switch:"schakelaars",vacuum:"stofzuigers"},qr={tomorrow:"morgen",daily:"dagelijks",daily_except_days:"elke dag behalve {days}",working_days:"op werkdagen",weekend:"in het weekend",interval:"{startDay} t/m {endDay}"},Hr={absolute:"om {time}",relative:"over {time}",interval:"van {startTime} tot {endTime}",seconds:"{seconds} seconden",hour:"1 uur",hours:"{hours} uur",minute:"1 minuut",minutes:"{minutes} minuten",now:"nu",midnight:"middernacht",noon:"12 uur",at_sun_event:"bij {sunEvent}",sun_event_sunrise:"zonsopgang",sun_event_sunset:"zonsondergang"},Qr={one_additional_task:"1 overige taak",x_additional_tasks:"{count} overige taken"},Br={scheduler:"Tijdplanner",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr},Kr=Object.freeze({__proto__:null,scheduler:"Tijdplanner",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr,default:Br}),Gr={add:"legg til",cancel:"avbryt",next:"neste",save:"lagre",delete:"slett"},Wr={no_group_selected:"Velg en gruppe først",no_entity_selected:"Velg en entitet først",no_groups_defined:"Ingen grupper definert",no_entities_for_group:"Det finnes ingen entiteter i denne gruppen",no_actions_for_entity:"Det finnes ingen handlinger for denne entiteten",no_entries_defined:"Det er ingen definerte tidsplaner å vise"},Yr={group:"Gruppe",entity:"Entitet",action:"Handling",days:"Dager",time:"Tid",options:"Valg",day_type_daily:"hver dag",day_type_weekdays:"ukedager",day_type_weekend:"weekend",day_type_custom:"egendefinert"},Jr={mon:"man",tue:"tir",wed:"ons",thu:"tor",fri:"fre",sat:"lør",sun:"søn"},Zr={mon:"mandag",tue:"tirsdag",wed:"onsdag",thu:"torsdag",fri:"fredag",sat:"lørdag",sun:"søndag"},Xr={and:"og",before:"før",after:"etter"},ei={turn_on:"slå på",turn_on_brightness:"slå på {at brightness}",turn_off:"slå av",close_cover:"lukk",open_cover:"åpne",set_temperature:"sett temperatur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"sett posisjon {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"slå av",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ti={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},ri={camera:"cameras",climate:"klima",cover:"cover",fan:"vifter",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"lys",switch:"brytere",vacuum:"støvsugere"},ii={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},si={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},ai={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},ni={scheduler:"Tidsplan",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai},oi=Object.freeze({__proto__:null,scheduler:"Tidsplan",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai,default:ni}),ci={add:"dodaj",cancel:"anuluj",next:"dalej",save:"zapisz",delete:"usuń"},li={no_group_selected:"Najpierw wybierz grupę",no_entity_selected:"Najpierw wybierz encję",no_groups_defined:"Nie ma zdefiniowanych grup",no_entities_for_group:"Nie ma encji w tej grupie",no_actions_for_entity:"Nie ma akcji dla tej encji",no_entries_defined:"Nie ma elementów do pokazania"},di={group:"Grupa",entity:"Encja",action:"Akcja",days:"Dni",time:"Czas",options:"Opcje",day_type_daily:"codziennie",day_type_workday:"dni robocze",day_type_weekend:"weekend",day_type_custom:"niestandardowy"},ui={mon:"pon.",tue:"wt.",wed:"śr.",thu:"czw.",fri:"pt.",sat:"sob.",sun:"niedz."},hi={mon:"poniedziałek",tue:"wtorek",wed:"środa",thu:"czwartek",fri:"piątek",sat:"sobota",sun:"niedziela"},pi={and:"oraz",before:"przed",after:"po"},mi={turn_on:"włącz",turn_on_brightness:"włącz {at brightness}",turn_off:"wyłącz",close_cover:"zamknij",open_cover:"otwórz",set_temperature:"ustaw temperaturę {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ustaw pozycję {to position}",set_hvac_mode:"ustaw tryb {to hvac_mode}",set_hvac_mode_hvac_mode_off:"wyłącz",set_preset_mode:"ustaw preset {preset_mode}",set_value:"ustaw wartość {value}",select_option:"wybierz opcję {option}",select_source:"wybierz źródło {source}",start:"start",run_script:"start"},vi={brightness:"jasność",temperature:"temperatura",position:"pozycja",hvac_mode:"tryb",preset_mode:"preset"},fi={camera:"kamera",climate:"termostat",cover:"roleta",fan:"wentylator",group:"grupa",input_boolean:"wejście logiczne",input_number:"wejście liczbowe",input_select:"wybór wejścia",media_player:"odtwarzacz av",scene:"scena",light:"światło",switch:"włącznik",vacuum:"odkurzacz"},gi={tomorrow:"jutro",daily:"codziennie",daily_except_days:"codziennie za wyjątkiem {days}",working_days:"dni robocze",weekend:"weekend",interval:"{startDay} do {endDay}"},yi={absolute:"o {time}",relative:"za {time}",interval:"od {startTime} do {endTime}",seconds:"{seconds} sekund(a/y)",hour:"1 godzina",hours:"{hours} godzin(y)",minute:"1 minuta",minutes:"{minutes} minut(y)",now:"teraz",midnight:"północ",noon:"południe",at_sun_event:"o {sunEvent}",sun_event_sunrise:"wschodzie",sun_event_sunset:"zachodzie"},_i={one_additional_task:"jeszcze 1 zadanie",x_additional_tasks:"{count} więcej zadań"},bi={scheduler:"Harmonogram",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i},wi=Object.freeze({__proto__:null,scheduler:"Harmonogram",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i,default:bi}),Ei={add:"adicionar item",cancel:"cancelar",next:"próximo",save:"gravar",delete:"apagar"},Pi={no_group_selected:"Selecione um grupo primeiro",no_entity_selected:"Selecione uma entidade primeiro",no_groups_defined:"Não tem grupo definido",no_entities_for_group:"Não tem entidade no grupo",no_actions_for_entity:"Não há ações para esta entidade",no_entries_defined:"Não tem item pra mostar"},Si={group:"Grupo",entity:"Entidade",action:"Ação",days:"Dias",time:"Hora",options:"Opções",day_type_daily:"todos os dias",day_type_weekdays:"dias da semana",day_type_weekend:"final da semana",day_type_custom:"personalizado"},ki={mon:"seg",tue:"ter",wed:"qua",thu:"qui",fri:"sex",sat:"sab",sun:"dom"},xi={mon:"segunda",tue:"terça",wed:"quarta",thu:"quinta",fri:"sexta",sat:"sabádo",sun:"domingo"},$i={and:"e",before:"antes",after:"depois"},Oi={turn_on:"ligar",turn_on_brightness:"ligar {a brightness}",turn_off:"desligar",close_cover:"fechar",open_cover:"abrir",set_temperature:"ajustar temperatura {a temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ajustar posição {a position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ji={brightness:"Brilho",temperature:"Temperatura",position:"Posição",hvac_mode:"mode",preset_mode:"preset"},Ci={camera:"cameras",climate:"ar condicionado",cover:"persiana",fan:"ventilador",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"luz",switch:"interruptor",vacuum:"aspirador"},Di={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},zi={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},Ai={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},Ti={scheduler:"Agenda",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:zi,misc:Ai},Ni=Object.freeze({__proto__:null,scheduler:"Agenda",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:zi,misc:Ai,default:Ti}),Ri={add:"adaugă element",cancel:"abandon",next:"următorul",save:"salvează",delete:"șterge"},Fi={no_group_selected:"Prima dată selectați un grup",no_entity_selected:"Prima dată selectați o entitate",no_groups_defined:"Nu există grupuri definite",no_entities_for_group:"Nu există entități definite în acest grup",no_actions_for_entity:"Nu există acțiuni pentru această entitate",no_entries_defined:"Nu există elemente de afișat"},Ii={group:"Grup",entity:"Entitate",action:"Acțiune",days:"Zile",time:"Timp",options:"Opțiuni",day_type_daily:"zilnic",day_type_workday:"zile lucrătoare",day_type_weekend:"sfârșit de săptămână",day_type_custom:"personalizat"},Mi={mon:"lun",tue:"mar",wed:"mie",thu:"joi",fri:"vin",sat:"sâm",sun:"dum"},Li={mon:"Luni",tue:"Marți",wed:"Miercuri",thu:"Joi",fri:"Vineri",sat:"Sâmbătă",sun:"Duminică"},Vi={and:"și",before:"înainte",after:"după"},Ui={turn_on:"pornire",turn_on_brightness:"pornire {la brightness}",turn_off:"oprire",close_cover:"închidere",open_cover:"deschidere",set_temperature:"setare temperatură {la temperature}",set_temperature_hvac_mode_heat:"încălzire {la temperature}",set_temperature_hvac_mode_cool:"răcire {la temperature}",set_cover_position:"setare poziție",set_hvac_mode:"setare mod {hvac_mode}",set_hvac_mode_hvac_mode_off:"oprire",set_preset_mode:"setare preset {preset_mode}",set_value:"setare valoare {value}",select_option:"selectare opțiune {option}",select_source:"selectare sursă {source}",start:"start",run_script:"rulare"},qi={brightness:"intensitate luminoasă",temperature:"temperatură",position:"poziție",hvac_mode:"mod",preset_mode:"preset"},Hi={camera:"camere",climate:"climat",cover:"jaluzele",fan:"ventilatoare",group:"grupuri",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lumini",media_player:"media playere",scene:"scene",switch:"întrerupătpare",vacuum:"aspiratoare"},Qi={tomorrow:"mâine",daily:"zilnic",daily_except_days:"zilnic cu excepția {days}",working_days:"zile lucrătoare",weekend:"sfârșit de săptămână",interval:"{startDay} până la {endDay}"},Bi={absolute:"la {time}",relative:"în {time}",interval:"de la {startTime} la {endTime}",seconds:"{seconds} secunde",hour:"1 oră",hours:"{hours} ore",minute:"1 minut",minutes:"{minutes} minute",now:"acum",midnight:"miezul nopții",noon:"amiază",at_sun_event:"la {sunEvent}",sun_event_sunrise:"răsărit",sun_event_sunset:"apus"},Ki={one_additional_task:"încă o sarcină",x_additional_tasks:"încă {count} sarcini"},Gi={scheduler:"Planificator",actions:Ri,instructions:Fi,fields:Ii,days_short:Mi,days_long:Li,words:Vi,services:Ui,service_parameters:qi,domains:Hi,days:Qi,time:Bi,misc:Ki},Wi={add:"добавить",cancel:"отменить",next:"далее",save:"сохранить",delete:"удалить"},Yi={no_group_selected:"Необходимо выбрать группу",no_entity_selected:"Необходимо выбрать объект",no_groups_defined:"Ни одной группы не создано",no_entities_for_group:"В этой группе нет объектов",no_actions_for_entity:"Для этого объекта нет действий",no_entries_defined:"Объекты отсутствуют"},Ji={group:"Группа",entity:"Объект",action:"Действие",days:"Дни",time:"Время",options:"Опции",day_type_daily:"ежедневно",day_type_workday:"по будням",day_type_weekend:"по выходным",day_type_custom:"выбрать дни"},Zi={mon:"пн",tue:"вт",wed:"ср",thu:"чт",fri:"пт",sat:"сб",sun:"вс"},Xi={mon:"понедельник",tue:"вторник",wed:"среда",thu:"четверг",fri:"пятница",sat:"суббота",sun:"воскресенье"},es={and:"и",before:"до",after:"после"},ts={turn_on:"включить",turn_on_brightness:"включить {на brightness}",turn_off:"выключить",close_cover:"закрыть",open_cover:"открыть",set_temperature:"задать температуру {к temperature}",set_temperature_hvac_mode_heat:"обогрев {к temperature}",set_temperature_hvac_mode_cool:"охлаждение {к temperature}",set_cover_position:"установить позицию {position}",set_hvac_mode:"установить режим {hvac_mode}",set_hvac_mode_hvac_mode_off:"выключить",set_preset_mode:"выбрать набор настроек {preset_mode}",set_value:"установить значение {value}",select_option:"выбрать вариант {option}",select_source:"выбрать источник {source}",start:"запуск",run_script:"запустить"},rs={brightness:"Яркость",temperature:"Температура",position:"Позицию",hvac_mode:"режим",preset_mode:"предуставновлено"},is={camera:"Камеры",climate:"Климат",cover:"Жалюзи",fan:"Вентиляторы",group:"Группы",input_boolean:"Переключатели",input_number:"Числа",input_select:"Списки",media_player:"Медиаплееры",scene:"Сцены",light:"Освещение",switch:"Выключатели",vacuum:"Пылесосы"},ss={tomorrow:"завтра",daily:"ежедневно",daily_except_days:"каждый день исключая {days}",working_days:"рабочие дни",weekend:"выходные",interval:"{startDay} до {endDay}"},as={absolute:"в {time}",relative:"через {time}",interval:"с {startTime} до {endTime}",seconds:"{seconds} секунд",hour:"1 час",hours:"{hours} часа",minute:"1 минуту",minutes:"{minutes} минут",now:"сейчас",midnight:"полночь",noon:"полдень",at_sun_event:"на {sunEvent}",sun_event_sunrise:"восходе",sun_event_sunset:"закате"},ns={one_additional_task:"1 задача",x_additional_tasks:"{count} задач"},os={scheduler:"Планирование",actions:Wi,instructions:Yi,fields:Ji,days_short:Zi,days_long:Xi,words:es,services:ts,service_parameters:rs,domains:is,days:ss,time:as,misc:ns},cs={cs:qe,de:it,en:gt,es:Dt,et:Qt,es_419:Dt,fr:ar,hu:_r,it:Ar,nb:oi,nl:Kr,nn:oi,no:oi,pl:wi,pt:Ni,pt_BR:Ni,ro:Object.freeze({__proto__:null,scheduler:"Planificator",actions:Ri,instructions:Fi,fields:Ii,days_short:Mi,days_long:Li,words:Vi,services:Ui,service_parameters:qi,domains:Hi,days:Qi,time:Bi,misc:Ki,default:Gi}),ru:Object.freeze({__proto__:null,scheduler:"Планирование",actions:Wi,instructions:Yi,fields:Ji,days_short:Zi,days_long:Xi,words:es,services:ts,service_parameters:rs,domains:is,days:ss,time:as,misc:ns,default:os})};function ls(e,t="",r=""){const i=ds();var s;try{if("test"==i)return"TRANSLATED";s=e.split(".").reduce((e,t)=>e[t],cs[i])}catch(t){s=e.split(".").reduce((e,t)=>e[t],cs.en)}if(void 0===s&&(s=e.split(".").reduce((e,t)=>e[t],cs.en)),""!==t&&""!==r)if(Array.isArray(t)||Array.isArray(r))for(var a=0;a=0?Math.floor(e/60):Math.ceil(e/60),i=e-60*r;return i%t!=0&&(i=Math.round(i/t)*t),i>=60&&(r++,i-=60),r>=24&&(r-=24),60*r+i}function ms(e,t={}){const r=!!t.amPm&&t.amPm,i=!!t.absolute&&t.absolute;e>=1440&&(e-=1440);let s=e>=0?Math.floor(e/60):Math.ceil(e/60);const a=e-60*s;let n="";r&&(n=s>=12?"PM":"AM",(s>12||12==s&&a>0)&&(s-=12));const o=String(Math.abs(s)).padStart(2,"0"),c=String(Math.abs(a)).padStart(2,"0"),l=s<0||a<0;return{hours:o,minutes:c,time:`${l&&!i?"-":""}${o}:${c}${r?" "+n:""}`,signed:l,amPm:n}}function vs(e,t={}){const r=t.stepSize?t.stepSize:1,i=!!t.signed&&t.signed,s=t.max?t.max:1440,a=ps(e,r);return a<0&&!i?e+=1440:a>=1440&&(e-=1440),a<-s?-s:a>s?s:e}function fs(e){let t,r,i;if("object"==typeof e)return fs(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`);if(null!==(i=/^([0-9]{2}):([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else if(null!==(i=/^([0-9]{2})([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else{if(null!==(i=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\+|\-][0-9]{2}:[0-9]{2}$/.exec(e))){const e=new Date(i[0]);return fs(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`)}console.log(`failed to parse timestamp '${e}'`)}return 60*t+r}function gs(e){return e.type==hs.Daily?[1,2,3,4,5,6,7]:e.type==hs.Workday?[1,2,3,4,5]:e.type==hs.Weekend?[6,7]:e.type==hs.Custom?e.custom_days:[]}function ys(e){return e==us.Sunrise?"sunrise":"sunset"}function _s(e){let t=e.getDay();return 0==t&&(t=7),t}function bs(e,t){let r=["mon","tue","wed","thu","fri","sat","sun"];if(!t||!r.includes(t))return e;const i=r.length-r.findIndex(e=>e==t);return e=[...e.slice(-i),...e.slice(0,-i)]}function ws(e,t){const r=new Date,i=Math.round((e.valueOf()-r.valueOf())/1e3);if(i<5)return ls("time.now");if(i<60)return ls("time.relative","{time}",ls("time.seconds","{seconds}",String(i)));if(i<3300){const e=i%60,t=Math.round(i/60);if(e<5||e>55)return ls("time.relative","{time}",1==t?ls("time.minute"):ls("time.minutes","{minutes}",String(t)));if(1==Math.floor(i/60)){const e=Math.round(i-60);return ls("time.relative","{time}",`${ls("time.minute")} ${ls("words.and")} ${ls("time.seconds","{seconds}",String(e))}`)}return ls("time.relative","{time}",ls("time.minutes","{minutes}",String(t)))}if(1==Math.floor(i/3600)){const e=Math.round(i/60-60);return ls("time.relative","{time}",`${ls("time.hour")} ${ls("words.and")} ${ls("time.minutes","{minutes}",String(e))}`)}const s=Math.round(i/3600);if(s<=6)return ls("time.relative","{time}",1==s?ls("time.hour"):ls("time.hours","{hours}",String(s)));const a=new Date;a.setHours(0,0,0,0);const n=Math.floor((e.valueOf()-a.valueOf())/864e5),o=""+ms(fs(e),{amPm:null==t?void 0:t.amPm}).time;return 0==n?12==e.getHours()&&0==e.getMinutes()?ls("time.absolute","{time}",ls("time.noon")):ls("time.absolute","{time}",o):1==n?0==e.getHours()&&0==e.getMinutes()?ls("time.absolute","{time}",ls("time.midnight")):12==e.getHours()&&0==e.getMinutes()?`${ls("days.tomorrow")} ${ls("time.absolute","{time}",ls("time.noon"))}`:`${ls("days.tomorrow")} ${ls("time.absolute","{time}",o)}`:`${function(e){switch(e){case 1:return ls("days_long.mon");case 2:return ls("days_long.tue");case 3:return ls("days_long.wed");case 4:return ls("days_long.thu");case 5:return ls("days_long.fri");case 6:return ls("days_long.sat");case 7:return ls("days_long.sun");default:return""}}(_s(e))} ${ls("time.absolute","{time}",o)}`}!function(e){e.Sunrise="SUNRISE",e.Sunset="SUNSET"}(us||(us={})),function(e){e.Daily="DAILY",e.Workday="WORKDAY",e.Weekend="WEEKEND",e.Custom="CUSTOM"}(hs||(hs={}));const Es=[{id:1,name:ls("days_short.mon")},{id:2,name:ls("days_short.tue")},{id:3,name:ls("days_short.wed")},{id:4,name:ls("days_short.thu")},{id:5,name:ls("days_short.fri")},{id:6,name:ls("days_short.sat")},{id:7,name:ls("days_short.sun")}],Ps=[{id:hs.Daily,name:ls("fields.day_type_daily")},{id:hs.Workday,name:ls("fields.day_type_workday")},{id:hs.Weekend,name:ls("fields.day_type_weekend")},{id:hs.Custom,name:ls("fields.day_type_custom")}];var Ss;!function(e){e.Overview="OVERVIEW",e.NewSchedule="NEW_SCHEDULE",e.TimePicker="TIME_PICKER",e.TimeScheme="TIME_SCHEME",e.Options="OPTIONS"}(Ss||(Ss={}));const ks={service:"turn_on",icon:"power"},xs={service:"turn_off",icon:"power-off"},$s=/^([0-9]+)?D([0-7]+)?T([0-9SRDUW]+)T?([0-9SRDUW]+)?(A[A0-9]+)+(C([C0-9]+))?(F([F0-9]+))?$/,Os=/^([0-9]{4})?([SRDUW]{2})([0-9]{4})?$/;function js(e){var t,r,i;const s=$s.exec(e),a={time:{value:0},days:{type:hs.Daily},actions:[]};if(s[1])"15"==s[1]?Object.assign(a,{days:{type:hs.Workday}}):"67"==s[1]&&Object.assign(a,{days:{type:hs.Weekend}});else{const e=s[2].split("").map(Number);e.sort(),1==e.length&&0==e[0]||Object.assign(a,{days:{type:hs.Custom,custom_days:e.filter(e=>0!=e)}})}const n=Os.exec(s[3]);if(n?Object.assign(a,{time:{event:"SR"==n[2]?us.Sunrise:us.Sunset,value:n[1]?-fs(n[1]):fs(n[3])}}):Object.assign(a,{time:{value:fs(s[3])}}),s[4]){const e=Os.exec(s[4]);e?Object.assign(a,{endTime:{event:"SR"==e[2]?us.Sunrise:us.Sunset,value:e[1]?-fs(e[1]):fs(e[4])}}):Object.assign(a,{endTime:{value:fs(s[4])}})}const o=null===(t=s[5].match(/A[0-9]+/g))||void 0===t?void 0:t.map(e=>Number(e.substring(1)));if(Object.assign(a,{actions:o}),s[6]){let e=null===(r=s[6].match(/C[0-9]+/g))||void 0===r?void 0:r.map(e=>Number(e.substring(1)));1==(null==e?void 0:e.length)&&s[7].length>1?(e=s[7].split("").map(Number),Object.assign(a,{conditions:{type:Oe.All,items:e}})):Object.assign(a,{conditions:{type:Oe.Any,items:e}})}if(s[8]){const e=null===(i=s[8].match(/F[0-9]+/g))||void 0===i?void 0:i.map(e=>Number(e.substring(1)));Object.assign(a,{options:e})}return a}const Cs=["disarmed","armed_away","armed_home","armed_night"];function Ds(e){return{type:xe.Level,field:e.field,min:e.min||0,max:e.max||255,step:e.step||1,optional:e.optional||!1,unit:e.unit||""}}function zs(e){return{type:xe.List,field:e.field,options:e.options}}function As(e,t={}){let r={value:String(e)};return t.icons&&e in t.icons&&(r=Object.assign(Object.assign({},r),{icon:t.icons[e]})),t.name&&(r=Object.assign(Object.assign({},r),{name:t.name})),r}const Ts={heat:"fire",cool:"snowflake",heat_cool:"thermometer",auto:"autorenew",dry:"water-percent",fan_only:"fan"};const Ns=e=>{switch(e.attributes.device_class){case"garage":return"garage";case"door":return"door-closed";case"shutter":return"window-shutter";case"blind":return"blinds";case"window":return"window-closed";default:return"window-shutter"}},Rs=e=>{switch(e.attributes.device_class){case"garage":return"garage-open";case"door":return"door-open";case"shutter":return"window-shutter-open";case"blind":return"blinds-open";case"window":return"window-open";default:return"window-shutter-open"}},Fs=["open","closed"],Is={off:"fan-off",low:"fan-speed-1",medium:"fan-speed-2",high:"fan-speed-3"};const Ms={normal:"account-outline",eco:"leaf",away:"car-traction-control",boost:"rocket-launch-outline",comfort:"car-seat-cooler",home:"home-outline",sleep:"sleep",auto:"autorenew",baby:"baby-bottle-outline"};const Ls=[{service:"unlock",icon:"lock-open-variant-outline"},{service:"lock",icon:"lock-outline"}],Vs=["locked","unlocked"];function Us(e){const t=Se(e.entity_id);e.attributes.supported_features;switch(t){case"alarm_control_panel":return(e=>{const t=e.attributes.supported_features;let r=[{service:"alarm_disarm",icon:"lock-open-variant-outline"}];return 1&t&&r.push({service:"alarm_arm_home",icon:"home-outline"}),2&t&&r.push({service:"alarm_arm_away",icon:"exit-run"}),4&t&&r.push({service:"alarm_arm_night",icon:"power-sleep"}),16&t&&r.push({service:"alarm_arm_custom_bypass",icon:"shield-lock-outline"}),r})(e);case"climate":return function(e){const t=e.attributes.supported_features,r=e.attributes.preset_modes,i=e.attributes.hvac_modes,s=i.filter(e=>!["off","heat","cool","heat_cool"].includes(e)),a=Ds({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let n=[];return i.includes("off")?n.push({service:"set_hvac_mode",service_data:{hvac_mode:"off"},icon:"power"}):n.push(xs),i.includes("heat")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"heat"},variable:a,icon:Ts.heat}),i.includes("cool")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"cool"},variable:a,icon:Ts.cool}),!i.includes("heat")&&!i.includes("cool")&&1&t&&n.push({service:"set_temperature",variable:a,icon:"thermometer"}),i.length>1&&s.length&&n.push({service:"set_hvac_mode",variable:zs({field:"hvac_mode",options:s.map(e=>As(e,{icons:Ts}))}),icon:"cog-transfer-outline"}),r&&r.length&&16&t&&n.push({service:"set_preset_mode",variable:zs({field:"preset_mode",options:r.map(e=>As(e))}),icon:"cloud-download-outline"}),n}(e);case"cover":return function(e){const t=e.attributes.supported_features;let r=[{service:"open_cover",icon:Rs(e)},{service:"close_cover",icon:Ns(e)}];return 4&t&&r.push({supported_feature:4,service:"set_cover_position",variable:Ds({field:"position",min:0,max:100,unit:"%"}),icon:"ray-vertex"}),r}(e);case"fan":return function(e){const t=e.attributes.supported_features,r=e.attributes.speed_list;let i=[ks,xs];return 1&t&&r&&r.length>1&&i.push({service:"set_speed",variable:zs({field:"speed",options:r.map(e=>As(e,{icons:Is}))}),icon:"weather-windy"}),2&t&&i.push({service:"oscillate",variable:zs({field:"oscillating",options:[{value:"True"},{value:"False"}]}),icon:"arrow-left-right"}),4&t&&i.push({service:"set_direction",variable:zs({field:"direction",options:[{value:"forward"},{value:"reverse"}]}),icon:"cog-clockwise"}),i}(e);case"group":return function(e){return e.attributes.entity_id,[ks,xs]}(e);case"humidifer":return function(e){const t=e.attributes.supported_features,r=e.attributes.available_modes,i=Ds({field:"humidity",min:e.attributes.min_humidity,max:e.attributes.max_humidity,step:1,unit:"%"});let s=[];return s.push({service:"set_humidity",variable:i}),r&&r.length>1&&1&t&&s.push({service:"set_mode",variable:zs({field:"mode",options:r.map(e=>As(e,{icons:Ms}))})}),s}(e);case"input_boolean":return[Object.assign(Object.assign({},ks),{icon:"flash"}),Object.assign(Object.assign({},xs),{icon:"flash-off"})];case"input_number":return function(e){return[{service:"set_value",variable:Ds({field:"value",min:Number(e.attributes.min),max:Number(e.attributes.max),step:Number(e.attributes.step)}),icon:"counter"}]}(e);case"input_select":return function(e){const t=e.attributes.options;return t.length<2?[]:[{service:"select_option",variable:zs({field:"option",options:t.map(e=>({value:e}))}),icon:"counter"}]}(e);case"light":return function(e){const t=e.attributes.supported_features,r=Ds({field:"brightness",min:0,max:255,unit:"%",optional:!0});let i=[];return i.push(Object.assign(Object.assign({},xs),{icon:"lightbulb-off"})),1&t?i.push(Object.assign(Object.assign({},ks),{icon:"lightbulb",variable:r})):i.push(Object.assign(Object.assign({},ks),{icon:"lightbulb"})),i}(e);case"lock":return Ls;case"media_player":return function(e){const t=Array(e.attributes.source_list),r=e.attributes.supported_features;let i=[];return 128&r&&i.push(ks),256&r&&i.push(xs),2048&r&&t.length>1&&i.push({service:"select_source",variable:zs({field:"source",options:t.map(e=>({value:e}))}),icon:"music-box-multiple-outline"}),i}(e);case"scene":return[Object.assign(Object.assign({},ks),{icon:"play"})];case"script":return function(e){let t=[ks,xs];return t.push({service:ke(e.entity_id),icon:"play",name:ls("services.run_script")}),t}(e);case"switch":return[Object.assign(Object.assign({},ks),{icon:"flash"}),Object.assign(Object.assign({},xs),{icon:"flash-off"})];case"vacuum":return function(e){const t=e.attributes.supported_features;let r=[];return 1&t&&r.push(ks),8192&t&&r.push({service:"start",icon:"play-circle-outline"}),4&t&&r.push({service:"start_pause",icon:"play-circle-outline"}),r}(e);case"water_heater":return function(e){const t=e.attributes.supported_features,r=e.attributes.operation_list,i=Ds({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let s=[];return 1&t&&s.push({service:"set_temperature",variable:i,icon:"thermometer"}),2&t&&s.push({service:"set_operation_mode",variable:zs({field:"operation_mode",options:r.map(e=>({value:e}))}),icon:"cog-transfer-outline"}),4&t&&s.push({service:"set_away_mode",variable:zs({field:"mode",options:[{value:"on",icon:"toggle-switch-outline"},{value:"off",icon:"toggle-switch-off-outline"}]}),icon:"car-traction-control"}),s}(e);default:return[]}}function qs(e,t){let r=!1;if(e.match(/^[a-z0-9_\.]+$/))r=e.includes(".")?e==t:e==Se(t);else try{if(e.startsWith("/")&&e.endsWith("/")||-1!==e.indexOf("*")){e.startsWith("/")||(e=`/^${e=e.replace(/\./g,".").replace(/\*/g,".*")}$/`);r=new RegExp(e.slice(1,-1)).test(t)}}catch(e){}return r}function Hs(e,t){return!(!t.include||!t.include.length)&&(!(t.include&&!t.include.find(t=>qs(t,e)))&&(!t.exclude||!t.exclude.find(t=>qs(t,e))))}const Qs={alarm_control_panel:"alarm-light-outline",automation:"playlist-play",binary_sensor:"radiobox-blank",camera:"camera",climate:"home-thermometer-outline",cover:"window-shutter",device_tracker:"account",fan:"fan",group:"google-circles-communities",humidifier:"air-humidifier",input_boolean:"drawing",input_number:"ray-vertex",input_select:"format-list-bulleted",input_text:"textbox",light:"lightbulb-outline",lock:"lock-open-outline",media_player:"cast-connected",notify:"comment-alert",person:"account-outline",remote:"remote",scene:"palette-outline",script:"file-document",sensor:"eye",switch:"flash",timer:"timer",vacuum:"robot-vacuum",water_heater:"water-boiler"},Bs=e=>{const t=Se(e.entity_id);switch(t){case"binary_sensor":return(e=>{switch(e.attributes.device_class){case"battery":return"battery-outline";case"cold":return"snowflake";case"connectivity":return"server-network";case"door":return"door-closed";case"garage_door":return"hass:garage";case"gas":case"power":case"problem":case"safety":case"smoke":return"shield-check";case"heat":return"fire";case"light":return"brightness-5";case"lock":return"lock";case"moisture":return"water";case"motion":return"walk";case"occupancy":case"presence":return"home-outline";case"opening":return"hass:square";case"plug":return"hass:power-plug-outline";case"sound":return"music-note";case"vibration":return"vibrate";case"window":return"window-closed";default:return"radiobox-blank"}})(e);case"cover":return Ns(e);case"sensor":return(e=>{switch(e.attributes.device_class){case"humidity":return"water-percent";case"illuminance":return"brightness-5";case"temperature":return"thermometer";case"power":return"flash";case"pressure":return"gauge";case"signal_strength":return"wifi";default:return"°C"==e.attributes.unit_of_measurement||"°F"==e.attributes.unit_of_measurement?"thermometer":"eye"}})(e);default:return t in Qs?Qs[t]:"folder-outline"}},Ks=e=>{switch(Se(e.entity_id)){case"alarm_control_panel":return Cs;case"binary_sensor":case"cover":return Fs;case"input_boolean":case"switch":return["on","off"];case"lock":return Vs;case"person":return["home","not_home"];default:return}};function Gs(e,t){return e?Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Ws(e,t){return e?Object.entries(e).filter(([e])=>!t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Ys(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Js(e){return"string"!=typeof e&&(e=String(e)),Ys(e.replace(/_/g," "))}function Zs(e){if(e)return"string"!=typeof e&&(e=String(e)),e.match(/^[a-z]+:[a-z0-9-]+$/i)?e:"hass:"+e}function Xs(e){const t=e=>Object.entries(e).sort((e,t)=>e[0]>t[0]?1:-1).map(([e,r])=>[e,"object"==typeof r&&null!==r?t(r):r]).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{});let r=Gs(e,["service","service_data"]);r=t(r);return Object.values(r).map(e=>JSON.stringify(e).replace(/[\W]/g," ").split(" ").filter(e=>" "!=e&&""!=e).join("_")).join("_")}function ea(e){const t=e.service;let r={id:"",name:e.name,icon:e.icon,service:t};return e.service_data&&Object.keys(e.service_data).length&&Object.assign(r,{service_data:e.service_data}),e.variable&&("options"in e.variable?Object.assign(r,{variable:zs(e.variable)}):Object.assign(r,{variable:Ds(e.variable)})),Object.assign(r,{id:Xs(r)}),r}function ta(e){let t=e.entity,r=e.service;const i=Se(t),s=Se(r);i&&s?i==s&&(r=ke(r)):i||(t=s+"."+t,r=ke(r));let a=Ws(e,["service","entity","service_data"]),n={entity:t,service:r};return a=Object.assign(Object.assign({},a),e.service_data),Object.keys(a).length&&(n=Object.assign(Object.assign({},n),{service_data:a})),n}function ra(e,t){const r=e.actions.map(ea),i=Xs(Ws(t,["entity"]));return r.map(e=>{if(e.id==i)return!0;if(e.variable&&t.service_data&&Object.keys(t.service_data).includes(e.variable.field)){let r=Object.entries(t.service_data).filter(([t])=>t!=e.variable.field).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}),i=Object.keys(r).length?Object.assign(Object.assign({},t),{service_data:r}):Ws(t,["service_data"]);return e.id==Xs(i)}return!1}).map((e,t)=>e?t:null).filter(e=>null!==e)}function ia(e,t){const r=ra(e,t);return r.length?ea(e.actions[r[0]]):ea(Ws(t,["entity"]))}function sa(e){return e.match(/^switch.schedule_[0-9a-f]{6}$/)}function aa(e,t){if(!e)return;const r="string"==typeof e?e:e.entity_id;let i={id:r,name:e.attributes.friendly_name||ke(r),icon:"folder-outline",actions:[]};if((void 0===t.standard_configuration||t.standard_configuration)&&(i=Object.assign(Object.assign({},i),{actions:[...Us(e)],icon:Bs(e),states:Ks(e)})),i=Object.assign(Object.assign({},i),{icon:e.attributes.icon||i.icon}),t.customize){Object.entries(t.customize).filter(([e])=>qs(e,r)).map(([,e])=>e).forEach(e=>{if(i=Object.assign(Object.assign({},i),Ws(e,["actions","exclude_actions"])),e.actions&&e.actions.forEach(e=>{Se(e.service)==Se(r)&&(e=Object.assign(Object.assign({},e),{service:ke(e.service)}));const t=ra(i,e);let s=i.actions;t.length?s=i.actions.map((r,i)=>t.includes(i)?Object.assign(r,e):r):i.actions.push(e),i=Object.assign(Object.assign({},i),{actions:s})}),e.exclude_actions){let t=e.exclude_actions.map(e=>e.replace(/_/g," ").trim().toLowerCase());i.exclude_actions&&(t=t.concat(i.exclude_actions).filter((e,t,r)=>r.indexOf(e)===t)),i=Object.assign(Object.assign({},i),{exclude_actions:t})}})}return i}function na(e,t,r){const i="object"==typeof e?e.entity_id:e;if(sa(i))return!1;if(!(Hs(i,t)||t.groups&&t.groups.some(e=>Hs(i,e))))return!1;if(r&&"object"==typeof e){const i=aa(e,t);if(!i)return!1;if(r.states&&!i.states)return!1;if(r.actions&&!i.actions.length)return!1}return!0}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function oa(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var ca=oa((function(e,t){ /** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,s=1;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function f(e){throw new RangeError(p[e])}function g(e,t){var r=e.split("@"),i="";r.length>1&&(i=r[0]+"@",e=r[1]);var s=function(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r}((e=e.replace(h,".")).split("."),t).join(".");return i+s}function y(e){for(var t=[],r=0,i=e.length;r=55296&&s<=56319&&r>1,e+=m(e/t);e>455;i+=36)e=m(e/35);return m(i+36*e/(e+38))},w=function(e){var t,r=[],i=e.length,s=0,a=128,n=72,o=e.lastIndexOf("-");o<0&&(o=0);for(var c=0;c=128&&f("not-basic"),r.push(e.charCodeAt(c));for(var d=o>0?o+1:0;d=i&&f("invalid-input");var v=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(v>=36||v>m((l-s)/h))&&f("overflow"),s+=v*h;var g=p<=n?1:p>=n+26?26:p-n;if(vm(l/y)&&f("overflow"),h*=y}var _=r.length+1;n=b(s-u,_,0==u),m(s/_)>l-a&&f("overflow"),a+=m(s/_),s%=_,r.splice(s++,0,a)}return String.fromCodePoint.apply(String,r)},E=function(e){var t=[],r=(e=y(e)).length,i=128,s=0,a=72,n=!0,o=!1,c=void 0;try{for(var d,u=e[Symbol.iterator]();!(n=(d=u.next()).done);n=!0){var h=d.value;h<128&&t.push(v(h))}}catch(e){o=!0,c=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw c}}var p=t.length,g=p;for(p&&t.push("-");g=i&&$m((l-s)/O)&&f("overflow"),s+=(w-i)*O,i=w;var j=!0,C=!1,D=void 0;try{for(var z,A=e[Symbol.iterator]();!(j=(z=A.next()).done);j=!0){var T=z.value;if(Tl&&f("overflow"),T==i){for(var N=s,R=36;;R+=36){var F=R<=a?1:R>=a+26?26:R-a;if(N>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function $(e){for(var t="",r=0,i=e.length;r=194&&s<224){if(i-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(i-r>=9){var n=parseInt(e.substr(r+4,2),16),o=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&n)<<6|63&o)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function O(e,t){function r(e){var r=$(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,x).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,x).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,x).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,x).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,x).replace(t.PCT_ENCODED,s)),e}function j(e){return e.replace(/^0*(.*)/,"$1")||"0"}function C(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(j).join("."):e}function D(e,t){var r=e.match(t.IPV6ADDRESS)||[],i=c(r,3),s=i[1],a=i[2];if(s){for(var n=s.toLowerCase().split("::").reverse(),o=c(n,2),l=o[0],d=o[1],u=d?d.split(":").map(j):[],h=l.split(":").map(j),p=t.IPV4ADDRESS.test(h[h.length-1]),m=p?7:8,v=h.length-m,f=Array(m),g=0;g1){var b=f.slice(0,y.index),w=f.slice(y.index+y.length);_=b.join(":")+"::"+w.join(":")}else _=f.join(":");return a&&(_+="%"+a),_}return e}var z=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,A=void 0==="".match(/(){0}/)[1];function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?o:n;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(z);if(s){A?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=D(C(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=k[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)O(r,i);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=P(r.host.replace(i.PCT_ENCODED,$).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}O(r,n)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function N(e,t){var r=!1!==t.iri?o:n,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(D(C(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var R=/^\.\.?\//,F=/^\/\.(\/|$)/,I=/^\/\.\.(\/|$)/,M=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(I))e=e.replace(I,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(M);if(!r)throw new Error("Unexpected dot segment condition");var i=r[0];e=e.slice(i.length),t.push(i)}return t.join("")}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?o:n,i=[],s=k[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?S(e.host):P(e.host.replace(r.PCT_ENCODED,$).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}O(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var a=N(e,t);if(void 0!==a&&("suffix"!==t.reference&&i.push("//"),i.push(a),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||s&&s.absolutePath||(c=L(c)),void 0===a&&(c=c.replace(/^\/\//,"/%2F")),i.push(c)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],s={};return i||(e=T(V(e,r),r),t=T(V(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=L(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function q(e,t){return e&&e.toString().replace(t&&t.iri?o.PCT_ENCODED:n.PCT_ENCODED,$)}var H={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize};function B(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=B(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(B(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),i=c(r,2),s=i[0],a=i[1];e.path=s&&"/"!==s?s:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},G={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},W={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",J="[0-9A-Fa-f]",Z=r(r("%[EFef]"+J+"%"+J+J+"%"+J+J)+"|"+r("%[89A-Fa-f]"+J+"%"+J+J)+"|"+r("%"+J+J)),X=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ee=new RegExp(Y,"g"),te=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',X),"g"),ie=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),se=ie;function ae(e){var t=$(e);return t.match(ee)?t:e}var ne={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,a={},n=r.query.split("&"),o=0,c=n.length;o=55296&&t<=56319&&s=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!s)return a}for(var o=a,c=s.split("/"),l=0;l=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function Wa(e,t,r){var i=Ya.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function Ya(e,t,r){for(var i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,dn=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,un=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,hn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,pn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,mn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,vn=fn;function fn(e){return e="full"==e?"full":"fast",ua.copy(fn[e])}function gn(e){var t=e.match(sn);if(!t)return!1;var r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2==i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:an[i])}function yn(e,t){var r=e.match(nn);if(!r)return!1;var i=r[1],s=r[2],a=r[3],n=r[5];return(i<=23&&s<=59&&a<=59||23==i&&59==s&&60==a)&&(!t||n)}fn.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":ln,url:dn,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:on,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:En,uuid:un,"json-pointer":hn,"json-pointer-uri-fragment":pn,"relative-json-pointer":mn},fn.full={date:gn,time:yn,"date-time":function(e){var t=e.split(_n);return 2==t.length&&gn(t[0])&&yn(t[1],!0)},uri:function(e){return bn.test(e)&&cn.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":ln,url:dn,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:on,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:En,uuid:un,"json-pointer":hn,"json-pointer-uri-fragment":pn,"relative-json-pointer":mn};var _n=/t|\s/i;var bn=/\/|:/;var wn=/[^\\]\\Z/;function En(e){if(wn.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var Pn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o;var p="maximum"==t,m=p?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[m],f=e.opts.$data&&v&&v.$data,g=p?"<":">",y=p?">":"<",_=void 0;if(!h&&"number"!=typeof o&&void 0!==o)throw new Error(t+" must be number");if(!f&&void 0!==v&&"number"!=typeof v&&"boolean"!=typeof v)throw new Error(m+" must be number or boolean");if(f){var b=e.util.getData(v.$data,n,e.dataPathArr),w="exclusive"+a,E="exclType"+a,P="exclIsNumber"+a,S="' + "+($="op"+a)+" + '";s+=" var schemaExcl"+a+" = "+b+"; ",s+=" var "+w+"; var "+E+" = typeof "+(b="schemaExcl"+a)+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ";var k;_=m;(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var x=s;s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+E+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+b+" "+g+"= "+i+") ? "+u+" "+y+"= "+b+" : "+u+" "+y+" "+i+" ) : ( ("+w+" = "+b+" === true) ? "+u+" "+y+"= "+i+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { var op"+a+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===o&&(_=m,l=e.errSchemaPath+"/"+m,i=b,h=f)}else{S=g;if((P="number"==typeof v)&&h){var $="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" ( "+i+" === undefined || "+v+" "+g+"= "+i+" ? "+u+" "+y+"= "+v+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { "}else{P&&void 0===o?(w=!0,_=m,l=e.errSchemaPath+"/"+m,i=v,y+="="):(P&&(i=Math[p?"min":"max"](v,o)),v===(!P||i)?(w=!0,_=m,l=e.errSchemaPath+"/"+m,y+="="):(w=!1,S+="="));$="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+" "+y+" "+i+" || "+u+" !== "+u+") { "}}_=_||t,(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+$+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+S+" ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";x=s;return s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { "),s},Sn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},kn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?s+=" "+u+".length ":s+=" ucs2length("+u+") ",s+=" "+p+" "+i+") { ";var m=t,v=v||[];v.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==t?"longer":"shorter",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var f=s;return s=v.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},xn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" Object.keys("+u+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},$n={$ref:function(e,t,r){var i,s,a=" ",n=e.level,o=e.dataLevel,c=e.schema[t],l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h="valid"+n;if("#"==c||"#/"==c)e.isRoot?(i=e.async,s="validate"):(i=!0===e.root.schema.$async,s="root.refVal[0]");else{var p=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===p){var m=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(m),(y=y||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;a=y.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,m);e.logger.warn(m),d&&(a+=" if (true) { ")}}else if(p.inline){var f=e.util.copy(e);f.level++;var g="valid"+f.level;f.schema=p.schema,f.schemaPath="",f.errSchemaPath=c,a+=" "+e.validate(f).replace(/validate\.schema/g,p.code)+" ",d&&(a+=" if ("+g+") { ")}else i=!0===p.$async||e.async&&!1!==p.$async,s=p.code}if(s){var y;(y=y||[]).push(a),a="",e.opts.passContext?a+=" "+s+".call(this, ":a+=" "+s+"( ",a+=" "+u+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var _=a+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";if(a=y.pop(),i){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(a+=" var "+h+"; "),a+=" try { await "+_+"; ",d&&(a+=" "+h+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(a+=" "+h+" = false; "),a+=" } ",d&&(a+=" if ("+h+") { ")}else a+=" if (!"+_+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",d&&(a+=" else { ")}return a},allOf:function(e,t,r){var i=" ",s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,c=e.util.copy(e),l="";c.level++;var d="valid"+c.level,u=c.baseId,h=!0,p=s;if(p)for(var m,v=-1,f=p.length-1;v0:e.util.schemaHasRules(m,e.RULES.all))&&(h=!1,c.schema=m,c.schemaPath=a+"["+v+"]",c.errSchemaPath=n+"/"+v,i+=" "+e.validate(c)+" ",c.baseId=u,o&&(i+=" if ("+d+") { ",l+="}"));return o&&(i+=h?" if (true) { ":" "+l.slice(0,-1)+" "),i},anyOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level;if(n.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var f=p.baseId;i+=" var "+h+" = errors; var "+u+" = false; ";var g=e.compositeRule;e.compositeRule=p.compositeRule=!0;var y=n;if(y)for(var _,b=-1,w=y.length-1;b0:e.util.schemaHasRules(n,e.RULES.all);if(i+="var "+h+" = errors;var "+u+";",_){var b=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+m+" = false; for (var "+v+" = 0; "+v+" < "+d+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var w=d+"["+v+"]";p.dataPathArr[f]=v;var E=e.validate(p);p.baseId=y,e.util.varOccurences(E,g)<2?i+=" "+e.util.varReplace(E,g,w)+" ":i+=" var "+g+" = "+w+"; "+E+" ",i+=" if ("+m+") break; } ",e.compositeRule=p.compositeRule=b,i+=" if (!"+m+") {"}else i+=" if ("+d+".length == 0) {";var P=P||[];P.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;return i=P.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",_&&(i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i},dependencies:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v={},f={},g=e.opts.ownProperties;for(w in n)if("__proto__"!=w){var y=n[w],_=Array.isArray(y)?f:v;_[w]=y}i+="var "+u+" = errors;";var b=e.errorPath;for(var w in i+="var missing"+s+";",f)if((_=f[w]).length){if(i+=" if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),l){i+=" && ( ";var E=_;if(E)for(var P=-1,S=E.length-1;P0:e.util.schemaHasRules(y,e.RULES.all))&&(i+=" "+m+" = true; if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),i+=") { ",h.schema=y,h.schemaPath=o+e.util.getProperty(w),h.errSchemaPath=c+"/"+e.util.escapeFragment(w),i+=" "+e.validate(h)+" ",h.baseId=N,i+=" } ",l&&(i+=" if ("+m+") { ",p+="}"))}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},enum:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h=e.opts.$data&&n&&n.$data;h&&(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ");var p="i"+s,m="schema"+s;h||(i+=" var "+m+" = validate.schema"+o+";"),i+="var "+u+";",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=u+" = false;for (var "+p+"=0; "+p+"<"+m+".length; "+p+"++) if (equal("+d+", "+m+"["+p+"])) { "+u+" = true; break; }",h&&(i+=" } "),i+=" if (!"+u+") { ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var f=i;return i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i},format:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||"");if(!1===e.opts.format)return l&&(i+=" if (true) { "),i;var u,h=e.opts.$data&&n&&n.$data;h?(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ",u="schema"+s):u=n;var p=e.opts.unknownFormats,m=Array.isArray(p);if(h){i+=" var "+(v="format"+s)+" = formats["+u+"]; var "+(f="isObject"+s)+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+(g="formatType"+s)+" = "+f+" && "+v+".type || 'string'; if ("+f+") { ",e.async&&(i+=" var async"+s+" = "+v+".async; "),i+=" "+v+" = "+v+".validate; } if ( ",h&&(i+=" ("+u+" !== undefined && typeof "+u+" != 'string') || "),i+=" (","ignore"!=p&&(i+=" ("+u+" && !"+v+" ",m&&(i+=" && self._opts.unknownFormats.indexOf("+u+") == -1 "),i+=") || "),i+=" ("+v+" && "+g+" == '"+r+"' && !(typeof "+v+" == 'function' ? ",e.async?i+=" (async"+s+" ? await "+v+"("+d+") : "+v+"("+d+")) ":i+=" "+v+"("+d+") ",i+=" : "+v+".test("+d+"))))) {"}else{var v;if(!(v=e.formats[n])){if("ignore"==p)return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(i+=" if (true) { "),i;if(m&&p.indexOf(n)>=0)return l&&(i+=" if (true) { "),i;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var f,g=(f="object"==typeof v&&!(v instanceof RegExp)&&v.validate)&&v.type||"string";if(f){var y=!0===v.async;v=v.validate}if(g!=r)return l&&(i+=" if (true) { "),i;if(y){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(_="formats"+e.util.getProperty(n)+".validate")+"("+d+"))) { "}else{i+=" if (! ";var _="formats"+e.util.getProperty(n);f&&(_+=".validate"),i+="function"==typeof v?" "+_+"("+d+") ":" "+_+".test("+d+") ",i+=") { "}}var b=b||[];b.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",i+=h?""+u:""+e.util.toQuotedString(n),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=h?"' + "+u+" + '":""+e.util.escapeQuotes(n),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+o:""+e.util.toQuotedString(n),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;return i=b.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i},if:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,v=e.schema.then,f=e.schema.else,g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),y=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0:e.util.schemaHasRules(f,e.RULES.all)),_=p.baseId;if(g||y){var b;p.createErrors=!1,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+h+" = errors; var "+u+" = true; ";var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,i+=" "+e.validate(p)+" ",p.baseId=_,p.createErrors=!0,i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=w,g?(i+=" if ("+m+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'then'; ":b="'then'",i+=" } ",y&&(i+=" else { ")):i+=" if (!"+m+") { ",y&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'else'; ":b="'else'",i+=" } "),i+=" if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i},items:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,_=e.baseId;if(i+="var "+h+" = errors;var "+u+";",Array.isArray(n)){var b=e.schema.additionalItems;if(!1===b){i+=" "+u+" = "+d+".length <= "+n.length+"; ";var w=c;c=e.errSchemaPath+"/additionalItems",i+=" if (!"+u+") { ";var E=E||[];E.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var P=i;i=E.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+P+"]); ":i+=" validate.errors = ["+P+"]; return false; ":i+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c=w,l&&(m+="}",i+=" else { ")}var S=n;if(S)for(var k,x=-1,$=S.length-1;x<$;)if(k=S[x+=1],e.opts.strictKeywords?"object"==typeof k&&Object.keys(k).length>0:e.util.schemaHasRules(k,e.RULES.all)){i+=" "+v+" = true; if ("+d+".length > "+x+") { ";var O=d+"["+x+"]";p.schema=k,p.schemaPath=o+"["+x+"]",p.errSchemaPath=c+"/"+x,p.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),p.dataPathArr[g]=x;var j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",i+=" } ",l&&(i+=" if ("+v+") { ",m+="}")}if("object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0:e.util.schemaHasRules(b,e.RULES.all))){p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+v+" = true; if ("+d+".length > "+n.length+") { for (var "+f+" = "+n.length+"; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" } } ",l&&(i+=" if ("+v+") { ",m+="}")}}else if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" for (var "+f+" = 0; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" }"}return l&&(i+=" "+m+" if ("+h+" == errors) {"),i},maximum:Pn,minimum:Pn,maxItems:Sn,minItems:Sn,maxLength:kn,minLength:kn,maxProperties:xn,minProperties:xn,multipleOf:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="var division"+a+";if (",h&&(s+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),s+=" (division"+a+" = "+u+" / "+i+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+a+" !== parseInt(division"+a+") ",s+=" ) ",h&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},not:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c,i+=" var "+u+" = errors; ";var m,v=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(m=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,m&&(h.opts.allErrors=m),e.compositeRule=h.compositeRule=v,i+=" if ("+p+") { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var g=i;i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(i+=" if (false) { ");return i},oneOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f=p.baseId,g="prevValid"+s,y="passingSchemas"+s;i+="var "+h+" = errors , "+g+" = false , "+u+" = false , "+y+" = null; ";var _=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=n;if(b)for(var w,E=-1,P=b.length-1;E0:e.util.schemaHasRules(w,e.RULES.all))?(p.schema=w,p.schemaPath=o+"["+E+"]",p.errSchemaPath=c+"/"+E,i+=" "+e.validate(p)+" ",p.baseId=f):i+=" var "+v+" = true; ",E&&(i+=" if ("+v+" && "+g+") { "+u+" = false; "+y+" = ["+y+", "+E+"]; } else { ",m+="}"),i+=" if ("+v+") { "+u+" = "+g+" = true; "+y+" = "+E+"; }";return e.compositeRule=p.compositeRule=_,i+=m+"if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i},pattern:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),s+=" !"+(h?"(new RegExp("+i+"))":e.usePattern(o))+".test("+u+") ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",s+=h?""+i:""+e.util.toQuotedString(o),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=h?"' + "+i+" + '":""+e.util.escapeQuotes(o),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},properties:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="key"+s,f="idx"+s,g=h.dataLevel=e.dataLevel+1,y="data"+g,_="dataProperties"+s,b=Object.keys(n||{}).filter(A),w=e.schema.patternProperties||{},E=Object.keys(w).filter(A),P=e.schema.additionalProperties,S=b.length||E.length,k=!1===P,x="object"==typeof P&&Object.keys(P).length,$=e.opts.removeAdditional,O=k||x||$,j=e.opts.ownProperties,C=e.baseId,D=e.schema.required;if(D&&(!e.opts.$data||!D.$data)&&D.length8)i+=" || validate.schema"+o+".hasOwnProperty("+v+") ";else{var T=b;if(T)for(var N=-1,R=T.length-1;N0:e.util.schemaHasRules(Z,e.RULES.all)){var X=e.util.getProperty(W),ee=(Q=d+X,K&&void 0!==Z.default);h.schema=Z,h.schemaPath=o+X,h.errSchemaPath=c+"/"+e.util.escapeFragment(W),h.errorPath=e.util.getPath(e.errorPath,W,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(W);B=e.validate(h);if(h.baseId=C,e.util.varOccurences(B,y)<2){B=e.util.varReplace(B,y,Q);var te=Q}else{te=y;i+=" var "+y+" = "+Q+"; "}if(ee)i+=" "+B+" ";else{if(z&&z[W]){i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = false; ";L=e.errorPath,U=c;var re,ie=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(L,W,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ie+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ie+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";q=i;i=re.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+q+"]); ":i+=" validate.errors = ["+q+"]; return false; ":i+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=U,e.errorPath=L,i+=" } else { "}else l?(i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = true; } else { "):(i+=" if ("+te+" !== undefined ",j&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=" ) { ");i+=" "+B+" } "}}l&&(i+=" if ("+m+") { ",p+="}")}}if(E.length){var se=E;if(se)for(var ae,ne=-1,oe=se.length-1;ne0:e.util.schemaHasRules(Z,e.RULES.all)){h.schema=Z,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),i+=j?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+_+".length; "+f+"++) { var "+v+" = "+_+"["+f+"]; ":" for (var "+v+" in "+d+") { ",i+=" if ("+e.usePattern(ae)+".test("+v+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);Q=d+"["+v+"]";h.dataPathArr[g]=v;B=e.validate(h);h.baseId=C,e.util.varOccurences(B,y)<2?i+=" "+e.util.varReplace(B,y,Q)+" ":i+=" var "+y+" = "+Q+"; "+B+" ",l&&(i+=" if (!"+m+") break; "),i+=" } ",l&&(i+=" else "+m+" = true; "),i+=" } ",l&&(i+=" if ("+m+") { ",p+="}")}}}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},propertyNames:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(i+="var "+u+" = errors;",e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c;var m="key"+s,v="idx"+s,f="i"+s,g="' + "+m+" + '",y="data"+(h.dataLevel=e.dataLevel+1),_="dataProperties"+s,b=e.opts.ownProperties,w=e.baseId;b&&(i+=" var "+_+" = undefined; "),i+=b?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+d+") { ",i+=" var startErrs"+s+" = errors; ";var E=m,P=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=w,e.util.varOccurences(S,y)<2?i+=" "+e.util.varReplace(S,y,E)+" ":i+=" var "+y+" = "+E+"; "+S+" ",e.compositeRule=h.compositeRule=P,i+=" if (!"+p+") { for (var "+f+"=startErrs"+s+"; "+f+"0:e.util.schemaHasRules(_,e.RULES.all))||(m[m.length]=f)}}else m=n;if(h||m.length){var b=e.errorPath,w=h||m.length>=e.opts.loopRequired,E=e.opts.ownProperties;if(l)if(i+=" var missing"+s+"; ",w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),i+=" var "+u+" = true; ",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { "+u+" = "+d+"["+p+"["+x+"]] !== undefined ",E&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+="; if (!"+u+") break; } ",h&&(i+=" } "),i+=" if (!"+u+") { ",(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var k=m;if(k)for(var x=-1,$=k.length-1;x<$;){D=k[x+=1],x&&(i+=" || "),i+=" ( ( "+(N=d+(T=e.util.getProperty(D)))+" === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(D)+"') "),i+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?D:T)+") ) "}i+=") { ";var O;P="' + "+(j="missing"+s)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,j,!0):b+" + "+j),(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var j;P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),h&&(i+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { if ("+d+"["+p+"["+x+"]] === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(i+=" } ")}else{var C=m;if(C)for(var D,z=-1,A=C.length-1;z 1) { ";var m=e.schema.items&&e.schema.items.type,v=Array.isArray(m);if(!m||"object"==m||"array"==m||v&&(m.indexOf("object")>=0||m.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ";var f="checkDataType"+(v?"s":"");s+=" if ("+e.util[f](m,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",p&&(s+=" } "),s+=" if (!"+h+") { ";var g=g||[];g.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var y=s;s=g.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+y+"]); ":s+=" validate.errors = ["+y+"]; return false; ":s+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { ")}else d&&(s+=" if (true) { ");return s},validate:Ha},On=ua.toHash,jn=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],Cn=function(e,t){for(var r=0;r1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,s=1;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function f(e){throw new RangeError(p[e])}function g(e,t){var r=e.split("@"),i="";r.length>1&&(i=r[0]+"@",e=r[1]);var s=function(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r}((e=e.replace(h,".")).split("."),t).join(".");return i+s}function y(e){for(var t=[],r=0,i=e.length;r=55296&&s<=56319&&r>1,e+=m(e/t);e>455;i+=36)e=m(e/35);return m(i+36*e/(e+38))},w=function(e){var t,r=[],i=e.length,s=0,a=128,n=72,o=e.lastIndexOf("-");o<0&&(o=0);for(var c=0;c=128&&f("not-basic"),r.push(e.charCodeAt(c));for(var d=o>0?o+1:0;d=i&&f("invalid-input");var v=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(v>=36||v>m((l-s)/h))&&f("overflow"),s+=v*h;var g=p<=n?1:p>=n+26?26:p-n;if(vm(l/y)&&f("overflow"),h*=y}var _=r.length+1;n=b(s-u,_,0==u),m(s/_)>l-a&&f("overflow"),a+=m(s/_),s%=_,r.splice(s++,0,a)}return String.fromCodePoint.apply(String,r)},E=function(e){var t=[],r=(e=y(e)).length,i=128,s=0,a=72,n=!0,o=!1,c=void 0;try{for(var d,u=e[Symbol.iterator]();!(n=(d=u.next()).done);n=!0){var h=d.value;h<128&&t.push(v(h))}}catch(e){o=!0,c=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw c}}var p=t.length,g=p;for(p&&t.push("-");g=i&&$m((l-s)/O)&&f("overflow"),s+=(w-i)*O,i=w;var j=!0,C=!1,D=void 0;try{for(var z,A=e[Symbol.iterator]();!(j=(z=A.next()).done);j=!0){var T=z.value;if(Tl&&f("overflow"),T==i){for(var N=s,R=36;;R+=36){var F=R<=a?1:R>=a+26?26:R-a;if(N>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function $(e){for(var t="",r=0,i=e.length;r=194&&s<224){if(i-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(i-r>=9){var n=parseInt(e.substr(r+4,2),16),o=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&n)<<6|63&o)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function O(e,t){function r(e){var r=$(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,x).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,x).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,x).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,x).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,x).replace(t.PCT_ENCODED,s)),e}function j(e){return e.replace(/^0*(.*)/,"$1")||"0"}function C(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(j).join("."):e}function D(e,t){var r=e.match(t.IPV6ADDRESS)||[],i=c(r,3),s=i[1],a=i[2];if(s){for(var n=s.toLowerCase().split("::").reverse(),o=c(n,2),l=o[0],d=o[1],u=d?d.split(":").map(j):[],h=l.split(":").map(j),p=t.IPV4ADDRESS.test(h[h.length-1]),m=p?7:8,v=h.length-m,f=Array(m),g=0;g1){var b=f.slice(0,y.index),w=f.slice(y.index+y.length);_=b.join(":")+"::"+w.join(":")}else _=f.join(":");return a&&(_+="%"+a),_}return e}var z=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,A=void 0==="".match(/(){0}/)[1];function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?o:n;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(z);if(s){A?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=D(C(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=k[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)O(r,i);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=P(r.host.replace(i.PCT_ENCODED,$).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}O(r,n)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function N(e,t){var r=!1!==t.iri?o:n,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(D(C(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var R=/^\.\.?\//,F=/^\/\.(\/|$)/,I=/^\/\.\.(\/|$)/,M=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(I))e=e.replace(I,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(M);if(!r)throw new Error("Unexpected dot segment condition");var i=r[0];e=e.slice(i.length),t.push(i)}return t.join("")}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?o:n,i=[],s=k[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?S(e.host):P(e.host.replace(r.PCT_ENCODED,$).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}O(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var a=N(e,t);if(void 0!==a&&("suffix"!==t.reference&&i.push("//"),i.push(a),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||s&&s.absolutePath||(c=L(c)),void 0===a&&(c=c.replace(/^\/\//,"/%2F")),i.push(c)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],s={};return i||(e=T(V(e,r),r),t=T(V(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=L(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function q(e,t){return e&&e.toString().replace(t&&t.iri?o.PCT_ENCODED:n.PCT_ENCODED,$)}var H={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize};function B(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=B(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(B(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),i=c(r,2),s=i[0],a=i[1];e.path=s&&"/"!==s?s:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},G={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},W={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",J="[0-9A-Fa-f]",Z=r(r("%[EFef]"+J+"%"+J+J+"%"+J+J)+"|"+r("%[89A-Fa-f]"+J+"%"+J+J)+"|"+r("%"+J+J)),X=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ee=new RegExp(Y,"g"),te=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',X),"g"),ie=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),se=ie;function ae(e){var t=$(e);return t.match(ee)?t:e}var ne={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,a={},n=r.query.split("&"),o=0,c=n.length;o=55296&&t<=56319&&s=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!s)return a}for(var o=a,c=s.split("/"),l=0;l=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function Ga(e,t,r){var i=Wa.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function Wa(e,t,r){for(var i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,ln=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,dn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,un=/^(?:\/(?:[^~/]|~0|~1)*)*$/,hn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,pn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,mn=vn;function vn(e){return e="full"==e?"full":"fast",da.copy(vn[e])}function fn(e){var t=e.match(rn);if(!t)return!1;var r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2==i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:sn[i])}function gn(e,t){var r=e.match(an);if(!r)return!1;var i=r[1],s=r[2],a=r[3],n=r[5];return(i<=23&&s<=59&&a<=59||23==i&&59==s&&60==a)&&(!t||n)}vn.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":cn,url:ln,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:nn,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:wn,uuid:dn,"json-pointer":un,"json-pointer-uri-fragment":hn,"relative-json-pointer":pn},vn.full={date:fn,time:gn,"date-time":function(e){var t=e.split(yn);return 2==t.length&&fn(t[0])&&gn(t[1],!0)},uri:function(e){return _n.test(e)&&on.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":cn,url:ln,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:nn,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:wn,uuid:dn,"json-pointer":un,"json-pointer-uri-fragment":hn,"relative-json-pointer":pn};var yn=/t|\s/i;var _n=/\/|:/;var bn=/[^\\]\\Z/;function wn(e){if(bn.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var En=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o;var p="maximum"==t,m=p?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[m],f=e.opts.$data&&v&&v.$data,g=p?"<":">",y=p?">":"<",_=void 0;if(!h&&"number"!=typeof o&&void 0!==o)throw new Error(t+" must be number");if(!f&&void 0!==v&&"number"!=typeof v&&"boolean"!=typeof v)throw new Error(m+" must be number or boolean");if(f){var b=e.util.getData(v.$data,n,e.dataPathArr),w="exclusive"+a,E="exclType"+a,P="exclIsNumber"+a,S="' + "+($="op"+a)+" + '";s+=" var schemaExcl"+a+" = "+b+"; ",s+=" var "+w+"; var "+E+" = typeof "+(b="schemaExcl"+a)+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ";var k;_=m;(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var x=s;s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+E+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+b+" "+g+"= "+i+") ? "+u+" "+y+"= "+b+" : "+u+" "+y+" "+i+" ) : ( ("+w+" = "+b+" === true) ? "+u+" "+y+"= "+i+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { var op"+a+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===o&&(_=m,l=e.errSchemaPath+"/"+m,i=b,h=f)}else{S=g;if((P="number"==typeof v)&&h){var $="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" ( "+i+" === undefined || "+v+" "+g+"= "+i+" ? "+u+" "+y+"= "+v+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { "}else{P&&void 0===o?(w=!0,_=m,l=e.errSchemaPath+"/"+m,i=v,y+="="):(P&&(i=Math[p?"min":"max"](v,o)),v===(!P||i)?(w=!0,_=m,l=e.errSchemaPath+"/"+m,y+="="):(w=!1,S+="="));$="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+" "+y+" "+i+" || "+u+" !== "+u+") { "}}_=_||t,(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+$+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+S+" ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";x=s;return s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { "),s},Pn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},Sn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?s+=" "+u+".length ":s+=" ucs2length("+u+") ",s+=" "+p+" "+i+") { ";var m=t,v=v||[];v.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==t?"longer":"shorter",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var f=s;return s=v.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},kn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" Object.keys("+u+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},xn={$ref:function(e,t,r){var i,s,a=" ",n=e.level,o=e.dataLevel,c=e.schema[t],l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h="valid"+n;if("#"==c||"#/"==c)e.isRoot?(i=e.async,s="validate"):(i=!0===e.root.schema.$async,s="root.refVal[0]");else{var p=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===p){var m=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(m),(y=y||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;a=y.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,m);e.logger.warn(m),d&&(a+=" if (true) { ")}}else if(p.inline){var f=e.util.copy(e);f.level++;var g="valid"+f.level;f.schema=p.schema,f.schemaPath="",f.errSchemaPath=c,a+=" "+e.validate(f).replace(/validate\.schema/g,p.code)+" ",d&&(a+=" if ("+g+") { ")}else i=!0===p.$async||e.async&&!1!==p.$async,s=p.code}if(s){var y;(y=y||[]).push(a),a="",e.opts.passContext?a+=" "+s+".call(this, ":a+=" "+s+"( ",a+=" "+u+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var _=a+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";if(a=y.pop(),i){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(a+=" var "+h+"; "),a+=" try { await "+_+"; ",d&&(a+=" "+h+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(a+=" "+h+" = false; "),a+=" } ",d&&(a+=" if ("+h+") { ")}else a+=" if (!"+_+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",d&&(a+=" else { ")}return a},allOf:function(e,t,r){var i=" ",s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,c=e.util.copy(e),l="";c.level++;var d="valid"+c.level,u=c.baseId,h=!0,p=s;if(p)for(var m,v=-1,f=p.length-1;v0:e.util.schemaHasRules(m,e.RULES.all))&&(h=!1,c.schema=m,c.schemaPath=a+"["+v+"]",c.errSchemaPath=n+"/"+v,i+=" "+e.validate(c)+" ",c.baseId=u,o&&(i+=" if ("+d+") { ",l+="}"));return o&&(i+=h?" if (true) { ":" "+l.slice(0,-1)+" "),i},anyOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level;if(n.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var f=p.baseId;i+=" var "+h+" = errors; var "+u+" = false; ";var g=e.compositeRule;e.compositeRule=p.compositeRule=!0;var y=n;if(y)for(var _,b=-1,w=y.length-1;b0:e.util.schemaHasRules(n,e.RULES.all);if(i+="var "+h+" = errors;var "+u+";",_){var b=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+m+" = false; for (var "+v+" = 0; "+v+" < "+d+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var w=d+"["+v+"]";p.dataPathArr[f]=v;var E=e.validate(p);p.baseId=y,e.util.varOccurences(E,g)<2?i+=" "+e.util.varReplace(E,g,w)+" ":i+=" var "+g+" = "+w+"; "+E+" ",i+=" if ("+m+") break; } ",e.compositeRule=p.compositeRule=b,i+=" if (!"+m+") {"}else i+=" if ("+d+".length == 0) {";var P=P||[];P.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;return i=P.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",_&&(i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i},dependencies:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v={},f={},g=e.opts.ownProperties;for(w in n)if("__proto__"!=w){var y=n[w],_=Array.isArray(y)?f:v;_[w]=y}i+="var "+u+" = errors;";var b=e.errorPath;for(var w in i+="var missing"+s+";",f)if((_=f[w]).length){if(i+=" if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),l){i+=" && ( ";var E=_;if(E)for(var P=-1,S=E.length-1;P0:e.util.schemaHasRules(y,e.RULES.all))&&(i+=" "+m+" = true; if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),i+=") { ",h.schema=y,h.schemaPath=o+e.util.getProperty(w),h.errSchemaPath=c+"/"+e.util.escapeFragment(w),i+=" "+e.validate(h)+" ",h.baseId=N,i+=" } ",l&&(i+=" if ("+m+") { ",p+="}"))}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},enum:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h=e.opts.$data&&n&&n.$data;h&&(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ");var p="i"+s,m="schema"+s;h||(i+=" var "+m+" = validate.schema"+o+";"),i+="var "+u+";",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=u+" = false;for (var "+p+"=0; "+p+"<"+m+".length; "+p+"++) if (equal("+d+", "+m+"["+p+"])) { "+u+" = true; break; }",h&&(i+=" } "),i+=" if (!"+u+") { ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var f=i;return i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i},format:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||"");if(!1===e.opts.format)return l&&(i+=" if (true) { "),i;var u,h=e.opts.$data&&n&&n.$data;h?(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ",u="schema"+s):u=n;var p=e.opts.unknownFormats,m=Array.isArray(p);if(h){i+=" var "+(v="format"+s)+" = formats["+u+"]; var "+(f="isObject"+s)+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+(g="formatType"+s)+" = "+f+" && "+v+".type || 'string'; if ("+f+") { ",e.async&&(i+=" var async"+s+" = "+v+".async; "),i+=" "+v+" = "+v+".validate; } if ( ",h&&(i+=" ("+u+" !== undefined && typeof "+u+" != 'string') || "),i+=" (","ignore"!=p&&(i+=" ("+u+" && !"+v+" ",m&&(i+=" && self._opts.unknownFormats.indexOf("+u+") == -1 "),i+=") || "),i+=" ("+v+" && "+g+" == '"+r+"' && !(typeof "+v+" == 'function' ? ",e.async?i+=" (async"+s+" ? await "+v+"("+d+") : "+v+"("+d+")) ":i+=" "+v+"("+d+") ",i+=" : "+v+".test("+d+"))))) {"}else{var v;if(!(v=e.formats[n])){if("ignore"==p)return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(i+=" if (true) { "),i;if(m&&p.indexOf(n)>=0)return l&&(i+=" if (true) { "),i;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var f,g=(f="object"==typeof v&&!(v instanceof RegExp)&&v.validate)&&v.type||"string";if(f){var y=!0===v.async;v=v.validate}if(g!=r)return l&&(i+=" if (true) { "),i;if(y){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(_="formats"+e.util.getProperty(n)+".validate")+"("+d+"))) { "}else{i+=" if (! ";var _="formats"+e.util.getProperty(n);f&&(_+=".validate"),i+="function"==typeof v?" "+_+"("+d+") ":" "+_+".test("+d+") ",i+=") { "}}var b=b||[];b.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",i+=h?""+u:""+e.util.toQuotedString(n),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=h?"' + "+u+" + '":""+e.util.escapeQuotes(n),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+o:""+e.util.toQuotedString(n),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;return i=b.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i},if:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,v=e.schema.then,f=e.schema.else,g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),y=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0:e.util.schemaHasRules(f,e.RULES.all)),_=p.baseId;if(g||y){var b;p.createErrors=!1,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+h+" = errors; var "+u+" = true; ";var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,i+=" "+e.validate(p)+" ",p.baseId=_,p.createErrors=!0,i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=w,g?(i+=" if ("+m+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'then'; ":b="'then'",i+=" } ",y&&(i+=" else { ")):i+=" if (!"+m+") { ",y&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'else'; ":b="'else'",i+=" } "),i+=" if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i},items:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,_=e.baseId;if(i+="var "+h+" = errors;var "+u+";",Array.isArray(n)){var b=e.schema.additionalItems;if(!1===b){i+=" "+u+" = "+d+".length <= "+n.length+"; ";var w=c;c=e.errSchemaPath+"/additionalItems",i+=" if (!"+u+") { ";var E=E||[];E.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var P=i;i=E.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+P+"]); ":i+=" validate.errors = ["+P+"]; return false; ":i+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c=w,l&&(m+="}",i+=" else { ")}var S=n;if(S)for(var k,x=-1,$=S.length-1;x<$;)if(k=S[x+=1],e.opts.strictKeywords?"object"==typeof k&&Object.keys(k).length>0:e.util.schemaHasRules(k,e.RULES.all)){i+=" "+v+" = true; if ("+d+".length > "+x+") { ";var O=d+"["+x+"]";p.schema=k,p.schemaPath=o+"["+x+"]",p.errSchemaPath=c+"/"+x,p.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),p.dataPathArr[g]=x;var j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",i+=" } ",l&&(i+=" if ("+v+") { ",m+="}")}if("object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0:e.util.schemaHasRules(b,e.RULES.all))){p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+v+" = true; if ("+d+".length > "+n.length+") { for (var "+f+" = "+n.length+"; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" } } ",l&&(i+=" if ("+v+") { ",m+="}")}}else if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" for (var "+f+" = 0; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" }"}return l&&(i+=" "+m+" if ("+h+" == errors) {"),i},maximum:En,minimum:En,maxItems:Pn,minItems:Pn,maxLength:Sn,minLength:Sn,maxProperties:kn,minProperties:kn,multipleOf:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="var division"+a+";if (",h&&(s+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),s+=" (division"+a+" = "+u+" / "+i+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+a+" !== parseInt(division"+a+") ",s+=" ) ",h&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},not:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c,i+=" var "+u+" = errors; ";var m,v=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(m=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,m&&(h.opts.allErrors=m),e.compositeRule=h.compositeRule=v,i+=" if ("+p+") { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var g=i;i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(i+=" if (false) { ");return i},oneOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f=p.baseId,g="prevValid"+s,y="passingSchemas"+s;i+="var "+h+" = errors , "+g+" = false , "+u+" = false , "+y+" = null; ";var _=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=n;if(b)for(var w,E=-1,P=b.length-1;E0:e.util.schemaHasRules(w,e.RULES.all))?(p.schema=w,p.schemaPath=o+"["+E+"]",p.errSchemaPath=c+"/"+E,i+=" "+e.validate(p)+" ",p.baseId=f):i+=" var "+v+" = true; ",E&&(i+=" if ("+v+" && "+g+") { "+u+" = false; "+y+" = ["+y+", "+E+"]; } else { ",m+="}"),i+=" if ("+v+") { "+u+" = "+g+" = true; "+y+" = "+E+"; }";return e.compositeRule=p.compositeRule=_,i+=m+"if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i},pattern:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),s+=" !"+(h?"(new RegExp("+i+"))":e.usePattern(o))+".test("+u+") ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",s+=h?""+i:""+e.util.toQuotedString(o),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=h?"' + "+i+" + '":""+e.util.escapeQuotes(o),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},properties:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="key"+s,f="idx"+s,g=h.dataLevel=e.dataLevel+1,y="data"+g,_="dataProperties"+s,b=Object.keys(n||{}).filter(A),w=e.schema.patternProperties||{},E=Object.keys(w).filter(A),P=e.schema.additionalProperties,S=b.length||E.length,k=!1===P,x="object"==typeof P&&Object.keys(P).length,$=e.opts.removeAdditional,O=k||x||$,j=e.opts.ownProperties,C=e.baseId,D=e.schema.required;if(D&&(!e.opts.$data||!D.$data)&&D.length8)i+=" || validate.schema"+o+".hasOwnProperty("+v+") ";else{var T=b;if(T)for(var N=-1,R=T.length-1;N0:e.util.schemaHasRules(Z,e.RULES.all)){var X=e.util.getProperty(W),ee=(Q=d+X,K&&void 0!==Z.default);h.schema=Z,h.schemaPath=o+X,h.errSchemaPath=c+"/"+e.util.escapeFragment(W),h.errorPath=e.util.getPath(e.errorPath,W,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(W);B=e.validate(h);if(h.baseId=C,e.util.varOccurences(B,y)<2){B=e.util.varReplace(B,y,Q);var te=Q}else{te=y;i+=" var "+y+" = "+Q+"; "}if(ee)i+=" "+B+" ";else{if(z&&z[W]){i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = false; ";L=e.errorPath,U=c;var re,ie=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(L,W,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ie+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ie+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";q=i;i=re.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+q+"]); ":i+=" validate.errors = ["+q+"]; return false; ":i+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=U,e.errorPath=L,i+=" } else { "}else l?(i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = true; } else { "):(i+=" if ("+te+" !== undefined ",j&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=" ) { ");i+=" "+B+" } "}}l&&(i+=" if ("+m+") { ",p+="}")}}if(E.length){var se=E;if(se)for(var ae,ne=-1,oe=se.length-1;ne0:e.util.schemaHasRules(Z,e.RULES.all)){h.schema=Z,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),i+=j?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+_+".length; "+f+"++) { var "+v+" = "+_+"["+f+"]; ":" for (var "+v+" in "+d+") { ",i+=" if ("+e.usePattern(ae)+".test("+v+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);Q=d+"["+v+"]";h.dataPathArr[g]=v;B=e.validate(h);h.baseId=C,e.util.varOccurences(B,y)<2?i+=" "+e.util.varReplace(B,y,Q)+" ":i+=" var "+y+" = "+Q+"; "+B+" ",l&&(i+=" if (!"+m+") break; "),i+=" } ",l&&(i+=" else "+m+" = true; "),i+=" } ",l&&(i+=" if ("+m+") { ",p+="}")}}}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},propertyNames:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(i+="var "+u+" = errors;",e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c;var m="key"+s,v="idx"+s,f="i"+s,g="' + "+m+" + '",y="data"+(h.dataLevel=e.dataLevel+1),_="dataProperties"+s,b=e.opts.ownProperties,w=e.baseId;b&&(i+=" var "+_+" = undefined; "),i+=b?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+d+") { ",i+=" var startErrs"+s+" = errors; ";var E=m,P=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=w,e.util.varOccurences(S,y)<2?i+=" "+e.util.varReplace(S,y,E)+" ":i+=" var "+y+" = "+E+"; "+S+" ",e.compositeRule=h.compositeRule=P,i+=" if (!"+p+") { for (var "+f+"=startErrs"+s+"; "+f+"0:e.util.schemaHasRules(_,e.RULES.all))||(m[m.length]=f)}}else m=n;if(h||m.length){var b=e.errorPath,w=h||m.length>=e.opts.loopRequired,E=e.opts.ownProperties;if(l)if(i+=" var missing"+s+"; ",w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),i+=" var "+u+" = true; ",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { "+u+" = "+d+"["+p+"["+x+"]] !== undefined ",E&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+="; if (!"+u+") break; } ",h&&(i+=" } "),i+=" if (!"+u+") { ",(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var k=m;if(k)for(var x=-1,$=k.length-1;x<$;){D=k[x+=1],x&&(i+=" || "),i+=" ( ( "+(N=d+(T=e.util.getProperty(D)))+" === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(D)+"') "),i+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?D:T)+") ) "}i+=") { ";var O;P="' + "+(j="missing"+s)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,j,!0):b+" + "+j),(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var j;P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),h&&(i+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { if ("+d+"["+p+"["+x+"]] === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(i+=" } ")}else{var C=m;if(C)for(var D,z=-1,A=C.length-1;z 1) { ";var m=e.schema.items&&e.schema.items.type,v=Array.isArray(m);if(!m||"object"==m||"array"==m||v&&(m.indexOf("object")>=0||m.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ";var f="checkDataType"+(v?"s":"");s+=" if ("+e.util[f](m,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",p&&(s+=" } "),s+=" if (!"+h+") { ";var g=g||[];g.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var y=s;s=g.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+y+"]); ":s+=" validate.errors = ["+y+"]; return false; ":s+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { ")}else d&&(s+=" if (true) { ");return s},validate:qa},$n=da.toHash,On=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],jn=function(e,t){for(var r=0;r{let a=ls("services."+ea({service:r,service_data:{[e]:t}}));a&&(i=a,delete s[e])}),!i&&s&&Object.keys(s).length&&Object.entries(s).forEach(([e])=>{let t=ls(`services.${r}_${e}`);t&&(i=t)}),i||(i=ls("services."+ea({service:r}))||r);const a=i.match(/\{([^}]+)\}/);if(a){let e="";Object.keys(s).length&&Object.entries(s).forEach(([r,i])=>{a[1].includes(r)&&(e=a[1].replace(r,io(r,i,t)))}),i=i.replace(/\{([^}]+)\}/,e)}return Zs(i)}window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-entity-row",name:"scheduler-entity-row",description:"Show a schedule entity in entities card."});let ao=class extends ie{setConfig(e){this._config=e}shouldUpdate(e){const t=e.get("hass");if(t&&this._config&&1==e.size){const e=this._config.entity;return t.states[e]!==this.hass.states[e]}return!0}render(){var e;if(!this._config||!this.hass)return I``;const t=this.hass.states[this._config.entity];if(!t)return I` + `;function ro(e,t,r){switch(e){case"position":return Number(t)+"%";case"temperature":return`${Number(t)}${r.config.unit_system.temperature}`;case"humidity":return Number(t)+"%";case"brightness":return Math.round(Number(t)/2.55)+"%";default:return""+t}}function io(e,t){if("name"in e&&e.name)return String(e.name);const r=e.service;let i,s=Object.assign({},e.service_data);s&&Object.keys(s).length&&Object.entries(s).forEach(([e,t])=>{let a=ls("services."+Xs({service:r,service_data:{[e]:t}}));a&&(i=a,delete s[e])}),!i&&s&&Object.keys(s).length&&Object.entries(s).forEach(([e])=>{let t=ls(`services.${r}_${e}`);t&&(i=t)}),i||(i=ls("services."+Xs({service:r}))||r);const a=i.match(/\{([^}]+)\}/);if(a){let e="";Object.keys(s).length&&Object.entries(s).forEach(([r,i])=>{a[1].includes(r)&&(e=a[1].replace(r,ro(r,i,t)))}),i=i.replace(/\{([^}]+)\}/,e)}return Js(i)}let so=class extends ie{shouldUpdate(e){const t=e.get("hass");return!t||1!=e.size||!this.schedule_entity||t.states[this.schedule_entity]!==this.hass.states[this.schedule_entity]}render(){var e;if(!this.config||!this.hass||!this.schedule_entity)return I``;const t=this.hass.states[this.schedule_entity];if(!t)return I` - Entity not found '${this._config.entity}' + Entity not found '${this.schedule_entity}' - `;let r=t.attributes.entries.map(Cs),i=this.computeNextEntry(r),s=ra(i.actions.map(e=>t.attributes.actions[e])[0]),a=this.hass.states[s.entity],n=this._config.name?this._config.name:a?a.attributes.friendly_name||ke(a.entity_id):"(unknown entity)",o=this._config.icon?this._config.icon:a?"folder-outline":"help-circle-outline";if(this._config.config&&s.entity in this._config.config&&this._config.config[s.entity]){n=this._config.config[s.entity].name||n,o=this._config.config[s.entity].icon||o;const e=ia(this._config.config[s.entity],s);if(e.length){const t=this._config.config[s.entity].actions[e[0]];t.icon&&(o=t.icon),s=ta(Object.assign(Object.assign({},t),{service_data:Object.assign(Object.assign({},t.service_data||{}),s.service_data||{})}))}}(null===(e=t.attributes.friendly_name)||void 0===e?void 0:e.match(/^schedule\ #[0-9a-f]{6}$/i))||t.attributes.friendly_name;return I` + `;const r=t.attributes.entries.map(js),i=this.computeNextEntry(r),s=ta(i.actions.map(e=>t.attributes.actions[e])[0]),a=this.hass.states[s.entity];let n="(unknown entity)",o="help-circle-outline",c=aa(a,this.config);if(c){o=ia(c,s).icon||c.icon||a.attributes.icon||"flash",n=c.name}(null===(e=t.attributes.friendly_name)||void 0===e?void 0:e.match(/^schedule\ #[0-9a-f]{6}$/i))||t.attributes.friendly_name;return I`
- ${Js(Zs(n))}: ${Js(so(s,this.hass))} + ${Ys(Js(n))}: ${Ys(io(s,this.hass))}
- ${Js(Es(this.computeTimestamp(i)))}
+ ${Ys(ws(this.computeTimestamp(i)))}
${r.length>1?2==r.length?ls("misc.one_additional_task"):ls("misc.x_additional_tasks","{count}",String(r.length-1)):""}
- `}computeTimestamp(e){let t=new Date,r=new Date;r.setSeconds(0);let i=e.time.value;if(e.time.event){let t=this.hass.states["sun.sun"];if(!t)return new Date(0);i=(e.time.event==ps.Sunrise?ys(t.attributes.next_rising):ys(t.attributes.next_setting))+e.time.value}let s=Math.floor(i/60),a=i-60*s;r.setHours(s),r.setMinutes(a);let n=_s(e.days);for(;r.valueOf()<=t.valueOf()||!n.includes(ws(r));)r.setDate(r.getDate()+1);return r}computeNextEntry(e){let t=e.map(e=>this.computeTimestamp(e)),r=-1,i=-1;return t.forEach((e,t)=>{(-1===r||e.valueOf()this.computeTimestamp(e)),r=-1,i=-1;return t.forEach((e,t)=>{(-1===r||e.valueOf()aa(e)).map(([,e])=>e);void 0===this.config.discover_existing||this.config.discover_existing||(e=e.filter(e=>e.attributes.actions.map(e=>e.entity).every(e=>this._hass.states[e]&&oa(this._hass.states[e],this.config)))),e.sort((e,t)=>{const r=e.attributes.next_trigger?new Date(e.attributes.next_trigger).valueOf():null,i=t.attributes.next_trigger?new Date(t.attributes.next_trigger).valueOf():null;return null!==r&&null!==i?r>i?1:raa(e));return e.length!==this.scheduleEntities.length?(this.loadSchedules(),!0):!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e])}return this.loadSchedules(),!0}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>aa(e)),this._hass=e}render(){return this._hass&&this.config&&this.schedules?I` + `,t([J()],so.prototype,"hass",void 0),t([J()],so.prototype,"schedule_entity",void 0),t([J()],so.prototype,"config",void 0),so=t([W("scheduler-entity-row")],so);let ao=class extends ie{constructor(){super(...arguments),this.schedules=[],this.scheduleEntities=[]}loadSchedules(){if(!this._hass||!this.config)return;let e=Object.entries(this._hass.states).filter(([e])=>sa(e)).map(([,e])=>e);void 0===this.config.discover_existing||this.config.discover_existing||(e=e.filter(e=>e.attributes.actions.map(e=>e.entity).every(e=>this._hass.states[e]&&na(this._hass.states[e],this.config)))),e.sort((e,t)=>{const r=e.attributes.next_trigger?new Date(e.attributes.next_trigger).valueOf():null,i=t.attributes.next_trigger?new Date(t.attributes.next_trigger).valueOf():null;return null!==r&&null!==i?r>i?1:rsa(e));return e.length!==this.scheduleEntities.length?(this.loadSchedules(),!0):!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e])}return this.loadSchedules(),!0}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>sa(e)),this._hass=e}render(){return this._hass&&this.config&&this.schedules?I`
@@ -321,7 +320,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
${this.schedules.length&&this.config.show_header_toggle?I` "on"==e.state)} + ?checked=${this.schedules.some(e=>"waiting"==e.state||"triggered"==e.state)} @change=${this.toggleDisableAll} > `:""} @@ -338,12 +337,13 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
`:""} - `:I``}getRows(){if(!this.config||!this._hass||!this.schedules)return I``;let e=[];this.schedules.forEach(t=>e=e.concat(t.attributes.actions.map(e=>e.entity))),e=e.filter((e,t,r)=>r.indexOf(e)===t);const t=e.map(e=>[e,na(this._hass.states[e],this.config)]).reduce((e,[t,r])=>Object.assign(e,{[String(t)]:r}),{});return this.schedules.length?this.schedules.map(e=>e.entity_id).map(e=>{const r=this._hass.states[e];return!r.attributes.actions.every(e=>oa(e.entity,this.config))?I` + `:I``}getRows(){return this.config&&this._hass&&this.schedules?this.schedules.length?this.schedules.map(e=>e.entity_id).map(e=>{const t=this._hass.states[e];return!t.attributes.actions.map(ta).every(e=>na(e.entity,this.config))?I` this.editItemClick(e)} > @@ -353,14 +353,15 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad `:I` this.editItemClick(e)} > - `}):I`${ls("instructions.no_entries_defined")}`}toggleDisableAll(e){if(!this._hass||!this.schedules)return;let t=e.target.checked;this.schedules.forEach(e=>{this._hass.callService("switch",t?"turn_on":"turn_off",{entity_id:e.entity_id})})}editItemClick(e){let t=new CustomEvent("editClick",{detail:e});this.dispatchEvent(t)}newItemClick(){let e=new CustomEvent("newClick");this.dispatchEvent(e)}};function co(e,t){const r=[];t.groups&&t.groups.forEach(t=>{const i={id:t.name,name:t.name,icon:t.icon||"folder-outline",entities:e.filter(e=>Qs(e,t))};r.push(i)});const i=e.filter(e=>!r.some(t=>t.entities.includes(e)));return i.map(Se).filter((e,t,r)=>r.indexOf(e)===t).forEach(e=>{const s={id:e,name:e in us?ls(us[e]):e,icon:(void 0===t.standard_configuration||t.standard_configuration)&&e in Bs?Bs[e]:"folder-outline",entities:i.filter(t=>Qs(t,{include:[e]}))};r.push(s)}),r}oo.styles=te` - ${ro} + `}):I`${ls("instructions.no_entries_defined")}`:I``}toggleDisableAll(e){if(!this._hass||!this.schedules)return;let t=e.target.checked;this.schedules.forEach(e=>{this._hass.callService("switch",t?"turn_on":"turn_off",{entity_id:e.entity_id})})}editItemClick(e){let t=new CustomEvent("editClick",{detail:e});this.dispatchEvent(t)}newItemClick(){let e=new CustomEvent("newClick");this.dispatchEvent(e)}};function no(e,t){const r=[];t.groups&&t.groups.forEach(t=>{const i={id:t.name,name:t.name,icon:t.icon||"folder-outline",entities:e.filter(e=>Hs(e,t))};r.push(i)});const i=e.filter(e=>!r.some(t=>t.entities.includes(e)));return i.map(Se).filter((e,t,r)=>r.indexOf(e)===t).forEach(e=>{const s={id:e,name:ls("domains."+e)||e,icon:(void 0===t.standard_configuration||t.standard_configuration)&&e in Qs?Qs[e]:"folder-outline",entities:i.filter(t=>Hs(t,{include:[e]}))};r.push(s)}),r}ao.styles=te` + ${to} .card-content > * { margin: 20px 0px; } @@ -375,16 +376,16 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad hui-warning { padding: 10px 0px; } - `,t([J()],oo.prototype,"_hass",void 0),t([J()],oo.prototype,"config",void 0),oo=t([W("scheduler-entities-card")],oo);let lo=class extends ie{constructor(){super(...arguments),this.items=[]}render(){return this.items.length?this.items.map(e=>this.createButton(e)):I` + `,t([J()],ao.prototype,"_hass",void 0),t([J()],ao.prototype,"config",void 0),ao=t([W("scheduler-entities-card")],ao);let oo=class extends ie{constructor(){super(...arguments),this.items=[]}render(){return this.items.length?this.items.map(e=>this.createButton(e)):I`
`}createButton(e){let t=Array.isArray(this.value)?this.value:[this.value];"object"!=typeof e&&(e={name:String(e)});let r=void 0!==e.id?e.id:e.name;return I` - ${e.icon?I``:""} - ${Zs(e.name)} + ${e.icon?I``:""} + ${Js(e.name)} - `}selectItem(e){if(Array.isArray(this.value)){let t=Array.isArray(this.value)?this.value:[];if(t.includes(e)){if(void 0!==this.min&&t.length<=this.min)return;t=t.filter(t=>t!=e)}else t.push(e);this.value=t}else if(e==this.value){if(!this.optional)return;this.value=null}else this.value=e;let t=new CustomEvent("change");this.dispatchEvent(t)}};lo.styles=ro,t([J({type:Array})],lo.prototype,"items",void 0),t([J()],lo.prototype,"value",void 0),t([J({type:Number})],lo.prototype,"min",void 0),t([J({type:Boolean})],lo.prototype,"optional",void 0),lo=t([W("button-group")],lo);let uo=class extends ie{getGroups(){if(!this.hass||!this.config)return[];let e=co(Object.values(this.hass.states).filter(e=>oa(e,this.config,{actions:!0})).map(e=>e.entity_id),this.config);return e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>na(this.hass.states[e],this.config)).filter(e=>e);return t.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedEntity);let r=t.actions.map(ta).map(e=>e.name?e:Object.assign(e,{name:so(e,this.hass)}));return t.exclude_actions&&(r=r.filter(e=>{var r;return!(null===(r=t.exclude_actions)||void 0===r?void 0:r.includes(e.name.trim().toLowerCase()))})),r.sort((e,t)=>e.name.trim().toLowerCase()t!=e)}else t.push(e);this.value=t}else if(e==this.value){if(!this.optional)return;this.value=null}else this.value=e;let t=new CustomEvent("change");this.dispatchEvent(t)}};oo.styles=to,t([J({type:Array})],oo.prototype,"items",void 0),t([J()],oo.prototype,"value",void 0),t([J({type:Number})],oo.prototype,"min",void 0),t([J({type:Boolean})],oo.prototype,"optional",void 0),oo=t([W("button-group")],oo);let co=class extends ie{getGroups(){if(!this.hass||!this.config)return[];let e=no(Object.values(this.hass.states).filter(e=>na(e,this.config,{actions:!0})).map(e=>e.entity_id),this.config);return e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>aa(this.hass.states[e],this.config)).filter(e=>e);return t.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedEntity);let r=t.actions.map(ea).map(e=>e.name?e:Object.assign(e,{name:io(e,this.hass)})).map(e=>e.icon?e:Object.assign(e,{icon:"flash"}));return t.exclude_actions&&(r=r.filter(e=>{var r;return!(null===(r=t.exclude_actions)||void 0===r?void 0:r.includes(e.name.trim().toLowerCase()))})),r.sort((e,t)=>e.name.trim().toLowerCase()
@@ -421,12 +422,12 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad {this.selectedAction="make_scheme"}}> - - ${Zs("make_scheme")} + + ${Js("make_scheme")}
- `:I``}selectGroup(e){let t="string"==typeof e?e:e.target.value;this.selectedGroup=t,this.selectedEntity=void 0,this.selectedAction=void 0}selectEntity(e){let t="string"==typeof e?e:e.target.value;this.selectedEntity=t,this.selectedAction=void 0}selectAction(e){let t="string"==typeof e?e:e.target.value;this.selectedAction=t}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}nextClick(){let e=new CustomEvent("nextClick",{detail:{entity:this.selectedEntity,action:this.selectedAction}});this.dispatchEvent(e)}};uo.styles=ro,t([J()],uo.prototype,"hass",void 0),t([J()],uo.prototype,"config",void 0),t([J()],uo.prototype,"selectedGroup",void 0),t([J()],uo.prototype,"selectedEntity",void 0),t([J()],uo.prototype,"selectedAction",void 0),uo=t([W("scheduler-editor-card")],uo);let ho=class extends ie{constructor(){super(...arguments),this._val=0,this.formatAmPm=!1,this.stepSize=10,this.maxOffset=2}set value(e){let t=this.value;this._val=e,this.requestUpdate("value",t)}get value(){return vs(this._val,this.stepSize)}updated(){let e=new CustomEvent("change",{detail:{event:this.event}});this.dispatchEvent(e)}firstUpdated(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this.value,e)}render(){return I` + `:I``}selectGroup(e){let t="string"==typeof e?e:e.target.value;this.selectedGroup=t,this.selectedEntity=void 0,this.selectedAction=void 0}selectEntity(e){let t="string"==typeof e?e:e.target.value;this.selectedEntity=t,this.selectedAction=void 0}selectAction(e){let t="string"==typeof e?e:e.target.value;this.selectedAction=t}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}nextClick(){let e=new CustomEvent("nextClick",{detail:{entity:this.selectedEntity,action:this.selectedAction}});this.dispatchEvent(e)}};co.styles=to,t([J()],co.prototype,"hass",void 0),t([J()],co.prototype,"config",void 0),t([J()],co.prototype,"selectedGroup",void 0),t([J()],co.prototype,"selectedEntity",void 0),t([J()],co.prototype,"selectedAction",void 0),co=t([W("scheduler-editor-card")],co);let lo=class extends ie{constructor(){super(...arguments),this._val=0,this.formatAmPm=!1,this.stepSize=10,this.maxOffset=2}set value(e){let t=this.value;this._val=e,this.requestUpdate("value",t)}get value(){return ps(this._val,this.stepSize)}updated(){let e=new CustomEvent("change",{detail:{event:this.event}});this.dispatchEvent(e)}firstUpdated(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=vs(this.value,e)}render(){return I`
@@ -456,17 +457,17 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getSunModeToggle()}
- `}getHours(){return fs(this.value,{amPm:this.formatAmPm}).hours}getMinutes(){return fs(this.value,{amPm:this.formatAmPm}).minutes}hoursUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val+60,e)}hoursDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val-60,e)}minutesUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val+this.stepSize,e)}minutesDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val-this.stepSize,e)}getSunModeToggle(){return this.hass&&this.hass.states["sun.sun"]?I` + `}getHours(){return ms(this.value,{amPm:this.formatAmPm}).hours}getMinutes(){return ms(this.value,{amPm:this.formatAmPm}).minutes}hoursUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=vs(this._val+60,e)}hoursDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=vs(this._val-60,e)}minutesUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=vs(this._val+this.stepSize,e)}minutesDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=vs(this._val-this.stepSize,e)}getSunModeToggle(){return this.hass&&this.hass.states["sun.sun"]?I` - `:I``}getAmPm(){return fs(this._val,{amPm:this.formatAmPm}).amPm}getBeforeAfter(){return this.value<0?ls("words.before"):ls("words.after")}getSuffix(){return this.event?I` + `:I``}getAmPm(){return ms(this._val,{amPm:this.formatAmPm}).amPm}getBeforeAfter(){return this.value<0?ls("words.before"):ls("words.after")}getSuffix(){return this.event?I`
${this.getBeforeAfter()} - +
`:this.formatAmPm?I` @@ -475,7 +476,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getAmPm()} - `:I``}toggleAmPm(){this._val<720?this.value=gs(this._val+720):this.value=gs(this._val-720)}toggleBeforeAfter(){this.value=-this._val}toggleSunriseSunset(){this.event=this.event==ps.Sunrise?ps.Sunset:ps.Sunrise,this.value=this._val}toggleMode(){if(!this.hass)return;let e=this.hass.states["sun.sun"],t=ys(e.attributes.next_rising),r=ys(e.attributes.next_setting),i=this.value;if(this.event){let e=this.event==ps.Sunrise?t:r;this.event=void 0,this.value=i+e}else{let e;Math.abs(i-t)60*this.maxOffset?this.value=60*this.maxOffset:this.value<60*-this.maxOffset&&(this.value=60*-this.maxOffset)}}};function po(e){return e.endTime.value-e.time.value}ho.styles=te` + `:I``}toggleAmPm(){this._val<720?this.value=vs(this._val+720):this.value=vs(this._val-720)}toggleBeforeAfter(){this.value=-this._val}toggleSunriseSunset(){this.event=this.event==us.Sunrise?us.Sunset:us.Sunrise,this.value=this._val}toggleMode(){if(!this.hass)return;let e=this.hass.states["sun.sun"],t=fs(e.attributes.next_rising),r=fs(e.attributes.next_setting),i=this.value;if(this.event){let e=this.event==us.Sunrise?t:r;this.event=void 0,this.value=i+e}else{let e;Math.abs(i-t)60*this.maxOffset?this.value=60*this.maxOffset:this.value<60*-this.maxOffset&&(this.value=60*-this.maxOffset)}}};function uo(e){return e.endTime.value-e.time.value}lo.styles=te` div.time-picker { display: grid; grid-template-columns: min-content min-content min-content 1fr min-content; @@ -520,7 +521,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad --mdc-theme-primary: var(--text-primary-color); border-radius: 4px; } - `,t([J({type:Number})],ho.prototype,"value",null),t([J()],ho.prototype,"hass",void 0),t([J({type:String})],ho.prototype,"event",void 0),t([J({type:Boolean})],ho.prototype,"formatAmPm",void 0),t([J({type:Number})],ho.prototype,"stepSize",void 0),ho=t([W("time-picker")],ho);let mo=class extends ie{constructor(){super(...arguments),this.entries=[],this.actions=[],this.stepSize=10,this._activeEntry=null,this._activeThumb=null}render(){return I` + `,t([J({type:Number})],lo.prototype,"value",null),t([J()],lo.prototype,"hass",void 0),t([J({type:String})],lo.prototype,"event",void 0),t([J({type:Boolean})],lo.prototype,"formatAmPm",void 0),t([J({type:Number})],lo.prototype,"stepSize",void 0),lo=t([W("time-picker")],lo);let ho=class extends ie{constructor(){super(...arguments),this.entries=[],this.actions=[],this.stepSize=10,this._activeEntry=null,this._activeThumb=null}render(){return I`
@@ -564,16 +565,16 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad `}
`}getSlots(){let e=[];return this.entries.forEach((t,r)=>{if(e.push(I` -
+
${this.getEntryAction(t)}
`),r
- ${fs(t).time} + ${ms(t).time}
-
`)}}),e}updated(){this.shadowRoot.querySelectorAll(".slider-thumb-tooltip").forEach((e,t)=>{let r=this.entries[t].endTime.value;e.innerText=fs(r).time})}getEntryAction(e){if(!this.hass)return;if(!e.action)return"";let t=this.actions.find(t=>t.id==e.action);if(e.variable&&e.variable.type==xe.Level&&t.variable){if(e.variable.enabled)return io(t.variable.field,Number(e.variable.value),this.hass)}else if(e.variable&&e.variable.type==xe.List)return Zs(String(e.variable.value));const r=t.service;return Zs(t.name||ls("services."+r)||r)}_handleSegmentClick(e){let t=e.target,r=Number(t.getAttribute("index"));this._activeEntry=this._activeEntry==r?null:r;let i=new CustomEvent("update",{detail:{entry:this._activeEntry}});this.dispatchEvent(i)}_handleTouchStart(e){let t;if(t=e.target,!t)return;let r=t.parentNode,i=r.parentElement,s=i.getBoundingClientRect(),a=r.previousElementSibling,n=r.nextElementSibling,o=r.querySelector(".slider-thumb-tooltip");this._activeThumb=Number(r.getAttribute("index"));const c=a.offsetWidth+n.offsetWidth,l=s.width;let d=Array.from(i.querySelectorAll(".slider-slot")),u=d.map(e=>e.offsetWidth),h=0,p=-1;d.forEach((e,t)=>{e==a?p=t:-1==p&&(h+=u[t])});var m=e=>{let t;t="undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].pageX:e.pageX;let r=t-s.left;r<0?r=0:r>s.width&&(r=s.width),r>c+h&&(r=c+h),r=1440?i=1440:vs(i,this.stepSize),o.dispatchEvent(new CustomEvent("update",{detail:{time:i}}))},v=()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",v),window.removeEventListener("touchend",v),m=()=>{};let e=ys(o.innerText),t=po(this.entries[p])+po(this.entries[p+1]),r=this.entries[p].time.value,i=[...this.entries];Object.assign(i[p],{endTime:{value:e}}),Object.assign(i[p+1],{time:{value:e},endTime:{value:r+t}}),this._activeThumb=null;let s=new CustomEvent("update",{detail:{entries:i}});this.dispatchEvent(s)};window.addEventListener("mouseup",v),window.addEventListener("touchend",v),window.addEventListener("mousemove",m),window.addEventListener("touchmove",m)}_updateMarker(e){let t=e.detail,r=Number(t.time);1440==r&&(r-=1),e.target.innerText=fs(r).time}_addSlot(){let e=this.entries[this._activeEntry],t=e.time.value,r=e.endTime.value,i=vs(t+po(e)/2,this.stepSize),s=Object.assign({time:{value:i},endTime:{value:r},action:""},Ws(e,["entity","days"])),a=[...this.entries];Object.assign(a[this._activeEntry],{endTime:{value:i}}),a.splice(this._activeEntry+1,0,s);let n=new CustomEvent("update",{detail:{entries:a}});this.dispatchEvent(n)}_removeSlot(){let e=this._activeEntry==this.entries.length-1?this._activeEntry-1:this._activeEntry,t=Object.assign({},this.entries[e]);Object.assign(t,{endTime:this.entries[e+1].endTime});let r=[...this.entries];r.splice(e,2,t),this._activeEntry==this.entries.length&&this._activeEntry--;let i=new CustomEvent("update",{detail:{entries:r}});this.dispatchEvent(i)}};mo.styles=te` +
`)}}),e}updated(){this.shadowRoot.querySelectorAll(".slider-thumb-tooltip").forEach((e,t)=>{let r=this.entries[t].endTime.value;e.innerText=ms(r).time})}getEntryAction(e){if(!this.hass)return;if(!e.action)return"";let t=this.actions.find(t=>t.id==e.action);if(e.variable&&e.variable.type==xe.Level&&t.variable){if(e.variable.enabled)return ro(t.variable.field,Number(e.variable.value),this.hass)}else if(e.variable&&e.variable.type==xe.List)return Js(String(e.variable.value));const r=t.service;return Js(t.name||ls("services."+r)||r)}_handleSegmentClick(e){let t=e.target,r=Number(t.getAttribute("index"));this._activeEntry=this._activeEntry==r?null:r;let i=new CustomEvent("update",{detail:{entry:this._activeEntry}});this.dispatchEvent(i)}_handleTouchStart(e){let t;if(t=e.target,!t)return;let r=t.parentNode,i=r.parentElement,s=i.getBoundingClientRect(),a=r.previousElementSibling,n=r.nextElementSibling,o=r.querySelector(".slider-thumb-tooltip");this._activeThumb=Number(r.getAttribute("index"));const c=a.offsetWidth+n.offsetWidth,l=s.width;let d=Array.from(i.querySelectorAll(".slider-slot")),u=d.map(e=>e.offsetWidth),h=0,p=-1;d.forEach((e,t)=>{e==a?p=t:-1==p&&(h+=u[t])});var m=e=>{let t;t="undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].pageX:e.pageX;let r=t-s.left;r<0?r=0:r>s.width&&(r=s.width),r>c+h&&(r=c+h),r=1440?i=1440:ps(i,this.stepSize),o.dispatchEvent(new CustomEvent("update",{detail:{time:i}}))},v=()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",v),window.removeEventListener("touchend",v),m=()=>{};let e=fs(o.innerText),t=uo(this.entries[p])+uo(this.entries[p+1]),r=this.entries[p].time.value,i=[...this.entries];Object.assign(i[p],{endTime:{value:e}}),Object.assign(i[p+1],{time:{value:e},endTime:{value:r+t}}),this._activeThumb=null;let s=new CustomEvent("update",{detail:{entries:i}});this.dispatchEvent(s)};window.addEventListener("mouseup",v),window.addEventListener("touchend",v),window.addEventListener("mousemove",m),window.addEventListener("touchmove",m)}_updateMarker(e){let t=e.detail,r=Number(t.time);1440==r&&(r-=1),e.target.innerText=ms(r).time}_addSlot(){let e=this.entries[this._activeEntry],t=e.time.value,r=e.endTime.value,i=ps(t+uo(e)/2,this.stepSize),s=Object.assign({time:{value:i},endTime:{value:r},action:""},Gs(e,["entity","days"])),a=[...this.entries];Object.assign(a[this._activeEntry],{endTime:{value:i}}),a.splice(this._activeEntry+1,0,s);let n=new CustomEvent("update",{detail:{entries:a}});this.dispatchEvent(n)}_removeSlot(){let e=this._activeEntry==this.entries.length-1?this._activeEntry-1:this._activeEntry,t=Object.assign({},this.entries[e]);Object.assign(t,{endTime:this.entries[e+1].endTime});let r=[...this.entries];r.splice(e,2,t),this._activeEntry==this.entries.length&&this._activeEntry--;let i=new CustomEvent("update",{detail:{entries:r}});this.dispatchEvent(i)}};ho.styles=te` div.slider-track { height: 50px; @@ -745,7 +746,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad --mdc-theme-primary: var(--text-primary-color); border-radius: 4px; } - `,t([J()],mo.prototype,"hass",void 0),t([J({type:Array})],mo.prototype,"entries",void 0),t([J({type:Array})],mo.prototype,"actions",void 0),t([J({type:Number})],mo.prototype,"stepSize",void 0),t([J({type:Number})],mo.prototype,"_activeEntry",void 0),t([J({type:Number})],mo.prototype,"_activeThumb",void 0),mo=t([W("timeslot-editor")],mo);let vo=class extends ie{constructor(){super(...arguments),this.min=0,this.max=100,this.step=1,this.value=0,this.unit="",this.optional=!1,this.disabled=!1,this.scaleGain=1,this.scaleOffset=0}firstUpdated(){(async()=>{await(async()=>{if(customElements.get("ha-checkbox")&&customElements.get("ha-slider"))return;await customElements.whenDefined("partial-panel-resolver");const e=document.createElement("partial-panel-resolver");e.hass={panels:[{url_path:"tmp",component_name:"config"}]},e._updateRoutes(),await e.routerOptions.routes.tmp.load(),await customElements.whenDefined("ha-panel-config");const t=document.createElement("ha-panel-config");await t.routerOptions.routes.automation.load()})()})(),"%"==this.unit&&(this.scaleOffset=this.min,this.scaleGain=(this.max-this.min)/100,this.min=0,this.max=100),this.disabled&&!this.optional&&(this.disabled=!1),isNaN(this.value)&&(this.value=this.min),this.requestUpdate()}render(){return I` + `,t([J()],ho.prototype,"hass",void 0),t([J({type:Array})],ho.prototype,"entries",void 0),t([J({type:Array})],ho.prototype,"actions",void 0),t([J({type:Number})],ho.prototype,"stepSize",void 0),t([J({type:Number})],ho.prototype,"_activeEntry",void 0),t([J({type:Number})],ho.prototype,"_activeThumb",void 0),ho=t([W("timeslot-editor")],ho);let po=class extends ie{constructor(){super(...arguments),this.min=0,this.max=100,this.step=1,this.value=0,this.unit="",this.optional=!1,this.disabled=!1,this.scaleGain=1,this.scaleOffset=0}firstUpdated(){(async()=>{await(async()=>{if(customElements.get("ha-checkbox")&&customElements.get("ha-slider"))return;await customElements.whenDefined("partial-panel-resolver");const e=document.createElement("partial-panel-resolver");e.hass={panels:[{url_path:"tmp",component_name:"config"}]},e._updateRoutes(),await e.routerOptions.routes.tmp.load(),await customElements.whenDefined("ha-panel-config");const t=document.createElement("ha-panel-config");await t.routerOptions.routes.automation.load()})()})(),"%"==this.unit&&(this.scaleOffset=this.min,this.scaleGain=(this.max-this.min)/100,this.min=0,this.max=100),this.disabled&&!this.optional&&(this.disabled=!1),isNaN(this.value)&&(this.value=this.min),this.requestUpdate()}render(){return I`
${this.getCheckbox()} @@ -778,8 +779,8 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad @change="${this.toggleChecked}" ?checked=${!this.disabled} > - `:I``}toggleChecked(e){let t=e.target.checked;this.disabled=!t;let r=new CustomEvent("change");this.dispatchEvent(r)}updateValue(e){let t=Number(e.target.value)*this.scaleGain+this.scaleOffset;t=Math.round(t/this.step)*this.step,this.value=t}};vo.styles=te` - ${ro} + `:I``}toggleChecked(e){let t=e.target.checked;this.disabled=!t;let r=new CustomEvent("change");this.dispatchEvent(r)}updateValue(e){let t=Number(e.target.value)*this.scaleGain+this.scaleOffset;t=Math.round(t/this.step)*this.step,this.value=t}};po.styles=te` + ${to} :host { width: 100%; } @@ -787,7 +788,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad width: 100%; --paper-slider-pin-start-color: var(--primary-color); } - `,t([J({type:Number})],vo.prototype,"min",void 0),t([J({type:Number})],vo.prototype,"max",void 0),t([J({type:Number})],vo.prototype,"step",void 0),t([J({type:Number})],vo.prototype,"value",void 0),t([J({type:String})],vo.prototype,"unit",void 0),t([J({type:Boolean})],vo.prototype,"optional",void 0),t([J({type:Boolean})],vo.prototype,"disabled",void 0),vo=t([W("variable-slider")],vo);let fo=class extends ie{constructor(){super(...arguments),this.entries=[],this.activeEntry=null,this.timeslots=!1,this.editItem=!1}firstUpdated(){if(this.actions&&this.hass)if(this.timeslots){let e=this.actions.map(e=>e.name?e:Object.assign(e,{name:so(e,this.hass)}));e.sort((e,t)=>e.name.trim().toLowerCase()e.name?e:Object.assign(e,{name:io(e,this.hass)}));e.sort((e,t)=>e.name.trim().toLowerCase()
@@ -800,27 +801,27 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
${ls("fields.action")}
- + - ${Js(Zs(this.entity.name))} + ${Ys(Js(this.entity.name))}
- + - ${Js(Zs("make_scheme"))} + ${Ys(Js("make_scheme"))}
${ls("fields.days")}
- + - ${this.entries[0].days.type==ms.Custom?I` + ${this.entries[0].days.type==hs.Custom?I`
- +
`:""} @@ -836,7 +837,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
${ls("fields.action")}
e.icon?e:Object.assign(e,{icon:"flash"})):[]} value=${null!==this.activeEntry?this.entries[this.activeEntry].action:""} optional="true" @change=${this.selectAction} @@ -864,29 +865,29 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
${ls("fields.action")}
- + - ${Js(Zs(this.entity.name))} + ${Ys(Js(this.entity.name))}
- + - ${Js(so(this.actions[0],this.hass))} + ${Ys(io(this.actions[0],this.hass))}
${this.getVariableEditor()}
${ls("fields.days")}
- + - ${this.entries[0].days.type==ms.Custom?I` + ${this.entries[0].days.type==hs.Custom?I`
- +
`:""} @@ -909,7 +910,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
`:I``}updateActiveEntry(e){if(null===this.activeEntry)return;let t=[...this.entries];Object.assign(t[this.activeEntry],e),this.entries=t}updateTime(e){const t=e.target,r=Number(t.value),i=e.detail.event;this.updateActiveEntry({time:e.detail.event?{event:i,value:r}:{value:r}})}handlePlannerUpdate(e){if(e.detail.hasOwnProperty("entries")){const t=e.detail.entries;t.lengthe.id==this.entries[this.activeEntry].action);if(!e.variable)return I``;if(e.variable.type==xe.Level){let t=e.variable;t.unit||"temperature"!=t.field||Object.assign(t,{unit:this.hass.config.unit_system.temperature}),this.entries[this.activeEntry].variable||this.updateActiveEntry({variable:{type:xe.Level,value:t.min,enabled:!t.optional}});let r=this.entries[this.activeEntry].variable;return I`
- ${t.name||(t.field in hs?ls(hs[t.field]):Zs(t.field))} + ${t.name||ls("service_parameters."+t.field)||Js(t.field)}
`}if(e.variable.type==xe.List){let t=e.variable;this.entries[this.activeEntry].variable||this.updateActiveEntry({variable:{type:xe.List,value:t.options[0].value}});let r=this.entries[this.activeEntry].variable;return I`
- ${t.name||(t.field in hs?ls(hs[t.field]):Zs(t.field))} + ${t.name||ls("service_parameters."+t.field)||Js(t.field)}
Object.assign(e,{name:e.value}))} @@ -933,8 +934,8 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad > ${ls("instructions.no_entries_defined")} - `}return I``}updateLevelValue(e){if(null===this.activeEntry)return;const t=e.target;this.updateActiveEntry({variable:{type:xe.Level,value:Number(t.value),enabled:"false"==String(t.disabled)}})}updateListValue(e){if(null===this.activeEntry)return;const t=e.target.value;this.updateActiveEntry({variable:{type:xe.List,value:t}})}selectDays(e){let t=Object.assign({},this.entries[0].days);const r=e.target.value;Object.values(ms).includes(r)?(r!=ms.Custom||t.custom_days||Object.assign(t,{custom_days:_s(t)}),Object.assign(t,{type:r})):Object.assign(t,{custom_days:[...r]}),this.entries=this.entries.map(e=>Object.assign(e,{days:t}))}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}saveClick(){let e=new CustomEvent("saveClick",{detail:this.entries});this.dispatchEvent(e)}optionsClick(){let e=new CustomEvent("optionsClick",{detail:this.entries});this.dispatchEvent(e)}deleteClick(){let e=new CustomEvent("deleteClick");this.dispatchEvent(e)}};fo.styles=te` - ${ro} + `}return I``}updateLevelValue(e){if(null===this.activeEntry)return;const t=e.target;this.updateActiveEntry({variable:{type:xe.Level,value:Number(t.value),enabled:"false"==String(t.disabled)}})}updateListValue(e){if(null===this.activeEntry)return;const t=e.target.value;this.updateActiveEntry({variable:{type:xe.List,value:t}})}selectDays(e){let t=Object.assign({},this.entries[0].days);const r=e.target.value;Object.values(hs).includes(r)?(r!=hs.Custom||t.custom_days||Object.assign(t,{custom_days:gs(t)}),Object.assign(t,{type:r})):Object.assign(t,{custom_days:[...r]}),this.entries=this.entries.map(e=>Object.assign(e,{days:t}))}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}saveClick(){let e=new CustomEvent("saveClick",{detail:this.entries});this.dispatchEvent(e)}optionsClick(){let e=new CustomEvent("optionsClick",{detail:this.entries});this.dispatchEvent(e)}deleteClick(){let e=new CustomEvent("deleteClick");this.dispatchEvent(e)}};mo.styles=te` + ${to} div.summary { display: grid; grid-template-columns: 1fr max-content 1fr; @@ -989,27 +990,27 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad } - `,t([J()],fo.prototype,"hass",void 0),t([J()],fo.prototype,"config",void 0),t([J()],fo.prototype,"entries",void 0),t([J()],fo.prototype,"actions",void 0),t([J()],fo.prototype,"entity",void 0),t([J()],fo.prototype,"activeEntry",void 0),t([J({type:Boolean})],fo.prototype,"timeslots",void 0),t([J({type:Boolean})],fo.prototype,"editItem",void 0),fo=t([W("scheduler-timepicker-card")],fo);let go=class extends ie{constructor(){super(...arguments),this.selected=!1,this.editMode=!1}render(){if(!this.item||!this.hass||!this.config)return I``;const e=this.hass.states[this.item.entity];if(!e)return I` - - Entity not found '${this.item.entity}' - - `;let t=na(e,this.config);return I` + `,t([J()],mo.prototype,"hass",void 0),t([J()],mo.prototype,"config",void 0),t([J()],mo.prototype,"entries",void 0),t([J()],mo.prototype,"actions",void 0),t([J()],mo.prototype,"entity",void 0),t([J()],mo.prototype,"activeEntry",void 0),t([J({type:Boolean})],mo.prototype,"timeslots",void 0),t([J({type:Boolean})],mo.prototype,"editItem",void 0),mo=t([W("scheduler-timepicker-card")],mo);let vo=class extends ie{constructor(){super(...arguments),this.selected=!1,this.editMode=!1}firstUpdated(){this.hass&&this.config&&this.item&&(this.entity=aa(this.hass.states[this.item.entity],this.config))}render(){return this.item&&this.hass&&this.config?this.entity?I`
- - ${Zs(t.name)} + + ${Js(this.entity.name)} ${this.getMatchTypeButton()} ${this.getStateButton()}
- `}entityButtonClick(){this.selected=!this.selected,this.fireEvent()}getMatchTypeButton(){if(!this.item)return I``;let e,t=this.item.match_type;return t==$e.Equal?e="is":t==$e.Unequal?e="is not":t==$e.Below?e="below":t==$e.Above&&(e="above"),I` + `:I` + + Entity not found '${this.item.entity}' + + `:I``}entityButtonClick(){this.selected=!this.selected,this.fireEvent()}getMatchTypeButton(){if(!this.item)return I``;let e,t=this.item.match_type;return t==$e.Equal?e="is":t==$e.Unequal?e="is not":t==$e.Below?e="below":t==$e.Above&&(e="above"),I` ${e} `}matchTypeButtonClick(){if(this.selected=!1,this.editMode=!1,!this.item)return;let e,t=this.item.match_type;"string"==typeof this.item.state?t==$e.Equal?e=$e.Unequal:t==$e.Unequal&&(e=$e.Equal):t==$e.Equal?e=$e.Unequal:t==$e.Unequal?e=$e.Below:t==$e.Below?e=$e.Above:t==$e.Above&&(e=$e.Equal),this.item=Object.assign(Object.assign({},this.item),{match_type:e}),this.fireEvent()}getStateButton(){return this.item?"string"==typeof this.item.state?I` - ${Zs(this.item.state)} + ${Js(this.item.state)} `:this.editMode?I`
@@ -1049,7 +1050,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getState()} - `:I``}stateButtonClick(){if(!this.item||!this.config||!this.hass)return;this.selected=!1;let e=na(this.hass.states[this.item.entity],this.config),t=this.item.state,r=e.states;if(!r||!Array.isArray(r))return;let i=0;for(i=0;i{this.stateDecrement(a)},a)}stateIncrement(e=null){if(!this.item||!this.config||!this.hass)return;clearTimeout(this.timer);let t=na(this.hass.states[this.item.entity],this.config),r=Number(this.item.state),i=t.states;if(Array.isArray(i))return;let s=i.step||1;r+=s,r>i.max&&(r=i.max),r=Number((Math.round(r/s)*s).toPrecision(5)),this.item=Object.assign(Object.assign({},this.item),{state:r});let a=null!==e?Number(.9*e):300;a<50&&(a=50),this.timer=setTimeout(()=>{this.stateIncrement(a)},a)}stateUpdateStop(){clearTimeout(this.timer),this.fireEvent()}toggleEditMode(){this.editMode=!this.editMode}getState(){if(!this.item||!this.config||!this.hass)return;let e=na(this.hass.states[this.item.entity],this.config),t=this.item.state,r=e.states;return!Array.isArray(r)&&r.unit?`${t}${r.unit}`:t}fireEvent(){let e={item:this.item,selected:this.selected},t=new CustomEvent("change",{detail:e});this.dispatchEvent(t)}};go.styles=te` + `:I``}stateButtonClick(){if(!this.item||!this.entity)return;this.selected=!1;let e=this.item.state;const t=this.entity.states;if(!t||!Array.isArray(t))return;let r=0;for(r=0;r{this.stateDecrement(s)},s)}stateIncrement(e=null){if(!this.item||!this.entity)return;clearTimeout(this.timer);let t=Number(this.item.state);const r=this.entity.states;if(!r||Array.isArray(r))return;let i=r.step||1;t+=i,t>r.max&&(t=r.max),t=Number((Math.round(t/i)*i).toPrecision(5)),this.item=Object.assign(Object.assign({},this.item),{state:t});let s=null!==e?Number(.9*e):300;s<50&&(s=50),this.timer=setTimeout(()=>{this.stateIncrement(s)},s)}stateUpdateStop(){clearTimeout(this.timer),this.fireEvent()}toggleEditMode(){this.editMode=!this.editMode}getState(){if(!this.item||!this.entity)return;let e=this.item.state,t=this.entity.states;return!Array.isArray(t)&&t.unit?`${e}${t.unit}`:e}fireEvent(){let e={item:this.item,selected:this.selected},t=new CustomEvent("change",{detail:e});this.dispatchEvent(t)}};vo.styles=te` div.list-item { background: none; cursor: pointer; @@ -1106,7 +1107,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad .mdc-button { min-width: 20px !important; } - `,t([J()],go.prototype,"hass",void 0),t([J()],go.prototype,"config",void 0),t([J()],go.prototype,"item",void 0),t([J()],go.prototype,"selected",void 0),t([J()],go.prototype,"editMode",void 0),go=t([W("condition-entity-row")],go);let yo=class extends ie{constructor(){super(...arguments),this.entries=[],this.editItem=null,this.selectedItem=null,this.addCondition=!1}render(){var e;return this.hass&&this.config?I` + `,t([J()],vo.prototype,"hass",void 0),t([J()],vo.prototype,"config",void 0),t([J()],vo.prototype,"item",void 0),t([J()],vo.prototype,"selected",void 0),t([J()],vo.prototype,"entity",void 0),t([J()],vo.prototype,"editMode",void 0),vo=t([W("condition-entity-row")],vo);let fo=class extends ie{constructor(){super(...arguments),this.entries=[],this.editItem=null,this.selectedItem=null,this.addCondition=!1}render(){var e;return this.hass&&this.config?I`
@@ -1173,7 +1174,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad `}
- `:I``}renderAddCondition(){if(!this.addCondition||!this.hass||!this.config)return I``;let e=co(Object.values(this.hass.states).filter(e=>oa(e,this.config,{states:!0})).map(e=>e.entity_id),this.config);e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>na(this.hass.states[e],this.config)).filter(e=>e),t.sort((e,t)=>e.name.trim().toLowerCase()na(e,this.config,{states:!0})).map(e=>e.entity_id),this.config);e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>aa(this.hass.states[e],this.config)).filter(e=>e),t.sort((e,t)=>e.name.trim().toLowerCase()${ls("fields.group")}
- `):I`
No conditions yet
`}updateCondition(e,t){if(e.detail.selected)this.selectedItem=t,this.editItem=null;else{this.selectedItem==t&&(this.selectedItem=null),this.editItem!=t&&(this.editItem=t);let r=[...this.entries[0].conditions.items];r[t]=Object.assign({},e.detail.item),this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{items:r})}))}}addConditionClick(){this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null}confirmConditionClick(){var e,t;if(!this.selectedEntity||!this.config||!this.hass)return;const r=na(this.hass.states[this.selectedEntity],this.config).states,i=Array.isArray(r)?1:r.step||1;let s=Array.isArray(r)?r[0]:Number((Math.round((r.min+r.max)/2/i)*i).toPrecision(5)),a={entity:this.selectedEntity,match_type:$e.Equal,state:s},n=(null===(e=this.entries[0].conditions)||void 0===e?void 0:e.items.length)?[...this.entries[0].conditions.items]:[],o=(null===(t=this.entries[0].conditions)||void 0===t?void 0:t.type)?this.entries[0].conditions.type:Oe.Any;n.push(a),this.entries=this.entries.map(e=>Object.assign(e,{conditions:{items:n,type:o}})),this.selectedEntity=void 0,this.selectedGroup=void 0,this.selectedItem=null,this.addCondition=!1}removeConditionClick(){if(null===this.selectedItem)return;let e=[...this.entries[0].conditions.items];e.splice(this.selectedItem,1),this.entries=this.entries.map(t=>Object.assign(t,{conditions:Object.assign(t.conditions,{items:e})})),this.selectedItem=null}conditionTypeSwitchClick(e){let t=e.target.checked?Oe.All:Oe.Any;this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{type:t})}))}updateName(e){let t=e.target.value;t!=this.friendlyName&&(this.friendlyName=t)}updateRunOnce(e){let t=e.target.checked,r=Object.assign({},this.entries[0].options);t?Object.assign(r,{run_once:!0}):"run_once"in r&&delete r.run_once,this.entries=this.entries.map(e=>Object.assign(e,{options:r}))}cancelClick(){if(this.addCondition)this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null;else{let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}}saveClick(){let e=new CustomEvent("saveClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}backClick(){let e=new CustomEvent("backClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}};yo.styles=ro,t([J()],yo.prototype,"hass",void 0),t([J()],yo.prototype,"config",void 0),t([J()],yo.prototype,"entries",void 0),t([J()],yo.prototype,"friendlyName",void 0),t([J()],yo.prototype,"selectedGroup",void 0),t([J()],yo.prototype,"selectedEntity",void 0),t([J()],yo.prototype,"editItem",void 0),t([J()],yo.prototype,"selectedItem",void 0),t([J()],yo.prototype,"addCondition",void 0),yo=t([W("scheduler-options-card")],yo);let _o=class extends ie{constructor(){super(...arguments),this.selectedDomain="",this.titleOption="standard"}setConfig(e){this._config=e,this.titleOption=this.getTitleOption()}render(){return this.hass?I` + `):I`
No conditions yet
`}updateCondition(e,t){if(e.detail.selected)this.selectedItem=t,this.editItem=null;else{this.selectedItem==t&&(this.selectedItem=null),this.editItem!=t&&(this.editItem=t);let r=[...this.entries[0].conditions.items];r[t]=Object.assign({},e.detail.item),this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{items:r})}))}}addConditionClick(){this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null}confirmConditionClick(){var e,t;if(!this.selectedEntity||!this.config||!this.hass)return;const r=aa(this.hass.states[this.selectedEntity],this.config).states,i=Array.isArray(r)?1:r.step||1;let s=Array.isArray(r)?r[0]:Number((Math.round((r.min+r.max)/2/i)*i).toPrecision(5)),a={entity:this.selectedEntity,match_type:$e.Equal,state:s},n=(null===(e=this.entries[0].conditions)||void 0===e?void 0:e.items.length)?[...this.entries[0].conditions.items]:[],o=(null===(t=this.entries[0].conditions)||void 0===t?void 0:t.type)?this.entries[0].conditions.type:Oe.Any;n.push(a),this.entries=this.entries.map(e=>Object.assign(e,{conditions:{items:n,type:o}})),this.selectedEntity=void 0,this.selectedGroup=void 0,this.selectedItem=null,this.addCondition=!1}removeConditionClick(){if(null===this.selectedItem)return;let e=[...this.entries[0].conditions.items];e.splice(this.selectedItem,1),this.entries=this.entries.map(t=>Object.assign(t,{conditions:Object.assign(t.conditions,{items:e})})),this.selectedItem=null}conditionTypeSwitchClick(e){let t=e.target.checked?Oe.All:Oe.Any;this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{type:t})}))}updateName(e){let t=e.target.value;t!=this.friendlyName&&(this.friendlyName=t)}updateRunOnce(e){let t=e.target.checked,r=Object.assign({},this.entries[0].options);t?Object.assign(r,{run_once:!0}):"run_once"in r&&delete r.run_once,this.entries=this.entries.map(e=>Object.assign(e,{options:r}))}cancelClick(){if(this.addCondition)this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null;else{let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}}saveClick(){let e=new CustomEvent("saveClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}backClick(){let e=new CustomEvent("backClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}};fo.styles=to,t([J()],fo.prototype,"hass",void 0),t([J()],fo.prototype,"config",void 0),t([J()],fo.prototype,"entries",void 0),t([J()],fo.prototype,"friendlyName",void 0),t([J()],fo.prototype,"selectedGroup",void 0),t([J()],fo.prototype,"selectedEntity",void 0),t([J()],fo.prototype,"editItem",void 0),t([J()],fo.prototype,"selectedItem",void 0),t([J()],fo.prototype,"addCondition",void 0),fo=t([W("scheduler-options-card")],fo);let go=class extends ie{constructor(){super(...arguments),this.selectedDomain="",this.titleOption="standard"}setConfig(e){this._config=e,this.titleOption=this.getTitleOption()}render(){return this.hass?I`
Title of the card
Click on a group to open it.
${this.getDomainSwitches()}
- `:I``}getTitleOption(){return this._config&&this.hass?void 0===this._config.title?"standard":"string"==typeof this._config.title?"custom":0==this._config.title?"hidden":"standard":"standard"}getTitle(){return this._config&&this.hass?void 0===this._config.title?ls("scheduler"):"string"==typeof this._config.title?this._config.title:0==this._config.title?"":ls("scheduler"):ls("scheduler")}updateTitleOption(e){let t=e.target.value;if(!this._config||!this.hass)return;this.titleOption=t;let r=Object.assign({},this._config);"standard"==t?"title"in this._config&&delete r.title:"hidden"==t&&Object.assign(r,{title:!1}),this._config=r,je(this,"config-changed",{config:this._config})}updateTitle(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=String(e.target.value);Object.assign(t,{title:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDiscoveryOption(){if(!this._config||!this.hass)return;return!this._config.hasOwnProperty("discover_existing")||this._config.discover_existing}updateDiscoveryOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?r.hasOwnProperty("discover_existing")&&delete r.discover_existing:Object.assign(r,{discover_existing:t}),this._config=r,je(this,"config-changed",{config:this._config})}getAmPmOption(){if(!this._config||!this.hass)return;return!!this._config.hasOwnProperty("am_pm")&&this._config.am_pm}updateAmPmOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?Object.assign(r,{am_pm:t}):r.hasOwnProperty("am_pm")&&delete r.am_pm,this._config=r,je(this,"config-changed",{config:this._config})}getTimeStepOption(){if(!this._config||!this.hass)return;let e=this._config.hasOwnProperty("time_step")?this._config.time_step:10;return Number(e)}updateTimeStepOption(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=Number(e.target.value);10==r&&t.hasOwnProperty("time_step")?delete t.time_step:Object.assign(t,{time_step:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDomainSwitches(){if(!this._config||!this.hass)return;this._config.include&&this._config.include;const e=Object.values(this.hass.states).filter(e=>!aa(e.entity_id)).map(e=>na(e,{include:["*"]})).filter(e=>e&&e.actions.length);return e.map(e=>Se(e.id)).filter((e,t,r)=>r.indexOf(e)===t).map(t=>{let r=e.filter(e=>Se(e.id)==t).length;return r?I` + `:I``}getTitleOption(){return this._config&&this.hass?void 0===this._config.title?"standard":"string"==typeof this._config.title?"custom":0==this._config.title?"hidden":"standard":"standard"}getTitle(){return this._config&&this.hass?void 0===this._config.title?ls("scheduler"):"string"==typeof this._config.title?this._config.title:0==this._config.title?"":ls("scheduler"):ls("scheduler")}updateTitleOption(e){let t=e.target.value;if(!this._config||!this.hass)return;this.titleOption=t;let r=Object.assign({},this._config);"standard"==t?"title"in this._config&&delete r.title:"hidden"==t&&Object.assign(r,{title:!1}),this._config=r,je(this,"config-changed",{config:this._config})}updateTitle(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=String(e.target.value);Object.assign(t,{title:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDiscoveryOption(){if(!this._config||!this.hass)return;return!this._config.hasOwnProperty("discover_existing")||this._config.discover_existing}updateDiscoveryOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?r.hasOwnProperty("discover_existing")&&delete r.discover_existing:Object.assign(r,{discover_existing:t}),this._config=r,je(this,"config-changed",{config:this._config})}getAmPmOption(){if(!this._config||!this.hass)return;return!!this._config.hasOwnProperty("am_pm")&&this._config.am_pm}updateAmPmOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?Object.assign(r,{am_pm:t}):r.hasOwnProperty("am_pm")&&delete r.am_pm,this._config=r,je(this,"config-changed",{config:this._config})}getTimeStepOption(){if(!this._config||!this.hass)return;let e=this._config.hasOwnProperty("time_step")?this._config.time_step:10;return Number(e)}updateTimeStepOption(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=Number(e.target.value);10==r&&t.hasOwnProperty("time_step")?delete t.time_step:Object.assign(t,{time_step:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDomainSwitches(){if(!this._config||!this.hass)return;this._config.include&&this._config.include;const e=Object.values(this.hass.states).filter(e=>!sa(e.entity_id)).map(e=>aa(e,{include:["*"]})).filter(e=>e&&e.actions.length);return e.map(e=>Se(e.id)).filter((e,t,r)=>r.indexOf(e)===t).map(t=>{let r=e.filter(e=>Se(e.id)==t).length;return r?I`
{this.toggleSelectDomain(t)}}> - +
@@ -1273,7 +1274,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getEntitySwitches(t)}
`:""} - `:""})}getEntitySwitches(e){if(!this._config||!this.hass)return;let t=this._config.include?[...this._config.include]:[];return Object.entries(this.hass.states).filter(([t])=>Se(t)==e&&!aa(t)).map(([e,r])=>{let i=r.attributes.friendly_name||ke(e),s=t.includes(e);return I` + `:""})}getEntitySwitches(e){if(!this._config||!this.hass)return;let t=this._config.include?[...this._config.include]:[];return Object.entries(this.hass.states).filter(([t])=>Se(t)==e&&!sa(t)).map(([e,r])=>{let i=r.attributes.friendly_name||ke(e),s=t.includes(e);return I`
this.toggleSelectEntity(e)}>
`})}toggleSelectDomain(e){this._config&&this.hass&&(this.selectedDomain!=e?this.selectedDomain=e:this.selectedDomain="")}toggleSelectEntity(e){if(!this._config||!this.hass)return;let t=this._config.include?[...this._config.include]:[];t.includes(e)?t=t.filter(t=>t!=e):t.push(e),t.sort(),this._config=Object.assign(Object.assign({},this._config),{include:t}),je(this,"config-changed",{config:this._config})}static get styles(){return te` - ${ro} + ${to} div.row { display: flex; align-items: center; @@ -1329,7 +1330,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad div.row ha-switch { padding: 13px 5px; } - `}};t([J()],_o.prototype,"hass",void 0),t([J()],_o.prototype,"_config",void 0),t([J()],_o.prototype,"selectedDomain",void 0),t([J()],_o.prototype,"titleOption",void 0),_o=t([W("scheduler-card-editor")],_o),window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-card",name:"Scheduler Card",description:"Card to manage schedule entities made with scheduler-component."}),console.info(`%c SCHEDULER-CARD \n%c Version: ${"1.8.2".padEnd(8," ")}\n%c Language: ${ds().padEnd(7," ")}`,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray","color: white; font-weight: bold; background: dimgray"),e.SchedulerCard=class extends ie{constructor(){super(...arguments),this._view=ks.Overview,this.entries=[],this.actions=[],this.editItem=null,this.scheduleEntities=[]}static getConfigElement(){return document.createElement("scheduler-card-editor")}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>aa(e)),this._hass=e}shouldUpdate(e){const t=e.get("_hass");if(t&&1==e.size){const e=Object.keys(t.states).filter(e=>aa(e));return e.length!==this.scheduleEntities.length||(!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e]))}return!0}setConfig(e){!function(e){const t=to.validate(eo,e),r=[];if(t||to.errors.forEach(e=>{let t="";const i=e.dataPath.substr(1).split("/"),s=i.pop();i.length&&(t+=`in ${i.join("/")} `),"type"==e.keyword&&(t+="type of "),s?s&&(t+=(isNaN(+s)?`'${s}'`:`[item ${s}]`)+" "):t+="card ",t+=e.message,e.params.hasOwnProperty("additionalProperty")&&(t+=` '${e.params.additionalProperty}'`),r.push(t.charAt(0).toUpperCase()+t.slice(1)+".")}),r.length)throw new Error(`Invalid configuration provided (${r.length} error(s)). ${r.join(" ")}`)}(e),this._config=e}getCardSize(){return this._hass&&this.scheduleEntities.length?6+this.scheduleEntities.length:6}render(){return this._hass&&this._config?this._view==ks.Overview?I` + `}};t([J()],go.prototype,"hass",void 0),t([J()],go.prototype,"_config",void 0),t([J()],go.prototype,"selectedDomain",void 0),t([J()],go.prototype,"titleOption",void 0),go=t([W("scheduler-card-editor")],go),window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-card",name:"Scheduler Card",description:"Card to manage schedule entities made with scheduler-component."}),console.info(`%c SCHEDULER-CARD \n%c Version: ${"1.8.3".padEnd(8," ")}\n%c Language: ${ds().padEnd(7," ")}`,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray","color: white; font-weight: bold; background: dimgray"),e.SchedulerCard=class extends ie{constructor(){super(...arguments),this._view=Ss.Overview,this.entries=[],this.actions=[],this.editItem=null,this.scheduleEntities=[]}static getConfigElement(){return document.createElement("scheduler-card-editor")}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>sa(e)),this._hass=e}shouldUpdate(e){const t=e.get("_hass");if(t&&1==e.size){const e=Object.keys(t.states).filter(e=>sa(e));return e.length!==this.scheduleEntities.length||(!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e]))}return!0}setConfig(e){!function(e){const t=eo.validate(Xn,e),r=[];if(t||eo.errors.forEach(e=>{let t="";const i=e.dataPath.substr(1).split("/"),s=i.pop();i.length&&(t+=`in ${i.join("/")} `),"type"==e.keyword&&(t+="type of "),s?s&&(t+=(isNaN(+s)?`'${s}'`:`[item ${s}]`)+" "):t+="card ",t+=e.message,e.params.hasOwnProperty("additionalProperty")&&(t+=` '${e.params.additionalProperty}'`),r.push(t.charAt(0).toUpperCase()+t.slice(1)+".")}),r.length)throw new Error(`Invalid configuration provided (${r.length} error(s)). ${r.join(" ")}`)}(e),this._config=e}getCardSize(){return this._hass&&this.scheduleEntities.length?6+this.scheduleEntities.length:6}render(){return this._hass&&this._config?this._view==Ss.Overview?I` - `:this._view==ks.NewSchedule?I` + `:this._view==Ss.NewSchedule?I` - `:this._view==ks.TimePicker||this._view==ks.TimeScheme?I` + `:this._view==Ss.TimePicker||this._view==Ss.TimeScheme?I` - `:this._view==ks.Options?I` + `:this._view==Ss.Options?I` - `:I``:I``}_addItemClick(){this._view=ks.NewSchedule,this.editItem=null,this.friendlyName=void 0}_cancelEditClick(){this._view=ks.Overview,this.editItem=null}_confirmItemClick(e){if(!this._hass||!this._config)return;const t=e.detail.entity;this.entity=na(this._hass.states[t],this._config);const r=e.detail.action;"make_scheme"!=r?(this.entries=[{entity:e.detail.entity,action:r,time:{value:ys("12:00")},days:{type:ms.Daily}}],this._view=ks.TimePicker,this.actions=[sa(this.entity,{service:r})]):(this.entries=[{entity:e.detail.entity,action:"",time:{value:ys("00:00")},endTime:{value:ys("08:00")},days:{type:ms.Daily}},{entity:e.detail.entity,action:"",time:{value:ys("08:00")},endTime:{value:ys("16:00")},days:{type:ms.Daily}},{entity:e.detail.entity,action:"",time:{value:ys("16:00")},endTime:{value:1440},days:{type:ms.Daily}}],this.actions=this.entity.actions.map(ta).filter(e=>e),this._view=ks.TimeScheme)}_saveItemClick(e){if(!this._hass||!this._config)return;e&&(this.entries=e.detail);const t=[],r=[],i=[],s={};this.entries.forEach(e=>{var a;if(!e.action||!e.entity)return;const n=na(this._hass.states[e.entity],this._config),o=sa(n,{service:e.action}),c=function(e,t){return t.variable&&e.variable?t.variable.type==xe.Level&&e.variable.type==xe.Level?t.variable.enabled?{[e.variable.field]:Number(t.variable.value)}:{}:{[e.variable.field]:String(t.variable.value)}:{}}(o,e),l={entity:n.id,service:Se(o.service)?o.service:`${Se(n.id)}.${o.service}`,service_data:Object.assign(Object.assign({},o.service_data||{}),c)};let d=t.findIndex(e=>ea(e)==ea(l));-1==d&&(d=t.push(l)-1);const u={actions:[d]};e.time.event?e.time.event&&Object.assign(u,{time:{event:bs(e.time.event),offset:fs(e.time.value).time}}):Object.assign(u,{time:fs(e.time.value).time}),e.endTime&&(e.time.event?e.time.event&&Object.assign(u,{end_time:{event:bs(e.endTime.event),offset:fs(e.endTime.value).time}}):Object.assign(u,{end_time:fs(e.endTime.value).time}));let h="daily";if(e.days.type==ms.Workday?h="workday":e.days.type==ms.Weekend?h="weekend":e.days.type==ms.Custom&&(h="custom"),e.days.type==ms.Custom?Object.assign(u,{days:{type:h,list:e.days.custom_days}}):Object.assign(u,{days:{type:h}}),"conditions"in e){const t=[];null===(a=e.conditions)||void 0===a||a.items.forEach(e=>{let r=i.findIndex(t=>t===e);r<0&&(r=i.push(e)-1),t.push(r)}),Object.assign(u,{conditions:{list:t,type:e.conditions.type}})}if(e.options){const t=[];Object.entries(e.options).forEach(([e,r])=>{let i=Object.entries(s).findIndex(([t,i])=>({[e]:r}==={[t]:i}));i<0&&(Object.assign(s,{[e]:r}),i=Object.keys(s).length-1),t.push(i)}),Object.assign(u,{options:t})}r.push(u)});const a={entries:r,actions:t};i.length&&Object.assign(a,{conditions:i}),this.friendlyName&&Object.assign(a,{name:this.friendlyName}),Object.keys(s).length&&Object.assign(a,{options:s}),this.editItem?this._hass.callService("scheduler","edit",Object.assign(a,{entity_id:this.editItem})):this._hass.callService("scheduler","add",a),this.editItem=null,this._view=ks.Overview}_deleteItemClick(){const e=this.editItem;this._hass.callService("scheduler","remove",{entity_id:e}),this.editItem=null,this._view=ks.Overview}_editItemClick(e){if(!this._hass||!this._config)return;const t=this._hass.states[e.detail];if(!t)return;const r=t.attributes.entries.map(Cs),i=t.attributes.actions[0].entity;if(this.entity=na(this._hass.states[i],this._config),!this.entity){const e={id:i,name:"(unknown entity)",icon:"help-circle-outline",actions:t.attributes.actions.map(e=>ra(e)).map(e=>ta(Ys(e,["entity"])))};this.entity=e}this.actions=this.entity.actions.map(e=>ta(e)).filter(e=>e);const s=t.attributes.conditions||[],a=t.attributes.options||{};this.entries=r.map(e=>{const r=e.actions.filter(e=>era(t.attributes.actions[e])).shift(),i=sa(this.entity,r);if(!this.actions.find(e=>e.id==i.id)){let e=[...this.actions];e.push(i),this.actions=e}const n={time:e.time,endTime:e.endTime,days:e.days,entity:this.entity.id,action:i.id};if(i.variable&&r.service_data&&i.variable.field in r.service_data)if(i.variable.type==xe.Level){const e={type:xe.Level,value:Number(r.service_data[i.variable.field]),enabled:!0};Object.assign(n,{variable:e})}else{const e={type:xe.List,value:String(r.service_data[i.variable.field])};Object.assign(n,{variable:e})}return e.conditions&&e.conditions.items.length&&Object.assign(n,{conditions:{type:e.conditions.type,items:e.conditions.items.filter(e=>s.length>=e-1).map(e=>s[e])}}),e.options&&Object.keys(e.options).length&&Object.assign(n,{options:e.options.reduce((e,t)=>Object.assign(e,Ws(a,[Object.keys(a)[t]])),{})}),n}),this.editItem=t.entity_id,this.friendlyName=t.attributes.friendly_name,this.entries.every(e=>e.endTime)?(this._view=ks.TimeScheme,this.entries=function(e){e.sort((e,t)=>e.time.value>t.time.value?1:-1),e=e.map(e=>e.endTime.valuet&&e.splice(r,0,Object.assign({time:{value:t},endTime:{value:i.time.value}},Ws(i,["entity","days","conditions","options"]))),t=i.endTime.value}return t<1440&&e.push(Object.assign({time:{value:t},endTime:{value:1440}},Ws(e[0],["entity","days","conditions","options"]))),e}(this.entries)):(this.actions=this.actions.filter(e=>e.id==this.entries[0].action),this._view=ks.TimePicker)}_gotoOptionsClick(e){this.entries=e.detail,this._view=ks.Options}_optionsBackClick(e,t){this.entries=e.detail.entries,this.friendlyName=e.detail.friendlyName,this.entries.every(e=>e.endTime)?this._view=ks.TimeScheme:this._view=ks.TimePicker,t&&this._saveItemClick()}},t([J()],e.SchedulerCard.prototype,"_hass",void 0),t([J()],e.SchedulerCard.prototype,"_view",void 0),t([J()],e.SchedulerCard.prototype,"entries",void 0),t([J()],e.SchedulerCard.prototype,"entity",void 0),t([J()],e.SchedulerCard.prototype,"actions",void 0),t([J()],e.SchedulerCard.prototype,"friendlyName",void 0),e.SchedulerCard=t([W("scheduler-card")],e.SchedulerCard)}({}); + `:I``:I``}_addItemClick(){this._view=Ss.NewSchedule,this.editItem=null,this.friendlyName=void 0}_cancelEditClick(){this._view=Ss.Overview,this.editItem=null}_confirmItemClick(e){if(!this._hass||!this._config)return;const t=e.detail.entity;this.entity=aa(this._hass.states[t],this._config);const r=e.detail.action;"make_scheme"!=r?(this.entries=[{entity:e.detail.entity,action:r,time:{value:fs("12:00")},days:{type:hs.Daily}}],this._view=Ss.TimePicker,this.actions=[ia(this.entity,{service:r})]):(this.entries=[{entity:e.detail.entity,action:"",time:{value:fs("00:00")},endTime:{value:fs("08:00")},days:{type:hs.Daily}},{entity:e.detail.entity,action:"",time:{value:fs("08:00")},endTime:{value:fs("16:00")},days:{type:hs.Daily}},{entity:e.detail.entity,action:"",time:{value:fs("16:00")},endTime:{value:1440},days:{type:hs.Daily}}],this.actions=this.entity.actions.map(ea).filter(e=>e),this._view=Ss.TimeScheme)}_saveItemClick(e){if(!this._hass||!this._config)return;e&&(this.entries=e.detail);const t=[],r=[],i=[],s={};this.entries.forEach(e=>{var a;if(!e.action||!e.entity)return;const n=aa(this._hass.states[e.entity],this._config),o=ia(n,{service:e.action}),c=function(e,t){return t.variable&&e.variable?t.variable.type==xe.Level&&e.variable.type==xe.Level?t.variable.enabled?{[e.variable.field]:Number(t.variable.value)}:{}:{[e.variable.field]:String(t.variable.value)}:{}}(o,e),l={entity:n.id,service:Se(o.service)?o.service:`${Se(n.id)}.${o.service}`,service_data:Object.assign(Object.assign({},o.service_data||{}),c)};let d=t.findIndex(e=>Xs(e)==Xs(l));-1==d&&(d=t.push(l)-1);const u={actions:[d]};e.time.event?e.time.event&&Object.assign(u,{time:{event:ys(e.time.event),offset:ms(e.time.value).time}}):Object.assign(u,{time:ms(e.time.value).time}),e.endTime&&(e.time.event?e.time.event&&Object.assign(u,{end_time:{event:ys(e.endTime.event),offset:ms(e.endTime.value).time}}):Object.assign(u,{end_time:ms(e.endTime.value).time}));let h="daily";if(e.days.type==hs.Workday?h="workday":e.days.type==hs.Weekend?h="weekend":e.days.type==hs.Custom&&(h="custom"),e.days.type==hs.Custom?Object.assign(u,{days:{type:h,list:e.days.custom_days}}):Object.assign(u,{days:{type:h}}),"conditions"in e){const t=[];null===(a=e.conditions)||void 0===a||a.items.forEach(e=>{let r=i.findIndex(t=>t===e);r<0&&(r=i.push(e)-1),t.push(r)}),Object.assign(u,{conditions:{list:t,type:e.conditions.type}})}if(e.options){const t=[];Object.entries(e.options).forEach(([e,r])=>{let i=Object.entries(s).findIndex(([t,i])=>({[e]:r}==={[t]:i}));i<0&&(Object.assign(s,{[e]:r}),i=Object.keys(s).length-1),t.push(i)}),Object.assign(u,{options:t})}r.push(u)});const a={entries:r,actions:t};i.length&&Object.assign(a,{conditions:i}),this.friendlyName&&Object.assign(a,{name:this.friendlyName}),Object.keys(s).length&&Object.assign(a,{options:s}),this.editItem?this._hass.callService("scheduler","edit",Object.assign(a,{entity_id:this.editItem})):this._hass.callService("scheduler","add",a),this.editItem=null,this._view=Ss.Overview}_deleteItemClick(){const e=this.editItem;this._hass.callService("scheduler","remove",{entity_id:e}),this.editItem=null,this._view=Ss.Overview}_editItemClick(e){if(!this._hass||!this._config)return;const t=this._hass.states[e.detail];if(!t)return;const r=t.attributes.entries.map(js),i=ta(t.attributes.actions[0]).entity;if(this.entity=aa(this._hass.states[i],this._config),!this.entity){const e={id:i,name:"(unknown entity)",icon:"help-circle-outline",actions:t.attributes.actions.map(e=>ta(e)).map(e=>ea(Ws(e,["entity"])))};this.entity=e}this.actions=this.entity.actions.map(e=>ea(e)).filter(e=>e);const s=t.attributes.conditions||[],a=t.attributes.options||{};this.entries=r.map(e=>{const r=e.actions.filter(e=>eta(t.attributes.actions[e])).shift(),i=ia(this.entity,r);if(!this.actions.find(e=>e.id==i.id)){let e=[...this.actions];e.push(i),this.actions=e}const n={time:e.time,endTime:e.endTime,days:e.days,entity:this.entity.id,action:i.id};if(i.variable&&r.service_data&&i.variable.field in r.service_data)if(i.variable.type==xe.Level){const e={type:xe.Level,value:Number(r.service_data[i.variable.field]),enabled:!0};Object.assign(n,{variable:e})}else{const e={type:xe.List,value:String(r.service_data[i.variable.field])};Object.assign(n,{variable:e})}return e.conditions&&e.conditions.items.length&&Object.assign(n,{conditions:{type:e.conditions.type,items:e.conditions.items.filter(e=>s.length>=e-1).map(e=>s[e])}}),e.options&&Object.keys(e.options).length&&Object.assign(n,{options:e.options.reduce((e,t)=>Object.assign(e,Gs(a,[Object.keys(a)[t]])),{})}),n}),this.editItem=t.entity_id,this.friendlyName=t.attributes.friendly_name,this.entries.every(e=>e.endTime)?(this._view=Ss.TimeScheme,this.entries=function(e){e.sort((e,t)=>e.time.value>t.time.value?1:-1),e=e.map(e=>e.endTime.valuet&&e.splice(r,0,Object.assign({time:{value:t},endTime:{value:i.time.value}},Gs(i,["entity","days","conditions","options"]))),t=i.endTime.value}return t<1440&&e.push(Object.assign({time:{value:t},endTime:{value:1440}},Gs(e[0],["entity","days","conditions","options"]))),e}(this.entries)):(this.actions=this.actions.filter(e=>e.id==this.entries[0].action),this._view=Ss.TimePicker)}_gotoOptionsClick(e){this.entries=e.detail,this._view=Ss.Options}_optionsBackClick(e,t){this.entries=e.detail.entries,this.friendlyName=e.detail.friendlyName,this.entries.every(e=>e.endTime)?this._view=Ss.TimeScheme:this._view=Ss.TimePicker,t&&this._saveItemClick()}},t([J()],e.SchedulerCard.prototype,"_hass",void 0),t([J()],e.SchedulerCard.prototype,"_view",void 0),t([J()],e.SchedulerCard.prototype,"entries",void 0),t([J()],e.SchedulerCard.prototype,"entity",void 0),t([J()],e.SchedulerCard.prototype,"actions",void 0),t([J()],e.SchedulerCard.prototype,"friendlyName",void 0),e.SchedulerCard=t([W("scheduler-card")],e.SchedulerCard)}({}); diff --git a/src/const.ts b/src/const.ts index 308821f5..46c49016 100755 --- a/src/const.ts +++ b/src/const.ts @@ -2,7 +2,7 @@ import { ActionConfig } from './types'; import { EDayType } from './date-time'; import { localize } from './localize/localize'; -export const CARD_VERSION = '1.8.2'; +export const CARD_VERSION = '1.8.3'; export const DefaultTimeStep = 10;