Files
homeassistant_espscreen/screen_manager/app/static/assets/index-CUv9rdNM.js
T
Max Gramser 1dc2eab0cf Speak the editor in each person's Home Assistant language: every text in the editor section of en.json, the mockup in the screens' language, and one Language & region card for all screens
- vue-i18n 11 with the Composition API: English comes with the page, any other language loads the first time it is
  needed from screen_manager/translations, and a text a language lacks shows in English. The build keeps only _meta
  and editor of each file (vite.config.ts), never the screens' or the add-on's texts.
- The editor follows the language of the user's Home Assistant profile (<html lang> of Home Assistant's page), else
  the browser's; plural forms follow the file's _meta.plural, with the screens' rules.
- Every request tells the add-on the editor's language (X-ESP-Screens-Language), so its own words can follow it.
- The mockup draws the screens' words (Unavailable, Page 2 ›, the date, "5 min ago") in the screens' language, with
  their clock and number format.
- Settings → Language & region: the screen language, time format and number format for every screen, with the user's
  own profile offered when it differs. The per-screen clock choice goes; the top bar points there. A screen that
  still needs the new language says so in its update badge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 14:48:12 +02:00

31 lines
314 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function al(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const De={},Wn=[],Gt=()=>{},Er=()=>!1,Do=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Fo=e=>e.startsWith("onUpdate:"),st=Object.assign,rl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},zu=Object.prototype.hasOwnProperty,Ae=(e,t)=>zu.call(e,t),de=Array.isArray,Cn=e=>Ys(e)==="[object Map]",dn=e=>Ys(e)==="[object Set]",Bl=e=>Ys(e)==="[object Date]",be=e=>typeof e=="function",Ye=e=>typeof e=="string",Xt=e=>typeof e=="symbol",Ie=e=>e!==null&&typeof e=="object",Tr=e=>(Ie(e)||be(e))&&be(e.then)&&be(e.catch),Ar=Object.prototype.toString,Ys=e=>Ar.call(e),Qu=e=>Ys(e).slice(8,-1),Pr=e=>Ys(e)==="[object Object]",cl=e=>Ye(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Cs=al(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Uo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Zu=/-\w/g,dt=Uo(e=>e.replace(Zu,t=>t.slice(1).toUpperCase())),ed=/\B([A-Z])/g,Nn=Uo(e=>e.replace(ed,"-$1").toLowerCase()),jo=Uo(e=>e.charAt(0).toUpperCase()+e.slice(1)),oi=Uo(e=>e?`on${jo(e)}`:""),qt=(e,t)=>!Object.is(e,t),fo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Lr=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Ho=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Kl;const Vo=()=>Kl||(Kl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function He(e){if(de(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Ye(s)?od(s):He(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Ye(e)||Ie(e))return e}const td=/;(?![^(]*\))/g,nd=/:([^]+)/,sd=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function od(e){const t={};return e.replace(sd,n=>n.startsWith("/*")?"":n).split(td).forEach(n=>{if(n){const s=n.split(nd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ve(e){let t="";if(Ye(e))t=e;else if(de(e))for(let n=0;n<e.length;n++){const s=ve(e[n]);s&&(t+=s+" ")}else if(Ie(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const id="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ld=al(id);function Ir(e){return!!e||e===""}function ad(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Mt(e[o],t[o],n);return s}function Yl(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const i of e){let r=-1;for(let c=0;c<s.length;c++)if(!o[c]&&Mt(i,s[c],n)){r=c;break}if(r<0)return!1;o[r]=1}return!0}function rd(e,t,n){let s=Cn(e),o=Cn(t);if(s||o||(s=dn(e),o=dn(t),s||o))return s&&o?Yl(e,t,n):!1;const i=Object.keys(e).length,r=Object.keys(t).length;if(i!==r)return!1;for(const c in e){const d=e.hasOwnProperty(c),h=t.hasOwnProperty(c);if(d&&!h||!d&&h||!Mt(e[c],t[c],n))return!1}return String(e)===String(t)}function ql(e,t,n,s){n||(n=[new Map,new Map]);const[o,i]=n;if(o.has(e)||i.has(t))return o.get(e)===t&&i.get(t)===e;o.set(e,t),i.set(t,e);const r=s(e,t,n);return o.delete(e),i.delete(t),r}function Mt(e,t,n){if(e===t)return!0;let s=Bl(e),o=Bl(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=Xt(e),o=Xt(t),s||o?e===t:(s=de(e),o=de(t),s||o?s&&o?ql(e,t,n,ad):!1:(s=Ie(e),o=Ie(t),s||o?!s||!o?!1:ql(e,t,n,rd):String(e)===String(t))))}function ul(e,t){return e.findIndex(n=>Mt(n,t))}const Or=e=>!!(e&&e.__v_isRef===!0),f=e=>Ye(e)?e:e==null?"":de(e)||Ie(e)&&(e.toString===Ar||!be(e.toString))?Or(e)?f(e.value):JSON.stringify(e,Nr,2):String(e),Nr=(e,t)=>Or(t)?Nr(e,t.value):Cn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[ii(s,i)+" =>"]=o,n),{})}:dn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ii(n))}:Xt(t)?ii(t):Ie(t)&&!de(t)&&!Pr(t)?String(t):t,ii=(e,t="")=>{var n;return Xt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let ze;class Mr{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ze&&(ze.active?(this.parent=ze,this.index=(ze.scopes||(ze.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=ze;try{return ze=this,t()}finally{ze=n}}}on(){++this._on===1&&(this.prevScope=ze,ze=this)}off(){if(this._on>0&&--this._on===0){if(ze===this)ze=this.prevScope;else{let t=ze;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function cd(e){return new Mr(e)}function Rr(){return ze}function ud(e,t=!1){ze&&ze.cleanups.push(e)}let Fe;const li=new WeakSet;class Dr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ze&&(ze.active?ze.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,li.has(this)&&(li.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ur(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Gl(this),jr(this);const t=Fe,n=Nt;Fe=this,Nt=!0;try{return this.fn()}finally{Hr(this),Fe=t,Nt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)pl(t);this.deps=this.depsTail=void 0,Gl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?li.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ai(this)&&this.run()}get dirty(){return Ai(this)}}let Fr=0,Es,Ts;function Ur(e,t=!1){if(e.flags|=8,t){e.next=Ts,Ts=e;return}e.next=Es,Es=e}function dl(){Fr++}function fl(){if(--Fr>0)return;if(Ts){let t=Ts;for(Ts=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Es;){let t=Es;for(Es=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function jr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Hr(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),pl(s),dd(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Ai(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Vr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Vr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Os)||(e.globalVersion=Os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ai(e))))return;e.flags|=2;const t=e.dep,n=Fe,s=Nt;Fe=e,Nt=!0;try{jr(e);const o=e.fn(e._value);(t.version===0||qt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Fe=n,Nt=s,Hr(e),e.flags&=-3}}function pl(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)pl(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function dd(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Nt=!0;const Wr=[];function fn(){Wr.push(Nt),Nt=!1}function pn(){const e=Wr.pop();Nt=e===void 0?!0:e}function Gl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Fe;Fe=void 0;try{t()}finally{Fe=n}}}let Os=0;class fd{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hl{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Fe||!Nt||Fe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Fe)n=this.activeLink=new fd(Fe,this),Fe.deps?(n.prevDep=Fe.depsTail,Fe.depsTail.nextDep=n,Fe.depsTail=n):Fe.deps=Fe.depsTail=n,Br(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Fe.depsTail,n.nextDep=void 0,Fe.depsTail.nextDep=n,Fe.depsTail=n,Fe.deps===n&&(Fe.deps=s)}return n}trigger(t){this.version++,Os++,this.notify(t)}notify(t){dl();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{fl()}}}function Br(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Br(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Pi=new WeakMap,Bn=Symbol(""),Li=Symbol(""),Ns=Symbol("");function it(e,t,n){if(Nt&&Fe){let s=Pi.get(e);s||Pi.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new hl),o.map=s,o.key=n),o.track()}}function on(e,t,n,s,o,i){const r=Pi.get(e);if(!r){Os++;return}const c=d=>{d&&d.trigger()};if(dl(),t==="clear")r.forEach(c);else{const d=de(e),h=d&&cl(n);if(d&&n==="length"){const p=Number(s);r.forEach((g,v)=>{(v==="length"||v===Ns||!Xt(v)&&v>=p)&&c(g)})}else switch((n!==void 0||r.has(void 0))&&c(r.get(n)),h&&c(r.get(Ns)),t){case"add":d?h&&c(r.get("length")):(c(r.get(Bn)),Cn(e)&&c(r.get(Li)));break;case"delete":d||(c(r.get(Bn)),Cn(e)&&c(r.get(Li)));break;case"set":Cn(e)&&c(r.get(Bn));break}}fl()}function Zn(e){const t=Se(e);return t===e||(it(t,"iterate",Ns),Ct(e))?t:zt(e)?En(e)?t.map(n=>An(Pt(n))):t.map(An):t.map(Pt)}function Wo(e){return it(e=Se(e),"iterate",Ns),e}function Kt(e,t){return zt(e)?An(En(e)?Pt(t):t):Pt(t)}const pd={__proto__:null,[Symbol.iterator](){return ai(this,Symbol.iterator,e=>Kt(this,e))},concat(...e){return Zn(this).concat(...e.map(t=>de(t)?Zn(t):t))},entries(){return ai(this,"entries",e=>(e[1]=Kt(this,e[1]),e))},every(e,t){return Qt(this,"every",e,t,void 0,arguments)},filter(e,t){return Qt(this,"filter",e,t,n=>n.map(s=>Kt(this,s)),arguments)},find(e,t){return Qt(this,"find",e,t,n=>Kt(this,n),arguments)},findIndex(e,t){return Qt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Qt(this,"findLast",e,t,n=>Kt(this,n),arguments)},findLastIndex(e,t){return Qt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Qt(this,"forEach",e,t,void 0,arguments)},includes(...e){return ri(this,"includes",e)},indexOf(...e){return ri(this,"indexOf",e)},join(e){return Zn(this).join(e)},lastIndexOf(...e){return ri(this,"lastIndexOf",e)},map(e,t){return Qt(this,"map",e,t,void 0,arguments)},pop(){return vs(this,"pop")},push(...e){return vs(this,"push",e)},reduce(e,...t){return Jl(this,"reduce",e,t)},reduceRight(e,...t){return Jl(this,"reduceRight",e,t)},shift(){return vs(this,"shift")},some(e,t){return Qt(this,"some",e,t,void 0,arguments)},splice(...e){return vs(this,"splice",e)},toReversed(){return Zn(this).toReversed()},toSorted(e){return Zn(this).toSorted(e)},toSpliced(...e){return Zn(this).toSpliced(...e)},unshift(...e){return vs(this,"unshift",e)},values(){return ai(this,"values",e=>Kt(this,e))}};function ai(e,t,n){const s=Wo(e),o=s[t]();return s!==e&&!Ct(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const hd=Array.prototype;function Qt(e,t,n,s,o,i){const r=Wo(e),c=r!==e&&!Ct(e),d=r[t];if(d!==hd[t]){const g=d.apply(e,i);return c?Pt(g):g}let h=n;r!==e&&(c?h=function(g,v){return n.call(this,Kt(e,g),v,e)}:n.length>2&&(h=function(g,v){return n.call(this,g,v,e)}));const p=d.call(r,h,s);return c&&o?o(p):p}function Jl(e,t,n,s){const o=Wo(e),i=o!==e&&!Ct(e);let r=n,c=!1;o!==e&&(i?(c=s.length===0,r=function(h,p,g){return c&&(c=!1,h=Kt(e,h)),n.call(this,h,Kt(e,p),g,e)}):n.length>3&&(r=function(h,p,g){return n.call(this,h,p,g,e)}));const d=o[t](r,...s);return c?Kt(e,d):d}function ri(e,t,n){const s=Se(e);it(s,"iterate",Ns);const o=s[t](...n);return(o===-1||o===!1)&&vl(n[0])?(n[0]=Se(n[0]),s[t](...n)):o}function vs(e,t,n=[]){fn(),dl();const s=Se(e)[t].apply(e,n);return fl(),pn(),s}const md=al("__proto__,__v_isRef,__isVue"),Kr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Xt));function gd(e){Xt(e)||(e=String(e));const t=Se(this);return it(t,"has",e),t.hasOwnProperty(e)}class Yr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?Cd:Xr:i?Jr:Gr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=de(t);if(!o){let d;if(r&&(d=pd[n]))return d;if(n==="hasOwnProperty")return gd}const c=Reflect.get(t,n,nt(t)?t:s);if((Xt(n)?Kr.has(n):md(n))||(o||it(t,"get",n),i))return c;if(nt(c)){const d=r&&cl(n)?c:c.value;return o&&Ie(d)?Oi(d):d}return Ie(c)?o?Oi(c):Xn(c):c}}class qr extends Yr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=de(t)&&cl(n);if(!this._isShallow){const h=zt(i);if(!Ct(s)&&!zt(s)&&(i=Se(i),s=Se(s)),!r&&nt(i)&&!nt(s))return h||(i.value=s),!0}const c=r?Number(n)<t.length:Ae(t,n),d=Reflect.set(t,n,s,nt(t)?t:o);return t===Se(o)&&d&&(c?qt(s,i)&&on(t,"set",n,s):on(t,"add",n,s)),d}deleteProperty(t,n){const s=Ae(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&on(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Xt(n)||!Kr.has(n))&&it(t,"has",n),s}ownKeys(t){return it(t,"iterate",de(t)?"length":Bn),Reflect.ownKeys(t)}}class vd extends Yr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const _d=new qr,yd=new vd,bd=new qr(!0);const Ii=e=>e,no=e=>Reflect.getPrototypeOf(e);function wd(e,t,n){return function(...s){const o=this.__v_raw,i=Se(o),r=Cn(i),c=e==="entries"||e===Symbol.iterator&&r,d=e==="keys"&&r,h=o[e](...s),p=n?Ii:t?An:Pt;return!t&&it(i,"iterate",d?Li:Bn),st(Object.create(h),{next(){const{value:g,done:v}=h.next();return v?{value:g,done:v}:{value:c?[p(g[0]),p(g[1])]:p(g),done:v}}})}}function so(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function kd(e,t){const n={get(o){const i=this.__v_raw,r=Se(i),c=Se(o);e||(qt(o,c)&&it(r,"get",o),it(r,"get",c));const{has:d}=no(r),h=t?Ii:e?An:Pt;if(d.call(r,o))return h(i.get(o));if(d.call(r,c))return h(i.get(c));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&it(Se(o),"iterate",Bn),o.size},has(o){const i=this.__v_raw,r=Se(i),c=Se(o);return e||(qt(o,c)&&it(r,"has",o),it(r,"has",c)),o===c?i.has(o):i.has(o)||i.has(c)},forEach(o,i){const r=this,c=r.__v_raw,d=Se(c),h=t?Ii:e?An:Pt;return!e&&it(d,"iterate",Bn),c.forEach((p,g)=>o.call(i,h(p),h(g),r))}};return st(n,e?{add:so("add"),set:so("set"),delete:so("delete"),clear:so("clear")}:{add(o){const i=Se(this),r=no(i),c=Se(o),d=!t&&!Ct(o)&&!zt(o)?c:o;return r.has.call(i,d)||qt(o,d)&&r.has.call(i,o)||qt(c,d)&&r.has.call(i,c)||(i.add(d),on(i,"add",d,d)),this},set(o,i){!t&&!Ct(i)&&!zt(i)&&(i=Se(i));const r=Se(this),{has:c,get:d}=no(r);let h=c.call(r,o);h||(o=Se(o),h=c.call(r,o));const p=d.call(r,o);return r.set(o,i),h?qt(i,p)&&on(r,"set",o,i):on(r,"add",o,i),this},delete(o){const i=Se(this),{has:r,get:c}=no(i);let d=r.call(i,o);d||(o=Se(o),d=r.call(i,o)),c&&c.call(i,o);const h=i.delete(o);return d&&on(i,"delete",o,void 0),h},clear(){const o=Se(this),i=o.size!==0,r=o.clear();return i&&on(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=wd(o,e,t)}),n}function ml(e,t){const n=kd(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Ae(n,o)&&o in s?n:s,o,i)}const $d={get:ml(!1,!1)},Sd={get:ml(!1,!0)},xd={get:ml(!0,!1)};const Gr=new WeakMap,Jr=new WeakMap,Xr=new WeakMap,Cd=new WeakMap;function Ed(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Xn(e){return zt(e)?e:gl(e,!1,_d,$d,Gr)}function Td(e){return gl(e,!1,bd,Sd,Jr)}function Oi(e){return gl(e,!0,yd,xd,Xr)}function gl(e,t,n,s,o){if(!Ie(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=Ed(Qu(e));if(r===0)return e;const c=new Proxy(e,r===2?s:n);return o.set(e,c),c}function En(e){return zt(e)?En(e.__v_raw):!!(e&&e.__v_isReactive)}function zt(e){return!!(e&&e.__v_isReadonly)}function Ct(e){return!!(e&&e.__v_isShallow)}function vl(e){return e?!!e.__v_raw:!1}function Se(e){const t=e&&e.__v_raw;return t?Se(t):e}function Ad(e){return!Ae(e,"__v_skip")&&Object.isExtensible(e)&&Lr(e,"__v_skip",!0),e}const Pt=e=>Ie(e)?Xn(e):e,An=e=>Ie(e)?Oi(e):e;function nt(e){return e?e.__v_isRef===!0:!1}function ke(e){return zr(e,!1)}function Pd(e){return zr(e,!0)}function zr(e,t){return nt(e)?e:new Ld(e,t)}class Ld{constructor(t,n){this.dep=new hl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Se(t),this._value=n?t:Pt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Ct(t)||zt(t);t=s?t:Se(t),qt(t,n)&&(this._rawValue=t,this._value=s?t:Pt(t),this.dep.trigger())}}function a(e){return nt(e)?e.value:e}const Id={get:(e,t,n)=>t==="__v_raw"?e:a(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return nt(o)&&!nt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Qr(e){return En(e)?e:new Proxy(e,Id)}class Od{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new hl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Fe!==this)return Ur(this,!0),!0}get value(){const t=this.dep.track();return Vr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Nd(e,t,n=!1){let s,o;return be(e)?s=e:(s=e.get,o=e.set),new Od(s,o,n)}const oo={},go=new WeakMap;let Hn;function Md(e,t=!1,n=Hn){if(n){let s=go.get(n);s||go.set(n,s=[]),s.push(e)}}function Rd(e,t,n=De){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:c,call:d}=n,h=x=>o?x:Ct(x)||o===!1||o===0?ln(x,1):ln(x);let p,g,v,$,U=!1,A=!1;if(nt(e)?(g=()=>e.value,U=Ct(e)):En(e)?(g=()=>h(e),U=!0):de(e)?(A=!0,U=e.some(x=>En(x)||Ct(x)),g=()=>e.map(x=>{if(nt(x))return x.value;if(En(x))return h(x);if(be(x))return d?d(x,2):x()})):be(e)?t?g=d?()=>d(e,2):e:g=()=>{if(v){fn();try{v()}finally{pn()}}const x=Hn;Hn=p;try{return d?d(e,3,[$]):e($)}finally{Hn=x}}:g=Gt,t&&o){const x=g,j=o===!0?1/0:o;g=()=>ln(x(),j)}const T=Rr(),k=()=>{p.stop(),T&&T.active&&rl(T.effects,p)};if(i&&t){const x=t;t=(...j)=>{const O=x(...j);return k(),O}}let S=A?new Array(e.length).fill(oo):oo;const F=x=>{if(!(!(p.flags&1)||!p.dirty&&!x))if(t){const j=p.run();if(x||o||U||(A?j.some((O,C)=>qt(O,S[C])):qt(j,S))){v&&v();const O=Hn;Hn=p;try{const C=[j,S===oo?void 0:A&&S[0]===oo?[]:S,$];S=j,d?d(t,3,C):t(...C)}finally{Hn=O}}}else p.run()};return c&&c(F),p=new Dr(g),p.scheduler=r?()=>r(F,!1):F,$=x=>Md(x,!1,p),v=p.onStop=()=>{const x=go.get(p);if(x){if(d)d(x,4);else for(const j of x)j();go.delete(p)}},t?s?F(!0):S=p.run():r?r(F.bind(null,!0),!0):p.run(),k.pause=p.pause.bind(p),k.resume=p.resume.bind(p),k.stop=k,k}function ln(e,t=1/0,n){if(t<=0||!Ie(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,nt(e))ln(e.value,t,n);else if(de(e))for(let s=0;s<e.length;s++)ln(e[s],t,n);else if(dn(e)||Cn(e))e.forEach(s=>{ln(s,t,n)});else if(Pr(e)){for(const s in e)ln(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&ln(e[s],t,n)}return e}function qs(e,t,n,s){try{return s?e(...s):e()}catch(o){Bo(o,t,n)}}function Rt(e,t,n,s){if(be(e)){const o=qs(e,t,n,s);return o&&Tr(o)&&o.catch(i=>{Bo(i,t,n)}),o}if(de(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Rt(e[i],t,n,s));return o}}function Bo(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||De;if(t){let c=t.parent;const d=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const p=c.ec;if(p){for(let g=0;g<p.length;g++)if(p[g](e,d,h)===!1)return}c=c.parent}if(i){fn(),qs(i,null,10,[e,d,h]),pn();return}}Dd(e,n,o,s,r)}function Dd(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const ut=[];let Wt=-1;const os=[];let $n=null,es=0;const Zr=Promise.resolve();let vo=null;function Ko(e){const t=vo||Zr;return e?t.then(this?e.bind(this):e):t}function Fd(e){let t=Wt+1,n=ut.length;for(;t<n;){const s=t+n>>>1,o=ut[s],i=Ms(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function _l(e){if(!(e.flags&1)){const t=Ms(e),n=ut[ut.length-1];!n||!(e.flags&2)&&t>=Ms(n)?ut.push(e):ut.splice(Fd(t),0,e),e.flags|=1,ec()}}function ec(){vo||(vo=Zr.then(nc))}function Ud(e){if(!de(e))$n&&e.id===-1?$n.splice(es+1,0,e):e.flags&1||(os.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)os.push(e[t]);ec()}function Xl(e,t,n=Wt+1){for(;n<ut.length;n++){const s=ut[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;ut.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function tc(e){if(os.length){const t=[...new Set(os)].sort((n,s)=>Ms(n)-Ms(s));if(os.length=0,$n){for(let n=0;n<t.length;n++)$n.push(t[n]);return}for($n=t,es=0;es<$n.length;es++){const n=$n[es];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}$n=null,es=0}}const Ms=e=>e.id==null?e.flags&2?-1:1/0:e.id;function nc(e){try{for(Wt=0;Wt<ut.length;Wt++){const t=ut[Wt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),qs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Wt<ut.length;Wt++){const t=ut[Wt];t&&(t.flags&=-2)}Wt=-1,ut.length=0,tc(),vo=null,(ut.length||os.length)&&nc()}}let vt=null,sc=null;function _o(e){const t=vt;return vt=e,sc=e&&e.type.__scopeId||null,t}function ie(e,t=vt,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&wo(-1);const i=_o(t),r=Kn.length;let c;try{c=e(...o)}finally{for(let d=Kn.length;d>r;d--)Ac();_o(i),s._d&&wo(1)}return c};return s._n=!0,s._c=!0,s._d=!0,s}function Pe(e,t){if(vt===null)return e;const n=Jo(vt),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,c,d=De]=t[o];i&&(be(i)&&(i={mounted:i,updated:i}),i.deep&&ln(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:c,modifiers:d}))}return e}function Un(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const c=o[r];i&&(c.oldValue=i[r].value);let d=c.dir[s];d&&(fn(),Rt(d,n,8,[e.el,c,e,t]),pn())}}function jd(e,t){if(lt){let n=lt.provides;const s=lt.parent&&lt.parent.provides;s===n&&(n=lt.provides=Object.create(s)),n[e]=t}}function As(e,t,n=!1){const s=Ic();if(s||is){let o=is?is._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&be(t)?t.call(s&&s.proxy):t}}const Hd=Symbol.for("v-scx"),Vd=()=>As(Hd);function Et(e,t,n){return oc(e,t,n)}function oc(e,t,n=De){const{immediate:s,deep:o,flush:i,once:r}=n,c=st({},n),d=t&&s||!t&&i!=="post";let h;if(Fs){if(i==="sync"){const $=Vd();h=$.__watcherHandles||($.__watcherHandles=[])}else if(!d){const $=()=>{};return $.stop=Gt,$.resume=Gt,$.pause=Gt,$}}const p=lt;c.call=($,U,A)=>Rt($,p,U,A);let g=!1;i==="post"?c.scheduler=$=>{pt($,p&&p.suspense)}:i!=="sync"&&(g=!0,c.scheduler=($,U)=>{U?$():_l($)}),c.augmentJob=$=>{t&&($.flags|=4),g&&($.flags|=2,p&&($.id=p.uid,$.i=p))};const v=Rd(e,t,c);return Fs&&(h?h.push(v):d&&v()),v}function Wd(e,t,n){const s=this.proxy,o=Ye(e)?e.includes(".")?ic(s,e):()=>s[e]:e.bind(s,s);let i;be(t)?i=t:(i=t.handler,n=t);const r=Xs(this),c=oc(o,i.bind(s),n);return r(),c}function ic(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Bd=Symbol("_vte"),Yo=e=>e.__isTeleport,ci=Symbol("_leaveCb");function Kd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==hn){t=n;break}}return t}function lc(e){if(!bl(e))return Yo(e.type)&&e.children?Kd(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&be(n.default))return n.default()}}function yl(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;yl(Yo(n.type)&&lc(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Me(e,t){return be(e)?st({name:e.name},t,{setup:e}):e}function ac(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function zl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const yo=new WeakMap;function Ps(e,t,n,s,o=!1){if(de(e)){e.forEach((A,T)=>Ps(A,t&&(de(t)?t[T]:t),n,s,o));return}if(Ls(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ps(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Jo(s.component):s.el,r=o?null:i,{i:c,r:d}=e,h=t&&t.r,p=c.refs===De?c.refs={}:c.refs,g=c.setupState,v=Se(g),$=g===De?Er:A=>zl(p,A)?!1:Ae(v,A),U=(A,T)=>!(T&&zl(p,T));if(h!=null&&h!==d){if(Ql(t),Ye(h))p[h]=null,$(h)&&(g[h]=null);else if(nt(h)){const A=t;U(h,A.k)&&(h.value=null),A.k&&(p[A.k]=null)}}if(be(d))qs(d,c,12,[r,p]);else{const A=Ye(d),T=nt(d);if(A||T){const k=()=>{if(e.f){const S=A?$(d)?g[d]:p[d]:U()||!e.k?d.value:p[e.k];if(o)de(S)&&rl(S,i);else if(de(S))S.includes(i)||S.push(i);else if(A)p[d]=[i],$(d)&&(g[d]=p[d]);else{const F=[i];U(d,e.k)&&(d.value=F),e.k&&(p[e.k]=F)}}else A?(p[d]=r,$(d)&&(g[d]=r)):T&&(U(d,e.k)&&(d.value=r),e.k&&(p[e.k]=r))};if(r){const S=()=>{k(),yo.delete(e)};S.id=-1,yo.set(e,S),pt(S,n)}else Ql(e),k()}}}function Ql(e){const t=yo.get(e);t&&(t.flags|=8,yo.delete(e))}Vo().requestIdleCallback;Vo().cancelIdleCallback;const Ls=e=>!!e.type.__asyncLoader,bl=e=>e.type.__isKeepAlive;function Yd(e,t){rc(e,"a",t)}function qd(e,t){rc(e,"da",t)}function rc(e,t,n=lt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(qo(t,s,n),n){let o=n.parent;for(;o&&o.parent;)bl(o.parent.vnode)&&Gd(s,t,n,o),o=o.parent}}function Gd(e,t,n,s){const o=qo(t,e,s,!0);wl(()=>{rl(s[t],o)},n)}function qo(e,t,n=lt,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{fn();const c=Xs(n),d=Rt(t,n,e,r);return c(),pn(),d});return s?o.unshift(i):o.push(i),i}}const _n=e=>(t,n=lt)=>{(!Fs||e==="sp")&&qo(e,(...s)=>t(...s),n)},Jd=_n("bm"),Mn=_n("m"),Xd=_n("bu"),zd=_n("u"),ms=_n("bum"),wl=_n("um"),Qd=_n("sp"),Zd=_n("rtg"),ef=_n("rtc");function tf(e,t=lt){qo("ec",e,t)}const cc="components";function Gs(e,t){return dc(cc,e,!0,t)||e}const uc=Symbol.for("v-ndc");function nf(e){return Ye(e)?dc(cc,e,!1)||e:e||uc}function dc(e,t,n=!0,s=!1){const o=vt||lt;if(o){const i=o.type;{const c=jf(i,!1);if(c&&(c===t||c===dt(t)||c===jo(dt(t))))return i}const r=Zl(o[e]||i[e],t)||Zl(o.appContext[e],t);return!r&&s?i:r}}function Zl(e,t){return e&&(e[t]||e[dt(t)]||e[jo(dt(t))])}function ge(e,t,n,s){let o;const i=n,r=de(e);if(r||Ye(e)){const c=r&&En(e);let d=!1,h=!1;c&&(d=!Ct(e),h=zt(e),e=Wo(e)),o=new Array(e.length);for(let p=0,g=e.length;p<g;p++)o[p]=t(d?h?An(Pt(e[p])):Pt(e[p]):e[p],p,void 0,i)}else if(typeof e=="number"){o=new Array(e);for(let c=0;c<e;c++)o[c]=t(c+1,c,void 0,i)}else if(Ie(e))if(e[Symbol.iterator])o=Array.from(e,(c,d)=>t(c,d,void 0,i));else{const c=Object.keys(e);o=new Array(c.length);for(let d=0,h=c.length;d<h;d++){const p=c[d];o[d]=t(e[p],p,d,i)}}else o=[];return o}const Ni=e=>e?Oc(e)?Jo(e):Ni(e.parent):null,Is=st(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ni(e.parent),$root:e=>Ni(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>pc(e),$forceUpdate:e=>e.f||(e.f=()=>{_l(e.update)}),$nextTick:e=>e.n||(e.n=Ko.bind(e.proxy)),$watch:e=>Wd.bind(e)}),ui=(e,t)=>e!==De&&!e.__isScriptSetup&&Ae(e,t),sf={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:c,appContext:d}=e;if(t[0]!=="$"){const v=r[t];if(v!==void 0)switch(v){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(ui(s,t))return r[t]=1,s[t];if(o!==De&&Ae(o,t))return r[t]=2,o[t];if(Ae(i,t))return r[t]=3,i[t];if(n!==De&&Ae(n,t))return r[t]=4,n[t];Mi&&(r[t]=0)}}const h=Is[t];let p,g;if(h)return t==="$attrs"&&it(e.attrs,"get",""),h(e);if((p=c.__cssModules)&&(p=p[t]))return p;if(n!==De&&Ae(n,t))return r[t]=4,n[t];if(g=d.config.globalProperties,Ae(g,t))return g[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return ui(o,t)?(o[t]=n,!0):s!==De&&Ae(s,t)?(s[t]=n,!0):Ae(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},c){let d;return!!(n[c]||e!==De&&c[0]!=="$"&&Ae(e,c)||ui(t,c)||Ae(i,c)||Ae(s,c)||Ae(Is,c)||Ae(o.config.globalProperties,c)||(d=r.__cssModules)&&d[c])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ae(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ea(e){return de(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Mi=!0;function of(e){const t=pc(e),n=e.proxy,s=e.ctx;Mi=!1,t.beforeCreate&&ta(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:c,provide:d,inject:h,created:p,beforeMount:g,mounted:v,beforeUpdate:$,updated:U,activated:A,deactivated:T,beforeDestroy:k,beforeUnmount:S,destroyed:F,unmounted:x,render:j,renderTracked:O,renderTriggered:C,errorCaptured:I,serverPrefetch:K,expose:M,inheritAttrs:he,components:z,directives:oe,filters:pe}=t;if(h&&lf(h,s,null),r)for(const ye in r){const $e=r[ye];be($e)&&(s[ye]=$e.bind(n))}if(o){const ye=o.call(n,n);Ie(ye)&&(e.data=Xn(ye))}if(Mi=!0,i)for(const ye in i){const $e=i[ye],Ge=be($e)?$e.bind(n,n):be($e.get)?$e.get.bind(n,n):Gt,ae=!be($e)&&be($e.set)?$e.set.bind(n):Gt,ee=L({get:Ge,set:ae});Object.defineProperty(s,ye,{enumerable:!0,configurable:!0,get:()=>ee.value,set:Y=>ee.value=Y})}if(c)for(const ye in c)fc(c[ye],s,n,ye);if(d){const ye=be(d)?d.call(n):d;Reflect.ownKeys(ye).forEach($e=>{jd($e,ye[$e])})}p&&ta(p,e,"c");function ce(ye,$e){de($e)?$e.forEach(Ge=>ye(Ge.bind(n))):$e&&ye($e.bind(n))}if(ce(Jd,g),ce(Mn,v),ce(Xd,$),ce(zd,U),ce(Yd,A),ce(qd,T),ce(tf,I),ce(ef,O),ce(Zd,C),ce(ms,S),ce(wl,x),ce(Qd,K),de(M))if(M.length){const ye=e.exposed||(e.exposed={});M.forEach($e=>{Object.defineProperty(ye,$e,{get:()=>n[$e],set:Ge=>n[$e]=Ge,enumerable:!0})})}else e.exposed||(e.exposed={});j&&e.render===Gt&&(e.render=j),he!=null&&(e.inheritAttrs=he),z&&(e.components=z),oe&&(e.directives=oe),K&&ac(e)}function lf(e,t,n=Gt){de(e)&&(e=Ri(e));for(const s in e){const o=e[s];let i;Ie(o)?"default"in o?i=As(o.from||s,o.default,!0):i=As(o.from||s):i=As(o),nt(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function ta(e,t,n){Rt(de(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function fc(e,t,n,s){let o=s.includes(".")?ic(n,s):()=>n[s];if(Ye(e)){const i=t[e];be(i)&&Et(o,i)}else if(be(e))Et(o,e.bind(n));else if(Ie(e))if(de(e))e.forEach(i=>fc(i,t,n,s));else{const i=be(e.handler)?e.handler.bind(n):t[e.handler];be(i)&&Et(o,i,e)}}function pc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,c=i.get(t);let d;return c?d=c:!o.length&&!n&&!s?d=t:(d={},o.length&&o.forEach(h=>bo(d,h,r,!0)),bo(d,t,r)),Ie(t)&&i.set(t,d),d}function bo(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&bo(e,i,n,!0),o&&o.forEach(r=>bo(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const c=af[r]||n&&n[r];e[r]=c?c(e[r],t[r]):t[r]}return e}const af={data:na,props:sa,emits:sa,methods:ws,computed:ws,beforeCreate:rt,created:rt,beforeMount:rt,mounted:rt,beforeUpdate:rt,updated:rt,beforeDestroy:rt,beforeUnmount:rt,destroyed:rt,unmounted:rt,activated:rt,deactivated:rt,errorCaptured:rt,serverPrefetch:rt,components:ws,directives:ws,watch:cf,provide:na,inject:rf};function na(e,t){return t?e?function(){return st(be(e)?e.call(this,this):e,be(t)?t.call(this,this):t)}:t:e}function rf(e,t){return ws(Ri(e),Ri(t))}function Ri(e){if(de(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function rt(e,t){return e?[...new Set([].concat(e,t))]:t}function ws(e,t){return e?st(Object.create(null),e,t):t}function sa(e,t){return e?de(e)&&de(t)?[...new Set([...e,...t])]:st(Object.create(null),ea(e),ea(t??{})):t}function cf(e,t){if(!e)return t;if(!t)return e;const n=st(Object.create(null),e);for(const s in t)n[s]=rt(e[s],t[s]);return n}function hc(){return{app:null,config:{isNativeTag:Er,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let uf=0;function df(e,t){return function(s,o=null){be(s)||(s=st({},s)),o!=null&&!Ie(o)&&(o=null);const i=hc(),r=new WeakSet,c=[];let d=!1;const h=i.app={_uid:uf++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:Vf,get config(){return i.config},set config(p){},use(p,...g){return r.has(p)||(p&&be(p.install)?(r.add(p),p.install(h,...g)):be(p)&&(r.add(p),p(h,...g))),h},mixin(p){return i.mixins.includes(p)||i.mixins.push(p),h},component(p,g){return g?(i.components[p]=g,h):i.components[p]},directive(p,g){return g?(i.directives[p]=g,h):i.directives[p]},mount(p,g,v){if(!d){const $=h._ceVNode||ne(s,o);return $.appContext=i,v===!0?v="svg":v===!1&&(v=void 0),e($,p,v),d=!0,h._container=p,p.__vue_app__=h,Jo($.component)}},onUnmount(p){c.push(p)},unmount(){d&&(Rt(c,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(p,g){return i.provides[p]=g,h},runWithContext(p){const g=is;is=h;try{return p()}finally{is=g}}};return h}}let is=null;const ff=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${dt(t)}Modifiers`]||e[`${Nn(t)}Modifiers`];function pf(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||De;let o=n;const i=t.startsWith("update:"),r=i&&ff(s,t.slice(7));r&&(r.trim&&(o=n.map(p=>Ye(p)?p.trim():p)),r.number&&(o=o.map(Ho)));let c,d=s[c=oi(t)]||s[c=oi(dt(t))];!d&&i&&(d=s[c=oi(Nn(t))]),d&&Rt(d,e,6,o);const h=s[c+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,Rt(h,e,6,o)}}const hf=new WeakMap;function mc(e,t,n=!1){const s=n?hf:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},c=!1;if(!be(e)){const d=h=>{const p=mc(h,t,!0);p&&(c=!0,st(r,p))};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!i&&!c?(Ie(e)&&s.set(e,null),null):(de(i)?i.forEach(d=>r[d]=null):st(r,i),Ie(e)&&s.set(e,r),r)}function Go(e,t){return!e||!Do(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ae(e,t[0].toLowerCase()+t.slice(1))||Ae(e,Nn(t))||Ae(e,t))}function oa(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:c,emit:d,render:h,renderCache:p,props:g,data:v,setupState:$,ctx:U,inheritAttrs:A}=e,T=_o(e);let k,S;try{if(n.shapeFlag&4){const x=o||s,j=x;k=Yt(h.call(j,x,p,g,$,v,U)),S=c}else{const x=t;k=Yt(x.length>1?x(g,{attrs:c,slots:r,emit:d}):x(g,null)),S=t.props?c:mf(c)}}catch(x){Kn.length=0,Bo(x,e,1),k=ne(hn)}let F=k;if(S&&A!==!1){const x=Object.keys(S),{shapeFlag:j}=F;x.length&&j&7&&(i&&x.some(Fo)&&(S=gf(S,i)),F=rs(F,S,!1,!0))}if(n.dirs&&(F=rs(F,null,!1,!0),F.dirs=F.dirs?F.dirs.concat(n.dirs):n.dirs),n.transition){const x=Yo(F.type)&&lc(F)||F;yl(x,n.transition)}return k=F,_o(T),k}const mf=e=>{let t;for(const n in e)(n==="class"||n==="style"||Do(n))&&((t||(t={}))[n]=e[n]);return t},gf=(e,t)=>{const n={};for(const s in e)(!Fo(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function vf(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:c,patchFlag:d}=t,h=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return s?ia(s,r,h):!!r;if(d&8){const p=t.dynamicProps;for(let g=0;g<p.length;g++){const v=p[g];if(gc(r,s,v)&&!Go(h,v))return!0}}}else return(o||c)&&(!c||!c.$stable)?!0:s===r?!1:s?r?ia(s,r,h):!0:!!r;return!1}function ia(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(gc(t,e,i)&&!Go(n,i))return!0}return!1}function gc(e,t,n){const s=e[n],o=t[n];return n==="style"&&Ie(s)&&Ie(o)?!Mt(s,o):s!==o}function _f({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const vc={},_c=()=>Object.create(vc),yc=e=>Object.getPrototypeOf(e)===vc;function yf(e,t,n,s=!1){const o={},i=_c();e.propsDefaults=Object.create(null),bc(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:Td(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function bf(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,c=Se(o),[d]=e.propsOptions;let h=!1;if((s||r>0)&&!(r&16)){if(r&8){const p=e.vnode.dynamicProps;for(let g=0;g<p.length;g++){let v=p[g];if(Go(e.emitsOptions,v))continue;const $=t[v];if(d)if(Ae(i,v))$!==i[v]&&(i[v]=$,h=!0);else{const U=dt(v);o[U]=Di(d,c,U,$,e,!1)}else $!==i[v]&&(i[v]=$,h=!0)}}}else{bc(e,t,o,i)&&(h=!0);let p;for(const g in c)(!t||!Ae(t,g)&&((p=Nn(g))===g||!Ae(t,p)))&&(d?n&&(n[g]!==void 0||n[p]!==void 0)&&(o[g]=Di(d,c,g,void 0,e,!0)):delete o[g]);if(i!==c)for(const g in i)(!t||!Ae(t,g))&&(delete i[g],h=!0)}h&&on(e.attrs,"set","")}function bc(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,c;if(t)for(let d in t){if(Cs(d))continue;const h=t[d];let p;o&&Ae(o,p=dt(d))?!i||!i.includes(p)?n[p]=h:(c||(c={}))[p]=h:Go(e.emitsOptions,d)||(!(d in s)||h!==s[d])&&(s[d]=h,r=!0)}if(i){const d=Se(n),h=c||De;for(let p=0;p<i.length;p++){const g=i[p];n[g]=Di(o,d,g,h[g],e,!Ae(h,g))}}return r}function Di(e,t,n,s,o,i){const r=e[n];if(r!=null){const c=Ae(r,"default");if(c&&s===void 0){const d=r.default;if(r.type!==Function&&!r.skipFactory&&be(d)){const{propsDefaults:h}=o;if(n in h)s=h[n];else{const p=Xs(o);s=h[n]=d.call(null,t),p()}}else s=d;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!c?s=!1:r[1]&&(s===""||s===Nn(n))&&(s=!0))}return s}const wf=new WeakMap;function wc(e,t,n=!1){const s=n?wf:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},c=[];let d=!1;if(!be(e)){const p=g=>{d=!0;const[v,$]=wc(g,t,!0);st(r,v),$&&c.push(...$)};!n&&t.mixins.length&&t.mixins.forEach(p),e.extends&&p(e.extends),e.mixins&&e.mixins.forEach(p)}if(!i&&!d)return Ie(e)&&s.set(e,Wn),Wn;if(de(i))for(let p=0;p<i.length;p++){const g=dt(i[p]);la(g)&&(r[g]=De)}else if(i)for(const p in i){const g=dt(p);if(la(g)){const v=i[p],$=r[g]=de(v)||be(v)?{type:v}:st({},v),U=$.type;let A=!1,T=!0;if(de(U))for(let k=0;k<U.length;++k){const S=U[k],F=be(S)&&S.name;if(F==="Boolean"){A=!0;break}else F==="String"&&(T=!1)}else A=be(U)&&U.name==="Boolean";$[0]=A,$[1]=T,(A||Ae($,"default"))&&c.push(g)}}const h=[r,c];return Ie(e)&&s.set(e,h),h}function la(e){return e[0]!=="$"&&!Cs(e)}const kl=e=>e==="_"||e==="_ctx"||e==="$stable",$l=e=>de(e)?e.map(Yt):[Yt(e)],kf=(e,t,n)=>{if(t._n)return t;const s=ie((...o)=>$l(t(...o)),n);return s._c=!1,s},kc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(kl(o))continue;const i=e[o];if(be(i))t[o]=kf(o,i,s);else if(i!=null){const r=$l(i);t[o]=()=>r}}},$c=(e,t)=>{const n=$l(t);e.slots.default=()=>n},Sc=(e,t,n)=>{for(const s in t)(n||!kl(s))&&(e[s]=t[s])},$f=(e,t,n)=>{const s=e.slots=_c();if(e.vnode.shapeFlag&32){const o=t._;o?(Sc(s,t,n),n&&Lr(s,"_",o,!0)):kc(t,s)}else t&&$c(e,t)},Sf=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=De;if(s.shapeFlag&32){const c=t._;c?n&&c===1?i=!1:Sc(o,t,n):(i=!t.$stable,kc(t,o)),r=t}else t&&($c(e,t),r={default:1});if(i)for(const c in o)!kl(c)&&r[c]==null&&delete o[c]},pt=Af;function xf(e){return Cf(e)}function Cf(e,t){const n=Vo();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:c,createComment:d,setText:h,setElementText:p,parentNode:g,nextSibling:v,setScopeId:$=Gt,insertStaticContent:U}=e,A=(E,P,H,q=null,W=null,B=null,y=void 0,w=null,N=!!P.dynamicChildren)=>{if(E===P)return;E&&!_s(E,P)&&(q=we(E),Y(E,W,B,!0),E=null),P.patchFlag===-2&&(N=!1,P.dynamicChildren=null),P.dynamicChildren&&E&&E.dynamicChildren&&E.dynamicChildren.hasOnce&&(P.dynamicChildren===Wn&&(P.dynamicChildren=[]),P.dynamicChildren.hasOnce=!0);const{type:R,ref:Z,shapeFlag:X}=P;switch(R){case Js:T(E,P,H,q);break;case hn:k(E,P,H,q);break;case fi:E==null&&S(P,H,q,y);break;case J:z(E,P,H,q,W,B,y,w,N);break;default:X&1?j(E,P,H,q,W,B,y,w,N):X&6?oe(E,P,H,q,W,B,y,w,N):(X&64||X&128)&&R.process(E,P,H,q,W,B,y,w,N,Ft)}Z!=null&&W?Ps(Z,E&&E.ref,B,P||E,!P):Z==null&&E&&E.ref!=null&&Ps(E.ref,null,B,E,!0)},T=(E,P,H,q)=>{if(E==null)s(P.el=c(P.children),H,q);else{const W=P.el=E.el;P.children!==E.children&&h(W,P.children)}},k=(E,P,H,q)=>{E==null?s(P.el=d(P.children||""),H,q):P.el=E.el},S=(E,P,H,q)=>{[E.el,E.anchor]=U(E.children,P,H,q,E.el,E.anchor)},F=({el:E,anchor:P},H,q)=>{let W;for(;E&&E!==P;)W=v(E),s(E,H,q),E=W;s(P,H,q)},x=({el:E,anchor:P})=>{let H;for(;E&&E!==P;)H=v(E),o(E),E=H;o(P)},j=(E,P,H,q,W,B,y,w,N)=>{if(P.type==="svg"?y="svg":P.type==="math"&&(y="mathml"),E==null)O(P,H,q,W,B,y,w,N);else{const R=E.el&&E.el._isVueCE?E.el:null;try{R&&R._beginPatch(),K(E,P,W,B,y,w,N)}finally{R&&R._endPatch()}}},O=(E,P,H,q,W,B,y,w)=>{let N,R;const{props:Z,shapeFlag:X,transition:Q,dirs:D}=E;if(N=E.el=r(E.type,B,Z&&Z.is,Z),X&8?p(N,E.children):X&16&&I(E.children,N,null,q,W,di(E,B),y,w),D&&Un(E,null,q,"created"),C(N,E,E.scopeId,y,q),Z){for(const re in Z)re!=="value"&&!Cs(re)&&i(N,re,null,Z[re],B,q);"value"in Z&&i(N,"value",null,Z.value,B),(R=Z.onVnodeBeforeMount)&&jt(R,q,E)}D&&Un(E,null,q,"beforeMount");const V=Ef(W,Q);V&&Q.beforeEnter(N),s(N,P,H),((R=Z&&Z.onVnodeMounted)||V||D)&&pt(()=>{R&&jt(R,q,E),V&&Q.enter(N),D&&Un(E,null,q,"mounted")},W)},C=(E,P,H,q,W)=>{if(H&&$(E,H),q)for(let B=0;B<q.length;B++)$(E,q[B]);if(W){let B=W.subTree;if(P===B||Tc(B.type)&&(B.ssContent===P||B.ssFallback===P)){const y=W.vnode;C(E,y,y.scopeId,y.slotScopeIds,W.parent)}}},I=(E,P,H,q,W,B,y,w,N=0)=>{for(let R=N;R<E.length;R++){const Z=E[R]=w?tn(E[R]):Yt(E[R]);A(null,Z,P,H,q,W,B,y,w)}},K=(E,P,H,q,W,B,y)=>{const w=P.el=E.el;let{patchFlag:N,dynamicChildren:R,dirs:Z}=P;N|=E.patchFlag&16;const X=E.props||De,Q=P.props||De;let D;if(H&&jn(H,!1),(D=Q.onVnodeBeforeUpdate)&&jt(D,H,P,E),Z&&Un(P,E,H,"beforeUpdate"),H&&jn(H,!0),R&&(!E.dynamicChildren||E.dynamicChildren.length!==R.length)&&(N=0,y=!1,R=null),(X.innerHTML&&Q.innerHTML==null||X.textContent&&Q.textContent==null)&&p(w,""),R?M(E.dynamicChildren,R,w,H,q,di(P,W),B):y||$e(E,P,w,null,H,q,di(P,W),B,!1),N>0){if(N&16)he(w,X,Q,H,W);else if(N&2&&X.class!==Q.class&&i(w,"class",null,Q.class,W),N&4&&i(w,"style",X.style,Q.style,W),N&8){const V=P.dynamicProps;for(let re=0;re<V.length;re++){const ue=V[re],Oe=X[ue],je=Q[ue];(je!==Oe||ue==="value")&&i(w,ue,Oe,je,W,H)}}N&1&&E.children!==P.children&&p(w,P.children)}else!y&&R==null&&he(w,X,Q,H,W);((D=Q.onVnodeUpdated)||Z)&&pt(()=>{D&&jt(D,H,P,E),Z&&Un(P,E,H,"updated")},q)},M=(E,P,H,q,W,B,y)=>{for(let w=0;w<P.length;w++){const N=E[w],R=P[w],Z=N.el&&(N.type===J||!_s(N,R)||N.shapeFlag&198)?g(N.el):H;A(N,R,Z,null,q,W,B,y,!0)}},he=(E,P,H,q,W)=>{if(P!==H){if(P!==De)for(const B in P)!Cs(B)&&!(B in H)&&i(E,B,P[B],null,W,q);for(const B in H){if(Cs(B))continue;const y=H[B],w=P[B];y!==w&&B!=="value"&&i(E,B,w,y,W,q)}"value"in H&&i(E,"value",P.value,H.value,W)}},z=(E,P,H,q,W,B,y,w,N)=>{const R=P.el=E?E.el:c(""),Z=P.anchor=E?E.anchor:c("");let{patchFlag:X,dynamicChildren:Q,slotScopeIds:D}=P;D&&(w=w?w.concat(D):D),E==null?(s(R,H,q),s(Z,H,q),I(P.children||[],H,Z,W,B,y,w,N)):X>0&&X&64&&Q&&E.dynamicChildren&&E.dynamicChildren.length===Q.length?(M(E.dynamicChildren,Q,H,W,B,y,w),(P.key!=null||W&&P===W.subTree)&&xc(E,P,!0)):$e(E,P,H,Z,W,B,y,w,N)},oe=(E,P,H,q,W,B,y,w,N)=>{P.slotScopeIds=w,E==null?P.shapeFlag&512?W.ctx.activate(P,H,q,y,N):pe(P,H,q,W,B,y,N):se(E,P,N)},pe=(E,P,H,q,W,B,y)=>{const w=E.component=Mf(E,q,W);if(bl(E)&&(w.ctx.renderer=Ft),Rf(w,!1,y),w.asyncDep){if(W&&W.registerDep(w,ce,y),!E.el){const N=w.subTree=ne(hn);k(null,N,P,H),E.placeholder=N.el}}else ce(w,E,P,H,W,B,y)},se=(E,P,H)=>{const q=P.component=E.component;if(vf(E,P,H))if(q.asyncDep&&!q.asyncResolved){P.el=E.el,ye(q,P,H);return}else q.next=P,q.update();else P.el=E.el,q.vnode=P},ce=(E,P,H,q,W,B,y)=>{const w=()=>{if(E.isMounted){let{next:X,bu:Q,u:D,parent:V,vnode:re}=E;{const kt=Cc(E);if(kt){X&&(X.el=re.el,ye(E,X,y)),kt.asyncDep.then(()=>{pt(()=>{E.isUnmounted||R()},W)});return}}let ue=X,Oe;jn(E,!1),X?(X.el=re.el,ye(E,X,y)):X=re,Q&&fo(Q),(Oe=X.props&&X.props.onVnodeBeforeUpdate)&&jt(Oe,V,X,re),jn(E,!0);const je=oa(E),Be=E.subTree;E.subTree=je,A(Be,je,g(Be.el),we(Be),E,W,B),X.el=je.el,ue===null&&_f(E,je.el),D&&pt(D,W),(Oe=X.props&&X.props.onVnodeUpdated)&&pt(()=>jt(Oe,V,X,re),W)}else{let X;const{el:Q,props:D}=P,{bm:V,m:re,parent:ue,root:Oe,type:je}=E,Be=Ls(P);jn(E,!1),V&&fo(V),!Be&&(X=D&&D.onVnodeBeforeMount)&&jt(X,ue,P),jn(E,!0);{Oe.ce&&Oe.ce._hasShadowRoot()&&Oe.ce._injectChildStyle(je,E.parent?E.parent.type:void 0);const kt=E.subTree=oa(E);A(null,kt,H,q,E,W,B),P.el=kt.el}if(re&&pt(re,W),!Be&&(X=D&&D.onVnodeMounted)){const kt=P;pt(()=>jt(X,ue,kt),W)}(P.shapeFlag&256||ue&&Ls(ue.vnode)&&ue.vnode.shapeFlag&256)&&E.a&&pt(E.a,W),E.isMounted=!0,P=H=q=null}};E.scope.on();const N=E.effect=new Dr(w);E.scope.off();const R=E.update=N.run.bind(N),Z=E.job=N.runIfDirty.bind(N);Z.i=E,Z.id=E.uid,N.scheduler=()=>_l(Z),jn(E,!0),R()},ye=(E,P,H)=>{P.component=E;const q=E.vnode.props;E.vnode=P,E.next=null,bf(E,P.props,q,H),Sf(E,P.children,H),fn(),Xl(E),pn()},$e=(E,P,H,q,W,B,y,w,N=!1)=>{const R=E&&E.children,Z=E?E.shapeFlag:0,X=P.children,{patchFlag:Q,shapeFlag:D}=P;if(Q>0){if(Q&128){ae(R,X,H,q,W,B,y,w,N);return}else if(Q&256){Ge(R,X,H,q,W,B,y,w,N);return}}D&8?(Z&16&&Ee(R,W,B),X!==R&&p(H,X)):Z&16?D&16?ae(R,X,H,q,W,B,y,w,N):Ee(R,W,B,!0):(Z&8&&p(H,""),D&16&&I(X,H,q,W,B,y,w,N))},Ge=(E,P,H,q,W,B,y,w,N)=>{E=E||Wn,P=P||Wn;const R=E.length,Z=P.length,X=Math.min(R,Z);let Q;for(Q=0;Q<X;Q++){const D=P[Q]=N?tn(P[Q]):Yt(P[Q]);A(E[Q],D,H,null,W,B,y,w,N)}R>Z?Ee(E,W,B,!0,!1,X):I(P,H,q,W,B,y,w,N,X)},ae=(E,P,H,q,W,B,y,w,N)=>{let R=0;const Z=P.length;let X=E.length-1,Q=Z-1;for(;R<=X&&R<=Q;){const D=E[R],V=P[R]=N?tn(P[R]):Yt(P[R]);if(_s(D,V))A(D,V,H,null,W,B,y,w,N);else break;R++}for(;R<=X&&R<=Q;){const D=E[X],V=P[Q]=N?tn(P[Q]):Yt(P[Q]);if(_s(D,V))A(D,V,H,null,W,B,y,w,N);else break;X--,Q--}if(R>X){if(R<=Q){const D=Q+1,V=D<Z?P[D].el:q;for(;R<=Q;)A(null,P[R]=N?tn(P[R]):Yt(P[R]),H,V,W,B,y,w,N),R++}}else if(R>Q)for(;R<=X;)Y(E[R],W,B,!0),R++;else{const D=R,V=R,re=new Map;for(R=V;R<=Q;R++){const gt=P[R]=N?tn(P[R]):Yt(P[R]);gt.key!=null&&re.set(gt.key,R)}let ue,Oe=0;const je=Q-V+1;let Be=!1,kt=0;const Qn=new Array(je);for(R=0;R<je;R++)Qn[R]=0;for(R=D;R<=X;R++){const gt=E[R];if(Oe>=je){Y(gt,W,B,!0);continue}let Ut;if(gt.key!=null)Ut=re.get(gt.key);else for(ue=V;ue<=Q;ue++)if(Qn[ue-V]===0&&_s(gt,P[ue])){Ut=ue;break}Ut===void 0?Y(gt,W,B,!0):(Qn[Ut-V]=R+1,Ut>=kt?kt=Ut:Be=!0,A(gt,P[Ut],H,null,W,B,y,w,N),Oe++)}const Hl=Be?Tf(Qn):Wn;for(ue=Hl.length-1,R=je-1;R>=0;R--){const gt=V+R,Ut=P[gt],Vl=P[gt+1],Wl=gt+1<Z?Vl.el||Ec(Vl):q;Qn[R]===0?A(null,Ut,H,Wl,W,B,y,w,N):Be&&(ue<0||R!==Hl[ue]?ee(Ut,H,Wl,2):ue--)}}},ee=(E,P,H,q,W=null)=>{const{el:B,type:y,transition:w,children:N,shapeFlag:R}=E;if(R&6){ee(E.component.subTree,P,H,q);return}if(R&128){E.suspense.move(P,H,q);return}if(R&64){y.move(E,P,H,Ft);return}if(y===J){s(B,P,H);for(let X=0;X<N.length;X++)ee(N[X],P,H,q);s(E.anchor,P,H);return}if(y===fi){F(E,P,H);return}if(q!==2&&R&1&&w)if(q===0)w.persisted&&!B[ci]?s(B,P,H):(w.beforeEnter(B),s(B,P,H),pt(()=>w.enter(B),W));else{const{leave:X,delayLeave:Q,afterLeave:D}=w,V=()=>{E.ctx.isUnmounted?o(B):s(B,P,H)},re=()=>{const ue=B._isLeaving||!!B[ci];B._isLeaving&&B[ci](!0),w.persisted&&!ue?V():X(B,()=>{V(),D&&D()})};Q?Q(B,V,re):re()}else s(B,P,H)},Y=(E,P,H,q=!1,W=!1)=>{const{type:B,props:y,ref:w,children:N,dynamicChildren:R,shapeFlag:Z,patchFlag:X,dirs:Q,cacheIndex:D,memo:V}=E;if((X===-2||R&&R.hasOnce)&&(W=!1),w!=null&&(fn(),Ps(w,null,H,E,!0),pn()),D!=null&&(!E.ctx||E.ctx===P)&&(P.renderCache[D]=void 0),Z&256){P.ctx.deactivate(E);return}const re=Z&1&&Q,ue=!Ls(E);let Oe;if(ue&&(Oe=y&&y.onVnodeBeforeUnmount)&&jt(Oe,P,E),Z&6)te(E.component,H,q);else{if(Z&128){E.suspense.unmount(H,q);return}re&&Un(E,null,P,"beforeUnmount"),Z&64?E.type.remove(E,P,H,Ft,q):R&&!R.hasOnce&&(B!==J||X>0&&X&64)?Ee(R,P,H,!1,!0):(B===J&&X&384||!W&&Z&16)&&Ee(N,P,H),q&&fe(E)}const je=V!=null&&D==null;(ue&&(Oe=y&&y.onVnodeUnmounted)||re||je)&&pt(()=>{Oe&&jt(Oe,P,E),re&&Un(E,null,P,"unmounted"),je&&(E.el=null)},H)},fe=E=>{const{type:P,el:H,anchor:q,transition:W}=E;if(P===J){me(H,q);return}if(P===fi){x(E),W&&!W.persisted&&W.afterLeave&&W.afterLeave();return}const B=()=>{o(H),W&&!W.persisted&&W.afterLeave&&W.afterLeave()};if(E.shapeFlag&1&&W&&!W.persisted){const{leave:y,delayLeave:w}=W,N=()=>y(H,B);w?w(E.el,B,N):N()}else B()},me=(E,P)=>{let H;for(;E!==P;)H=v(E),o(E),E=H;o(P)},te=(E,P,H)=>{const{bum:q,scope:W,job:B,subTree:y,um:w,m:N,a:R}=E;aa(N),aa(R),q&&fo(q),W.stop(),B?(B.flags|=8,Y(y,E,P,H)):E.vnode.el&&y&&(y.transition=E.vnode.transition,Y(y,E,P,H)),w&&pt(w,P),pt(()=>{E.isUnmounted=!0},P)},Ee=(E,P,H,q=!1,W=!1,B=0)=>{for(let y=B;y<E.length;y++)Y(E[y],P,H,q,W)},we=E=>{if(E.shapeFlag&6)return we(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const P=v(E.anchor||E.el),H=P&&P[Bd];return H?v(H):P};let yn=!1;const zn=(E,P,H)=>{let q;E==null?P._vnode&&(Y(P._vnode,null,null,!0),q=P._vnode.component):A(P._vnode||null,E,P,null,null,null,H),P._vnode=E,yn||(yn=!0,Xl(q),tc(),yn=!1)},Ft={p:A,um:Y,m:ee,r:fe,mt:pe,mc:I,pc:$e,pbc:M,n:we,o:e};return{render:zn,hydrate:void 0,createApp:df(zn)}}function di({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function jn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ef(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function xc(e,t,n=!1){const s=e.children,o=t.children;if(de(s)&&de(o))for(let i=0;i<s.length;i++){const r=s[i];let c=o[i];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=o[i]=tn(o[i]),c.el=r.el),!n&&c.patchFlag!==-2&&xc(r,c)),c.type===Js&&(c.patchFlag===-1&&(c=o[i]=tn(c)),c.el=r.el),c.type===hn&&!c.el&&(c.el=r.el)}}function Tf(e){const t=e.slice(),n=[0];let s,o,i,r,c;const d=e.length;for(s=0;s<d;s++){const h=e[s];if(h!==0){if(o=n[n.length-1],e[o]<h){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)c=i+r>>1,e[n[c]]<h?i=c+1:r=c;h<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function Cc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Cc(t)}function aa(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ec(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ec(t.subTree):null}const Tc=e=>e.__isSuspense;function Af(e,t){t&&t.pendingBranch?de(e)?t.effects.push(...e):t.effects.push(e):Ud(e)}const J=Symbol.for("v-fgt"),Js=Symbol.for("v-txt"),hn=Symbol.for("v-cmt"),fi=Symbol.for("v-stc"),Kn=[];let _t=null;function _(e=!1){Kn.push(_t=e?null:[])}function Ac(){Kn.pop(),_t=Kn[Kn.length-1]||null}let Rs=1;function wo(e,t=!1){Rs+=e,e<0&&_t&&t&&(_t.hasOnce=!0)}function Pc(e){return e.dynamicChildren=Rs>0?_t||Wn:null,Ac(),Rs>0&&_t&&_t.push(e),e}function b(e,t,n,s,o,i){return Pc(l(e,t,n,s,o,i,!0))}function at(e,t,n,s,o){return Pc(ne(e,t,n,s,o,!0))}function ko(e){return e?e.__v_isVNode===!0:!1}function _s(e,t){return e.type===t.type&&e.key===t.key}const Lc=({key:e})=>e??null,po=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ye(e)||nt(e)||be(e)?{i:vt,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,s=0,o=null,i=e===J?0:1,r=!1,c=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Lc(t),ref:t&&po(t),scopeId:sc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:vt};return c?($o(d,n),i&128&&e.normalize(d)):n&&(d.shapeFlag|=Ye(n)?8:16),Rs>0&&!r&&_t&&(d.patchFlag>0||i&6)&&d.patchFlag!==32&&_t.push(d),d}const ne=Pf;function Pf(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===uc)&&(e=hn),ko(e)){const c=rs(e,t,!0);return n&&$o(c,n),Rs>0&&!i&&_t&&(c.shapeFlag&6?_t[_t.indexOf(e)]=c:_t.push(c)),c.patchFlag=-2,c}if(Hf(e)&&(e=e.__vccOpts),t){t=Lf(t);let{class:c,style:d}=t;c&&!Ye(c)&&(t.class=ve(c)),Ie(d)&&(vl(d)&&!de(d)&&(d=st({},d)),t.style=He(d))}const r=Ye(e)?1:Tc(e)?128:Yo(e)?64:Ie(e)?4:be(e)?2:0;return l(e,t,n,s,o,r,i,!0)}function Lf(e){return e?vl(e)||yc(e)?st({},e):e:null}function rs(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:c,transition:d}=e,h=t?If(o||{},t):o,p={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&Lc(h),ref:t&&t.ref?n&&i?de(i)?i.concat(po(t)):[i,po(t)]:po(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==J?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rs(e.ssContent),ssFallback:e.ssFallback&&rs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return d&&s&&yl(p,d.clone(p)),p}function Re(e=" ",t=0){return ne(Js,null,e,t)}function G(e="",t=!1){return t?(_(),at(hn,null,e)):ne(hn,null,e)}function Yt(e){return e==null||typeof e=="boolean"?ne(hn):de(e)?ne(J,null,e.slice()):ko(e)?tn(e):ne(Js,null,String(e))}function tn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:rs(e)}function $o(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(de(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),$o(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!yc(t)?t._ctx=vt:o===3&&vt&&(vt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(be(t)){if(s&65){$o(e,{default:t});return}t={default:t,_ctx:vt},n=32}else t=String(t),s&64?(n=16,t=[Re(t)]):n=8;e.children=t,e.shapeFlag|=n}function If(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=ve([t.class,s.class]));else if(o==="style")t.style=He([t.style,s.style]);else if(Do(o)){const i=t[o],r=s[o];r&&i!==r&&!(de(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Fo(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function jt(e,t,n,s=null){Rt(e,t,7,[n,s])}const Of=hc();let Nf=0;function Mf(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Of,i={uid:Nf++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Mr(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:wc(s,o),emitsOptions:mc(s,o),emit:null,emitted:null,propsDefaults:De,inheritAttrs:s.inheritAttrs,ctx:De,data:De,props:De,attrs:De,slots:De,refs:De,setupState:De,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=pf.bind(null,i),e.ce&&e.ce(i),i}let lt=null;const Ic=()=>lt||vt;let So,Ds;{const e=Vo(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};So=t("__VUE_INSTANCE_SETTERS__",n=>lt=n),Ds=t("__VUE_SSR_SETTERS__",n=>Fs=n)}const Xs=e=>{const t=lt;return So(e),e.scope.on(),()=>{e.scope.off(),So(t)}},ra=()=>{lt&&lt.scope.off(),So(null)};function Oc(e){return e.vnode.shapeFlag&4}let Fs=!1;function Rf(e,t=!1,n=!1){t&&Ds(t);const{props:s,children:o}=e.vnode,i=Oc(e);yf(e,s,i,t),$f(e,o,n||t);const r=i?Df(e,t):void 0;return t&&Ds(!1),r}function Df(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,sf);const{setup:s}=n;if(s){fn();const o=e.setupContext=s.length>1?Uf(e):null,i=Xs(e),r=qs(s,e,0,[e.props,o]),c=Tr(r);if(pn(),i(),(c||e.sp)&&!Ls(e)&&ac(e),c){if(r.then(ra,ra),t)return r.then(d=>{Ds(!0);try{ca(e,d,t)}finally{Ds(!1)}}).catch(d=>{Bo(d,e,0)});e.asyncDep=r}else ca(e,r)}else Nc(e)}function ca(e,t,n){be(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ie(t)&&(e.setupState=Qr(t)),Nc(e)}function Nc(e,t,n){const s=e.type;e.render||(e.render=s.render||Gt);{const o=Xs(e);fn();try{of(e)}finally{pn(),o()}}}const Ff={get(e,t){return it(e,"get",""),e[t]}};function Uf(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Ff),slots:e.slots,emit:e.emit,expose:t}}function Jo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Qr(Ad(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Is)return Is[n](e)},has(t,n){return n in t||n in Is}})):e.proxy}function jf(e,t=!0){return be(e)?e.displayName||e.name:e.name||t&&e.__name}function Hf(e){return be(e)&&"__vccOpts"in e}const L=(e,t)=>Nd(e,t,Fs);function xo(e,t,n){try{wo(-1);const s=arguments.length;return s===2?Ie(t)&&!de(t)?ko(t)?ne(e,null,[t]):ne(e,t):ne(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&ko(n)&&(n=[n]),ne(e,t,n))}finally{wo(1)}}const Vf="3.5.43";let Fi;const ua=typeof window<"u"&&window.trustedTypes;if(ua)try{Fi=ua.createPolicy("vue",{createHTML:e=>e})}catch{}const Mc=Fi?e=>Fi.createHTML(e):e=>e,Wf="http://www.w3.org/2000/svg",Bf="http://www.w3.org/1998/Math/MathML",en=typeof document<"u"?document:null,da=en&&en.createElement("template"),Kf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?en.createElementNS(Wf,e):t==="mathml"?en.createElementNS(Bf,e):n?en.createElement(e,{is:n}):en.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>en.createTextNode(e),createComment:e=>en.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>en.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{da.innerHTML=Mc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const c=da.content;if(s==="svg"||s==="mathml"){const d=c.firstChild;for(;d.firstChild;)c.appendChild(d.firstChild);c.removeChild(d)}t.insertBefore(c,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Yf=Symbol("_vtc");function qf(e,t,n){const s=e[Yf];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const fa=Symbol("_vod"),Gf=Symbol("_vsh"),Jf=Symbol(""),Xf=/(?:^|;)\s*display\s*:/;function zf(e,t,n){const s=e.style,o=Ye(n);let i=!1;if(n&&!o){if(t)if(Ye(t))for(const r of t.split(";")){const c=r.slice(0,r.indexOf(":")).trim();n[c]==null&&ks(s,c,"")}else for(const r in t)n[r]==null&&ks(s,r,"");for(const r in n){r==="display"&&(i=!0);const c=n[r];c!=null?Zf(e,r,!Ye(t)&&t?t[r]:void 0,c)||ks(s,r,c):ks(s,r,"")}}else if(o){if(t!==n){const r=s[Jf];r&&(n+=";"+r),s.cssText=n,i=Xf.test(n)}}else t&&e.removeAttribute("style");fa in e&&(e[fa]=i?s.display:"",e[Gf]&&(s.display="none"))}const io=/\s*!important$/;function ks(e,t,n){if(de(n))n.forEach(s=>ks(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))io.test(n)?e.setProperty(t,n.replace(io,""),"important"):e.setProperty(t,n);else{const s=Qf(e,t);io.test(n)?e.setProperty(Nn(s),n.replace(io,""),"important"):e[s]=n}}const pa=["Webkit","Moz","ms"],pi={};function Qf(e,t){const n=pi[t];if(n)return n;let s=dt(t);if(s!=="filter"&&s in e)return pi[t]=s;s=jo(s);for(let o=0;o<pa.length;o++){const i=pa[o]+s;if(i in e)return pi[t]=i}return t}function Zf(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Ye(s)&&n===s}const ha="http://www.w3.org/1999/xlink";function ma(e,t,n,s,o,i=ld(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ha,t.slice(6,t.length)):e.setAttributeNS(ha,t,n):n==null||i&&!Ir(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Xt(n)?String(n):n)}function ga(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Mc(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const c=i==="OPTION"?e.getAttribute("value")||"":e.value,d=n==null?e.type==="checkbox"?"on":"":String(n);(c!==d||!("_value"in e))&&(e.value=d),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const c=typeof e[t];c==="boolean"?n=Ir(n):n==null&&c==="string"?(n="",r=!0):c==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function an(e,t,n,s){e.addEventListener(t,n,s)}function ep(e,t,n,s){e.removeEventListener(t,n,s)}const va=Symbol("_vei");function tp(e,t,n,s,o=null){const i=e[va]||(e[va]={}),r=i[t];if(s&&r)r.value=s;else{const[c,d]=op(t);if(s){const h=i[t]=ap(s,o);an(e,c,h,d)}else r&&(ep(e,c,r,d),i[t]=void 0)}}const np=/(Once|Passive|Capture)$/,sp=/^on:?(?:Once|Passive|Capture)$/;function op(e){let t,n;for(;(n=e.match(np))&&!sp.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Nn(e.slice(2)),t]}let hi=0;const ip=Promise.resolve(),lp=()=>hi||(ip.then(()=>hi=0),hi=Date.now());function ap(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(de(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),c=[s];for(let d=0;d<r.length&&!s._stopped;d++){const h=r[d];h&&Rt(h,t,5,c)}}else Rt(o,t,5,[s])};return n.value=e,n.attached=lp(),n}const _a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,rp=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?qf(e,s,r):t==="style"?zf(e,n,s):Do(t)?Fo(t)||tp(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):cp(e,t,s,r))?(ga(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ma(e,t,s,r,i,t!=="value")):e._isVueCE&&(up(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ye(s)))?ga(e,dt(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),ma(e,t,s,r))};function cp(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&_a(t)&&be(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return _a(t)&&Ye(n)?!1:t in e}function up(e,t){const n=e._def.props;if(!n)return!1;const s=dt(t);return Array.isArray(n)?n.some(o=>dt(o)===s):Object.keys(n).some(o=>dt(o)===s)}const Pn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return de(t)?n=>fo(t,n):t};function dp(e){e.target.composing=!0}function ya(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const yt=Symbol("_assign"),lo=Symbol("_initialValue");function mi(e,t,n){return t&&(e=e.trim()),n&&(e=Ho(e)),e}const Qe={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[lo]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[lo]=e.defaultValue.replace(/\r\n?/g,`
`))),e[yt]=Pn(o);const i=s||o.props&&o.props.type==="number";an(e,t?"change":"input",r=>{r.target.composing||e[yt](mi(e.value,n,i))}),(n||i)&&an(e,"change",()=>{e.value=mi(e.value,n,i)}),t||(an(e,"compositionstart",dp),an(e,"compositionend",ya),an(e,"change",ya))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",i=e[lo];delete e[lo],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[yt](mi(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[yt]=Pn(r),e.composing)return;const c=(i||e.type==="number")&&!/^0\d/.test(e.value)?Ho(e.value):e.value,d=t??"";if(c===d)return;const h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===d)||(e.value=d)}},fp={deep:!0,created(e,t,n){e[yt]=Pn(n),an(e,"change",()=>{const s=e._modelValue,o=cs(e),i=e.checked,r=e[yt];if(de(s)){const c=ul(s,o),d=c!==-1;if(i&&!d)r(s.concat(o));else if(!i&&d){const h=[...s];h.splice(c,1),r(h)}}else if(dn(s)){const c=new Set(s);i?c.add(o):c.delete(o),r(c)}else r(Rc(e,i))})},mounted:ba,beforeUpdate(e,t,n){e[yt]=Pn(n),ba(e,t,n)}};function ba(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(de(t))o=ul(t,s.props.value)>-1;else if(dn(t))o=t.has(s.props.value);else{if(t===n)return;o=Mt(t,Rc(e,!0))}e.checked!==o&&(e.checked=o)}const wa={created(e,{value:t},n){e.checked=Mt(t,n.props.value),e[yt]=Pn(n),an(e,"change",()=>{e[yt](cs(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[yt]=Pn(s),t!==n&&(e.checked=Mt(t,s.props.value))}},Yn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,an(e,"change",()=>{const o=Array.prototype.filter.call(e.options,d=>d.selected).map(d=>n?Ho(cs(d)):cs(d)),i=e.multiple,r=i?dn(e._modelValue)?new Set(o):o:o[0],c=e._pendingValue=[i,i?de(r)?o.slice():o:r];try{e[yt](r)}finally{Ko(()=>{e._pendingValue===c&&(e._pendingValue=void 0)})}}),e[yt]=Pn(s)},mounted(e,{value:t}){ka(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[yt]=Pn(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!pp(t,n[1],n[0]))&&ka(e,t)}};function pp(e,t,n){if(!n||de(e))return Mt(e,t);if(dn(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function ka(e,t){const n=e.multiple,s=de(t);if(!(n&&!s&&!dn(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],c=cs(r);if(n)if(s){const d=typeof c;d==="string"||d==="number"?r.selected=t.some(h=>String(h)===String(c)):r.selected=ul(t,c)>-1}else r.selected=t.has(c);else if(Mt(cs(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function Rc(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const hp=["ctrl","shift","alt","meta"],mp={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>hp.some(n=>e[`${n}Key`]&&!t.includes(n))},Lt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const c=mp[t[r]];if(c&&c(o,t))return}return e(o,...i)}))},gp={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Dc=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Nn(o.key);if(t.some(r=>r===i||gp[r]===i))return e(o)}))},vp=st({patchProp:rp},Kf);let $a;function _p(){return $a||($a=xf(vp))}const yp=((...e)=>{const t=_p().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=wp(s);if(!o)return;const i=t._component;!be(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,bp(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t});function bp(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function wp(e){return Ye(e)?document.querySelector(e):e}const kp="modulepreload",$p=function(e,t){return new URL(e,t).href},Sa={},bn=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let h=function(p){return Promise.all(p.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const r=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");o=h(n.map(p=>{if(p=$p(p,s),p in Sa)return;Sa[p]=!0;const g=p.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(s)for(let U=r.length-1;U>=0;U--){const A=r[U];if(A.href===p&&(!g||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${v}`))return;const $=document.createElement("link");if($.rel=g?"stylesheet":kp,g||($.as="script"),$.crossOrigin="",$.href=p,d&&$.setAttribute("nonce",d),document.head.appendChild($),g)return new Promise((U,A)=>{$.addEventListener("load",U),$.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(r){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=r,window.dispatchEvent(c),!c.defaultPrevented)throw r}return o.then(r=>{for(const c of r||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};const Co=typeof window<"u",Rn=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Sp=(e,t,n)=>xp({l:e,k:t,s:n}),xp=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Xe=e=>typeof e=="number"&&isFinite(e),Fc=e=>xl(e)==="[object Date]",Eo=e=>xl(e)==="[object RegExp]",Sl=e=>Ue(e)&&Object.keys(e).length===0,Ze=Object.assign,Cp=Object.create,Ne=(e=null)=>Cp(e);let xa;const Ep=()=>xa||(xa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Ne()),Tp=Object.prototype.hasOwnProperty;function xt(e,t){return Tp.call(e,t)}const Ve=Array.isArray,qe=e=>typeof e=="function",le=e=>typeof e=="string",Ke=e=>typeof e=="boolean",xe=e=>e!==null&&typeof e=="object",Ap=e=>xe(e)&&qe(e.then)&&qe(e.catch),Uc=Object.prototype.toString,xl=e=>Uc.call(e),Ue=e=>xl(e)==="[object Object]",Pp=e=>e==null?"":Ve(e)||Ue(e)&&e.toString===Uc?JSON.stringify(e,null,2):String(e);function Cl(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}function Lp(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function Ca(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function Ip(e){return e.replace(/&(?![a-z0-9#]{2,6};)/gi,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const Op=/^javascript:/i,Np=/^(?:href|src|action|formaction)$/i,Mp=/&#(?:x([0-9a-f]+)|(\d+));?/gi,Rp=/&(?:Tab|NewLine);/g,Dp=/&colon;?/gi,Fp=/[\u0000-\u0020\u007f-\u009f]/g,Up=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,jp=/(^|[\s"'<>/])on(\w+\s*=)/gi,Hp=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function Vp(e,t,n){const s=t||n;if(!s)return e;const o=Number.parseInt(s,t?16:10);return o<=127?String.fromCharCode(o):e}function El(e){const t=e.replace(Mp,Vp).replace(Rp,"").replace(Dp,":").replace(Fp,"");return Op.test(t)}function Wp(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let c=r+1,d=1,h=null;for(;c<e.length;c++){const v=e[c];if(h){v===h&&(h=null);continue}if(v==='"'||v==="'")h=v;else if(v==="(")d++;else if(v===")"&&(d--,d===0))break}if(d!==0)break;const p=e.slice(r+1,c).trim(),g=p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'")?p.slice(1,-1).trim():p;n+=e.slice(s,i),n+=El(g)?"url(about:blank)":e.slice(i,c+1),s=c+1}return n+e.slice(s)}function Ea(e,t){if(Np.test(e)&&El(t))return"about:blank";const n=e.toLowerCase()==="style"?Wp(t):t;return Ip(n)}function Bp(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(t,n,s)=>`${n}="${Ea(n,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(t,n,s)=>`${n}='${Ea(n,s)}'`),Up.test(e)&&(e=e.replace(jp,"$1&#111;n$2")),e=e.replace(Hp,(t,n,s,o)=>El(o)?`${n}${s}about:blank`:t),e}const Ta=e=>!xe(e)||Ve(e);function ho(e,t){if(Ta(e)||Ta(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{if(i==="__proto__")return;const r=s[i];if(Ve(r)){const c=[];c.length=r.length,o[i]=c,n.push({src:r,des:c})}else xe(r)?((!xe(o[i])||Ve(o[i]))&&(o[i]=Ne()),n.push({src:r,des:o[i]})):o[i]=r})}}function Kp(e,t,n){return{line:e,column:t,offset:n}}function Ui(e,t,n){return{start:e,end:t}}const Te={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},Yp=17;function Xo(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,c=new SyntaxError(String(r));return c.code=e,t&&(c.location=t),c.domain=s,c}function qp(e){throw e}const Ht=" ",Gp="\r",ot=`
`,Jp="\u2028",Xp="\u2029";function zp(e){const t=e;let n=0,s=1,o=1,i=0;const r=C=>t[C]===Gp&&t[C+1]===ot,c=C=>t[C]===ot,d=C=>t[C]===Xp,h=C=>t[C]===Jp,p=C=>r(C)||c(C)||d(C)||h(C),g=()=>n,v=()=>s,$=()=>o,U=()=>i,A=C=>r(C)||d(C)||h(C)?ot:t[C],T=()=>A(n),k=()=>A(n+i);function S(){return i=0,p(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function F(){return r(n+i)&&i++,i++,t[n+i]}function x(){n=0,s=1,o=1,i=0}function j(C=0){i=C}function O(){const C=n+i;for(;C!==n;)S();i=0}return{index:g,line:v,column:$,peekOffset:U,charAt:A,currentChar:T,currentPeek:k,next:S,peek:F,reset:x,resetPeek:j,skipToPeek:O}}const Zt=void 0,Qp=".",Aa="'",Zp="tokenizer";function eh(e,t={}){const n=t.location!==!1,s=zp(e),o=()=>s.index(),i=()=>Kp(s.line(),s.column(),s.index()),r=i(),c=o(),d={currentType:13,offset:c,startLoc:r,endLoc:r,lastType:13,lastOffset:c,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},h=()=>d,{onError:p}=t;function g(y,w,N,...R){const Z=h();if(w.column+=N,w.offset+=N,p){const X=n?Ui(Z.startLoc,w):null,Q=Xo(y,X,{domain:Zp,args:R});p(Q)}}function v(y,w,N){y.endLoc=i(),y.currentType=w;const R={type:w};return n&&(R.loc=Ui(y.startLoc,y.endLoc)),N!=null&&(R.value=N),R}const $=y=>v(y,13);function U(y,w){return y.currentChar()===w?(y.next(),w):(g(Te.EXPECTED_TOKEN,i(),0,w),"")}function A(y){let w="";for(;y.currentPeek()===Ht||y.currentPeek()===ot;)w+=y.currentPeek(),y.peek();return w}function T(y){const w=A(y);return y.skipToPeek(),w}function k(y){if(y===Zt)return!1;const w=y.charCodeAt(0);return w>=97&&w<=122||w>=65&&w<=90||w===95}function S(y){if(y===Zt)return!1;const w=y.charCodeAt(0);return w>=48&&w<=57}function F(y,w){const{currentType:N}=w;if(N!==2)return!1;A(y);const R=k(y.currentPeek());return y.resetPeek(),R}function x(y,w){const{currentType:N}=w;if(N!==2)return!1;A(y);const R=y.currentPeek()==="-"?y.peek():y.currentPeek(),Z=S(R);return y.resetPeek(),Z}function j(y,w){const{currentType:N}=w;if(N!==2)return!1;A(y);const R=y.currentPeek()===Aa;return y.resetPeek(),R}function O(y,w){const{currentType:N}=w;if(N!==7)return!1;A(y);const R=y.currentPeek()===".";return y.resetPeek(),R}function C(y,w){const{currentType:N}=w;if(N!==8)return!1;A(y);const R=k(y.currentPeek());return y.resetPeek(),R}function I(y,w){const{currentType:N}=w;if(!(N===7||N===11))return!1;A(y);const R=y.currentPeek()===":";return y.resetPeek(),R}function K(y,w){const{currentType:N}=w;if(N!==9)return!1;const R=()=>{const X=y.currentPeek();return X==="{"?k(y.peek()):X==="@"||X==="|"||X===":"||X==="."||X===Ht||!X?!1:X===ot?(y.peek(),R()):he(y,!1)},Z=R();return y.resetPeek(),Z}function M(y){A(y);const w=y.currentPeek()==="|";return y.resetPeek(),w}function he(y,w=!0){const N=(Z=!1,X="")=>{const Q=y.currentPeek();return Q==="{"||Q==="@"||!Q?Z:Q==="|"?!(X===Ht||X===ot):Q===Ht?(y.peek(),N(!0,Ht)):Q===ot?(y.peek(),N(!0,ot)):!0},R=N();return w&&y.resetPeek(),R}function z(y,w){const N=y.currentChar();return N===Zt?Zt:w(N)?(y.next(),N):null}function oe(y){const w=y.charCodeAt(0);return w>=97&&w<=122||w>=65&&w<=90||w>=48&&w<=57||w===95||w===36}function pe(y){return z(y,oe)}function se(y){const w=y.charCodeAt(0);return w>=97&&w<=122||w>=65&&w<=90||w>=48&&w<=57||w===95||w===36||w===45}function ce(y){return z(y,se)}function ye(y){const w=y.charCodeAt(0);return w>=48&&w<=57}function $e(y){return z(y,ye)}function Ge(y){const w=y.charCodeAt(0);return w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102}function ae(y){return z(y,Ge)}function ee(y){let w="",N="";for(;w=$e(y);)N+=w;return N}function Y(y){let w="";for(;;){const N=y.currentChar();if(N==="\\"){const R=y.peek();R==="{"||R==="}"||R==="@"||R==="|"||R==="\\"?(w+=N+R,y.next(),y.next()):(y.resetPeek(),w+=N,y.next())}else{if(N==="{"||N==="}"||N==="@"||N==="|"||!N)break;if(N===Ht||N===ot)if(he(y))w+=N,y.next();else{if(M(y))break;w+=N,y.next()}else w+=N,y.next()}}return w}function fe(y){T(y);let w="",N="";for(;w=ce(y);)N+=w;const R=y.currentChar();if(R&&R!=="}"&&R!==Zt&&R!==Ht&&R!==ot&&R!==" "){const Z=Ft(y);return g(Te.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,N+Z),N+Z}return y.currentChar()===Zt&&g(Te.UNTERMINATED_CLOSING_BRACE,i(),0),N}function me(y){T(y);let w="";return y.currentChar()==="-"?(y.next(),w+=`-${ee(y)}`):w+=ee(y),y.currentChar()===Zt&&g(Te.UNTERMINATED_CLOSING_BRACE,i(),0),w}function te(y){return y!==Aa&&y!==ot}function Ee(y){T(y),U(y,"'");let w="",N="";for(;w=z(y,te);)w==="\\"?N+=we(y):N+=w;const R=y.currentChar();return R===ot||R===Zt?(g(Te.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),R===ot&&(y.next(),U(y,"'")),N):(U(y,"'"),N)}function we(y){const w=y.currentChar();switch(w){case"\\":case"'":return y.next(),`\\${w}`;case"u":return yn(y,w,4);case"U":return yn(y,w,6);default:return g(Te.UNKNOWN_ESCAPE_SEQUENCE,i(),0,w),""}}function yn(y,w,N){U(y,w);let R="";for(let Z=0;Z<N;Z++){const X=ae(y);if(!X){g(Te.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${w}${R}${y.currentChar()}`);break}R+=X}return`\\${w}${R}`}function zn(y){return y!=="{"&&y!=="}"&&y!==Ht&&y!==ot}function Ft(y){T(y);let w="",N="";for(;w=z(y,zn);)N+=w;return N}function to(y){let w="",N="";for(;w=pe(y);)N+=w;return N}function E(y){const w=N=>{const R=y.currentChar();return R==="{"||R==="@"||R==="|"||R==="("||R===")"||!R||R===Ht?N:(N+=R,y.next(),w(N))};return w("")}function P(y){T(y);const w=U(y,"|");return T(y),w}function H(y,w){let N=null;switch(y.currentChar()){case"{":return w.braceNest>=1&&g(Te.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),y.next(),N=v(w,2,"{"),T(y),w.braceNest++,N;case"}":return w.braceNest>0&&w.currentType===2&&g(Te.EMPTY_PLACEHOLDER,i(),0),y.next(),N=v(w,3,"}"),w.braceNest--,w.braceNest>0&&T(y),w.inLinked&&w.braceNest===0&&(w.inLinked=!1),N;case"@":return w.braceNest>0&&g(Te.UNTERMINATED_CLOSING_BRACE,i(),0),N=q(y,w)||$(w),w.braceNest=0,N;default:{let Z=!0,X=!0,Q=!0;if(M(y))return w.braceNest>0&&g(Te.UNTERMINATED_CLOSING_BRACE,i(),0),N=v(w,1,P(y)),w.braceNest=0,w.inLinked=!1,N;if(w.braceNest>0&&(w.currentType===4||w.currentType===5||w.currentType===6))return g(Te.UNTERMINATED_CLOSING_BRACE,i(),0),w.braceNest=0,W(y,w);if(Z=F(y,w))return N=v(w,4,fe(y)),T(y),N;if(X=x(y,w))return N=v(w,5,me(y)),T(y),N;if(Q=j(y,w))return N=v(w,6,Ee(y)),T(y),N;if(!Z&&!X&&!Q)return N=v(w,12,Ft(y)),g(Te.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,N.value),T(y),N;break}}return N}function q(y,w){const{currentType:N}=w;let R=null;const Z=y.currentChar();switch((N===7||N===8||N===11||N===9)&&(Z===ot||Z===Ht)&&g(Te.INVALID_LINKED_FORMAT,i(),0),Z){case"@":return y.next(),R=v(w,7,"@"),w.inLinked=!0,R;case".":return T(y),y.next(),v(w,8,".");case":":return T(y),y.next(),v(w,9,":");default:return M(y)?(R=v(w,1,P(y)),w.braceNest=0,w.inLinked=!1,R):O(y,w)||I(y,w)?(T(y),q(y,w)):C(y,w)?(T(y),v(w,11,to(y))):K(y,w)?(T(y),Z==="{"?H(y,w)||R:v(w,10,E(y))):(N===7&&g(Te.INVALID_LINKED_FORMAT,i(),0),w.braceNest=0,w.inLinked=!1,W(y,w))}}function W(y,w){let N={type:13};if(w.braceNest>0)return H(y,w)||$(w);if(w.inLinked)return q(y,w)||$(w);switch(y.currentChar()){case"{":return H(y,w)||$(w);case"}":return g(Te.UNBALANCED_CLOSING_BRACE,i(),0),y.next(),v(w,3,"}");case"@":return q(y,w)||$(w);default:{if(M(y))return N=v(w,1,P(y)),w.braceNest=0,w.inLinked=!1,N;if(he(y))return v(w,0,Y(y));break}}return N}function B(){const{currentType:y,offset:w,startLoc:N,endLoc:R}=d;return d.lastType=y,d.lastOffset=w,d.lastStartLoc=N,d.lastEndLoc=R,d.offset=o(),d.startLoc=i(),s.currentChar()===Zt?v(d,13):W(s,d)}return{nextToken:B,currentOffset:o,currentPosition:i,context:h}}const th="parser",nh=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,sh=/\\([\\@{}|])/g;function oh(e,t){return t}function ih(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function lh(e={}){const t=e.location!==!1,{onError:n}=e;function s(k,S,F,x,...j){const O=k.currentPosition();if(O.offset+=x,O.column+=x,n){const C=t?Ui(F,O):null,I=Xo(S,C,{domain:th,args:j});n(I)}}function o(k,S,F){const x={type:k};return t&&(x.start=S,x.end=S,x.loc={start:F,end:F}),x}function i(k,S,F,x){t&&(k.end=S,k.loc&&(k.loc.end=F))}function r(k,S){const F=k.context(),x=o(3,F.offset,F.startLoc);return x.value=S.replace(sh,oh),i(x,k.currentOffset(),k.currentPosition()),x}function c(k,S){const F=k.context(),{lastOffset:x,lastStartLoc:j}=F,O=o(5,x,j);return O.index=parseInt(S,10),k.nextToken(),i(O,k.currentOffset(),k.currentPosition()),O}function d(k,S){const F=k.context(),{lastOffset:x,lastStartLoc:j}=F,O=o(4,x,j);return O.key=S,k.nextToken(),i(O,k.currentOffset(),k.currentPosition()),O}function h(k,S){const F=k.context(),{lastOffset:x,lastStartLoc:j}=F,O=o(9,x,j);return O.value=S.replace(nh,ih),k.nextToken(),i(O,k.currentOffset(),k.currentPosition()),O}function p(k){const S=k.nextToken(),F=k.context(),{lastOffset:x,lastStartLoc:j}=F,O=o(8,x,j);return S.type!==11?(s(k,Te.UNEXPECTED_EMPTY_LINKED_MODIFIER,F.lastStartLoc,0),O.value="",i(O,x,j),{nextConsumeToken:S,node:O}):(S.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,F.lastStartLoc,0,Vt(S)),O.value=S.value||"",i(O,k.currentOffset(),k.currentPosition()),{node:O})}function g(k,S){const F=k.context(),x=o(7,F.offset,F.startLoc);return x.value=S,i(x,k.currentOffset(),k.currentPosition()),x}function v(k){const S=k.context(),F=o(6,S.offset,S.startLoc);let x=k.nextToken();if(x.type===8){const j=p(k);F.modifier=j.node,x=j.nextConsumeToken||k.nextToken()}switch(x.type!==9&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(x)),x=k.nextToken(),x.type===2&&(x=k.nextToken()),x.type){case 10:x.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(x)),F.key=g(k,x.value||"");break;case 4:x.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(x)),F.key=d(k,x.value||"");break;case 5:x.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(x)),F.key=c(k,x.value||"");break;case 6:x.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(x)),F.key=h(k,x.value||"");break;default:{s(k,Te.UNEXPECTED_EMPTY_LINKED_KEY,S.lastStartLoc,0);const j=k.context(),O=o(7,j.offset,j.startLoc);return O.value="",i(O,j.offset,j.startLoc),F.key=O,i(F,j.offset,j.startLoc),{nextConsumeToken:x,node:F}}}return i(F,k.currentOffset(),k.currentPosition()),{node:F}}function $(k){const S=k.context(),F=S.currentType===1?k.currentOffset():S.offset,x=S.currentType===1?S.endLoc:S.startLoc,j=o(2,F,x);j.items=[];let O=null;do{const K=O||k.nextToken();switch(O=null,K.type){case 0:K.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(K)),j.items.push(r(k,K.value||""));break;case 5:K.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(K)),j.items.push(c(k,K.value||""));break;case 4:K.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(K)),j.items.push(d(k,K.value||""));break;case 6:K.value==null&&s(k,Te.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Vt(K)),j.items.push(h(k,K.value||""));break;case 7:{const M=v(k);j.items.push(M.node),O=M.nextConsumeToken||null;break}}}while(S.currentType!==13&&S.currentType!==1);const C=S.currentType===1?S.lastOffset:k.currentOffset(),I=S.currentType===1?S.lastEndLoc:k.currentPosition();return i(j,C,I),j}function U(k,S,F,x){const j=k.context();let O=x.items.length===0;const C=o(1,S,F);C.cases=[],C.cases.push(x);do{const I=$(k);O||(O=I.items.length===0),C.cases.push(I)}while(j.currentType!==13);return O&&s(k,Te.MUST_HAVE_MESSAGES_IN_PLURAL,F,0),i(C,k.currentOffset(),k.currentPosition()),C}function A(k){const S=k.context(),{offset:F,startLoc:x}=S,j=$(k);return S.currentType===13?j:U(k,F,x,j)}function T(k){const S=eh(k,Ze({},e)),F=S.context(),x=o(0,F.offset,F.startLoc);return t&&x.loc&&(x.loc.source=k),x.body=A(S),e.onCacheKey&&(x.cacheKey=e.onCacheKey(k)),F.currentType!==13&&s(S,Te.UNEXPECTED_LEXICAL_ANALYSIS,F.lastStartLoc,0,k[F.offset]||""),i(x,S.currentOffset(),S.currentPosition()),x}return{parse:T}}function Vt(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function ah(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Pa(e,t){for(let n=0;n<e.length;n++)Tl(e[n],t)}function Tl(e,t){switch(e.type){case 1:Pa(e.cases,t),t.helper("plural");break;case 2:Pa(e.items,t);break;case 6:{Tl(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function rh(e,t={}){const n=ah(e);n.helper("normalize"),e.body&&Tl(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function ch(e){const t=e.body;return t.type===2?La(t):t.cases.forEach(n=>La(n)),e}function La(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=Cl(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function ts(e){switch(e.t=e.type,e.type){case 0:{const t=e;ts(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)ts(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)ts(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;ts(t.key),t.k=t.key,delete t.key,t.modifier&&(ts(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function uh(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const c=()=>r;function d(A,T){r.code+=A}function h(A,T=!0){const k=T?s:"";d(o?k+" ".repeat(A):k)}function p(A=!0){const T=++r.indentLevel;A&&h(T)}function g(A=!0){const T=--r.indentLevel;A&&h(T)}function v(){h(r.indentLevel)}return{context:c,push:d,indent:p,deindent:g,newline:v,helper:A=>`_${A}`,needIndent:()=>r.needIndent}}function dh(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),us(e,t.key),t.modifier?(e.push(", "),us(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function fh(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(us(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function ph(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(us(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function hh(e,t){t.body?us(e,t.body):e.push("null")}function us(e,t){const{helper:n}=e;switch(t.type){case 0:hh(e,t);break;case 1:ph(e,t);break;case 2:fh(e,t);break;case 6:dh(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const mh=(e,t={})=>{const n=le(t.mode)?t.mode:"normal",s=le(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],c=uh(e,{filename:s,breakLineCode:o,needIndent:i});c.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(i),r.length>0&&(c.push(`const { ${Cl(r.map(p=>`${p}: _${p}`),", ")} } = ctx`),c.newline()),c.push("return "),us(c,e),c.deindent(i),c.push("}"),delete e.helpers;const{code:d,map:h}=c.context();return{ast:e,code:d,map:h?h.toJSON():void 0}};function gh(e,t={}){const n=Ze({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,c=lh(n).parse(e);return s?(i&&ch(c),o&&ts(c),{ast:c,code:""}):(rh(c,n),mh(c,n))}function Jt(e){return xe(e)&&Al(e)===0&&(xt(e,"b")||xt(e,"body"))}const jc=["b","body"];function vh(e){return Dn(e,jc)}const Hc=["c","cases"];function _h(e){return Dn(e,Hc,[])}const Vc=["s","static"];function yh(e){return Dn(e,Vc)}const Wc=["i","items"];function bh(e){return Dn(e,Wc,[])}const Bc=["t","type"];function Al(e){return Dn(e,Bc)}const Kc=["v","value"];function ao(e,t){const n=Dn(e,Kc);if(n!=null)return n;throw Us(t)}const Yc=["m","modifier"];function wh(e){return Dn(e,Yc)}const qc=["k","key"];function kh(e){const t=Dn(e,qc);if(t)return t;throw Us(6)}function Dn(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(xt(e,o)&&e[o]!=null)return e[o]}return n}const Gc=[...jc,...Hc,...Vc,...Wc,...qc,...Yc,...Kc,...Bc];function Us(e){return new Error(`unhandled node type: ${e}`)}function gi(e){return n=>$h(n,e)}function $h(e,t){const n=vh(t);if(n==null)throw Us(0);if(Al(n)===1){const i=_h(n);return e.plural(i.reduce((r,c)=>[...r,Ia(e,c)],[]))}else return Ia(e,n)}function Ia(e,t){const n=yh(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=bh(t).reduce((o,i)=>[...o,ji(e,i)],[]);return e.normalize(s)}}function ji(e,t){const n=Al(t);switch(n){case 3:return ao(t,n);case 9:return ao(t,n);case 4:{const s=t;if(xt(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(xt(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Us(n)}case 5:{const s=t;if(xt(s,"i")&&Xe(s.i))return e.interpolate(e.list(s.i));if(xt(s,"index")&&Xe(s.index))return e.interpolate(e.list(s.index));throw Us(n)}case 6:{const s=t,o=wh(s),i=kh(s);return e.linked(ji(e,i),o?ji(e,o):void 0,e.type)}case 7:return ao(t,n);case 8:return ao(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Sh=e=>e;let ro=Ne();function xh(e,t={}){let n=!1;const s=t.onError||qp;return t.onError=o=>{n=!0,s(o)},{...gh(e,t),detectError:n}}function Ch(e,t){if(le(e)){Ke(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||Sh)(e),o=ro[s];if(o)return o;const{ast:i,detectError:r}=xh(e,{...t,location:!1,jit:!0}),c=gi(i);return r?c:ro[s]=c}else{const n=e.cacheKey;if(n){const s=ro[n];return s||(ro[n]=gi(e))}else return gi(e)}}const rn={INVALID_ARGUMENT:Yp,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Eh=24;function cn(e){return Xo(e,null,void 0)}function Pl(e,t){return t.locale!=null?Oa(t.locale):Oa(e.locale)}let vi;function Oa(e){if(le(e))return e;if(qe(e)){if(e.resolvedOnce&&vi!=null)return vi;if(e.constructor.name==="Function"){const t=e();if(Ap(t))throw cn(rn.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return vi=t}else throw cn(rn.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw cn(rn.NOT_SUPPORT_LOCALE_TYPE)}function Th(e,t,n){return[...new Set([n,...Ve(t)?t:xe(t)?Object.keys(t).filter(s=>s!=="default"):le(t)?[t]:[n]])]}function Hi(e,t,n){const s=le(n)?n:To,o=e;let i;xe(t)?(o.__localeChainObjectCache||(o.__localeChainObjectCache=new WeakMap),i=o.__localeChainObjectCache.get(t),i||(i=new Map,o.__localeChainObjectCache.set(t,i))):(o.__localeChainCache||(o.__localeChainCache=new Map),i=o.__localeChainCache.get(t),i||(i=new Map,o.__localeChainCache.set(t,i)));const r=i.get(s);if(r)return r;const c=[];let d=[n];for(;Ve(d);)d=Na(c,d,t);const h=Ve(t)||!Ue(t)?t:t.default?t.default:null;return d=le(h)?[h]:h,Ve(d)&&Na(c,d,!1),i.set(s,c),c}function Na(e,t,n){let s=!0;for(let o=0;o<t.length&&Ke(s);o++){const i=t[o];le(i)&&(s=Ah(e,t[o],n))}return s}function Ah(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=Ph(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function Ph(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(Ve(n)||Ue(n))&&n[o]&&(s=n[o])}return s}const Fn=[];Fn[0]={w:[0],i:[3,0],"[":[4],o:[7]};Fn[1]={w:[1],".":[2],"[":[4],o:[7]};Fn[2]={w:[2],i:[3,0],0:[3,0]};Fn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Fn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Fn[5]={"'":[4,0],o:8,l:[5,0]};Fn[6]={'"':[4,0],o:8,l:[6,0]};const Lh=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Ih(e){return Lh.test(e)}function Oh(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function Nh(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Mh(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:Ih(t)?Oh(t):"*"+t}function Rh(e){const t=[];let n=-1,s=0,o=0,i,r,c,d,h,p,g;const v=[];v[0]=()=>{r===void 0?r=c:r+=c},v[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},v[2]=()=>{v[0](),o++},v[3]=()=>{if(o>0)o--,s=4,v[0]();else{if(o=0,r===void 0||(r=Mh(r),r===!1))return!1;v[1]()}};function $(){const U=e[n+1];if(s===5&&U==="'"||s===6&&U==='"')return n++,c="\\"+U,v[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&$())){if(d=Nh(i),g=Fn[s],h=g[d]||g.l||8,h===8||(s=h[0],h[1]!==void 0&&(p=v[h[1]],p&&(c=i,p()===!1))))return;if(s===7)return t}}const Ma=new Map;function Dh(e,t){return xe(e)?e[t]:null}function Fh(e,t){if(!xe(e))return null;let n=Ma.get(t);if(n||(n=Rh(t),n&&Ma.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(Gc.includes(r)&&Jt(o)||!xe(o)||!xt(o,r))return null;const c=o[r];if(c===void 0||qe(o))return null;o=c,i++}return o}const Uh="11.4.12",zo=-1,To="en-US",Ao="",Ra=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function jh(){return{upper:(e,t)=>t==="text"&&le(e)?e.toUpperCase():t==="vnode"&&xe(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&le(e)?e.toLowerCase():t==="vnode"&&xe(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&le(e)?Ra(e):t==="vnode"&&xe(e)&&"__v_isVNode"in e?Ra(e.children):e}}let Jc;function Hh(e){Jc=e}let Xc;function Vh(e){Xc=e}let zc;function Wh(e){zc=e}let Qc=null;const Da=e=>{Qc=e},Fa=()=>Qc;let Ua=0;function Bh(e={}){const t=qe(e.onWarn)?e.onWarn:Lp,n=le(e.version)?e.version:Uh,s=le(e.locale)||qe(e.locale)?e.locale:To,o=qe(s)?To:s,i=Ve(e.fallbackLocale)||Ue(e.fallbackLocale)||le(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Ue(e.messages)?e.messages:_i(o),c=Ue(e.datetimeFormats)?e.datetimeFormats:_i(o),d=Ue(e.numberFormats)?e.numberFormats:_i(o),h=Ze(Ne(),e.modifiers,jh()),p=e.pluralRules||Ne(),g=qe(e.missing)?e.missing:null,v=Ke(e.missingWarn)||Eo(e.missingWarn)?e.missingWarn:!0,$=Ke(e.fallbackWarn)||Eo(e.fallbackWarn)?e.fallbackWarn:!0,U=!!e.fallbackFormat,A=!!e.unresolving,T=qe(e.postTranslation)?e.postTranslation:null,k=Ue(e.processor)?e.processor:null,S=Ke(e.warnHtmlMessage)?e.warnHtmlMessage:!0,F=!!e.escapeParameter,x=qe(e.messageCompiler)?e.messageCompiler:Jc,j=qe(e.messageResolver)?e.messageResolver:Xc||Dh,O=qe(e.localeFallbacker)?e.localeFallbacker:zc||Th,C=xe(e.fallbackContext)?e.fallbackContext:void 0,I=e,K=xe(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,M=xe(I.__numberFormatters)?I.__numberFormatters:new Map,he=xe(I.__meta)?I.__meta:{};Ua++;const z={version:n,cid:Ua,locale:s,fallbackLocale:i,messages:r,modifiers:h,pluralRules:p,missing:g,missingWarn:v,fallbackWarn:$,fallbackFormat:U,unresolving:A,postTranslation:T,processor:k,warnHtmlMessage:S,escapeParameter:F,messageCompiler:x,messageResolver:j,localeFallbacker:O,fallbackContext:C,onWarn:t,__meta:he};return z.datetimeFormats=c,z.numberFormats=d,z.__datetimeFormatters=K,z.__numberFormatters=M,z}const _i=e=>({[e]:Ne()});function Zc(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const c=i(e,n,t,o);return le(c)?c:t}else return t}function ja(e,t){const n=e;xe(t)?n.__localeChainObjectCache?.delete(t):n.__localeChainCache?.delete(t)}function co(e,t,n){ja(e,n),e.fallbackContext&&ja(e.fallbackContext,n),e.localeFallbacker(e,n,t)}function Kh(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function Yh(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(Kh(e,t[s]))return!0;return!1}function eu(e,t,n,s,o,i,r){const{fallbackLocale:c,localeFallbacker:d,onWarn:h}=e,p=d(e,c,n);for(let g=0;g<p.length;g++){const v=p[g],$=(s[v]||{})[t];if(Ue($)&&le(v))return v;Zc(e,t,v,o,r)}return null}function tu(e,t,n){let s=`${e}__${t}`;return Ue(n)&&!Sl(n)&&(s=`${s}__${JSON.stringify(n)}`),s}function nu(e,t,n){for(const s in n){const o=`${t}__${s}`;for(const i of e.keys())(i===o||i.startsWith(`${o}__`))&&e.delete(i)}}function su(e,t,n,s){const[,o,i,r]=e;let c=n;return le(o)?t.key=o:Ue(o)&&Object.keys(o).forEach(d=>{s.includes(d)?c[d]=o[d]:t[d]=o[d]}),le(i)?t.locale=i:Ue(i)&&(c=i),Ue(r)&&(c=r),c}function Ha(e,...t){const{datetimeFormats:n,unresolving:s,onWarn:o}=e,{__datetimeFormatters:i}=e;if(!le(t[0])&&!Fc(t[0])&&!Xe(t[0]))return Ao;const[r,c,d,h]=Vi(...t),p=Ke(d.missingWarn)?d.missingWarn:e.missingWarn,g=Ke(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn,v=!!d.part,$=Pl(e,d);if(!le(r)||r===""){const S=new Intl.DateTimeFormat($.replace(/!/g,""),h);return v?S.formatToParts(c):S.format(c)}const U=eu(e,r,$,n,p,g,"datetime format");if(!le(U))return s?zo:r;const A=n[U][r],T=tu(U,r,h);let k=i.get(T);return k||(k=new Intl.DateTimeFormat(U,Ze({},A,h)),i.set(T,k)),v?k.formatToParts(c):k.format(c)}const ou=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Vi(...e){const[t]=e,n=Ne(),s=Ne();let o;if(le(t)){const r=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!r)throw cn(rn.INVALID_ISO_DATE_ARGUMENT);const c=r[3]?r[3].trim().startsWith("T")?`${r[1].trim()}${r[3].trim()}`:`${r[1].trim()}T${r[3].trim()}`:r[1].trim();o=new Date(c);try{o.toISOString()}catch{throw cn(rn.INVALID_ISO_DATE_ARGUMENT)}}else if(Fc(t)){if(isNaN(t.getTime()))throw cn(rn.INVALID_DATE_ARGUMENT);o=t}else if(Xe(t))o=t;else throw cn(rn.INVALID_ARGUMENT);const i=su(e,n,s,ou);return[n.key||"",o,n,i]}function Va(e,t,n){nu(e.__datetimeFormatters,t,n)}function Wa(e,...t){const{numberFormats:n,unresolving:s,onWarn:o}=e,{__numberFormatters:i}=e;if(!Xe(t[0]))return Ao;const[r,c,d,h]=Wi(...t),p=Ke(d.missingWarn)?d.missingWarn:e.missingWarn,g=Ke(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn,v=!!d.part,$=Pl(e,d);if(!le(r)||r===""){const S=new Intl.NumberFormat($.replace(/!/g,""),h);return v?S.formatToParts(c):S.format(c)}const U=eu(e,r,$,n,p,g,"number format");if(!le(U))return s?zo:r;const A=n[U][r],T=tu(U,r,h);let k=i.get(T);return k||(k=new Intl.NumberFormat(U,Ze({},A,h)),i.set(T,k)),v?k.formatToParts(c):k.format(c)}const iu=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Wi(...e){const[t]=e,n=Ne(),s=Ne();if(!Xe(t))throw cn(rn.INVALID_ARGUMENT);const o=t,i=su(e,n,s,iu);return[n.key||"",o,n,i]}function Ba(e,t,n){nu(e.__numberFormatters,t,n)}const qh=e=>e,Gh=e=>"",Jh="text",Xh=e=>e.length===0?"":Cl(e),zh=Pp;function yi(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function Qh(e){const t=Xe(e.pluralIndex)?e.pluralIndex:-1;return Xe(e.named?.count)?e.named.count:Xe(e.named?.n)?e.named.n:t}function Zh(e={}){const t=e.locale,n=Qh(e),s=le(t)&&qe(e.pluralRules?.[t])?e.pluralRules[t]:yi,o=s===yi?void 0:yi,i=k=>k[s(n,k.length,o)],r=e.list||[],c=k=>r[k],d=e.named||Ne();Xe(e.pluralIndex)&&(d.count||=e.pluralIndex,d.n||=e.pluralIndex);const h=k=>d[k];function p(k,S){const F=qe(e.messages)?e.messages(k,!!S):xe(e.messages)?e.messages[k]:!1;return F||(e.parent?e.parent.message(k):Gh)}const g=k=>e.modifiers?e.modifiers[k]:qh,v=qe(e.processor?.normalize)?e.processor.normalize:Xh,$=qe(e.processor?.interpolate)?e.processor.interpolate:zh,U=le(e.processor?.type)?e.processor.type:Jh,T={list:c,named:h,plural:i,linked:(k,...S)=>{const[F,x]=S;let j="text",O="";S.length===1?xe(F)?(O=F.modifier||O,j=F.type||j):le(F)&&(O=F||O):S.length===2&&(le(F)&&(O=F||O),le(x)&&(j=x||j));const C=p(k,!0)(T),I=C===""||C===void 0?k:C,K=j==="vnode"&&Ve(I)&&O?I[0]:I;return O?g(O)(K,j):K},message:p,type:U,interpolate:$,normalize:v,values:Ze(Ne(),r,d)};return T}const Ka=()=>"",un=e=>qe(e);function Ya(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:c}=e,[d,h]=Bi(...t),p=Ke(h.missingWarn)?h.missingWarn:e.missingWarn,g=Ke(h.fallbackWarn)?h.fallbackWarn:e.fallbackWarn,v=Ke(h.escapeParameter)?h.escapeParameter:e.escapeParameter,$=!!h.resolvedMessage,U=le(h.default)||Ke(h.default)?Ke(h.default)?i?d:()=>d:h.default:n?i?d:()=>d:null,A=n||U!=null&&(le(U)||qe(U)),T=Pl(e,h);v&&em(h);let[k,S,F]=$?[d,T,c[T]||Ne()]:lu(e,d,T,r,g,p),x=k,j=d;if(!$&&!(le(x)||Jt(x)||un(x))&&A&&(x=U,j=x),!$&&(!(le(x)||Jt(x)||un(x))||!le(S)))return o?zo:d;let O=!1;const C=()=>{O=!0},I=un(x)?x:au(e,d,S,x,j,C);if(O)return x;const K=sm(e,S,F,h),M=Zh(K),he=tm(e,I,M);let z=s?s(he,d):he;return v&&le(z)&&(z=Bp(z)),z}function em(e){Ve(e.list)?e.list=e.list.map(t=>le(t)?Ca(t):t):xe(e.named)&&Object.keys(e.named).forEach(t=>{le(e.named[t])&&(e.named[t]=Ca(e.named[t]))})}function lu(e,t,n,s,o,i){const{messages:r,onWarn:c,messageResolver:d,localeFallbacker:h}=e,p=h(e,s,n);let g=Ne(),v,$=null;const U="translate";for(let A=0;A<p.length&&(v=p[A],g=r[v]||Ne(),($=d(g,t))===null&&($=g[t]),!(le($)||Jt($)||un($)));A++)if(!Yh(v,p)){const T=Zc(e,t,v,i,U);T!==t&&($=T)}return[$,v,g]}function au(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:c}=e;if(un(s)){const h=s;return h.locale=h.locale||n,h.key=h.key||t,h}if(r==null){const h=(()=>s);return h.locale=n,h.key=t,h}const d=r(s,nm(e,n,o,s,c,i));return d.locale=n,d.key=t,d.source=s,d}function tm(e,t,n){return t(n)}function Bi(...e){const[t,n,s]=e,o=Ne();if(!le(t)&&!Xe(t)&&!un(t)&&!Jt(t))throw cn(rn.INVALID_ARGUMENT);const i=Xe(t)?String(t):(un(t),t);return Xe(n)?o.plural=n:le(n)?o.default=n:Ue(n)&&!Sl(n)?o.named=n:Ve(n)&&(o.list=n),Xe(s)?o.plural=s:le(s)?o.default=s:Ue(s)&&Ze(o,s),[i,o]}function nm(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>Sp(t,n,r)}}function sm(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:c,fallbackWarn:d,missingWarn:h,fallbackContext:p}=e,v={locale:t,modifiers:o,pluralRules:i,messages:($,U)=>{let A=r(n,$);if(A==null&&(p||U)){const[T,,k]=lu(p||e,$,t,c,d,h);A=T??r(k,$)}if(le(A)||Jt(A)){let T=!1;const S=au(e,$,t,A,$,()=>{T=!0});return T?Ka:S}else return un(A)?A:Ka}};return e.processor&&(v.processor=e.processor),s.list&&(v.list=s.list),s.named&&(v.named=s.named),Xe(s.plural)&&(v.pluralIndex=s.plural),v}const om="11.4.12",bt={UNEXPECTED_RETURN_TYPE:Eh,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Tt(e,...t){return Xo(e,null,void 0)}const Ki=Rn("__translateVNode"),Yi=Rn("__datetimeParts"),qi=Rn("__numberParts"),im=Rn("__setPluralRules"),lm=Rn("__injectWithOption"),ss=Rn("__dispose");let ru=null;{const e=Ep().__VUE_INSTANCE_SETTERS__;Ve(e)&&e.push(t=>{ru=t})}function js(e){if(!xe(e)||Jt(e))return e;for(const t in e)if(xt(e,t))if(!t.includes("."))xe(e[t])&&js(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=Ne()),!xe(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Jt(o)?Gc.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Jt(o)){const r=o[n[s]];xe(r)&&js(r)}}return e}function cu(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Ue(n)?n:Ve(s)?Ne():{[e]:Ne()};if(Ve(s)&&s.forEach(c=>{if("locale"in c&&"resource"in c){const{locale:d,resource:h}=c;d?(r[d]=r[d]||Ne(),ho(h,r[d])):ho(h,r)}else le(c)&&ho(JSON.parse(c),r)}),o==null&&i)for(const c in r)xt(r,c)&&js(r[c]);return r}function am(e){return e.type}function rm(e,t,n){let s=xe(t.messages)?t.messages:Ne();"__i18nGlobal"in n&&(s=cu(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(xe(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(xe(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function qa(e){return ne(Js,null,e,0)}function uu(){return ru??Ic()}const Ga=()=>[],cm=()=>!1;let Ja=0;function Xa(e){return((t,n,s,o)=>e(n,s,uu()||void 0,o))}function Gi(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=Co?ke:Pd;let r=Ke(e.inheritLocale)?e.inheritLocale:!0;const c=i(t&&r?t.locale.value:le(e.locale)?e.locale:To),d=i(t&&r?t.fallbackLocale.value:le(e.fallbackLocale)||Ve(e.fallbackLocale)||Ue(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),h=i(cu(c.value,e)),p=i(Ue(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),g=i(Ue(e.numberFormats)?e.numberFormats:{[c.value]:{}});let v=t?t.missingWarn:Ke(e.missingWarn)||Eo(e.missingWarn)?e.missingWarn:!0,$=t?t.fallbackWarn:Ke(e.fallbackWarn)||Eo(e.fallbackWarn)?e.fallbackWarn:!0,U=t?t.fallbackRoot:Ke(e.fallbackRoot)?e.fallbackRoot:!0,A=!!e.fallbackFormat,T=qe(e.missing)?e.missing:null,k=qe(e.missing)?Xa(e.missing):null,S=qe(e.postTranslation)?e.postTranslation:null,F=t?t.warnHtmlMessage:Ke(e.warnHtmlMessage)?e.warnHtmlMessage:!0,x=!!e.escapeParameter;const j=t?t.modifiers:Ue(e.modifiers)?e.modifiers:{};let O=e.pluralRules||t&&t.pluralRules,C;C=(()=>{s&&Da(null);const D={version:om,locale:c.value,fallbackLocale:d.value,messages:h.value,modifiers:j,pluralRules:O,missing:k===null?void 0:k,missingWarn:v,fallbackWarn:$,fallbackFormat:A,unresolving:!0,postTranslation:S===null?void 0:S,warnHtmlMessage:F,escapeParameter:x,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};D.datetimeFormats=p.value,D.numberFormats=g.value,D.__datetimeFormatters=Ue(C)?C.__datetimeFormatters:void 0,D.__numberFormatters=Ue(C)?C.__numberFormatters:void 0;const V=Bh(D);return s&&Da(V),V})(),co(C,c.value,d.value);function K(){return[c.value,d.value,h.value,p.value,g.value]}const M=L({get:()=>c.value,set:D=>{C.locale=D,c.value=D}});function he(D){s||(C.fallbackContext=t?Fa():void 0);try{co(C,c.value,D)}finally{s||(C.fallbackContext=void 0)}}const z=L({get:()=>d.value,set:D=>{d.value=D,C.fallbackLocale=d.value,he(d.value)}}),oe=L(()=>h.value),pe=L(()=>p.value),se=L(()=>g.value);function ce(){return qe(S)?S:null}function ye(D){S=D,C.postTranslation=D}function $e(){return T}function Ge(D){D!==null&&(k=Xa(D)),T=D,C.missing=k}const ae=(D,V,re,ue,Oe,je)=>{K();let Be;try{s||(C.fallbackContext=t?Fa():void 0),Be=D(C)}finally{s||(C.fallbackContext=void 0)}if(re!=="translate exists"&&Xe(Be)&&Be===zo||re==="translate exists"&&!Be){const[kt,Qn]=V();return t&&U?ue(t):Oe(kt)}else{if(je(Be))return Be;throw Tt(bt.UNEXPECTED_RETURN_TYPE)}};function ee(...D){return ae(V=>Reflect.apply(Ya,null,[V,...D]),()=>Bi(...D),"translate",V=>Reflect.apply(V.t,V,[...D]),V=>V,V=>le(V))}function Y(...D){const[V,re,ue]=D;if(ue&&!xe(ue))throw Tt(bt.INVALID_ARGUMENT);return ee(V,re,Ze({resolvedMessage:!0},ue||{}))}function fe(...D){return ae(V=>Reflect.apply(Ha,null,[V,...D]),()=>Vi(...D),"datetime format",V=>Reflect.apply(V.d,V,[...D]),()=>Ao,V=>le(V)||Ve(V))}function me(...D){return ae(V=>Reflect.apply(Wa,null,[V,...D]),()=>Wi(...D),"number format",V=>Reflect.apply(V.n,V,[...D]),()=>Ao,V=>le(V)||Ve(V))}function te(D){return D.map(V=>le(V)||Xe(V)||Ke(V)?qa(String(V)):V)}const we={normalize:te,interpolate:D=>D,type:"vnode"};function yn(...D){return ae(V=>{let re;const ue=V;try{ue.processor=we,re=Reflect.apply(Ya,null,[ue,...D])}finally{ue.processor=null}return re},()=>Bi(...D),"translate",V=>V[Ki](...D),V=>[qa(V)],V=>Ve(V))}function zn(...D){return ae(V=>Reflect.apply(Wa,null,[V,...D]),()=>Wi(...D),"number format",V=>V[qi](...D),Ga,V=>le(V)||Ve(V))}function Ft(...D){return ae(V=>Reflect.apply(Ha,null,[V,...D]),()=>Vi(...D),"datetime format",V=>V[Yi](...D),Ga,V=>le(V)||Ve(V))}function to(D){O=D,C.pluralRules=O}function E(D,V){return ae(()=>{if(!D)return!1;const re=le(V)?V:c.value,ue=le(V)?[re]:Hi(C,d.value,re);for(let Oe=0;Oe<ue.length;Oe++){const je=q(ue[Oe]);let Be=C.messageResolver(je,D);if(Be===null&&(Be=je[D]),Jt(Be)||un(Be)||le(Be))return!0}return!1},()=>[D],"translate exists",re=>Reflect.apply(re.te,re,[D,V]),cm,re=>Ke(re))}function P(D){let V=null;const re=Hi(C,d.value,c.value);for(let ue=0;ue<re.length;ue++){const Oe=h.value[re[ue]]||{},je=C.messageResolver(Oe,D);if(je!=null){V=je;break}}return V}function H(D){const V=P(D);return V??(t?t.tm(D)||{}:{})}function q(D){return h.value[D]||{}}function W(D,V){if(o){const re={[D]:V};for(const ue in re)xt(re,ue)&&js(re[ue]);V=re[D]}h.value[D]=V,C.messages=h.value}function B(D,V){h.value[D]=h.value[D]||{};const re={[D]:V};if(o)for(const ue in re)xt(re,ue)&&js(re[ue]);V=re[D],ho(V,h.value[D]),C.messages=h.value}function y(D){return p.value[D]||{}}function w(D,V){p.value[D]=V,C.datetimeFormats=p.value,Va(C,D,V)}function N(D,V){p.value[D]=Ze(p.value[D]||{},V),C.datetimeFormats=p.value,Va(C,D,V)}function R(D){return g.value[D]||{}}function Z(D,V){g.value[D]=V,C.numberFormats=g.value,Ba(C,D,V)}function X(D,V){g.value[D]=Ze(g.value[D]||{},V),C.numberFormats=g.value,Ba(C,D,V)}Ja++,Et(d,()=>he(d.value),{deep:!0,flush:"sync"}),t&&Co&&(Et(t.locale,D=>{r&&(c.value=D,C.locale=D,co(C,c.value,d.value))}),Et(t.fallbackLocale,D=>{r&&(d.value=D,C.fallbackLocale=d.value,co(C,c.value,d.value))}));const Q={id:Ja,locale:M,fallbackLocale:z,get inheritLocale(){return r},set inheritLocale(D){r=D,D&&t&&(M.value=t.locale.value,z.value=t.fallbackLocale.value)},get availableLocales(){return Object.keys(h.value).sort()},messages:oe,get modifiers(){return j},get pluralRules(){return O||{}},get isGlobal(){return s},get missingWarn(){return v},set missingWarn(D){v=D,C.missingWarn=v},get fallbackWarn(){return $},set fallbackWarn(D){$=D,C.fallbackWarn=$},get fallbackRoot(){return U},set fallbackRoot(D){U=D},get fallbackFormat(){return A},set fallbackFormat(D){A=D,C.fallbackFormat=A},get warnHtmlMessage(){return F},set warnHtmlMessage(D){F=D,C.warnHtmlMessage=D},get escapeParameter(){return x},set escapeParameter(D){x=D,C.escapeParameter=D},t:ee,getLocaleMessage:q,setLocaleMessage:W,mergeLocaleMessage:B,getPostTranslationHandler:ce,setPostTranslationHandler:ye,getMissingHandler:$e,setMissingHandler:Ge,[im]:to};return Q.datetimeFormats=pe,Q.numberFormats=se,Q.rt=Y,Q.te=E,Q.tm=H,Q.d=fe,Q.n=me,Q.getDateTimeFormat=y,Q.setDateTimeFormat=w,Q.mergeDateTimeFormat=N,Q.getNumberFormat=R,Q.setNumberFormat=Z,Q.mergeNumberFormat=X,Q[lm]=n,Q[Ki]=yn,Q[Yi]=Ft,Q[qi]=zn,Q}const Ll={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function um({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===J?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Ne())}function du(){return J}const dm=Me({name:"i18n-t",props:Ze({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Xe(e)||!isNaN(e)}},Ll),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Il({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const d=Object.keys(n).filter(g=>g[0]!=="_"),h=Ne();e.locale&&(h.locale=e.locale),e.plural!==void 0&&(h.plural=le(e.plural)?+e.plural:e.plural);const p=um(t,d);return o[Ki](e.keypath,p,h)},r=Ze(Ne(),s),c=le(e.tag)||xe(e.tag)?e.tag:du();return xe(c)?xo(c,r,{default:i}):xo(c,r,i())}}}),za=dm;function fm(e){return Ve(e)&&!le(e[0])}function fu(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const h={part:!0};let p=Ne();e.locale&&(h.locale=e.locale),le(e.format)?h.key=e.format:xe(e.format)&&(le(e.format.key)&&(h.key=e.format.key),p=Object.keys(e.format).reduce(($,U)=>n.includes(U)?Ze(Ne(),$,{[U]:e.format[U]}):$,Ne()));const g=s(e.value,h,p);let v=[h.key];return Ve(g)?v=g.map(($,U)=>{const A=o[$.type],T=A?A({[$.type]:$.value,index:U,parts:g}):[$.value];return fm(T)&&(T[0].key=`${$.type}-${U}`),T}):le(g)&&(v=[g]),v},c=Ze(Ne(),i),d=le(e.tag)||xe(e.tag)?e.tag:du();return xe(d)?xo(d,c,{default:r}):xo(d,c,r())}}const pm=Me({name:"i18n-n",props:Ze({value:{type:Number,required:!0},format:{type:[String,Object]}},Ll),setup(e,t){const n=e.i18n||Il({useScope:e.scope,__useComponent:!0});return fu(e,t,iu,(...s)=>n[qi](...s))}}),Qa=pm;function hm(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function mm(e){const t=r=>{const{instance:c,value:d}=r;if(!c||!c.$)throw Tt(bt.UNEXPECTED_ERROR);const h=hm(e,c.$),p=Za(d);return[Reflect.apply(h.t,h,[...er(p)]),h]};return{created:(r,c)=>{const[d,h]=t(c);Co&&(r.__i18nWatcher=Et(h.locale,()=>{c.instance&&c.instance.$forceUpdate()})),r.__composer=h,r.textContent=d},unmounted:r=>{Co&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:c})=>{if(r.__composer){const d=r.__composer,h=Za(c);r.textContent=Reflect.apply(d.t,d,[...er(h)])}},getSSRProps:r=>{const[c]=t(r);return{textContent:c}}}}function Za(e){if(le(e))return{path:e};if(Ue(e)){if(!("path"in e))throw Tt(bt.REQUIRED_VALUE,"path");return e}else throw Tt(bt.INVALID_VALUE)}function er(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},c=s||{};return le(n)&&(r.locale=n),Xe(o)&&(r.plural=o),Xe(i)&&(r.plural=i),[t,c,r]}function gm(e,t,...n){const s=Ue(n[0])?n[0]:{};(!Ke(s.globalInstall)||s.globalInstall)&&([za.name,"I18nT"].forEach(i=>e.component(i,za)),[Qa.name,"I18nN"].forEach(i=>e.component(i,Qa)),[sr.name,"I18nD"].forEach(i=>e.component(i,sr))),e.directive("t",mm(t))}const vm=Rn("global-vue-i18n");function _m(e={}){const t=Ke(e.globalInjection)?e.globalInjection:!0,n=new Map,[s,o]=ym(e),i=Rn("");function r(p){return n.get(p)||null}function c(p,g){n.set(p,g)}function d(p){n.delete(p)}const h={get mode(){return"composition"},async install(p,...g){if(p.__VUE_I18N_SYMBOL__=i,p.provide(p.__VUE_I18N_SYMBOL__,h),Ue(g[0])){const U=g[0];h.__composerExtend=U.__composerExtend,h.__vueI18nExtend=U.__vueI18nExtend}let v=null;t&&(v=Cm(p,h.global)),gm(p,h,...g);const $=p.unmount;p.unmount=()=>{v&&v(),h.dispose(),$()}},get global(){return o},dispose(){s.stop()},__instances:n,__getInstance:r,__setInstance:c,__deleteInstance:d};return h}function Il(e={}){const t=uu();if(t==null)throw Tt(bt.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Tt(bt.NOT_INSTALLED);const n=bm(t),s=km(n),o=am(t),i=wm(e,o);if(i==="global")return rm(s,e,o),s;if(i==="parent"){let d=tr(n,t,e.__useComponent);return d==null&&(d=s),d}if(i==="isolated"){if(n.mode!=="composition")throw Tt(bt.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const d=n,h=Ze({},e),p=tr(n,t);h.__root=p||s;const g=Gi(h);return d.__composerExtend&&(g[ss]=d.__composerExtend(g)),Rr()&&ud(()=>{const $=g[ss];$&&($(),delete g[ss])}),g}const r=n;let c=r.__getInstance(t);if(c==null){const d=Ze({},e);"__i18n"in o&&(d.__i18n=o.__i18n),s&&(d.__root=s),c=Gi(d),r.__composerExtend&&(c[ss]=r.__composerExtend(c)),Sm(r,t,c),r.__setInstance(t,c)}return c}function ym(e,t){const n=cd(),s=n.run(()=>Gi(e));if(s==null)throw Tt(bt.UNEXPECTED_ERROR);return[n,s]}function bm(e){const t=As(e.isCE?vm:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Tt(e.isCE?bt.NOT_INSTALLED_WITH_PROVIDE:bt.UNEXPECTED_ERROR);return t}function wm(e,t){return Sl(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function km(e){return e.mode==="composition"?e.global:e.global.__composer}function tr(e,t,n=!1){let s=null;const o=t.root;let i=$m(t,n);for(;i!=null;){const r=e;if(e.mode==="composition"&&(s=r.__getInstance(i)),s!=null||o===i)break;i=i.parent}return s}function $m(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Sm(e,t,n){Mn(()=>{},t),wl(()=>{const s=n;e.__deleteInstance(t);const o=s[ss];o&&(o(),delete s[ss])},t)}const xm=["locale","fallbackLocale","availableLocales"],nr=["t","rt","d","n","tm","te"];function Cm(e,t){const n=Object.create(null);return xm.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Tt(bt.UNEXPECTED_ERROR);const r=nt(i.value)?{get(){return i.value.value},set(c){i.value.value=c}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,nr.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Tt(bt.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,nr.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const Em=Me({name:"i18n-d",props:Ze({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Ll),setup(e,t){const n=e.i18n||Il({useScope:e.scope,__useComponent:!0});return fu(e,t,ou,(...s)=>n[Yi](...s))}}),sr=Em;Hh(Ch);Vh(Fh);Wh(Hi);const Tm={name:"English (US)",english:"English (US)",script:"latin",plural:"one_other",clock:"12",checked:!0},Am=JSON.parse(`{"common":{"undo":"Undo","online":"Online","offline":"Offline","unknown":"unknown","unsaved":"Unsaved changes","cancel":"Cancel","open_integrations":"Open Devices & services","save_send":"Save & send","saving":"Saving…","read_current_data":"Read current data","results":"1 result. Keep typing to narrow it down. | {n} results. Keep typing to narrow it down.","close":"Close","remove":"Remove","change":"Change","loading":"Loading…","back":"← Back","copy":"Copy"},"nav":{"new_screen":"New screen","firmware":"Firmware & USB","alerts":"Alerts","settings":"Settings","new_screen_detail":"Connect and install"},"api":{"failed":"That didn't work. Refresh the page and try again."},"copy":{"api_key":{"copied":"API key copied.","selected":"API key is selected. Copy with Ctrl+C or Command+C."},"layout_json":{"copied":"Layout JSON copied.","selected":"Layout JSON is selected. Copy with Ctrl+C or Command+C."},"action_name":{"copied":"Action name copied.","selected":"Action name is selected. Copy with Ctrl+C or Command+C."},"yaml":{"copied":"YAML copied.","selected":"YAML is selected. Copy with Ctrl+C or Command+C."},"icon_name":{"copied":"Icon name copied.","selected":"Icon name is selected. Copy with Ctrl+C or Command+C."},"empty_color":{"copied":"Empty color copied.","selected":"Empty color is selected. Copy with Ctrl+C or Command+C."},"color_name":{"copied":"Color name copied.","selected":"Color name is selected. Copy with Ctrl+C or Command+C."}},"sidebar":{"connection":{"unreachable":"Management page unreachable · retrying…","connected":"Home Assistant connected","reconnecting":"Reconnecting to Home Assistant…"},"search":"Search","screens":"Screens","more":"More","refresh":"Refresh","update":{"pill":"Update","button":"Update","queued":"Queued for the update","available":"Update {version}","no_profile":"No ESPHome profile found with this device name.","whats_new":"What's new","full_log":"Full log"},"host":{"hint":"The IP address, once; new firmware reports it itself.","placeholder":"IP address, e.g. 192.168.1.50","label":"IP address","start":"Start"},"pending":{"installed":"Installed, but not yet in Home Assistant. Add the discovered ESPHome device under Settings → Devices & services, paste the API key there, and turn on “Allow the device to perform Home Assistant actions” under Configure.","downloaded":"Firmware downloaded, not yet in Home Assistant. Put it on the screen with ESPHome Web, then add the discovered ESPHome device under Settings → Devices & services, paste the API key there, and allow the Home Assistant actions under Configure.","not_flashed":"Not yet in Home Assistant. Already flashed? Add the ESPHome device under Settings → Devices & services, then allow the Home Assistant actions under Configure. Not flashed yet? Firmware & USB → {file}."},"copy_api_key":"Copy API key"},"palette":{"groups":{"screens":"Screens","actions":"Actions","add":"Add to this screen"},"alerts_detail":"Cheatsheet and a test alert","settings_detail":"Updates, Claude","nothing_to_save":"Nothing to save","identify":"Identify this screen","identify_detail":"Blinks the backlight and shows a card","identify_needs":"Needs a newer firmware","export":"Export layout","export_detail":"Download and copy as JSON","placeholder":"Search screens, entities, actions…","empty":"Nothing matches. Type part of a screen, entity or action."},"empty":{"choose":{"title":"Choose a screen","text":"Pick one of your screens on the left to change its tiles, top bar and settings."},"start":{"title":"Start with a screen","text":"Connect a CYD or Guition via USB to your Home Assistant machine. Profile, firmware, and the first flash happen in one go.","button":"Install new screen"}},"screen_view":{"confirm":{"switch":"You have unsaved changes. Open a different screen anyway?","copy":"Replace the unsaved layout with a copy of the other screen's?","import":"Replace the unsaved layout with the imported one?"},"saved":{"current":"Saved. Your screen is being updated.","other":"Saved. {name} is being updated.","other_unnamed":"Saved. The screen is being updated.","newer_edit":"Saved. Your newest change isn't sent yet: press Save & send again."},"identified":"{name} blinks and shows a card for a few seconds.","offline":"Offline · changes are saved","tabs":{"layout":"Layout","settings":"Screen settings"},"sent":"Saved · sent to screen","all_saved":"All saved","more":"More","menu":{"identify":"Identify","identify_hint":"blink the screen","identify_needs":"Needs firmware 0.2.31 or newer","inspect_hint":"from Home Assistant","copy":"Copy layout from…","copy_screens":"{n} screen | {n} screens","copy_none":"no other screen","copy_tiles":"{n} tile | {n} tiles","export":"Export layout","import":"Import layout…","override":"Override YAML","override_hint":"advanced","override_none":"No ESPHome profile found for this screen","update":"Update firmware"}},"layout":{"removed":"{name} removed","no_room":"There is no room for this tile on page {page}.","no_free_page":"No page is free for a full-page tile. Free a page first.","page_taken":"This screen already has a tile that goes to page {page}.","copied":"Layout of {name} copied. Save & send when it looks right.","copied_part":"Layout of {name} copied: {kept} of {total} tiles fit this screen's firmware. Save & send when it looks right.","imported":"Layout imported. Save & send when it looks right.","imported_part":"Layout imported: {kept} of {total} tiles fit this screen's firmware. Save & send when it looks right.","not_json":"That isn't JSON. Export a layout first, or paste one from another ESP Screens.","no_tiles_in_file":"No tiles in this file. Expected a layout exported from ESP Screens.","count":"{n} page · {tiles} / {limit} tiles | {n} pages · {tiles} / {limit} tiles","no_tiles":"Add your first light, scene, or device from the library.","how_to":"Tap the top bar or a tile to change it. Drag to move; drop on the next page for a new one.","positions_hint":"Empty slots and fixed positions work from firmware 0.2.26. This screen (firmware {firmware}) shifts the tiles up to the first free slot until that update.","aria":"Screen layout","add_page":"+ Add page","max_pages":"1 page is the most | {n} pages is the most"},"page":{"label":"Page {page}","remove":"Remove page","remove_title":"The pages after this one shift up one slot","edit_bar":"Edit top bar","cell":{"title":"Empty slot. Click to add a tile here, or drag one over.","aria":"Empty slot {slot} on page {page}: add the next tile here","next":"Next tile goes here","empty":"Empty"}},"library":{"title":"Library","entities":"{n} entity | {n} entities","search":"Search by name, device, or room…","search_label":"Add an entity","filters":{"all":"All","light":"Lights","climate":"Climate","switch":"Switches","binary_sensor":"Status","button":"Actions","script":"Scripts","fan":"Fans","cover":"Covers","scene":"Scenes","vacuum":"Vacuum","sensor":"Sensors","media_player":"Media","weather":"Weather","number":"Values","select":"Selects","person":"People","timer":"Timers","screen":"Screen"},"room":"Room","all_rooms":"All rooms","hide_placed":"Hide placed","hide_placed_title":"Hide what is already on this screen","all_placed":"Everything here is already on this screen.","none_found":"No entities found. Try a different name, room or filter.","full":"This screen holds 1 tile. | This screen holds {n} tiles.","full_update":"This screen holds 1 tile; update its firmware for 48. | This screen holds {n} tiles; update its firmware for 48.","hint":"Drag onto a page, or tap + to add to the first free slot. ⌘K searches everything."},"domains":{"light":"Light","climate":"Climate","vacuum":"Vacuum","fan":"Fan","cover":"Cover","media_player":"Media","sensor":"Sensor","binary_sensor":"Status","switch":"Switch","input_boolean":"Switch","scene":"Scene","script":"Script","weather":"Weather","number":"Value","input_number":"Value","select":"Select","input_select":"Select","button":"Action","input_button":"Action","screen":"Screen","sun":"Sun","timer":"Timer","person":"Person","camera":"Camera","image":"Image","entity":"Entity"},"displays":{"standard":"standard","watch":"large value","forecast":"weather forecast","graph":"graph","digital":"digital clock","analog":"analog clock","sunpath":"sun path"},"sizes":{"single":"normal","wide":"double","full":"full page"},"tile":{"name":"Name on the screen","icon":{"auto_ha":"Automatic (from Home Assistant)","auto_default":"Automatic (default)","needs_firmware":"The screen shows a chosen icon from firmware 0.2.18."},"goes_to":{"label":"Goes to page","empty":"{page} (empty)","needs_firmware":"Navigation tiles need firmware 0.2.62: press Update on the screen first.","no_page":"This screen has no page {page}, so a tap opens its last page. Choose another page.","hint":"A tap on the tile opens that page."},"display":{"label":"Display","digital":"Digital clock","analog":"Analog clock","standard":"Name and status","watch":"Large value","forecast":"Weather forecast","graph":"Graph","sunpath":"Sun path","no_graph":"Home Assistant has no numbers for this entity, so the graph stays empty. Choose another display.","no_forecast":"This weather service has no daily forecast in Home Assistant. Choose another display."},"size":{"label":"Size","single":"Normal","wide":"Double-width","full":"Full page","full_hint":"Full page: one big button that lights up while on; a slider, controls or a graph sit at the bottom of it.","needs_firmware":"A full-page tile needs firmware 0.2.62: press Update on the screen first."},"page":{"label":"Page","new":"New page"},"controls":{"label":"Direct control on the tile","not_offered":"Home Assistant doesn't offer this control for this entity, so it stays empty on the screen. Choose another one.","full_hint":"At the bottom of the full-page tile; a tap anywhere else works as set below.","wide_hint":"On the right of the double-width tile, like the rows in Home Assistant. Tapping the name works as set below.","needs_firmware":"The screen shows direct control from firmware 0.2.19; until then the tile stays as it was."},"tap":{"label":"On tap","auto":"Automatic","detail":"Open control","none":"View only","toggle":"On / off","action":"Perform action","no_toggle":"Home Assistant can't turn this on and off, so a tap does nothing. Choose another option.","toggle_needs_firmware":"The screen switches this from firmware 0.2.58: press Update on the screen. Until then a tap opens its card.","hold":"Hold the tile to open its card."},"slider":{"label":"Small slider on the tile","no":"No","yes":"Yes, control directly","nothing":"Home Assistant has nothing a slider can change for this entity. Choose No."},"history":{"label":"History","hours":"{n} hour | {n} hours"},"background":{"label":"Pastel background","aria":"Background: {name}"}},"tile_card":{"label":"{name}, slot {slot} on page {page}. Enter: configure, arrow keys: move","remove":"Remove tile","remove_named":"Remove {name}"},"action":{"label":"Action","asking":"Asking Home Assistant which actions this entity has…","not_answering":"Home Assistant isn't answering right now. Try again in a moment.","choose":"Choose an action","search":"Search, for example toggle, position, or play","search_label":"Search for an action","none_found":"No action found.","gone":"Home Assistant doesn't offer this action for this entity any more, so a tap does nothing. Choose another one.","optional":"{name} (optional)","not_set":"Not set","on":"On","off":"Off","needs":"Home Assistant needs {fields}.","needs_firmware":"The screen performs an action from firmware 0.2.58: press Update on the screen. Until then a tap works as Automatic."},"icon":{"label":"Icon","none":"No icon","search":"Search, for example lamp, music, or door","search_label":"Search for an icon","none_text_only":"No icon, text only","aria":"Icon: {name}","none_found":"No icon found."},"inspect":{"title":"Current data","subtitle":"Connection, status, and supported properties","reading":"Reading…","fetching":"Fetching current HA status...","status":"Status: {status}","options":"Small slider: {slider} · Display: {display} · Size: {size} · Control: {control} · Background: {background}","yes":"yes","no":"no","control_none":"none","background_default":"Default","read_again":"Read again"},"topbar":{"removed":"{name} removed from the top bar","full":"The top bar has room for 1 item. | The top bar has room for {n} items.","already":"This is already in the top bar.","title":"Top bar","aria":"Top bar: {name}","builtin":"From the screen itself, also works without Home Assistant","items":"{used} of {n} item | {used} of {n} items","name":"Left: name","name_placeholder":"For example: Living room","right":"Right: time, sensors, or a clock","item_label":"{name}, slot {slot}. Enter: configure, arrows: move","remove_named":"Remove {name} from the top bar","max":"Maximum 1 item | Maximum {n} items","add_title":"Add the time, date, analog clock, or an entity","add_button":"+ Add time, date, or an entity","hint":{"overflow":"Not everything fits next to the name: the screen drops the dashed items. Remove one or choose a shorter name.","reorder":"Drag to reorder; tap an item to configure it.","needs_firmware":"Sensors, the date, and the analog clock appear from firmware {version}; until that update, this screen shows the name and, if the time is in the bar, the clock."},"detail":{"hidden":"Hidden: not active right now","overflow":"Doesn't fit next to the name","dial":"Dial"},"live":{"hidden":"Hidden right now: not active","overflow":"Doesn't currently fit next to the name","looks":"How it looks on the screen"},"analog_sample":"Small dial with the time","content":{"label":"What to show","hint":"Last changed keeps counting on the screen itself: “Just now”, “5 min ago”, “Yesterday”."},"auto_icon":"Automatic (like Home Assistant)","show":{"label":"Show","hint":"Only when active hides the item as long as it's off, closed, away, or 0. Handy for an open door, a running washing machine, or who's home."},"clock_24":"24 hour clock · change under {settings}","clock_12":"12 hour clock · change under {settings}","clock_settings":"Settings → Language & region","date_hint":"{date} today. The date follows the screen's own clock.","up":"↑ Up","down":"↓ Down","add":{"title":"Add to the top bar","slots":"{used} of {n} slot used | {used} of {n} slots used","builtin":"From the screen itself","added":"Already added","suggestions":"Suggestions from Home Assistant","entity":"An entity","search":"Search by name, room, or entity, e.g. temperature or door","search_label":"Search for an entity for the top bar","none_found":"No entities found."}},"screen_settings":{"groups":{"brightness":"Brightness","night":"Night","screen":"Screen"},"rows":{"brightness":"Brightness","dark_mode":"Dark mode","standby_enabled":"Auto standby","standby_seconds":"Standby after","standby_brightness":"Standby brightness","night_enabled":"Night mode","night_start":"Starts","night_end":"Ends","night_brightness":"Night brightness","auto_home":"Back to page 1","auto_home_seconds":"After","home_on_standby":"Also on standby","swipe_pages":"Swipe between pages","page_buttons":"Page buttons","rotation":"Rotation"},"duration":{"seconds":"{n} sec","minutes":"{n} min","hours":"{n} h","hours_minutes":"{h} h {m}"},"time":{"am":"{time} AM","pm":"{time} PM"},"other_screen_busy":"Still saving the other screen's settings. Try again in a moment.","reach":{"intro":"Page buttons and swiping are off, so only Go to page tiles change the page.","pages":"page {list} | pages {list}","tiles":"You have {n} Go to page tile, to {targets}. | You have {n} Go to page tiles, to {targets}.","tiles_missing_one":"You have {n} Go to page tile, to {targets}, but none to {missing}, so you can't reach it. | You have {n} Go to page tiles, to {targets}, but none to {missing}, so you can't reach it.","tiles_missing_more":"You have {n} Go to page tile, to {targets}, but none to {missing}, so you can't reach them. | You have {n} Go to page tiles, to {targets}, but none to {missing}, so you can't reach them.","none":"You have no Go to page tiles.","none_missing_one":"You have no Go to page tiles to {missing}, so you can't reach it.","none_missing_more":"You have no Go to page tiles to {missing}, so you can't reach them.","cut_off":"The tiles to {pages} are only on pages you can't reach.","no_way_back":"From {pages} no tile leads back to page 1."},"status":{"offline":"This screen is offline. Its settings can change once it's back.","screen":"Changes apply on the screen at once, and show up here when they change there.","app":"Changes apply at once. Firmware 0.2.49 lets the screen keep them itself."},"unavailable":"This entity is off in Home Assistant, or the screen is restarting.","lower":"{name} lower","higher":"{name} higher"},"update":{"starting":"Starting update…","building":"Building the firmware…","writing":"Writing the firmware over Wi-Fi…","phases":{"install":"Building and installing…","verify":"Waiting for the screen to come back…","settle":"Checking that it stays stable…"},"new_language":"New language: {name}"},"settings":{"updates":{"auto_on":"Screens will now update automatically at night.","auto_off":"Automatic updates are off.","title":"Firmware updates","busy":"Updating to firmware {version}…","no_screens":"No screen paired yet. New screens get firmware {version}.","available":"Firmware {version} is available for {n} screen. | Firmware {version} is available for {n} screens.","current":"All screens have firmware {version}.","all":"Update 1 screen | Update all {n} screens","whats_new":"What's new in firmware {version}","auto_label":"Update automatically every night","auto_hint":"Between 03:00 and 06:00, one screen at a time. Stops on an error and reports it in Home Assistant."},"claude":{"installed":"Skill installed. Claude Code picks it up right away.","installed_restart":"Skill installed. Restart Claude Code once so it finds the new skills folder.","text":"Teach Claude about ESP Screens, then ask: \\"Show an alert on all my screens when the mailbox is full.\\" Claude knows the alert events, every field, color, and icon.","install":"Install for Claude Code","install_again":"Install again","update":"Update the skill","not_installed":"Not installed","installed_chip":"● Installed","newer":"Installed · a newer version is ready","writes":"For Claude Code in Home Assistant. Writes one file to {path}; installing again replaces it.","download":"Download for claude.ai","upload":"Upload the zip in Claude under Customize → Skills."},"title":"Everything around your screens.","back":"← My screens","screens":{"title":"Screens","text":"Add a screen, or build and reinstall the firmware of one you already have.","firmware_detail":"Build and install via USB or Wi-Fi"},"language":{"title":"Language & region","screen_language":"Screen language","auto":"Home Assistant's language ({name})","auto_plain":"Home Assistant's language","ha_missing":"The screens use English until Home Assistant's language is available.","unchecked":"{name} · not checked yet, help welcome","help":"{name} is not checked yet, help welcome: {guide}","guide":"how to translate","update_hint":"After a change every screen needs a firmware update, one build each: with its Update button, or in the nightly updates.","time":"Time format","time_auto":"Automatic, follows the language ({clock})","clock_24":"24 hour","clock_12":"12 hour","numbers":"Number format","numbers_auto":"Automatic, follows the language ({example})","profile":"Your Home Assistant profile: {formats}","use_profile":"Use these","editor_hint":"The editor itself follows the language of your Home Assistant profile.","saved":"Saved.","saved_language":"Saved. Every screen takes the new language with its next update."},"alerts":{"text":"A card over the whole screen from an automation, on one screen or on all of them. The cheatsheet has the action names, fields, icons, and colors, and a form to try one.","detail":"Full-screen notifications, from an automation"}},"firmware":{"title":"Build and install screen firmware","intro":"The built-in ESPHome CLI uses your own profile (YAML with keys) and secrets. Choose the screen's profile, then a USB port (screen connected to the Home Assistant machine), {ota} with the hostname, or {download} to put the firmware on the screen from your own computer. {check} only validates, {build} compiles, {install} puts the firmware on the screen. Your tiles stay as they are in ESP Screens. The first build takes a few minutes.","ota":"Wi-Fi / OTA","download":"Download","check":"Check","build":"Build only","install":"Build & install","build_download":"Build & download","no_cli":"The ESPHome CLI is missing. Update the app to 0.2.0.","choose":"Choose the intended profile, then a USB port, an IP address, or Download.","profile":"ESPHome profile","install_to":"Install to","no_board":"USB · no board found on the Home Assistant machine yet","download_target":"Download · flash from your own computer","host":"IP address or hostname","download_file":"Download {name}","download_how":"Put it on the screen with {esphome_web} in Chrome or Edge: Connect, choose the screen's USB port, Install, and select this file. It holds your Wi-Fi password and the screen's keys: keep it to yourself."},"installer":{"title":{"setup":"Connect and install.","saved":"Profile saved.","running":"One moment…","ready":"Ready to download.","done":"Done.","failed":"That didn't work."},"intro":"ESP Screens creates the screen's own profile with unique keys and builds the firmware. Connect the screen with a USB data cable to the machine running Home Assistant, or download the firmware and put it on the screen from your own computer.","board":"Which screen do you have?","board_cyd":"CYD · 2.8 inch","board_guition":"Guition · 4 inch","name":"Name","name_placeholder":"Living room screen","device_name":"Device name","customize":"customize","name_hint":"Every screen gets its own profile with its own keys. Four screens? Go through this four times with a different name.","device_name_hint":"Lowercase letters, digits, and dashes. A different name for each screen.","wifi":{"title":"Wi-Fi","ssid":"Wi-Fi name (2.4 GHz)","password":"Wi-Fi password","new":"Fill in once: ESP Screens saves this in ESPHome secrets.yaml, later screens use it automatically.","missing":"Your ESPHome secrets.yaml is still missing Wi-Fi details. ESP Screens only fills in the missing lines.","ready":"Wi-Fi comes from your ESPHome secrets.yaml.","invalid":"secrets.yaml in the ESPHome folder isn't valid YAML. Fix the file first; it won't be overwritten."},"install_via":"Install via","later":"Later · save profile only","target":{"usb":"Connect the screen with a USB data cable to the Home Assistant machine; the list refreshes on its own. Or choose Download to use your own computer.","download":"Download the firmware and put it on the screen from your own computer, in Chrome or Edge. After that, updates go over Wi-Fi.","later":"The profile goes into the ESPHome folder. You can install later via Firmware & USB, or from ESPHome Device Builder.","several":"More than one board connected: choose this screen's port.","once":"Once over USB; after that, everything is wireless."},"install":"Install","save_profile":"Save profile","busy":"A build or installation is already running ({file}). Wait for it to finish.","no_cli":"The ESPHome CLI is missing from this installation; only saving the profile is possible.","progress":{"saved":"{file} is in the ESPHome folder","writing":"Writing firmware to {name}…","building":"Building firmware…","ready":"Firmware for {name} is ready","installed":"Firmware is on {name}","build_failed":"Build failed","install_failed":"Install failed"},"detail":{"saved":"Install it later from Firmware & USB: choose this profile, then the USB port of the Home Assistant machine, or Download to put the firmware on the screen from your own computer. Save the API key for pairing:","uploading":"Don't disconnect the USB cable yet.","building":"A first build takes a few minutes on a Raspberry Pi. You can leave this page: the installation keeps running and you'll find it again under New screen.","building_download":"A first build takes a few minutes on a Raspberry Pi. You can leave this page: the build keeps running and you'll find it again under New screen.","downloaded":"Put it on the screen from your own computer, then pair the screen with Home Assistant.","booted":"The screen boots up and connects to your Wi-Fi. Pair it with Home Assistant now:","booted_cyd":"The screen boots up and connects to your Wi-Fi. The CYD first asks for a touch calibration: tap the crosshairs. Pair it with Home Assistant now:","see_log":"See the log below."},"download_steps":{"plug":"{bold} with a USB data cable.","plug_bold":"Plug the screen into your computer","open":"{bold} in Chrome or Edge, click Connect and choose the screen's USB port.","open_bold":"Open {esphome_web}","install":"{bold} and select {file}. The screen restarts and joins your Wi-Fi.","install_cyd":"{bold} and select {file}. The screen restarts and joins your Wi-Fi. The CYD first asks for a touch calibration: tap the crosshairs.","install_bold":"Click Install"},"download_keep":"The file holds your Wi-Fi password and the screen's keys: keep it to yourself.","api_key":"API key","pairing":{"ha":"{bold} This happens outside ESP Screens. Home Assistant discovers {name} as an ESPHome device; click Add. Not discovered? Add ESPHome manually with the screen's IP address.","ha_bold":"Go to Home Assistant → Settings → Devices & services.","key":"{bold} above when Home Assistant asks for an encryption key.","key_bold":"Paste the API key","actions":"{bold} ESPHome integration → Configure → “Allow the device to perform Home Assistant actions”. Without this, the screen sees everything but controls nothing.","actions_bold":"Allow HA actions:","tiles":"{bold} Back in ESP Screens, the screen appears in the list on the left within about thirty seconds; until then it's shown there as “not yet in Home Assistant”.","tiles_bold":"Choose your tiles."},"log":"ESPHome log","retry":"Retry","another":"Install another screen","start_over":"Start over","done":"Done"},"alerts":{"eyebrow":"Alerts · cheatsheet","title":"A full-screen notification, from an automation.","intro":"Every screen has the {action} action. It places a card over everything, wakes the screen, and keeps the backlight at normal brightness until someone taps the button or the timeout runs out. Home Assistant itself shows no explanation or dropdowns for ESPHome actions; everything you can fill in is listed here.","loading":"The cheatsheet is still loading; one moment.","example":{"title":"Someone is at the door","subtitle":"Door 3, back","button":"Coming"},"sections":"Sections","nav":{"try":"Try it","screens":"Your screens","howto":"In an automation","all":"All screens","fields":"The fields","icons":"Icons","colors":"Colors","behaviour":"Behavior","events":"Events","tips":"Tips"},"try":{"text":"Send one alert now, with the same fields an automation sends. The screen shows the card and, with blinking on, flashes its backlight.","screen":"Screen","all":"All screens ({ready} ready)","not_ready":"{name} · not ready","title":"Title","subtitle":"Subtitle","icon":"Icon","color":"Color","button":"Button text","timeout":"Timeout (seconds, 0 waits for the button)","flash":"Blink the backlight","flash_hint":"Four times when the alert arrives.","sending":"Sending…","send":"Send alert","sent_all":"Sent to {n} screen. | Sent to {n} screens.","sent_to":"Sent to {name}.","sent_one":"Sent to the screen.","skipped":"1 skipped (offline or old firmware). | {n} skipped (offline or old firmware).","left_empty":"Left empty: {fields}.","nothing":"No screen could show it: check that a screen is online with firmware {version} or newer."},"white":"White (default)","screens":{"text":"Every screen has its own action, with the device name in it. From firmware {version}; update an older screen with its Update button under Screens.","none":"No screen paired yet. Install one via New screen; the action appears once Home Assistant sees the screen.","ready":"● firmware {version}","update":"Update needed · firmware {version}","unknown":"Device name unknown · update the screen","show":"Show alert","dismiss":"Dismiss alert"},"howto":{"add":"{add} and search for {esphome}. Choose your screen's action: Home Assistant calls it \\"Performs the action show_alert of the node {device}\\".","add_bold":"Add action","device":"device name","fields":"{bold} Home Assistant asks for all seven; leave what you don't use empty ({empty}, {zero}, off).","fields_bold":"Fill in the fields.","yaml":"Prefer YAML? Choose {edit} on the action and paste the example below.","example_for":"Example for","no_screen":"a screen (not paired yet)"},"edit_yaml":"Edit in YAML","copy_yaml":"Copy YAML","all":{"title":"All screens at once","text":"Fire the event {show} with the same fields, and ESP Screens passes the alert on to every screen that is online, including screens you add later. {dismiss} clears it everywhere. In an automation, add the {event} action or paste the example under {edit}. Leave out the fields you don't use. ESP Screens has to be running for this.","event":"Event"},"fields":{"text":"Text is free-form; the limit is in bytes, and an accented letter counts as two. What doesn't fit gets an ellipsis (title) or is dropped (subtitle).","field":"Field","type":"Type","what":"What it does","example":"Example","limit":"Limit","types":{"string":"text","int":"number","bool":"on / off","entity":"entity"},"bytes":"CYD {cyd} · Guition {guition} bytes","seconds":"0 to 86400 s","camera_limit":"Guition, firmware 0.2.57+"},"icons":{"text":"Fill in the name in {field}, for example {example}. {mdi} and the hex codepoint ({hex}) also work. Only these icons are included in the firmware; any other name shows the warning triangle. Tap an icon to copy its name.","handy":"Handy for notifications","search_label":"Search for an icon","search":"Search by name or description…","extra":"Also available: control and weather icons","copy":"Copy {name}","none":"No icon for \\"{query}\\". Unknown names show the warning triangle ({fallback})."},"colors":{"text":"Fill in the name in {field}. These are the pastel shades of the tiles, with dark text. Empty or unknown gives the white card. Tap to copy."},"behaviour":{"wakes":"{bold} An alert immediately wakes a dimmed or dark screen and appears above every page, every open light card, and the standby layer.","wakes_bold":"Wakes the screen.","on":"{bold} As long as the card is showing, the backlight stays at normal brightness. Standby and night hours wait. After the button, the regular standby time starts again.","on_bold":"On until the button.","timeout":"{bold} {zero} waits for the button, however long that takes. With {minute} the card disappears after a minute, but the button closes it sooner.","timeout_bold":"Timeout.","blinking":"{bold} {flash} blinks the backlight four times when the alert arrives (about a second) and leaves the screen on afterward.","blinking_bold":"Blinking.","replacing":"{bold} A new alert replaces the current one; there's no stack. The replaced alert reports itself as {replaced}.","replacing_bold":"Replacing.","closing":"{bold} {dismiss} clears the card, for example if the door is already open. Without an alert, that action does nothing.","closing_bold":"Closing remotely.","beside":"{bold} does nothing; only the button closes it. That way a wake-up tap never accidentally dismisses the alert.","beside_bold":"Tapping beside the card"},"events":{"text":"Every end fires the event {event} with {action}, {title}, {screen} (the device name) and the {device_id} that Home Assistant adds. Visible under Settings → Tools → Events.","when":"When","wait":"Waiting until someone presses the button"},"tips":{"color":"Use a {bold}: orange for the door, red for smoke or water, green for \\"done\\". The text always stays dark and readable.","color_bold":"color per kind of notification","short":"Keep the title {bold}; a screen shows about twenty characters on one line and ends a longer title with an ellipsis. Put details in the subtitle.","short_bold":"short","button":"A {bold} turns the notification into a question: \\"Coming\\", \\"Seen\\", \\"Turn off\\". The event then tells you who responded.","button_bold":"custom button text","resolve":"For an alert that resolves itself (the door opens, the laundry gets taken out) close it in the same automation with {dismiss}.","every":"Every screen? Fire {event} once (see All screens at once). The screens still work independently and each reports with its own {screen}.","claude":"Rather {bold} for the automation? Install the ESP Screens skill under Settings → Claude.","claude_bold":"ask Claude"}},"override":{"eyebrow":"Advanced · local override","title":"Override YAML","title_named":"Override YAML · {name}","intro":"This small file is yours. It is loaded after the shared screen package and stays in place when ESP Screen Manager updates. Change hardware-specific details here, such as a display model.","safe_title":"What is safe to change?","safe_text":"Display, touchscreen, substitutions, pins and other device details. Name, Wi-Fi, API, OTA and package links remain managed.","active":"Active","ready":"Ready to attach","editor_label":"Local override YAML","use_example":"Use example","clear":"Clear","characters":"1 character | {n} characters","lines":"1 line | {n} lines","save_check":"Save & check","save":"Save override","no_profile":"No ESPHome profile was found for this screen.","attached":"Changes here apply on the next build.","not_attached":"Save once to attach this file to the profile.","saving":"Checking and saving…","saved":"Saved. The override is kept during firmware updates.","saved_toast":"Override YAML saved.","checking":"Saved. ESPHome is checking the complete profile…","checking_profile":"ESPHome is checking the profile…","checking_stage":"ESPHome is checking the profile… {stage}","valid":"The complete profile is valid. Safe to build and install.","rejected":"ESPHome rejected the complete profile. See Firmware & USB for the full log.","confirm_example":"Replace the current text with the example?","example_loaded":"Example loaded. Save it when you are ready.","confirm_clear":"Clear the local override?","cleared":"The override will be empty after you save."},"mockup":{"date":{"weekdays_min":["Su","Mo","Tu","We","Th","Fr","Sa"],"months_short":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"top_bar":"{weekday} {day} {month}"},"time":{"just_now":"Just now","minutes_ago":"{n} min ago","hours_ago":"1 hour ago | {n} hours ago","yesterday":"Yesterday","days_ago":"1 day ago | {n} days ago","weeks_ago":"1 week ago | {n} weeks ago","months_ago":"1 month ago | {n} months ago","years_ago":"1 year ago | {n} years ago","in_minutes":"In {n} min","in_hours":"In 1 hour | In {n} hours","tomorrow":"Tomorrow","in_days":"In 1 day | In {n} days"},"home":"Home","page_link":"Page {page} ›","unknown":"Unknown","unavailable":"Unavailable","run":{"scene":"Activate","script":"Run","press":"Press"},"weather":{"clear_night":"Clear, night","cloudy":"Cloudy","exceptional":"Exceptional","fog":"Fog","hail":"Hail","lightning":"Lightning","lightning_rainy":"Lightning, rainy","partlycloudy":"Partly cloudy","pouring":"Pouring","rainy":"Rainy","snowy":"Snowy","snowy_rainy":"Snowy, rainy","sunny":"Sunny","windy":"Windy","windy_variant":"Windy"}}}`),pu={_meta:Tm,editor:Am},or=e=>e%10>=2&&e%10<=4&&(e%100<12||e%100>14),ir={one_other:e=>e===1?0:1,one_upto_1:e=>Math.abs(e)<=1?0:1,slavic_pl:e=>e===1?0:or(e)?1:2,east_slavic:e=>e%10===1&&e%100!==11?0:or(e)?1:2,none:()=>0},Pm=Object.assign({"../../screen_manager/translations/de.json":()=>bn(()=>import("./de-D8f1sCWy.js"),[],import.meta.url).then(e=>e.default),"../../screen_manager/translations/en-GB.json":()=>bn(()=>import("./en-GB-BZ7UoEeO.js"),[],import.meta.url).then(e=>e.default),"../../screen_manager/translations/es.json":()=>bn(()=>import("./es-CkwupUxz.js"),[],import.meta.url).then(e=>e.default),"../../screen_manager/translations/fr.json":()=>bn(()=>import("./fr-DqQ0gkYe.js"),[],import.meta.url).then(e=>e.default),"../../screen_manager/translations/it.json":()=>bn(()=>import("./it-8dniYzl4.js"),[],import.meta.url).then(e=>e.default),"../../screen_manager/translations/nl.json":()=>bn(()=>import("./nl-Bml3MQex.js"),[],import.meta.url).then(e=>e.default),"../../screen_manager/translations/pl.json":()=>bn(()=>import("./pl-2alySqqF.js"),[],import.meta.url).then(e=>e.default),"../../screen_manager/translations/pt.json":()=>bn(()=>import("./pt-BD1M56yK.js"),[],import.meta.url).then(e=>e.default)}),Ji=Object.fromEntries(Object.entries(Pm).map(([e,t])=>[e.slice(e.lastIndexOf("/")+1,-5),t])),zs={en:pu._meta},Ol={},hu=e=>Ol[e]=(t,n)=>Math.min((ir[zs[e]?.plural]||ir.one_other)(t),n-1),Nl=()=>["en",...Object.keys(Ji).sort(),...Object.keys(zs).filter(e=>e!=="en"&&!Ji[e])];Nl().forEach(hu);const ds=_m({locale:"en",fallbackLocale:"en",messages:{en:{editor:pu.editor}},pluralRules:Ol,missingWarn:!1,fallbackWarn:!1,missing:(e,t)=>{}}),u=ds.global.t,mu=()=>ds.global.locale.value,Lm=e=>zs[e];function Im(e=window){try{if(e.parent!==e){const t=e.parent.document.documentElement.lang;if(t)return t}}catch{}return e.navigator.language||"en"}function gu(e,t=Nl()){const n=o=>t.find(i=>i.toLowerCase()===o.toLowerCase()),s=(e||"").trim();return s?n(s)||n(s.split("-")[0]):void 0}const vu=(e,t=Nl())=>gu(e,t)||"en";function _u(e){if(typeof e=="string")return e.trim()?e:void 0;if(Array.isArray(e))return e.every(n=>typeof n=="string"&&n.trim())?e:void 0;if(!e||typeof e!="object")return;const t=Object.entries(e).map(([n,s])=>[n,_u(s)]).filter(([,n])=>n!==void 0);return t.length?Object.fromEntries(t):void 0}function yu(e,t){return typeof e=="string"?[t]:!e||typeof e!="object"?[]:Object.entries(e).flatMap(([n,s])=>yu(s,`${t}.${n}`))}function Om(e,t){zs[e]=t._meta,Ol[e]||hu(e);const n=_u(t.editor)||{};ds.global.setLocaleMessage(e,{editor:n});const s=yu(n,"editor").filter(o=>{try{return u(o,{},{locale:e}),!1}catch{return!0}});if(s.length){for(const o of s){const i=o.split(".").slice(1),r=i.pop();delete i.reduce((c,d)=>c[d],n)[r]}ds.global.setLocaleMessage(e,{editor:n})}}const lr={};function bu(e){if(zs[e])return Promise.resolve(!0);const t=Ji[e];return t?lr[e]??=t().then(n=>(Om(e,n),!0),()=>(delete lr[e],!1)):Promise.resolve(!1)}async function Nm(e=vu(Im())){const t=await bu(e)?e:"en";return ds.global.locale.value=t,document.documentElement.lang=t,t}const ar={point:[".",","],comma:[",","."],space:[","," "]};function wu(e,t){const n=String(e),s=/^(-?)(\d+)(?:\.(\d+))?$/.exec(n);if(!s)return n;const[o,i]=ar[t]||ar.point,r=s[2].replace(/\B(?=(\d{3})+$)/g,i);return`${s[1]}${r}${s[3]!==void 0?o+s[3]:""}`}const rr={comma_decimal:"point",decimal_comma:"comma",space_comma:"space"};function Mm(e=window){try{if(e.parent===e)return{};const t=e.parent.document.querySelector("home-assistant")?.hass?.locale,n=["12","24"].includes(t?.time_format)?t.time_format:void 0;return{...n?{clock:n}:{},...rr[t?.number_format]?{numbers:rr[t.number_format]}:{}}}catch{return{}}}const Rm=(e,t=mu())=>new Intl.ListFormat(t==="en"?"en-GB":t,{type:"conjunction"}).format(e.map(String)),Je=6,mn=8,Hs=mn*Je,ku=["single","wide","full"],Ln=e=>e===!0?"wide":e===!1?"single":e,gs=e=>/^screen\.page_[1-8]$/.test(e)?Number(e.slice(-1)):0,ft=e=>ku.includes(e.options?.size)?e.options.size:"single",Xi=e=>ft(e)!=="single",$u=e=>ft(e)==="full",Su=e=>e-e%Je,xu=e=>e-e%2,At=e=>Math.floor(e/Je),Ml=e=>Ln(e)==="full"?Je:Ln(e)==="wide"?2:1,qn=(e,t)=>Ln(t)==="full"?Array.from({length:Je},(n,s)=>Su(e)+s):Ln(t)==="wide"?[e,e+1]:[e],cr=(e,t)=>Ln(t)==="full"?Su(e):Ln(t)==="wide"?xu(e):e,et=e=>e.tiles.map(t=>({tile:t,slot:t.slot}));function Cu(e){let t=0;return e.map(n=>{const s=ft(n);s==="full"&&t%Je?t+=Je-t%Je:s==="wide"&&t%2===1&&t++;const o=t;return t+=Ml(s),o})}function Dm(e){const t=Cu(e);return e.some((n,s)=>n.slot!==t[s])}function Qo(e){if(e.tiles.some(t=>!Number.isInteger(t.slot))){const t=Cu(e.tiles);e.tiles.forEach((n,s)=>n.slot=t[s])}e.tiles.sort((t,n)=>t.slot-n.slot)}function ls(e){const t=new Set;for(const{tile:n,slot:s}of e)for(const o of qn(s,ft(n)))t.add(o);return t}const Vs=(e,t,n)=>Number.isInteger(t)&&t>=0&&t<Hs&&(Ln(n)==="full"?t%Je===0:Ln(n)==="wide"?t+1<Hs&&!(t%2):!0)&&qn(t,n).every(s=>!e.has(s));function Po(e,t,n=0){for(let s=n;s<Hs;s++)if(Vs(e,s,t))return s;return-1}function Eu(e,t,n){let s=-1;for(let o=0;o<Hs;o++)Vs(e,o,t)&&(s<0||Math.abs(o-n)<=Math.abs(s-n))&&(s=o);return s}function Tu(e,t,n){const s=ft(t);if(n=cr(n,s),!Vs(new Set,n,s))return null;const o=qn(n,s),i=e.includes(t)?qn(t.slot,s):[],r=[{tile:t,slot:n}],c=[];for(const d of e)d!==t&&(qn(d.slot,ft(d)).some(h=>o.includes(h))?c.push(d):r.push({tile:d,slot:d.slot}));for(const d of c){const h=ft(d),p=ls(r);let g=i.map(v=>cr(v,h)).find(v=>Vs(p,v,h));if(g===void 0&&(g=Eu(p,h,d.slot)),g<0)return null;r.push({tile:d,slot:g})}return r.sort((d,h)=>d.slot-h.slot)}function It(e,t=1){const n=Math.max(0,...e.map(({tile:s,slot:o})=>o+Ml(ft(s))));return Math.min(mn,Math.max(1,Math.ceil(n/Je),t||1))}function Fm(e,t){const n=Array.from({length:t},()=>new Set);let s=0;for(const{tile:h,slot:p}of e){const g=gs(h.entity)-1,v=At(p);g<0||g>=t||v>=t||(s++,n[v].add(g))}const o=h=>{const p=new Set([0]),g=[0];for(;g.length;)for(const v of h(g.shift()))p.has(v)||(p.add(v),g.push(v));return p},i=o(h=>[...n[h]]),r=o(h=>n.flatMap((p,g)=>p.has(h)?[g]:[])),c=Array.from({length:t},(h,p)=>p),d=h=>h.map(p=>p+1);return{tiles:s,targets:d(c.filter(h=>n.some(p=>p.has(h)))),unreachable:d(c.filter(h=>!i.has(h))),noWayBack:d(c.filter(h=>i.has(h)&&!r.has(h)))}}function Um(e){const t=e.split(".")[0];return t==="sun"?{options:{display:"sunpath",size:"wide"}}:t==="weather"?{options:{display:"forecast",size:"wide"}}:gs(e)?{}:t==="screen"?{options:{display:"digital",size:"wide"}}:{}}const Au=e=>({entity:e,name:"",slot:-1,...Um(e)});function Pu(e,t){const n=e.entity.split(".")[0],s=t.controls?.[n],o=e.options||{};if(!s||!["wide","full"].includes(o.size)||(o.display||"standard")!=="standard"||o.inline==="slider")return null;const i=o.controls??(o.size==="full"?"none":s.default);return i==="none"?null:i}function jm(e,t){const n=Pu(e,t);return n?t.controls?.[e.entity.split(".")[0]]?.choices.find(s=>s.key===n)?.label.toLocaleLowerCase()||n:u("editor.inspect.control_none")}const zi=e=>(/^(\d+)\.(\d+)\.(\d+)$/.exec(e||"")||[]).slice(1).map(Number);function gn(e,t){const[n,s]=[zi(e),zi(t)];if(n.length!==3||s.length!==3)return!1;for(let o=0;o<3;o++)if(n[o]!==s[o])return n[o]>s[o];return!0}const Hm=(e,t,n,s)=>gn(e,`${t}.${n}.${s}`),Vm=Hs;function Wm(e){return zi(e).length!==3?10:gn(e,"0.2.62")?Vm:gn(e,"0.2.7")?20:10}const Bm=["standard","watch","forecast","graph","digital","analog","sunpath"],Lu=e=>Bm.includes(e)?u(`editor.displays.${e}`):e,Km=e=>u(`editor.sizes.${ku.includes(e)?e:"single"}`),ur=["light","switch","input_boolean","fan","media_player","climate"],Ym=["light","fan","cover","number","input_number","media_player"],qm={light:["☀","#ad7600","#fff3d3"],climate:["❄","#c86620","#ffebdc"],vacuum:["◉","#008577","#def3ed"],fan:["✣","#008aab","#def5fa"],cover:["▤","#8053af","#eee5f8"],media_player:["▶","#007cad","#def2fc"],sensor:["⌁","#3476b1","#e5effa"],binary_sensor:["◈","#ad7600","#fff3d3"],switch:["⏻","#ad7600","#fff3d3"],input_boolean:["⏻","#ad7600","#fff3d3"],scene:["✦","#8053af","#eee5f8"],script:["▷","#8053af","#eee5f8"],weather:["☁","#007cad","#def2fc"],number:["±","#008577","#def3ed"],input_number:["±","#008577","#def3ed"],select:["≡","#5862af","#eaecfa"],input_select:["≡","#5862af","#eaecfa"],button:["↗","#5862af","#eaecfa"],input_button:["↗","#5862af","#eaecfa"],screen:["◷","#25282c","#e9ecf1"],sun:["☼","#c86620","#ffebdc"],timer:["⏱","#008577","#def3ed"],person:["☺","#2f7d32","#e1f2e2"],camera:["◧","#3d4a57","#e6ebf0"],image:["◧","#3d4a57","#e6ebf0"]};function Bt(e){const t=e.split(".")[0],n=qm[t];return n?[u(`editor.domains.${t}`),...n]:[u("editor.domains.entity"),"◇","#637184","#edf0f4"]}const Iu={clock:"clock-outline",analog:"clock-outline",date:"calendar"},ct=e=>JSON.stringify(e),Le=e=>String.fromCodePoint(parseInt(e,16));function Zo(e,t=new Date){let n=t.getHours();return e||(n=n%12||12),`${String(n).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}const Rl=(e=new Date,t="en")=>u("editor.mockup.date.top_bar",{weekday:u(`editor.mockup.date.weekdays_min.${e.getDay()}`,{},{locale:t}),day:e.getDate(),month:u(`editor.mockup.date.months_short.${e.getMonth()}`,{},{locale:t})},{locale:t});function Gm(e,t=Math.floor(Date.now()/1e3),n="en"){const s=t-e,o=Math.abs(s),i=c=>Math.floor(o/c),r=(c,d)=>d===void 0?u(`editor.mockup.time.${c}`,{},{locale:n}):u(`editor.mockup.time.${c}`,d,{locale:n});return s<0?o<3600?r("in_minutes",Math.max(1,i(60))):o<86400?r("in_hours",i(3600)):o<172800?r("tomorrow"):r("in_days",i(86400)):o<60?r("just_now"):o<3600?r("minutes_ago",i(60)):o<86400?r("hours_ago",i(3600)):o<172800?r("yesterday"):o<604800?r("days_ago",i(86400)):o<2592e3?r("weeks_ago",i(604800)):o<31536e3?r("months_ago",i(2592e3)):r("years_ago",i(31536e3))}const Jm={guition:{width:448,top:36,name:27,text:21,icon:26},cyd:{width:298,top:24,name:18,text:14,icon:18}};let ys;const Qi=new Map,Xm=()=>Qi.clear();function Vn(e,t){const n=`${t}|${e}`;let s=Qi.get(n);if(!s){if(ys===void 0&&(ys=document.createElement("canvas").getContext("2d")),ys){ys.font=t;const o=ys.measureText(e);s={left:-o.actualBoundingBoxLeft,right:o.actualBoundingBoxRight,top:-o.actualBoundingBoxAscent,bottom:o.actualBoundingBoxDescent,advance:o.width}}else{const o=Number(/(\d+(?:\.\d+)?)px/.exec(t)?.[1]||14),i=[...e].length*o*.55;s={left:0,right:i,top:-o*.72,bottom:o*.02,advance:i}}Qi.set(n,s)}return s}const zm=e=>({name:`500 ${e.name}px "Bar Roboto"`,text:`400 ${e.text}px "Bar Roboto"`,icon:`${e.icon}px "Tile Icons"`});function Qm(e){return{icon:Math.max(2,Math.floor((e*4+5)/10)),item:Math.max(6,Math.floor((e*125+50)/100)),name:Math.max(8,Math.floor((e*16+5)/10))}}function Ou(e,t,n,s){const o=zm(t),i=Vn("0",o.text),r=Math.round(i.bottom-i.top),c=Qm(r),d=Vn(String.fromCodePoint(983376),o.icon),h=Math.round(d.bottom-d.top),p=e.map((x,j)=>{const O=s(x),C={index:j,item:x,view:O,shown:O.shown,width:0};return O.analog?(C.dial=h,C.width=h,C):(O.icon&&(C.icon={glyph:Le(O.icon),ink:Vn(Le(O.icon),o.icon)},C.width+=C.icon.ink.right-C.icon.ink.left),O.text&&(C.text={value:O.text,ink:Vn(O.text,o.text)},C.width+=(C.icon?c.icon:0)+C.text.ink.right-C.text.ink.left),C)}),g=p.filter(x=>x.shown),v=Vn(n,o.name).advance,$=Math.min(v,Math.floor(t.width*35/100)),U=x=>x.reduce((j,O)=>j+O.width,0)+Math.max(0,x.length-1)*c.item;let A=0;for(;A<g.length&&U(g.slice(A))+c.name+$>t.width;)A++;const T=g.slice(A),k=new Set(g.slice(0,A).map(x=>x.index));let S=t.width-U(T);for(const x of T)x.x=S,S+=x.width+c.item;const F=T.length?T[0].x-c.name:t.width;return{metrics:t,fonts:o,cap:r,zero:i,gaps:c,parts:p,placed:T,dropped:k,nameText:n,natural:v,nameRoom:F}}function Zm(e,t,n){if(Vn(e,t).advance<=n)return e;const s=[...e];for(;s.length&&Vn(s.join("")+"...",t).advance>n;)s.pop();return s.join("")+"..."}function eg(e){"fonts"in document&&Promise.all([document.fonts.load('500 27px "Bar Roboto"',"Studio 0"),document.fonts.load('400 21px "Bar Roboto"',"Away 0"),document.fonts.load('26px "Tile Icons"',String.fromCodePoint(983376))]).then(()=>{Xm(),e()}).catch(()=>{})}let Nu="";function tg(e){Nu=e||""}async function Dl(e,t={}){const n=await fetch(`api/${e}`,{...t,headers:{"Content-Type":"application/json","X-Screen-CSRF":Nu,"X-ESP-Screens-Language":mu(),...t.headers}});if(!n.ok){let s=u("editor.api.failed");try{const o=(await n.json())?.error;typeof o=="string"&&o.trim()&&(s=o)}catch{}throw new Error(s)}return n}const Dt=async e=>(await Dl(e)).json(),ht=async(e,t,n,s={})=>{const i=await(await Dl(e,{method:t,body:n===void 0?void 0:JSON.stringify(n),...s})).text();return i?JSON.parse(i):null},m=Xn({inventory:{screens:[],entities:[]},connected:!1,reachable:!0,selected:null,layout:null,dirty:!1,busy:!1,saved:0,tab:"layout",selectedTile:null,inspector:null,iconPickerOpen:!1,actionPickerOpen:!1,actionSearch:"",insertAt:-1,filter:"",search:"",capabilities:{},entityActions:{},topbarPreviews:{},topbarAdded:null,topbarOverflow:[],settingEdits:{},settingPending:!1,updating:[],toast:null,now:Date.now(),fontsVersion:0,route:location.hash,overrideProfile:null,overrideFriendly:"",drag:{active:!1,moving:null,preview:null},menuOpen:!1,liveStates:{},room:"",hidePlaced:!1,palette:!1,firmwareJob:null}),wt=L(()=>m.inventory.screens.find(e=>e.id===m.selected)),fs=e=>(e&&"firmware_known"in e?e.firmware_known:e?.firmware)||"",Mu=L(()=>fs(wt.value)),Tn=(e,t,n)=>Hm(Mu.value,e,t,n),Gn=L(()=>{const e=wt.value?.tile_limit;return typeof e=="number"&&Number.isInteger(e)&&e>0?e:Wm(Mu.value)}),dr=L(()=>{const e=wt.value?.full_page;return typeof e=="boolean"?e:Tn(0,2,62)}),ng=L(()=>{const e=wt.value?.page_tiles_repeat;return typeof e=="boolean"?e:Tn(0,2,65)}),ei=e=>ng.value&&gs(e)>0,Fl=L(()=>wt.value?.board==="guition"),Ru=L(()=>Jm[Fl.value?"guition":"cyd"]),bi=L(()=>m.selectedTile&&m.layout?.tiles.includes(m.selectedTile)?m.selectedTile:void 0),Ul=e=>!!m.selectedTile&&Se(m.selectedTile)===Se(e);let fr=0;function Ce(e,t){m.toast={message:e,action:t},clearTimeout(fr),fr=window.setTimeout(()=>m.toast=null,t?8e3:5e3)}function sg(){m.toast=null}async function Ot(e,t,n="api_key"){try{if(!navigator.clipboard||!window.isSecureContext)throw new Error;await navigator.clipboard.writeText(e),Ce(u(`editor.copy.${n}.copied`))}catch{if(t){const s=document.createRange();s.selectNodeContents(t);const o=window.getSelection();o?.removeAllRanges(),o?.addRange(s)}Ce(u(document.execCommand("copy")?`editor.copy.${n}.copied`:`editor.copy.${n}.selected`))}}function Lo(){const e="/config/integrations/dashboard";try{window.top.location.assign(e)}catch{window.open(e,"_blank")}}const og=["","#settings","#new-screen","#firmware","#alerts","#override"],St=L(()=>og.includes(m.route)?m.route:"");function We(e){if(location.hash===e){m.route=e;return}location.hash=e}window.addEventListener("hashchange",()=>{m.route=location.hash,window.scrollTo(0,0)});function Qs(e){return m.inventory.entities.find(t=>t.id===e)?.name||m.inventory.builtin?.find(t=>t.id===e)?.name||e}let wi={source:null,byName:{}};function Zs(e){return wi.source!==m.inventory.icons&&(wi={source:m.inventory.icons,byName:Object.fromEntries((m.inventory.icons?.groups||[]).flatMap(t=>t.icons.map(n=>[n.name,n])))}),e?wi.byName[e]:void 0}function In(e){const t=m.inventory.icons;if(!t)return"F0335";const n=m.inventory.entities.find(o=>o.id===e),s=e.split(".")[0];return t.builtin?.[e]?t.builtin[e]:n?.icon?n.icon:s==="weather"?t.weather[n?.state||""]||t.weather.partlycloudy:s==="sun"?t.sun[n?.state||""]||t.sun.below_horizon:t.defaults[s]||t.fallback}const $s=e=>Zs(e.options?.icon)?.cp||In(e.entity),ki=new Set;async function ti(e){const t=[...new Set(e)].filter(n=>!ki.has(n)&&!n.startsWith("screen."));if(t.length){t.forEach(n=>ki.add(n));try{for(let n=0;n<t.length;n+=40){const s=t.slice(n,n+40).map(o=>`entity=${encodeURIComponent(o)}`).join("&");Object.assign(m.capabilities,(await Dt(`capabilities?${s}`)).capabilities||{})}}catch{t.forEach(n=>ki.delete(n))}}}const $i=new Set;async function ig(e){if(!$i.has(e)){$i.add(e);try{m.entityActions[e]=(await Dt(`entity-actions?entity=${encodeURIComponent(e)}`)).actions}catch{$i.delete(e)}}}let Si=!1;async function ni(){const e=[...new Set((m.layout?.tiles||[]).map(t=>t.entity).filter(t=>!t.startsWith("screen.")))];if(!(!e.length||Si)){Si=!0;try{for(let t=0;t<e.length;t+=60){const n=e.slice(t,t+60).map(s=>`entity=${encodeURIComponent(s)}`).join("&");Object.assign(m.liveStates,(await Dt(`states?${n}`)).states||{})}}catch{}finally{Si=!1}}}function lg(e){const t=m.liveStates[e];if(t)return t;const n=m.inventory.entities.find(s=>s.id===e);return n?.state?{state:n.state,word:null,a:{}}:null}let Zi=0;function mt(){m.dirty=!0,m.saved=0,Zi++}function Du(e){if(e===m.selected&&m.layout&&m.dirty){tt(),m.tab="layout",m.menuOpen=!1,We("");return}if(e!==m.selected&&m.dirty&&!confirm(u("editor.screen_view.confirm.switch")))return;e!==m.selected&&(Bs(),m.settingEdits={}),m.selected=e,m.selectedTile=null,m.inspector=null,m.tab="layout",m.menuOpen=!1;const t=m.inventory.screens.find(s=>s.id===e);if(!t){m.layout=null;return}const n=JSON.parse(JSON.stringify(t.layout));Qo(n),n.pages=It(et(n),n.pages),m.layout=n,m.insertAt=-1,m.dirty=!1,m.saved=0,si(0),ti(n.tiles.map(s=>s.entity)),ni(),We("")}const ag=()=>m.layout?et(m.layout):[];function rg(e){const t=m.layout,n=t.tiles.map(o=>`${o.entity}@${o.slot}`).join();for(const{tile:o,slot:i}of e)o.slot=i,t.tiles.includes(o)||t.tiles.push(o);Qo(t),t.pages=It(et(t),t.pages);const s=t.tiles.map(o=>`${o.entity}@${o.slot}`).join()!==n;return s&&mt(),s}function eo(e,t){if(!m.layout)return!1;ti([e.entity]);const n=Tu(m.layout.tiles,e,t),s=n?rg(n):!1;return s&&!m.liveStates[e.entity]&&ni(),s}function Fu(e){const t=m.layout;if(!t||!ei(e)&&t.tiles.some(o=>o.entity===e)||t.tiles.length>=Gn.value)return;const n=Au(e),s=m.insertAt>=0?m.insertAt:Po(ls(et(t)),ft(n));m.insertAt=-1,s>=0&&eo(n,s)&&el(n)}function Uu(e){const t=m.layout;if(!t)return;const n=t.tiles.indexOf(e);n<0||(t.tiles.splice(n,1),Ul(e)&&tt(),mt(),t.pages=It(et(t),t.pages),Ce(u("editor.layout.removed",{name:e.name||Qs(e.entity)}),{label:u("editor.common.undo"),run:()=>eo(e,e.slot)}))}function pr(){const e=m.layout;e&&(e.pages=Math.min(mn,It(et(e),e.pages)+1),mt())}function cg(e){const t=m.layout;if(t){for(const n of t.tiles)At(n.slot)>e&&(n.slot-=Je);t.pages=Math.max(1,It(et(t),t.pages)-1),mt()}}function ug(e,t){const n=m.layout;if(!n||!Number.isInteger(t)||t<0||t>=mn||t===At(e.slot))return!1;const s=Po(ls(et(n).filter(i=>i.tile!==e)),ft(e),t*Je),o=eo(e,s>=0&&At(s)===t?s:t*Je);return o||Ce(u("editor.layout.no_room",{page:t+1})),o}function dg(){const e=m.layout;if(!e)return 1;const t=m.drag.preview||et(e),n=It(t,e.pages);return m.drag.active&&n<mn?n+1:n}function wn(e,t,n){const s=e.entity.split(".")[0],o=m.capabilities[e.entity],i=Xi(e),r=ft(e);e.options={...e.options,[t]:n},t==="display"&&n==="watch"&&(e.options.inline="none",m.inventory.controls?.[s]&&(e.options.controls="none")),t==="display"&&["forecast","sunpath"].includes(n)&&(e.options.size="wide"),t==="inline"&&n==="slider"&&(e.options.display="standard",m.inventory.controls?.[s]&&(e.options.controls="none")),t==="controls"&&n!=="none"&&(e.options.display="standard",e.options.inline="none");const c=m.inventory.controls?.[s];t==="size"&&n==="wide"&&o&&c&&!("controls"in e.options)&&!o.controls.includes(c.default)&&(e.options.controls=c.choices.find(h=>h.key!=="none"&&o.controls.includes(h.key))?.key||"none"),mt();const d=m.layout;if(d){if($u(e)&&r!=="full"){const h=At(e.slot),p=d.tiles.filter($=>$!==e&&At($.slot)===h),g=ls(et(d).filter($=>$.tile!==e&&!p.includes($.tile))),v=[];for(const $ of p){const U=Po(g,ft($),(h+1)*Je);if(U<0){v.length=0;break}v.push([$,U]);for(const A of qn(U,ft($)))g.add(A)}if(v.length===p.length){for(const[$,U]of v)$.slot=U;e.slot=h*Je}else{const $=Po(ls(et(d).filter(U=>U.tile!==e)),"full");$>=0?e.slot=$:(e.options.size=r,Ce(u("editor.layout.no_free_page")))}}else if(Xi(e)&&!i){const h=ls(et(d).filter(v=>v.tile!==e)),p=xu(e.slot),g=Vs(h,p,"wide")?p:Eu(h,"wide",p);g>=0&&(e.slot=g)}Qo(d),d.pages=It(et(d),d.pages)}}function fg(e,t){const n=`screen.page_${t}`,s=m.layout;return!s||n===e.entity||!gs(n)?!1:!ei(n)&&s.tiles.some(o=>o.entity===n)?(Ce(u("editor.layout.page_taken",{page:t})),!1):(e.entity=n,s.pages=Math.max(It(et(s),s.pages),t),mt(),!0)}function el(e){Ul(e)||(m.iconPickerOpen=!1,m.actionPickerOpen=!1,m.actionSearch=""),m.selectedTile=e,m.inspector={kind:"tile"},ti([e.entity])}function nn(e){m.inspector?.kind==="bar"&&m.inspector.index===e||(m.iconPickerOpen=!1),m.selectedTile=null,m.inspector={kind:"bar",index:e}}function hr(){m.selectedTile=null,m.inspector={kind:"bar-add"}}function tt(){m.inspector=null,m.selectedTile=null}async function tl(){if(m.busy||!m.layout||!m.selected)return;m.busy=!0;const e=Zi,t=m.selected;try{const{settings:n,...s}=m.layout;if(await ht(`screens/${encodeURIComponent(m.selected)}`,"PUT",s),m.selected!==t){const o=m.inventory.screens.find(i=>i.id===t)?.name;Ce(o?u("editor.screen_view.saved.other",{name:o}):u("editor.screen_view.saved.other_unnamed"))}else Zi===e?(m.dirty=!1,m.saved=Date.now(),Ce(u("editor.screen_view.saved.current"))):Ce(u("editor.screen_view.saved.newer_edit"));await On()}catch(n){Ce(n.message)}finally{m.busy=!1}}const Jn=e=>!!(e&&e.alert_action&&gn(fs(e),m.inventory.alerts?.min_firmware||"0.2.31"));async function ju(e){try{await ht(`screens/${encodeURIComponent(e.id)}/identify`,"POST"),Ce(u("editor.screen_view.identified",{name:e.name}))}catch(t){Ce(t.message)}}async function pg(e,t){return await ht("alerts/test","POST",{screen:e,data:t})}const hg=["title","tiles","header","pages"];function Hu(e,t){const n=m.layout;if(!n)return;const s=(Array.isArray(e.tiles)?e.tiles:[]).filter(c=>!!(c&&typeof c=="object"&&typeof c.entity=="string"&&c.entity.includes("."))).map(c=>({entity:c.entity,name:typeof c.name=="string"?c.name:"",slot:Number.isInteger(c.slot)?c.slot:-1,...c.options&&typeof c.options=="object"?{options:{...c.options}}:{}})),o=new Set,i=s.filter(c=>ei(c.entity)||!o.has(c.entity)&&o.add(c.entity)),r=i.slice(0,Gn.value);n.tiles=r,e.header&&Array.isArray(e.header.items)?n.header={items:e.header.items.map(c=>({...c}))}:delete n.header,n.pages=Number.isInteger(e.pages)?e.pages:1,Qo(n),n.pages=It(et(n),n.pages),tt(),mt(),ti(r.map(c=>c.entity)),ni(),si(0),Ce(t(r.length<i.length?{kept:r.length,total:i.length}:void 0))}function mg(e){const t=m.inventory.screens.find(n=>n.id===e);!t||!m.layout||Hu(JSON.parse(JSON.stringify(t.layout)),n=>n?u("editor.layout.copied_part",{name:t.name,...n}):u("editor.layout.copied",{name:t.name}))}function gg(){const e=m.layout;if(!e)return"";const t={esp_screens_layout:1};for(const n of hg)e[n]!==void 0&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Vu(){const e=gg();if(!e)return;const t=`${(wt.value?.name||"screen").toLowerCase().replace(/[^a-z0-9]+/g,"-")}.layout.json`,n=URL.createObjectURL(new Blob([e],{type:"application/json"})),s=document.createElement("a");s.href=n,s.download=t,s.click(),setTimeout(()=>URL.revokeObjectURL(n),5e3),Ot(e,void 0,"layout_json")}function vg(e){let t;try{t=JSON.parse(e)}catch{Ce(u("editor.layout.not_json"));return}if(!t||typeof t!="object"||!Array.isArray(t.tiles)){Ce(u("editor.layout.no_tiles_in_file"));return}Hu(t,n=>n?u("editor.layout.imported_part",n):u("editor.layout.imported"))}function _g(e){const t=m.inventory.updates?.target,n=m.inventory.changelog;if(!Array.isArray(n)||!t)return[];const s=fs(e),o=[];for(const i of n)if(!(gn(i.firmware,t)&&i.firmware!==t)&&!(s&&gn(s,i.firmware)))for(const r of i.lines)o.includes(r)||o.push(r);return o}let xi=!1;async function yg(){if(!xi){xi=!0;try{const e=await Dt("firmware");m.firmwareJob={job:e.job,logs:e.logs||[]}}catch{}finally{xi=!1}}}const nl=()=>m.inventory.screens.some(e=>e.update?.state==="running")||m.updating.length>0;function ns(e){const t=e.update||{};if(!(t.state==="running"||m.updating.includes(e.id)))return null;const n=m.firmwareJob?.job?.stage;return t.phase==="verify"?{percent:78,text:xs("verify")}:t.phase==="settle"?{percent:92,text:xs("settle")}:t.phase==="install"||!t.phase?n==="upload"?{percent:66,text:u("editor.update.writing")}:n?{percent:40,text:u("editor.update.building")}:{percent:12,text:xs("install")}:{percent:12,text:xs(t.phase)}}const vn=()=>m.layout?.header?.items??(m.layout?.settings?.show_clock??!0?[{type:"clock"}]:[]),Sn=()=>m.inventory.header?.max_items||6;function Ws(e){m.layout&&(m.layout.header={items:e},mt(),si())}let mr=0;function si(e=150){clearTimeout(mr),mr=window.setTimeout(async()=>{const t=vn();if(t.some(n=>n.type==="entity"))try{const n=await ht("header-preview","POST",{header:{items:t}});t.forEach((s,o)=>m.topbarPreviews[ct(s)]=n.items[o])}catch{}},e)}function Ss(e){return e.type==="entity"?Qs(e.entity):m.inventory.header?.builtin.find(t=>t.type===e.type)?.label||e.type}function kn(e){const t=new Date(m.now);if(e.type==="clock")return{text:Zo(hs.value,t),shown:!0};if(e.type==="date")return{text:Rl(t,ps.value),shown:!0};if(e.type==="analog")return{analog:!0,shown:!0};const n=m.topbarPreviews[ct(e)];return n?{icon:n.i||null,text:n.k==="ago"?Gm(n.e,Math.floor(m.now/1e3),ps.value):n.t,color:n.c?`#${n.c}`:null,shown:n.shown}:{icon:e.icon==="none"?null:Zs(e.icon)?.cp||In(e.entity),text:"…",shown:!0,loading:!0}}function Ci(e,t){const n=[...vn()];return t<0||t>=n.length||e===t?!1:(n.splice(t,0,...n.splice(e,1)),Ws(n),!0)}function gr(e){const t=[...vn()],[n]=t.splice(e,1);n&&(m.inspector?.kind==="bar"&&tt(),Ws(t),Ce(u("editor.topbar.removed",{name:Ss(n)}),{label:u("editor.common.undo"),run:()=>{const s=[...vn()];s.splice(Math.min(e,s.length),0,n),Ws(s)}}))}function Ei(e){const t=vn();if(t.length>=Sn())return Ce(u("editor.topbar.full",Sn()));if(t.some(n=>ct(n)===ct(e)))return Ce(u("editor.topbar.already"));m.topbarAdded={key:ct(e),time:Date.now()},Ws([...t,e]),nn(t.length)}const bg=[{group:"brightness",icon:"F0599",rows:[{key:"brightness",kind:"number",min:5,max:100,step:5,unit:"%"},{key:"dark_mode",kind:"toggle"},{key:"standby_enabled",kind:"toggle"},{key:"standby_seconds",kind:"duration",min:60,max:86400,needs:"standby_enabled"},{key:"standby_brightness",kind:"number",min:0,max:100,step:5,unit:"%",needs:"standby_enabled",cap:"brightness"}]},{group:"night",icon:"F0594",rows:[{key:"night_enabled",kind:"toggle"},{key:"night_start",kind:"moment",needs:"night_enabled"},{key:"night_end",kind:"moment",needs:"night_enabled"},{key:"night_brightness",kind:"number",min:0,max:100,step:5,unit:"%",needs:"night_enabled",cap:"brightness"}]},{group:"screen",icon:"F0379",rows:[{key:"auto_home",kind:"toggle"},{key:"auto_home_seconds",kind:"duration",min:30,max:3600,needs:"auto_home"},{key:"home_on_standby",kind:"toggle"},{key:"swipe_pages",kind:"toggle"},{key:"page_buttons",kind:"toggle"},{key:"rotation",kind:"choice",options:[0,90,180,270]}]}],Ti=e=>u(`editor.screen_settings.rows.${e.key}`),wg=(e,t)=>`${t}°`;function Wu(e=ag(),t=m.layout?It(e,m.layout.pages):1){const n=Oo();if(t<2||n.page_buttons!==!1||n.swipe_pages!==!1)return"";const{tiles:s,targets:o,unreachable:i,noWayBack:r}=Fm(e,t);if(!i.length&&!r.length)return"";const c=v=>u("editor.screen_settings.reach.pages",{list:Rm(v)},v.length),d=i.filter(v=>!o.includes(v)),h=i.filter(v=>o.includes(v)),p=d.length===1?"one":"more",g=[u("editor.screen_settings.reach.intro")];return s&&d.length?g.push(u(`editor.screen_settings.reach.tiles_missing_${p}`,{targets:c(o),missing:c(d)},s)):s?g.push(u("editor.screen_settings.reach.tiles",{targets:c(o)},s)):d.length?g.push(u(`editor.screen_settings.reach.none_missing_${p}`,{missing:c(d)})):g.push(u("editor.screen_settings.reach.none")),h.length&&g.push(u("editor.screen_settings.reach.cut_off",{pages:c(h)})),r.length&&g.push(u("editor.screen_settings.reach.no_way_back",{pages:c(r)})),g.join(" ")}const Bu=4e3;let xn={},as=null,Io=0,mo=null;const jl=()=>wt.value?.settings;function Oo(){const e=jl(),t={...e?.values||{}};for(const[n,s]of Object.entries(m.settingEdits))t[n]=s.value;return t}const kg=e=>e<300?30:e<900?60:e<3600?300:e<7200?900:1800;function vr(e,t,n,s,o){if(e.kind==="moment"){let c=s&&t%60?Math.floor(t/60)*60+(n>0?60:0):t+n*(s?60:15);return c%=1440,c<0?c+1440:c}const i=e.kind==="duration"?kg(n<0?t-1:t):e.step,r=e.cap?Math.min(e.max,o[e.cap]):e.max;return Math.min(r,Math.max(e.min,t+n*i))}function $g(e){if(e<60)return u("editor.screen_settings.duration.seconds",{n:e});if(e<3600)return u("editor.screen_settings.duration.minutes",{n:Math.floor(e/60)});const t=Math.floor(e/3600),n=Math.floor(e%3600/60);return n?u("editor.screen_settings.duration.hours_minutes",{h:t,m:String(n).padStart(2,"0")}):u("editor.screen_settings.duration.hours",{n:t})}function Sg(e,t){const n=Math.floor(e/60),s=String(e%60).padStart(2,"0");return t?`${String(n).padStart(2,"0")}:${s}`:u(n<12?"editor.screen_settings.time.am":"editor.screen_settings.time.pm",{time:`${n%12||12}:${s}`})}function xg(e,t){const n=t[e.key];return n==null?"—":e.kind==="number"?`${n}${e.unit||""}`:e.kind==="duration"?$g(n):e.kind==="moment"?Sg(n,hs.value):""}function uo(e,t,n){if(as&&as!==m.selected&&Object.keys(xn).length){Bs(),Ce(u("editor.screen_settings.other_screen_busy"));return}as=m.selected;const s=Oo();if(m.settingEdits[e]={value:t,at:Date.now()},xn[e]=t,e==="brightness")for(const o of["standby_brightness","night_brightness"])s[o]>t&&(m.settingEdits[o]={value:t,at:Date.now()});m.settingPending=!0,clearTimeout(Io),Io=window.setTimeout(()=>Bs(),n)}async function Bs(e=!1){if(clearTimeout(Io),mo||!Object.keys(xn).length||!as)return;const t=as,n=xn;xn={};const s=Dl(`screens/${encodeURIComponent(t)}/settings`,{method:"PUT",body:JSON.stringify({settings:n}),keepalive:e});mo=s;try{const o=await(await s).json(),i=m.inventory.screens.find(r=>r.id===t);i&&(i.settings=o)}catch(o){if(Ce(o.message),t===m.selected)for(const i of Object.keys(n))delete m.settingEdits[i];if(t===m.selected&&n.brightness!==void 0)for(const i of["standby_brightness","night_brightness"])delete m.settingEdits[i]}finally{mo=null,Object.keys(xn).length?Io=window.setTimeout(()=>Bs(),150):as=null,m.settingPending=!!Object.keys(xn).length,t===m.selected&&No(),setTimeout(()=>{t===m.selected&&No()},Bu+100)}}function No(){const e=jl();for(const[t,n]of Object.entries(m.settingEdits))xn[t]!==void 0||mo||(e&&e.values[t]===n.value||Date.now()-n.at>Bu)&&delete m.settingEdits[t]}const xs=e=>["install","verify","settle"].includes(e||"")?u(`editor.update.phases.${e}`):u("editor.update.starting");async function sl(e,t){m.updating.push(e.id);try{await ht(`screens/${encodeURIComponent(e.id)}/update`,"POST",t?{host:t}:{}),await On()}catch(n){m.updating=m.updating.filter(s=>s!==e.id),Ce(n.message)}}async function _r(){try{await ht("updates/run","POST"),await On()}catch(e){Ce(e.message)}}async function Cg(e){try{await ht("updates","PUT",{auto:e}),m.inventory.updates&&(m.inventory.updates.auto=e),Ce(u(e?"editor.settings.updates.auto_on":"editor.settings.updates.auto_off"))}catch(t){Ce(t.message)}}async function Eg(){try{m.inventory.claude_skill=await ht("claude-skill","POST"),Ce(u(m.inventory.claude_skill?.restart?"editor.settings.claude.installed_restart":"editor.settings.claude.installed"))}catch(e){Ce(e.message)}}const ps=L(()=>vu(m.inventory.language?.effective));Et(ps,e=>bu(e),{immediate:!0});const sn=(e,t={})=>u(e,t,{locale:ps.value}),Tg=e=>m.inventory.language?.languages?.find(t=>t.code===e)?.name||Lm(e||"")?.name||e||"",Ku=e=>!!(e.update?.available||e.update?.language),yr=()=>u("editor.update.new_language",{name:Tg(m.inventory.language?.effective)}),hs=L(()=>m.inventory.language?.clock_effective!=="12"),Ag=L(()=>m.inventory.language?.numbers_effective||"point");async function br(e){try{const t=await ht("language","PUT",e);return t?.language&&(m.inventory.language=t.language),Ce(u(e.setting===void 0?"editor.settings.language.saved":"editor.settings.language.saved_language")),await On(),!0}catch(t){return Ce(t.message),!1}}async function On(e=!0){try{const t=await Dt(e?"inventory":"inventory?light=1");m.inventory=e?t:{...m.inventory,...t},t.csrf&&tg(t.csrf),m.connected=!!m.inventory.connected,m.reachable=!0;for(const n of m.inventory.screens)n.update?.state==="running"&&(m.updating=m.updating.filter(s=>s!==n.id));m.selected&&No()}catch{m.reachable=!1}}function Pg(e){m.inventory={...m.inventory,...e},m.connected=!!m.inventory.connected;for(const t of m.inventory.screens)t.update?.state==="running"&&(m.updating=m.updating.filter(n=>n!==t.id));m.selected&&No()}let wr=0,ol=Date.now(),Mo=!1,bs=null;function Lg(){bs||typeof EventSource>"u"||(bs=new EventSource("api/events"),bs.onopen=()=>{Mo=!0,Ks()},bs.onmessage=e=>{document.hidden||Pg(JSON.parse(e.data))},bs.onerror=()=>{Mo=!1,Ks()})}function Ks(){clearTimeout(wr);const e=Mo?6e4:m.inventory.updates?.busy?3e3:1e4;wr=window.setTimeout(async()=>{if(!document.hidden){const t=Date.now()-ol>=3e5;t&&(ol=Date.now()),(t||!Mo)&&await On(t)}Ks()},e)}let kr=!1;function Ig(){kr||(kr=!0,On(),Lg(),Ks(),eg(()=>m.fontsVersion++),setInterval(()=>{!m.layout||document.hidden||m.drag.active||(m.now=Date.now(),si(0))},3e4),setInterval(()=>{!document.hidden&&m.layout&&m.tab==="layout"&&St.value===""&&ni()},8e3),setInterval(()=>{!document.hidden&&nl()?yg():m.firmwareJob&&!nl()&&(m.firmwareJob=null)},3e3),document.addEventListener("visibilitychange",async()=>{document.hidden||(ol=Date.now(),m.now=Date.now(),await On(),Ks())}),window.addEventListener("pagehide",()=>Bs(!0)),window.addEventListener("beforeunload",e=>{m.dirty&&(e.preventDefault(),e.returnValue="")}))}const Og={class:"side"},Ng={class:"label"},Mg={id:"screens"},Rg=["aria-current","onClick"],Dg={class:"txt"},Fg=["aria-label","title"],Ug={key:1,class:"pill"},jg={key:2,class:"spin small"},Hg=["onSubmit"],Vg=["placeholder","aria-label"],Wg={type:"submit",class:"btn mini primary"},Bg=["aria-label"],Kg=["disabled","title","onClick"],Yg={key:2,class:"whatsnew"},qg=["aria-valuenow"],Gg={class:"progress-text"},Jg=["title"],Xg=["title"],zg={id:"pending"},Qg={class:"pending-actions"},Zg=["onClick"],ev=["aria-current"],tv={class:"txt"},nv={class:"more"},sv={class:"label"},ov=["aria-current"],iv={class:"mdi"},lv={class:"txt"},av=["aria-current"],rv={class:"mdi"},cv={class:"txt"},uv=["aria-current"],dv={class:"mdi"},fv={class:"txt"},pv={class:"txt"},hv=Me({__name:"Sidebar",setup(e){const t=ke(null),n=ke(""),s=p=>{const g=p.update||{};return!!g.language&&(!g.target||gn(fs(p),g.target))};function o(p){const g=p.update||{};return g.state==="running"||m.updating.includes(p.id)?{kind:"running",text:xs(g.phase)}:g.state==="queued"?{kind:"queued",text:u("editor.sidebar.update.queued")}:Ku(p)&&p.online?{kind:"available",text:s(p)?yr():u("editor.sidebar.update.available",{version:g.target})}:g.result&&Date.now()/1e3-g.result.time<86400?{kind:g.result.state==="failed"?"failed":"done",text:g.result.message}:null}const i=p=>[...p.update?.language&&!s(p)?[yr()]:[],..._g(p)];function r(p){const g=p.update||{};g.host&&g.profile?sl(p):g.profile&&(t.value=p.id,n.value="")}function c(p){const g=n.value.trim();g&&(t.value=null,sl(p,g))}const d=()=>{const p=m.firmwareJob?.logs||[];return p.length?p[p.length-1]:""},h=p=>p.installed?u("editor.sidebar.pending.installed"):p.downloaded?u("editor.sidebar.pending.downloaded"):u("editor.sidebar.pending.not_flashed",{file:p.file});return(p,g)=>(_(),b("aside",Og,[g[13]||(g[13]=l("div",{class:"brand"},[l("span",{class:"mark"},"▦"),l("span",null,"ESP Screens")],-1)),l("span",{id:"connection",class:ve(["conn",{online:a(m).connected}]),role:"status"},f(a(m).reachable?a(m).connected?a(u)("editor.sidebar.connection.connected"):a(u)("editor.sidebar.connection.reconnecting"):a(u)("editor.sidebar.connection.unreachable")),3),l("button",{type:"button",class:"search-btn",id:"open-palette",onClick:g[0]||(g[0]=v=>a(m).palette=!0)},[Re("⌕ "+f(a(u)("editor.sidebar.search")),1),g[10]||(g[10]=l("kbd",null,"⌘K",-1))]),l("div",Ng,f(a(u)("editor.sidebar.screens")),1),l("div",Mg,[(_(!0),b(J,null,ge(a(m).inventory.screens,v=>(_(),b("div",{key:v.id,class:ve(["screen-item",{selected:v.id===a(m).selected&&a(St)===""}])},[l("button",{type:"button",class:"nav-item","aria-current":v.id===a(m).selected&&a(St)===""?"true":"false",onClick:$=>a(Du)(v.id)},[l("span",{class:ve(["dot",{off:!v.online}])},null,2),l("span",Dg,[l("span",null,f(v.name),1),l("small",null,f(v.online?a(u)("editor.common.online"):a(u)("editor.common.offline"))+f(v.area?" · "+v.area:"")+" · "+f(v.firmware||a(u)("editor.common.unknown")),1)]),v.id===a(m).selected&&a(m).dirty?(_(),b("span",{key:0,class:"unsaved",role:"img","aria-label":a(u)("editor.common.unsaved"),title:a(u)("editor.common.unsaved")},null,8,Fg)):G("",!0),o(v)?.kind==="available"?(_(),b("span",Ug,f(a(u)("editor.sidebar.update.pill")),1)):o(v)?.kind==="running"?(_(),b("span",jg)):G("",!0)],8,Rg),o(v)?(_(),b("div",{key:0,class:ve(["screen-update",o(v).kind])},[o(v).kind==="available"?(_(),b(J,{key:0},[t.value===v.id?(_(),b(J,{key:0},[l("small",null,f(a(u)("editor.sidebar.host.hint")),1),l("form",{class:"screen-host",onSubmit:Lt($=>c(v),["prevent"])},[Pe(l("input",{"onUpdate:modelValue":g[1]||(g[1]=$=>n.value=$),placeholder:a(u)("editor.sidebar.host.placeholder"),required:"",pattern:"[A-Za-z0-9][A-Za-z0-9.\\-]*","aria-label":a(u)("editor.sidebar.host.label"),autofocus:""},null,8,Vg),[[Qe,n.value]]),l("button",Wg,f(a(u)("editor.sidebar.host.start")),1),l("button",{type:"button",class:"icon-btn","aria-label":a(u)("editor.common.cancel"),onClick:g[2]||(g[2]=$=>t.value=null)},"✕",8,Bg)],40,Hg)],64)):(_(),b(J,{key:1},[l("small",null,f(o(v).text),1),l("button",{type:"button",class:"btn mini primary",disabled:!v.update?.profile,title:v.update?.profile?"":a(u)("editor.sidebar.update.no_profile"),onClick:$=>r(v)},f(a(u)("editor.sidebar.update.button")),9,Kg)],64)),i(v).length?(_(),b("details",Yg,[l("summary",null,f(a(u)("editor.sidebar.update.whats_new")),1),l("ul",null,[(_(!0),b(J,null,ge(i(v).slice(0,8),$=>(_(),b("li",{key:$},f($),1))),128))])])):G("",!0)],64)):o(v).kind==="running"&&a(ns)(v)?(_(),b(J,{key:1},[l("div",{class:"progress",role:"progressbar","aria-valuenow":a(ns)(v).percent,"aria-valuemin":"0","aria-valuemax":"100"},[l("i",{style:He({width:a(ns)(v).percent+"%"})},null,4)],8,qg),l("div",Gg,[l("span",null,f(a(ns)(v).percent)+" %",1),l("span",{title:d()},f(a(ns)(v).text),9,Jg)]),d()?(_(),b("small",{key:0,title:d(),style:{"white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}},f(d()),9,Xg)):G("",!0),l("button",{type:"button",class:"btn link mini",style:{"justify-self":"start"},onClick:g[3]||(g[3]=$=>a(We)("#firmware"))},f(a(u)("editor.sidebar.update.full_log")),1)],64)):(_(),b("small",{key:2,class:ve({failed:o(v).kind==="failed"})},f(o(v).text),3))],2)):G("",!0)],2))),128))]),l("div",zg,[(_(!0),b(J,null,ge(a(m).inventory.pending||[],v=>(_(),b("div",{key:v.file,class:"pending"},[l("strong",null,f(v.friendly),1),l("small",null,f(h(v)),1),l("div",Qg,[l("button",{type:"button",class:"btn mini quiet",onClick:g[4]||(g[4]=(...$)=>a(Lo)&&a(Lo)(...$))},f(a(u)("editor.common.open_integrations")),1),v.api_key?(_(),b("button",{key:0,type:"button",class:"btn mini quiet",onClick:$=>a(Ot)(v.api_key)},f(a(u)("editor.sidebar.copy_api_key")),9,Zg)):G("",!0)])]))),128))]),l("button",{id:"new-screen",type:"button",class:"nav-item ghost","aria-current":a(St)==="#new-screen"?"true":"false",onClick:g[5]||(g[5]=v=>a(We)("#new-screen"))},[g[11]||(g[11]=l("span",{class:"plus"},"+",-1)),l("span",tv,f(a(u)("editor.nav.new_screen")),1)],8,ev),g[14]||(g[14]=l("div",{class:"spacer"},null,-1)),l("div",nv,[l("div",sv,f(a(u)("editor.sidebar.more")),1),l("button",{id:"open-firmware",type:"button",class:"nav-item","aria-current":a(St)==="#firmware"?"true":"false",onClick:g[6]||(g[6]=v=>a(We)("#firmware"))},[l("span",iv,f(a(Le)("F0241")),1),l("span",lv,f(a(u)("editor.nav.firmware")),1)],8,ov),l("button",{id:"open-alerts",type:"button",class:"nav-item","aria-current":a(St)==="#alerts"?"true":"false",onClick:g[7]||(g[7]=v=>a(We)("#alerts"))},[l("span",rv,f(a(Le)("F0594")),1),l("span",cv,f(a(u)("editor.nav.alerts")),1)],8,av),l("button",{id:"open-settings",type:"button",class:"nav-item","aria-current":a(St)==="#settings"?"true":"false",onClick:g[8]||(g[8]=v=>a(We)("#settings"))},[l("span",dv,f(a(Le)("F0493")),1),l("span",fv,f(a(u)("editor.nav.settings")),1)],8,uv),l("button",{id:"refresh",type:"button",class:"nav-item ghost",onClick:g[9]||(g[9]=v=>a(On)())},[g[12]||(g[12]=l("span",{class:"plus"},"↻",-1)),l("span",pv,f(a(u)("editor.sidebar.refresh")),1)])])]))}}),mv={key:0,id:"toast",class:"toast",role:"status"},gv=Me({__name:"Toast",setup(e){return(t,n)=>a(m).toast?(_(),b("div",mv,[l("span",null,f(a(m).toast.message),1),a(m).toast.action?(_(),b("button",{key:0,type:"button",onClick:n[0]||(n[0]=s=>{a(m).toast.action.run(),a(sg)()})},f(a(m).toast.action.label),1)):G("",!0)])):G("",!0)}}),vv=["aria-label"],_v=["placeholder","aria-label"],yv={class:"palette-list"},bv={class:"palette-group"},wv=["onMouseenter","onClick"],kv={key:0,class:"mdi"},$v={key:1,class:"glyph"},Sv={class:"tx"},xv={key:0},Cv={key:2,class:"hint-key"},Ev={key:0,class:"palette-empty"},Tv=Me({__name:"CommandPalette",setup(e){const t=ke(""),n=ke(0),s=ke(null),o=L(()=>{const h=t.value.trim().toLocaleLowerCase(),p=[],g=u("editor.palette.groups.screens"),v=u("editor.palette.groups.actions");for(const A of m.inventory.screens)p.push({group:g,label:A.name,detail:`${A.online?u("editor.common.online"):u("editor.common.offline")} · ${A.firmware||u("editor.common.unknown")}`,glyphText:"▦",run:()=>Du(A.id)});const $=wt.value,U=[{group:v,label:u("editor.nav.new_screen"),detail:u("editor.nav.new_screen_detail"),glyphText:"+",run:()=>We("#new-screen")},{group:v,label:u("editor.nav.firmware"),icon:"F0241",run:()=>We("#firmware")},{group:v,label:u("editor.nav.alerts"),detail:u("editor.palette.alerts_detail"),icon:"F0594",run:()=>We("#alerts")},{group:v,label:u("editor.nav.settings"),detail:u("editor.palette.settings_detail"),icon:"F0493",run:()=>We("#settings")}];if($&&m.layout&&U.unshift({group:v,label:u("editor.common.save_send"),detail:m.dirty?u("editor.common.unsaved"):u("editor.palette.nothing_to_save"),key:"⌘S",run:()=>tl()},{group:v,label:u("editor.screen_view.tabs.layout"),detail:$.name,run:()=>{We(""),m.tab="layout"}},{group:v,label:u("editor.screen_view.tabs.settings"),detail:$.name,run:()=>{We(""),m.tab="settings"}},{group:v,label:u("editor.palette.identify"),detail:Jn($)?u("editor.palette.identify_detail"):u("editor.palette.identify_needs"),run:()=>{Jn($)&&ju($)}},{group:v,label:u("editor.palette.export"),detail:u("editor.palette.export_detail"),run:Vu}),p.push(...U),$&&m.layout&&h){const A=new Set(m.layout.tiles.map(k=>k.entity)),T=m.layout.tiles.length>=Gn.value;for(const k of m.inventory.entities)if(!(k.tile===!1||A.has(k.id))&&`${k.name} ${k.id} ${k.area||""} ${k.device||""}`.toLocaleLowerCase().includes(h)&&(p.push({group:u("editor.palette.groups.add"),label:k.name,detail:[Bt(k.id)[0],k.area].filter(Boolean).join(" · "),icon:m.inventory.icons?In(k.id):void 0,run:()=>{T||Fu(k.id)}}),p.length>60))break}return h?p.filter(A=>`${A.label} ${A.detail||""}`.toLocaleLowerCase().includes(h)):p}),i=L(()=>{const h=[];return o.value.forEach((p,g)=>{(h.find($=>$.group===p.group)||(h.push({group:p.group,items:[]}),h[h.length-1])).items.push({item:p,index:g})}),h});function r(){m.palette=!1}function c(h){r(),h.run()}function d(h){if(h.key==="Escape")h.preventDefault(),r();else if(h.key==="ArrowDown")h.preventDefault(),n.value=Math.min(o.value.length-1,n.value+1);else if(h.key==="ArrowUp")h.preventDefault(),n.value=Math.max(0,n.value-1);else if(h.key==="Enter"){h.preventDefault();const p=o.value[n.value];p&&c(p)}}return Et(t,()=>n.value=0),Et(()=>m.palette,async h=>{h&&(t.value="",n.value=0,await Ko(),s.value?.focus())}),(h,p)=>a(m).palette?(_(),b("div",{key:0,class:"palette-backdrop",onClick:r},[l("div",{class:"palette",role:"dialog","aria-label":a(u)("editor.sidebar.search"),onClick:p[1]||(p[1]=Lt(()=>{},["stop"])),onKeydown:d},[Pe(l("input",{ref_key:"input",ref:s,"onUpdate:modelValue":p[0]||(p[0]=g=>t.value=g),id:"palette-input",placeholder:a(u)("editor.palette.placeholder"),"aria-label":a(u)("editor.sidebar.search"),autocomplete:"off"},null,8,_v),[[Qe,t.value]]),l("div",yv,[(_(!0),b(J,null,ge(i.value,g=>(_(),b(J,{key:g.group},[l("div",bv,f(g.group),1),(_(!0),b(J,null,ge(g.items,({item:v,index:$})=>(_(),b("button",{key:$,type:"button",class:ve(["palette-item",{active:$===n.value}]),onMouseenter:U=>n.value=$,onClick:U=>c(v)},[v.icon?(_(),b("span",kv,f(a(Le)(v.icon)),1)):(_(),b("span",$v,f(v.glyphText||"›"),1)),l("span",Sv,[l("span",null,f(v.label),1),v.detail?(_(),b("small",xv,f(v.detail),1)):G("",!0)]),v.key?(_(),b("kbd",Cv,f(v.key),1)):G("",!0)],42,wv))),128))],64))),128)),o.value.length?G("",!0):(_(),b("p",Ev,f(a(u)("editor.palette.empty")),1))])],40,vv)])):G("",!0)}}),_e={source:null,element:null,ghost:null,timer:0,start:null,offset:{x:0,y:0},pointerId:null,suppressUntil:0,last:null,scroller:0,target:null},Yu={mounted(e,t){e.__dragSource=t.value,e.addEventListener("pointerdown",s=>{const o=e.__dragSource;if(!(s.button!==0||e.disabled||s.target.closest(".remove"))){s.pointerType!=="touch"&&s.preventDefault(),Object.assign(_e,{source:o,element:e,start:{x:s.clientX,y:s.clientY},pointerId:s.pointerId});try{e.setPointerCapture(s.pointerId)}catch{}clearTimeout(_e.timer),s.pointerType==="touch"&&(_e.timer=window.setTimeout(()=>$r(s),260))}}),e.addEventListener("pointermove",s=>{if(m.drag.active||!_e.start||_e.element!==e)return;const o=Math.hypot(s.clientX-_e.start.x,s.clientY-_e.start.y);if(s.pointerType==="touch"){o>10&&(clearTimeout(_e.timer),_e.start=null);return}o>=6&&$r(s)});const n=()=>{_e.element===e&&!m.drag.active&&(clearTimeout(_e.timer),_e.start=null)};e.addEventListener("pointerup",n),e.addEventListener("pointercancel",n)},updated(e,t){e.__dragSource=t.value}};function $r(e){if(m.drag.active||!_e.start||!_e.source||!_e.element)return;m.drag.active=!0,m.drag.moving=_e.source.kind==="tile"?_e.source.tile:Au(_e.source.id),m.drag.preview=null,_e.target=null,getSelection()?.removeAllRanges();const t=_e.element.getBoundingClientRect(),n=_e.element.cloneNode(!0);n.classList.add("drag-ghost"),n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,_e.offset={x:e.clientX-t.left,y:e.clientY-t.top},document.body.append(n),_e.ghost=n,document.addEventListener("pointermove",il),document.addEventListener("pointerup",Ro),document.addEventListener("pointercancel",Ro);try{_e.element.releasePointerCapture(_e.pointerId)}catch{}try{document.documentElement.setPointerCapture(_e.pointerId)}catch{}document.addEventListener("touchmove",qu,{passive:!1}),_e.scroller=window.setInterval(()=>{if(!_e.last)return;const{x:s,y:o}=Av(document),i=s?Cr(_e.last.x,xr(s,"x")):0,r=o?Cr(_e.last.y,xr(o,"y")):0;i&&s.scrollBy(i,0),r&&o.scrollBy(0,r),(i||r)&&ll(Gu(_e.last.x,_e.last.y))},16),ll(-1),il(e)}function Sr(e,t){if(!e)return!1;const n=t==="x"?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight,s=getComputedStyle(e)[t==="x"?"overflowX":"overflowY"];return n&&(s==="auto"||s==="scroll")}function Av(e){const t=e.querySelector(".pages"),n=e.querySelector(".canvas");return{x:Sr(t,"x")?t:n,y:Sr(n,"y")?n:e.scrollingElement}}function xr(e,t){const n=t==="x"?window.innerWidth:window.innerHeight;if(e===e.ownerDocument.scrollingElement)return[0,n];const s=e.getBoundingClientRect();return t==="x"?[Math.max(s.left,0),Math.min(s.right,n)]:[Math.max(s.top,0),Math.min(s.bottom,n)]}function Cr(e,[t,n]){return e<t+60?-12:e>n-60?12:0}function qu(e){m.drag.active&&e.preventDefault()}function Ro(e){e.pointerId===_e.pointerId&&Pv(e.type==="pointerup")}function il(e){!_e.ghost||e.pointerId!==_e.pointerId||(_e.last={x:e.clientX,y:e.clientY},_e.ghost.style.transform=`translate(${e.clientX-_e.offset.x}px, ${e.clientY-_e.offset.y}px)`,ll(Gu(e.clientX,e.clientY)))}function Gu(e,t){let n=null,s=1/0;for(const i of document.querySelectorAll(".pages [data-slot]")){const r=i.getBoundingClientRect(),c=Math.hypot(Math.max(r.left-e,0,e-r.right),Math.max(r.top-t,0,t-r.bottom));c<s&&(s=c,n={cell:i,r})}if(!n||s>16)return-1;let o=Number(n.cell.dataset.slot);return n.cell.classList.contains("wide")&&e>(n.r.left+n.r.right)/2&&(o+=1),o}function ll(e){_e.target===e||!m.layout||!m.drag.moving||(_e.target=e,m.drag.preview=e>=0?Tu(m.layout.tiles,m.drag.moving,e):null)}function Pv(e){const t=m.drag.preview,n=m.drag.moving;document.removeEventListener("pointermove",il),document.removeEventListener("pointerup",Ro),document.removeEventListener("pointercancel",Ro),document.removeEventListener("touchmove",qu);try{document.documentElement.releasePointerCapture(_e.pointerId)}catch{}if(_e.ghost?.remove(),Object.assign(_e,{ghost:null,suppressUntil:Date.now()+400,last:null,start:null,target:null,element:null,source:null}),clearInterval(_e.scroller),m.drag.active=!1,m.drag.preview=null,m.drag.moving=null,e&&t&&n&&m.layout){const s=m.layout.tiles.map(i=>`${i.entity}@${i.slot}`).join(),o=!m.layout.tiles.includes(n);for(const{tile:i,slot:r}of t)i.slot=r,m.layout.tiles.includes(i)||m.layout.tiles.push(i);m.layout.tiles.sort((i,r)=>i.slot-r.slot),m.layout.tiles.map(i=>`${i.entity}@${i.slot}`).join()!==s&&mt(),o&&eo(n,n.slot)}}window.addEventListener("click",e=>{Date.now()<_e.suppressUntil&&(e.stopPropagation(),e.preventDefault())},!0);const Lv=["data-slot","tabindex","role","aria-label"],Iv={class:"clockface",viewBox:"0 0 60 60","aria-hidden":"true"},Ov=["transform"],Nv=["transform"],Mv=["transform"],Rv={key:0,class:"lead"},Dv={class:"tx"},Fv={class:"nm"},Uv={class:"st"},jv={class:"ic mdi"},Hv={class:"lead"},Vv={class:"big"},Wv={class:"nm"},Bv={class:"lead"},Kv={class:"nm"},Yv={key:0,class:"goto"},qv={key:1,class:"big"},Gv={key:0},Jv={key:1,class:"ctl"},Xv={key:1,class:"stp"},zv={class:"mdi"},Qv={class:"mdi"},Zv={class:"key mdi"},e_={class:"key mdi"},t_={class:"key mdi"},n_={class:"key mdi"},s_={class:"key mdi"},o_={class:"key mdi"},i_={class:"key mdi"},l_={key:5,class:"run"},a_={class:"lead"},r_={class:"tx"},c_={class:"nm"},u_={key:0,class:"goto"},d_={key:1,class:"big"},f_={key:0},p_={key:1,class:"ctl"},h_={key:1,class:"stp"},m_={class:"mdi"},g_={class:"mdi"},v_={class:"key mdi"},__={class:"key mdi"},y_={key:3,class:"stp"},b_={class:"mdi"},w_={class:"mdi"},k_={class:"key mdi"},$_={class:"key mdi"},S_={class:"key mdi"},x_={class:"key mdi"},C_={class:"key mdi"},E_={class:"key mdi"},T_={class:"key mdi"},A_={class:"key mdi"},P_={class:"key mdi"},L_={class:"key mdi"},I_={class:"key mdi"},O_={class:"key mdi"},N_={class:"key mdi"},M_={class:"key mdi"},R_={class:"key mdi"},D_={key:10,class:"run"},F_={class:"tx"},U_={class:"nm"},j_={key:0,class:"goto"},H_={key:0,class:"big"},V_={key:0},W_=["title","aria-label"],B_=Me({__name:"TileCard",props:{tile:{},slot:{},placeholder:{type:Boolean}},setup(e){const t=e,n=L(()=>t.tile.name||Qs(t.tile.entity)),s=L(()=>$u(t.tile)),o=L(()=>Xi(t.tile)&&!s.value),i=L(()=>gs(t.tile.entity)),r=L(()=>m.inventory.backgrounds?.[t.tile.options?.background||""]?.color),c=L(()=>t.tile.options?.background==="none"),d=L(()=>t.tile.options?.display||"standard"),h=L(()=>d.value!=="standard"?Lu(d.value):""),p=L(()=>Pu(t.tile,m.inventory)),g=L(()=>t.tile.entity.split(".")[0]),v=L(()=>m.inventory.icons?.controls||{}),$=Y=>v.value[Y]?Le(v.value[Y]):"",U=L(()=>Ul(t.tile)&&m.inspector?.kind==="tile"),A=L(()=>!t.placeholder&&m.layout?.tiles.includes(t.tile)),T=L(()=>u("editor.tile_card.label",{name:n.value,slot:t.slot%Je+1,page:At(t.slot)+1})),k=L(()=>new Date(m.now)),S=L(()=>(k.value.getHours()%12+k.value.getMinutes()/60)*30),F=L(()=>k.value.getMinutes()*6),x=L(()=>g.value==="screen"?null:lg(t.tile.entity)),j=L(()=>!x.value||["unavailable","unknown",""].includes(x.value.state)),O=L(()=>!!x.value&&!j.value&&x.value.state!=="off"&&x.value.state!=="closed"&&x.value.state!=="standby"&&x.value.state!=="idle"&&x.value.state!=="docked"),C=L(()=>["light","switch","input_boolean","fan"].includes(g.value)&&x.value?.state==="on"),I=L(()=>x.value?.a?.unit_of_measurement),K=Y=>Y.charAt(0).toUpperCase()+Y.slice(1).replace(/_/g," "),M=Y=>wu(Y,Ag.value),he=["clear-night","cloudy","exceptional","fog","hail","lightning","lightning-rainy","partlycloudy","pouring","rainy","snowy","snowy-rainy","sunny","windy","windy-variant"],z=Y=>he.includes(Y)?sn(`editor.mockup.weather.${Y.replace(/-/g,"_")}`):"",oe=["scene","script","button","input_button"],pe=L(()=>{const Y=x.value;if(!Y||oe.includes(g.value))return h.value;if(j.value)return sn(Y.state==="unknown"?"editor.mockup.unknown":"editor.mockup.unavailable");const fe=Y.a||{};return g.value==="climate"?`${fe.current_temperature!==void 0?`${M(fe.current_temperature)}° · `:""}${Y.word||K(Y.state)}`:g.value==="weather"?`${Y.word||z(Y.state)||K(Y.state)}${fe.temperature!==void 0?` · ${M(fe.temperature)}°`:""}`:g.value==="cover"&&fe.current_position!==void 0&&fe.current_position>0&&fe.current_position<100?`${Y.word||K(Y.state)} · ${fe.current_position} %`:g.value==="media_player"&&fe.media_title?`${Y.word||K(Y.state)} · ${fe.media_title}`:g.value==="sensor"?`${M(Y.state)}${I.value?` ${I.value}`:""}`:(g.value==="timer",Y.word||K(Y.state))}),se=L(()=>x.value&&!j.value?M(x.value.state):"—"),ce=L(()=>{const Y=x.value;if(!Y||j.value)return 0;const fe=Y.a||{};if(g.value==="light")return Y.state==="on"?fe.brightness!==void 0?Math.round(fe.brightness/255*100):100:0;if(g.value==="fan")return Y.state==="on"?fe.percentage??100:0;if(g.value==="cover")return 100-(fe.current_position??(Y.state==="open"?100:0));if(g.value==="media_player")return Math.round((fe.volume_level??0)*100);if(g.value==="number"||g.value==="input_number"){const me=Number(Y.state),te=Number(fe.min??0),Ee=Number(fe.max??100);return Number.isFinite(me)&&Ee>te?Math.round((me-te)/(Ee-te)*100):0}return 0}),ye=L(()=>sn(`editor.mockup.run.${["scene","script"].includes(g.value)?g.value:"press"}`)),$e=L(()=>({background:`linear-gradient(to right, ${ce.value?"#ffbf38":"#c9ccd1"} ${ce.value}%, ${ce.value?"#fff1d3":"#e6e8ec"} ${ce.value}%)`})),Ge=L(()=>({background:`linear-gradient(to right, #2196f3 ${ce.value}%, #d3e8fb ${ce.value}%)`})),ae=L(()=>{const Y=x.value?.a?.temperature;return Y!=null?`${M(Y)}°`:"—"});async function ee(Y){if(Y.key==="Enter"||Y.key===" "){Y.preventDefault(),el(t.tile);return}const fe={ArrowLeft:-1,ArrowRight:1,ArrowUp:-2,ArrowDown:2}[Y.key];fe&&(Y.preventDefault(),eo(t.tile,t.tile.slot+(s.value?Math.sign(fe)*Je:o.value?Math.sign(fe)*2:fe))&&(await Ko(),document.querySelector(`.pages [data-slot="${t.tile.slot}"]`)?.focus()))}return(Y,fe)=>Pe((_(),b("div",{class:ve(["tile",{wide:o.value,full:s.value,bare:c.value,placeholder:e.placeholder||!A.value,chosen:U.value}]),"data-slot":e.slot,style:He(r.value&&!c.value?{backgroundColor:r.value}:void 0),tabindex:A.value?0:-1,role:A.value?"button":void 0,"aria-label":A.value?T.value:void 0,onClick:fe[1]||(fe[1]=me=>A.value&&a(el)(e.tile)),onKeydown:fe[2]||(fe[2]=me=>A.value&&ee(me))},[d.value==="analog"?(_(),b(J,{key:0},[(_(),b("svg",Iv,[fe[3]||(fe[3]=l("circle",{cx:"30",cy:"30",r:"27",fill:"#fff",stroke:"#c9ccd1"},null,-1)),(_(),b(J,null,ge([0,90,180,270],me=>l("line",{key:me,x1:"30",y1:"5",x2:"30",y2:"9",stroke:"#1b1b1b","stroke-width":"1.5",transform:`rotate(${me} 30 30)`},null,8,Ov)),64)),l("line",{x1:"30",y1:"30",x2:"30",y2:"16",stroke:"#1b1b1b","stroke-width":"2.4","stroke-linecap":"round",transform:`rotate(${S.value} 30 30)`},null,8,Nv),l("line",{x1:"30",y1:"30",x2:"30",y2:"11",stroke:"#1b1b1b","stroke-width":"1.6","stroke-linecap":"round",transform:`rotate(${F.value} 30 30)`},null,8,Mv),fe[4]||(fe[4]=l("circle",{cx:"30",cy:"30",r:"1.8",fill:"#1b1b1b"},null,-1))])),o.value?(_(),b("span",Rv,[l("span",Dv,[l("span",Fv,f(n.value),1),l("span",Uv,f(h.value),1)])])):G("",!0)],64)):d.value==="digital"&&g.value==="screen"?(_(),b(J,{key:1},[l("span",jv,f(a(Le)(a($s)(e.tile))),1),l("span",Hv,[l("span",Vv,f(a(Zo)(a(hs),k.value)),1),l("span",Wv,f(n.value),1)])],64)):s.value?(_(),b(J,{key:2},[l("span",{class:ve(["ic mdi",{lit:C.value}])},f(a(Le)(a($s)(e.tile))),3),l("span",Bv,[l("span",Kv,f(n.value),1),i.value?(_(),b("span",Yv,f(a(sn)("editor.mockup.page_link",{page:i.value})),1)):d.value==="watch"?(_(),b("span",qv,[Re(f(se.value),1),I.value&&!j.value?(_(),b("small",Gv,f(I.value),1)):G("",!0)])):pe.value?(_(),b("span",{key:2,class:ve(["st",{off:j.value}])},f(pe.value),3)):G("",!0)]),e.tile.options?.inline==="slider"?(_(),b("span",{key:0,class:"mini-slider",style:He($e.value)},null,4)):G("",!0),p.value?(_(),b("span",Jv,[p.value==="toggle"?(_(),b("span",{key:0,class:ve(["tog",{off:!O.value}])},null,2)):p.value==="setpoint"?(_(),b("span",Xv,[l("span",zv,f($("minus")||"−"),1),l("b",null,f(ae.value),1),l("span",Qv,f($("plus")||"+"),1)])):p.value==="volume"?(_(),b(J,{key:2},[l("span",{class:"range",style:He(Ge.value)},null,4),l("span",Zv,f($("volume-high")),1)],64)):p.value==="playback"?(_(),b(J,{key:3},[l("span",e_,f($("skip-previous")),1),l("span",t_,f($(O.value?"pause":"play")||$("play")),1),l("span",n_,f($("skip-next")),1)],64)):p.value==="buttons"&&g.value==="cover"?(_(),b(J,{key:4},[l("span",s_,f($("arrow-expand-horizontal")),1),l("span",o_,f($("stop")),1),l("span",i_,f($("arrow-collapse-horizontal")),1)],64)):p.value==="run"?(_(),b("span",l_,f(ye.value),1)):(_(),b("span",{key:6,class:"range",style:He({background:`linear-gradient(to right, #2196f3 ${ce.value}%, #d3e8fb ${ce.value}%)`})},null,4))])):G("",!0)],64)):o.value?(_(),b(J,{key:3},[l("span",a_,[l("span",{class:ve(["ic mdi",{lit:C.value}])},f(a(Le)(a($s)(e.tile))),3),l("span",r_,[l("span",c_,f(n.value),1),i.value?(_(),b("span",u_,f(a(sn)("editor.mockup.page_link",{page:i.value})),1)):d.value==="watch"?(_(),b("span",d_,[Re(f(se.value),1),I.value&&!j.value?(_(),b("small",f_,f(I.value),1)):G("",!0)])):pe.value?(_(),b("span",{key:2,class:ve(["st",{off:j.value}])},f(pe.value),3)):G("",!0)])]),e.tile.options?.inline==="slider"?(_(),b("span",{key:0,class:"mini-slider",style:He($e.value)},null,4)):G("",!0),p.value?(_(),b("span",p_,[p.value==="toggle"?(_(),b("span",{key:0,class:ve(["tog",{off:!O.value}])},null,2)):p.value==="setpoint"?(_(),b("span",h_,[l("span",m_,f($("minus")||"−"),1),l("b",null,f(ae.value),1),l("span",g_,f($("plus")||"+"),1)])):p.value==="stepper"&&g.value.endsWith("select")?(_(),b(J,{key:2},[l("span",v_,f($("chevron-left")),1),l("span",__,f($("chevron-right")),1)],64)):p.value==="stepper"?(_(),b("span",y_,[l("span",b_,f($("minus")||"−"),1),l("b",null,f(se.value),1),l("span",w_,f($("plus")||"+"),1)])):p.value==="mode"?(_(),b(J,{key:4},[l("span",k_,f($("power")),1),l("span",$_,f($("fire")),1),l("span",S_,f($("snowflake")),1)],64)):p.value==="volume"?(_(),b(J,{key:5},[l("span",{class:"range",style:He(Ge.value)},null,4),l("span",x_,f($("volume-high")),1)],64)):p.value==="playback"?(_(),b(J,{key:6},[l("span",C_,f($("skip-previous")),1),l("span",E_,f($(O.value?"pause":"play")||$("play")),1),l("span",T_,f($("skip-next")),1)],64)):p.value==="buttons"&&g.value==="cover"?(_(),b(J,{key:7},[l("span",A_,f($("arrow-expand-horizontal")),1),l("span",P_,f($("stop")),1),l("span",L_,f($("arrow-collapse-horizontal")),1)],64)):p.value==="buttons"&&g.value==="vacuum"?(_(),b(J,{key:8},[l("span",I_,f($("play")),1),l("span",O_,f($("stop")),1),l("span",N_,f($("home-map-marker")),1)],64)):p.value==="buttons"&&g.value==="timer"?(_(),b(J,{key:9},[l("span",M_,f($("play")),1),l("span",R_,f($("close")),1)],64)):p.value==="run"?(_(),b("span",D_,f(ye.value),1)):(_(),b("span",{key:11,class:"range",style:He({background:`linear-gradient(to right, #2196f3 ${ce.value}%, #d3e8fb ${ce.value}%)`})},null,4))])):G("",!0)],64)):(_(),b(J,{key:4},[l("span",{class:ve(["head",{top:d.value==="watch"}])},[l("span",{class:ve(["ic mdi",{lit:C.value}])},f(a(Le)(a($s)(e.tile))),3),l("span",F_,[l("span",U_,f(n.value),1),i.value?(_(),b("span",j_,f(a(sn)("editor.mockup.page_link",{page:i.value})),1)):d.value!=="watch"&&pe.value?(_(),b("span",{key:1,class:ve(["st",{off:j.value}])},f(pe.value),3)):G("",!0)])],2),d.value==="watch"?(_(),b("span",H_,[Re(f(se.value),1),I.value&&!j.value?(_(),b("small",V_,f(I.value),1)):G("",!0)])):G("",!0),e.tile.options?.inline==="slider"?(_(),b("span",{key:1,class:"mini-slider",style:He($e.value)},null,4)):G("",!0)],64)),A.value?(_(),b("button",{key:5,type:"button",class:"remove",title:a(u)("editor.tile_card.remove"),"aria-label":a(u)("editor.tile_card.remove_named",{name:n.value}),onClick:fe[0]||(fe[0]=Lt(me=>a(Uu)(e.tile),["stop"]))},"✕",8,W_)):G("",!0)],46,Lv)),[[a(Yu),{kind:"tile",tile:e.tile}]])}}),K_=["viewBox","aria-label"],Y_=["y"],q_=["cx","cy","r","stroke","stroke-width"],G_=["x1","y1","x2","y2","stroke","stroke-width"],J_=["x","y","fill"],X_=["x","y"],Ju=Me({__name:"TopbarSvg",props:{items:{},nameText:{},single:{type:Boolean}},setup(e,{expose:t}){const n=e,s=L(()=>{m.fontsVersion,m.now,m.topbarPreviews;const T=n.items||vn();return Ou(T,Ru.value,n.nameText??(m.layout?.title||sn("editor.mockup.home")),kn)}),o=L(()=>s.value.metrics),i=L(()=>n.single?Math.round(o.value.text*1.4):o.value.top+Math.round(o.value.name*.45)),r=L(()=>n.single?Math.round(o.value.text*1.05):o.value.top),c=L(()=>{if(!n.single)return s.value.placed;const T=s.value.parts[0];return T&&(T.x=0),T?[T]:[]}),d=L(()=>n.single?`-2 0 ${Math.max(1,c.value[0]?.width||1)+4} ${i.value}`:`0 0 ${o.value.width} ${i.value}`),h=L(()=>r.value+(s.value.zero.top+s.value.zero.bottom)/2),p=L(()=>Zm(s.value.nameText,s.value.fonts.name,Math.min(s.value.natural,s.value.nameRoom))),g=L(()=>new Date(m.now));function v(T){const k=g.value;return[[(k.getHours()%12+k.getMinutes()/60)*30,T*.24],[k.getMinutes()*6,T*.34]].map(([S,F])=>{const x=S*Math.PI/180;return{x2:F*Math.sin(x),y2:-F*Math.cos(x)}})}const $=T=>T.x-T.icon.ink.left,U=T=>(T.icon?T.x+(T.icon.ink.right-T.icon.ink.left)+s.value.gaps.icon:T.x)-T.text.ink.left,A=L(()=>`${(Math.max(1,c.value[0]?.width||1)+4)*(26/o.value.icon)}px`);return t({lay:s}),(T,k)=>(_(),b("svg",{viewBox:d.value,role:"img","aria-label":e.single?a(u)("editor.topbar.live.looks"):a(u)("editor.topbar.aria",{name:s.value.nameText}),style:He(e.single?{width:A.value}:void 0)},[e.single?G("",!0):(_(),b("text",{key:0,x:"0",y:o.value.top,fill:"#1b1b1b",style:He({font:s.value.fonts.name})},f(p.value),13,Y_)),l("g",null,[(_(!0),b(J,null,ge(c.value,S=>(_(),b(J,{key:S.index},[S.dial?(_(),b(J,{key:0},[l("circle",{cx:S.x+S.dial/2,cy:h.value,r:S.dial/2-Math.max(1,Math.round(S.dial/10))/2,fill:"none",stroke:S.view.color||"#46525e","stroke-width":Math.max(1,Math.round(S.dial/10))},null,8,q_),(_(!0),b(J,null,ge(v(S.dial),(F,x)=>(_(),b("line",{key:x,x1:S.x+S.dial/2,y1:h.value,x2:S.x+S.dial/2+F.x2,y2:h.value+F.y2,stroke:S.view.color||"#46525e","stroke-width":Math.max(1,Math.round(S.dial*.075)),"stroke-linecap":"round"},null,8,G_))),128))],64)):(_(),b(J,{key:1},[S.icon?(_(),b("text",{key:0,x:$(S),y:h.value-(S.icon.ink.top+S.icon.ink.bottom)/2,fill:S.view.color||"#46525e",style:He({font:s.value.fonts.icon})},f(S.icon.glyph),13,J_)):G("",!0),S.text?(_(),b("text",{key:1,x:U(S),y:r.value,fill:"#46525e",style:He({font:s.value.fonts.text})},f(S.text.value),13,X_)):G("",!0)],64))],64))),128))])],12,K_))}}),z_={class:"page"},Q_={class:"page-label"},Z_=["title"],ey={key:1},ty=["title"],ny={class:"tiles"},sy=["data-slot","title","aria-label","onClick"],oy=Me({__name:"DevicePage",props:{page:{},entries:{},pages:{},moving:{}},setup(e){const t=e,n=L(()=>new Map(t.entries.map(h=>[h.slot,h]))),s=L(()=>new Set(t.entries.flatMap(h=>qn(h.slot,ft(h.tile)).slice(1)))),o=L(()=>Array.from({length:Je},(h,p)=>t.page*Je+p).filter(h=>!s.value.has(h))),i=L(()=>t.pages>1&&!t.entries.some(h=>At(h.slot)===t.page)),r=L(()=>m.inspector?.kind==="bar"||m.inspector?.kind==="bar-add"),c=L(()=>t.entries.filter(h=>At(h.slot)===t.page).reduce((h,p)=>h+Ml(ft(p.tile)),0));function d(h){const p=m.insertAt===h;m.insertAt=p?-1:h,m.insertAt>=0&&document.querySelector("#search")?.focus()}return(h,p)=>(_(),b("div",z_,[l("div",Q_,[l("span",null,f(a(u)("editor.page.label",{page:e.page+1})),1),i.value?(_(),b("button",{key:0,type:"button",class:"btn mini",title:a(u)("editor.page.remove_title"),onClick:p[0]||(p[0]=g=>a(cg)(e.page))},f(a(u)("editor.page.remove")),9,Z_)):(_(),b("span",ey,f(c.value)+" / "+f(a(Je)),1))]),l("div",{class:ve(["device",{cyd:!a(Fl)}])},[l("div",{class:ve(["bar-wrap",{selected:r.value}]),title:a(u)("editor.page.edit_bar"),role:"button",tabindex:"0",onClick:p[1]||(p[1]=g=>a(nn)(0)),onKeydown:p[2]||(p[2]=Dc(Lt(g=>a(nn)(0),["prevent"]),["enter"]))},[ne(Ju)],42,ty),l("div",ny,[(_(!0),b(J,null,ge(o.value,g=>(_(),b(J,{key:g},[n.value.get(g)?(_(),at(B_,{key:0,tile:n.value.get(g).tile,slot:g,placeholder:n.value.get(g).tile===e.moving},null,8,["tile","slot","placeholder"])):(_(),b("button",{key:1,type:"button",class:ve(["cell",{"insert-here":a(m).insertAt===g}]),"data-slot":g,title:a(u)("editor.page.cell.title"),"aria-label":a(u)("editor.page.cell.aria",{slot:g%a(Je)+1,page:e.page+1}),onClick:v=>d(g)},[p[3]||(p[3]=l("span",null,"+",-1)),l("small",null,f(a(m).insertAt===g?a(u)("editor.page.cell.next"):a(u)("editor.page.cell.empty")),1)],10,sy))],64))),128))])],2)]))}}),iy={class:"library",id:"library"},ly={class:"lib-head"},ay={class:"lib-title"},ry=["placeholder","aria-label"],cy={class:"filters",id:"filters"},uy=["aria-pressed","onClick"],dy={class:"lib-row"},fy=["aria-label"],py={value:""},hy=["value"],my=["aria-pressed","title"],gy={class:"lib-list",id:"results","aria-live":"polite"},vy=["title","disabled","onClick"],_y={class:"tx"},yy={key:0,class:"hint"},by={key:1,class:"hint"},wy={class:"lib-foot"},ky=Me({__name:"Library",setup(e){const t=["","light","climate","switch","binary_sensor","button","script","fan","cover","scene","vacuum","sensor","media_player","weather","number","select","person","timer","screen"],n={switch:"input_boolean",number:"input_number",select:"input_select",weather:"sun",button:"input_button"},s=L(()=>new Set(m.layout?.tiles.map(p=>p.entity)||[])),o=p=>s.value.has(p)&&!ei(p),i=L(()=>[...new Set(m.inventory.entities.map(p=>p.area).filter(p=>!!p))].sort((p,g)=>p.localeCompare(g))),r=L(()=>{const p=m.search.toLocaleLowerCase(),g=m.filter,v=m.room;return[...m.inventory.builtin||[],...m.inventory.entities].filter($=>$.tile!==!1&&(Fl.value||!["camera","image"].includes($.id.split(".")[0]))&&(!g||$.id.startsWith(g+".")||n[g]===$.id.split(".")[0])&&(!v||$.area===v)&&(!m.hidePlaced||!o($.id))&&`${$.name} ${$.id} ${$.device||""} ${$.area||""}`.toLocaleLowerCase().includes(p))}),c=L(()=>(m.layout?.tiles.length||0)>=Gn.value),d=L(()=>m.inventory.entities.length),h=p=>{const g=p.id.split(".")[0];return p.state==="unavailable"||p.state==="unknown"?"gone":["light","switch","input_boolean","fan"].includes(g)&&p.state==="on"?"on":""};return(p,g)=>(_(),b("aside",iy,[l("div",ly,[l("div",ay,[Re(f(a(u)("editor.library.title"))+" ",1),l("small",null,f(a(u)("editor.library.entities",d.value)),1)]),Pe(l("input",{id:"search","onUpdate:modelValue":g[0]||(g[0]=v=>a(m).search=v),type:"search",placeholder:a(u)("editor.library.search"),autocomplete:"off","aria-label":a(u)("editor.library.search_label")},null,8,ry),[[Qe,a(m).search]]),l("div",cy,[(_(),b(J,null,ge(t,v=>l("button",{key:v,type:"button","aria-pressed":a(m).filter===v?"true":"false",onClick:$=>a(m).filter=v},[v?(_(),b("span",{key:0,class:"domain-icon",style:He({color:a(Bt)(v+".")[2],background:a(Bt)(v+".")[3]}),"aria-hidden":"true"},f(a(Bt)(v+".")[1]),5)):G("",!0),Re(f(a(u)(`editor.library.filters.${v||"all"}`)),1)],8,uy)),64))]),l("div",dy,[Pe(l("select",{id:"room","onUpdate:modelValue":g[1]||(g[1]=v=>a(m).room=v),"aria-label":a(u)("editor.library.room")},[l("option",py,f(a(u)("editor.library.all_rooms")),1),(_(!0),b(J,null,ge(i.value,v=>(_(),b("option",{key:v,value:v},f(v),9,hy))),128))],8,fy),[[Yn,a(m).room]]),l("button",{type:"button",class:"chip-toggle",id:"hide-placed","aria-pressed":a(m).hidePlaced?"true":"false",title:a(u)("editor.library.hide_placed_title"),onClick:g[2]||(g[2]=v=>a(m).hidePlaced=!a(m).hidePlaced)},f(a(u)("editor.library.hide_placed")),9,my)])]),l("div",gy,[(_(!0),b(J,null,ge(r.value.slice(0,80),v=>Pe((_(),b("button",{key:v.id,type:"button",class:"ent",title:v.id,disabled:o(v.id)||c.value,onClick:$=>a(Fu)(v.id)},[l("span",{class:ve(["av mdi",h(v)]),style:He({color:a(Bt)(v.id)[2],background:a(Bt)(v.id)[3]})},f(a(m).inventory.icons?a(Le)(a(In)(v.id)):a(Bt)(v.id)[1]),7),l("span",_y,[l("b",null,f(v.name),1),l("small",null,f([a(Bt)(v.id)[0],v.area,v.device].filter(Boolean).join(" · ")),1)]),l("span",{class:ve(["add",{done:o(v.id)}])},f(o(v.id)?"✓":"+"),3)],8,vy)),[[a(Yu),{kind:"entity",id:v.id}]])),128)),r.value.length?r.value.length>80?(_(),b("p",by,f(a(u)("editor.common.results",r.value.length)),1)):G("",!0):(_(),b("p",yy,f(a(m).hidePlaced&&!a(m).search&&!a(m).filter&&!a(m).room?a(u)("editor.library.all_placed"):a(u)("editor.library.none_found")),1))]),l("div",wy,f(c.value?a(u)(a(Gn)<48?"editor.library.full_update":"editor.library.full",a(Gn)):a(u)("editor.library.hint")),1)]))}}),$y={class:"canvas-head"},Sy={id:"count"},xy={key:0,id:"no-tiles"},Cy={key:1},Ey={key:2,id:"positions-hint",class:"warn"},Ty={key:3,id:"page-reach-hint",class:"warn"},Ay=["aria-label"],Py={class:"page-label"},Ly=["tabindex"],Iy=Me({__name:"LayoutView",setup(e){const t=L(()=>m.layout),n=L(()=>m.drag.preview||et(t.value)),s=L(()=>It(n.value,t.value.pages)),o=L(()=>dg()),i=L(()=>s.value<mn),r=L(()=>Dm(t.value.tiles)&&!Tn(0,2,26)?u("editor.layout.positions_hint",{firmware:wt.value?.firmware||u("editor.common.unknown")}):""),c=L(()=>Wu(n.value,s.value));function d(h){h.target.closest(".device, .page-label, .canvas-head")||m.inspector&&tt()}return(h,p)=>(_(),b(J,null,[l("div",{class:"canvas",id:"canvas",onClick:d},[l("div",$y,[l("b",Sy,f(a(u)("editor.layout.count",{tiles:t.value.tiles.length,limit:a(Gn)},s.value)),1),t.value.tiles.length?(_(),b("span",Cy,f(a(u)("editor.layout.how_to")),1)):(_(),b("span",xy,f(a(u)("editor.layout.no_tiles")),1)),r.value?(_(),b("span",Ey,f(r.value),1)):G("",!0),c.value?(_(),b("span",Ty,f(c.value),1)):G("",!0)]),l("div",{class:"pages",id:"layout-preview","aria-label":a(u)("editor.layout.aria")},[(_(!0),b(J,null,ge(o.value,g=>(_(),at(oy,{key:g,page:g-1,entries:n.value,pages:s.value,moving:a(m).drag.moving},null,8,["page","entries","pages","moving"]))),128)),l("div",{class:ve(["page ghost",{disabled:!i.value}])},[l("div",Py,[l("span",null,f(a(u)("editor.page.label",{page:o.value+1})),1)]),l("div",{class:ve(["device",{cyd:a(wt)?.board!=="guition"}]),id:"add-page",role:"button",tabindex:i.value?0:-1,onClick:p[0]||(p[0]=g=>i.value&&a(pr)()),onKeydown:p[1]||(p[1]=Dc(Lt(g=>i.value&&a(pr)(),["prevent"]),["enter"]))},f(i.value?a(u)("editor.layout.add_page"):a(u)("editor.layout.max_pages",a(mn))),43,Ly)],2)],8,Ay)]),ne(ky)],64))}}),Oy={class:"status",id:"settings-status",role:"status"},Ny={key:0,class:"set-grid",id:"settings-groups"},My={class:"mdi"},Ry=["data-setting","title","onClick"],Dy=["id"],Fy={class:"s-control"},Uy=["id","aria-checked","aria-labelledby","disabled","onClick"],jy=["aria-labelledby"],Hy=["aria-pressed","disabled","onClick"],Vy={key:2,class:"step"},Wy=["aria-label","disabled","onPointerdown","onClick"],By={class:"mdi"},Ky=["id","aria-labelledby"],Yy=["aria-label","disabled","onPointerdown","onClick"],qy={class:"mdi"},Gy={key:0,class:"hint warn",id:"settings-page-reach"},Jy=Me({__name:"SettingsTab",setup(e){const t=L(()=>jl()),n=L(()=>Oo()),s=L(()=>t.value?.owner==="screen"&&!wt.value?.online),o=L(()=>bg.map(A=>({...A,rows:A.rows.filter(T=>t.value?.keys.includes(T.key))})).filter(A=>A.rows.length)),i=L(()=>Wu()),r=A=>s.value||!!t.value?.unavailable.includes(A.key),c=A=>A.needs?!!n.value[A.needs]:!0,d=L(()=>s.value?u("editor.screen_settings.status.offline"):m.settingPending?u("editor.common.saving"):t.value?.owner==="screen"?u("editor.screen_settings.status.screen"):u("editor.screen_settings.status.app")),h=(A,T)=>{const k=n.value[A.key];return r(A)||!c(A)||k===null||k===void 0?!0:A.kind!=="moment"&&vr(A,k,T,!1,n.value)===k},p=new WeakMap;function g(A,T,k){const S=Oo(),F=vr(A,S[A.key],T,k,S);F!==S[A.key]&&uo(A.key,F,600)}function v(A,T,k){const S=A.currentTarget;if(S.disabled||A.button!==0)return;const F={timer:0,held:!1};p.set(S,F);let x=0;F.timer=window.setTimeout(function j(){F.held=!0,x+=1,g(T,k,x>5),F.timer=window.setTimeout(j,180)},450)}function $(A){const T=p.get(A.currentTarget);T&&clearTimeout(T.timer)}function U(A,T,k){const S=p.get(A.currentTarget);if(S?.held){S.held=!1;return}g(T,k,!1)}return(A,T)=>(_(),b("div",{class:ve(["settings",{offline:s.value}]),id:"general-settings"},[l("span",Oy,f(d.value),1),t.value?(_(),b("div",Ny,[(_(!0),b(J,null,ge(o.value,k=>(_(),b("section",{key:k.group,class:"set-card"},[l("h4",null,[l("span",My,f(a(Le)(k.icon)),1),Re(f(a(u)(`editor.screen_settings.groups.${k.group}`)),1)]),(_(!0),b(J,null,ge(k.rows,S=>(_(),b("div",{key:S.key,class:ve(["srow",[`setting-${S.kind}`,{inactive:!c(S)||r(S)}]]),"data-setting":S.key,title:r(S)&&!s.value?a(u)("editor.screen_settings.unavailable"):"",onClick:F=>S.kind==="toggle"&&F.target.closest(".srow")===F.currentTarget&&!F.target.closest("button")&&!r(S)&&a(uo)(S.key,!n.value[S.key],150)},[l("span",{class:"s-label",id:`setting-label-${S.key}`},f(a(Ti)(S)),9,Dy),l("div",Fy,[S.kind==="toggle"?(_(),b("button",{key:0,type:"button",class:ve(["switch",{unknown:n.value[S.key]===null||n.value[S.key]===void 0}]),role:"switch",id:`setting-${S.key}`,"aria-checked":n.value[S.key]?"true":"false","aria-labelledby":`setting-label-${S.key}`,disabled:r(S),onClick:Lt(F=>a(uo)(S.key,!n.value[S.key],150),["stop"])},null,10,Uy)):S.kind==="choice"?(_(),b("div",{key:1,class:"seg",role:"group","aria-labelledby":`setting-label-${S.key}`},[(_(!0),b(J,null,ge(S.options,F=>(_(),b("button",{key:String(F),type:"button","aria-pressed":n.value[S.key]===F?"true":"false",disabled:r(S),onClick:x=>a(uo)(S.key,F,150)},f(a(wg)(S,F)),9,Hy))),128))],8,jy)):(_(),b("div",Vy,[l("button",{type:"button","aria-label":a(u)("editor.screen_settings.lower",{name:a(Ti)(S)}),disabled:h(S,-1),onPointerdown:F=>v(F,S,-1),onPointerup:$,onPointercancel:$,onPointerleave:$,onClick:F=>U(F,S,-1)},[l("span",By,f(a(Le)("F0374")),1)],40,Wy),l("output",{id:`setting-${S.key}`,"aria-labelledby":`setting-label-${S.key}`},f(a(xg)(S,n.value)),9,Ky),l("button",{type:"button","aria-label":a(u)("editor.screen_settings.higher",{name:a(Ti)(S)}),disabled:h(S,1),onPointerdown:F=>v(F,S,1),onPointerup:$,onPointercancel:$,onPointerleave:$,onClick:F=>U(F,S,1)},[l("span",qy,f(a(Le)("F0415")),1)],40,Yy)]))])],10,Ry))),128)),i.value&&k.rows.some(S=>S.key==="page_buttons")?(_(),b("p",Gy,f(i.value),1)):G("",!0)]))),128))])):G("",!0)],2))}}),Xy={class:"seg wrap",role:"group"},zy=["disabled","aria-pressed","onClick"],$t=Me({__name:"Segmented",props:{choices:{},value:{},disabled:{type:Boolean}},emits:["pick"],setup(e,{emit:t}){const n=t;return(s,o)=>(_(),b("div",Xy,[(_(!0),b(J,null,ge(e.choices,([i,r])=>(_(),b("button",{key:String(i),type:"button",disabled:e.disabled,"aria-pressed":String(i)===String(e.value)?"true":"false",onClick:c=>n("pick",i)},f(r),9,zy))),128))]))}}),Qy={class:"f"},Zy={class:"f-label"},eb={key:0},tb={key:1,class:"warn"},nb=["aria-expanded"],sb={class:"tx"},ob={key:0,class:"mono"},ib={class:"link"},lb={key:0,class:"picker"},ab=["placeholder","aria-label"],rb={class:"action-list"},cb=["aria-pressed","onClick"],ub={key:0,class:"hint"},db={key:1,class:"warn"},fb={class:"f-label"},pb=["aria-label","value","onChange"],hb={value:""},mb=["value"],gb={key:3,class:"action-number"},vb=["aria-label","value","onInput"],_b=["onClick"],yb={key:4,class:"action-number"},bb=["aria-label","min","max","step","value","placeholder","onInput"],wb={key:0},kb=["aria-label","value","placeholder","onInput"],$b={key:6},Sb={key:0,class:"warn"},xb={key:3},Cb=Me({__name:"ActionPicker",props:{tile:{}},setup(e){const t=e,n=L(()=>m.entityActions[t.tile.entity]),s=L(()=>t.tile.options?.action),o=L(()=>n.value?.find(x=>x.action===s.value?.action)),i=L(()=>m.actionPickerOpen||!s.value),r=L(()=>{const x=m.actionSearch.trim().toLocaleLowerCase();return(n.value||[]).filter(j=>`${j.name} ${j.action} ${j.description}`.toLocaleLowerCase().includes(x))});n.value===void 0&&ig(t.tile.entity);function c(x){const j=x.action===s.value?.action;t.tile.options={...t.tile.options,action:j?s.value:{action:x.action}},m.actionPickerOpen=!1,mt()}function d(x,j){const O={...t.tile.options?.action?.data||{}};j===void 0?delete O[x]:O[x]=j,t.tile.options={...t.tile.options,action:{action:s.value.action,...Object.keys(O).length?{data:O}:{}}},mt()}const h=L(()=>{if(!o.value)return[];const x=t.tile.options?.action?.data||{};return o.value.fields.filter(j=>j.required&&x[j.key]===void 0).map(j=>j.name)}),p=x=>Object.keys(x.selector||{})[0]||"text",g=x=>(x.selector||{})[p(x)]||{},v=x=>x.example===void 0?"":typeof x.example=="string"?x.example:JSON.stringify(x.example);function $(x){const j=g(x),O=p(x);return Array.isArray(x.options)?x.options.map(C=>[C,C]):O==="select"&&Array.isArray(j.options)&&!j.multiple?j.options.map(C=>C&&typeof C=="object"?[String(C.value),String(C.label??C.value)]:[String(C),String(C)]):null}const U=x=>"#"+x.map(j=>Math.max(0,Math.min(255,Number(j)||0)).toString(16).padStart(2,"0")).join(""),A=x=>Array.isArray(x)&&x.length===3?U(x):"#ffffff",T=x=>x===void 0?"":typeof x=="string"?x:JSON.stringify(x);function k(x,j){const O=j.trim();if(!O)return d(x.key,void 0);if(p(x)==="text")return d(x.key,j);try{d(x.key,JSON.parse(O))}catch{d(x.key,j)}}function S(x,j){d(x.key,j===""||!Number.isFinite(Number(j))?void 0:Number(j))}const F=x=>g(x).unit_of_measurement||p(x)==="color_temp"&&g(x).unit||"";return(x,j)=>(_(),b("div",Qy,[l("span",Zy,f(a(u)("editor.action.label")),1),n.value===void 0?(_(),b("small",eb,f(a(u)("editor.action.asking")),1)):n.value===null?(_(),b("small",tb,f(a(u)("editor.action.not_answering")),1)):(_(),b(J,{key:2},[l("button",{type:"button",class:"row","aria-expanded":i.value?"true":"false",onClick:j[0]||(j[0]=O=>a(m).actionPickerOpen=!i.value)},[l("span",sb,[l("b",null,f(o.value?o.value.name:s.value?s.value.action:a(u)("editor.action.choose")),1),s.value?(_(),b("small",ob,f(s.value.action),1)):G("",!0)]),l("span",ib,f(i.value?a(u)("editor.common.close"):a(u)("editor.common.change")),1)],8,nb),i.value?(_(),b("div",lb,[Pe(l("input",{"onUpdate:modelValue":j[1]||(j[1]=O=>a(m).actionSearch=O),type:"search",placeholder:a(u)("editor.action.search"),"aria-label":a(u)("editor.action.search_label")},null,8,ab),[[Qe,a(m).actionSearch]]),l("div",rb,[(_(!0),b(J,null,ge(r.value,O=>(_(),b("button",{key:O.action,type:"button",class:"action-choice","aria-pressed":O.action===s.value?.action?"true":"false",onClick:C=>c(O)},[l("strong",null,f(O.name),1),l("small",null,f(O.description?`${O.action} · ${O.description}`:O.action),1)],8,cb))),128)),r.value.length?G("",!0):(_(),b("p",ub,f(a(u)("editor.action.none_found")),1))])])):G("",!0),s.value&&!o.value?(_(),b("small",db,f(a(u)("editor.action.gone")),1)):G("",!0),o.value&&!i.value?(_(),b(J,{key:2},[(_(!0),b(J,null,ge(o.value.fields,O=>(_(),b("div",{key:O.key,class:"f"},[l("span",fb,f(O.required?O.name:a(u)("editor.action.optional",{name:O.name})),1),p(O)==="boolean"?(_(),at($t,{key:0,choices:[["",a(u)("editor.action.not_set")],["true",a(u)("editor.action.on")],["false",a(u)("editor.action.off")]],value:s.value?.data?.[O.key]===void 0?"":String(s.value?.data?.[O.key]),onPick:C=>d(O.key,C===""?void 0:C==="true")},null,8,["choices","value","onPick"])):$(O)&&$(O).length<=4?(_(),at($t,{key:1,choices:[["",a(u)("editor.action.not_set")],...$(O)],value:s.value?.data?.[O.key]===void 0?"":String(s.value?.data?.[O.key]),onPick:C=>d(O.key,C===""?void 0:C)},null,8,["choices","value","onPick"])):$(O)?(_(),b("select",{key:2,"aria-label":O.name,value:String(s.value?.data?.[O.key]??""),onChange:C=>d(O.key,C.target.value===""?void 0:C.target.value)},[l("option",hb,f(a(u)("editor.action.not_set")),1),(_(!0),b(J,null,ge($(O),([C,I])=>(_(),b("option",{key:C,value:C},f(I),9,mb))),128))],40,pb)):p(O)==="color_rgb"?(_(),b("div",gb,[l("input",{type:"color","aria-label":O.name,value:A(s.value?.data?.[O.key]),onInput:C=>d(O.key,[1,3,5].map(I=>parseInt(C.target.value.slice(I,I+2),16)))},null,40,vb),l("button",{type:"button",class:"btn quiet mini",onClick:C=>d(O.key,void 0)},f(a(u)("editor.action.not_set")),9,_b)])):p(O)==="number"||p(O)==="color_temp"?(_(),b("div",yb,[l("input",{type:"number","aria-label":O.name,min:g(O).min,max:g(O).max,step:g(O).step==="any"?"any":g(O).step,value:s.value?.data?.[O.key]??"",placeholder:v(O),onInput:C=>S(O,C.target.value)},null,40,bb),F(O)?(_(),b("span",wb,f(F(O)),1)):G("",!0)])):(_(),b("input",{key:5,type:"text","aria-label":O.name,value:T(s.value?.data?.[O.key]),placeholder:v(O),onInput:C=>k(O,C.target.value)},null,40,kb)),O.description?(_(),b("small",$b,f(O.description),1)):G("",!0)]))),128)),h.value.length?(_(),b("small",Sb,f(a(u)("editor.action.needs",{fields:h.value.join(", ")})),1)):G("",!0)],64)):G("",!0),a(Tn)(0,2,58)?G("",!0):(_(),b("small",xb,f(a(u)("editor.action.needs_firmware")),1))],64))]))}}),Eb={class:"f"},Tb={class:"f-label"},Ab=["aria-expanded"],Pb={class:"av mdi"},Lb={class:"tx"},Ib={class:"link"},Ob={key:0,class:"picker"},Nb=["placeholder","aria-label"],Mb=["aria-pressed","title"],Rb={class:"mdi"},Db=["aria-pressed","title"],Fb={class:"icon-list"},Ub={class:"icon-grid"},jb=["title","aria-label","aria-pressed","onClick"],Hb={class:"mdi"},Vb={key:0,class:"hint"},Wb={key:1},Xu=Me({__name:"IconPicker",props:{selected:{},automatic:{},autoLabel:{},allowNone:{type:Boolean},note:{}},emits:["pick"],setup(e,{emit:t}){const n=e,s=t,o=ke(""),i=L(()=>Zs(n.selected)),r=L(()=>n.selected==="none"?"":Le(i.value?.cp||n.automatic)),c=L(()=>n.selected==="none"?u("editor.icon.none"):i.value?.label||n.autoLabel),d=L(()=>{const h=o.value.trim().toLocaleLowerCase();return(m.inventory.icons?.groups||[]).map(p=>({label:p.label,icons:p.icons.filter(g=>!h||`${g.label} ${g.name.replaceAll("-"," ")} ${p.label}`.toLocaleLowerCase().includes(h))})).filter(p=>p.icons.length)});return(h,p)=>(_(),b("div",Eb,[l("span",Tb,f(a(u)("editor.icon.label")),1),l("button",{type:"button",class:"row","aria-expanded":a(m).iconPickerOpen?"true":"false",onClick:p[0]||(p[0]=g=>a(m).iconPickerOpen=!a(m).iconPickerOpen)},[l("span",Pb,f(r.value),1),l("span",Lb,[l("b",null,f(c.value),1)]),l("span",Ib,f(a(m).iconPickerOpen?a(u)("editor.common.close"):a(u)("editor.common.change")),1)],8,Ab),a(m).iconPickerOpen?(_(),b("div",Ob,[Pe(l("input",{"onUpdate:modelValue":p[1]||(p[1]=g=>o.value=g),type:"search",placeholder:a(u)("editor.icon.search"),"aria-label":a(u)("editor.icon.search_label")},null,8,Nb),[[Qe,o.value]]),l("button",{type:"button",class:"icon-choice icon-auto","aria-pressed":e.selected==="auto"?"true":"false",title:e.autoLabel,onClick:p[2]||(p[2]=g=>s("pick","auto"))},[l("span",Rb,f(a(Le)(e.automatic)),1),l("span",null,f(e.autoLabel),1)],8,Mb),e.allowNone?(_(),b("button",{key:0,type:"button",class:"icon-choice icon-auto","aria-pressed":e.selected==="none"?"true":"false",title:a(u)("editor.icon.none"),onClick:p[3]||(p[3]=g=>s("pick","none"))},[p[4]||(p[4]=l("span",{class:"mdi"},null,-1)),l("span",null,f(a(u)("editor.icon.none_text_only")),1)],8,Db)):G("",!0),l("div",Fb,[(_(!0),b(J,null,ge(d.value,g=>(_(),b("section",{key:g.label},[l("small",null,f(g.label),1),l("div",Ub,[(_(!0),b(J,null,ge(g.icons,v=>(_(),b("button",{key:v.name,type:"button",class:"icon-choice",title:v.label,"aria-label":a(u)("editor.icon.aria",{name:v.label}),"aria-pressed":e.selected===v.name?"true":"false",onClick:$=>s("pick",v.name)},[l("span",Hb,f(a(Le)(v.cp)),1)],8,jb))),128))])]))),128)),d.value.length?G("",!0):(_(),b("p",Vb,f(a(u)("editor.icon.none_found")),1))])])):G("",!0),e.note?(_(),b("small",Wb,f(e.note),1)):G("",!0)]))}}),Bb={class:"dr-head"},Kb={class:"tx"},Yb={class:"mono"},qb=["aria-label"],Gb={class:"dr-body"},Jb={class:"f"},Xb={class:"f-label",for:"tile-name"},zb=["value","placeholder"],Qb={key:1,class:"f"},Zb={class:"f-label"},e1={key:2,class:"f"},t1={class:"f-label"},n1={key:0,class:"warn"},s1={class:"f"},o1={class:"f-label"},i1={key:0},l1={key:3,class:"f"},a1={class:"f-label"},r1={key:4,class:"f"},c1={class:"f-label"},u1={key:5,class:"f"},d1={class:"f-label"},f1={key:7,class:"f"},p1={class:"f-label"},h1={key:0,class:"warn"},m1={key:8,class:"f"},g1={class:"f-label"},v1={class:"f"},_1={class:"f-label"},y1={class:"sw"},b1=["aria-label","aria-pressed","onClick"],w1={class:"dr-foot"},k1=Me({__name:"TileInspector",props:{tile:{}},setup(e){const t=e,n=L(()=>t.tile.entity.split(".")[0]),s=L(()=>Qs(t.tile.entity)),o=L(()=>gs(t.tile.entity)),i=L(()=>m.layout?It(et(m.layout),m.layout.pages):1),r=L(()=>At(t.tile.slot)+1),c=ae=>!m.layout?.tiles.some(ee=>At(ee.slot)===ae-1),d=L(()=>{const ae=Array.from({length:Math.min(mn,i.value+1)},(ee,Y)=>Y+1);return o.value>ae.length&&ae.push(o.value),ae.map(ee=>[ee,c(ee)?u("editor.tile.goes_to.empty",{page:ee}):String(ee)])}),h=L(()=>dr.value?o.value>i.value?{text:u("editor.tile.goes_to.no_page",{page:o.value}),warn:!0}:{text:u("editor.tile.goes_to.hint"),warn:!1}:{text:u("editor.tile.goes_to.needs_firmware"),warn:!1}),p=L(()=>!m.layout?.tiles.some(ae=>Se(ae)!==Se(t.tile)&&At(ae.slot)===r.value-1)),g=L(()=>{const ae=Array.from({length:i.value},(ee,Y)=>[Y+1,String(Y+1)]);return i.value<mn&&!(p.value&&r.value===i.value)&&ae.push([i.value+1,u("editor.tile.page.new")]),ae}),v=L(()=>(o.value?["single","wide"]:["single","wide","full"]).map(ae=>[ae,u(`editor.tile.size.${ae}`)])),$=L(()=>o.value?"":dr.value?u("editor.tile.size.full_hint"):u("editor.tile.size.needs_firmware")),U=L(()=>m.capabilities[t.tile.entity]),A=(ae,ee)=>t.tile.options?.[ae]??ee,T=L(()=>A("display",n.value==="screen"?"digital":"standard")),k=L(()=>{const ae=n.value==="screen"?["digital","analog"]:["standard","watch"],ee=U.value;return n.value==="weather"&&(!ee||ee.displays.includes("forecast")||T.value==="forecast")&&ae.push("forecast"),n.value==="sensor"&&(!ee||ee.displays.includes("graph")||T.value==="graph")&&ae.push("graph"),n.value==="sun"&&ae.push("sunpath"),ae.map(Y=>[Y,u(`editor.tile.display.${Y}`)])}),S=L(()=>{const ae=U.value;return ae&&T.value==="graph"&&!ae.displays.includes("graph")?u("editor.tile.display.no_graph"):ae&&T.value==="forecast"&&!ae.displays.includes("forecast")?u("editor.tile.display.no_forecast"):""}),F=L(()=>A("size","single")),x=L(()=>m.inventory.controls?.[n.value]),j=L(()=>A("controls",F.value==="full"?"none":x.value?.default)),O=L(()=>{const ae=U.value;return(x.value?.choices||[]).filter(ee=>!ae||ee.key==="none"||ee.key===j.value||ae.controls.includes(ee.key)).map(ee=>[ee.key,ee.label])}),C=L(()=>{const ae=U.value;return ae&&j.value!=="none"&&!ae.controls.includes(j.value)?{text:u("editor.tile.controls.not_offered"),warn:!0}:{text:Tn(0,2,19)?u(F.value==="full"?"editor.tile.controls.full_hint":"editor.tile.controls.wide_hint"):u("editor.tile.controls.needs_firmware"),warn:!1}}),I=L(()=>A("tap","auto")),K=L(()=>{const ae=["auto","detail","none"];return((U.value?U.value.toggle:ur.includes(n.value))||I.value==="toggle")&&ae.push("toggle"),ae.push("action"),ae.map(ee=>[ee,u(`editor.tile.tap.${ee}`)])}),M=L(()=>I.value==="toggle"&&U.value&&!U.value.toggle?{text:u("editor.tile.tap.no_toggle"),warn:!0}:I.value==="toggle"&&!ur.includes(n.value)&&!Tn(0,2,58)?{text:u("editor.tile.tap.toggle_needs_firmware"),warn:!1}:I.value==="toggle"?{text:u("editor.tile.tap.hold"),warn:!1}:null),he=L(()=>A("inline","none")),z=L(()=>Ym.includes(n.value)&&(!U.value||U.value.inline||he.value==="slider")),oe=L(()=>he.value==="slider"&&U.value&&!U.value.inline),pe=L(()=>A("history_hours",24)),se=L(()=>Object.entries(m.inventory.backgrounds||{})),ce=L(()=>!!m.inventory.entities.find(ae=>ae.id===t.tile.entity)?.icon),ye=L(()=>!!m.inventory.icons&&(n.value!=="screen"||o.value>0)&&!["forecast","sunpath"].includes(T.value));function $e(ae){t.tile.name=ae,mt()}function Ge(){m.inspector={kind:"inspect",entity:t.tile.entity}}return(ae,ee)=>(_(),b(J,null,[l("div",Bb,[l("span",{class:"av mdi",style:He({color:a(Bt)(e.tile.entity)[2],background:a(Bt)(e.tile.entity)[3]})},f(a(Le)(a($s)(e.tile))),5),l("span",Kb,[l("b",null,f(e.tile.name||s.value),1),l("small",Yb,f(e.tile.entity),1)]),l("button",{type:"button",class:"icon-btn","aria-label":a(u)("editor.common.close"),onClick:ee[0]||(ee[0]=(...Y)=>a(tt)&&a(tt)(...Y))},"✕",8,qb)]),l("div",Gb,[l("div",Jb,[l("label",Xb,f(a(u)("editor.tile.name")),1),l("input",{id:"tile-name",value:e.tile.name,placeholder:s.value,maxlength:"60",onInput:ee[1]||(ee[1]=Y=>$e(Y.target.value))},null,40,zb)]),ye.value?(_(),at(Xu,{key:0,selected:e.tile.options?.icon||"auto",automatic:a(In)(e.tile.entity),"auto-label":a(u)(ce.value?"editor.tile.icon.auto_ha":"editor.tile.icon.auto_default"),note:a(Tn)(0,2,18)?"":a(u)("editor.tile.icon.needs_firmware"),onPick:ee[2]||(ee[2]=Y=>a(wn)(e.tile,"icon",Y))},null,8,["selected","automatic","auto-label","note"])):G("",!0),o.value?(_(),b("div",Qb,[l("span",Zb,f(a(u)("editor.tile.goes_to.label")),1),ne($t,{choices:d.value,value:o.value,onPick:ee[3]||(ee[3]=Y=>a(fg)(e.tile,Number(Y)))},null,8,["choices","value"]),l("small",{class:ve({warn:h.value.warn})},f(h.value.text),3)])):(_(),b("div",e1,[l("span",t1,f(a(u)("editor.tile.display.label")),1),ne($t,{choices:k.value,value:T.value,onPick:ee[4]||(ee[4]=Y=>a(wn)(e.tile,"display",Y))},null,8,["choices","value"]),S.value?(_(),b("small",n1,f(S.value),1)):G("",!0)])),l("div",s1,[l("span",o1,f(a(u)("editor.tile.size.label")),1),ne($t,{choices:v.value,value:F.value,onPick:ee[5]||(ee[5]=Y=>a(wn)(e.tile,"size",Y))},null,8,["choices","value"]),$.value?(_(),b("small",i1,f($.value),1)):G("",!0)]),g.value.length>1?(_(),b("div",l1,[l("span",a1,f(a(u)("editor.tile.page.label")),1),ne($t,{choices:g.value,value:r.value,onPick:ee[6]||(ee[6]=Y=>a(ug)(e.tile,Number(Y)-1))},null,8,["choices","value"])])):G("",!0),x.value&&F.value!=="single"&&!o.value?(_(),b("div",r1,[l("span",c1,f(a(u)("editor.tile.controls.label")),1),ne($t,{choices:O.value,value:j.value,onPick:ee[7]||(ee[7]=Y=>a(wn)(e.tile,"controls",Y))},null,8,["choices","value"]),l("small",{class:ve({warn:C.value.warn})},f(C.value.text),3)])):G("",!0),n.value!=="screen"&&!o.value?(_(),b("div",u1,[l("span",d1,f(a(u)("editor.tile.tap.label")),1),ne($t,{choices:K.value,value:I.value,onPick:ee[8]||(ee[8]=Y=>a(wn)(e.tile,"tap",Y))},null,8,["choices","value"]),M.value?(_(),b("small",{key:0,class:ve({warn:M.value.warn})},f(M.value.text),3)):G("",!0)])):G("",!0),n.value!=="screen"&&!o.value&&I.value==="action"?(_(),at(Cb,{key:6,tile:e.tile},null,8,["tile"])):G("",!0),z.value&&!o.value?(_(),b("div",f1,[l("span",p1,f(a(u)("editor.tile.slider.label")),1),ne($t,{choices:[["none",a(u)("editor.tile.slider.no")],["slider",a(u)("editor.tile.slider.yes")]],value:he.value,onPick:ee[9]||(ee[9]=Y=>a(wn)(e.tile,"inline",Y))},null,8,["choices","value"]),oe.value?(_(),b("small",h1,f(a(u)("editor.tile.slider.nothing")),1)):G("",!0)])):G("",!0),n.value==="sensor"&&!o.value?(_(),b("div",m1,[l("span",g1,f(a(u)("editor.tile.history.label")),1),ne($t,{choices:[1,6,24].map(Y=>[Y,a(u)("editor.tile.history.hours",Y)]),value:pe.value,onPick:ee[10]||(ee[10]=Y=>a(wn)(e.tile,"history_hours",Number(Y)))},null,8,["choices","value"])])):G("",!0),l("div",v1,[l("span",_1,f(a(u)("editor.tile.background.label")),1),l("div",y1,[(_(!0),b(J,null,ge(se.value,([Y,fe])=>(_(),b("button",{key:Y,type:"button","aria-label":a(u)("editor.tile.background.aria",{name:fe.label}),"aria-pressed":(e.tile.options?.background||"auto")===Y?"true":"false",onClick:me=>a(wn)(e.tile,"background",Y)},[l("i",{class:ve(fe.color?"":Y==="none"?"none":"auto"),style:He(fe.color?{background:fe.color}:void 0)},null,6),Re(f(fe.label),1)],8,b1))),128))])])]),l("div",w1,[l("button",{type:"button",class:"btn danger",onClick:ee[11]||(ee[11]=Y=>a(Uu)(e.tile))},f(a(u)("editor.common.remove")),1),ee[12]||(ee[12]=l("span",{class:"spacer"},null,-1)),n.value!=="screen"?(_(),b("button",{key:0,type:"button",class:"btn quiet",onClick:Ge},f(a(u)("editor.common.read_current_data")),1)):G("",!0)])],64))}}),$1={class:"dr-head"},S1={class:"av mdi",style:{background:"var(--seg)",color:"var(--ink-2)"}},x1={class:"tx"},C1=["aria-label"],E1={class:"dr-body"},T1={class:"f"},A1={class:"f-label",for:"title"},P1=["value","placeholder"],L1={class:"f"},I1={class:"f-label",id:"topbar-caption"},O1={style:{"text-transform":"none","letter-spacing":"0","font-weight":"500"}},N1={class:"items",id:"topbar-chips",role:"list","aria-labelledby":"topbar-caption"},M1=["data-index","aria-label","onPointerdown","onClick","onKeydown"],R1={class:"tx"},D1=["aria-label","onClick"],F1=["disabled","title"],U1={class:"live",id:"topbar-live"},j1={class:"f"},H1={class:"f-label"},V1={class:"f"},W1={class:"f-label"},B1={href:"#settings"},K1={key:2},Y1={key:0,class:"dr-foot"},q1=["disabled"],G1=["disabled"],J1=Me({__name:"TopbarInspector",props:{index:{}},setup(e){const t=e,n=L(()=>vn()),s=L(()=>n.value[t.index]),o=L(()=>(m.fontsVersion,m.now,m.topbarPreviews,Ou(n.value,Ru.value,m.layout?.title||sn("editor.mockup.home"),kn))),i=L(()=>o.value.dropped),r=L(()=>m.inventory.header?.min_firmware||"0.2.32"),c=L(()=>{const[z,oe,pe]=r.value.split(".").map(Number);return Tn(z,oe,pe)}),d=L(()=>c.value?u(i.value.size?"editor.topbar.hint.overflow":"editor.topbar.hint.reorder"):u("editor.topbar.hint.needs_firmware",{version:r.value})),h=(z,oe)=>{const pe=kn(z);return pe.shown?i.value.has(oe)?u("editor.topbar.detail.overflow"):pe.analog?u("editor.topbar.detail.dial"):pe.text:u("editor.topbar.detail.hidden")},p=z=>{const oe=kn(z);return oe.analog||z.type!=="entity"?Zs(Iu[z.type])?.cp:oe.icon},g=z=>m.topbarAdded?.key===ct(z)&&Date.now()-m.topbarAdded.time<1200;function v(z){m.layout&&(m.layout.title=z,mt())}function $(z){const oe=[...n.value];oe[t.index]={...oe[t.index],...z},Ws(oe)}const U=L(()=>s.value?kn(s.value).shown?i.value.has(t.index)?u("editor.topbar.live.overflow"):u("editor.topbar.live.looks"):u("editor.topbar.live.hidden"):""),A=L(()=>({clock:Zo(hs.value,new Date(m.now)),analog:u("editor.topbar.analog_sample"),date:Rl(new Date(m.now),ps.value)})),T=ke({index:-1,active:!1,moved:!1});let k=null,S=0,F=null,x=0;function j(z,oe){z.button!==0||z.target.closest(".x")||(z.pointerType!=="touch"&&z.preventDefault(),T.value={index:oe,active:!1,moved:!1},k={x:z.clientX,y:z.clientY},F=z.pointerId,clearTimeout(S),z.pointerType==="touch"&&(S=window.setTimeout(O,260)),document.addEventListener("pointermove",I),document.addEventListener("pointerup",K),document.addEventListener("pointercancel",K))}function O(){T.value.active=!0,document.addEventListener("touchmove",C,{passive:!1})}function C(z){T.value.active&&z.preventDefault()}function I(z){if(z.pointerId!==F||!k)return;if(!T.value.active){const se=Math.hypot(z.clientX-k.x,z.clientY-k.y);if(z.pointerType==="touch"){se>10&&(clearTimeout(S),k=null);return}if(se<6)return;O()}const oe=[...document.querySelectorAll(".items .item[data-index]")];let pe=T.value.index;if(oe.forEach((se,ce)=>{const ye=se.getBoundingClientRect();ce<T.value.index&&z.clientY<ye.top+ye.height/2&&(pe=Math.min(pe,ce)),ce>T.value.index&&z.clientY>ye.top+ye.height/2&&(pe=Math.max(pe,ce))}),pe!==T.value.index&&m.layout){const se=[...n.value];se.splice(pe,0,...se.splice(T.value.index,1)),m.layout.header={items:se};const ce=t.index===T.value.index;T.value.index=pe,T.value.moved=!0,ce&&nn(pe)}}function K(z){z.pointerId===F&&(clearTimeout(S),document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("touchmove",C),T.value.active&&(x=Date.now()+400,T.value.moved&&mt()),T.value={index:-1,active:!1,moved:!1},k=null,F=null)}function M(z){Date.now()<x||nn(z)}function he(z,oe){if(z.key==="Enter"||z.key===" "){z.preventDefault(),nn(oe);return}const pe={ArrowUp:-1,ArrowDown:1}[z.key];pe&&Ci(oe,oe+pe)&&(t.index===oe&&nn(oe+pe),z.preventDefault())}return(z,oe)=>{const pe=Gs("i18n-t");return _(),b(J,null,[l("div",$1,[l("span",S1,f(s.value?a(Le)(p(s.value)||"F0150"):a(Le)("F0150")),1),l("span",x1,[l("b",null,f(s.value?s.value.type==="entity"?a(Qs)(s.value.entity):a(Ss)(s.value):a(u)("editor.topbar.title")),1),l("small",{class:ve({mono:s.value?.type==="entity"})},f(s.value?s.value.type==="entity"?s.value.entity:a(u)("editor.topbar.builtin"):a(u)("editor.topbar.items",{used:n.value.length},a(Sn)())),3)]),l("button",{type:"button",class:"icon-btn","aria-label":a(u)("editor.common.close"),onClick:oe[0]||(oe[0]=(...se)=>a(tt)&&a(tt)(...se))},"✕",8,C1)]),l("div",E1,[l("div",T1,[l("label",A1,f(a(u)("editor.topbar.name")),1),l("input",{id:"title",value:a(m).layout?.title,maxlength:"60",placeholder:a(u)("editor.topbar.name_placeholder"),onInput:oe[1]||(oe[1]=se=>v(se.target.value))},null,40,P1)]),l("div",L1,[l("span",I1,[Re(f(a(u)("editor.topbar.right"))+" ",1),l("span",O1," · "+f(n.value.length)+" / "+f(a(Sn)()),1)]),l("div",N1,[(_(!0),b(J,null,ge(n.value,(se,ce)=>(_(),b("div",{key:a(ct)(se)+ce,class:ve(["item",{selected:ce===e.index,"is-hidden":!a(kn)(se).shown,"is-overflow":i.value.has(ce),"just-added":g(se),"dragging-chip":T.value.active&&T.value.index===ce}]),role:"listitem",tabindex:"0","data-index":ce,"aria-label":a(u)("editor.topbar.item_label",{name:a(Ss)(se),slot:ce+1}),onPointerdown:ye=>j(ye,ce),onClick:ye=>M(ce),onKeydown:ye=>he(ye,ce)},[oe[9]||(oe[9]=l("span",{class:"grip","aria-hidden":"true"},"⋮⋮",-1)),l("span",{class:"av mdi",style:He(a(kn)(se).color?{color:a(kn)(se).color}:void 0)},f(p(se)?a(Le)(p(se)):""),5),l("span",R1,[l("b",null,f(a(Ss)(se)),1),l("small",null,f(h(se,ce)),1)]),l("button",{type:"button",class:"x","aria-label":a(u)("editor.topbar.remove_named",{name:a(Ss)(se)}),onClick:Lt(ye=>a(gr)(ce),["stop"])},"✕",8,D1)],42,M1))),128)),l("button",{type:"button",class:"ghost-btn",id:"topbar-add",disabled:n.value.length>=a(Sn)(),title:n.value.length>=a(Sn)()?a(u)("editor.topbar.max",a(Sn)()):a(u)("editor.topbar.add_title"),onClick:oe[2]||(oe[2]=(...se)=>a(hr)&&a(hr)(...se))},f(a(u)("editor.topbar.add_button")),9,F1)]),l("small",{id:"topbar-hint",class:ve({warn:i.value.size>0&&c.value})},f(d.value),3)]),s.value?(_(),b(J,{key:0},[l("div",U1,[l("small",null,f(U.value),1),ne(Ju,{items:[s.value],single:""},null,8,["items"])]),s.value.type==="entity"?(_(),b(J,{key:0},[l("div",j1,[l("span",H1,f(a(u)("editor.topbar.content.label")),1),ne($t,{choices:(a(m).inventory.header?.contents||[]).map(se=>[se.key,se.label]),value:s.value.content,onPick:oe[3]||(oe[3]=se=>$({content:se}))},null,8,["choices","value"]),l("small",null,f(a(u)("editor.topbar.content.hint")),1)]),ne(Xu,{selected:s.value.icon||"auto",automatic:a(m).topbarPreviews[a(ct)(s.value)]?.auto_icon||a(In)(s.value.entity),"auto-label":a(u)("editor.topbar.auto_icon"),"allow-none":"",onPick:oe[4]||(oe[4]=se=>$({icon:se}))},null,8,["selected","automatic","auto-label"]),l("div",V1,[l("span",W1,f(a(u)("editor.topbar.show.label")),1),ne($t,{choices:(a(m).inventory.header?.shows||[]).map(se=>[se.key,se.label]),value:s.value.show,onPick:oe[5]||(oe[5]=se=>$({show:se}))},null,8,["choices","value"]),l("small",null,f(a(u)("editor.topbar.show.hint")),1)])],64)):s.value.type!=="date"?(_(),at(pe,{key:1,keypath:a(hs)?"editor.topbar.clock_24":"editor.topbar.clock_12",tag:"small",id:"topbar-clock",scope:"global"},{settings:ie(()=>[l("a",B1,f(a(u)("editor.topbar.clock_settings")),1)]),_:1},8,["keypath"])):(_(),b("small",K1,f(a(u)("editor.topbar.date_hint",{date:A.value.date})),1))],64)):G("",!0)]),s.value?(_(),b("div",Y1,[l("button",{type:"button",class:"btn danger",onClick:oe[6]||(oe[6]=se=>a(gr)(e.index))},f(a(u)("editor.common.remove")),1),oe[10]||(oe[10]=l("span",{class:"spacer"},null,-1)),l("button",{type:"button",class:"btn quiet",disabled:e.index===0,onClick:oe[7]||(oe[7]=se=>a(Ci)(e.index,e.index-1)&&a(nn)(e.index-1))},f(a(u)("editor.topbar.up")),9,q1),l("button",{type:"button",class:"btn quiet",disabled:e.index>=n.value.length-1,onClick:oe[8]||(oe[8]=se=>a(Ci)(e.index,e.index+1)&&a(nn)(e.index+1))},f(a(u)("editor.topbar.down")),9,G1)])):G("",!0)],64)}}}),X1={class:"dr-head"},z1={class:"tx"},Q1=["aria-label"],Z1={class:"dr-body"},ew={class:"f"},tw={class:"f-label"},nw={class:"options"},sw=["disabled","onClick"],ow={class:"mdi"},iw={class:"tx"},lw={key:0,class:"f"},aw={class:"f-label"},rw={class:"options"},cw=["disabled","onClick"],uw={class:"mdi"},dw={class:"tx"},fw={class:"f"},pw={class:"f-label",for:"topbar-search"},hw=["placeholder","aria-label"],mw={class:"options"},gw=["disabled","onClick"],vw={class:"mdi"},_w={class:"tx"},yw={key:0,class:"hint"},bw={key:1,class:"hint"},ww={class:"dr-foot"},kw=Me({__name:"TopbarAdd",setup(e){const t=ke(""),n=L(()=>new Set(vn().map(ct))),s=L(()=>({clock:Zo(hs.value,new Date(m.now)),analog:u("editor.topbar.analog_sample"),date:Rl(new Date(m.now),ps.value)})),o=L(()=>m.inventory.header?.suggestions?.[m.selected||""]||[]),i=L(()=>{const c=t.value.trim().toLocaleLowerCase();return m.inventory.entities.filter(d=>`${d.name} ${d.id} ${d.area||""} ${d.device||""}`.toLocaleLowerCase().includes(c))}),r=c=>({type:"entity",entity:c,content:"state",icon:"auto",show:"always"});return(c,d)=>(_(),b(J,null,[l("div",X1,[d[3]||(d[3]=l("span",{class:"av",style:{background:"var(--seg)",color:"var(--ink-2)","font-size":"18px"}},"+",-1)),l("span",z1,[l("b",null,f(a(u)("editor.topbar.add.title")),1),l("small",null,f(a(u)("editor.topbar.add.slots",{used:a(vn)().length},a(Sn)())),1)]),l("button",{type:"button",class:"icon-btn","aria-label":a(u)("editor.common.close"),onClick:d[0]||(d[0]=(...h)=>a(tt)&&a(tt)(...h))},"✕",8,Q1)]),l("div",Z1,[l("div",ew,[l("span",tw,f(a(u)("editor.topbar.add.builtin")),1),l("div",nw,[(_(!0),b(J,null,ge(a(m).inventory.header?.builtin||[],h=>(_(),b("button",{key:h.type,type:"button",class:"option",disabled:n.value.has(a(ct)({type:h.type})),onClick:p=>a(Ei)({type:h.type})},[l("span",ow,f(a(Le)(a(Zs)(a(Iu)[h.type])?.cp||"F0150")),1),l("span",iw,[l("strong",null,f(h.label),1),l("small",null,f(n.value.has(a(ct)({type:h.type}))?a(u)("editor.topbar.add.added"):s.value[h.type]),1)])],8,sw))),128))])]),o.value.length?(_(),b("div",lw,[l("span",aw,f(a(u)("editor.topbar.add.suggestions")),1),l("div",rw,[(_(!0),b(J,null,ge(o.value,h=>(_(),b("button",{key:a(ct)(h.item),type:"button",class:"option",disabled:n.value.has(a(ct)(h.item)),onClick:p=>a(Ei)(h.item)},[l("span",uw,f(a(Le)(h.icon||a(In)(h.item.entity))),1),l("span",dw,[l("strong",null,f(h.label),1),l("small",null,f(n.value.has(a(ct)(h.item))?a(u)("editor.topbar.add.added"):[h.name,h.area].filter(Boolean).join(" · ")),1)])],8,cw))),128))])])):G("",!0),l("div",fw,[l("label",pw,f(a(u)("editor.topbar.add.entity")),1),Pe(l("input",{id:"topbar-search","onUpdate:modelValue":d[1]||(d[1]=h=>t.value=h),type:"search",placeholder:a(u)("editor.topbar.add.search"),"aria-label":a(u)("editor.topbar.add.search_label")},null,8,hw),[[Qe,t.value]]),l("div",mw,[(_(!0),b(J,null,ge(i.value.slice(0,40),h=>(_(),b("button",{key:h.id,type:"button",class:"option",disabled:n.value.has(a(ct)(r(h.id))),onClick:p=>a(Ei)(r(h.id))},[l("span",vw,f(a(Le)(a(In)(h.id))),1),l("span",_w,[l("strong",null,f(h.name),1),l("small",null,f([h.area,h.id].filter(Boolean).join(" · ")),1)])],8,gw))),128)),i.value.length?i.value.length>40?(_(),b("p",bw,f(a(u)("editor.common.results",i.value.length)),1)):G("",!0):(_(),b("p",yw,f(a(u)("editor.topbar.add.none_found")),1))])])]),l("div",ww,[d[4]||(d[4]=l("span",{class:"spacer"},null,-1)),l("button",{type:"button",class:"btn quiet",onClick:d[2]||(d[2]=(...h)=>a(tt)&&a(tt)(...h))},f(a(u)("editor.common.cancel")),1)])],64))}}),$w={class:"dr-head"},Sw={class:"tx"},xw=["aria-label"],Cw={class:"dr-body",id:"inspector-section"},Ew={id:"inspection-summary"},Tw={key:0,class:"hint warn"},Aw={key:1,class:"hint"},Pw={id:"inspection"},Lw={class:"dr-foot"},Iw=Me({__name:"InspectPanel",props:{entity:{}},setup(e){const t=e,n=ke(null),s=ke(u("editor.inspect.reading")),o=ke("");async function i(){if(m.selected){n.value=null,o.value="",s.value=u("editor.inspect.fetching");try{const c=await Dt(`screens/${encodeURIComponent(m.selected)}/inspect`),d=t.entity?c.tiles.filter(h=>h.entity===t.entity):c.tiles;n.value=d,s.value=JSON.stringify(t.entity?d[0]:c,null,2)}catch(c){o.value=c.message,s.value="",Ce(c.message)}}}const r=c=>{const d=m.layout?.tiles.find(h=>h.entity===c)?.options||{};return u("editor.inspect.options",{slider:u(d.inline==="slider"?"editor.inspect.yes":"editor.inspect.no"),display:Lu(d.display||"standard"),size:Km(d.size),control:jm({entity:c,options:d},m.inventory),background:m.inventory.backgrounds?.[d.background||"auto"]?.label||u("editor.inspect.background_default")})};return Mn(i),Et(()=>t.entity,i),(c,d)=>(_(),b(J,null,[l("div",$w,[d[1]||(d[1]=l("span",{class:"av",style:{background:"var(--seg)",color:"var(--ink-2)","font-size":"16px"}},"⌕",-1)),l("span",Sw,[l("b",null,f(a(u)("editor.inspect.title")),1),l("small",{class:ve({mono:e.entity})},f(e.entity||a(u)("editor.inspect.subtitle")),3)]),l("button",{type:"button",class:"icon-btn","aria-label":a(u)("editor.common.close"),onClick:d[0]||(d[0]=(...h)=>a(tt)&&a(tt)(...h))},"✕",8,xw)]),l("div",Cw,[l("div",Ew,[o.value?(_(),b("p",Tw,f(o.value),1)):n.value?G("",!0):(_(),b("p",Aw,f(a(u)("editor.inspect.fetching")),1)),(_(!0),b(J,null,ge(n.value||[],(h,p)=>(_(),b("article",{key:p,class:"inspection-tile"},[l("strong",null,f(h.entity),1),l("span",null,f(a(u)("editor.inspect.status",{status:h.word||h.state})),1),l("small",null,f(r(h.entity)),1)]))),128))]),l("pre",Pw,f(s.value),1)]),l("div",Lw,[l("button",{type:"button",class:"btn quiet",onClick:i},f(a(u)("editor.inspect.read_again")),1),d[2]||(d[2]=l("span",{class:"spacer"},null,-1))])],64))}}),Ow=["aria-hidden"],Nw=Me({__name:"Drawer",setup(e){const t=L(()=>!!(m.inspector&&(m.inspector.kind!=="tile"||bi.value)));return(n,s)=>(_(),b("aside",{class:ve(["drawer",{open:t.value}]),id:"tile-sheet","aria-hidden":t.value?"false":"true",onClick:s[0]||(s[0]=Lt(()=>{},["stop"]))},[a(m).inspector?(_(),b(J,{key:0},[a(m).inspector.kind==="tile"&&a(bi)?(_(),at(k1,{key:0,tile:a(bi)},null,8,["tile"])):a(m).inspector.kind==="bar"?(_(),at(J1,{key:1,index:a(m).inspector.index},null,8,["index"])):a(m).inspector.kind==="bar-add"?(_(),at(kw,{key:2})):a(m).inspector.kind==="inspect"?(_(),at(Iw,{key:3,entity:a(m).inspector.entity},null,8,["entity"])):G("",!0)],64)):G("",!0)],10,Ow))}}),Mw={class:"main-head"},Rw={class:"eyebrow",id:"screen-name"},Dw=["title"],Fw={class:"head-right"},Uw={class:"seg",role:"tablist"},jw=["aria-pressed"],Hw=["aria-pressed"],Vw={key:1,id:"dirty",class:"chip dirty"},Ww=["disabled"],Bw={key:0,class:"spin small"},Kw=["aria-label","aria-expanded"],Yw={key:3,class:"menu",role:"menu"},qw=["disabled","title"],Gw=["disabled","aria-expanded"],Jw={key:0,class:"sub"},Xw=["onClick"],zw=["disabled","title"],Qw={class:"body",id:"body"},Zw=Me({__name:"ScreenView",setup(e){const t=L(()=>wt.value),n=L(()=>t.value.online?`${t.value.delivery} · ${t.value.status}`:u("editor.screen_view.offline")),s=L(()=>Ku(t.value)&&t.value.online&&t.value.update?.profile&&t.value.update?.host),o=L(()=>m.inventory.screens.filter(A=>A.id!==t.value.id&&A.layout?.tiles?.length)),i=ke(!1),r=ke(null);function c(){m.menuOpen=!1,i.value=!1}function d(){c(),m.overrideProfile=t.value.update?.profile||null,m.overrideFriendly=t.value.name,We("#override")}function h(){c(),m.selectedTile=null,m.inspector={kind:"inspect"}}function p(A){c(),!(m.dirty&&!confirm(u("editor.screen_view.confirm.copy")))&&mg(A)}function g(){c(),r.value?.click()}async function v(A){const T=A.target,k=T.files?.[0];T.value="",k&&(m.dirty&&!confirm(u("editor.screen_view.confirm.import"))||vg(await k.text()))}function $(A){if(A.key==="Escape")if(m.menuOpen)c();else{if(m.palette)return;m.inspector&&!A.target?.closest?.(".picker")&&tt()}else(A.metaKey||A.ctrlKey)&&A.key.toLowerCase()==="s"&&(A.preventDefault(),m.dirty&&tl())}function U(A){m.menuOpen&&!A.target.closest(".head-right .menu, #more")&&c()}return Mn(()=>{document.addEventListener("keydown",$),document.addEventListener("click",U)}),ms(()=>{document.removeEventListener("keydown",$),document.removeEventListener("click",U)}),(A,T)=>(_(),b(J,null,[l("header",Mw,[l("div",null,[l("span",Rw,f(t.value.name),1),l("h1",null,f(a(m).layout?.title||a(sn)("editor.mockup.home")),1)]),l("span",{id:"delivery",class:ve(["chip",{off:!t.value.online}]),title:n.value},[T[9]||(T[9]=l("span",{class:"dot"},null,-1)),Re(f(n.value),1)],10,Dw),l("div",Fw,[l("div",Uw,[l("button",{type:"button",id:"tab-layout",role:"tab","aria-pressed":a(m).tab==="layout"?"true":"false",onClick:T[0]||(T[0]=k=>a(m).tab="layout")},f(a(u)("editor.screen_view.tabs.layout")),9,jw),l("button",{type:"button",id:"tab-settings",role:"tab","aria-pressed":a(m).tab==="settings"?"true":"false",onClick:T[1]||(T[1]=k=>{a(m).tab="settings",a(tt)()})},f(a(u)("editor.screen_view.tabs.settings")),9,Hw)]),a(m).dirty?(_(),b("span",Vw,f(a(u)("editor.common.unsaved")),1)):(_(),b("span",{key:0,id:"dirty",class:ve(["chip",{sent:a(m).saved}])},f(a(m).saved?a(u)("editor.screen_view.sent"):a(u)("editor.screen_view.all_saved")),3)),a(m).dirty?(_(),b("button",{key:2,id:"save",type:"button",class:"btn primary",disabled:a(m).busy,title:"⌘S",onClick:T[2]||(T[2]=k=>a(tl)())},[a(m).busy?(_(),b("span",Bw)):G("",!0),Re(f(a(m).busy?a(u)("editor.common.saving"):a(u)("editor.common.save_send")),1)],8,Ww)):G("",!0),l("button",{id:"more",type:"button",class:"icon-btn","aria-label":a(u)("editor.screen_view.more"),"aria-haspopup":"menu","aria-expanded":a(m).menuOpen?"true":"false",onClick:T[3]||(T[3]=Lt(k=>{a(m).menuOpen=!a(m).menuOpen,i.value=!1},["stop"]))},"···",8,Kw),a(m).menuOpen?(_(),b("div",Yw,[l("button",{type:"button",role:"menuitem",id:"identify",disabled:!a(Jn)(t.value)||!t.value.online,title:a(Jn)(t.value)?"":a(u)("editor.screen_view.menu.identify_needs"),onClick:T[4]||(T[4]=k=>{c(),a(ju)(t.value)})},[Re(f(a(u)("editor.screen_view.menu.identify"))+" ",1),l("small",null,f(a(u)("editor.screen_view.menu.identify_hint")),1)],8,qw),l("button",{type:"button",role:"menuitem",id:"inspect",onClick:h},[Re(f(a(u)("editor.common.read_current_data"))+" ",1),l("small",null,f(a(u)("editor.screen_view.menu.inspect_hint")),1)]),T[12]||(T[12]=l("div",{class:"sep"},null,-1)),l("button",{type:"button",role:"menuitem",id:"copy-layout",disabled:!o.value.length,"aria-expanded":i.value?"true":"false",onClick:T[5]||(T[5]=Lt(k=>i.value=!i.value,["stop"]))},[Re(f(a(u)("editor.screen_view.menu.copy"))+" ",1),l("small",null,f(o.value.length?a(u)("editor.screen_view.menu.copy_screens",o.value.length):a(u)("editor.screen_view.menu.copy_none")),1)],8,Gw),i.value?(_(),b("div",Jw,[(_(!0),b(J,null,ge(o.value,k=>(_(),b("button",{key:k.id,type:"button",role:"menuitem",onClick:S=>p(k.id)},[Re(f(k.name)+" ",1),l("small",null,f(a(u)("editor.screen_view.menu.copy_tiles",k.layout.tiles.length)),1)],8,Xw))),128))])):G("",!0),l("button",{type:"button",role:"menuitem",id:"export-layout",onClick:T[6]||(T[6]=k=>{c(),a(Vu)()})},[Re(f(a(u)("editor.screen_view.menu.export"))+" ",1),T[10]||(T[10]=l("small",null,"JSON",-1))]),l("button",{type:"button",role:"menuitem",id:"import-layout",onClick:g},[Re(f(a(u)("editor.screen_view.menu.import"))+" ",1),T[11]||(T[11]=l("small",null,"JSON",-1))]),T[13]||(T[13]=l("div",{class:"sep"},null,-1)),l("button",{type:"button",role:"menuitem",id:"open-override",disabled:!t.value.update?.profile,title:t.value.update?.profile?"":a(u)("editor.screen_view.menu.override_none"),onClick:d},[Re(f(a(u)("editor.screen_view.menu.override"))+" ",1),l("small",null,f(a(u)("editor.screen_view.menu.override_hint")),1)],8,zw),l("button",{type:"button",role:"menuitem",onClick:T[7]||(T[7]=k=>{c(),a(We)("#firmware")})},f(a(u)("editor.nav.firmware")),1),s.value?(_(),b("button",{key:1,type:"button",role:"menuitem",onClick:T[8]||(T[8]=k=>{c(),a(sl)(t.value)})},[Re(f(a(u)("editor.screen_view.menu.update"))+" ",1),l("small",null,f(t.value.update?.target),1)])):G("",!0)])):G("",!0),l("input",{ref_key:"fileInput",ref:r,type:"file",accept:"application/json,.json",hidden:"",onChange:v},null,544)])]),l("div",Qw,[a(m).tab==="layout"?(_(),at(Iy,{key:0})):(_(),at(Jy,{key:1})),ne(Nw)])],64))}}),ek={key:0,id:"choose",class:"empty"},tk={key:1,id:"empty",class:"empty"},nk=Me({__name:"EmptyState",setup(e){return(t,n)=>a(m).inventory.screens.length?(_(),b("section",ek,[n[1]||(n[1]=l("span",{class:"empty-icon"},"▦",-1)),l("h2",null,f(a(u)("editor.empty.choose.title")),1),l("p",null,f(a(u)("editor.empty.choose.text")),1)])):(_(),b("section",tk,[n[2]||(n[2]=l("span",{class:"empty-icon"},"▦",-1)),l("h2",null,f(a(u)("editor.empty.start.title")),1),l("p",null,f(a(u)("editor.empty.start.text")),1),l("button",{id:"start",type:"button",class:"btn primary",onClick:n[0]||(n[0]=s=>a(We)("#new-screen"))},f(a(u)("editor.empty.start.button")),1)]))}}),sk={class:"panel",id:"settings-view"},ok={class:"panel-head"},ik={class:"tx"},lk={class:"eyebrow"},ak={id:"settings-title"},rk={class:"card-grid"},ck={class:"card"},uk={class:"tools"},dk={class:"tx"},fk={class:"tx"},pk={key:0,class:"card updates",id:"updates"},hk={id:"updates-hint"},mk=["aria-valuenow"],gk={class:"progress-text"},vk={key:0,class:"log-lines"},_k={key:2,class:"whatsnew"},yk={class:"check"},bk=["checked"],wk={key:1,class:"card",id:"language"},kk={class:"field"},$k={class:"f-label",for:"screen-language"},Sk=["value","disabled"],xk={value:"auto"},Ck=["value"],Ek={key:0,id:"language-ha-missing"},Tk={class:"field"},Ak={class:"f-label",for:"time-format"},Pk=["value","disabled"],Lk={value:"auto"},Ik={value:"24"},Ok={value:"12"},Nk={class:"field"},Mk={class:"f-label",for:"number-format"},Rk=["value","disabled"],Dk={value:"auto"},Fk=["value"],Uk={key:0,class:"actions",id:"language-profile"},jk=["disabled"],Hk={class:"card"},Vk={class:"tools"},Wk={class:"tx"},Bk={class:"card",id:"claude"},Kk={class:"actions"},Yk=["disabled"],qk={id:"claude-path"},Gk={class:"actions"},Jk={class:"btn quiet",id:"claude-download",href:"api/claude-skill.zip",download:"esp-screens.zip"},Xk="https://github.com/MaxGramser/homeassistant_espscreen/blob/main/docs/TRANSLATING.md",zk=Me({__name:"AppSettingsView",setup(e){const t=L(()=>m.inventory.updates),n=L(()=>m.inventory.screens.filter(C=>C.update?.available).length),s=L(()=>t.value?t.value.busy?u("editor.settings.updates.busy",{version:t.value.target}):m.inventory.screens.length?n.value?u("editor.settings.updates.available",{version:t.value.target},n.value):u("editor.settings.updates.current",{version:t.value.target}):u("editor.settings.updates.no_screens",{version:t.value.target}):""),o=L(()=>m.inventory.screens.find(C=>C.update?.state==="running"||m.updating.includes(C.id))),i=L(()=>o.value?ns(o.value):null),r=L(()=>(m.firmwareJob?.logs||[]).slice(-12).join(`
`)),c=L(()=>{const C=m.inventory.changelog,I=t.value?.target;return!Array.isArray(C)||!I?[]:C.filter(K=>K.firmware===I).flatMap(K=>K.lines).slice(0,10)}),d=L(()=>m.inventory.claude_skill),h=ke(!1);async function p(){h.value=!0;try{await Eg()}finally{h.value=!1}}const g=["point","comma","space"],v=L(()=>m.inventory.language),$=L(()=>{const C=v.value,I=C?.ha?gu(C.ha,C.languages.map(K=>K.code)):void 0;return C?.languages.find(K=>K.code===I)?.name}),U=L(()=>v.value?.languages.find(C=>C.code===v.value.effective&&!C.checked)),A=C=>u(C==="12"?"editor.settings.language.clock_12":"editor.settings.language.clock_24"),T=C=>wu("1234.5",C),k=Mm(),S=L(()=>{const C=v.value;return C?{...k.clock&&k.clock!==(C.clock_effective||"24")?{clock:k.clock}:{},...k.numbers&&k.numbers!==(C.numbers_effective||"point")?{numbers:k.numbers}:{}}:{}}),F=L(()=>[S.value.clock&&A(S.value.clock),S.value.numbers&&T(S.value.numbers)].filter(Boolean).join(" · ")),x=ke(!1);async function j(C,I){const K=I.target;x.value=!0;const M=await br({[C]:K.value});x.value=!1,M||(K.value=String(v.value?.[C]??"auto"))}async function O(){x.value=!0,await br(S.value),x.value=!1}return(C,I)=>{const K=Gs("i18n-t");return _(),b("div",sk,[l("div",ok,[l("div",ik,[l("span",lk,f(a(u)("editor.nav.settings")),1),l("h1",ak,f(a(u)("editor.settings.title")),1)]),l("button",{type:"button",class:"btn quiet",id:"close-settings",onClick:I[0]||(I[0]=M=>a(We)(""))},f(a(u)("editor.settings.back")),1)]),l("div",rk,[l("section",ck,[l("h2",null,f(a(u)("editor.settings.screens.title")),1),l("p",null,f(a(u)("editor.settings.screens.text")),1),l("div",uk,[l("button",{type:"button",class:"tool",onClick:I[1]||(I[1]=M=>a(We)("#new-screen"))},[I[9]||(I[9]=l("span",{class:"tool-icon"},"+",-1)),l("span",dk,[l("b",null,f(a(u)("editor.nav.new_screen")),1),l("small",null,f(a(u)("editor.nav.new_screen_detail")),1)])]),l("button",{type:"button",class:"tool",onClick:I[2]||(I[2]=M=>a(We)("#firmware"))},[I[10]||(I[10]=l("span",{class:"tool-icon"},"⇪",-1)),l("span",fk,[l("b",null,f(a(u)("editor.nav.firmware")),1),l("small",null,f(a(u)("editor.settings.screens.firmware_detail")),1)])])])]),t.value?(_(),b("section",pk,[l("h2",null,f(a(u)("editor.settings.updates.title")),1),l("p",hk,f(s.value),1),o.value&&i.value?(_(),b(J,{key:0},[l("div",{class:"progress",role:"progressbar","aria-valuenow":i.value.percent,"aria-valuemin":"0","aria-valuemax":"100"},[l("i",{style:He({width:i.value.percent+"%"})},null,4)],8,mk),l("div",gk,[l("span",null,f(o.value.name)+" · "+f(i.value.percent)+" %",1),l("span",null,f(i.value.text),1)]),r.value?(_(),b("pre",vk,f(r.value),1)):G("",!0)],64)):G("",!0),t.value.pending&&!t.value.busy&&t.value.pending>=2?(_(),b("button",{key:1,id:"update-all",type:"button",class:"btn primary",onClick:I[3]||(I[3]=(...M)=>a(_r)&&a(_r)(...M))},f(a(u)("editor.settings.updates.all",t.value.pending)),1)):G("",!0),c.value.length&&!a(nl)()?(_(),b("details",_k,[l("summary",null,f(a(u)("editor.settings.updates.whats_new",{version:t.value.target})),1),l("ul",null,[(_(!0),b(J,null,ge(c.value,M=>(_(),b("li",{key:M},f(M),1))),128))])])):G("",!0),l("label",yk,[l("input",{type:"checkbox",id:"auto-update",checked:!!t.value.auto,onChange:I[4]||(I[4]=M=>a(Cg)(M.target.checked))},null,40,bk),l("span",null,[Re(f(a(u)("editor.settings.updates.auto_label")),1),l("small",null,f(a(u)("editor.settings.updates.auto_hint")),1)])])])):G("",!0),v.value?(_(),b("section",wk,[l("h2",null,f(a(u)("editor.settings.language.title")),1),l("div",kk,[l("label",$k,f(a(u)("editor.settings.language.screen_language")),1),l("select",{id:"screen-language",value:v.value.setting,disabled:x.value,onChange:I[5]||(I[5]=M=>j("setting",M))},[l("option",xk,f($.value?a(u)("editor.settings.language.auto",{name:$.value}):a(u)("editor.settings.language.auto_plain")),1),(_(!0),b(J,null,ge(v.value.languages,M=>(_(),b("option",{key:M.code,value:M.code},f(M.checked?M.name:a(u)("editor.settings.language.unchecked",{name:M.name})),9,Ck))),128))],40,Sk),v.value.setting==="auto"&&!$.value?(_(),b("small",Ek,f(a(u)("editor.settings.language.ha_missing")),1)):G("",!0),U.value?(_(),at(K,{key:1,keypath:"editor.settings.language.help",tag:"small",id:"language-help",scope:"global"},{name:ie(()=>[Re(f(U.value.name),1)]),guide:ie(()=>[l("a",{href:Xk,target:"_blank",rel:"noopener"},f(a(u)("editor.settings.language.guide")),1)]),_:1})):G("",!0),l("small",null,f(a(u)("editor.settings.language.update_hint")),1)]),l("div",Tk,[l("label",Ak,f(a(u)("editor.settings.language.time")),1),l("select",{id:"time-format",value:v.value.clock||"auto",disabled:x.value,onChange:I[6]||(I[6]=M=>j("clock",M))},[l("option",Lk,f(a(u)("editor.settings.language.time_auto",{clock:A(v.value.clock_effective)})),1),l("option",Ik,f(A("24")),1),l("option",Ok,f(A("12")),1)],40,Pk)]),l("div",Nk,[l("label",Mk,f(a(u)("editor.settings.language.numbers")),1),l("select",{id:"number-format",value:v.value.numbers||"auto",disabled:x.value,onChange:I[7]||(I[7]=M=>j("numbers",M))},[l("option",Dk,f(a(u)("editor.settings.language.numbers_auto",{example:T(v.value.numbers_effective||"point")})),1),(_(),b(J,null,ge(g,M=>l("option",{key:M,value:M},f(T(M)),9,Fk)),64))],40,Rk)]),F.value?(_(),b("div",Uk,[l("small",null,f(a(u)("editor.settings.language.profile",{formats:F.value})),1),l("button",{type:"button",class:"btn quiet mini",disabled:x.value,onClick:O},f(a(u)("editor.settings.language.use_profile")),9,jk)])):G("",!0),l("small",null,f(a(u)("editor.settings.language.editor_hint")),1)])):G("",!0),l("section",Hk,[l("h2",null,f(a(u)("editor.nav.alerts")),1),l("p",null,f(a(u)("editor.settings.alerts.text")),1),l("div",Vk,[l("button",{type:"button",class:"tool",onClick:I[8]||(I[8]=M=>a(We)("#alerts"))},[I[11]||(I[11]=l("span",{class:"tool-icon"},"!",-1)),l("span",Wk,[l("b",null,f(a(u)("editor.nav.alerts")),1),l("small",null,f(a(u)("editor.settings.alerts.detail")),1)])])])]),l("section",Bk,[I[12]||(I[12]=l("h2",null,"Claude",-1)),l("p",null,f(a(u)("editor.settings.claude.text")),1),l("div",Kk,[l("button",{type:"button",id:"claude-install",class:ve(["btn",d.value?.installed&&d.value.current?"quiet":"primary"]),disabled:!d.value||h.value,onClick:p},f(!d.value||!d.value.installed?a(u)("editor.settings.claude.install"):d.value.current?a(u)("editor.settings.claude.install_again"):a(u)("editor.settings.claude.update")),11,Yk),l("span",{id:"claude-status",class:ve(["chip",d.value&&d.value.installed?d.value.current?"good":"update":""]),role:"status"},f(d.value?d.value.installed?d.value.current?a(u)("editor.settings.claude.installed_chip"):a(u)("editor.settings.claude.newer"):a(u)("editor.settings.claude.not_installed"):a(u)("editor.common.loading")),3)]),ne(K,{keypath:"editor.settings.claude.writes",tag:"small",scope:"global"},{path:ie(()=>[l("code",qk,f(d.value?.path||"/homeassistant/.claude/skills/esp-screens"),1)]),_:1}),l("div",Gk,[l("a",Jk,f(a(u)("editor.settings.claude.download")),1),l("small",null,f(a(u)("editor.settings.claude.upload")),1)])])])])}}}),Qk={class:"panel",id:"installer"},Zk={class:"panel-head"},e0={class:"tx"},t0={class:"eyebrow"},n0={id:"install-title"},s0={key:0},o0=["aria-label"],i0={class:"boards"},l0={class:"board"},a0={class:"board"},r0={class:"field"},c0={class:"f-label",for:"friendly_name"},u0=["placeholder"],d0={class:"node-line"},f0={id:"node-preview"},p0={key:0,class:"field",id:"node-label"},h0={class:"f-label",for:"node-name"},m0={key:1,id:"wifi-fields",class:"wifi"},g0={class:"hint",id:"wifi-status"},v0={key:0,class:"field",id:"wifi-ssid-label"},_0={class:"f-label",for:"wifi_ssid"},y0={key:1,class:"field",id:"wifi-password-label"},b0={class:"f-label",for:"wifi_password"},w0={class:"field"},k0={class:"f-label",for:"install-target"},$0={key:0,value:"usb"},S0=["value"],x0={value:"download"},C0={value:""},E0={id:"target-hint"},T0={key:2,class:"hint",id:"install-note"},A0={class:"actions"},P0=["disabled"],L0={id:"install-status",class:"status-line error",role:"status"},I0={key:1,id:"install-progress",class:"card"},O0={class:"progress-head"},N0={key:0,class:"spin",id:"progress-spin"},M0={id:"progress-title"},R0={id:"progress-detail"},D0={key:0,id:"install-download",class:"card",style:{background:"var(--surface-2)"}},F0=["href","download"],U0={class:"steps",id:"download-steps"},j0={key:1,id:"install-result",class:"field"},H0={class:"key-box"},V0={class:"steps",id:"install-steps"},W0=["open"],B0={id:"install-log",class:"log"},K0={class:"actions"},Y0="https://web.esphome.io/?dashboard_install",q0=Me({__name:"InstallerView",setup(e){const t=Xn({board:"cyd",friendly_name:"",name:"",wifi_ssid:"",wifi_password:"",target:""}),n=Xn({view:"setup",file:null,friendly:"",board:"cyd",target:"",apiKey:null,nodeEdited:!1,jobState:null,picked:!1,action:null}),s=ke(!1),o=ke(null),i=ke(null),r=ke([]),c=ke(""),d=ke(""),h=ke(!1),p=ke(!1),g=ke(null);let v=0;function $(me){return me.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^[^a-z]+/,"").slice(0,30).replace(/-+$/,"")||"screen"}function U(me){const te=me.replace(/^\/dev\/serial\/by-id\/usb-/,"").replace(/-if\d+(-port\d+)?$/,"").replace(/_/g," ");return`USB · ${te===me?me.replace(/^\/dev\//,""):te}`}Et(()=>t.friendly_name,()=>{n.nodeEdited||(t.name=$(t.friendly_name))});const A=L(()=>t.name||"…"),T=L(()=>o.value?.ports||[]),k=L(()=>o.value?.wifi),S=L(()=>k.value?.state==="new"||k.value?.state==="missing"),F=L(()=>k.value?.missing||[]),x=L(()=>u(k.value?.state==="new"?"editor.installer.wifi.new":"editor.installer.wifi.missing")),j=L(()=>k.value?.state==="ready"?u("editor.installer.wifi.ready"):k.value?.state==="invalid"?u("editor.installer.wifi.invalid"):""),O=L(()=>u(t.target==="usb"?"editor.installer.target.usb":t.target==="download"?"editor.installer.target.download":t.target?T.value.length>1?"editor.installer.target.several":"editor.installer.target.once":"editor.installer.target.later")),C=L(()=>t.target==="download"?u("editor.firmware.build_download"):t.target?u("editor.installer.install"):u("editor.installer.save_profile")),I=L(()=>o.value?.job?.state==="running"&&!(n.file&&o.value.job.file===n.file)),K=L(()=>h.value||k.value?.state==="invalid"||t.target==="usb"||!!t.target&&(I.value||!o.value?.available));function M(){const me=t.target;(me==="download"||me===""?n.picked:T.value.includes(me))||(t.target=T.value[0]||"usb")}async function he(){let me;try{me=await Dt("firmware")}catch(we){c.value=we.message;return}o.value=me;const te=me.job,Ee=te&&n.file&&te.file===n.file;if(Ee&&(n.jobState=te.state),n.view==="setup"){if(Ee&&te.state==="running"){z(te,me.logs||[]);return}M(),c.value=I.value?u("editor.installer.busy",{file:te.file}):!me.available&&t.target?u("editor.installer.no_cli"):j.value}else n.view==="progress"&&Ee&&(i.value=te,r.value=me.logs||[],te.state!=="running"&&te.state!=="success"&&(p.value=!0))}function z(me,te){n.view="progress",n.jobState=me.state,n.action=me.action,i.value=me,r.value=te}const oe=L(()=>i.value?.state==="running"),pe=L(()=>n.view==="done"||i.value?.state==="success"),se=L(()=>n.action==="download"),ce=L(()=>u(n.view==="done"?"editor.installer.title.saved":oe.value?"editor.installer.title.running":pe.value?se.value?"editor.installer.title.ready":"editor.installer.title.done":"editor.installer.title.failed")),ye=L(()=>n.view==="done"?u("editor.installer.progress.saved",{file:n.file}):oe.value?i.value?.stage==="upload"?u("editor.installer.progress.writing",{name:n.friendly}):u("editor.installer.progress.building"):pe.value?se.value?u("editor.installer.progress.ready",{name:n.friendly}):u("editor.installer.progress.installed",{name:n.friendly}):u(se.value?"editor.installer.progress.build_failed":"editor.installer.progress.install_failed")),$e=L(()=>n.view==="done"?u("editor.installer.detail.saved"):oe.value?i.value?.stage==="upload"?u("editor.installer.detail.uploading"):u(se.value?"editor.installer.detail.building_download":"editor.installer.detail.building"):pe.value?se.value?u("editor.installer.detail.downloaded"):u(n.board==="cyd"?"editor.installer.detail.booted_cyd":"editor.installer.detail.booted"):r.value.filter(me=>/error/i.test(me)).pop()||r.value.filter(me=>/failed/i.test(me)).pop()||u("editor.installer.detail.see_log")),Ge=L(()=>({href:`api/firmware/profiles/${encodeURIComponent(n.file||"")}/download`,name:(n.file||"").replace(/\.yaml$/,"")+".factory.bin"}));async function ae(me){const te=me.target;if(n.nodeEdited||(t.name=$(t.friendly_name)),!!te.reportValidity()){h.value=!0,d.value="";try{const Ee={board:t.board,friendly_name:t.friendly_name,name:t.name,target:t.target};S.value&&(F.value.includes("wifi_ssid")&&(Ee.wifi_ssid=t.wifi_ssid),F.value.includes("wifi_password")&&(Ee.wifi_password=t.wifi_password));const we=await ht("firmware/profiles","POST",Ee);Object.assign(n,{file:we.file,apiKey:we.api_key,friendly:t.friendly_name.trim(),board:t.board,target:t.target}),t.wifi_password="",we.job?z(we.job,[]):n.view="done"}catch(Ee){d.value=Ee.message}finally{h.value=!1}}}async function ee(){try{if(!se.value){const{ports:te}=await Dt("firmware");!te.includes(n.target)&&te.length===1&&(n.target=te[0])}const me=await ht("firmware/jobs","POST",se.value?{file:n.file,action:"download"}:{file:n.file,action:"install",target:n.target});z(me,[])}catch(me){Ce(me.message)}}function Y(){Object.assign(n,{view:"setup",file:null,apiKey:null,nodeEdited:!1,jobState:null,target:"",picked:!1,action:null}),Object.assign(t,{board:"cyd",friendly_name:"",name:"",wifi_ssid:"",wifi_password:"",target:""}),s.value=!1,i.value=null,r.value=[],d.value="",c.value="",p.value=!1,he()}function fe(){n.view==="progress"&&n.jobState!=="running"&&(n.view="done"),We("")}return Mn(()=>{he(),v=window.setInterval(he,3e3)}),ms(()=>clearInterval(v)),(me,te)=>{const Ee=Gs("i18n-t");return _(),b("div",Qk,[l("div",Zk,[l("div",e0,[l("span",t0,f(a(u)("editor.nav.new_screen")),1),l("h1",n0,f(n.view==="setup"?a(u)("editor.installer.title.setup"):ce.value),1),n.view==="setup"?(_(),b("p",s0,f(a(u)("editor.installer.intro")),1)):G("",!0)]),l("button",{type:"button",class:"btn quiet",id:"close-install","aria-label":a(u)("editor.common.close"),onClick:fe},f(a(u)("editor.common.back")),9,o0)]),n.view==="setup"?(_(),b("form",{key:0,id:"install-form",class:"card",onSubmit:Lt(ae,["prevent"])},[l("fieldset",null,[l("legend",null,f(a(u)("editor.installer.board")),1),l("div",i0,[l("label",l0,[Pe(l("input",{type:"radio",name:"board",value:"cyd","onUpdate:modelValue":te[0]||(te[0]=we=>t.board=we)},null,512),[[wa,t.board]]),l("span",null,[l("b",null,f(a(u)("editor.installer.board_cyd")),1),te[13]||(te[13]=l("small",null,"ESP32-2432S028 · 320 × 240",-1))])]),l("label",a0,[Pe(l("input",{type:"radio",name:"board",value:"guition","onUpdate:modelValue":te[1]||(te[1]=we=>t.board=we)},null,512),[[wa,t.board]]),l("span",null,[l("b",null,f(a(u)("editor.installer.board_guition")),1),te[14]||(te[14]=l("small",null,"ESP32-S3-4848S040 · 480 × 480 · GT911",-1))])])])]),l("div",r0,[l("label",c0,f(a(u)("editor.installer.name")),1),Pe(l("input",{id:"friendly_name",name:"friendly_name","onUpdate:modelValue":te[2]||(te[2]=we=>t.friendly_name=we),required:"",maxlength:"60",placeholder:a(u)("editor.installer.name_placeholder"),autocomplete:"off"},null,8,u0),[[Qe,t.friendly_name]]),l("small",d0,[Re(f(a(u)("editor.installer.device_name"))+" ",1),l("code",f0,f(A.value),1),l("button",{type:"button",class:"btn link mini",id:"edit-node",onClick:te[3]||(te[3]=we=>{n.nodeEdited=!0,s.value=!0})},f(a(u)("editor.installer.customize")),1)]),l("small",null,f(a(u)("editor.installer.name_hint")),1)]),s.value?(_(),b("div",p0,[l("label",h0,f(a(u)("editor.installer.device_name")),1),Pe(l("input",{id:"node-name",name:"name","onUpdate:modelValue":te[4]||(te[4]=we=>t.name=we),pattern:"[a-z][a-z0-9\\-]{0,29}",maxlength:"30",autocomplete:"off",onInput:te[5]||(te[5]=we=>n.nodeEdited=!0)},null,544),[[Qe,t.name]]),l("small",null,f(a(u)("editor.installer.device_name_hint")),1)])):G("",!0),S.value?(_(),b("fieldset",m0,[l("legend",null,f(a(u)("editor.installer.wifi.title")),1),l("p",g0,f(x.value),1),F.value.includes("wifi_ssid")?(_(),b("div",v0,[l("label",_0,f(a(u)("editor.installer.wifi.ssid")),1),Pe(l("input",{id:"wifi_ssid",name:"wifi_ssid","onUpdate:modelValue":te[6]||(te[6]=we=>t.wifi_ssid=we),autocomplete:"off"},null,512),[[Qe,t.wifi_ssid]])])):G("",!0),F.value.includes("wifi_password")?(_(),b("div",y0,[l("label",b0,f(a(u)("editor.installer.wifi.password")),1),Pe(l("input",{id:"wifi_password",name:"wifi_password",type:"password","onUpdate:modelValue":te[7]||(te[7]=we=>t.wifi_password=we),autocomplete:"new-password"},null,512),[[Qe,t.wifi_password]])])):G("",!0)])):G("",!0),l("div",w0,[l("label",k0,f(a(u)("editor.installer.install_via")),1),Pe(l("select",{id:"install-target",name:"target","onUpdate:modelValue":te[8]||(te[8]=we=>t.target=we),onChange:te[9]||(te[9]=we=>{n.picked=!0,he()})},[T.value.length?G("",!0):(_(),b("option",$0,f(a(u)("editor.firmware.no_board")),1)),(_(!0),b(J,null,ge(T.value,we=>(_(),b("option",{key:we,value:we},f(U(we)),9,S0))),128)),l("option",x0,f(a(u)("editor.firmware.download_target")),1),l("option",C0,f(a(u)("editor.installer.later")),1)],544),[[Yn,t.target]]),l("small",E0,f(O.value),1)]),c.value?(_(),b("p",T0,f(c.value),1)):G("",!0),l("div",A0,[l("button",{type:"submit",class:"btn primary",id:"install-go",disabled:K.value},f(C.value),9,P0),l("span",L0,f(d.value),1)])],32)):(_(),b("div",I0,[l("div",O0,[oe.value?(_(),b("span",N0)):(_(),b("span",{key:1,class:ve(["outcome",pe.value?"ok":"bad"]),id:"progress-mark"},f(pe.value?"✓":"✕"),3)),l("strong",M0,f(ye.value),1)]),l("p",R0,f($e.value),1),pe.value&&se.value&&n.view!=="done"?(_(),b("div",D0,[l("a",{class:"btn primary",id:"download-firmware",href:Ge.value.href,download:Ge.value.name},f(a(u)("editor.firmware.download_file",{name:Ge.value.name})),9,F0),l("ol",U0,[l("li",null,[ne(Ee,{keypath:"editor.installer.download_steps.plug",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.installer.download_steps.plug_bold")),1)]),_:1})]),l("li",null,[ne(Ee,{keypath:"editor.installer.download_steps.open",scope:"global"},{bold:ie(()=>[l("b",null,[ne(Ee,{keypath:"editor.installer.download_steps.open_bold",scope:"global"},{esphome_web:ie(()=>[l("a",{href:Y0,target:"_blank",rel:"noopener"},"ESPHome Web")]),_:1})])]),_:1})]),l("li",null,[ne(Ee,{keypath:n.board==="cyd"?"editor.installer.download_steps.install_cyd":"editor.installer.download_steps.install",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.installer.download_steps.install_bold")),1)]),file:ie(()=>[Re(f(Ge.value.name),1)]),_:1},8,["keypath"])])]),l("small",null,f(a(u)("editor.installer.download_keep")),1)])):G("",!0),pe.value?(_(),b("div",j0,[l("div",H0,[l("span",null,f(a(u)("editor.installer.api_key")),1),l("code",{id:"api-key",ref_key:"keyBox",ref:g},f(n.apiKey||""),513),l("button",{type:"button",class:"btn quiet mini",id:"copy-key",onClick:te[10]||(te[10]=we=>a(Ot)(n.apiKey||"",g.value))},f(a(u)("editor.common.copy")),1)]),l("ol",V0,[l("li",null,[ne(Ee,{keypath:"editor.installer.pairing.ha",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.installer.pairing.ha_bold")),1)]),name:ie(()=>[Re(f(n.friendly),1)]),_:1}),te[15]||(te[15]=Re()),l("button",{type:"button",class:"btn quiet mini",onClick:te[11]||(te[11]=(...we)=>a(Lo)&&a(Lo)(...we))},f(a(u)("editor.common.open_integrations")),1)]),l("li",null,[ne(Ee,{keypath:"editor.installer.pairing.key",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.installer.pairing.key_bold")),1)]),_:1})]),l("li",null,[ne(Ee,{keypath:"editor.installer.pairing.actions",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.installer.pairing.actions_bold")),1)]),_:1})]),l("li",null,[ne(Ee,{keypath:"editor.installer.pairing.tiles",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.installer.pairing.tiles_bold")),1)]),_:1})])])])):G("",!0),n.view!=="done"?(_(),b("details",{key:2,id:"install-log-wrap",class:"log-wrap",open:p.value,onToggle:te[12]||(te[12]=we=>p.value=we.target.open)},[l("summary",null,f(a(u)("editor.installer.log")),1),l("pre",B0,f(r.value.join(`
`)),1)],40,W0)):G("",!0),l("div",K0,[!oe.value&&!pe.value?(_(),b("button",{key:0,type:"button",class:"btn primary",id:"install-retry",onClick:ee},f(a(u)("editor.installer.retry")),1)):G("",!0),l("button",{type:"button",class:"btn quiet",id:"install-close",onClick:Y},f(pe.value?a(u)("editor.installer.another"):a(u)("editor.installer.start_over")),1),l("button",{type:"button",class:ve(["btn",pe.value?"primary":"quiet"]),onClick:fe},f(pe.value?a(u)("editor.installer.done"):a(u)("editor.common.close")),3)])]))])}}}),G0={class:"panel",id:"firmware-dialog"},J0={class:"panel-head"},X0={class:"tx"},z0={class:"eyebrow"},Q0={class:"card"},Z0={class:"card-grid"},e$={class:"field"},t$={class:"f-label",for:"firmware-file"},n$=["value"],s$={class:"field"},o$={class:"f-label",for:"firmware-port"},i$={value:"ota"},l$={key:0,value:"usb"},a$=["value"],r$={value:"download"},c$={key:0,class:"field",id:"firmware-host-label"},u$={class:"f-label",for:"firmware-host"},d$=["placeholder"],f$={class:"actions"},p$=["disabled"],h$=["disabled"],m$=["disabled"],g$={key:0,class:"spin"},v$={id:"firmware-status",class:"status-line",role:"status"},_$={key:0,id:"firmware-download",class:"card",style:{background:"var(--surface-2)"}},y$=["href","download"],b$={id:"firmware-log",class:"log"},w$="https://web.esphome.io/?dashboard_install",k$=Me({__name:"FirmwareView",setup(e){const t=ke(null),n=ke(""),s=ke("ota"),o=ke("");let i=0;async function r(A=!1){try{const T=await Dt("firmware");t.value=T,(A||!n.value)&&(n.value=T.profiles[0]?.file||"");const k=T.ports||[];s.value.startsWith("/")&&!k.includes(s.value)&&(s.value=k[0]||"usb"),s.value==="usb"&&k.length&&(s.value=k[0])}catch(T){Ce(T.message)}}const c=L(()=>t.value?.job?.state==="running"),d=L(()=>!t.value||c.value||!t.value.available||!t.value.profiles?.length),h=L(()=>d.value||s.value==="usb"),p=L(()=>t.value?.ports||[]),g=L(()=>t.value?t.value.available?t.value.job?`${t.value.job.file} · ${t.value.job.action} · ${t.value.job.state}`:u("editor.firmware.choose"):u("editor.firmware.no_cli"):u("editor.common.loading")),v=L(()=>s.value==="download"&&!!n.value&&!!t.value?.downloads?.includes(n.value)),$=L(()=>({href:`api/firmware/profiles/${encodeURIComponent(n.value)}/download`,name:n.value.replace(/\.yaml$/,"")+".factory.bin"}));async function U(A){try{await ht("firmware/jobs","POST",{file:n.value,action:A==="validate"?"validate":A==="build"?"build":s.value==="download"?"download":"install",target:s.value==="ota"?o.value.trim():s.value==="download"?"":s.value}),await r()}catch(T){Ce(T.message)}}return Mn(()=>{r(!0),i=window.setInterval(()=>r(),3e3)}),ms(()=>clearInterval(i)),(A,T)=>{const k=Gs("i18n-t");return _(),b("div",G0,[l("div",J0,[l("div",X0,[l("span",z0,f(a(u)("editor.nav.firmware")),1),l("h1",null,f(a(u)("editor.firmware.title")),1),ne(k,{keypath:"editor.firmware.intro",tag:"p",scope:"global"},{ota:ie(()=>[l("b",null,f(a(u)("editor.firmware.ota")),1)]),download:ie(()=>[l("b",null,f(a(u)("editor.firmware.download")),1)]),check:ie(()=>[l("b",null,f(a(u)("editor.firmware.check")),1)]),build:ie(()=>[l("b",null,f(a(u)("editor.firmware.build")),1)]),install:ie(()=>[l("b",null,f(a(u)("editor.firmware.install")),1)]),_:1})]),l("button",{type:"button",class:"btn quiet",id:"close-firmware",onClick:T[0]||(T[0]=S=>a(We)(""))},f(a(u)("editor.common.back")),1)]),l("div",Q0,[l("div",Z0,[l("div",e$,[l("label",t$,f(a(u)("editor.firmware.profile")),1),Pe(l("select",{id:"firmware-file","onUpdate:modelValue":T[1]||(T[1]=S=>n.value=S)},[(_(!0),b(J,null,ge(t.value?.profiles||[],S=>(_(),b("option",{key:S.file,value:S.file},f(S.file),9,n$))),128))],512),[[Yn,n.value]])]),l("div",s$,[l("label",o$,f(a(u)("editor.firmware.install_to")),1),Pe(l("select",{id:"firmware-port","onUpdate:modelValue":T[2]||(T[2]=S=>s.value=S)},[l("option",i$,f(a(u)("editor.firmware.ota")),1),p.value.length?G("",!0):(_(),b("option",l$,f(a(u)("editor.firmware.no_board")),1)),(_(!0),b(J,null,ge(p.value,S=>(_(),b("option",{key:S,value:S},f(S),9,a$))),128)),l("option",r$,f(a(u)("editor.firmware.download_target")),1)],512),[[Yn,s.value]])]),s.value==="ota"?(_(),b("div",c$,[l("label",u$,f(a(u)("editor.firmware.host")),1),Pe(l("input",{id:"firmware-host","onUpdate:modelValue":T[3]||(T[3]=S=>o.value=S),placeholder:n.value?n.value.replace(/\.yaml$/,".local"):"screen-livingroom.local"},null,8,d$),[[Qe,o.value]])])):G("",!0)]),l("div",f$,[l("button",{type:"button",class:"btn quiet",id:"firmware-validate",disabled:d.value,onClick:T[4]||(T[4]=S=>U("validate"))},f(a(u)("editor.firmware.check")),9,p$),l("button",{type:"button",class:"btn quiet",id:"firmware-build",disabled:d.value,onClick:T[5]||(T[5]=S=>U("build"))},f(a(u)("editor.firmware.build")),9,h$),l("button",{type:"button",class:"btn primary",id:"firmware-install",disabled:h.value,onClick:T[6]||(T[6]=S=>U("install"))},f(s.value==="download"?a(u)("editor.firmware.build_download"):a(u)("editor.firmware.install")),9,m$),c.value?(_(),b("span",g$)):G("",!0)]),l("p",v$,f(g.value),1),v.value?(_(),b("div",_$,[l("a",{class:"btn primary",id:"firmware-download-link",href:$.value.href,download:$.value.name},f(a(u)("editor.firmware.download_file",{name:$.value.name})),9,y$),ne(k,{keypath:"editor.firmware.download_how",tag:"small",scope:"global"},{esphome_web:ie(()=>[l("a",{href:w$,target:"_blank",rel:"noopener"},"ESPHome Web")]),_:1})])):G("",!0)]),l("pre",b$,f((t.value?.logs||[]).join(`
`)),1)])}}}),$$={class:"panel wide alerts",id:"alerts-dialog"},S$={class:"panel-head"},x$={class:"tx"},C$={class:"eyebrow"},E$={key:0,class:"hint"},T$={class:"alert-hero"},A$={class:"alert-mock",id:"alert-mock","aria-hidden":"true"},P$={class:"mdi alert-mock-icon",id:"alert-mock-icon"},L$={id:"alert-mock-title"},I$={id:"alert-mock-subtitle"},O$={class:"fake",id:"alert-mock-button"},N$=["aria-label"],M$=["data-jump","onClick"],R$={id:"alerts-try",class:"card"},D$={class:"field"},F$={class:"f-label",for:"try-screen"},U$={value:"all"},j$=["value","disabled"],H$={class:"field"},V$={class:"f-label",for:"try-title"},W$={class:"field"},B$={class:"f-label",for:"try-subtitle"},K$={class:"field"},Y$={class:"f-label",for:"try-icon"},q$={id:"try-icons"},G$=["value"],J$={class:"field"},X$={class:"f-label",for:"try-color"},z$={value:""},Q$=["value"],Z$={class:"field"},eS={class:"f-label",for:"try-button"},tS={class:"field"},nS={class:"f-label",for:"try-timeout"},sS={class:"check field"},oS={class:"actions field wide"},iS=["disabled"],lS={class:"status-line",id:"try-result",role:"status"},aS={id:"alerts-screens",class:"card"},rS={id:"alerts-min-firmware"},cS={id:"alerts-screen-list",class:"options"},uS={key:0,class:"hint"},dS={class:"alert-screen-head"},fS={class:"copy-label"},pS=["onClick"],hS={id:"alerts-howto",class:"card"},mS={class:"steps"},gS={class:"field"},vS={class:"f-label",for:"alerts-example-screen"},_S=["value"],yS={key:0,value:""},bS={class:"copy-line"},wS={id:"alerts-example"},kS={id:"alerts-all",class:"card"},$S={id:"alerts-all-event"},SS={id:"alerts-all-dismiss"},xS={class:"copy-line"},CS={id:"alerts-all-example"},ES={id:"alerts-fields",class:"card"},TS={class:"table-scroll"},AS={id:"alerts-field-table"},PS={key:0},LS={id:"alerts-icons",class:"card"},IS={class:"subhead"},OS={class:"chips",id:"alerts-suggested"},NS=["onClick"],MS={class:"mdi"},RS={class:"field"},DS={class:"f-label",for:"alerts-icon-search"},FS=["placeholder"],US={id:"alerts-icon-groups"},jS={class:"subhead"},HS={class:"alert-icon-grid"},VS=["title","onClick"],WS={class:"mdi"},BS={key:0},KS={key:0,class:"hint"},YS={id:"alerts-colors",class:"card"},qS={class:"swatches",id:"alerts-swatches"},GS=["onClick"],JS={id:"alerts-behaviour",class:"card"},XS={class:"alerts-list"},zS={id:"alerts-events",class:"card"},QS={id:"alerts-event-name"},ZS={class:"table-scroll"},ex={id:"alerts-ending-table"},tx={class:"subhead"},nx={class:"copy-line"},sx={id:"alerts-wait-example"},ox={id:"alerts-tips",class:"card"},ix={class:"alerts-list"},lx=Me({__name:"AlertsView",setup(e){const t=L(()=>m.inventory.alerts),n=Xn({screen:"all",title:u("editor.alerts.example.title"),subtitle:u("editor.alerts.example.subtitle"),icon:"doorbell",color:"orange",button_text:u("editor.alerts.example.button"),timeout:30,flash:!0}),s=ke(!1),o=ke(""),i=L(()=>m.inventory.screens.filter(C=>Jn(C)&&C.online));async function r(){s.value=!0,o.value="";try{const{screen:C,...I}=n,K=await pg(C,I),M=m.inventory.screens.find(z=>z.id===C)?.name,he=C==="all"?u("editor.alerts.try.sent_all",K.sent):M?u("editor.alerts.try.sent_to",{name:M}):u("editor.alerts.try.sent_one");o.value=K.sent?[he,K.skipped?u("editor.alerts.try.skipped",K.skipped):"",K.unusable?.length?u("editor.alerts.try.left_empty",{fields:K.unusable.join(", ")}):""].filter(Boolean).join(" "):u("editor.alerts.try.nothing",{version:t.value?.min_firmware||"0.2.31"})}catch(C){o.value=C.message}finally{s.value=!1}}const c=L(()=>m.inventory.icons),d=ke(""),h=ke(""),p=C=>`"${String(C).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,g=C=>C.type==="string"?/^[a-z][a-z0-9-]*$/.test(C.example)?C.example:p(C.example):C.example===!0?"true":C.example===!1?"false":String(C.example),v=L(()=>m.inventory.screens.filter(C=>C.alert_action)),$=L(()=>d.value||v.value[0]?.alert_action||""),U=L(()=>{const C=(t.value?.fields||[]).map(I=>` ${I.name}: ${g(I)}`);return`action: ${$.value||"esphome.<device_name>_show_alert"}
data:
${C.join(`
`)}`}),A=L(()=>["# Doorbell: show the alert and wait until someone presses the button.","actions:",` - action: ${$.value||"esphome.<device_name>_show_alert"}`," data:",' title: "Someone is at the door"',' subtitle: "Door 3, back"'," icon: doorbell"," color: orange",' button_text: "Coming"'," timeout: 0"," flash: true"," - wait_for_trigger:"," - trigger: event",` event_type: ${t.value?.event||"esphome.screen_alert"}`," event_data:"," action: ok",' timeout: "00:05:00"'," - if:"," - condition: template",' value_template: "{{ wait.trigger is not none }}"'," then:"," - action: notify.notify"," data:",' message: "Someone is coming to the door."'].join(`
`)),T=L(()=>{const C=(t.value?.fields||[]).map(K=>` ${K.name}: ${g(K)}`),I=t.value?.camera;return I&&C.push(` # ${I.name}: ${I.example} # a Guition shows its picture on the card`),`event: ${t.value?.broadcast?.show||"esp_screens_show_alert"}
event_data:
${C.join(`
`)}`}),k=L(()=>{if(!t.value||!c.value)return[];const C=h.value.trim().toLowerCase();return[...c.value.groups,{label:u("editor.alerts.icons.extra"),icons:t.value.extra_icons}].map(K=>({label:K.label,icons:K.icons.filter(M=>!C||M.name.includes(C)||(M.label||"").toLowerCase().includes(C))})).filter(K=>K.icons.length)}),S=L(()=>t.value?.suggested_icons?.find(C=>C.name==="doorbell")),F=L(()=>t.value?.colors?.find(C=>C.name==="orange")),x=C=>["string","int","bool"].includes(C)?u(`editor.alerts.fields.types.${C}`):C;function j(C){document.getElementById(C)?.scrollIntoView({behavior:"smooth",block:"start"})}const O=["alerts-try","alerts-screens","alerts-howto","alerts-all","alerts-fields","alerts-icons","alerts-colors","alerts-behaviour","alerts-events","alerts-tips"];return(C,I)=>{const K=Gs("i18n-t");return _(),b("div",$$,[l("div",S$,[l("div",x$,[l("span",C$,f(a(u)("editor.alerts.eyebrow")),1),l("h1",null,f(a(u)("editor.alerts.title")),1),ne(K,{keypath:"editor.alerts.intro",tag:"p",scope:"global"},{action:ie(()=>[...I[15]||(I[15]=[l("code",null,"show_alert",-1)])]),_:1})]),l("button",{type:"button",class:"btn quiet",id:"close-alerts",onClick:I[0]||(I[0]=M=>a(We)(""))},f(a(u)("editor.common.back")),1)]),t.value?(_(),b(J,{key:1},[l("div",T$,[l("div",A$,[l("div",{class:"alert-mock-card",style:He(F.value?{background:F.value.color}:void 0)},[l("span",P$,f(S.value?a(Le)(S.value.cp):""),1),l("strong",L$,f(a(u)("editor.alerts.example.title")),1),l("span",I$,f(a(u)("editor.alerts.example.subtitle")),1),l("span",O$,f(a(u)("editor.alerts.example.button")),1)],4)]),l("nav",{class:"alerts-nav","aria-label":a(u)("editor.alerts.sections")},[(_(),b(J,null,ge(O,M=>l("button",{key:M,type:"button","data-jump":M,onClick:he=>j(M)},f(a(u)(`editor.alerts.nav.${M.slice(7)}`)),9,M$)),64))],8,N$)]),l("section",R$,[l("h2",null,f(a(u)("editor.alerts.nav.try")),1),l("p",null,f(a(u)("editor.alerts.try.text")),1),l("form",{class:"try-grid",onSubmit:Lt(r,["prevent"])},[l("div",D$,[l("label",F$,f(a(u)("editor.alerts.try.screen")),1),Pe(l("select",{id:"try-screen","onUpdate:modelValue":I[1]||(I[1]=M=>n.screen=M)},[l("option",U$,f(a(u)("editor.alerts.try.all",{ready:i.value.length})),1),(_(!0),b(J,null,ge(a(m).inventory.screens,M=>(_(),b("option",{key:M.id,value:M.id,disabled:!a(Jn)(M)||!M.online},f(a(Jn)(M)&&M.online?M.name:a(u)("editor.alerts.try.not_ready",{name:M.name})),9,j$))),128))],512),[[Yn,n.screen]])]),l("div",H$,[l("label",V$,f(a(u)("editor.alerts.try.title")),1),Pe(l("input",{id:"try-title","onUpdate:modelValue":I[2]||(I[2]=M=>n.title=M),maxlength:"64"},null,512),[[Qe,n.title]])]),l("div",W$,[l("label",B$,f(a(u)("editor.alerts.try.subtitle")),1),Pe(l("input",{id:"try-subtitle","onUpdate:modelValue":I[3]||(I[3]=M=>n.subtitle=M),maxlength:"240"},null,512),[[Qe,n.subtitle]])]),l("div",K$,[l("label",Y$,f(a(u)("editor.alerts.try.icon")),1),Pe(l("input",{id:"try-icon","onUpdate:modelValue":I[4]||(I[4]=M=>n.icon=M),list:"try-icons",placeholder:"doorbell"},null,512),[[Qe,n.icon]]),l("datalist",q$,[(_(!0),b(J,null,ge(t.value.suggested_icons,M=>(_(),b("option",{key:M.name,value:M.name},f(M.label||M.name),9,G$))),128))])]),l("div",J$,[l("label",X$,f(a(u)("editor.alerts.try.color")),1),Pe(l("select",{id:"try-color","onUpdate:modelValue":I[5]||(I[5]=M=>n.color=M)},[l("option",z$,f(a(u)("editor.alerts.white")),1),(_(!0),b(J,null,ge(t.value.colors,M=>(_(),b("option",{key:M.name,value:M.name},f(M.label),9,Q$))),128))],512),[[Yn,n.color]])]),l("div",Z$,[l("label",eS,f(a(u)("editor.alerts.try.button")),1),Pe(l("input",{id:"try-button","onUpdate:modelValue":I[6]||(I[6]=M=>n.button_text=M),maxlength:"16"},null,512),[[Qe,n.button_text]])]),l("div",tS,[l("label",nS,f(a(u)("editor.alerts.try.timeout")),1),Pe(l("input",{id:"try-timeout","onUpdate:modelValue":I[7]||(I[7]=M=>n.timeout=M),type:"number",min:"0",max:"86400"},null,512),[[Qe,n.timeout,void 0,{number:!0}]])]),l("label",sS,[Pe(l("input",{type:"checkbox",id:"try-flash","onUpdate:modelValue":I[8]||(I[8]=M=>n.flash=M)},null,512),[[fp,n.flash]]),l("span",null,[Re(f(a(u)("editor.alerts.try.flash")),1),l("small",null,f(a(u)("editor.alerts.try.flash_hint")),1)])]),l("div",oS,[l("button",{type:"submit",class:"btn primary",id:"try-send",disabled:s.value||!i.value.length},f(s.value?a(u)("editor.alerts.try.sending"):a(u)("editor.alerts.try.send")),9,iS),l("span",lS,f(o.value),1)])],32)]),l("section",aS,[l("h2",null,f(a(u)("editor.alerts.nav.screens")),1),ne(K,{keypath:"editor.alerts.screens.text",tag:"p",scope:"global"},{version:ie(()=>[l("code",rS,f(t.value.min_firmware),1)]),_:1}),l("div",cS,[a(m).inventory.screens.length?G("",!0):(_(),b("p",uS,f(a(u)("editor.alerts.screens.none")),1)),(_(!0),b(J,null,ge(a(m).inventory.screens,M=>(_(),b("div",{key:M.id,class:"alert-screen"},[l("div",dS,[l("strong",null,f(M.name),1),l("span",{class:ve(["chip",a(gn)(a(fs)(M),t.value.min_firmware)&&M.alert_action?"good":"update"])},f(a(gn)(a(fs)(M),t.value.min_firmware)&&M.alert_action?a(u)("editor.alerts.screens.ready",{version:M.firmware}):M.alert_action?a(u)("editor.alerts.screens.update",{version:M.firmware||a(u)("editor.common.unknown")}):a(u)("editor.alerts.screens.unknown")),3)]),(_(!0),b(J,null,ge([[a(u)("editor.alerts.screens.show"),M.alert_action],[a(u)("editor.alerts.screens.dismiss"),M.dismiss_action]],([he,z])=>(_(),b("div",{key:he,class:"copy-line"},[l("span",fS,f(he),1),l("code",null,f(z||"esphome.<device_name>_show_alert"),1),z?(_(),b("button",{key:0,type:"button",class:"btn quiet mini",onClick:oe=>a(Ot)(z,void 0,"action_name")},f(a(u)("editor.common.copy")),9,pS)):G("",!0)]))),128))]))),128))])]),l("section",hS,[l("h2",null,f(a(u)("editor.alerts.nav.howto")),1),l("ol",mS,[ne(K,{keypath:"editor.alerts.howto.add",tag:"li",scope:"global"},{add:ie(()=>[l("b",null,f(a(u)("editor.alerts.howto.add_bold")),1)]),esphome:ie(()=>[...I[16]||(I[16]=[l("b",null,"ESPHome",-1)])]),device:ie(()=>[l("i",null,f(a(u)("editor.alerts.howto.device")),1)]),_:1}),ne(K,{keypath:"editor.alerts.howto.fields",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.howto.fields_bold")),1)]),empty:ie(()=>[...I[17]||(I[17]=[l("code",null,'""',-1)])]),zero:ie(()=>[...I[18]||(I[18]=[l("code",null,"0",-1)])]),_:1}),ne(K,{keypath:"editor.alerts.howto.yaml",tag:"li",scope:"global"},{edit:ie(()=>[l("b",null,f(a(u)("editor.alerts.edit_yaml")),1)]),_:1})]),l("div",gS,[l("label",vS,f(a(u)("editor.alerts.howto.example_for")),1),Pe(l("select",{id:"alerts-example-screen","onUpdate:modelValue":I[9]||(I[9]=M=>d.value=M),style:{"max-width":"360px"}},[(_(!0),b(J,null,ge(v.value,M=>(_(),b("option",{key:M.id,value:M.alert_action},f(M.name),9,_S))),128)),v.value.length?G("",!0):(_(),b("option",yS,f(a(u)("editor.alerts.howto.no_screen")),1))],512),[[Yn,d.value]])]),l("div",bS,[l("pre",wS,f(U.value),1),l("button",{type:"button",class:"btn quiet mini",id:"alerts-example-copy",onClick:I[10]||(I[10]=M=>a(Ot)(U.value,void 0,"yaml"))},f(a(u)("editor.alerts.copy_yaml")),1)])]),l("section",kS,[l("h2",null,f(a(u)("editor.alerts.all.title")),1),ne(K,{keypath:"editor.alerts.all.text",tag:"p",scope:"global"},{show:ie(()=>[l("code",$S,f(t.value.broadcast?.show||"esp_screens_show_alert"),1)]),dismiss:ie(()=>[l("code",SS,f(t.value.broadcast?.dismiss||"esp_screens_dismiss_alert"),1)]),event:ie(()=>[l("b",null,f(a(u)("editor.alerts.all.event")),1)]),edit:ie(()=>[l("b",null,f(a(u)("editor.alerts.edit_yaml")),1)]),_:1}),l("div",xS,[l("pre",CS,f(T.value),1),l("button",{type:"button",class:"btn quiet mini",id:"alerts-all-copy",onClick:I[11]||(I[11]=M=>a(Ot)(T.value,void 0,"yaml"))},f(a(u)("editor.alerts.copy_yaml")),1)])]),l("section",ES,[l("h2",null,f(a(u)("editor.alerts.nav.fields")),1),l("p",null,f(a(u)("editor.alerts.fields.text")),1),l("div",TS,[l("table",AS,[l("tr",null,[l("th",null,f(a(u)("editor.alerts.fields.field")),1),l("th",null,f(a(u)("editor.alerts.fields.type")),1),l("th",null,f(a(u)("editor.alerts.fields.what")),1),l("th",null,f(a(u)("editor.alerts.fields.example")),1),l("th",null,f(a(u)("editor.alerts.fields.limit")),1)]),(_(!0),b(J,null,ge(t.value.fields,M=>(_(),b("tr",{key:M.name},[l("td",null,[l("code",null,f(M.name),1),l("small",null,f(M.label),1)]),l("td",null,f(x(M.type)),1),l("td",null,f(M.help),1),l("td",null,[l("code",null,f(typeof M.example=="string"?M.example:String(M.example)),1)]),l("td",null,f(t.value.limits.cyd[M.name]?a(u)("editor.alerts.fields.bytes",{cyd:t.value.limits.cyd[M.name],guition:t.value.limits.guition[M.name]}):M.type==="int"?a(u)("editor.alerts.fields.seconds"):"—"),1)]))),128)),t.value.camera?(_(),b("tr",PS,[l("td",null,[l("code",null,f(t.value.camera.name),1),l("small",null,f(t.value.camera.label),1)]),l("td",null,f(a(u)("editor.alerts.fields.types.entity")),1),l("td",null,f(t.value.camera.help),1),l("td",null,[l("code",null,f(t.value.camera.example),1)]),l("td",null,f(a(u)("editor.alerts.fields.camera_limit")),1)])):G("",!0)])])]),l("section",LS,[l("h2",null,f(a(u)("editor.alerts.nav.icons")),1),ne(K,{keypath:"editor.alerts.icons.text",tag:"p",scope:"global"},{field:ie(()=>[...I[19]||(I[19]=[l("code",null,"icon",-1)])]),example:ie(()=>[...I[20]||(I[20]=[l("code",null,"doorbell",-1)])]),mdi:ie(()=>[...I[21]||(I[21]=[l("code",null,"mdi:doorbell",-1)])]),hex:ie(()=>[...I[22]||(I[22]=[l("code",null,"F12E6",-1)])]),_:1}),l("p",IS,f(a(u)("editor.alerts.icons.handy")),1),l("div",OS,[(_(!0),b(J,null,ge(t.value.suggested_icons,M=>(_(),b("button",{key:M.name,type:"button",class:"chip",onClick:he=>a(Ot)(M.name,void 0,"icon_name")},[l("span",MS,f(a(Le)(M.cp)),1),l("code",null,f(M.name),1)],8,NS))),128))]),l("div",RS,[l("label",DS,f(a(u)("editor.alerts.icons.search_label")),1),Pe(l("input",{id:"alerts-icon-search","onUpdate:modelValue":I[12]||(I[12]=M=>h.value=M),type:"search",placeholder:a(u)("editor.alerts.icons.search"),autocomplete:"off"},null,8,FS),[[Qe,h.value]])]),l("div",US,[(_(!0),b(J,null,ge(k.value,M=>(_(),b("div",{key:M.label,class:"field"},[l("p",jS,f(M.label)+" · "+f(M.icons.length),1),l("div",HS,[(_(!0),b(J,null,ge(M.icons,he=>(_(),b("button",{key:he.name,type:"button",class:"alert-icon",title:a(u)("editor.alerts.icons.copy",{name:he.name}),onClick:z=>a(Ot)(he.name,void 0,"icon_name")},[l("span",WS,f(a(Le)(he.cp)),1),l("code",null,f(he.name),1),he.label?(_(),b("small",BS,f(he.label),1)):G("",!0)],8,VS))),128))])]))),128)),k.value.length?G("",!0):(_(),b("p",KS,f(a(u)("editor.alerts.icons.none",{query:h.value,fallback:t.value.fallback_icon})),1))])]),l("section",YS,[l("h2",null,f(a(u)("editor.alerts.nav.colors")),1),ne(K,{keypath:"editor.alerts.colors.text",tag:"p",scope:"global"},{field:ie(()=>[...I[23]||(I[23]=[l("code",null,"color",-1)])]),_:1}),l("div",qS,[l("button",{type:"button",class:"swatch",onClick:I[13]||(I[13]=M=>a(Ot)("",void 0,"empty_color"))},[I[25]||(I[25]=l("i",{style:{background:"#ffffff"}},null,-1)),l("span",null,[I[24]||(I[24]=l("code",null,"empty",-1)),l("small",null,f(a(u)("editor.alerts.white")),1)])]),(_(!0),b(J,null,ge(t.value.colors,M=>(_(),b("button",{key:M.name,type:"button",class:"swatch",onClick:he=>a(Ot)(M.name,void 0,"color_name")},[l("i",{style:He({background:M.color})},null,4),l("span",null,[l("code",null,f(M.name),1),l("small",null,f(M.label)+" · "+f(M.color),1)])],8,GS))),128))])]),l("section",JS,[l("h2",null,f(a(u)("editor.alerts.nav.behaviour")),1),l("ul",XS,[ne(K,{keypath:"editor.alerts.behaviour.wakes",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.behaviour.wakes_bold")),1)]),_:1}),ne(K,{keypath:"editor.alerts.behaviour.on",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.behaviour.on_bold")),1)]),_:1}),ne(K,{keypath:"editor.alerts.behaviour.timeout",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.behaviour.timeout_bold")),1)]),zero:ie(()=>[...I[26]||(I[26]=[l("code",null,"timeout: 0",-1)])]),minute:ie(()=>[...I[27]||(I[27]=[l("code",null,"timeout: 60",-1)])]),_:1}),ne(K,{keypath:"editor.alerts.behaviour.blinking",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.behaviour.blinking_bold")),1)]),flash:ie(()=>[...I[28]||(I[28]=[l("code",null,"flash: true",-1)])]),_:1}),ne(K,{keypath:"editor.alerts.behaviour.replacing",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.behaviour.replacing_bold")),1)]),replaced:ie(()=>[...I[29]||(I[29]=[l("code",null,"replaced",-1)])]),_:1}),ne(K,{keypath:"editor.alerts.behaviour.closing",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.behaviour.closing_bold")),1)]),dismiss:ie(()=>[...I[30]||(I[30]=[l("code",null,"dismiss_alert",-1)])]),_:1}),ne(K,{keypath:"editor.alerts.behaviour.beside",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.behaviour.beside_bold")),1)]),_:1})])]),l("section",zS,[l("h2",null,f(a(u)("editor.alerts.nav.events")),1),ne(K,{keypath:"editor.alerts.events.text",tag:"p",scope:"global"},{event:ie(()=>[l("code",QS,f(t.value.event),1)]),action:ie(()=>[...I[31]||(I[31]=[l("code",null,"action",-1)])]),title:ie(()=>[...I[32]||(I[32]=[l("code",null,"title",-1)])]),screen:ie(()=>[...I[33]||(I[33]=[l("code",null,"screen",-1)])]),device_id:ie(()=>[...I[34]||(I[34]=[l("code",null,"device_id",-1)])]),_:1}),l("div",ZS,[l("table",ex,[l("tr",null,[I[35]||(I[35]=l("th",null,"action",-1)),l("th",null,f(a(u)("editor.alerts.events.when")),1)]),(_(!0),b(J,null,ge(t.value.endings,M=>(_(),b("tr",{key:M.action},[l("td",null,[l("code",null,f(M.action),1)]),l("td",null,f(M.label),1)]))),128))])]),l("p",tx,f(a(u)("editor.alerts.events.wait")),1),l("div",nx,[l("pre",sx,f(A.value),1),l("button",{type:"button",class:"btn quiet mini",id:"alerts-wait-copy",onClick:I[14]||(I[14]=M=>a(Ot)(A.value,void 0,"yaml"))},f(a(u)("editor.alerts.copy_yaml")),1)])]),l("section",ox,[l("h2",null,f(a(u)("editor.alerts.nav.tips")),1),l("ul",ix,[ne(K,{keypath:"editor.alerts.tips.color",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.tips.color_bold")),1)]),_:1}),ne(K,{keypath:"editor.alerts.tips.short",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.tips.short_bold")),1)]),_:1}),ne(K,{keypath:"editor.alerts.tips.button",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.tips.button_bold")),1)]),_:1}),ne(K,{keypath:"editor.alerts.tips.resolve",tag:"li",scope:"global"},{dismiss:ie(()=>[...I[36]||(I[36]=[l("code",null,"dismiss_alert",-1)])]),_:1}),ne(K,{keypath:"editor.alerts.tips.every",tag:"li",scope:"global"},{event:ie(()=>[l("code",null,f(t.value.broadcast?.show||"esp_screens_show_alert"),1)]),screen:ie(()=>[...I[37]||(I[37]=[l("code",null,"screen",-1)])]),_:1}),ne(K,{keypath:"editor.alerts.tips.claude",tag:"li",scope:"global"},{bold:ie(()=>[l("b",null,f(a(u)("editor.alerts.tips.claude_bold")),1)]),_:1})])])],64)):(_(),b("p",E$,f(a(u)("editor.alerts.loading")),1))])}}}),ax={class:"panel",id:"override-dialog"},rx={class:"panel-head"},cx={class:"tx"},ux={class:"eyebrow"},dx={id:"override-title"},fx={class:"notice"},px={class:"mdi"},hx={class:"file-row"},mx={id:"override-file"},gx={class:"yaml-editor",id:"yaml-editor-wrap"},vx=["aria-label"],_x={class:"actions"},yx={id:"override-count",class:"hint"},bx={class:"actions"},wx=["disabled"],kx=["disabled"],$x=`# Hardware-specific changes for this screen.
# This file is kept when the shared firmware package updates.
# Do not add esphome:, api:, ota:, wifi: or packages: here.
# Example: a CYD with the ST7789V display controller.
# "!extend" changes the display the shared package already defines;
# a bare id would add a second, incomplete display and fail the build.
display:
- id: !extend my_display
model: ST7789V
`,Sx=Me({__name:"OverrideView",setup(e){const t=L(()=>m.overrideProfile),n=ke(""),s=ke(""),o=ke(!1),i=ke(u("editor.common.loading")),r=ke(""),c=ke(!1),d=ke(null),h=ke(null),p=L(()=>n.value.split(`
`).length),g=L(()=>Array.from({length:p.value},(O,C)=>C+1).join(`
`)),v=L(()=>`${u("editor.override.characters",n.value.length)} · ${u("editor.override.lines",p.value)}`);let $=!0;function U(O,C=""){i.value=O,r.value=C}async function A(){if(!t.value){U(u("editor.override.no_profile"),"error");return}U(u("editor.common.loading"));try{const O=await Dt(`firmware/profiles/${encodeURIComponent(t.value)}/override`);s.value=O.override_file,o.value=!!O.attached,n.value=O.exists&&O.content!==`{}
`?O.content:"",U(u(O.attached?"editor.override.attached":"editor.override.not_attached"))}catch(O){U(O.message,"error")}}async function T(O=!1){if(!(!t.value||c.value)){c.value=!0,U(u("editor.override.saving"));try{const C=await ht(`firmware/profiles/${encodeURIComponent(t.value)}/override`,"PUT",{content:n.value});if(s.value=C.override_file,o.value=!0,!O){U(u("editor.override.saved"),"ok"),Ce(u("editor.override.saved_toast"));return}U(u("editor.override.checking")),await ht("firmware/jobs","POST",{file:t.value,action:"validate"}),k()}catch(C){U(C.message,"error")}finally{c.value=!1}}}function k(){const O=Date.now(),C=t.value,I=async()=>{if(!(!$||t.value!==C))try{const K=await Dt("firmware"),M=K.job;if(M&&M.file===C&&M.state==="running")U(M.stage?u("editor.override.checking_stage",{stage:M.stage}):u("editor.override.checking_profile"));else if(M&&M.file===C&&M.state==="success"){U(u("editor.override.valid"),"ok");return}else if(M&&M.file===C&&M.state==="failed"){const he=(K.logs||[]).filter(z=>/error|failed/i.test(z)).pop();U(he||u("editor.override.rejected"),"error");return}Date.now()-O<72e5&&setTimeout(I,1200)}catch(K){U(K.message,"error")}};I()}function S(){(!n.value.trim()||confirm(u("editor.override.confirm_example")))&&(n.value=$x,U(u("editor.override.example_loaded")),d.value?.focus())}function F(){(!n.value.trim()||confirm(u("editor.override.confirm_clear")))&&(n.value="",U(u("editor.override.cleared")),d.value?.focus())}function x(O){const C=d.value;if(O.key==="Tab"){O.preventDefault();const I=C.selectionStart,K=C.selectionEnd;C.setRangeText(" ",I,K,"end"),n.value=C.value}else(O.ctrlKey||O.metaKey)&&O.key.toLowerCase()==="s"&&(O.preventDefault(),T(!1))}function j(){h.value&&d.value&&(h.value.scrollTop=d.value.scrollTop)}return Mn(A),ms(()=>{$=!1}),(O,C)=>(_(),b("div",ax,[l("div",rx,[l("div",cx,[l("span",ux,f(a(u)("editor.override.eyebrow")),1),l("h1",dx,f(a(m).overrideFriendly?a(u)("editor.override.title_named",{name:a(m).overrideFriendly}):a(u)("editor.override.title")),1),l("p",null,f(a(u)("editor.override.intro")),1)]),l("button",{type:"button",class:"btn quiet",id:"close-override",onClick:C[0]||(C[0]=I=>a(We)(""))},f(a(u)("editor.common.back")),1)]),l("div",fx,[l("span",px,f(a(Le)("F0493")),1),l("div",null,[l("strong",null,f(a(u)("editor.override.safe_title")),1),l("span",null,f(a(u)("editor.override.safe_text")),1)])]),l("div",hx,[l("code",mx,f(s.value||t.value||""),1),l("span",{id:"override-state",class:ve(["chip",{good:o.value}])},f(o.value?a(u)("editor.override.active"):a(u)("editor.override.ready")),3)]),l("div",gx,[l("div",{ref_key:"gutter",ref:h,class:"yaml-gutter",id:"override-gutter","aria-hidden":"true"},f(g.value),513),Pe(l("textarea",{ref_key:"editor",ref:d,id:"override-editor","onUpdate:modelValue":C[1]||(C[1]=I=>n.value=I),spellcheck:"false",autocapitalize:"off",autocomplete:"off",autocorrect:"off","aria-label":a(u)("editor.override.editor_label"),placeholder:`# Example
display:
- id: !extend my_display
model: ST7789V`,onKeydown:x,onScroll:j},null,40,vx),[[Qe,n.value]])]),l("div",_x,[l("button",{type:"button",class:"btn quiet mini",id:"override-example",onClick:S},f(a(u)("editor.override.use_example")),1),l("button",{type:"button",class:"btn quiet mini",id:"override-empty",onClick:F},f(a(u)("editor.override.clear")),1),l("span",yx,f(v.value),1)]),l("p",{id:"override-status",class:ve(["status-line",r.value]),role:"status"},f(i.value),3),l("div",bx,[l("button",{type:"button",class:"btn quiet",id:"override-check",disabled:c.value||!t.value,onClick:C[2]||(C[2]=I=>T(!0))},f(a(u)("editor.override.save_check")),9,wx),l("button",{type:"button",class:"btn primary",id:"override-save",disabled:c.value||!t.value,onClick:C[3]||(C[3]=I=>T(!1))},f(a(u)("editor.override.save")),9,kx)])]))}}),xx={class:"main"},Cx=Me({__name:"App",setup(e){const t=L(()=>St.value==="#settings"?zk:St.value==="#new-screen"?q0:St.value==="#firmware"?k$:St.value==="#alerts"?lx:St.value==="#override"?Sx:wt.value&&m.layout?Zw:nk);function n(s){(s.metaKey||s.ctrlKey)&&s.key.toLowerCase()==="k"&&(s.preventDefault(),m.palette=!m.palette)}return Mn(()=>document.addEventListener("keydown",n)),ms(()=>document.removeEventListener("keydown",n)),(s,o)=>(_(),b("div",{class:ve(["app",{dragging:a(m).drag.active}])},[ne(hv),l("main",xx,[(_(),at(nf(t.value)))]),ne(gv),ne(Tv)],2))}});Nm().finally(()=>{yp(Cx).use(ds).mount("#app"),Ig()});