diff --git a/config/.HA_VERSION b/config/.HA_VERSION index 38d71f2c..b4bba136 100755 --- a/config/.HA_VERSION +++ b/config/.HA_VERSION @@ -1 +1 @@ -2024.12.4 \ No newline at end of file +2024.12.5 \ No newline at end of file diff --git a/config/www/community/frigate-hass-card/audio-cf3a75aa.js.gz b/config/www/community/frigate-hass-card/audio-cf3a75aa.js.gz index 892aa7da..ba663eb9 100644 Binary files a/config/www/community/frigate-hass-card/audio-cf3a75aa.js.gz and b/config/www/community/frigate-hass-card/audio-cf3a75aa.js.gz differ diff --git a/config/www/community/frigate-hass-card/card-e5d55e5b.js b/config/www/community/frigate-hass-card/card-e5d55e5b.js new file mode 100644 index 00000000..8092b84e --- /dev/null +++ b/config/www/community/frigate-hass-card/card-e5d55e5b.js @@ -0,0 +1,654 @@ +function e(e,t,n,i){var a,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(r<3?a(s):r>3?a(t,n,s):a(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}"function"==typeof SuppressedError&&SuppressedError; +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,n=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),a=new WeakMap;let r=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=a.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&a.set(t,e))}return e}toString(){return this.cssText}};const s=e=>new r("string"==typeof e?e:e+"",void 0,i),o=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1]),e[0]);return new r(n,e,i)},c=(e,i)=>{if(n)e.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of i){const i=document.createElement("style"),a=t.litNonce;void 0!==a&&i.setAttribute("nonce",a),i.textContent=n.cssText,e.appendChild(i)}},l=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return s(t)})(e):e +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,{is:d,defineProperty:u,getOwnPropertyDescriptor:h,getOwnPropertyNames:p,getOwnPropertySymbols:g,getPrototypeOf:m}=Object,f=globalThis,_=f.trustedTypes,y=_?_.emptyScript:"",v=f.reactiveElementPolyfillSupport,b=(e,t)=>e,w={toAttribute(e,t){switch(t){case Boolean:e=e?y:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},x=(e,t)=>!d(e,t),C={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;class M extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=C){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&u(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:a}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return i?.call(this)},set(t){const r=i?.call(this);a.call(this,t),this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??C}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const e=m(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const e=this.properties,t=[...p(e),...g(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){const a=(void 0!==n.converter?.toAttribute?n.converter:w).toAttribute(t,n.type);this._$Em=e,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(e,t){const n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=n.getPropertyOptions(i),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:w;this._$Em=i,this[i]=a.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??x)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}M.elementStyles=[],M.shadowRootOptions={mode:"open"},M[b("elementProperties")]=new Map,M[b("finalized")]=new Map,v?.({ReactiveElement:M}),(f.reactiveElementVersions??=[]).push("2.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const S=globalThis,k=S.trustedTypes,E=k?k.createPolicy("lit-html",{createHTML:e=>e}):void 0,$="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,I="?"+A,z=`<${I}>`,T=document,j=()=>T.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,R="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,N=/>/g,F=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,q=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),U=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),Z=new WeakMap,Q=T.createTreeWalker(T,129);function G(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(t):t}const Y=(e,t)=>{const n=e.length-1,i=[];let a,r=2===t?"":"",s=P;for(let t=0;t"===c[0]?(s=a??P,l=-1):void 0===c[1]?l=-2:(l=s.lastIndex-c[2].length,o=c[1],s=void 0===c[3]?F:'"'===c[3]?H:V):s===H||s===V?s=F:s===L||s===N?s=P:(s=F,a=void 0);const u=s===F&&e[t+1].startsWith("/>")?" ":"";r+=s===P?n+z:l>=0?(i.push(o),n.slice(0,l)+$+n.slice(l)+A+u):n+A+(-2===l?t:u)}return[G(e,r+(e[n]||"")+(2===t?"":"")),i]};class K{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let a=0,r=0;const s=e.length-1,o=this.parts,[c,l]=Y(e,t);if(this.el=K.createElement(c,n),Q.currentNode=this.el.content,2===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=Q.nextNode())&&o.length0){i.textContent=k?k.emptyScript:"";for(let n=0;nD(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==W&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,i="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=K.createElement(G(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new J(i,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Z.get(e.strings);return void 0===t&&Z.set(e.strings,t=new K(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const a of e)i===t.length?t.push(n=new ee(this.S(j()),this.S(j()),this,this.options)):n=t[i],n._$AI(a),i++;i2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=W}_$AI(e,t=this,n,i){const a=this.strings;let r=!1;if(void 0===a)e=X(this,e,t,0),r=!O(e)||e!==this._$AH&&e!==U,r&&(this._$AH=e);else{const i=e;let s,o;for(e=a[0],s=0;s{const i=n?.renderBefore??t;let a=i._$litPart$;if(void 0===a){const e=n?.renderBefore??null;i._$litPart$=a=new ee(t.insertBefore(j(),e),e,void 0,n??{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return U}};oe._$litElement$=!0,oe.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:oe});const ce=globalThis.litElementPolyfillSupport;ce?.({LitElement:oe}),(globalThis.litElementVersions??=[]).push("4.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const le=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,de={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:x},ue=(e=de,t,n)=>{const{kind:i,metadata:a}=n;let r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),r.set(n.name,e),"accessor"===i){const{name:i}=n;return{set(n){const a=t.get.call(this);t.set.call(this,n),this.requestUpdate(i,a,e)},init(t){return void 0!==t&&this.P(i,void 0,e),t}}}if("setter"===i){const{name:i}=n;return function(n){const a=this[i];t.call(this,n),this.requestUpdate(i,a,e)}}throw Error("Unsupported decorator location: "+i)};function he(e){return(t,n)=>"object"==typeof n?ue(e,t,n):((e,t,n)=>{const i=t.hasOwnProperty(n);return t.constructor.createProperty(n,i?{...e,wrapped:!0}:e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */}function pe(e){return he({...e,state:!0,attribute:!1})} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const ge={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},me=e=>(...t)=>({_$litDirective$:e,values:t});let fe=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}; +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const _e=me(class extends fe{constructor(e){if(super(e),e.type!==ge.ATTRIBUTE||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const n=e.element.classList;for(const e of this.st)e in t||(n.remove(e),this.st.delete(e));for(const e in t){const i=!!t[e];i===this.st.has(e)||this.nt?.has(e)||(i?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return U}}),ye=e=>e??W +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,ve=e=>null===e||"object"!=typeof e&&"function"!=typeof e,be=e=>void 0===e.strings,we={},xe=(e,t=we)=>e._$AH=t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,Ce=(e,t)=>{const n=e._$AN;if(void 0===n)return!1;for(const e of n)e._$AO?.(t,!1),Ce(e,t);return!0},Me=e=>{let t,n;do{if(void 0===(t=e._$AM))break;n=t._$AN,n.delete(e),e=t}while(0===n?.size)},Se=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(void 0===n)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),$e(t)}}; +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function ke(e){void 0!==this._$AN?(Me(this),this._$AM=e,Se(this)):this._$AM=e}function Ee(e,t=!1,n=0){const i=this._$AH,a=this._$AN;if(void 0!==a&&0!==a.size)if(t)if(Array.isArray(i))for(let e=n;e{e.type==ge.CHILD&&(e._$AP??=Ee,e._$AQ??=ke)};class Ae extends fe{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Se(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Ce(this,e),Me(this))}setValue(e){if(be(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ie=()=>new ze;let ze=class{};const Te=new WeakMap,je=me(class extends Ae{render(e){return W}update(e,[t]){const n=t!==this.Y;return n&&void 0!==this.Y&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),W}rt(e){if("function"==typeof this.Y){const t=this.ht??globalThis;let n=Te.get(t);void 0===n&&(n=new WeakMap,Te.set(t,n)),void 0!==n.get(this.Y)&&this.Y.call(this.ht,void 0),n.set(this.Y,e),void 0!==e&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){return"function"==typeof this.Y?Te.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Oe="important",De=" !"+Oe,Re=me(class extends fe{constructor(e){if(super(e),e.type!==ge.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,n)=>{const i=e[n];return null==i?t:t+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:n}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?n.removeProperty(e):n[e]=null);for(const e in t){const i=t[e];if(null!=i){this.ft.add(e);const t="string"==typeof i&&i.endsWith(De);e.includes("-")||t?n.setProperty(e,t?i.slice(0,-11):i,t?Oe:""):n[e]=i}}return U}}); +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function Pe(e,t,n,i=20,a=0){let r=[];if(a>=i)return r;const s=e=>{const r=e.assignedNodes().filter((e=>1===e.nodeType));return r.length>0?Pe(r[0].parentElement,t,n,i,a+1):[]},o=Array.from(e.children||[]);for(const e of o)t(e)||(n(e)&&r.push(e),null!=e.shadowRoot?r.push(...Pe(e.shadowRoot,t,n,i,a+1)):"SLOT"===e.tagName?r.push(...s(e)):r.push(...Pe(e,t,n,i,a+1)));return r}function Le(e){return e.hasAttribute("hidden")||e.hasAttribute("aria-hidden")&&"false"!==e.getAttribute("aria-hidden")||"none"===e.style.display||"0"===e.style.opacity||"hidden"===e.style.visibility||"collapse"===e.style.visibility}function Ne(e){return"-1"!==e.getAttribute("tabindex")&&!Le(e)&&!function(e){return e.hasAttribute("disabled")||e.hasAttribute("aria-disabled")&&"false"!==e.getAttribute("aria-disabled")}(e)&&(e.hasAttribute("tabindex")||(e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLIFrameElement)}const Fe=new Map;const Ve=document.createElement("template");Ve.innerHTML='\n\t
\n\t
\n\t\n\t
\n';class He extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const e=this.attachShadow({mode:"open"});e.appendChild(Ve.content.cloneNode(!0)),this.$backup=e.querySelector("#backup"),this.$start=e.querySelector("#start"),this.$end=e.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(e){e?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return Pe(this,Le,Ne)}trapFocus(e){if(this.inactive)return;let t=this.getFocusableElements();t.length>0?(e?t[t.length-1].focus():t[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(e){!function(e,t,n){const i=Fe.get(n);null!=i&&window.clearTimeout(i),Fe.set(n,window.setTimeout((()=>{e(),Fe.delete(n)}),t))}((()=>{this.focused!==e&&(this._focused=e,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}function Be(e){return Number(e.getAttribute("data-dialog-count"))||0}function qe(e,t){e.setAttribute("data-dialog-count",t.toString())}function Ue(e=document.activeElement){return null!=e&&null!=e.shadowRoot&&null!=e.shadowRoot.activeElement?Ue(e.shadowRoot.activeElement):e}window.customElements.define("focus-trap",He);const We=document.createElement("template");We.innerHTML='\n \n
\n \n \n \n';class Ze extends HTMLElement{constructor(){super(),this.$scrollContainer=document.documentElement,this.$previousActiveElement=null;const e=this.attachShadow({mode:"open"});e.appendChild(We.content.cloneNode(!0)),this.$dialog=e.querySelector("#dialog"),this.$backdrop=e.querySelector("#backdrop"),this.onBackdropClick=this.onBackdropClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.setAttribute("aria-modal","true"),this.$dialog.setAttribute("role","alertdialog")}static get observedAttributes(){return["open","center"]}get open(){return this.hasAttribute("open")}set open(e){e?this.setAttribute("open",""):this.removeAttribute("open")}get center(){return this.hasAttribute("center")}set center(e){e?this.setAttribute("center",""):this.removeAttribute("center")}connectedCallback(){this.$backdrop.addEventListener("click",this.onBackdropClick)}disconnectedCallback(){this.$backdrop.removeEventListener("click",this.onBackdropClick),this.open&&this.didClose()}show(){this.open=!0}close(e){this.result=e,this.open=!1}onBackdropClick(){this.assertClosing()&&this.close()}onKeyDown(e){if("Escape"===e.code)this.assertClosing()&&(this.close(),e.stopImmediatePropagation())}assertClosing(){return this.dispatchEvent(new CustomEvent("closing",{cancelable:!0}))}didOpen(){this.$previousActiveElement=Ue(document.activeElement),requestAnimationFrame((()=>{this.$dialog.focusFirstElement()})),this.tabIndex=0,this.$scrollContainer.style.overflow="hidden",this.addEventListener("keydown",this.onKeyDown,{capture:!0,passive:!0}),qe(this.$scrollContainer,Be(this.$scrollContainer)+1),this.dispatchEvent(new CustomEvent("open"))}didClose(){this.removeEventListener("keydown",this.onKeyDown,{capture:!0}),qe(this.$scrollContainer,Math.max(0,Be(this.$scrollContainer)-1)),Be(this.$scrollContainer)<=0&&(this.$scrollContainer.style.overflow=""),this.tabIndex=-1,null!=this.$previousActiveElement&&(this.$previousActiveElement.focus(),this.$previousActiveElement=null),this.dispatchEvent(new CustomEvent("close",{detail:this.result}))}attributeChangedCallback(e,t,n){if("open"===e)this.open?this.didOpen():this.didClose()}}var Qe,Ge;function Ye(e){return e.substr(0,e.indexOf("."))}customElements.define("web-dialog",Ze),function(e){e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.space_comma="space_comma",e.none="none"}(Qe||(Qe={})),function(e){e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24"}(Ge||(Ge={}));var Ke,Xe,Je=["closed","locked","off"],et=function(e,t,n,i){i=i||{},n=null==n?{}:n;var a=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return a.detail=n,e.dispatchEvent(a),a},tt=function(e){et(window,"haptic",e)},nt=function(e,t){return function(e,t,n){void 0===n&&(n=!0);var i,a=Ye(t),r="group"===a?"homeassistant":a;switch(a){case"lock":i=n?"unlock":"lock";break;case"cover":i=n?"open_cover":"close_cover";break;default:i=n?"turn_on":"turn_off"}return e.callService(r,i,{entity_id:t})}(e,t,Je.includes(e.states[t].state))},it=function(e,t,n,i){if(i||(i={action:"more-info"}),!i.confirmation||i.confirmation.exemptions&&i.confirmation.exemptions.some((function(e){return e.user===t.user.id}))||(tt("warning"),confirm(i.confirmation.text||"Are you sure you want to "+i.action+"?")))switch(i.action){case"more-info":(n.entity||n.camera_image)&&et(e,"hass-more-info",{entityId:n.entity?n.entity:n.camera_image});break;case"navigate":i.navigation_path&&function(e,t,n){void 0===n&&(n=!1),n?history.replaceState(null,"",t):history.pushState(null,"",t),et(window,"location-changed",{replace:n})}(0,i.navigation_path);break;case"url":i.url_path&&window.open(i.url_path);break;case"toggle":n.entity&&(nt(t,n.entity),tt("success"));break;case"perform-action":if(!i.perform_action)return void tt("failure");var a=i.perform_action.split(".",2);t.callService(a[0],a[1],i.data,i.target),tt("success");break;case"call-service":if(!i.service)return void tt("failure");var r=i.service.split(".",2);t.callService(r[0],r[1],i.data,i.target),tt("success");break;case"fire-dom-event":et(e,"ll-custom",i)}};!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),i={};for(const e of n)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Ke||(Ke={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Xe||(Xe={}));const at=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rt=e=>{switch(typeof e){case"undefined":return at.undefined;case"string":return at.string;case"number":return isNaN(e)?at.nan:at.number;case"boolean":return at.boolean;case"function":return at.function;case"bigint":return at.bigint;case"symbol":return at.symbol;case"object":return Array.isArray(e)?at.array:null===e?at.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?at.promise:"undefined"!=typeof Map&&e instanceof Map?at.map:"undefined"!=typeof Set&&e instanceof Set?at.set:"undefined"!=typeof Date&&e instanceof Date?at.date:at.object;default:return at.unknown}},st=Ke.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ot extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},i=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(i);else if("invalid_return_type"===a.code)i(a.returnTypeError);else if("invalid_arguments"===a.code)i(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,i=0;for(;ie.message)){const t={},n=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ot.create=e=>new ot(e);const ct=(e,t)=>{let n;switch(e.code){case st.invalid_type:n=e.received===at.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case st.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ke.jsonStringifyReplacer)}`;break;case st.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ke.joinValues(e.keys,", ")}`;break;case st.invalid_union:n="Invalid input";break;case st.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ke.joinValues(e.options)}`;break;case st.invalid_enum_value:n=`Invalid enum value. Expected ${Ke.joinValues(e.options)}, received '${e.received}'`;break;case st.invalid_arguments:n="Invalid function arguments";break;case st.invalid_return_type:n="Invalid function return type";break;case st.invalid_date:n="Invalid date";break;case st.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ke.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case st.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case st.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case st.custom:n="Invalid input";break;case st.invalid_intersection_types:n="Intersection results could not be merged";break;case st.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case st.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ke.assertNever(e)}return{message:n}};let lt=ct;function dt(){return lt}const ut=e=>{const{data:t,path:n,errorMaps:i,issueData:a}=e,r=[...n,...a.path||[]],s={...a,path:r};if(void 0!==a.message)return{...a,path:r,message:a.message};let o="";const c=i.filter((e=>!!e)).slice().reverse();for(const e of c)o=e(s,{data:t,defaultError:o}).message;return{...a,path:r,message:o}};function ht(e,t){const n=dt(),i=ut({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ct?void 0:ct].filter((e=>!!e))});e.common.issues.push(i)}class pt{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const i of t){if("aborted"===i.status)return gt;"dirty"===i.status&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,i=await e.value;n.push({key:t,value:i})}return pt.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const i of t){const{key:t,value:a}=i;if("aborted"===t.status)return gt;if("aborted"===a.status)return gt;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!i.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const gt=Object.freeze({status:"aborted"}),mt=e=>({status:"dirty",value:e}),ft=e=>({status:"valid",value:e}),_t=e=>"aborted"===e.status,yt=e=>"dirty"===e.status,vt=e=>"valid"===e.status,bt=e=>"undefined"!=typeof Promise&&e instanceof Promise;function wt(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function xt(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n}var Ct,Mt,St;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Ct||(Ct={}));class kt{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Et=(e,t)=>{if(vt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ot(e.common.issues);return this._error=t,this._error}}};function $t(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:i,description:a}=e;if(t&&(n||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var r,s;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(r=null!=o?o:i)&&void 0!==r?r:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(s=null!=o?o:n)&&void 0!==s?s:a.defaultError}},description:a}}class At{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return rt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:rt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pt,ctx:{common:e.parent.common,data:e.data,parsedType:rt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(bt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const i={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rt(e)},a=this._parseSync({data:e,path:i.path,parent:i});return Et(i,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rt(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(bt(i)?i:Promise.resolve(i));return Et(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,i)=>{const a=e(t),r=()=>i.addIssue({code:st.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(r(),!1))):!!a||(r(),!1)}))}refinement(e,t){return this._refinement(((n,i)=>!!e(n)||(i.addIssue("function"==typeof t?t(n,i):t),!1)))}_refinement(e){return new Sn({schema:this,typeName:Pn.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return kn.create(this,this._def)}nullable(){return En.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return Mn.create(this,this._def)}or(e){return ln.create([this,e],this._def)}and(e){return pn.create(this,e,this._def)}transform(e){return new Sn({...$t(this._def),schema:this,typeName:Pn.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new $n({...$t(this._def),innerType:this,defaultValue:t,typeName:Pn.ZodDefault})}brand(){return new Tn({typeName:Pn.ZodBranded,type:this,...$t(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new An({...$t(this._def),innerType:this,catchValue:t,typeName:Pn.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return jn.create(this,e)}readonly(){return On.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const It=/^c[^\s-]{8,}$/i,zt=/^[0-9a-z]+$/,Tt=/^[0-9A-HJKMNP-TV-Z]{26}$/,jt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ot=/^[a-z0-9_-]{21}$/i,Dt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Rt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Pt;const Lt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Nt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ft=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ht=new RegExp(`^${Vt}$`);function Bt(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function qt(e){let t=`${Vt}T${Bt(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ut(e,t){return!("v4"!==t&&t||!Lt.test(e))||!("v6"!==t&&t||!Nt.test(e))}class Wt extends At{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==at.string){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.string,received:t.parsedType}),gt}const t=new pt;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.lengthi.value&&(n=this._getOrReturnCtx(e,n),ht(n,{code:st.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const a=e.data.length>i.value,r=e.data.lengthe.test(t)),{validation:t,code:st.invalid_string,...Ct.errToObj(n)})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ct.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ct.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ct.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ct.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ct.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ct.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ct.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ct.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ct.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ct.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...Ct.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...Ct.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ct.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ct.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...Ct.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ct.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ct.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ct.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ct.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ct.errToObj(t)})}nonempty(e){return this.min(1,Ct.errToObj(e))}trim(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuei?n:i;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}Wt.create=e=>{var t;return new Wt({checks:[],typeName:Pn.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$t(e)})};class Qt extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==at.number){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.number,received:t.parsedType}),gt}let t;const n=new pt;for(const i of this._def.checks)if("int"===i.kind)Ke.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ht(t,{code:st.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty());else if("min"===i.kind){(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),ht(t,{code:st.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty())}else"multipleOf"===i.kind?0!==Zt(e.data,i.value)&&(t=this._getOrReturnCtx(e,t),ht(t,{code:st.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ht(t,{code:st.not_finite,message:i.message}),n.dirty()):Ke.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ct.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ct.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ct.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ct.toString(t))}setLimit(e,t,n,i){return new Qt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ct.toString(i)}]})}_addCheck(e){return new Qt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ct.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ct.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ct.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ct.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ct.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ct.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&Ke.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.valuenew Qt({checks:[],typeName:Pn.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$t(e)});class Gt extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==at.bigint){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.bigint,received:t.parsedType}),gt}let t;const n=new pt;for(const i of this._def.checks)if("min"===i.kind){(i.inclusive?e.datai.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),ht(t,{code:st.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty())}else"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),ht(t,{code:st.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):Ke.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ct.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ct.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ct.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ct.toString(t))}setLimit(e,t,n,i){return new Gt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ct.toString(i)}]})}_addCheck(e){return new Gt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ct.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ct.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new Gt({checks:[],typeName:Pn.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$t(e)})};class Yt extends At{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==at.boolean){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.boolean,received:t.parsedType}),gt}return ft(e.data)}}Yt.create=e=>new Yt({typeName:Pn.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$t(e)});class Kt extends At{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==at.date){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.date,received:t.parsedType}),gt}if(isNaN(e.data.getTime())){return ht(this._getOrReturnCtx(e),{code:st.invalid_date}),gt}const t=new pt;let n;for(const i of this._def.checks)"min"===i.kind?e.data.getTime()i.value&&(n=this._getOrReturnCtx(e,n),ht(n,{code:st.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):Ke.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Kt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ct.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ct.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew Kt({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Pn.ZodDate,...$t(e)});class Xt extends At{_parse(e){if(this._getType(e)!==at.symbol){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.symbol,received:t.parsedType}),gt}return ft(e.data)}}Xt.create=e=>new Xt({typeName:Pn.ZodSymbol,...$t(e)});class Jt extends At{_parse(e){if(this._getType(e)!==at.undefined){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.undefined,received:t.parsedType}),gt}return ft(e.data)}}Jt.create=e=>new Jt({typeName:Pn.ZodUndefined,...$t(e)});class en extends At{_parse(e){if(this._getType(e)!==at.null){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.null,received:t.parsedType}),gt}return ft(e.data)}}en.create=e=>new en({typeName:Pn.ZodNull,...$t(e)});class tn extends At{constructor(){super(...arguments),this._any=!0}_parse(e){return ft(e.data)}}tn.create=e=>new tn({typeName:Pn.ZodAny,...$t(e)});class nn extends At{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ft(e.data)}}nn.create=e=>new nn({typeName:Pn.ZodUnknown,...$t(e)});class an extends At{_parse(e){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.never,received:t.parsedType}),gt}}an.create=e=>new an({typeName:Pn.ZodNever,...$t(e)});class rn extends At{_parse(e){if(this._getType(e)!==at.undefined){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.void,received:t.parsedType}),gt}return ft(e.data)}}rn.create=e=>new rn({typeName:Pn.ZodVoid,...$t(e)});class sn extends At{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==at.array)return ht(t,{code:st.invalid_type,expected:at.array,received:t.parsedType}),gt;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,a=t.data.lengthi.maxLength.value&&(ht(t,{code:st.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>i.type._parseAsync(new kt(t,e,t.path,n))))).then((e=>pt.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>i.type._parseSync(new kt(t,e,t.path,n))));return pt.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new sn({...this._def,minLength:{value:e,message:Ct.toString(t)}})}max(e,t){return new sn({...this._def,maxLength:{value:e,message:Ct.toString(t)}})}length(e,t){return new sn({...this._def,exactLength:{value:e,message:Ct.toString(t)}})}nonempty(e){return this.min(1,e)}}function on(e){if(e instanceof cn){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=kn.create(on(i))}return new cn({...e._def,shape:()=>t})}return e instanceof sn?new sn({...e._def,type:on(e.element)}):e instanceof kn?kn.create(on(e.unwrap())):e instanceof En?En.create(on(e.unwrap())):e instanceof gn?gn.create(e.items.map((e=>on(e)))):e}sn.create=(e,t)=>new sn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Pn.ZodArray,...$t(t)});class cn extends At{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Ke.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==at.object){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.object,received:t.parsedType}),gt}const{status:t,ctx:n}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),r=[];if(!(this._def.catchall instanceof an&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||r.push(e);const s=[];for(const e of a){const t=i[e],a=n.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new kt(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof an){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)s.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)r.length>0&&(ht(n,{code:st.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r){const i=n.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new kt(n,i,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of s){const n=await t.key,i=await t.value;e.push({key:n,value:i,alwaysSet:t.alwaysSet})}return e})).then((e=>pt.mergeObjectSync(t,e))):pt.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return Ct.errToObj,new cn({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var i,a,r,s;const o=null!==(r=null===(a=(i=this._def).errorMap)||void 0===a?void 0:a.call(i,t,n).message)&&void 0!==r?r:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=Ct.errToObj(e).message)&&void 0!==s?s:o}:{message:o}}}:{}})}strip(){return new cn({...this._def,unknownKeys:"strip"})}passthrough(){return new cn({...this._def,unknownKeys:"passthrough"})}extend(e){return new cn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new cn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Pn.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new cn({...this._def,catchall:e})}pick(e){const t={};return Ke.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new cn({...this._def,shape:()=>t})}omit(e){const t={};return Ke.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new cn({...this._def,shape:()=>t})}deepPartial(){return on(this)}partial(e){const t={};return Ke.objectKeys(this.shape).forEach((n=>{const i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()})),new cn({...this._def,shape:()=>t})}required(e){const t={};return Ke.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof kn;)e=e._def.innerType;t[n]=e}})),new cn({...this._def,shape:()=>t})}keyof(){return wn(Ke.objectKeys(this.shape))}}cn.create=(e,t)=>new cn({shape:()=>e,unknownKeys:"strip",catchall:an.create(),typeName:Pn.ZodObject,...$t(t)}),cn.strictCreate=(e,t)=>new cn({shape:()=>e,unknownKeys:"strict",catchall:an.create(),typeName:Pn.ZodObject,...$t(t)}),cn.lazycreate=(e,t)=>new cn({shape:e,unknownKeys:"strip",catchall:an.create(),typeName:Pn.ZodObject,...$t(t)});class ln extends At{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new ot(e.ctx.common.issues)));return ht(t,{code:st.invalid_union,unionErrors:n}),gt}));{let e;const i=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},r=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:n}),n.common.issues.length&&i.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=i.map((e=>new ot(e)));return ht(t,{code:st.invalid_union,unionErrors:a}),gt}}get options(){return this._def.options}}ln.create=(e,t)=>new ln({options:e,typeName:Pn.ZodUnion,...$t(t)});const dn=e=>e instanceof vn?dn(e.schema):e instanceof Sn?dn(e.innerType()):e instanceof bn?[e.value]:e instanceof xn?e.options:e instanceof Cn?Ke.objectValues(e.enum):e instanceof $n?dn(e._def.innerType):e instanceof Jt?[void 0]:e instanceof en?[null]:e instanceof kn?[void 0,...dn(e.unwrap())]:e instanceof En?[null,...dn(e.unwrap())]:e instanceof Tn||e instanceof On?dn(e.unwrap()):e instanceof An?dn(e._def.innerType):[];class un extends At{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==at.object)return ht(t,{code:st.invalid_type,expected:at.object,received:t.parsedType}),gt;const n=this.discriminator,i=t.data[n],a=this.optionsMap.get(i);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(ht(t,{code:st.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const i=new Map;for(const n of t){const t=dn(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,n)}}return new un({typeName:Pn.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...$t(n)})}}function hn(e,t){const n=rt(e),i=rt(t);if(e===t)return{valid:!0,data:e};if(n===at.object&&i===at.object){const n=Ke.objectKeys(t),i=Ke.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of i){const i=hn(e[n],t[n]);if(!i.valid)return{valid:!1};a[n]=i.data}return{valid:!0,data:a}}if(n===at.array&&i===at.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i{if(_t(e)||_t(i))return gt;const a=hn(e.value,i.value);return a.valid?((yt(e)||yt(i))&&t.dirty(),{status:t.value,value:a.data}):(ht(n,{code:st.invalid_intersection_types}),gt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}pn.create=(e,t,n)=>new pn({left:e,right:t,typeName:Pn.ZodIntersection,...$t(n)});class gn extends At{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==at.array)return ht(n,{code:st.invalid_type,expected:at.array,received:n.parsedType}),gt;if(n.data.lengththis._def.items.length&&(ht(n,{code:st.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...n.data].map(((e,t)=>{const i=this._def.items[t]||this._def.rest;return i?i._parse(new kt(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(i).then((e=>pt.mergeArray(t,e))):pt.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new gn({...this._def,rest:e})}}gn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new gn({items:e,typeName:Pn.ZodTuple,rest:null,...$t(t)})};class mn extends At{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==at.object)return ht(n,{code:st.invalid_type,expected:at.object,received:n.parsedType}),gt;const i=[],a=this._def.keyType,r=this._def.valueType;for(const e in n.data)i.push({key:a._parse(new kt(n,e,n.path,e)),value:r._parse(new kt(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?pt.mergeObjectAsync(t,i):pt.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return new mn(t instanceof At?{keyType:e,valueType:t,typeName:Pn.ZodRecord,...$t(n)}:{keyType:Wt.create(),valueType:e,typeName:Pn.ZodRecord,...$t(t)})}}class fn extends At{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==at.map)return ht(n,{code:st.invalid_type,expected:at.map,received:n.parsedType}),gt;const i=this._def.keyType,a=this._def.valueType,r=[...n.data.entries()].map((([e,t],r)=>({key:i._parse(new kt(n,e,n.path,[r,"key"])),value:a._parse(new kt(n,t,n.path,[r,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of r){const i=await n.key,a=await n.value;if("aborted"===i.status||"aborted"===a.status)return gt;"dirty"!==i.status&&"dirty"!==a.status||t.dirty(),e.set(i.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of r){const i=n.key,a=n.value;if("aborted"===i.status||"aborted"===a.status)return gt;"dirty"!==i.status&&"dirty"!==a.status||t.dirty(),e.set(i.value,a.value)}return{status:t.value,value:e}}}}fn.create=(e,t,n)=>new fn({valueType:t,keyType:e,typeName:Pn.ZodMap,...$t(n)});class _n extends At{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==at.set)return ht(n,{code:st.invalid_type,expected:at.set,received:n.parsedType}),gt;const i=this._def;null!==i.minSize&&n.data.sizei.maxSize.value&&(ht(n,{code:st.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const a=this._def.valueType;function r(e){const n=new Set;for(const i of e){if("aborted"===i.status)return gt;"dirty"===i.status&&t.dirty(),n.add(i.value)}return{status:t.value,value:n}}const s=[...n.data.values()].map(((e,t)=>a._parse(new kt(n,e,n.path,t))));return n.common.async?Promise.all(s).then((e=>r(e))):r(s)}min(e,t){return new _n({...this._def,minSize:{value:e,message:Ct.toString(t)}})}max(e,t){return new _n({...this._def,maxSize:{value:e,message:Ct.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_n.create=(e,t)=>new _n({valueType:e,minSize:null,maxSize:null,typeName:Pn.ZodSet,...$t(t)});class yn extends At{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==at.function)return ht(t,{code:st.invalid_type,expected:at.function,received:t.parsedType}),gt;function n(e,n){return ut({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dt(),ct].filter((e=>!!e)),issueData:{code:st.invalid_arguments,argumentsError:n}})}function i(e,n){return ut({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dt(),ct].filter((e=>!!e)),issueData:{code:st.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Mn){const e=this;return ft((async function(...t){const s=new ot([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw s.addIssue(n(t,e)),s})),c=await Reflect.apply(r,this,o),l=await e._def.returns._def.type.parseAsync(c,a).catch((e=>{throw s.addIssue(i(c,e)),s}));return l}))}{const e=this;return ft((function(...t){const s=e._def.args.safeParse(t,a);if(!s.success)throw new ot([n(t,s.error)]);const o=Reflect.apply(r,this,s.data),c=e._def.returns.safeParse(o,a);if(!c.success)throw new ot([i(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new yn({...this._def,args:gn.create(e).rest(nn.create())})}returns(e){return new yn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new yn({args:e||gn.create([]).rest(nn.create()),returns:t||nn.create(),typeName:Pn.ZodFunction,...$t(n)})}}class vn extends At{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}vn.create=(e,t)=>new vn({getter:e,typeName:Pn.ZodLazy,...$t(t)});class bn extends At{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ht(t,{received:t.data,code:st.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function wn(e,t){return new xn({values:e,typeName:Pn.ZodEnum,...$t(t)})}bn.create=(e,t)=>new bn({value:e,typeName:Pn.ZodLiteral,...$t(t)});class xn extends At{constructor(){super(...arguments),Mt.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return ht(t,{expected:Ke.joinValues(n),received:t.parsedType,code:st.invalid_type}),gt}if(wt(this,Mt,"f")||xt(this,Mt,new Set(this._def.values),"f"),!wt(this,Mt,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ht(t,{received:t.data,code:st.invalid_enum_value,options:n}),gt}return ft(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return xn.create(e,{...this._def,...t})}exclude(e,t=this._def){return xn.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}Mt=new WeakMap,xn.create=wn;class Cn extends At{constructor(){super(...arguments),St.set(this,void 0)}_parse(e){const t=Ke.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==at.string&&n.parsedType!==at.number){const e=Ke.objectValues(t);return ht(n,{expected:Ke.joinValues(e),received:n.parsedType,code:st.invalid_type}),gt}if(wt(this,St,"f")||xt(this,St,new Set(Ke.getValidEnumValues(this._def.values)),"f"),!wt(this,St,"f").has(e.data)){const e=Ke.objectValues(t);return ht(n,{received:n.data,code:st.invalid_enum_value,options:e}),gt}return ft(e.data)}get enum(){return this._def.values}}St=new WeakMap,Cn.create=(e,t)=>new Cn({values:e,typeName:Pn.ZodNativeEnum,...$t(t)});class Mn extends At{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==at.promise&&!1===t.common.async)return ht(t,{code:st.invalid_type,expected:at.promise,received:t.parsedType}),gt;const n=t.parsedType===at.promise?t.data:Promise.resolve(t.data);return ft(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Mn.create=(e,t)=>new Mn({type:e,typeName:Pn.ZodPromise,...$t(t)});class Sn extends At{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pn.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:e=>{ht(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===i.type){const e=i.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return gt;const i=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===i.status?gt:"dirty"===i.status||"dirty"===t.value?mt(i.value):i}));{if("aborted"===t.value)return gt;const i=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===i.status?gt:"dirty"===i.status||"dirty"===t.value?mt(i.value):i}}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===i.status?gt:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?gt:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===i.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!vt(e))return e;const r=i.transform(e.value,a);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>vt(e)?Promise.resolve(i.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}Ke.assertNever(i)}}Sn.create=(e,t,n)=>new Sn({schema:e,typeName:Pn.ZodEffects,effect:t,...$t(n)}),Sn.createWithPreprocess=(e,t,n)=>new Sn({schema:t,effect:{type:"preprocess",transform:e},typeName:Pn.ZodEffects,...$t(n)});class kn extends At{_parse(e){return this._getType(e)===at.undefined?ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}kn.create=(e,t)=>new kn({innerType:e,typeName:Pn.ZodOptional,...$t(t)});class En extends At{_parse(e){return this._getType(e)===at.null?ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}En.create=(e,t)=>new En({innerType:e,typeName:Pn.ZodNullable,...$t(t)});class $n extends At{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===at.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}$n.create=(e,t)=>new $n({innerType:e,typeName:Pn.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$t(t)});class An extends At{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return bt(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ot(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new ot(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}An.create=(e,t)=>new An({innerType:e,typeName:Pn.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$t(t)});class In extends At{_parse(e){if(this._getType(e)!==at.nan){const t=this._getOrReturnCtx(e);return ht(t,{code:st.invalid_type,expected:at.nan,received:t.parsedType}),gt}return{status:"valid",value:e.data}}}In.create=e=>new In({typeName:Pn.ZodNaN,...$t(e)});const zn=Symbol("zod_brand");class Tn extends At{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class jn extends At{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?gt:"dirty"===e.status?(t.dirty(),mt(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?gt:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new jn({in:e,out:t,typeName:Pn.ZodPipeline})}}class On extends At{_parse(e){const t=this._def.innerType._parse(e),n=e=>(vt(e)&&(e.value=Object.freeze(e.value)),e);return bt(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Dn(e,t={},n){return e?tn.create().superRefine(((i,a)=>{var r,s;if(!e(i)){const e="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,o=null===(s=null!==(r=e.fatal)&&void 0!==r?r:n)||void 0===s||s,c="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...c,fatal:o})}})):tn.create()}On.create=(e,t)=>new On({innerType:e,typeName:Pn.ZodReadonly,...$t(t)});const Rn={object:cn.lazycreate};var Pn;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Pn||(Pn={}));const Ln=Wt.create,Nn=Qt.create,Fn=In.create,Vn=Gt.create,Hn=Yt.create,Bn=Kt.create,qn=Xt.create,Un=Jt.create,Wn=en.create,Zn=tn.create,Qn=nn.create,Gn=an.create,Yn=rn.create,Kn=sn.create,Xn=cn.create,Jn=cn.strictCreate,ei=ln.create,ti=un.create,ni=pn.create,ii=gn.create,ai=mn.create,ri=fn.create,si=_n.create,oi=yn.create,ci=vn.create,li=bn.create,di=xn.create,ui=Cn.create,hi=Mn.create,pi=Sn.create,gi=kn.create,mi=En.create,fi=Sn.createWithPreprocess,_i=jn.create,yi={string:e=>Wt.create({...e,coerce:!0}),number:e=>Qt.create({...e,coerce:!0}),boolean:e=>Yt.create({...e,coerce:!0}),bigint:e=>Gt.create({...e,coerce:!0}),date:e=>Kt.create({...e,coerce:!0})},vi=gt;var bi=Object.freeze({__proto__:null,defaultErrorMap:ct,setErrorMap:function(e){lt=e},getErrorMap:dt,makeIssue:ut,EMPTY_PATH:[],addIssueToContext:ht,ParseStatus:pt,INVALID:gt,DIRTY:mt,OK:ft,isAborted:_t,isDirty:yt,isValid:vt,isAsync:bt,get util(){return Ke},get objectUtil(){return Xe},ZodParsedType:at,getParsedType:rt,ZodType:At,datetimeRegex:qt,ZodString:Wt,ZodNumber:Qt,ZodBigInt:Gt,ZodBoolean:Yt,ZodDate:Kt,ZodSymbol:Xt,ZodUndefined:Jt,ZodNull:en,ZodAny:tn,ZodUnknown:nn,ZodNever:an,ZodVoid:rn,ZodArray:sn,ZodObject:cn,ZodUnion:ln,ZodDiscriminatedUnion:un,ZodIntersection:pn,ZodTuple:gn,ZodRecord:mn,ZodMap:fn,ZodSet:_n,ZodFunction:yn,ZodLazy:vn,ZodLiteral:bn,ZodEnum:xn,ZodNativeEnum:Cn,ZodPromise:Mn,ZodEffects:Sn,ZodTransformer:Sn,ZodOptional:kn,ZodNullable:En,ZodDefault:$n,ZodCatch:An,ZodNaN:In,BRAND:zn,ZodBranded:Tn,ZodPipeline:jn,ZodReadonly:On,custom:Dn,Schema:At,ZodSchema:At,late:Rn,get ZodFirstPartyTypeKind(){return Pn},coerce:yi,any:Zn,array:Kn,bigint:Vn,boolean:Hn,date:Bn,discriminatedUnion:ti,effect:pi,enum:di,function:oi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Dn((t=>t instanceof e),t),intersection:ni,lazy:ci,literal:li,map:ri,nan:Fn,nativeEnum:ui,never:Gn,null:Wn,nullable:mi,number:Nn,object:Xn,oboolean:()=>Hn().optional(),onumber:()=>Nn().optional(),optional:gi,ostring:()=>Ln().optional(),pipeline:_i,preprocess:fi,promise:hi,record:ai,set:si,strictObject:Jn,string:Ln,symbol:qn,transformer:pi,tuple:ii,undefined:Un,union:ei,unknown:Qn,void:Yn,NEVER:vi,ZodIssueCode:st,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:ot});const wi="cameras",xi=`${wi}.#.camera_entity`,Ci=`${wi}.#.frigate.camera_name`,Mi=`${wi}.#.capabilities.disable`,Si=`${wi}.#.capabilities.disable_except`,ki=`${wi}.#.cast.method`,Ei=`${wi}.#.cast.dashboard.dashboard_path`,$i=`${wi}.#.cast.dashboard.view_path`,Ai=`${wi}.#.dimensions.aspect_ratio`,Ii=`${wi}.#.frigate.client_id`,zi=`${wi}.#.frigate.labels`,Ti=`${wi}.#.frigate.url`,ji=`${wi}.#.frigate.zones`,Oi=`${wi}.#.go2rtc.modes`,Di=`${wi}.#.go2rtc.stream`,Ri=`${wi}.#.icon`,Pi=`${wi}.#.id`,Li=`${wi}.#.image.entity`,Ni=`${wi}.#.image.entity_parameters`,Fi=`${wi}.#.image.mode`,Vi=`${wi}.#.image.refresh_seconds`,Hi=`${wi}.#.image.url`,Bi=`${wi}.#.motioneye.images.directory_pattern`,qi=`${wi}.#.motioneye.images.file_pattern`,Ui=`${wi}.#.motioneye.movies.directory_pattern`,Wi=`${wi}.#.motioneye.movies.file_pattern`,Zi=`${wi}.#.motioneye.url`,Qi=`${wi}.#.title`,Gi=`${wi}.#.webrtc_card.entity`,Yi=`${wi}.#.webrtc_card.url`,Ki=`${wi}.#.live_provider`,Xi=`${wi}.#.dependencies.cameras`,Ji=`${wi}.#.dependencies.all_cameras`,ea=`${wi}.#.dimensions.layout.fit`,ta=`${wi}.#.dimensions.layout.pan.x`,na=`${wi}.#.dimensions.layout.pan.y`,ia=`${wi}.#.dimensions.layout.position.x`,aa=`${wi}.#.dimensions.layout.position.y`,ra=`${wi}.#.dimensions.layout.view_box.top`,sa=`${wi}.#.dimensions.layout.view_box.bottom`,oa=`${wi}.#.dimensions.layout.view_box.left`,ca=`${wi}.#.dimensions.layout.view_box.right`,la=`${wi}.#.dimensions.layout.zoom`,da=`${wi}.#.proxy.dynamic`,ua=`${wi}.#.proxy.media`,ha=`${wi}.#.proxy.ssl_ciphers`,pa=`${wi}.#.proxy.ssl_verification`,ga=`${wi}.#.reolink.media_resolution`,ma=`${wi}.#.reolink.url`,fa=`${wi}.#.triggers.motion`,_a=`${wi}.#.triggers.occupancy`,ya=`${wi}.#.triggers.entities`,va=`${wi}.#.triggers.events`,ba="cameras_global",wa=`${ba}.image`,xa=`${ba}.live_provider`,Ca=`${ba}.jsmpeg`,Ma=`${ba}.webrtc_card`,Sa=`${ba}.triggers.occupancy`,ka=`${ba}.image.refresh_seconds`,Ea=`${ba}.dimensions.layout`,$a=`${ba}.ptz`,Aa="elements",Ia="view",za=`${Ia}.camera_select`,Ta=`${Ia}.dark_mode`,ja=`${Ia}.default`,Oa=`${Ia}.interaction_seconds`,Da=`${Ia}.keyboard_shortcuts`,Ra=`${Ia}.keyboard_shortcuts.enabled`,Pa=`${Da}.ptz_left`,La=`${Da}.ptz_right`,Na=`${Da}.ptz_up`,Fa=`${Da}.ptz_down`,Va=`${Da}.ptz_zoom_in`,Ha=`${Da}.ptz_zoom_out`,Ba=`${Da}.ptz_home`,qa=`${Ia}.default_cycle_camera`,Ua=`${Ia}.default_reset`,Wa=`${Ua}.interaction_mode`,Za=`${Ua}.every_seconds`,Qa=`${Ua}.entities`,Ga=`${Ua}.after_interaction`,Ya=`${Ia}.triggers`,Ka=`${Ya}.show_trigger_status`,Xa=`${Ya}.filter_selected_camera`,Ja=`${Ya}.untrigger_seconds`,er=`${Ya}.actions`,tr=`${er}.trigger`,nr=`${er}.untrigger`,ir=`${er}.interaction_mode`,ar="media_gallery",rr=`${ar}.controls.filter.mode`,sr=`${ar}.controls.thumbnails.show_details`,or=`${ar}.controls.thumbnails.show_download_control`,cr=`${ar}.controls.thumbnails.show_favorite_control`,lr=`${ar}.controls.thumbnails.show_timeline_control`,dr=`${ar}.controls.thumbnails.size`,ur="media_viewer",hr=`${ur}.auto_play`,pr=`${ur}.auto_pause`,gr=`${ur}.auto_mute`,mr=`${ur}.auto_unmute`,fr=`${ur}.display.mode`,_r=`${ur}.display.grid_columns`,yr=`${ur}.display.grid_max_columns`,vr=`${ur}.display.grid_selected_width_factor`,br=`${ur}.draggable`,wr=`${ur}.lazy_load`,xr=`${ur}.snapshot_click_plays_clip`,Cr=`${ur}.transition_effect`,Mr=`${ur}.controls.builtin`,Sr=`${ur}.controls.next_previous.style`,kr=`${ur}.controls.next_previous.size`,Er=`${ur}.controls.thumbnails.mode`,$r=`${ur}.controls.thumbnails.show_details`,Ar=`${ur}.controls.thumbnails.show_download_control`,Ir=`${ur}.controls.thumbnails.show_favorite_control`,zr=`${ur}.controls.thumbnails.show_timeline_control`,Tr=`${ur}.controls.thumbnails.size`,jr=`${ur}.controls.timeline.clustering_threshold`,Or=`${ur}.controls.timeline.events_media_type`,Dr=`${ur}.controls.timeline.mode`,Rr=`${ur}.controls.timeline.pan_mode`,Pr=`${ur}.controls.timeline.show_recordings`,Lr=`${ur}.controls.timeline.style`,Nr=`${ur}.controls.timeline.window_seconds`,Fr=`${ur}.zoomable`,Vr="live",Hr=`${Vr}.auto_play`,Br=`${Vr}.auto_pause`,qr=`${Vr}.auto_mute`,Ur=`${Vr}.auto_unmute`,Wr=`${Vr}.controls.builtin`,Zr=`${Vr}.controls.next_previous.style`,Qr=`${Vr}.controls.next_previous.size`,Gr=`${Vr}.controls.ptz.hide_home`,Yr=`${Vr}.controls.ptz.hide_pan_tilt`,Kr=`${Vr}.controls.ptz.hide_zoom`,Xr=`${Vr}.controls.ptz.mode`,Jr=`${Vr}.controls.ptz.orientation`,es=`${Vr}.controls.ptz.position`,ts=`${Vr}.controls.thumbnails.media_type`,ns=`${Vr}.controls.thumbnails.events_media_type`,is=`${Vr}.controls.thumbnails.mode`,as=`${Vr}.controls.thumbnails.size`,rs=`${Vr}.controls.thumbnails.show_details`,ss=`${Vr}.controls.thumbnails.show_download_control`,os=`${Vr}.controls.thumbnails.show_favorite_control`,cs=`${Vr}.controls.thumbnails.show_timeline_control`,ls=`${Vr}.controls.timeline.clustering_threshold`,ds=`${Vr}.controls.timeline.events_media_type`,us=`${Vr}.controls.timeline.mode`,hs=`${Vr}.controls.timeline.pan_mode`,ps=`${Vr}.controls.timeline.show_recordings`,gs=`${Vr}.controls.timeline.style`,ms=`${Vr}.controls.timeline.window_seconds`,fs=`${Vr}.display.mode`,_s=`${Vr}.display.grid_columns`,ys=`${Vr}.display.grid_max_columns`,vs=`${Vr}.display.grid_selected_width_factor`,bs=`${Vr}.draggable`,ws=`${Vr}.lazy_load`,xs=`${Vr}.lazy_unload`,Cs=`${Vr}.preload`,Ms=`${Vr}.transition_effect`,Ss=`${Vr}.show_image_during_load`,ks=`${Vr}.microphone.disconnect_seconds`,Es=`${Vr}.microphone.mute_after_microphone_mute_seconds`,$s=`${Vr}.microphone.always_connected`,As=`${Vr}.zoomable`,Is="image",zs=`${Is}.entity`,Ts=`${Is}.entity_parameters`,js=`${Is}.mode`,Os=`${Is}.refresh_seconds`,Ds=`${Is}.url`,Rs="timeline",Ps=`${Rs}.window_seconds`,Ls=`${Rs}.clustering_threshold`,Ns=`${Rs}.events_media_type`,Fs=`${Rs}.show_recordings`,Vs=`${Rs}.style`,Hs=`${Rs}.controls.thumbnails.mode`,Bs=`${Rs}.controls.thumbnails.size`,qs=`${Rs}.controls.thumbnails.show_details`,Us=`${Rs}.controls.thumbnails.show_download_control`,Ws=`${Rs}.controls.thumbnails.show_favorite_control`,Zs=`${Rs}.controls.thumbnails.show_timeline_control`,Qs="menu",Gs=`${Qs}.alignment`,Ys=`${Qs}.position`,Ks=`${Qs}.style`,Xs=`${Qs}.button_size`,Js=`${Qs}.buttons`,eo=`${Js}.frigate`,to=`${Js}.camera_ui`,no=`${Js}.fullscreen`,io=`${Js}.play`,ao=`${Js}.mute`,ro=`${Js}.media_player`,so=`${Js}.timeline`,oo="status_bar",co=`${oo}.position`,lo=`${oo}.style`,uo=`${oo}.popup_seconds`,ho=`${oo}.height`,po=`${oo}.items`,go="dimensions",mo=`${go}.aspect_ratio`,fo=`${go}.aspect_ratio_mode`,_o=`${go}.height`,yo="overrides",vo="performance",bo=`${vo}.features.animated_progress_indicator`,wo=`${vo}.features.media_chunk_size`,xo=`${vo}.features.max_simultaneous_engine_requests`,Co=`${vo}.profile`,Mo=`${vo}.style.box_shadow`,So=`${vo}.style.border_radius`,ko="profiles",Eo=1e3;class $o extends Error{constructor(e,t){super(e),this.context=t}}const Ao={info:10,error:20,connection:30,diagnostics:40},Io=["clips","favorite-events","favorite-recordings","live","menu","ptz","recordings","seek","snapshots","substream"],zo=bi.object({url:bi.string(),mime_type:bi.string()}),To=bi.object({path:bi.string()});function jo(e){if(e instanceof bi.ZodDefault)return jo(e.removeDefault());if(e instanceof bi.ZodObject){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=bi.ZodOptional.create(jo(i))}return new bi.ZodObject({...e._def,shape:()=>t})}return e instanceof bi.ZodArray?bi.ZodArray.create(jo(e.element)).min(e._def.minLength?.value,e._def.minLength?.message).max(e._def.maxLength?.value,e._def.maxLength?.message).length(e._def.exactLength?.value,e._def.exactLength?.message):e instanceof bi.ZodOptional?bi.ZodOptional.create(jo(e.unwrap())):e instanceof bi.ZodNullable?bi.ZodNullable.create(jo(e.unwrap())):e instanceof bi.ZodTuple?bi.ZodTuple.create(e.items.map((e=>jo(e)))):e}function Oo(e){const t=e.format();return Object.keys(t).filter((e=>!e.startsWith("_")))}const Do=e=>{const t=new Set;if(e.issues.length)for(const n of e.issues)if("invalid_union"===n.code){const e=n.unionErrors;for(const n of e)Do(n).forEach(t.add,t)}else t.add(Ro(n.path));return t},Ro=e=>{let t="";for(let n=0;n"fire-dom-event")).or(bi.literal("fire-dom-event")),card_id:bi.string().regex(Jo,"card_id parameter can only contain [a-z][A-Z][0-9_]-").optional()}),mc=gc.extend({frigate_card_action:bi.enum(Uo)}),fc=gc.extend({frigate_card_action:bi.enum(["camera_ui","default","download","expand","fullscreen","live_substream_off","live_substream_on","menu_toggle","microphone_connect","microphone_disconnect","microphone_mute","microphone_unmute","mute","pause","play","screenshot","unmute"])}),_c=gc.extend({frigate_card_action:bi.literal("camera_select"),camera:bi.string().optional(),triggered:bi.boolean().optional()}),yc=gc.extend({frigate_card_action:bi.literal("live_substream_select"),camera:bi.string()}),vc=gc.extend({frigate_card_action:bi.literal("media_player"),media_player:bi.string(),media_player_action:bi.enum(["play","stop"])}),bc=gc.extend({frigate_card_action:bi.literal("display_mode_select"),display_mode:nc}),wc=gc.extend({frigate_card_action:bi.literal("ptz"),camera:bi.string().optional(),ptz_action:bi.enum(Fo).optional(),ptz_phase:bi.enum(Ko).optional(),ptz_preset:bi.string().optional()}),xc=gc.extend({frigate_card_action:bi.literal("ptz_digital"),target_id:bi.string().optional(),absolute:bi.object({zoom:tc.optional(),pan:ec.optional()}).optional(),ptz_action:bi.enum(Fo).optional(),ptz_phase:bi.enum(Ko).optional()}),Cc=gc.extend({frigate_card_action:bi.literal("ptz_multi"),target_id:bi.string().optional(),ptz_action:bi.enum(Fo).optional(),ptz_phase:bi.enum(Ko).optional(),ptz_preset:bi.string().optional()}),Mc=gc.extend({frigate_card_action:bi.literal("ptz_controls"),enabled:bi.boolean()}),Sc=bi.object({ms:bi.number().optional(),s:bi.number().optional(),m:bi.number().optional(),h:bi.number().optional()}),kc=gc.extend({frigate_card_action:bi.literal("sleep"),duration:Sc.optional().default({s:1})}),Ec=gc.extend({frigate_card_action:bi.literal("status_bar"),status_bar_action:bi.enum(["add","remove","reset"]),items:bi.lazy((()=>al)).array().optional()}),$c=gc.extend({frigate_card_action:bi.literal("log"),message:bi.string(),level:bi.enum(["debug","info","warn","error"]).default("info")}),Ac=bi.union([_c,fc,yc,$c,vc,wc,xc,Cc,Mc,mc,bc,kc,Ec]),Ic=bi.union([rc,cc,oc,lc,dc,uc,pc,hc,Ac]),zc=bi.object({tap_action:Ic.or(Ic.array()).optional(),hold_action:Ic.or(Ic.array()).optional(),double_tap_action:Ic.or(Ic.array()).optional(),start_tap_action:Ic.or(Ic.array()).optional(),end_tap_action:Ic.or(Ic.array()).optional()}).passthrough(),Tc=bi.object({actions:zc.optional()}),jc=zc.extend({style:bi.record(bi.string().nullable().or(bi.undefined()).or(bi.number())).optional(),title:bi.string().nullable().optional()}),Oc=jc.extend({type:bi.literal("state-badge"),entity:bi.string()}),Dc=jc.extend({type:bi.literal("state-icon"),entity:bi.string(),icon:bi.string().optional(),state_color:bi.boolean().default(!0)}),Rc=jc.extend({type:bi.literal("state-label"),entity:bi.string(),attribute:bi.string().optional(),prefix:bi.string().optional(),suffix:bi.string().optional()}),Pc=jc.extend({type:bi.literal("service-button"),title:bi.string(),service:bi.string(),service_data:bi.object({}).passthrough().optional()}),Lc=jc.extend({type:bi.literal("icon"),icon:bi.string(),entity:bi.string().optional()}),Nc=jc.extend({type:bi.literal("image"),entity:bi.string().optional(),image:bi.string().optional(),camera_image:bi.string().optional(),camera_view:bi.string().optional(),state_image:bi.object({}).passthrough().optional(),filter:bi.string().optional(),state_filter:bi.object({}).passthrough().optional(),aspect_ratio:bi.string().optional()}),Fc=bi.object({condition:bi.literal("state").optional(),entity:bi.string(),state:bi.string().or(bi.string().array()).optional(),state_not:bi.string().or(bi.string().array()).optional()}),Vc=bi.object({condition:bi.literal("numeric_state"),entity:bi.string(),above:bi.number().optional(),below:bi.number().optional()}),Hc=bi.object({condition:bi.literal("screen"),media_query:bi.string()}),Bc=bi.object({condition:bi.literal("user"),users:bi.string().array().min(1)}),qc=bi.discriminatedUnion("condition",[Fc,Vc,Hc,Bc]),Uc=bi.object({type:bi.literal("conditional"),conditions:qc.array(),elements:bi.lazy((()=>_l))}),Wc=bi.object({type:bi.string().superRefine(((e,t)=>{e.match(/^custom:(?!frigate-card).+/)||t.addIssue({code:bi.ZodIssueCode.custom,message:"Frigate-card custom elements must match specific schemas",fatal:!0})}))}).passthrough(),Zc=bi.object({enabled:bi.boolean().default(!0).optional(),priority:bi.number().min(0).max(Bo).default(50).optional(),alignment:bi.enum(["matching","opposing"]).default("matching").optional(),icon:bi.string().optional(),permanent:bi.boolean().default(!1).optional()}),Qc=Zc.merge(Lc).extend({type:bi.literal("custom:frigate-card-menu-icon")}),Gc=Zc.merge(Dc).extend({type:bi.literal("custom:frigate-card-menu-state-icon")}).merge(Zc),Yc=jc.extend({entity:bi.string().optional(),icon:bi.string().optional(),state_color:bi.boolean().default(!0),selected:bi.boolean().default(!1),subtitle:bi.string().optional(),enabled:bi.boolean().default(!0)}),Kc=Zc.merge(Lc).extend({type:bi.literal("custom:frigate-card-menu-submenu"),items:Yc.array()}),Xc=Zc.merge(Dc).extend({type:bi.literal("custom:frigate-card-menu-submenu-select"),options:bi.record(Yc.deepPartial()).optional()}),Jc=bi.object({enabled:bi.boolean().default(!0).optional(),priority:bi.number().min(0).max(100).default(50).optional()}),el=Jc.extend({sufficient:bi.boolean().default(!1).optional(),exclusive:bi.boolean().default(!1).optional(),expand:bi.boolean().default(!1).optional(),actions:zc.optional()}),tl=el.extend({type:bi.literal("custom:frigate-card-status-bar-icon"),icon:bi.string()}),nl=el.extend({type:bi.literal("custom:frigate-card-status-bar-image"),image:bi.string()}),il=el.extend({type:bi.literal("custom:frigate-card-status-bar-string"),string:bi.string()}),al=bi.union([tl,nl,il]),rl=bi.object({condition:bi.literal("view"),views:bi.string().array()}),sl=bi.object({condition:bi.literal("fullscreen"),fullscreen:bi.boolean()}),ol=bi.object({condition:bi.literal("expand"),expand:bi.boolean()}),cl=bi.object({condition:bi.literal("camera"),cameras:bi.string().array()}),ll=bi.object({condition:bi.literal("media_loaded"),media_loaded:bi.boolean()}),dl=bi.object({condition:bi.literal("display_mode"),display_mode:nc}),ul=bi.object({condition:bi.literal("triggered"),triggered:bi.string().array()}),hl=bi.object({condition:bi.literal("interaction"),interaction:bi.boolean()}),pl=bi.object({condition:bi.literal("microphone"),connected:bi.boolean().optional(),muted:bi.boolean().optional()}),gl=bi.object({condition:bi.literal("key"),key:bi.string(),state:bi.enum(["down","up"]).optional(),ctrl:bi.boolean().optional(),shift:bi.boolean().optional(),alt:bi.boolean().optional(),meta:bi.boolean().optional()}),ml=bi.discriminatedUnion("condition",[Fc,Vc,Hc,Bc,rl,sl,ol,cl,ll,dl,ul,hl,pl,gl]),fl=bi.object({type:bi.literal("custom:frigate-card-conditional"),conditions:ml.array(),elements:bi.lazy((()=>_l))}),_l=bi.union([Uc,Wc,fl,Lc,Nc,Qc,Gc,Kc,Xc,Pc,Oc,Dc,Rc,tl,nl,il]).array().optional(),yl=bi.object({fit:bi.enum(["contain","cover","fill"]).optional(),position:bi.object({x:bi.number().min(0).max(100).optional(),y:bi.number().min(0).max(100).optional()}).optional(),view_box:bi.object({bottom:bi.number().min(0).max(100).optional().default(0),left:bi.number().min(0).max(100).optional().default(0),right:bi.number().min(0).max(100).optional().default(0),top:bi.number().min(0).max(100).optional().default(0)}).optional(),pan:ec.optional(),zoom:tc.optional()}),vl=bi.number().array().length(2).or(bi.string().regex(/^\s*\d+\.?\d*\s*[:/]\s*\d+\.?\d*\s*$/).transform((e=>e.split(/[:\/]/).map((e=>Number(e)))))),bl={r2c_delay_between_calls_seconds:.5,c2r_delay_between_calls_seconds:.2},wl=function(e){return t=>{if(!t||"object"!=typeof t||!t.service)return t;const n={...t};return Object.keys(t).forEach((i=>{const a=i.match(/^data_(.+)$/),r=a?.[1];r&&!(`${e}${r}`in t)&&(n[`${e}${r}`]={action:"perform-action",perform_action:t.service,data:t[i]},delete n[i],delete n.service)})),n}},xl=bi.preprocess(wl("actions_"),bi.object({actions_left:oc.optional(),actions_left_start:oc.optional(),actions_left_stop:oc.optional(),actions_right:oc.optional(),actions_right_start:oc.optional(),actions_right_stop:oc.optional(),actions_up:oc.optional(),actions_up_start:oc.optional(),actions_up_stop:oc.optional(),actions_down:oc.optional(),actions_down_start:oc.optional(),actions_down_stop:oc.optional(),actions_zoom_in:oc.optional(),actions_zoom_in_start:oc.optional(),actions_zoom_in_stop:oc.optional(),actions_zoom_out:oc.optional(),actions_zoom_out_start:oc.optional(),actions_zoom_out_stop:oc.optional(),r2c_delay_between_calls_seconds:bi.number().default(bl.r2c_delay_between_calls_seconds),c2r_delay_between_calls_seconds:bi.number().default(bl.c2r_delay_between_calls_seconds),presets:bi.preprocess(wl(""),bi.union([bi.record(oc),bi.object({service:bi.string().optional()})])).optional(),service:bi.string().optional()}).passthrough()),Cl={orientation:"horizontal",mode:"auto",hide_pan_tilt:!1,hide_zoom:!1,hide_home:!1,position:"bottom-right"},Ml=bi.object({mode:bi.enum(["off","auto","on"]).default(Cl.mode),position:bi.enum(["top-left","top-right","bottom-left","bottom-right"]).default(Cl.position),orientation:bi.enum(["vertical","horizontal"]).default(Cl.orientation),hide_pan_tilt:bi.boolean().default(Cl.hide_pan_tilt),hide_zoom:bi.boolean().default(Cl.hide_zoom),hide_home:bi.boolean().default(Cl.hide_home),style:bi.object({}).passthrough().optional()}),Sl={mode:"auto",refresh_seconds:1},kl=bi.object({mode:bi.enum(["auto","camera","entity","screensaver","url"]).default(Sl.mode),refresh_seconds:bi.number().min(0).default(Sl.refresh_seconds),url:bi.string().optional(),entity:bi.string().optional(),entity_parameters:bi.string().optional()}),El=kl.merge(Tc).default(Sl),$l=75,Al=300,Il={size:100,show_details:!0,show_favorite_control:!0,show_timeline_control:!0,show_download_control:!0},zl=bi.object({size:bi.number().min(75).max(300).default(Il.size),show_details:bi.boolean().default(Il.show_details),show_favorite_control:bi.boolean().default(Il.show_favorite_control),show_timeline_control:bi.boolean().default(Il.show_timeline_control),show_download_control:bi.boolean().default(Il.show_download_control)}),Tl={...Il,mode:"right"},jl=zl.extend({mode:bi.enum(["none","above","below","left","right"]).default(Tl.mode)}),Ol=bi.enum(["all","clips","snapshots"]),Dl={clustering_threshold:3,events_media_type:"all",window_seconds:3600,show_recordings:!0,style:"stack",pan_mode:"pan"},Rl=bi.enum(["pan","seek","seek-in-media","seek-in-camera"]),Pl=bi.object({clustering_threshold:bi.number().optional().default(Dl.clustering_threshold),events_media_type:Ol.optional().default(Dl.events_media_type),window_seconds:bi.number().min(60).max(86400).optional().default(Dl.window_seconds),show_recordings:bi.boolean().optional().default(Dl.show_recordings),style:bi.enum(["stack","ribbon"]).optional().default(Dl.style),pan_mode:Rl.optional().default(Dl.pan_mode)}),Ll={...Dl,mode:"none",style:"ribbon"},Nl=Pl.extend({mode:bi.enum(["none","above","below"]).default(Ll.mode),style:Pl.shape.style.default(Ll.style)}),Fl={...Dl,controls:{thumbnails:Tl}},Vl=Pl.extend({controls:bi.object({thumbnails:jl.default(Fl.controls.thumbnails)}).default(Fl.controls)}).default(Fl),Hl=bi.object({style:bi.enum(["none","chevrons","icons","thumbnails"]),size:bi.number().min(20)}),Bl=bi.enum(["none","slide"]),ql={always_connected:!1,disconnect_seconds:90,mute_after_microphone_mute_seconds:60},Ul=bi.object({always_connected:bi.boolean().default(ql.always_connected),disconnect_seconds:bi.number().min(0).default(ql.disconnect_seconds),mute_after_microphone_mute_seconds:bi.number().min(0).default(ql.mute_after_microphone_mute_seconds)}).default(ql),Wl=bi.object({url:bi.string().transform((e=>e.replace(/\/+$/,""))).optional(),host:bi.string().optional(),modes:bi.enum(["webrtc","mse","mp4","mjpeg"]).array().optional(),stream:bi.string().optional()}),Zl=bi.object({entity:bi.string().optional(),url:bi.string().optional()}).passthrough(),Ql=bi.object({options:bi.object({audio:bi.boolean().optional(),video:bi.boolean().optional(),pauseWhenHidden:bi.boolean().optional(),disableGl:bi.boolean().optional(),disableWebAssembly:bi.boolean().optional(),preserveDrawingBuffer:bi.boolean().optional(),progressive:bi.boolean().optional(),throttled:bi.boolean().optional(),chunkSize:bi.number().optional(),maxAudioLag:bi.number().optional(),videoBufferSize:bi.number().optional(),audioBufferSize:bi.number().optional()}).optional()}),Gl={...Tl,media_type:"events",events_media_type:"all"},Yl={auto_play:[...Qo],auto_pause:[],auto_mute:[...Yo],auto_unmute:["microphone"],preload:!1,lazy_load:!0,lazy_unload:[],draggable:!0,zoomable:!0,transition_effect:"slide",show_image_during_load:!0,mode:"single",controls:{builtin:!0,next_previous:{size:48,style:"chevrons"},ptz:Cl,thumbnails:Gl,timeline:Ll},microphone:{...ql}},Kl=jl.extend({media_type:bi.enum(["events","recordings"]).default(Yl.controls.thumbnails.media_type),events_media_type:Ol.default(Yl.controls.thumbnails.events_media_type)}),Xl=bi.object({auto_pause:bi.enum(Zo).array().default(Yl.auto_pause),auto_play:bi.enum(Qo).array().default(Yl.auto_play),auto_mute:bi.enum(Yo).array().default(Yl.auto_mute),auto_unmute:bi.enum(Go).array().default(Yl.auto_unmute),controls:bi.object({builtin:bi.boolean().default(Yl.controls.builtin),next_previous:Hl.extend({style:bi.enum(["none","chevrons","icons"]).default(Yl.controls.next_previous.style),size:Hl.shape.size.default(Yl.controls.next_previous.size)}).default(Yl.controls.next_previous),ptz:Ml.default(Yl.controls.ptz),thumbnails:Kl.default(Yl.controls.thumbnails),timeline:Nl.default(Yl.controls.timeline)}).default(Yl.controls),display:ic,draggable:bi.boolean().default(Yl.draggable),lazy_load:bi.boolean().default(Yl.lazy_load),lazy_unload:bi.enum(Zo).array().default(Yl.lazy_unload),microphone:Ul.default(Yl.microphone),preload:bi.boolean().default(Yl.preload),show_image_during_load:bi.boolean().default(Yl.show_image_during_load),transition_effect:Bl.default(Yl.transition_effect),zoomable:bi.boolean().default(Yl.zoomable)}).merge(Tc).default(Yl),Jl=bi.object({live:Xl}),ed=bi.object({method:bi.enum(["standard","dashboard"]).default("standard").optional(),dashboard:bi.object({dashboard_path:bi.string().optional(),view_path:bi.string().optional()}).optional()}),td={dependencies:{all_cameras:!1,cameras:[]},engine:"auto",frigate:{client_id:"frigate"},live_provider:"auto",motioneye:{images:{directory_pattern:"%Y-%m-%d",file_pattern:"%H-%M-%S"},movies:{directory_pattern:"%Y-%m-%d",file_pattern:"%H-%M-%S"}},reolink:{media_resolution:"low"},ptz:bl,triggers:{motion:!1,occupancy:!1,events:[...Xo],entities:[]},proxy:{media:"auto",dynamic:!0,ssl_verification:"auto",ssl_ciphers:"auto"},always_error_if_entity_unavailable:!1},nd=bi.object({media:bi.boolean().or(bi.literal("auto")).default(td.proxy.media),dynamic:bi.boolean().default(td.proxy.dynamic),ssl_verification:bi.boolean().or(bi.literal("auto")).default(td.proxy.ssl_verification),ssl_ciphers:bi.enum(["default","insecure","intermediate","modern"]).or(bi.literal("auto")).default(td.proxy.ssl_ciphers)}),id=bi.object({camera_entity:bi.string().optional(),icon:bi.string().optional(),title:bi.string().optional(),capabilities:bi.object({disable:bi.enum(Io).array().optional(),disable_except:bi.enum(Io).array().optional()}).optional(),id:bi.string().optional(),dependencies:bi.object({all_cameras:bi.boolean().default(td.dependencies.all_cameras),cameras:bi.string().array().default(td.dependencies.cameras)}).default(td.dependencies),triggers:bi.object({motion:bi.boolean().default(td.triggers.motion),occupancy:bi.boolean().default(td.triggers.occupancy),entities:bi.string().array().default(td.triggers.entities),events:bi.enum(Xo).array().default(td.triggers.events)}).default(td.triggers),engine:bi.enum(["auto","frigate","generic","motioneye","reolink"]).default("auto"),frigate:bi.object({url:bi.string().optional(),client_id:bi.string().default(td.frigate.client_id),camera_name:bi.string().optional(),labels:bi.string().array().optional(),zones:bi.string().array().optional()}).default(td.frigate),motioneye:bi.object({url:bi.string().optional(),images:bi.object({directory_pattern:bi.string().includes("%").default(td.motioneye.images.directory_pattern),file_pattern:bi.string().includes("%").default(td.motioneye.images.file_pattern)}).default(td.motioneye.images),movies:bi.object({directory_pattern:bi.string().includes("%").default(td.motioneye.movies.directory_pattern),file_pattern:bi.string().includes("%").default(td.motioneye.movies.file_pattern)}).default(td.motioneye.movies)}).default(td.motioneye),reolink:bi.object({url:bi.string().optional(),media_resolution:bi.enum(["high","low"]).default(td.reolink.media_resolution)}).default(td.reolink),live_provider:bi.enum(["auto","image","ha","jsmpeg","go2rtc","webrtc-card"]).default(td.live_provider),go2rtc:Wl.optional(),image:kl.optional().default(Sl),jsmpeg:Ql.optional(),webrtc_card:Zl.optional(),cast:ed.optional(),ptz:xl.default(td.ptz),dimensions:bi.object({aspect_ratio:vl.optional(),layout:yl.optional()}).optional(),proxy:nd.default(td.proxy),always_error_if_entity_unavailable:bi.boolean().default(td.always_error_if_entity_unavailable)}).default(td),ad=id.array().min(1),rd={default:Wo,camera_select:"current",interaction_seconds:300,default_reset:{every_seconds:0,after_interaction:!1,entities:[],interaction_mode:"inactive"},default_cycle_camera:!1,dark_mode:"off",triggers:{show_trigger_status:!1,filter_selected_camera:!0,actions:{trigger:"update",untrigger:"none"},untrigger_seconds:0},keyboard_shortcuts:Lo},sd=bi.enum(["all","inactive","active"]).default("inactive"),od=bi.object({actions:bi.object({interaction_mode:sd,trigger:bi.enum(["default","live","media","none","update"]).default(rd.triggers.actions.trigger),untrigger:bi.enum(["default","none"]).default(rd.triggers.actions.untrigger)}).default(rd.triggers.actions),filter_selected_camera:bi.boolean().default(rd.triggers.filter_selected_camera),show_trigger_status:bi.boolean().default(rd.triggers.show_trigger_status),untrigger_seconds:bi.number().default(rd.triggers.untrigger_seconds)}),cd=bi.object({default:bi.enum(Uo).default(rd.default),camera_select:bi.enum([...Uo,"current"]).default(rd.camera_select),interaction_seconds:bi.number().default(rd.interaction_seconds),default_cycle_camera:bi.boolean().default(rd.default_cycle_camera),default_reset:bi.object({after_interaction:bi.boolean().default(rd.default_reset.after_interaction),every_seconds:bi.number().default(rd.default_reset.every_seconds),entities:bi.string().array().default(rd.default_reset.entities),interaction_mode:sd.default(rd.default_reset.interaction_mode)}).default(rd.default_reset),render_entities:bi.string().array().optional(),dark_mode:bi.enum(["on","off","auto"]).optional(),triggers:od.default(rd.triggers),keyboard_shortcuts:No.default(rd.keyboard_shortcuts)}).merge(Tc).default(rd),ld=["left","right","top","bottom"],dd=ld,ud={priority:50,enabled:!0},hd={priority:50,enabled:!1},pd={alignment:"left",button_size:40,buttons:{camera_ui:ud,cameras:ud,clips:ud,ptz_home:hd,display_mode:ud,download:ud,expand:hd,frigate:ud,fullscreen:ud,image:hd,live:ud,media_player:ud,microphone:{...hd,type:"momentary"},mute:hd,play:hd,ptz_controls:hd,recordings:hd,screenshot:hd,snapshots:ud,substreams:ud,timeline:ud},position:"top",style:"hidden"},gd=Zc.extend({enabled:Zc.shape.enabled.default(ud.enabled),priority:Zc.shape.priority.default(ud.priority)}),md=Zc.extend({enabled:Zc.shape.enabled.default(hd.enabled),priority:Zc.shape.priority.default(hd.priority)}),fd=bi.object({style:bi.enum(["none","hidden","overlay","hover","hover-card","outside"]).default(pd.style),position:bi.enum(ld).default(pd.position),alignment:bi.enum(dd).default(pd.alignment),buttons:bi.object({camera_ui:gd.default(pd.buttons.camera_ui),cameras:gd.default(pd.buttons.cameras),clips:gd.default(pd.buttons.clips),ptz_home:md.default(pd.buttons.ptz_home),display_mode:gd.default(pd.buttons.display_mode),download:gd.default(pd.buttons.download),expand:md.default(pd.buttons.expand),frigate:gd.default(pd.buttons.frigate),fullscreen:gd.default(pd.buttons.fullscreen),image:md.default(pd.buttons.image),live:gd.default(pd.buttons.live),media_player:gd.default(pd.buttons.media_player),microphone:md.extend({type:bi.enum(["momentary","toggle"]).default(pd.buttons.microphone.type)}).default(pd.buttons.microphone),mute:md.default(pd.buttons.mute),play:md.default(pd.buttons.play),ptz_controls:md.default(pd.buttons.ptz_controls),recordings:md.default(pd.buttons.recordings),screenshot:md.default(pd.buttons.screenshot),snapshots:gd.default(pd.buttons.snapshots),substreams:gd.default(pd.buttons.substreams),timeline:gd.default(pd.buttons.timeline)}).default(pd.buttons),button_size:bi.number().min(20).default(pd.button_size)}).default(pd),_d={priority:50,enabled:!0},yd={height:30,items:{engine:_d,resolution:_d,technology:_d,title:_d},position:"bottom",style:"popup",popup_seconds:3},vd=bi.object({position:bi.enum(["top","bottom"]).default(yd.position),style:bi.enum(["none","overlay","hover","hover-card","outside","popup"]).default(yd.style),popup_seconds:bi.number().min(0).max(60).default(yd.popup_seconds),height:bi.number().min(20).default(yd.height),items:bi.object({engine:Jc.default(yd.items.engine),technology:Jc.default(yd.items.technology),resolution:Jc.default(yd.items.resolution),title:Jc.default(yd.items.title)}).default(yd.items)}).default(yd),bd={auto_play:[...Qo],auto_pause:[...Zo],auto_mute:[...Zo],auto_unmute:[],lazy_load:!0,draggable:!0,zoomable:!0,transition_effect:"slide",snapshot_click_plays_clip:!0,display_mode:"single",controls:{builtin:!0,next_previous:{size:48,style:"thumbnails"},thumbnails:Tl,timeline:Ll,ptz:{...Cl,mode:"off"}}},wd=Hl.extend({style:bi.enum(["none","thumbnails","chevrons"]).default(bd.controls.next_previous.style),size:Hl.shape.size.default(bd.controls.next_previous.size)}),xd=bi.object({auto_play:bi.enum(Qo).array().default(bd.auto_play),auto_pause:bi.enum(Zo).array().default(bd.auto_pause),auto_mute:bi.enum(Zo).array().default(bd.auto_mute),auto_unmute:bi.enum(Qo).array().default(bd.auto_unmute),lazy_load:bi.boolean().default(bd.lazy_load),draggable:bi.boolean().default(bd.draggable),zoomable:bi.boolean().default(bd.zoomable),transition_effect:Bl.default(bd.transition_effect),snapshot_click_plays_clip:bi.boolean().default(bd.snapshot_click_plays_clip),display:ic,controls:bi.object({builtin:bi.boolean().default(bd.controls.builtin),next_previous:wd.default(bd.controls.next_previous),ptz:Ml.extend({mode:bi.enum(["off","on"]).default(bd.controls.ptz.mode)}).default(bd.controls.ptz),thumbnails:jl.default(bd.controls.thumbnails),timeline:Nl.default(bd.controls.timeline)}).default(bd.controls)}).merge(Tc).default(bd),Cd={...Tl,show_details:!1},Md={controls:{thumbnails:Cd,filter:{mode:"right"}}},Sd=jl.extend({show_details:bi.boolean().default(Cd.show_details)}),kd=bi.object({controls:bi.object({thumbnails:Sd.default(Md.controls.thumbnails),filter:bi.object({mode:bi.enum(["none","left","right"]).default(Md.controls.filter.mode)}).default(Md.controls.filter)}).default(Md.controls)}).merge(Tc).default(Md),Ed={aspect_ratio_mode:"dynamic",aspect_ratio:[16,9],height:"auto"},$d=bi.object({aspect_ratio_mode:bi.enum(["dynamic","static","unconstrained"]).default(Ed.aspect_ratio_mode),aspect_ratio:vl.default(Ed.aspect_ratio),height:bi.string().default(Ed.height)}).default(Ed),Ad=bi.object({conditions:ml.array(),merge:bi.object({}).passthrough().optional(),set:bi.object({}).passthrough().optional(),delete:bi.string().array().optional()}).array().optional(),Id=Ic.array(),zd=bi.object({conditions:ml.array(),actions:Id.optional(),actions_not:Id.optional()}).refine((e=>e.actions?.length||e.actions_not?.length),"Automations must include at least one action").array(),Td={features:{animated_progress_indicator:!0,media_chunk_size:50},style:{border_radius:!0,box_shadow:!0}},jd=bi.object({features:bi.object({animated_progress_indicator:bi.boolean().default(Td.features.animated_progress_indicator),media_chunk_size:bi.number().min(0).max(1e3).default(Td.features.media_chunk_size),max_simultaneous_engine_requests:bi.number().min(1).optional()}).default(Td.features),style:bi.object({border_radius:bi.boolean().default(Td.style.border_radius),box_shadow:bi.boolean().default(Td.style.box_shadow)}).default(Td.style)}).default(Td),Od={logging:!1},Dd=bi.object({logging:bi.boolean().default(Od.logging)}).default(Od),Rd=bi.enum(["casting","low-performance","scrubbing"]).array().optional(),Pd=bi.object({cameras:jo(ad),cameras_global:id,view:cd,menu:fd,status_bar:vd,live:Xl,media_gallery:kd,media_viewer:xd,image:El,elements:_l,dimensions:$d,timeline:Vl,performance:jd,debug:Dd,automations:zd.optional(),profiles:Rd,overrides:Ad,card_mod:bi.unknown(),card_id:bi.string().regex(Jo).optional(),type:bi.string()}),Ld={cameras:td,view:rd,menu:pd,status_bar:yd,live:Yl,media_gallery:Md,media_viewer:bd,image:Sl,timeline:Fl,performance:Td,debug:Od};function Nd(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Fd(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Vd(e,t){const n=Nd(e);return isNaN(t)?Fd(e,NaN):t?(n.setDate(n.getDate()+t),n):n}function Hd(e,t){const n=Nd(e);if(isNaN(t))return Fd(e,NaN);if(!t)return n;const i=n.getDate(),a=Fd(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);return i>=a.getDate()?a:(n.setFullYear(a.getFullYear(),a.getMonth(),i),n)}function Bd(e,t){const{years:n=0,months:i=0,weeks:a=0,days:r=0,hours:s=0,minutes:o=0,seconds:c=0}=t,l=Nd(e),d=i||n?Hd(l,i+12*n):l,u=1e3*(c+60*(o+60*s));return Fd(e,(r||a?Vd(d,r+7*a):d).getTime()+u)}const qd=6048e5,Ud=864e5,Wd=6e4,Zd=36e5,Qd=1e3;let Gd={};function Yd(){return Gd}function Kd(e,t){const n=Yd(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Nd(e),r=a.getDay(),s=(r=a.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function eu(e){const t=Nd(e);return t.setHours(0,0,0,0),t}function tu(e){const t=Nd(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function nu(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=Nd(e);return!isNaN(Number(n))}function iu(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return 0===n?0:n}}function au(e,t){return+Nd(e)-+Nd(t)}function ru(e,t,n){const i=au(e,t)/1e3;return iu(n?.roundingMethod)(i)}const su={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ou(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const cu={date:ou({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ou({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ou({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},lu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function du(e){return(t,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):t;i=e.formattingValues[a]||e.formattingValues[t]}else{const t=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function uu(e){return(t,n={})=>{const i=n.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(a);if(!r)return null;const s=r[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?function(e,t){for(let n=0;ne.test(s))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(o,(e=>e.test(s)));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(s.length)}}}var hu;const pu={code:"en-US",formatDistance:(e,t,n)=>{let i;const a=su[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:cu,formatRelative:(e,t,n,i)=>lu[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:du({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:du({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:du({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:du({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:du({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(hu={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(hu.matchPattern);if(!n)return null;const i=n[0],a=e.match(hu.parsePattern);if(!a)return null;let r=hu.valueCallback?hu.valueCallback(a[0]):a[0];return r=t.valueCallback?t.valueCallback(r):r,{value:r,rest:e.slice(i.length)}}),era:uu({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:uu({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:uu({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:uu({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:uu({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function gu(e){const t=Nd(e),n=function(e,t){const n=eu(e),i=eu(t),a=+n-tu(n),r=+i-tu(i);return Math.round((a-r)/Ud)}(t,function(e){const t=Nd(e),n=Fd(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function mu(e){const t=Nd(e),n=+Xd(t)-+function(e){const t=Jd(e),n=Fd(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Xd(n)}(t);return Math.round(n/qd)+1}function fu(e,t){const n=Nd(e),i=n.getFullYear(),a=Yd(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=Fd(e,0);s.setFullYear(i+1,0,r),s.setHours(0,0,0,0);const o=Kd(s,t),c=Fd(e,0);c.setFullYear(i,0,r),c.setHours(0,0,0,0);const l=Kd(c,t);return n.getTime()>=o.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function _u(e,t){const n=Nd(e),i=+Kd(n,t)-+function(e,t){const n=Yd(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=fu(e,t),r=Fd(e,0);return r.setFullYear(a,0,i),r.setHours(0,0,0,0),Kd(r,t)}(n,t);return Math.round(i/qd)+1}function yu(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const vu={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return yu("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):yu(n+1,2)},d:(e,t)=>yu(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>yu(e.getHours()%12||12,t.length),H:(e,t)=>yu(e.getHours(),t.length),m:(e,t)=>yu(e.getMinutes(),t.length),s:(e,t)=>yu(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds();return yu(Math.trunc(i*Math.pow(10,n-3)),t.length)}},bu="midnight",wu="noon",xu="morning",Cu="afternoon",Mu="evening",Su="night",ku={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return vu.y(e,t)},Y:function(e,t,n,i){const a=fu(e,i),r=a>0?a:1-a;if("YY"===t){return yu(r%100,2)}return"Yo"===t?n.ordinalNumber(r,{unit:"year"}):yu(r,t.length)},R:function(e,t){return yu(Jd(e),t.length)},u:function(e,t){return yu(e.getFullYear(),t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return yu(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return yu(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return vu.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return yu(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const a=_u(e,i);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):yu(a,t.length)},I:function(e,t,n){const i=mu(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):yu(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):vu.d(e,t)},D:function(e,t,n){const i=gu(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):yu(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return yu(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return yu(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return yu(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let a;switch(a=12===i?wu:0===i?bu:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let a;switch(a=i>=17?Mu:i>=12?Cu:i>=4?xu:Su,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return vu.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):vu.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):yu(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):yu(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vu.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vu.s(e,t)},S:function(e,t){return vu.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return $u(i);case"XXXX":case"XX":return Au(i);default:return Au(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return $u(i);case"xxxx":case"xx":return Au(i);default:return Au(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Eu(i,":");default:return"GMT"+Au(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Eu(i,":");default:return"GMT"+Au(i,":")}},t:function(e,t,n){return yu(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return yu(e.getTime(),t.length)}};function Eu(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),r=i%60;return 0===r?n+String(a):n+String(a)+t+yu(r,2)}function $u(e,t){if(e%60==0){return(e>0?"-":"+")+yu(Math.abs(e)/60,2)}return Au(e,t)}function Au(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+yu(Math.trunc(i/60),2)+t+yu(i%60,2)}const Iu=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},zu=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Tu={p:zu,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return Iu(e,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",Iu(i,t)).replace("{{time}}",zu(a,t))}},ju=/^D+$/,Ou=/^Y+$/,Du=["D","DD","YY","YYYY"];function Ru(e){return ju.test(e)}function Pu(e){return Ou.test(e)}function Lu(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),Du.includes(e))throw new RangeError(i)}const Nu=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fu=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vu=/^'([^]*?)'?$/,Hu=/''/g,Bu=/[a-zA-Z]/;function qu(e,t,n){const i=Yd(),a=n?.locale??i.locale??pu,r=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=Nd(e);if(!nu(o))throw new RangeError("Invalid time value");let c=t.match(Fu).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,Tu[t])(e,a.formatLong)}return e})).join("").match(Nu).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Uu(e)};if(ku[t])return{isToken:!0,value:e};if(t.match(Bu))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const l={firstWeekContainsDate:r,weekStartsOn:s,locale:a};return c.map((i=>{if(!i.isToken)return i.value;const r=i.value;(!n?.useAdditionalWeekYearTokens&&Pu(r)||!n?.useAdditionalDayOfYearTokens&&Ru(r))&&Lu(r,t,String(e));return(0,ku[r[0]])(o,r,a.localize,l)})).join("")}function Uu(e){const t=e.match(Vu);return t?t[1].replace(Hu,"'"):e}function Wu(e,t){const{years:n=0,months:i=0,weeks:a=0,days:r=0,hours:s=0,minutes:o=0,seconds:c=0}=t,l=function(e,t){return Hd(e,-t)}(e,i+12*n),d=function(e,t){return Vd(e,-t)}(l,r+7*a),u=1e3*(c+60*(o+60*s));return Fd(e,d.getTime()-u)}function Zu(e,t){return e===t||e!=e&&t!=t}function Qu(e,t){for(var n=e.length;n--;)if(Zu(e[n][0],t))return n;return-1}var Gu=Array.prototype.splice;function Yu(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},Yu.prototype.set=function(e,t){var n=this.__data__,i=Qu(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ku="object"==typeof global&&global&&global.Object===Object&&global,Xu="object"==typeof self&&self&&self.Object===Object&&self,Ju=Ku||Xu||Function("return this")(),eh=Ju.Symbol,th=Object.prototype,nh=th.hasOwnProperty,ih=th.toString,ah=eh?eh.toStringTag:void 0;var rh=Object.prototype.toString;var sh="[object Null]",oh="[object Undefined]",ch=eh?eh.toStringTag:void 0;function lh(e){return null==e?void 0===e?oh:sh:ch&&ch in Object(e)?function(e){var t=nh.call(e,ah),n=e[ah];try{e[ah]=void 0;var i=!0}catch(e){}var a=ih.call(e);return i&&(t?e[ah]=n:delete e[ah]),a}(e):function(e){return rh.call(e)}(e)}function dh(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var uh="[object AsyncFunction]",hh="[object Function]",ph="[object GeneratorFunction]",gh="[object Proxy]";function mh(e){if(!dh(e))return!1;var t=lh(e);return t==hh||t==ph||t==uh||t==gh}var fh,_h=Ju["__core-js_shared__"],yh=(fh=/[^.]+$/.exec(_h&&_h.keys&&_h.keys.IE_PROTO||""))?"Symbol(src)_1."+fh:"";var vh=Function.prototype.toString;function bh(e){if(null!=e){try{return vh.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var wh=/^\[object .+?Constructor\]$/,xh=Function.prototype,Ch=Object.prototype,Mh=xh.toString,Sh=Ch.hasOwnProperty,kh=RegExp("^"+Mh.call(Sh).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Eh(e){return!(!dh(e)||(t=e,yh&&yh in t))&&(mh(e)?kh:wh).test(bh(e));var t}function $h(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Eh(n)?n:void 0}var Ah=$h(Ju,"Map"),Ih=$h(Object,"create");var zh=Object.prototype.hasOwnProperty;var Th=Object.prototype.hasOwnProperty;function jh(e){var t=-1,n=null==e?0:e.length;for(this.clear();++to))return!1;var l=r.get(e),d=r.get(t);if(l&&d)return l==t&&d==e;var u=-1,h=!0,p=n&Vh?new Ph:void 0;for(r.set(e,t),r.set(t,e);++u-1&&e%1==0&&e-1&&e%1==0&&e<=Ep}var Ap={};function Ip(e){return function(t){return e(t)}}Ap["[object Float32Array]"]=Ap["[object Float64Array]"]=Ap["[object Int8Array]"]=Ap["[object Int16Array]"]=Ap["[object Int32Array]"]=Ap["[object Uint8Array]"]=Ap["[object Uint8ClampedArray]"]=Ap["[object Uint16Array]"]=Ap["[object Uint32Array]"]=!0,Ap["[object Arguments]"]=Ap["[object Array]"]=Ap["[object ArrayBuffer]"]=Ap["[object Boolean]"]=Ap["[object DataView]"]=Ap["[object Date]"]=Ap["[object Error]"]=Ap["[object Function]"]=Ap["[object Map]"]=Ap["[object Number]"]=Ap["[object Object]"]=Ap["[object RegExp]"]=Ap["[object Set]"]=Ap["[object String]"]=Ap["[object WeakMap]"]=!1;var zp="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tp=zp&&"object"==typeof module&&module&&!module.nodeType&&module,jp=Tp&&Tp.exports===zp&&Ku.process,Op=function(){try{var e=Tp&&Tp.require&&Tp.require("util").types;return e||jp&&jp.binding&&jp.binding("util")}catch(e){}}(),Dp=Op,Rp=Dp&&Dp.isTypedArray,Pp=Rp?Ip(Rp):function(e){return gp(e)&&$p(e.length)&&!!Ap[lh(e)]},Lp=Object.prototype.hasOwnProperty;function Np(e,t){var n=cp(e),i=!n&&vp(e),a=!n&&!i&&Cp(e),r=!n&&!i&&!a&&Pp(e),s=n||i||a||r,o=s?function(e,t){for(var n=-1,i=Array(e);++n0){if(++am>=800)return arguments[0]}else am=0;return im.apply(void 0,arguments)});function om(e,t){return sm(function(e,t,n){return t=Jg(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,r=Jg(i.length-t,0),s=Array(r);++a1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(a--,r):void 0,s&&cm(n[0],n[1],s)&&(r=a<3?void 0:r,a=1),t=Object(t);++i-1}function Pm(e,t,n){for(var i=-1,a=null==e?0:e.length;++i=Nm){var l=t?null:Lm(e);if(l)return Uh(l);s=!1,a=Nh,c=new Ph}else c=t?[]:o;e:for(;++ie[0].toUpperCase()+e.substring(1))).join(" ")}function Bm(e,t,n){const i=e[t];return e.splice(t,1),e.splice(n,0,i),e}const qm=e=>Array.isArray(e)?e:[e],Um=e=>e instanceof Set?e:new Set(qm(e));function Wm(e,t,n){return!function(e,t,n){var i=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===i?yg(e,t,void 0,n):!!i}(e,t,n)}function Zm(e,t=console.warn){e instanceof $o&&e.context?t(e,e.context):t("object"==typeof e&&"message"in e?e.message:e)}const Qm=()=>window.matchMedia("(hover: hover) and (pointer: fine)").matches,Gm=(e,t)=>qu(e,"yyyy-MM-dd HH:mm"+(t?":ss":"")),Ym=e=>qu(e,"yyyy-MM-dd"),Km=(e,t)=>{window.requestIdleCallback?window.requestIdleCallback(e,{...t&&{timeout:t}}):e()};function Xm(e,t){const n=function(e,t,n){const i=au(e,t)/Zd;return iu(n?.roundingMethod)(i)}(t,e),i=function(e,t,n){const i=au(e,t)/Wd;return iu(n?.roundingMethod)(i)}(t,e)-60*n;let a="";return n&&(a+=`${n}h `),i&&(a+=`${i}m `),a+=`${ru(t,e)-60*n*60-60*i}s`,a}const Jm=async(e,t)=>await Promise.all(Array.from(e).map((e=>t(e)))),ef=e=>new Date(`${e}T00:00:00`),tf=async e=>{await new Promise((t=>setTimeout(t,1e3*e)))},nf=e=>!isNaN(e.getTime()),af=(e,t,n,i)=>{t?e.setAttribute(n,i??""):e.removeAttribute(n)},rf=e=>!!e,sf=e=>e instanceof HTMLElement,of=e=>(e instanceof HTMLSlotElement?e.assignedElements({flatten:!0}):[...e.children]).filter(sf),cf=e=>e?.ratio&&2===e.ratio.length?`${e.ratio[0]} / ${e.ratio[1]}`:e?.defaultStatic?"16 / 9":"auto",lf=e=>({"aspect-ratio":cf(e)}),df=e=>{if(Array.isArray(e))return e.filter((e=>void 0!==e)).map((e=>df(e)));if("object"==typeof e&&null!==e){const t={};for(const n in e)t[n]=df(e[n]);return t}return e},uf=(e,t,n)=>Om(e,n)===Om(t,n);function hf(e){if(!e)return null;const t=Ac.safeParse(e);return t.success?t.data:null}function pf(e,t){return{action:"fire-dom-event",frigate_card_action:e,...t?.cardID&&{card_id:t.cardID}}}function gf(e,t,n){return{action:"fire-dom-event",frigate_card_action:e,camera:t,...n?.cardID&&{card_id:n.cardID}}}function mf(e,t,n){return{action:"fire-dom-event",frigate_card_action:"media_player",media_player:e,media_player_action:t,...n?.cardID&&{card_id:n.cardID}}}function ff(e){return{action:"fire-dom-event",frigate_card_action:"ptz_multi",...e?.cardID&&{card_id:e.cardID},...e?.ptzAction&&{ptz_action:e.ptzAction},...e?.ptzPhase&&{ptz_phase:e.ptzPhase},...e?.ptzPreset&&{ptz_preset:e.ptzPreset},...e?.targetID&&{target_id:e.targetID}}}function _f(e,t){return e&&t?"tap"===e&&t.tap_action?t.tap_action:"hold"===e&&t.hold_action?t.hold_action:"double_tap"===e&&t.double_tap_action?t.double_tap_action:"end_tap"===e&&t.end_tap_action?t.end_tap_action:"start_tap"===e&&t.start_tap_action?t.start_tap_action:null:null}const yf=e=>qm(e).some((e=>function(e){return void 0!==e&&"none"!==e.action}(e))),vf=e=>{e.stopPropagation()};class bf{constructor(){this._timer=null,this._repeated=!1}stop(){this._timer&&(this._repeated?window.clearInterval(this._timer):window.clearTimeout(this._timer),this._timer=null)}isRunning(){return null!==this._timer}start(e,t){this.stop(),this._timer=window.setTimeout((()=>{this._timer=null,t()}),1e3*e),this._repeated=!1}startRepeated(e,t){this.stop(),this._timer=window.setInterval((()=>{t()}),1e3*e),this._repeated=!0}}class wf extends HTMLElement{constructor(){super(...arguments),this.holdTime=.4,this.holdTimer=new bf,this.doubleClickTimer=new bf,this.held=!1,this.started=!1}connectedCallback(){["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((e=>{document.addEventListener(e,(()=>{this.holdTimer.stop()}),{passive:!0})}))}bind(e,t){if(e.actionHandlerOptions)return void(e.actionHandlerOptions=t);e.actionHandlerOptions=t,e.addEventListener("contextmenu",(e=>{const t=e||window.event;return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0,t.returnValue=!1,!1}));const n=()=>{this.held=!1,this.holdTimer.start(this.holdTime,(()=>{this.held=!0})),this.started||(this.started=!0,et(e,"action",{action:"start_tap"}))},i=t=>{this.holdTimer.stop(),this.started&&(this.started=!1,et(e,"action",{action:"end_tap"}))},a=t=>{const n=e.actionHandlerOptions;n?.allowPropagation||vf(t),["touchend","touchcancel"].includes(t.type)&&!this.held||(i(),n?.hasHold&&this.held?et(e,"action",{action:"hold"}):n?.hasDoubleClick?"click"===t.type&&t.detail<2||!this.doubleClickTimer.isRunning()?this.doubleClickTimer.start(.25,(()=>et(e,"action",{action:"tap"}))):(this.doubleClickTimer.stop(),et(e,"action",{action:"double_tap"})):et(e,"action",{action:"tap"}))};e.addEventListener("touchstart",n,{passive:!0}),e.addEventListener("touchend",a),e.addEventListener("touchcancel",a),e.addEventListener("mousedown",n,{passive:!0}),e.addEventListener("click",a),e.addEventListener("keyup",(e=>{"Enter"===e.key&&a(e)})),e.addEventListener("mouseleave",i)}}customElements.define("action-handler-frigate-card",wf);const xf=(e,t)=>{const n=(()=>{const e=document.body;if(e.querySelector("action-handler-frigate-card"))return e.querySelector("action-handler-frigate-card");const t=document.createElement("action-handler-frigate-card");return e.appendChild(t),t})();n&&n.bind(e,t)},Cf=me(class extends fe{update(e,[t]){return xf(e.element,t),U}render(e){}});var Mf=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)op(t,pp(e)),e=Dg(e);return t}:dp;function Sf(e){return lp(e,Gg,Mf)}var kf=Object.prototype.hasOwnProperty;var Ef=/\w*$/;var $f=eh?eh.prototype:void 0,Af=$f?$f.valueOf:void 0;var If="[object Boolean]",zf="[object Date]",Tf="[object Map]",jf="[object Number]",Of="[object RegExp]",Df="[object Set]",Rf="[object String]",Pf="[object Symbol]",Lf="[object ArrayBuffer]",Nf="[object DataView]",Ff="[object Float32Array]",Vf="[object Float64Array]",Hf="[object Int8Array]",Bf="[object Int16Array]",qf="[object Int32Array]",Uf="[object Uint8Array]",Wf="[object Uint8ClampedArray]",Zf="[object Uint16Array]",Qf="[object Uint32Array]";function Gf(e,t,n){var i,a,r,s=e.constructor;switch(t){case Lf:return Ig(e);case If:case zf:return new s(+e);case Nf:return function(e,t){var n=t?Ig(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case Ff:case Vf:case Hf:case Bf:case qf:case Uf:case Wf:case Zf:case Qf:return zg(e,n);case Tf:return new s;case jf:case Rf:return new s(e);case Of:return(r=new(a=e).constructor(a.source,Ef.exec(a))).lastIndex=a.lastIndex,r;case Df:return new s;case Pf:return i=e,Af?Object(Af.call(i)):{}}}var Yf=Dp&&Dp.isMap,Kf=Yf?Ip(Yf):function(e){return gp(e)&&"[object Map]"==ug(e)};var Xf=Dp&&Dp.isSet,Jf=Xf?Ip(Xf):function(e){return gp(e)&&"[object Set]"==ug(e)},e_=1,t_=2,n_=4,i_="[object Arguments]",a_="[object Function]",r_="[object GeneratorFunction]",s_="[object Object]",o_={};function c_(e,t,n,i,a,r){var s,o=t&e_,c=t&t_,l=t&n_;if(n&&(s=a?n(e,i,a,r):n(e)),void 0!==s)return s;if(!dh(e))return e;var d=cp(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&kf.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!o)return Tg(e,s)}else{var u=ug(e),h=u==a_||u==r_;if(Cp(e))return Ag(e,o);if(u==s_||u==i_||h&&!a){if(s=c||h?{}:Rg(e),!o)return c?function(e,t){return Wg(e,Mf(e),t)}(e,function(e,t){return e&&Wg(t,Gg(t),e)}(s,e)):function(e,t){return Wg(e,pp(e),t)}(e,function(e,t){return e&&Wg(t,Wp(t),e)}(s,e))}else{if(!o_[u])return a?e:{};s=Gf(e,u,o)}}r||(r=new Rh);var p=r.get(e);if(p)return p;r.set(e,s),Jf(e)?e.forEach((function(i){s.add(c_(i,t,n,i,e,r))})):Kf(e)&&e.forEach((function(i,a){s.set(a,c_(i,t,n,a,e,r))}));var g=d?void 0:(l?c?Sf:Zp:c?Gg:Wp)(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++nvoid 0===globalThis.DOMException?new m_(e):new DOMException(e),__=e=>{const t=void 0===e.reason?f_("This operation was aborted."):e.reason;return t instanceof Error?t:f_(t)};class y_{#e=[];enqueue(e,t){const n={priority:(t={priority:0,...t}).priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority)return void this.#e.push(n);const i=function(e,t,n){let i=0,a=e.length;for(;a>0;){const r=Math.trunc(a/2);let s=i+r;n(e[s],t)<=0?(i=++s,a-=r+1):a=r}return i}(this.#e,n,((e,t)=>t.priority-e.priority));this.#e.splice(i,0,n)}dequeue(){const e=this.#e.shift();return e?.run}filter(e){return this.#e.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this.#e.length}}class v_ extends p_{#t;#n;#i=0;#a;#r;#s=0;#o;#c;#e;#l;#d=0;#u;#h;#p;timeout;constructor(e){if(super(),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:y_,...e}).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#t=e.carryoverConcurrencyCount,this.#n=e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,this.#a=e.intervalCap,this.#r=e.interval,this.#e=new e.queueClass,this.#l=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#p=!0===e.throwOnTimeout,this.#h=!1===e.autoStart}get#g(){return this.#n||this.#i{this.#y()}),t)),!0;this.#i=this.#t?this.#d:0}return!1}#_(){if(0===this.#e.size)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit("empty"),0===this.#d&&this.emit("idle"),!1;if(!this.#h){const e=!this.#w;if(this.#g&&this.#m){const t=this.#e.dequeue();return!!t&&(this.emit("active"),t(),e&&this.#b(),!0)}}return!1}#b(){this.#n||void 0!==this.#o||(this.#o=setInterval((()=>{this.#v()}),this.#r),this.#s=Date.now()+this.#r)}#v(){0===this.#i&&0===this.#d&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#i=this.#t?this.#d:0,this.#x()}#x(){for(;this.#_(););}get concurrency(){return this.#u}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#u=e,this.#x()}async#C(e){return new Promise(((t,n)=>{e.addEventListener("abort",(()=>{n(e.reason)}),{once:!0})}))}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#p,...t},new Promise(((n,i)=>{this.#e.enqueue((async()=>{this.#d++,this.#i++;try{t.signal?.throwIfAborted();let i=e({signal:t.signal});t.timeout&&(i=function(e,t){const{milliseconds:n,fallback:i,message:a,customTimers:r={setTimeout:setTimeout,clearTimeout:clearTimeout}}=t;let s;const o=new Promise(((o,c)=>{if("number"!=typeof n||1!==Math.sign(n))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(t.signal){const{signal:e}=t;e.aborted&&c(__(e)),e.addEventListener("abort",(()=>{c(__(e))}))}if(n===Number.POSITIVE_INFINITY)return void e.then(o,c);const l=new g_;s=r.setTimeout.call(void 0,(()=>{if(i)try{o(i())}catch(e){c(e)}else"function"==typeof e.cancel&&e.cancel(),!1===a?o():a instanceof Error?c(a):(l.message=a??`Promise timed out after ${n} milliseconds`,c(l))}),n),(async()=>{try{o(await e)}catch(e){c(e)}})()})),c=o.finally((()=>{c.clear()}));return c.clear=()=>{r.clearTimeout.call(void 0,s),s=void 0},c}(Promise.resolve(i),{milliseconds:t.timeout})),t.signal&&(i=Promise.race([i,this.#C(t.signal)]));const a=await i;n(a),this.emit("completed",a)}catch(e){if(e instanceof g_&&!t.throwOnTimeout)return void n();i(e),this.emit("error",e)}finally{this.#f()}}),t),this.emit("add"),this.#_()}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return this.#h?(this.#h=!1,this.#x(),this):this}pause(){this.#h=!0}clear(){this.#e=new this.#l}async onEmpty(){0!==this.#e.size&&await this.#M("empty")}async onSizeLessThan(e){this.#e.sizethis.#e.size{const i=()=>{t&&!t()||(this.off(e,i),n())};this.on(e,i)}))}get size(){return this.#e.size}sizeBy(e){return this.#e.filter(e).length}get pending(){return this.#d}get isPaused(){return this.#h}}var b_={frigate_card:"Frigate card",frigate_card_description:"A Lovelace card for use with Frigate",live:"Live",no_media:"No media to display",recordings:"Recordings",version:"Version"},w_={cameras:{camera_entity:"Camera Entity",capabilities:{capabilities:{clips:"Clips","favorite-events":"Favorite Events","favorite-recordings":"Favorite Recordings",live:"Live",menu:"Menu",ptz:"PTZ",recordings:"Recordings",seek:"Seeking",snapshots:"Snapshots",substream:"Substream"},disable:"Disable",disable_except:"Disable except",editor_label:"Camera capabilities"},cast:{dashboard:{dashboard_path:"Dashboard path",view_path:"View path"},editor_label:"Cast options",method:"Cast method",methods:{dashboard:"Dashboard",standard:"Standard"}},dependencies:{all_cameras:"Show events for all cameras with this camera",cameras:"Show events for specific cameras with this camera",editor_label:"Dependency options"},dimensions:{aspect_ratio:"Static aspect ratio",editor_label:"Camera dimensions",layout:{editor_label:"Camera Layout",fit:"Layout fit",fits:{contain:"Media is contained/letterboxed",cover:"Media expands proportionally to cover the card",fill:"Media is stretched to fill the card"},pan:{x:"Pan horizontal percentage",y:"Pan vertical percentage"},position:{editor_label:"Layout Cover Position",x:"Horizontal placement percentage",y:"Vertical placement percentage"},view_box:{bottom:"Bottom inset percentage",editor_label:"Layout View Box",left:"Left inset percentage",right:"Right inset percentage",top:"Top inset percentage"},zoom:"Zoom factor"}},engines:{editor_label:"Camera engine options"},frigate:{camera_name:"Frigate camera name (Autodetected from entity)",client_id:"Frigate client id (For >1 Frigate server)",editor_label:"Frigate options",labels:"Frigate labels/object filters",url:"Frigate server URL",zones:"Frigate zones"},go2rtc:{editor_label:"go2rtc Options",modes:{editor_label:"go2rtc Modes",mjpeg:"Motion JPEG (MJPEG)",mp4:"MPEG-4 (MP4)",mse:"Media Source Extensions (MSE)",webrtc:"Web Real-Time Communication (WebRTC)"},stream:"go2rtc stream name"},icon:"Icon for this camera (Autodetected from entity)",id:"Unique id for this camera in this card",image:{editor_label:"Image Options",refresh_seconds:"Number of seconds after which to refresh live image (0=never)",url:"Image URL to use instead of camera entity snapshot"},live_provider:"Live view provider for this camera",live_provider_options:{editor_label:"Live provider options"},live_providers:{auto:"Automatic",go2rtc:"go2rtc",ha:"Home Assistant video stream (i.e. HLS, LL-HLS, WebRTC via HA)",image:"Home Assistant images",jsmpeg:"JSMpeg","webrtc-card":"WebRTC Card (i.e. AlexxIT's WebRTC Card)"},motioneye:{editor_label:"MotionEye options",images:{directory_pattern:"Images directory pattern",file_pattern:"Images file pattern"},movies:{directory_pattern:"Movies directory pattern",file_pattern:"Movies file pattern"},url:"MotionEye UI URL"},proxy:{dynamic:"Dynamic proxying",editor_label:"Camera proxying",media:{auto:"Media proxying automatically configured",editor_label:"Media proxying",false:"Media proxying disabled",true:"Media proxying enabled"},ssl_ciphers:{auto:"SSL ciphers automatically configured",default:"Default SSL ciphers",editor_label:"SSL ciphers",insecure:"Insecure SSL ciphers",intermediate:"Intermediate SSL ciphers",modern:"Modern SSL ciphers"},ssl_verification:{auto:"SSL verification automatically configured",editor_label:"SSL verification",false:"SSL verification disabled",true:"SSL verification enabled"}},reolink:{editor_label:"Reolink options",media_resolution:{editor_label:"Media Resolution",high:"High Resolution",low:"Low Resolution"},url:"Reolink UI URL"},title:"Title for this camera (Autodetected from entity)",triggers:{editor_label:"Trigger options",entities:"Trigger from other entities",events:{clips:"Events with new clips",editor_label:"Trigger Events",events:"All events",snapshots:"Events with new snapshots"},motion:"Trigger by auto-detecting the motion sensor",occupancy:"Trigger by auto-detecting the occupancy sensor"},webrtc_card:{editor_label:"WebRTC Card Options",entity:"WebRTC Card Camera Entity (Not a Frigate camera)",url:"WebRTC Card Camera URL"}},common:{controls:{builtin:"Built-in video controls",filter:{editor_label:"Media Filter",mode:"Filter mode",modes:{left:"Media filter in a drawer to the left",none:"No media filter",right:"Media filter in a drawer to the right"}},next_previous:{editor_label:"Next & Previous",size:"Next & previous control size in pixels",style:"Next & previous control style",styles:{chevrons:"Chevrons",icons:"Icons",none:"None",thumbnails:"Thumbnails"}},thumbnails:{editor_label:"Thumbnails",events_media_type:"Whether to show event thumbnails of clips or snapshots",events_media_types:{clips:"Clip thumbnails",snapshots:"Snapshot thumbnails"},media_type:"Whether to show thumnails of events or recordings",media_types:{events:"Events",recordings:"Recordings"},mode:"Thumbnails mode",modes:{above:"Thumbnails above",below:"Thumbnails below",left:"Thumbnails in a drawer to the left",none:"No thumbnails",right:"Thumbnails in a drawer to the right"},show_details:"Show details with thumbnails",show_download_control:"Show download control on thumbnails",show_favorite_control:"Show favorite control on thumbnails",show_timeline_control:"Show timeline control on thumbnails",size:"Thumbnails size in pixels"},timeline:{editor_label:"Mini Timeline",mode:"Mode",modes:{above:"Above",below:"Below",none:"None"},pan_mode:"Default pan mode",pan_modes:{pan:"Pan",seek:"Pan seeks across all media","seek-in-camera":"Pan seeks within selected camera only","seek-in-media":"Pan seeks within selected media item only"}}},display:{editor_label:"Display",grid_columns:"Exact number of grid columns",grid_max_columns:"Maximum number of grid columns",grid_selected_width_factor:"Increase selected media width by this factor",mode:"Mode"},image:{entity:"Entity for use with entity mode",entity_parameters:"Query parameters added to the entity-based picture URLs (e.g. width=1920&height=1080)",mode:"Image mode",modes:{camera:"Home Assistant camera snapshot of camera entity",entity:"Entity with entity_picture attribute",screensaver:"Embedded Frigate logo",url:"Arbitrary image specified by URL"},refresh_seconds:"Number of seconds after which to refresh (0=never)",url:"Static image URL"},media_action_conditions:{all:"All opportunities",hidden:"On browser/tab hiding",microphone_mute:"On microphone mute",microphone_unmute:"On microphone unmute",never:"Never",selected:"On selection",unselected:"On unselection",visible:"On browser/tab visibility"},timeline:{clustering_threshold:"The count of events at which they are clustered (0=no clustering)",events_media_type:"The events media the timeline displays",events_media_types:{all:"All event media types",clips:"Clips",snapshots:"Snapshots"},show_recordings:"Show recordings",style:"Timeline style",styles:{ribbon:"Events on a single ribbon",stack:"Stacked & clustered events"},window_seconds:"The default length of the timeline view in seconds"}},dimensions:{aspect_ratio:"Default aspect ratio (e.g. '16:9')",aspect_ratio_mode:"Aspect ratio mode",aspect_ratio_modes:{dynamic:"Aspect ratio adjusts to media",static:"Static aspect ratio",unconstrained:"Unconstrained aspect ratio"},height:"Card height in CSS units (e.g. '500px')"},live:{auto_mute:"Automatically mute live cameras",auto_pause:"Automatically pause live cameras",auto_play:"Automatically play live cameras",auto_unmute:"Automatically unmute live cameras",controls:{editor_label:"Live Controls",ptz:{editor_label:"PTZ",hide_home:"Hide home control",hide_pan_tilt:"Hide pan & tilt control",hide_zoom:"Hide zoom control",mode:"Mode",modes:{off:"Off",on:"On"},orientation:"Orientation",orientations:{horizontal:"Horizontal",vertical:"Vertical"},position:"Position",positions:{"bottom-left":"Bottom left","bottom-right":"Bottom right","top-left":"Top left","top-right":"Top right"}}},draggable:"Live cameras view can be dragged/swiped",lazy_load:"Live cameras are lazily loaded",lazy_unload:"Live cameras are lazily unloaded",microphone:{always_connected:"Always keep the microphone connected",disconnect_seconds:"Seconds after which to disconnect microphone (0=never)",editor_label:"Microphone",enabled:"Microphone enabled",mute_after_microphone_mute_seconds:"Seconds after microphone mute to mute inbound audio"},preload:"Preload live view in the background",show_image_during_load:"Show still image while the live stream is loading",transition_effect:"Live camera transition effect",zoomable:"Live cameras can be zoomed/panned"},media_viewer:{auto_mute:"Automatically mute media",auto_pause:"Automatically pause media",auto_play:"Automatically play media",auto_unmute:"Automatically unmute media",controls:{editor_label:"Media Viewer Controls"},draggable:"Media Viewer can be dragged/swiped",lazy_load:"Media Viewer media is lazily loaded in carousel",snapshot_click_plays_clip:"Clicking on a snapshot plays a related clip",transition_effect:"Media Viewer transition effect",transition_effects:{none:"No transition",slide:"Slide transition"},zoomable:"Media Viewer can be zoomed/panned"},menu:{alignment:"Menu alignment",alignments:{bottom:"Aligned to the bottom",left:"Aligned to the left",right:"Aligned to the right",top:"Aligned to the top"},button_size:"Menu button size in pixels",buttons:{alignment:"Button alignment",alignments:{matching:"Matching the menu alignment",opposing:"Opposing the menu alignment"},camera_ui:"Camera user interface",cameras:"Cameras",clips:"Clips",display_mode:"Display mode",download:"Download",enabled:"Button enabled",expand:"Expand",frigate:"Frigate menu / Default view",fullscreen:"Fullscreen",icon:"Icon",image:"Image",live:"Live",media_player:"Send to media player",microphone:"Microphone",mute:"Mute / Unmute",permanent:"Show when the menu is hidden",play:"Play / Pause",priority:"Priority",ptz_controls:"Show PTZ controls",ptz_home:"PTZ Home",recordings:"Recordings",screenshot:"Screenshot",snapshots:"Snapshots",substreams:"Substream(s)",timeline:"Timeline",type:"Button type",types:{momentary:"Momentary",toggle:"Toggle"}},position:"Menu position",positions:{bottom:"Positioned on the bottom",left:"Positioned on the left",right:"Positioned on the right",top:"Positioned on the top"},style:"Menu style",styles:{hidden:"Hidden menu",hover:"Hover menu","hover-card":"Hover menu (card-wide)",none:"No menu",outside:"Outside menu",overlay:"Overlay menu"}},overrides:{info:"This card configuration has manually specified overrides configured which may override values shown in the visual editor, please consult the code editor to view/modify these overrides"},performance:{features:{animated_progress_indicator:"Animated Progress Indicator",editor_label:"Feature Options",max_simultaneous_engine_requests:"Max simultaneous camera engine requests",media_chunk_size:"Media chunk size"},style:{border_radius:"Curves",box_shadow:"Shadows",editor_label:"Style Options"},warning:"This card is in low profile mode so defaults have changed to optimize performance"},profiles:{casting:"Casting",editor_label:"Configuration profiles","low-performance":"Low performance",scrubbing:"Video scrubbing"},status_bar:{height:"Status bar height in pixels",items:{enabled:"Item enabled",engine:"Camera engine",live_provider:"Live provider",priority:"Item priority",resolution:"Resolution",technology:"Technology",title:"Title"},popup_seconds:"Status bar popup seconds",position:"Status bar position",positions:{bottom:"Positioned on the bottom",top:"Positioned on the top"},style:"Status bar style",styles:{hover:"Hover status bar","hover-card":"Hover status bar (card-wide)",none:"No status bar",outside:"Outside status bar",overlay:"Overlay status bar",popup:"Popup status bar"}},view:{camera_select:"View for newly selected cameras",dark_mode:"Dark mode",dark_modes:{auto:"Auto",off:"Off",on:"On"},default:"Default view",default_cycle_camera:"Cycle through cameras when default view updates",default_reset:{after_interaction:"Reset to the default view after user interaction ends",editor_label:"Default view reset behavior",entities:"Reset to the default view on entity state change",every_seconds:"Reset to default view every X seconds (0=never)",interaction_mode:"How default reset behaves when the card has human interaction",interaction_modes:{active:"Only allow reset when card has active human interaction",all:"Reset regardless of human interaction",inactive:"Only reset when card has no human interaction"}},interaction_seconds:"Seconds after user action to remain interacted with (0=never)",keyboard_shortcuts:{editor_label:"Keyboard shortcuts",enabled:"Keyboard shortcuts enabled",ptz_down:"PTZ Down",ptz_home:"PTZ Home",ptz_left:"PTZ Left",ptz_right:"PTZ Right",ptz_up:"PTZ Up",ptz_zoom_in:"PTZ Zoom In",ptz_zoom_out:"PTZ Zoom Out"},triggers:{actions:{editor_label:"Trigger actions",interaction_mode:"How to handle actions when the card has human interaction",interaction_modes:{active:"Only trigger actions when card has human interaction",all:"Trigger actions regardless of human interaction",inactive:"Only trigger actions when card has no human interaction"},trigger:"Trigger action",triggers:{default:"Change to or update default view",live:"Change to or update live view",media:"Change to the relevant media view for new media",none:"No action"},untrigger:"Untrigger action",untriggers:{default:"Change to default view/camera",none:"No action"}},editor_label:"Trigger behavior",filter_selected_camera:"Only trigger on selected camera",show_trigger_status:"Show pulsing border when triggered",untrigger_seconds:"Seconds after inactive state change to untrigger"},views:{clip:"Most recent clip",clips:"Clips gallery",current:"Current view",image:"Static image",live:"Live view",recording:"Most recent recording",recordings:"Recordings gallery",snapshot:"Most recent snapshot",snapshots:"Snapshots gallery",timeline:"Timeline view"}}},x_={grid:"Show media viewer for each camera in a grid",single:"Show single media viewer"},C_={add_new_camera:"Add new camera",button:"Button",camera:"Camera",cameras:"Cameras",cameras_secondary:"What cameras to render on this card",delete:"Delete",dimensions:"Card dimensions",dimensions_secondary:"Card dimensions & shape options",image:"Image",image_secondary:"Static image view options",live:"Live",live_secondary:"Live camera view options",media_gallery:"Media gallery",media_gallery_secondary:"Media gallery options",media_viewer:"Media viewer",media_viewer_secondary:"Viewer for static media (clips, snapshots or recordings)",menu:"Menu",menu_secondary:"Menu look & feel options",move_down:"Move down",move_up:"Move up",overrides:"Overrides are active",overrides_secondary:"Dynamic configuration overrides detected",performance:"Performance",performance_secondary:"Card performance options",profiles:"Configuration profiles",profiles_secondary:"Choose pre-configured sets of defaults",status_bar:"Status bar",status_bar_secondary:"Status bar look & feel options",timeline:"Timeline",timeline_secondary:"Event timeline options",upgrade:"Upgrade",upgrade_available:"An automatic card configuration upgrade is available",view:"View",view_secondary:"What the card should show and how to show it"},M_={ptz:{down:"Down",home:"Home",left:"Left",right:"Right",up:"Up",zoom_in:"Zoom In",zoom_out:"Zoom Out"}},S_={awaiting_live:"Waiting for live stream to load ...",awaiting_media:"Waiting for media to load",camera_initialization:"Camera initialization failed",camera_initialization_reolink:"Could not initialize Reolink camera",could_not_render_elements:"Could not render picture elements",could_not_resolve:"Could not resolve media URL",diagnostics:"Card diagnostics. Please review for confidential information prior to sharing",download_no_media:"No media to download",download_sign_failed:"Could not sign media URL for download",duplicate_camera_id:"Duplicate Frigate camera id for the following camera, use the 'id' parameter to uniquely identify cameras",empty_response:"Received empty response from Home Assistant for request",failed_response:"Failed to receive response from Home Assistant for request",failed_retain:"Could not retain event",failed_sign:"Could not sign Home Assistant URL",image_load_error:"The image could not be loaded",invalid_configuration:"Invalid configuration",invalid_configuration_no_hint:"No location hint available (bad or missing type?)",invalid_configuration_override:"Invalid override configuration",invalid_elements_config:"Invalid picture elements configuration",invalid_response:"Received invalid response from Home Assistant for request",jsmpeg_no_player:"Could not start JSMPEG player",live_camera_no_endpoint:"Could not get camera endpoint for this live provider (incomplete configuration?)",live_camera_not_found:"The configured camera_entity was not found",live_camera_unavailable:"Camera unavailable",no_camera_engine:"Could not determine suitable engine for camera",no_camera_entity:"Could not find camera entity",no_camera_entity_for_triggers:"A camera entity is required in order to autodetect triggers",no_camera_id:"Could not determine camera id for the following camera, may need to set 'id' parameter manually",no_camera_name:"Could not determine a Frigate camera name for camera (or one of its dependents), please specify either 'camera_entity' or 'camera_name'",no_dashboard_or_view:"Both 'dashboard_path' and 'view_path' parameters are required for the 'dashboard' cast method",no_live_camera:"The camera_entity parameter must be set and valid for this live provider",no_supported_camera:"The selected camera does not support this view",no_supported_cameras:"No cameras support this view",reconnecting:"Reconnecting",too_many_automations:"Too many nested automation calls, please check your configuration for loops",troubleshooting:"Check troubleshooting",unknown:"Unknown error",upgrade_available:"An automated card configuration upgrade is available, please visit the visual card editor",webrtc_card_reported_error:"WebRTC Card reported an error",webrtc_card_waiting:"Waiting for WebRTC Card to load ..."},k_={camera:"Camera",duration:"Duration",in_progress:"In Progress",score:"Score",seek:"Seek",start:"Start",tag:"Tag",what:"What",where:"Where"},E_={assign:"Assign",modifiers:{alt:"Alt",ctrl:"Ctrl",meta:"Meta",shift:"Shift"},unassign:"Unassign"},$_={all:"All",camera:"Camera",favorite:"Favorite",media_type:"Media Type",media_types:{clips:"Clips",recordings:"Recordings",snapshots:"Snapshots"},not_favorite:"Not Favorite",select_camera:"Select camera...",select_favorite:"Select favorite...",select_media_type:"Select media type...",select_tag:"Select tag...",select_what:"Select what...",select_when:"Select when...",select_where:"Select where...",tag:"Tag",what:"What",when:"When",whens:{custom:"Custom",past_month:"Past Month",past_week:"Past Week",today:"Today",yesterday:"Yesterday"},where:"Where"},A_={unseekable:"Seek time not found in media"},I_={camera:"Camera",duration:"Duration",events:"Events",in_progress:"In Progress",seek:"Seek",start:"Start"},z_={download:"Download media",no_thumbnail:"No thumbnail available",retain_indefinitely:"Media will be indefinitely retained",timeline:"See media in timeline"},T_={select_date:"Choose date"},j_={common:b_,config:w_,display_modes:x_,editor:C_,elements:M_,error:S_,event:k_,key_assigner:E_,media_filter:$_,media_viewer:A_,recording:I_,thumbnail:z_,timeline:T_},O_=Object.freeze({__proto__:null,common:b_,config:w_,default:j_,display_modes:x_,editor:C_,elements:M_,error:S_,event:k_,key_assigner:E_,media_filter:$_,media_viewer:A_,recording:I_,thumbnail:z_,timeline:T_});const D_="en",R_={[D_]:O_};let P_;function L_(e){const t=e=>e.replace("-","_"),n=e?.language??e?.selectedLanguage;if(n)return t(n);const i=localStorage.getItem("selectedLanguage");if(i){const e=JSON.parse(i);if(e)return t(e)}for(const e of navigator.languages){const n=t(e);if(n&&n in R_)return n}return D_}function N_(e,t="",n=""){let i="";try{i=e.split(".").reduce(((e,t)=>e[t]),R_[P_??D_])}catch(e){}return i||(i=e.split(".").reduce(((e,t)=>e[t]),R_[D_])),""!==t&&""!==n&&(i=i.replace(t,n)),i}function F_(e){return"string"==typeof e?.id&&e.id||"string"==typeof e?.camera_entity&&e.camera_entity||"object"==typeof e?.webrtc_card&&e.webrtc_card&&("string"==typeof e.webrtc_card.entity&&e.webrtc_card.entity||"string"==typeof e.webrtc_card.url&&e.webrtc_card.url)||"object"==typeof e?.go2rtc&&e.go2rtc&&"string"==typeof e.go2rtc.url&&"string"==typeof e.go2rtc.stream&&`${e.go2rtc.url}#${e.go2rtc.stream}`||"object"==typeof e?.frigate&&e.frigate&&"string"==typeof e?.frigate.camera_name&&e.frigate.camera_name||""}const V_=(e,...t)=>{e?.debug?.logging&&console.debug(...t)},H_=(e,t,n)=>"preset"===t?(n?.preset?e.ptz.presets?.[n.preset]:null)??null:n?.phase?e.ptz[`actions_${t}_${n.phase}`]??null:e.ptz[`actions_${t}`]??null,B_=(e,t,n)=>!!H_(e,t,n),q_=(e,t)=>{const n=B_(e,t,{phase:"start"})&&B_(e,t,{phase:"stop"}),i=B_(e,t);return n||i?[...n?["continuous"]:[],...i?["relative"]:[]]:null},U_=e=>{const t=q_(e,"left"),n=q_(e,"right"),i=q_(e,"up"),a=q_(e,"down"),r=q_(e,"zoom_in"),s=q_(e,"zoom_out"),o=e.ptz.presets?Object.keys(e.ptz.presets):void 0;return t?.length||n?.length||i?.length||a?.length||r?.length||s?.length||o?.length?{...t?{left:t}:{},...n?{right:n}:{},...i?{up:i}:{},...a?{down:a}:{},...r?{zoomIn:r}:{},...s?{zoomOut:s}:{},...o?{presets:o}:{}}:null};class W_{constructor(e,t){this._capabilities=e;for(const e of t?.disable??[])this._disable(e);for(const e of Io)t?.disableExcept?.length&&!t.disableExcept.includes(e)&&this._disable(e)}_disable(e){delete this._capabilities[e]}matches(e){let t=!0;return"string"==typeof e&&(t&&=this.has(e)),"object"==typeof e&&e.allCapabilities&&(t&&=e.allCapabilities.every((e=>this.has(e)))),"object"==typeof e&&e.anyCapabilities&&(t&&=e.anyCapabilities.some((e=>this.has(e)))),t}has(e){return!!this._capabilities[e]}getPTZCapabilities(){return this._capabilities.ptz??null}hasPTZCapability(){return!!(this._capabilities.ptz?.down?.length||this._capabilities.ptz?.up?.length||this._capabilities.ptz?.left?.length||this._capabilities.ptz?.right?.length||this._capabilities.ptz?.zoomIn?.length||this._capabilities.ptz?.zoomOut?.length||this._capabilities.ptz?.presets?.length)}getRawCapabilities(){return this._capabilities}}function Z_(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++it||r&&s&&c&&!o&&!l||i&&s&&c||!n&&c||!a)return 1;if(!i&&!r&&!l&&e=o?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)}))}function Sy(e,t,n,i){return null==e?[]:(cp(t)||(t=null==t?[]:[t]),cp(n=i?void 0:n)||(n=null==n?[]:[n]),My(e,t,n))}async function ky(e,t,n,i=!1){let a;try{a=await e.callWS(n)}catch(e){if(!(e instanceof Error))throw new $o(N_("error.failed_response"),{request:n,response:e});throw e}if(!a)throw new $o(N_("error.empty_response"),{request:n});const r=i?t.safeParse(JSON.parse(a)):t.safeParse(a);if(!r.success)throw new $o(N_("error.invalid_response"),{request:n,response:a,invalid_keys:Oo(r.error)});return r.data}const Ey=bi.lazy((()=>bi.object({title:bi.string(),media_class:bi.string(),media_content_type:bi.string(),media_content_id:bi.string(),can_play:bi.boolean(),can_expand:bi.boolean(),children_media_class:bi.string().nullable().optional(),thumbnail:bi.string().nullable(),children:bi.array(Ey).nullable().optional()}))),$y="video",Ay="image",Iy=60,zy=e=>Sy(e,(e=>e._metadata?.startDate),"desc");class Ty{async walkBrowseMedias(e,t,n){return t&&t.length?(await Jm(t,(async t=>await this._walkBrowseMedia(e,t,n)))).flat():[]}async _walkBrowseMedia(e,t,n){let i=[];for(const a of function(e,t,n){t=(n?cm(e,t,n):void 0===t)?1:G_(Mm(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,r=0,s=Array(Q_(i/t));aawait this._browseMedia(e,i,{cache:n?.cache,metadataGenerator:t.metadataGenerator})));for(const e of r)for(const n of e.children??[])t.matcher(n)&&i.push(n);if(t.sorter&&(i=t.sorter(i)),t.earlyExit&&t.earlyExit(i))break}const a=t.advance?t.advance(i):null;return a?.length?await this.walkBrowseMedias(e,a,n):i}async _browseMedia(e,t,n){const i="object"==typeof t?t.media_content_id:t,a=n?.cache?n.cache.get(i):null;if(a)return a;const r={type:"media_source/browse_media",media_content_id:i},s=await ky(e,Ey,r);if(n?.metadataGenerator)for(const e of s.children??[])e._metadata=n.metadataGenerator(e,"object"==typeof t?t:void 0)??void 0;return n?.cache&&n.cache.set(i,s,Bd(new Date,{seconds:60})),s}}function jy(e,t){return yg(e,t)}function Oy(e,t){return e&&e.length?function(e,t){for(var n=-1,i=e.length,a=0,r=[];++nPy(t,e)))}add(e){this._ranges.push(e),this._ranges=Ny(this._ranges)}clear(){this._ranges=[]}}class Ry{constructor(e){this._ranges=e??[]}hasCoverage(e){const t=new Date;return this._ranges.some((n=>tet.start>=e.start&&t.end<=e.end,Ly=(e,t)=>e.start>=t.start&&e.start<=t.end||e.end>=t.start&&e.end<=t.end||e.start<=t.start&&e.end>=t.end,Ny=(e,t=0)=>{const n=[];e=Sy(e,(e=>e.start),"asc");let i=null;for(const a of e){const e=a.start instanceof Date?a.start.getTime():a.start;if(!i){i={...a};continue}(i.end instanceof Date?i.end.getTime():i.end)+1e3*t>=e?a.end>i.end&&(i.end=a.end):(n.push(i),i={...a})}return i&&n.push(i),n};class Fy{constructor(){this._data=[]}get(e){const t=new Date;for(const n of this._data)if((!n.expires||t<=n.expires)&&this._contains(e,n.request))return n.response;return null}clear(){this._data=[]}has(e){return!!this.get(e)}set(e,t,n){this._data.push({request:e,response:t,expires:n}),this._expireOldRequests()}_contains(e,t){return jy(e,t)}_expireOldRequests(){const e=new Date;this._data=this._data.filter((t=>!t.expires||e=e.start.getTime()){if(i>e.end.getTime())break;t.push(n)}}return t}getSize(){return this._data.length}expireMatches(e){this._data=this._data.filter((t=>!e(t)))}}class By{constructor(){this._segments=new Map}add(e,t,n){let i=this._segments.get(e);i||(i=new Hy((e=>1e3*e.start_time),(e=>e.id)),this._segments.set(e,i)),i.add(t,n)}clear(){this._segments.clear()}hasCoverage(e,t){return!!this._segments.get(e)?.hasCoverage(t)}get(e,t){return this._segments.get(e)?.get(t)??null}getSize(e){return this._segments.get(e)?.getSize()??null}getCameraIDs(){return[...this._segments.keys()]}expireMatches(e,t){this._segments.get(e)?.expireMatches(t)}}class qy extends $o{}class Uy extends $o{}var Wy,Zy,Qy;!function(e){e.Event="event-query",e.Recording="recording-query",e.RecordingSegments="recording-segments-query",e.MediaMetadata="media-metadata"}(Wy||(Wy={})),function(e){e.Event="event-results",e.Recording="recording-results",e.RecordingSegments="recording-segments-results",e.MediaMetadata="media-metadata-results"}(Zy||(Zy={})),function(e){e.Frigate="frigate",e.Generic="generic",e.MotionEye="motioneye",e.Reolink="reolink"}(Qy||(Qy={}));const Gy=e=>e.camera_entity??e.webrtc_card?.entity??null;class Yy{constructor(e){this._entityRegistryManager=e}async createEngine(e,t){let n;switch(e){case Qy.Generic:const{GenericCameraManagerEngine:e}=await import("./engine-generic-93cdbee6.js").then((function(e){return e.e}));n=new e(t.stateWatcher,t.eventCallback);break;case Qy.Frigate:const{FrigateCameraManagerEngine:i}=await import("./engine-frigate-be325e58.js");n=new i(this._entityRegistryManager,t.stateWatcher,new By,new Vy,t.eventCallback);break;case Qy.MotionEye:const{MotionEyeCameraManagerEngine:a}=await import("./engine-motioneye-aba6e54b.js");n=new a(this._entityRegistryManager,t.stateWatcher,new Ty,t.resolvedMediaCache,new Vy,t.eventCallback);break;case Qy.Reolink:const{ReolinkCameraManagerEngine:r}=await import("./engine-reolink-a43e6d37.js");n=new r(this._entityRegistryManager,t.stateWatcher,new Ty,t.resolvedMediaCache,new Vy,t.eventCallback)}return n}async getEngineForCamera(e,t){let n=null;if("frigate"===t.engine)n=Qy.Frigate;else if("motioneye"===t.engine)n=Qy.MotionEye;else if("generic"===t.engine)n=Qy.Generic;else if("reolink"===t.engine)n=Qy.Reolink;else{const i=Gy(t);if(i){const a=await this._entityRegistryManager.getEntity(e,i);if(!a){if(e.states[i])return Qy.Generic;throw new qy(N_("error.no_camera_entity"),t)}switch(a?.platform){case"frigate":n=Qy.Frigate;break;case"motioneye":n=Qy.MotionEye;break;case"reolink":n=Qy.Reolink;break;default:n=Qy.Generic}}else t.frigate.camera_name?n=Qy.Frigate:(t.webrtc_card?.url||t.go2rtc?.url&&t.go2rtc?.stream)&&(n=Qy.Generic)}return n}}class Ky{constructor(){this._cameras=new Map,this._enginesByType=new Map}addCamera(e){this._cameras.set(e.getID(),e),this._enginesByType.set(e.getEngine().getEngineType(),e.getEngine())}async setCameras(e){for(const t of e){const e=this._cameras.get(t.getID());e!==t&&(this.addCamera(t),await(e?.destroy()))}for(const t of this._cameras.values())e.includes(t)||(await t.destroy(),this._cameras.delete(t.getID()))}async reset(){await Jm(this._cameras.values(),(e=>e.destroy())),this._cameras.clear(),this._enginesByType.clear()}getCamera(e){return this._cameras.get(e)??null}getCameras(){return this._cameras}getCameraConfig(e){return this._cameras.get(e)?.getConfig()??null}hasCameraID(e){return this._cameras.has(e)}getCameraCount(){return this._cameras.size}getDefaultCameraID(){return this._cameras.keys().next().value??null}*getCameraConfigs(e){for(const[t,n]of this.getCameraConfigEntries(e))yield n}*getCameraConfigEntries(e){for(const t of e??this._cameras.keys()){const e=this.getCameraConfig(t);e&&(yield[t,e])}}getCameraIDs(){return new Set(this._cameras.keys())}getCameraIDsWithCapability(e){const t=new Set;for(const n of this._cameras.values())n.getCapabilities()?.matches(e)&&t.add(n.getID());return t}getCameraConfigForMedia(e){return this.getCameraConfig(e.getCameraID())}getEngineOfType(e){return this._enginesByType.get(e)??null}getEngineForCameraID(e){return this._cameras.get(e)?.getEngine()??null}getEnginesForCameraIDs(e){const t=new Map;for(const n of e){const e=this.getEngineForCameraID(n);e&&(t.has(e)||t.set(e,new Set),t.get(e)?.add(n))}return t.size?t:null}getEngineForMedia(e){return this.getEngineForCameraID(e.getCameraID())}getAllDependentCameras(e,t){const n=new Set,i=new Set,a=e=>{n.add(e);const r=this.getCamera(e),s=r?.getConfig();if(r&&s){t&&!r.getCapabilities()?.matches(t)||i.add(e);const o=new Set;s.dependencies.cameras.forEach((e=>o.add(e))),s.dependencies.all_cameras&&this.getCameraIDs().forEach((e=>o.add(e)));for(const e of o)n.has(e)||a(e)}};return a(e),i}}const Xy=e=>{return Sy((n=e=>e.getID()??e,(t=e)&&t.length?Fm(t,by(n)):[]),(e=>e.getStartTime()??e.getID()),"asc");var t,n};class Jy{static isEventQuery(e){return e.type===Wy.Event}static isRecordingQuery(e){return e.type===Wy.Recording}static isRecordingSegmentsQuery(e){return e.type===Wy.RecordingSegments}static isMediaMetadataQuery(e){return e.type===Wy.MediaMetadata}}class ev{static isEventQueryResult(e){return e.type===Zy.Event}static isRecordingQueryResult(e){return e.type===Zy.Recording}static isRecordingSegmentsQueryResult(e){return e.type===Zy.RecordingSegments}static isMediaMetadataQueryResult(e){return e.type===Zy.MediaMetadata}}class tv{constructor(e,t){this._requestLimit=new v_,this._api=e,this._engineFactory=t?.factory??new Yy(this._api.getEntityRegistryManager()),this._store=t?.store??new Ky}async initializeCamerasFromConfig(){const e=this._api.getConfigManager().getConfig(),t=this._api.getHASSManager().getHASS();if(!e||!t)return!1;this._requestLimit.concurrency=e.performance.features.max_simultaneous_engine_requests??1/0;const n=e.cameras.map((t=>{return n={},i=l_(e?.cameras_global),dm(n,i,t,((e,t)=>Array.isArray(t)?t:void 0));var n,i}));try{await this._initializeCameras(n)}catch(e){return this._api.getMessageManager().setErrorIfHigherPriority(e,N_("error.camera_initialization")),!1}return!0}async reset(){await this._store.reset()}async _getEnginesForCameras(e){const t=new Map,n=new Map,i=this._api.getHASSManager().getHASS(); +/* istanbul ignore if: the if path cannot be reached -- @preserve */ +if(!i)return t;const a=await(async e=>await Jm(e,(e=>this._engineFactory.getEngineForCamera(i,e))))(e);for(const[i,r]of e.entries()){const e=a[i],s=e?n.get(e)??await this._engineFactory.createEngine(e,{eventCallback:e=>this._api.getTriggersManager().handleCameraEvent(e),stateWatcher:this._api.getHASSManager().getStateWatcher(),resolvedMediaCache:this._api.getResolvedMediaCache()}):null;if(!s||!e)throw new qy(N_("error.no_camera_engine"),l_(r));n.set(e,s),t.set(r,s)}return t}async _initializeCameras(e){const t=new Date,n=this._api.getHASSManager().getHASS(); +/* istanbul ignore if: the if path cannot be reached -- @preserve */ +if(!n)return;e.some((e=>(e=>e.triggers.motion||e.triggers.occupancy)(e)))&&await this._api.getEntityRegistryManager().fetchEntityList(n);const i=await this._getEnginesForCameras(e),a=await Jm(i.entries(),(async([e,t])=>await t.createCamera(n,e))),r=async()=>{a.forEach((e=>e.destroy()))},s=new Set;for(const e of a){const t=F_(e.getConfig());if(!t)throw await r(),new qy(N_("error.no_camera_id"),e.getConfig());if(s.has(t))throw await r(),new qy(N_("error.duplicate_camera_id"),e.getConfig());e.setID(t),s.add(t)}await this._store.setCameras(a),V_(this._api.getConfigManager().getCardWideConfig(),"Frigate Card CameraManager initialized (Cameras: ",this._store.getCameras(),`, Duration: ${((new Date).getTime()-t.getTime())/1e3}s,`,")")}isInitialized(){return this._store.getCameraCount()>0}getStore(){return this._store}generateDefaultEventQueries(e,t){return this._generateDefaultQueries(e,{type:Wy.Event,...t})}generateDefaultRecordingQueries(e,t){return this._generateDefaultQueries(e,{type:Wy.Recording,...t})}generateDefaultRecordingSegmentsQueries(e,t){return this._generateDefaultQueries(e,{type:Wy.RecordingSegments,...t})}_generateDefaultQueries(e,t){const n=[],i=Um(e),a=this._store.getEnginesForCameraIDs(i);if(!a)return null;for(const[e,i]of a){let a=null; +/* istanbul ignore else: the else path cannot be reached -- @preserve */Jy.isEventQuery(t)?a=e.generateDefaultEventQuery(this._store,i,t):Jy.isRecordingQuery(t)?a=e.generateDefaultRecordingQuery(this._store,i,t):Jy.isRecordingSegmentsQuery(t)&&(a=e.generateDefaultRecordingSegmentsQuery(this._store,i,t));for(const e of a??[])n.push(e)}return n.length?n:null}async getMediaMetadata(){const e=new Set,t=new Set,n=new Set,i=new Set,a={type:Wy.MediaMetadata,cameraIDs:this._store.getCameraIDs()},r=await this._handleQuery(a);for(const a of r.values())a.metadata.tags&&a.metadata.tags.forEach(e.add,e),a.metadata.what&&a.metadata.what.forEach(t.add,t),a.metadata.where&&a.metadata.where.forEach(n.add,n),a.metadata.days&&a.metadata.days.forEach(i.add,i);return t.size||n.size||i.size||e.size?{...e.size&&{tags:e},...t.size&&{what:t},...n.size&&{where:n},...i.size&&{days:i}}:null}async getEvents(e,t){return await this._handleQuery(e,t)}async getRecordings(e,t){return await this._handleQuery(e,t)}async getRecordingSegments(e,t){return await this._handleQuery(e,t)}async executeMediaQueries(e,t){return this._convertQueryResultsToMedia(await this._handleQuery(e,t))}async extendMediaQueries(e,t,n,i){if(!this._api.getHASSManager().getHASS())return null;const a=e=>{let n=null;for(const i of t){const t=i.getStartTime();t&&(!n||"earliest"===e&&tn)&&(n=t)}return n},r=this._api.getConfigManager().getCardWideConfig()?.performance?.features.media_chunk_size??50,s=[],o=[];for(const t of e){const e={...t}; +/* istanbul ignore else: the else path cannot be reached -- @preserve */if("later"===n){const t=a("latest");t&&(e.start=t,delete e.end)}else if("earlier"===n){const t=a("earliest");t&&(e.end=t,delete e.start)}e.limit=r,o.push({...t,limit:(t.limit??0)+r}),s.push(e)}const c=this._convertQueryResultsToMedia(await this._handleQuery(s,i));if(!c.length)return null;const l=Xy(t.concat(c));return l.length===t.length?null:{queries:o,results:l}}async getMediaDownloadPath(e){const t=this._store.getCameraConfigForMedia(e),n=this._store.getEngineForMedia(e),i=this._api.getHASSManager().getHASS();return t&&n&&i?await n.getMediaDownloadPath(i,t,e):null}getMediaCapabilities(e){const t=this._store.getEngineForMedia(e);return t?t.getMediaCapabilities(e):null}async favoriteMedia(e,t){const n=this._store.getCameraConfigForMedia(e),i=this._store.getEngineForMedia(e),a=this._api.getHASSManager().getHASS();if(!n||!i||!a)return;const r=new Date;await this._requestLimit.add((()=>i.favoriteMedia(a,n,e,t))),V_(this._api.getConfigManager().getCardWideConfig(),"Frigate Card CameraManager favorite request (",`Duration: ${((new Date).getTime()-r.getTime())/1e3}s,`,"Media:",e.getID(),", Favorite:",t,")")}areMediaQueriesResultsFresh(e,t){const n=new Date;for(const i of e){const e=this._store.getEnginesForCameraIDs(i.cameraIDs);for(const[a,r]of e??[]){const e=a.getQueryResultMaxAge({...i,cameraIDs:r});if(null!==e&&Bd(t,{seconds:e})i?null:await this._requestLimit.add((()=>a.getMediaSeekTime(r,this._store,e,t)))??null}async _handleQuery(e,t){const n=qm(e),i=new Map,a=new Date,r=this._api.getHASSManager().getHASS();if(!r)return i;const s=async(e,n)=>{let a=null; +/* istanbul ignore else: the else path cannot be reached -- @preserve */Jy.isEventQuery(n)?a=await e.getEvents(r,this._store,n,t):Jy.isRecordingQuery(n)?a=await e.getRecordings(r,this._store,n,t):Jy.isRecordingSegmentsQuery(n)?a=await e.getRecordingSegments(r,this._store,n,t):Jy.isMediaMetadataQuery(n)&&(a=await e.getMediaMetadata(r,this._store,n,t)),a?.forEach(((e,t)=>i.set(t,e)))},o=async e=>{const t=this._store.getEnginesForCameraIDs(e.cameraIDs);t&&await Promise.all(Array.from(t.keys()).map((n=>this._requestLimit.add((()=>s(n,{...e,cameraIDs:t.get(n)}))))))};await Promise.all(n.map((e=>o(e))));const c=(l=Array.from(i.values()).map((e=>Number(e.cached??0))))&&l.length?function(e,t){for(var n,i=-1,a=e.length;++ithis._store.getCamera(e))).filter(rf);return new W_({live:t.some((e=>e.getCapabilities()?.has("live"))),clips:t.some((e=>e.getCapabilities()?.has("clips"))),recordings:t.some((e=>e.getCapabilities()?.has("recordings"))),snapshots:t.some((e=>e.getCapabilities()?.has("snapshots"))),"favorite-events":t.some((e=>e.getCapabilities()?.has("favorite-events"))),"favorite-recordings":t.some((e=>e.getCapabilities()?.has("favorite-recordings"))),seek:t.some((e=>e.getCapabilities()?.has("seek"))),menu:t.some((e=>e.getCapabilities()?.has("menu")))})}async executePTZAction(e,t,n){const i=this._store.getCameraConfig(e);if(!i)return;const a=H_(i,t,n);if(a)return await this._api.getActionsManager().executeActions(a);const r=this._api.getHASSManager().getHASS(),s=this._store.getEngineForCameraID(e);return s&&r?await this._requestLimit.add((()=>s.executePTZAction(r,i,t,n))):void 0}}class nv{constructor(e){this._cache=new Map,this._keyCallback=e}has(e){return this._cache.has(e)}getMatches(e){return[...this._cache.values()].filter(e)}get(e){return this._cache.get(e)??null}add(e){const t=e=>this._cache.set(this._keyCallback(e),e);Array.isArray(e)?e.forEach(t):t(e)}}const iv=bi.object({id:bi.string(),model:bi.string().nullable(),config_entries:bi.string().array(),manufacturer:bi.string().nullable()}).array();class av{constructor(e){this._fetchedDeviceList=!1,this._cache=e}async getDevice(e,t){return this._cache.has(t)?this._cache.get(t):(await this._fetchDeviceList(e),this._cache.get(t)??null)}async getMatchingDevices(e,t){return await this._fetchDeviceList(e),this._cache.getMatches(t)}async _fetchDeviceList(e){if(this._fetchedDeviceList)return;let t=null;try{t=await ky(e,iv,{type:"config/device_registry/list"})}catch(e){return void Zm(e)}this._cache.add(t),this._fetchedDeviceList=!0}}const rv=bi.object({config_entry_id:bi.string().nullable(),device_id:bi.string().nullable(),disabled_by:bi.string().nullable(),entity_id:bi.string(),hidden_by:bi.string().nullable(),platform:bi.string(),translation_key:bi.string().nullable(),unique_id:bi.string().or(bi.number()).optional()}),sv=rv.array();class ov{constructor(e){this._fetchedEntityList=!1,this._cache=e}async getEntity(e,t){const n=this._cache.get(t);if(n)return n;let i=null;try{i=await ky(e,rv,{type:"config/entity_registry/get",entity_id:t})}catch(e){return Zm(e),null}return this._cache.add(i),i}async getMatchingEntities(e,t){return await this.fetchEntityList(e),this._cache.getMatches(t)}async getEntities(e,t){const n=new Map;return await Promise.all(t.map((async t=>{const i=await this.getEntity(e,t);i&&n.set(t,i)}))),n}async fetchEntityList(e){if(this._fetchedEntityList)return;let t=null;try{t=await ky(e,sv,{type:"config/entity_registry/list"})}catch(e){return void Zm(e)}this._cache.add(t),this._fetchedEntityList=!0}}class cv extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if("number"==typeof e.maxAge&&0===e.maxAge)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if("function"==typeof this.onEviction)for(const[t,n]of e)this.onEviction(t,n.value)}_deleteIfExpired(e,t){return"number"==typeof t.expiry&&t.expiry<=Date.now()&&("function"==typeof this.onEviction&&this.onEviction(e,t.value),this.delete(e))}_getOrDeleteIfExpired(e,t){if(!1===this._deleteIfExpired(e,t))return t.value}_getItemValue(e,t){return t.expiry?this._getOrDeleteIfExpired(e,t):t.value}_peek(e,t){const n=t.get(e);return this._getItemValue(e,n)}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,t){this.oldCache.delete(e),this._set(e,t)}*_entriesAscending(){for(const e of this.oldCache){const[t,n]=e;if(!this.cache.has(t)){!1===this._deleteIfExpired(t,n)&&(yield e)}}for(const e of this.cache){const[t,n]=e;!1===this._deleteIfExpired(t,n)&&(yield e)}}get(e){if(this.cache.has(e)){const t=this.cache.get(e);return this._getItemValue(e,t)}if(this.oldCache.has(e)){const t=this.oldCache.get(e);if(!1===this._deleteIfExpired(e,t))return this._moveToRecent(e,t),t.value}}set(e,t,{maxAge:n=this.maxAge}={}){const i="number"==typeof n&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;return this.cache.has(e)?this.cache.set(e,{value:t,expiry:i}):this._set(e,{value:t,expiry:i}),this}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):!!this.oldCache.has(e)&&!this._deleteIfExpired(e,this.oldCache.get(e))}peek(e){return this.cache.has(e)?this._peek(e,this.cache):this.oldCache.has(e)?this._peek(e,this.oldCache):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");const t=[...this._entriesAscending()],n=t.length-e;n<0?(this.cache=new Map(t),this.oldCache=new Map,this._size=t.length):(n>0&&this._emitEvictions(t.slice(0,n)),this.oldCache=new Map(t.slice(n)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache){const[t,n]=e;!1===this._deleteIfExpired(t,n)&&(yield[t,n.value])}for(const e of this.oldCache){const[t,n]=e;if(!this.cache.has(t)){!1===this._deleteIfExpired(t,n)&&(yield[t,n.value])}}}*entriesDescending(){let e=[...this.cache];for(let t=e.length-1;t>=0;--t){const n=e[t],[i,a]=n;!1===this._deleteIfExpired(i,a)&&(yield[i,a.value])}e=[...this.oldCache];for(let t=e.length-1;t>=0;--t){const n=e[t],[i,a]=n;if(!this.cache.has(i)){!1===this._deleteIfExpired(i,a)&&(yield[i,a.value])}}}*entriesAscending(){for(const[e,t]of this._entriesAscending())yield[e,t.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,t=this){for(const[n,i]of this.entriesAscending())e.call(t,i,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}class lv{constructor(){this._cache=new cv({maxSize:1e3})}has(e){return this._cache.has(e)}get(e){return this._cache.get(e)}set(e,t){this._cache.set(e,t)}}const dv=async(e,t,n)=>{const i=n?n.get(t):void 0;if(i)return i;const a={type:"media_source/resolve_media",media_content_id:t};let r=null;try{r=await ky(e,zo,a)}catch(e){Zm(e)}return n&&r&&n.set(t,r),r};class uv{constructor(e,t,n){this._context=e,this._action=t,this._config=n}async execute(e){}async stop(){}}class hv extends uv{}class pv extends hv{async execute(e){const t=this._action.camera??(this._action.triggered?e.getTriggersManager().getMostRecentlyTriggeredCameraID():null),n=e.getViewManager().getView(),i=e.getConfigManager().getConfig();if(t&&n){const a=i?.view.camera_select??"current",r="current"===a?n.view:a;await e.getViewManager().setViewByParametersWithNewQuery({params:{view:r,camera:t},failSafe:!0})}}}class gv extends hv{async execute(e){e.getCameraURLManager().openURL()}}class mv extends hv{async execute(e){await e.getViewManager().setViewDefaultWithNewQuery()}}class fv extends hv{async execute(e){await e.getViewManager().setViewByParametersWithNewQuery({params:{displayMode:this._action.display_mode}})}}class _v extends hv{async execute(e){await e.getDownloadManager().downloadViewerMedia()}}class yv extends hv{async execute(e){e.getExpandManager().toggleExpanded()}}class vv extends hv{async execute(e){e.getFullscreenManager().toggleFullscreen()}}class bv extends uv{async execute(e){const t=e.getHASSManager().getHASS();t&&it(e.getCardElementManager().getElement(),t,this._config??{},this._action)}}class wv extends hv{async execute(e){console[this._action.level](this._action.message)}}const xv=(e,t)=>e.context?.live?.overrides?.get(t??e.camera)??t??e.camera,Cv=e=>xv(e)!==e.camera,Mv=(e,t)=>{const n=e.context?.live?.overrides??new Map;n.set(e.camera,t),e.mergeInContext({live:{overrides:n}})};class Sv extends hv{async execute(e){const t=this._action.media_player,n=e.getMediaPlayerManager(),i=e.getViewManager().getView(),a=i?.queryResults?.getSelectedResult()??null;"stop"===this._action.media_player_action?await n.stop(t):i?.is("live")?await n.playLive(t,xv(i)):i?.isViewerView()&&a&&await n.playMedia(t,a)}}class kv extends hv{async execute(e){e.getCardElementManager().toggleMenu()}}class Ev extends hv{async execute(e){await e.getMicrophoneManager().connect()}}class $v extends hv{async execute(e){e.getMicrophoneManager().disconnect()}}class Av extends hv{async execute(e){e.getMicrophoneManager().mute()}}class Iv extends hv{async execute(e){await e.getMicrophoneManager().unmute()}}class zv extends hv{async execute(e){await(e.getMediaLoadedInfoManager().get()?.player?.mute())}}class Tv extends hv{async execute(e){await(e.getMediaLoadedInfoManager().get()?.player?.pause())}}class jv extends hv{async execute(e){await(e.getMediaLoadedInfoManager().get()?.player?.play())}}const Ov=(e,t)=>{if(e.isViewerView()){const n=e.queryResults?.getSelectedResult()?.getID()??null;return"ptz"!==t?.type&&n?{targetID:n,type:"digital"}:null}if(e.is("live")){const n=xv(e);let i="digital";return"digital"!==t?.type&&t?.cameraManager&&(Dv(t.cameraManager,n)&&(i="ptz"),"ptz"!==i&&"ptz"===t?.type)?null:{targetID:n,type:i}}return null},Dv=(e,t)=>!!e.getStore().getCamera(t)?.getCapabilities()?.hasPTZCapability();var Rv=lm((function(e,t,n){Kg(e,t,n)}));const Pv=(e,t)=>{t?.[e]?.inProgressAction?.stop()},Lv=(e,t,n,i)=>{Rv(t,{[n]:{[e]:{inProgressAction:i}}})};class Nv extends hv{constructor(){super(...arguments),this._timer=new bf}async stop(){this._timer.stop()}async execute(e){const t=e.getViewManager().getView();if(!t)return;const n=this._action.camera??Ov(t,{type:"ptz",cameraManager:e.getCameraManager()})?.targetID??null,i=n?e.getCameraManager().getCameraCapabilities(n)?.getPTZCapabilities():null,a=n?e.getCameraManager().getStore().getCameraConfig(n)?.ptz:null;if(!n||!i||!a)return;if(!this._action.ptz_action)return void(i.presets&&i.presets.length>=1&&await e.getCameraManager().executePTZAction(n,"preset",{phase:this._action.ptz_phase,preset:i.presets[0]}));const r=(e=>{switch(e){case"left":case"right":case"up":case"down":return e;case"zoom_in":return"zoomIn";case"zoom_out":return"zoomOut"}return null})(this._action.ptz_action);if(r&&i[r]?.includes(this._action.ptz_phase?"continuous":"relative")||"preset"===this._action.ptz_action)return await e.getCameraManager().executePTZAction(n,this._action.ptz_action,{phase:this._action.ptz_phase,preset:this._action.ptz_preset});if("start"===this._action.ptz_phase){Pv(n,this._context.ptz),Lv(n,this._context,"ptz",this);const t=async()=>{this._action.ptz_action&&await e.getCameraManager().executePTZAction(n,this._action.ptz_action,{preset:this._action.ptz_preset}),this._timer.start(a.r2c_delay_between_calls_seconds,t)};await t()}else"stop"===this._action.ptz_phase?Pv(n,this._context.ptz):(await e.getCameraManager().executePTZAction(n,this._action.ptz_action,{preset:this._action.ptz_preset,phase:"start"}),this._timer.start(a.c2r_delay_between_calls_seconds,(async()=>{this._action.ptz_action&&await e.getCameraManager().executePTZAction(n,this._action.ptz_action,{preset:this._action.ptz_preset,phase:"stop"})})))}}class Fv extends hv{async execute(e){e.getViewManager().setViewWithMergedContext({ptzControls:{enabled:this._action.enabled}})}}function Vv(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=wm(n))==n?n:0),void 0!==t&&(t=(t=wm(t))==t?t:0),function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}(wm(e),t,n)}const Hv=50,Bv=50,qv=1,Uv=4,Wv=e=>void 0===e?.pan?.x&&void 0===e?.pan?.y&&void 0===e?.zoom;class Zv{constructor(e){this._context=e}modify(e){e.mergeInContext(this._context)}}const Qv=(e,t)=>({zoom:{[e]:{observed:t?.observed??void 0,requested:t?.requested??null}}}),Gv=(e,t,n)=>{t&&n&&t.setViewByParameters({modifiers:[new Zv(Qv(n,{observed:e.detail}))]})};class Yv extends hv{constructor(){super(...arguments),this._timer=new bf}async _stepChange(e,t){e.getViewManager().setViewWithMergedContext(Qv(t,{requested:this._convertActionToZoomSettings(e.getViewManager().getView()?.context?.zoom?.[t]?.observed)}))}async stop(){this._timer.stop()}async execute(e){const t=e.getViewManager().getView();if(!t)return;const n=this._action.target_id??Ov(t,{type:"digital",cameraManager:e.getCameraManager()})?.targetID;return n?this._action.absolute||!this._action.ptz_phase?await this._stepChange(e,n): +/* istanbul ignore else: the else path cannot be reached -- @preserve */ +void("start"===this._action.ptz_phase?(Pv(n,this._context.ptzDigital),Lv(n,this._context,"ptzDigital",this),await this._stepChange(e,n),this._timer.startRepeated(.1,(()=>this._stepChange(e,n)))):"stop"===this._action.ptz_phase&&(Pv(n,this._context.ptzDigital),delete this._context.ptzDigital?.[n])):void 0}_convertActionToZoomSettings(e){if(!this._action.absolute&&!this._action.ptz_action)return{};if(this._action.absolute)return this._action.absolute;const t=e?.zoom??1,n=e?.pan?.x??50,i=e?.pan?.y??50,a="zoom_in"===this._action.ptz_action?.1:"zoom_out"===this._action.ptz_action?-.1:0,r="left"===this._action.ptz_action?-5:"right"===this._action.ptz_action?5:0,s="up"===this._action.ptz_action?-5:"down"===this._action.ptz_action?5:0;return{zoom:Vv(t+a,1,10),pan:{x:Vv(n+r,0,100),y:Vv(i+s,0,100)}}}}class Kv extends hv{async execute(e){const t=e.getViewManager().getView();let n=null,i=null;if(this._action.target_id)n=this._action.target_id,i=Dv(e.getCameraManager(),n)?"ptz":"digital";else if(t){const a=Ov(t,{cameraManager:e.getCameraManager()});n=a?.targetID??null,i=a?.type??null}n&&null!==i&&("ptz"===i?this._toPTZAction(n):this._toPTZDigitalAction(n)).execute(e)}_toPTZAction(e){return new Nv(this._context,(t={cardID:this._action.card_id,cameraID:e,ptzAction:this._action.ptz_action,ptzPhase:this._action.ptz_phase,ptzPreset:this._action.ptz_preset},{action:"fire-dom-event",frigate_card_action:"ptz",...t?.cardID&&{card_id:t.cardID},...t?.ptzAction&&{ptz_action:t.ptzAction},...t?.ptzPhase&&{ptz_phase:t.ptzPhase},...t?.ptzPreset&&{ptz_preset:t.ptzPreset},...t?.cameraID&&{camera:t.cameraID}}),this._config);var t}_toPTZDigitalAction(e){return new Yv(this._context,(t={cardID:this._action.card_id,ptzPhase:this._action.ptz_phase,ptzAction:this._action.ptz_action,targetID:e},{action:"fire-dom-event",frigate_card_action:"ptz_digital",...t?.cardID&&{card_id:t.cardID},...t?.ptzAction&&{ptz_action:t.ptzAction},...t?.ptzPhase&&{ptz_phase:t.ptzPhase},...t?.absolute&&{absolute:t.absolute},...t?.targetID&&{target_id:t.targetID}}),this._config);var t}}class Xv extends hv{async execute(e){await e.getDownloadManager().downloadScreenshot()}}class Jv extends hv{async execute(e){var t;await tf((t=this._action.duration,3600*(t.h??0)+60*(t.m??0)+(t.s??0)+(t.ms??0)/1e3))}}class eb extends hv{async execute(e){switch(this._action.status_bar_action){case"reset":e.getStatusBarItemManager().removeAllDynamicStatusBarItems();break;case"add":this._action.items?.forEach((t=>e.getStatusBarItemManager().addDynamicStatusBarItem(t)));break;case"remove":this._action.items?.forEach((t=>e.getStatusBarItemManager().removeDynamicStatusBarItem(t)))}}}class tb{modify(e){(e=>{const t=e.context?.live?.overrides;t&&t.has(e.camera)&&e.context?.live?.overrides?.delete(e.camera)})(e)}}class nb extends hv{async execute(e){e.getViewManager().setViewByParameters({modifiers:[new tb]})}}class ib{constructor(e){this._api=e}modify(e){const t=[...this._api.getCameraManager().getStore().getAllDependentCameras(e.camera,"substream")];if(t.length<=1)return;const n=xv(e),i=t.indexOf(n),a=i<0?0:(i+1)%t.length;Mv(e,t[a])}}class ab extends hv{async execute(e){e.getViewManager().setViewByParameters({modifiers:[new ib(e)]})}}class rb{constructor(e){this._substreamID=e}modify(e){Mv(e,this._substreamID)}}class sb extends hv{async execute(e){e.getViewManager().setViewByParameters({modifiers:[new rb(this._action.camera)]})}}class ob extends hv{async execute(e){await(e.getMediaLoadedInfoManager().get()?.player?.unmute())}}class cb extends hv{async execute(e){await e.getViewManager().setViewByParametersWithNewQuery({params:{view:this._action.frigate_card_action}})}}class lb{createAction(e,t,n){const i=hf(t);if("fire-dom-event"!==t.action||!i)return new bv(e,t,n?.config);if(i.card_id&&i.card_id!==n?.cardID)return null;switch(i.frigate_card_action){case"default":return new mv(e,i,n?.config);case"clip":case"clips":case"image":case"live":case"recording":case"recordings":case"snapshot":case"snapshots":case"timeline":case"diagnostics":return new cb(e,i,n?.config);case"sleep":return new Jv(e,i,n?.config);case"download":return new _v(e,i,n?.config);case"camera_ui":return new gv(e,i,n?.config);case"expand":return new yv(e,i,n?.config);case"fullscreen":return new vv(e,i,n?.config);case"menu_toggle":return new kv(e,i,n?.config);case"camera_select":return new pv(e,i,n?.config);case"live_substream_select":return new sb(e,i,n?.config);case"live_substream_off":return new nb(e,i,n?.config);case"live_substream_on":return new ab(e,i,n?.config);case"media_player":return new Sv(e,i,n?.config);case"microphone_connect":return new Ev(e,i,n?.config);case"microphone_disconnect":return new $v(e,i,n?.config);case"microphone_mute":return new Av(e,i,n?.config);case"microphone_unmute":return new Iv(e,i,n?.config);case"mute":return new zv(e,i,n?.config);case"unmute":return new ob(e,i,n?.config);case"play":return new jv(e,i,n?.config);case"pause":return new Tv(e,i,n?.config);case"screenshot":return new Xv(e,i,n?.config);case"display_mode_select":return new fv(e,i,n?.config);case"ptz":return new Nv(e,i,n?.config);case"ptz_digital":return new Yv(e,i,n?.config);case"ptz_multi":return new Kv(e,i,n?.config);case"ptz_controls":return new Fv(e,i,n?.config);case"log":return new wv(e,i,n?.config);case"status_bar":return new eb(e,i,n?.config)} +/* istanbul ignore next: this path cannot be reached -- @preserve */ +/* istanbul ignore next: this path cannot be reached -- @preserve */ +return console.warn(`Frigate card received unknown card action: ${i.frigate_card_action}`),null}}class db{constructor(e,t,n){this._actions=[],this._factory=new lb,this._stopped=!1,this._context=e;for(const i of qm(t)){const t=this._factory.createAction(e,i,n);t&&this._actions.push(t)}}async execute(e){for(const t of this._actions){if(this._stopped)break;await t.execute(e)}}async stop(){this._stopped=!0}}const ub=bi.object({action:bi.enum(["tap","double_tap","hold","start_tap","end_tap"])}),hb=bi.object({detail:ub});class pb{constructor(e){this._actionsInFlight=[],this._actionContext={},this.handleInteractionEvent=e=>{const t=hb.safeParse(e);if(!t.success)return;const n=t.data.detail.action,i=this.getMergedActions(),a=_f(n,i);i&&n&&a&&this.executeActions(a,i)},this.handleCustomActionEvent=e=>{"detail"in e&&this.executeActions(e.detail)},this.handleActionExecutionRequestEvent=async e=>{await this.executeActions(e.detail.action,e.detail.config)},this._api=e}getMergedActions(){const e=this._api.getViewManager().getView();if(this._api.getMessageManager().hasMessage())return{};const t=this._api.getConfigManager().getConfig();let n;if(e?.is("live"))n=t?.live.actions;else if(e?.isGalleryView())n=t?.media_gallery?.actions;else if(e?.isViewerView())n=t?.media_viewer.actions;else{if(!e?.is("image"))return{};n=t?.image?.actions}return{...t?.view.actions,...n}}uninitialize(){this._actionsInFlight.forEach((e=>e.stop()))}async executeActions(e,t){const n=new db(this._actionContext,e,{config:t,cardID:this._api.getConfigManager().getConfig()?.card_id});this._actionsInFlight.push(n),await n.execute(this._api),this._actionsInFlight=this._actionsInFlight.filter((e=>e!==n))}}class gb{constructor(e){this._automations=[],this._priorEvaluations=new Map,this._nestedAutomationExecutions=0,this._api=e}deleteAutomations(e){this._automations=this._automations.filter((t=>t.tag!==e))}addAutomations(e){this._automations.push(...e)}execute(){if(!this._api.getHASSManager().hasHASS()||!this._api.getInitializationManager().isInitializedMandatory()||this._api.getMessageManager().hasErrorMessage())return;const e=[];for(const t of this._automations){const n=this._api.getConditionsManager().evaluateConditions(t.conditions),i=n?t.actions:t.actions_not,a=this._priorEvaluations.get(t);this._priorEvaluations.set(t,n),n!==a&&i&&e.push(...i)}if(!e.length)return;(async e=>{++this._nestedAutomationExecutions,this._nestedAutomationExecutions>10?this._api.getMessageManager().setMessageIfHigherPriority({type:"error",message:N_("error.too_many_automations")}):(await this._api.getActionsManager().executeActions(e),--this._nestedAutomationExecutions)})(e)}}class mb{constructor(e){this._api=e}openURL(){const e=this.getCameraURL();e&&window.open(e)}hasCameraURL(){return!!this.getCameraURL()}getCameraURL(){const e=this._api.getViewManager().getView(),t=e?.queryResults?.getSelectedResult()??null,n=e?.camera?this._api.getCameraManager().getCameraEndpoints(e.camera,{view:e.view,...t&&{media:t}})??null:null;return n?.ui?.endpoint??null}}const fb=()=>!!navigator.userAgent.match(/CrKey\//);async function _b(e,t,n){const i={type:"auth/sign_path",path:t,expires:n},a=await ky(e,To,i);return a?e.hassUrl(a.path):null}function yb(e,t,n,i){if(!e||!n||!n.length)return[];const a=[];for(const r of n){const n=t?.states[r],s=e.states[r];if((i?.stateOnly&&n?.state!==s?.state||!i?.stateOnly&&n!==s)&&(a.push({entityID:r,oldState:n,newState:s}),i?.firstOnly))break}return a}function vb(e,t,n,i){return!!yb(e,t,n,{...i,firstOnly:!0}).length}function bb(e,t){return t?e?.states[t]?.attributes?.friendly_name??null:null}const wb=async()=>{if(["ha-button-menu","ha-button","ha-camera-stream","ha-card","ha-circular-progress","ha-combo-box","ha-hls-player","ha-icon-button","ha-icon","ha-menu-button","ha-selector","ha-state-icon","ha-web-rtc-player","mwc-button","mwc-list-item","state-badge"].every((e=>customElements.get(e))))return!0;const e=await window.loadCardHelpers();await e.createCardElement({type:"picture-glance",entities:[],camera_image:"dummy-to-load-editor-components"}),await customElements.whenDefined("hui-picture-glance-card");const t=customElements.get("hui-picture-glance-card");if(!t)return!1;const n=new t;return await n.constructor.getConfigElement(),!0},xb=e=>!!e&&["on","open"].includes(e),Cb=(e,t)=>{if(!e)return[];const n=Object.keys(e.states).filter((e=>!t||e.substr(0,e.indexOf("."))===t));return n.sort(),n};function Mb(e){return!!e?.startsWith("/")}function Sb(e,t){return Mb(t)?e.hassUrl(t):t??null}const kb=(e,t)=>!!((e.attributes.supported_features??0)&t);class Eb{constructor(){this._initialized=new Set}async initializeMultipleIfNecessary(e){return(await Jm(Object.entries(e),(async([e,t])=>await this.initializeIfNecessary(e,t)))).every(Boolean)}async initializeIfNecessary(e,t){return!!this._initialized.has(e)||(t?!!await t()&&(this._initialized.add(e),!0):(this._initialized.add(e),!0))}uninitialize(e){this._initialized.delete(e)}isInitialized(e){return this._initialized.has(e)}isInitializedMultiple(e){return e.every((e=>this.isInitialized(e)))}}var $b;!function(e){e.LANGUAGES="languages",e.SIDE_LOAD_ELEMENTS="side-load-elements",e.CAMERAS="cameras",e.MICROPHONE_CONNECT="microphone-connect",e.VIEW="view"}($b||($b={}));class Ab{constructor(e,t){this._initializationQueue=new v_({concurrency:1}),this._everInitialized=!1,this._api=e,this._initializer=t??new Eb}wasEverInitialized(){return this._everInitialized}isInitializedMandatory(){return!!this._api.getConfigManager().getConfig()&&this._initializer.isInitializedMultiple([$b.LANGUAGES,$b.SIDE_LOAD_ELEMENTS,$b.CAMERAS,...this._api.getMicrophoneManager().shouldConnectOnInitialization()?[$b.MICROPHONE_CONNECT]:[],$b.VIEW])}async initializeMandatory(){await this._initializationQueue.add((()=>this._initializeMandatory()))}async _initializeMandatory(){const e=this._api.getHASSManager().getHASS();if(!e||this.isInitializedMandatory())return;if(!await this._initializer.initializeMultipleIfNecessary({[$b.LANGUAGES]:async()=>await(async e=>{const t=L_(e);return"ca"===t?R_[t]=await import("./lang-ca-99b9960f.js"):"it"===t?R_[t]=await import("./lang-it-7713a746.js"):"pt"===t?R_[t]=await import("./lang-pt-PT-16f39312.js"):"pt_BR"===t?R_[t]=await import("./lang-pt-BR-ea76ed6c.js"):"fr"===t&&(R_[t]=await import("./lang-fr-e5e97bbf.js")),t&&(P_=t),!0})(e),[$b.SIDE_LOAD_ELEMENTS]:async()=>await wb()}))return;this._api.getConfigManager().getConfig()&&await this._initializer.initializeMultipleIfNecessary({[$b.CAMERAS]:async()=>await this._api.getCameraManager().initializeCamerasFromConfig(),...this._api.getMicrophoneManager().shouldConnectOnInitialization()&&{[$b.MICROPHONE_CONNECT]:async()=>await this._api.getMicrophoneManager().connect()}})&&!this._api.getMessageManager().hasMessage()&&await this._initializer.initializeIfNecessary($b.VIEW,this._api.getViewManager().initialize)&&(this._everInitialized=!0,this._api.getCardElementManager().update())}uninitialize(e){this._initializer.uninitialize(e)}}class Ib{constructor(e,t,n,i){this.update=()=>{this._element.requestUpdate()},this._api=e,this._element=t,this._scrollCallback=n,this._menuToggleCallback=i}getElement(){return this._element}scrollReset(){this._scrollCallback()}toggleMenu(){this._menuToggleCallback()}hasUpdated(){return this._element.hasUpdated}elementConnected(){this._api.getInteractionManager().initialize(),this._api.getFullscreenManager().initialize(),this._api.getExpandManager().initialize(),this._api.getMediaLoadedInfoManager().initialize(),this._api.getMicrophoneManager().initialize(),this._api.getKeyboardStateManager().initialize(),this._api.getDefaultManager().initialize(),this._api.getMediaPlayerManager().initialize(),this._api.getHASSManager().getStateWatcher()?.subscribe(this.update,[...this._api.getConfigManager().getConfig()?.view.render_entities??[],...this._api.getMediaPlayerManager().getMediaPlayers()??[]]),af(this._element,(e=>{const t=e.getRootNode();return!!(t&&t instanceof ShadowRoot&&"HUI-PANEL-VIEW"===t.host.tagName)})(this._element),"panel"),af(this._element,fb(),"casted"),this._api.getFullscreenManager().connect(),this._element.addEventListener("mousemove",this._api.getInteractionManager().reportInteraction),this._element.addEventListener("wheel",this._api.getInteractionManager().reportInteraction),this._element.addEventListener("ll-custom",this._api.getActionsManager().handleCustomActionEvent),this._element.addEventListener("action",this._api.getActionsManager().handleInteractionEvent),this._element.addEventListener("action",this._api.getInteractionManager().reportInteraction),this._element.addEventListener("frigate-card:action:execution-request",this._api.getActionsManager().handleActionExecutionRequestEvent),window.addEventListener("location-changed",this._api.getQueryStringManager().requestExecution),window.addEventListener("popstate",this._api.getQueryStringManager().requestExecution),this._api.getQueryStringManager().requestExecution(),this._element.requestUpdate()}elementDisconnected(){af(this._element,!1,"panel"),af(this._element,!1,"tabindex"),af(this._element,!1,"casted"),this._api.getMediaLoadedInfoManager().clear(),this._api.getFullscreenManager().disconnect(),this._api.getKeyboardStateManager().uninitialize(),this._api.getActionsManager().uninitialize(),this._api.getDefaultManager().uninitialize(),this._api.getHASSManager().getStateWatcher()?.unsubscribe(this.update),this._api.getInitializationManager().uninitialize($b.CAMERAS),this._api.getCameraManager().reset(),this._element.removeEventListener("mousemove",this._api.getInteractionManager().reportInteraction),this._element.removeEventListener("wheel",this._api.getInteractionManager().reportInteraction),this._element.removeEventListener("ll-custom",this._api.getActionsManager().handleCustomActionEvent),this._element.removeEventListener("action",this._api.getActionsManager().handleInteractionEvent),this._element.removeEventListener("action",this._api.getInteractionManager().reportInteraction),this._element.removeEventListener("frigate-card:action:execution-request",this._api.getActionsManager().handleActionExecutionRequestEvent),window.removeEventListener("location-changed",this._api.getQueryStringManager().requestExecution),window.removeEventListener("popstate",this._api.getQueryStringManager().requestExecution)}}function zb(e,t,n){return null==e?e:function(e,t,n,i){if(!dh(e))return e;for(var a=-1,r=(t=ry(t,e)).length,s=r-1,o=e;null!=o&&++a{zb(e,t,n)},Ob=(e,t,n)=>gy(e,t,n),Db=(e,t)=>{!function(e,t){null==e||Tb(e,t)}(e,t)},Rb=e=>l_(e),Pb=(e,t)=>e.replace("#",`[${t.toString()}]`),Lb=function(e){let t=!1;for(let n=0;n{const a=Ob(e,t);if(void 0===a)return!1;const r=i?.transform?i.transform(a):a;return!(t===n&&jy(a,r)||(null===r?i?.keepOriginal||(Db(e,t),0):void 0===r||(i?.keepOriginal||Db(e,t),jb(e,n,r),0)))})(i,e,t,n)}},Vb=function(e,t,n){return function(i){let a=Fb(e,t,n)(i);return a=qb(yo,Fb(e,t,n),(e=>e.overrides))(i)||a,a}},Hb=function(e,t){return Vb(e,e,{transform:t})},Bb=function(e){return Vb(e,e,{transform:e=>null})},qb=function(e,t,n){return function(i){let a=!1;const r=Ob(i,e);return Array.isArray(r)&&r.forEach((e=>{const i=n?n(e):e;i&&"object"==typeof i&&(a=t(i)||a)})),a}},Ub=(e,t)=>{const n=i=>{let a=!1;if(i&&"object"==typeof i){const r=t?t(i):i;r&&(a=e(r)||a),Array.isArray(i)?i.forEach((e=>{a=n(e)||a})):Object.keys(i).forEach((e=>{a=n(i[e])||a}))}return a};return n},Wb=e=>!("object"!=typeof e||!e||void 0===e.mediaLoaded)&&(e.media_loaded=e.mediaLoaded,delete e.mediaLoaded,!0),Zb=e=>{if("object"!=typeof e||!e||"object"!=typeof e.conditions||!e.conditions)return!1;const t=e.conditions,n=[];if(void 0!==t.view&&n.push({condition:"view",views:t.view}),void 0!==t.fullscreen&&n.push({condition:"fullscreen",fullscreen:t.fullscreen}),void 0!==t.expand&&n.push({condition:"expand",expand:t.expand}),void 0!==t.camera&&n.push({condition:"camera",cameras:t.camera}),void 0!==t.media_loaded&&n.push({condition:"media_loaded",media_loaded:t.media_loaded}),void 0!==t.state&&Array.isArray(t.state))for(const e of t.state)"object"!=typeof e||!e||void 0===e.state&&void 0===e.state_not&&void 0===e.entity||n.push({condition:"state",...e.state&&{state:e.state},...e.state_not&&{state_not:e.state_not},...e.entity&&{entity:e.entity}});return void 0!==t.media_query&&n.push({condition:"screen",media_query:t.media_query}),!!n.length&&(e.conditions=n,!0)},Qb=e=>!("object"!=typeof e||!e||"call-service"!==e.action||"string"!=typeof e.service)&&(e.action="perform-action",e.perform_action=e.service,delete e.service,!0),Gb=e=>!("object"!=typeof e||!e||"call-service"!==e.action||void 0===e.service||void 0===e.service_data||void 0!==e.data)&&(e.data=e.service_data,delete e.service_data,!0),Yb=e=>!("object"!=typeof e||!e||"custom:frigate-card-action"!==e.action||"frigate_ui"!==e.frigate_card_action)&&(e.frigate_card_action="camera_ui",!0),Kb=[qb(yo,Wb,(e=>e.conditions)),e=>Ub(Wb,(e=>e.conditions))("object"==typeof e&&e?e[Aa]:{}),Vb("event_gallery",ar),Vb("menu.buttons.frigate_ui",to),e=>Ub(Yb)("object"==typeof e&&e?e:{}),qb(wi,Hb("live_provider",(e=>"frigate-jsmpeg"===e?"jsmpeg":e))),Vb("live.jsmpeg",Ca),Vb("live.image",wa),Vb("live.webrtc_card",Ma),qb(wi,Vb("frigate.zone","frigate.zones",{transform:e=>qm(e)})),qb(wi,Vb("frigate.label","frigate.labels",{transform:e=>qm(e)})),e=>Ub(Gb)("object"==typeof e&&e?e:{}),function(e){if("object"!=typeof e||!e||!(Aa in e)||!Array.isArray(e[Aa]))return!1;let t=!1;const n=n=>{if(!t){if(!gy(e,"live.controls.ptz")){const{type:t,...i}=n;zb(e,"live.controls.ptz",i)}t=!0}},i=e=>{const t=[];for(const a of e)if("custom:frigate-card-ptz"===a.type)n(a);else if("conditional"!==a.type&&"custom:frigate-card-conditional"!==a.type||!Array.isArray(a.elements))t.push(a);else{const e=i(a.elements);e.length&&(a.elements=e,t.push(a))}return t},a=i(e[Aa]);return t&&(a.length?e[Aa]=a:delete e[Aa]),t},Vb("view.timeout_seconds",Oa),Hb("live.lazy_unload",(e=>"all"===e?["unselected","hidden"]:"never"===e?null:qm(e))),Hb("live.auto_play",(e=>"all"===e?null:"never"===e?[]:qm(e))),Hb("live.auto_pause",(e=>"all"===e?["unselected","hidden"]:"never"===e?null:qm(e))),Hb("live.auto_mute",(e=>"all"===e?null:"never"===e?[]:qm(e))),Hb("live.auto_unmute",(e=>"all"===e?["selected","visible","microphone"]:"never"===e?null:qm(e))),Hb("media_viewer.auto_play",(e=>"all"===e?null:"never"===e?[]:qm(e))),Hb("media_viewer.auto_pause",(e=>"all"===e?null:"never"===e?[]:qm(e))),Hb("media_viewer.auto_mute",(e=>"all"===e?null:"never"===e?[]:qm(e))),Hb("media_viewer.auto_unmute",(e=>"all"===e?["selected","visible"]:"never"===e?null:qm(e))),Vb("live.controls.thumbnails.media",ns),Vb("timeline.media",Ns),Vb("live.controls.timeline.media",ds),Vb("media_viewer.controls.timeline.media",Or),Vb("view.scan",Ya),Vb("view.triggers.enabled",tr,{transform:e=>!0===e?"live":null,keepOriginal:!0}),Vb("view.triggers.enabled",Xa,{transform:e=>!0!==e&&null}),Vb("view.triggers.untrigger_reset",nr,{transform:e=>e?"default":null}),Vb("live.layout",Ea),Bb("media_viewer.layout"),Bb("image.layout"),qb(yo,Zb),e=>Ub(Zb)("object"==typeof e&&e?e[Aa]:{}),e=>Ub(Zb)("object"==typeof e&&e?e.automations:{}),qb(wi,Vb("hide","capabilities",{transform:e=>!0===e?{disable_except:["substream"]}:null})),Vb("performance.profile",ko,{transform:e=>"low"===e?["low-performance"]:null}),qb(yo,Fb("overrides","merge")),Vb("live.controls.ptz",$a,{transform:e=>{if("object"!=typeof e||!e)return;const t=["data_left","data_right","data_up","data_down","data_zoom_in","data_zoom_out","service"],n=["actions_left","actions_right","actions_up","actions_down","actions_zoom_in","actions_zoom_out"],i=[...t,...n,"data_home","actions_home"];if(!Object.keys(e).some((e=>i.includes(e))))return;const a={};t.filter((t=>t in e)).reduce(((t,n)=>(t[n]=e[n],t)),a),n.filter((t=>t in e)).reduce(((t,n)=>("object"==typeof e[n]&&"tap_action"in e[n]&&(t[n]=e[n].tap_action),t)),a);const r=()=>{a.presets="presets"in e&&"object"==typeof e.presets&&e.presets?e.presets:{}};return"actions_home"in e&&"object"==typeof e.actions_home&&e.actions_home&&"tap_action"in e.actions_home?(r(),a.presets.home=e.actions_home.tap_action):"data_home"in e&&"object"==typeof e.data_home&&e.data_home&&"string"==typeof e.service&&(r(),a.presets.service=e.service,a.presets.data_home=e.data_home),a},keepOriginal:!0}),Hb("live.controls.ptz",(e=>{if("object"!=typeof e||!e)return e;const t=["mode","position","orientation","hide_pan_tilt","hide_zoom","hide_home","style"],n=Object.keys(e);return n.some((e=>!t.includes(e)))?n.filter((e=>t.includes(e))).reduce(((t,n)=>(t[n]=e[n],t)),{}):void 0})),Vb("view.update_cycle_camera",qa),Vb("view.update_force",Wa,{transform:e=>!0===e?"all":null}),Vb("view.update_seconds",Za),Vb("view.update_entities",Qa),Fb("live.controls.title",oo,{transform:e=>"object"==typeof e&&e&&"string"==typeof e.mode?"none"===e.mode?{style:"none"}:e.mode.includes("bottom")?{position:"bottom"}:e.mode.includes("top")?{position:"top"}:null:null}),Bb("live.controls.title"),Bb("media_viewer.controls.title"),e=>Ub(Qb)("object"==typeof e&&e?e:{}),Vb("dimensions.max_height",_o),Bb("dimensions.min_height")];class Xb extends $o{}class Jb extends Event{constructor(e,t){super("frigate-card:conditions:evaluate",t),this.conditions=e}}function ew(e,t,n){let i=Rb(t),a=!1;if(n?.configOverrides)for(const t of n.configOverrides)e.evaluateConditions(t.conditions,n?.stateOverrides)&&(t.delete?.forEach((e=>{Db(i,e)})),Object.keys(t.set??{}).forEach((e=>{jb(i,e,t.set?.[e])})),Object.keys(t.merge??{}).forEach((e=>{jb(i,e,Rv({},Ob(i,e),t.merge?.[e]))})),a=!0);if(!a)return t;if(n?.configOverrides?.some((e=>e.delete?.length))&&(i=df(i)),n?.schema){const e=n.schema.safeParse(i);if(!e.success)throw new Xb(N_("error.invalid_configuration_override"),[e.error.errors,i]);return e.data}return i}class tw{constructor(e,t){this._state={},this._epoch=this._createEpoch(),this._hasHAStateConditions=!1,this._mediaQueries=[],this._mediaQueryTrigger=()=>this._triggerChange(),this._api=e,this._listeners=[()=>this._api.getConfigManager().computeOverrideConfig(),()=>this._api.getAutomationsManager().execute(),...t?[t]:[]]}removeConditions(){this._mediaQueries.forEach((e=>e.removeEventListener("change",this._mediaQueryTrigger))),this._mediaQueries=[]}setConditionsFromConfig(){this.removeConditions();const e=(()=>{const e=this._api.getConfigManager().getConfig(),t=[];e?.overrides?.forEach((e=>t.push(...e.conditions))),e?.automations?.forEach((e=>t.push(...e.conditions)));const n=e=>{const i=fl.safeParse(e);i.success?(t.push(...i.data.conditions),i.data.elements?.forEach(n)):e&&"object"==typeof e&&Object.keys(e).forEach((t=>n(e[t])))};return e?.elements?.forEach(n),t})();this._hasHAStateConditions=e.some((e=>!e.condition||["state","numeric_state","user"].includes(e.condition))),e.forEach((e=>{if("screen"===e.condition){const t=window.matchMedia(e.media_query);t.addEventListener("change",this._mediaQueryTrigger),this._mediaQueries.push(t)}}))}setState(e){Object.keys(e).every((t=>jy(e[t],this._state[t])))||(this._state={...this._state,...e},this._triggerChange())}getState(){return this._state}hasHAStateConditions(){return this._hasHAStateConditions}getEpoch(){return this._epoch}evaluateConditions(e,t){return e.every((e=>this._evaluateCondition(e,t)))}_evaluateCondition(e,t){const n={...this._state,...t};switch(e.condition){case void 0:case"state":return!!n.state&&(!e.state&&!e.state_not||e.entity in n.state&&(!e.state||(Array.isArray(e.state)?e.state.includes(n.state[e.entity].state):e.state===n.state[e.entity].state))&&(!e.state_not||(Array.isArray(e.state_not)?!e.state_not.includes(n.state[e.entity].state):e.state_not!==n.state[e.entity].state)));case"view":return!!n?.view&&e.views.includes(n.view);case"fullscreen":return void 0!==n.fullscreen&&e.fullscreen===n.fullscreen;case"expand":return void 0!==n.expand&&e.expand===n.expand;case"camera":return!!n.camera&&e.cameras.includes(n.camera);case"numeric_state":return!!n.state&&e.entity in n.state&&void 0!==n.state[e.entity].state&&(void 0===e.above||Number(n.state[e.entity].state)>e.above)&&(void 0===e.below||Number(n.state[e.entity].state)n.triggered?.has(e)));case"interaction":return void 0!==n.interaction&&e.interaction===n.interaction;case"microphone":return!(void 0!==e.connected&&n.microphone?.connected!==e.connected||void 0!==e.muted&&n.microphone?.muted!==e.muted);case"key":return!(!n.keys||!(e.key in n.keys)||(e.state??"down")!==n.keys[e.key].state||void 0!==e.ctrl&&e.ctrl!==!!n.keys[e.key].ctrl||void 0!==e.alt&&e.alt!==!!n.keys[e.key].alt||void 0!==e.meta&&e.meta!==!!n.keys[e.key].meta||void 0!==e.shift&&e.shift!==!!n.keys[e.key].shift)}}_createEpoch(){return{manager:this}}_triggerChange(){this._epoch=this._createEpoch(),this._listeners.forEach((e=>e()))}}const nw={casting:{[Wr]:!1,[Mr]:!1,[Ks]:"none",[`${io}.enabled`]:!0,[`${ao}.enabled`]:!0,[`${no}.enabled`]:!1,[`${ro}.enabled`]:!1,[Ur]:["selected","visible"],[fo]:"static",[mo]:"16:9",[ka]:1,[Ss]:!0},"low-performance":{[is]:"none",[Er]:"none",[Hs]:"none",[ps]:!1,[Pr]:!1,[Fs]:!1,[qr]:[],[hr]:[],[pr]:[],[gr]:[],[xs]:["unselected","hidden"],[bs]:!1,[br]:!1,[Ms]:"none",[Cr]:"none",[Ss]:!1,[Sr]:"chevrons",[lo]:"none",[Ks]:"outside",[`${eo}.enabled`]:!1,[`${so}.enabled`]:!1,[`${so}.enabled`]:!1,[`${ro}.enabled`]:!1,[or]:!1,[cr]:!1,[lr]:!1,[sr]:!1,[ss]:!1,[os]:!1,[cs]:!1,[rs]:!1,[Ar]:!1,[Ir]:!1,[zr]:!1,[$r]:!1,[Us]:!1,[Ws]:!1,[Zs]:!1,[qs]:!1,[bo]:!1,[wo]:10,[So]:!1,[Mo]:!1,[xr]:!1,[Sa]:!1,[xa]:"image",[ka]:10,[tr]:"none",[xo]:1},scrubbing:{[us]:"below",[gs]:"ribbon",[hs]:"seek",[Dr]:"below",[Lr]:"ribbon",[Rr]:"seek"}},iw=(e,t,n)=>{const i=jo(Pd).safeParse(e);if(!i.success)return t;const a=i.data;for(const e of n??[])e in nw&&Object.entries(nw[e]).forEach((([e,n])=>{return r=n,void(void 0===Ob(a,i=e)&&jb(t,i,r));var i,r}));return t},aw=e=>{switch(e){case"ptz_left":return"left";case"ptz_right":return"right";case"ptz_up":return"up";case"ptz_down":return"down";case"ptz_zoom_in":return"zoom_in";case"ptz_zoom_out":return"zoom_out"} +/* istanbul ignore next: No (current) way to reach this code -- @preserve */return null},rw=(e,t)=>{if(!t.enabled)return[];const n=[];for(const i of["ptz_down","ptz_left","ptz_right","ptz_up","ptz_zoom_in","ptz_zoom_out"]){const a=t[i],r=aw(i);a&&r&&(n.push({conditions:[{condition:"key",key:a.key,state:"down",shift:a.shift,ctrl:a.ctrl,alt:a.alt,meta:a.meta}],actions:[ff({ptzAction:r,ptzPhase:"start"})],tag:e}),n.push({conditions:[{condition:"key",key:a.key,state:"up"}],actions:[ff({ptzAction:r,ptzPhase:"stop"})],tag:e}))}const i=t.ptz_home;return i&&n.push({conditions:[{condition:"key",key:i.key,state:"down",shift:i.shift,ctrl:i.ctrl,alt:i.alt,meta:i.meta}],actions:[ff()],tag:e}),n};class sw{constructor(e){this._config=null,this._overriddenConfig=null,this._rawConfig=null,this._cardWideConfig=null,this._api=e}hasConfig(){return!!this.getConfig()}getConfig(){return this._overriddenConfig??this._config}getCardWideConfig(){return this._cardWideConfig}getNonOverriddenConfig(){return this._config}getRawConfig(){return this._rawConfig}setConfig(e){if(!e)throw new Error(N_("error.invalid_configuration"));const t=Pd.safeParse(e);if(!t.success){const n=Nb(e),i=Do(t.error);let a="";throw n&&(a=`${N_("error.upgrade_available")}. `),new Error(a+`${N_("error.invalid_configuration")}: `+(i&&i.size?JSON.stringify([...i],null," "):N_("error.invalid_configuration_no_hint")))}const n=iw(e,t.data,t.data.profiles);var i;(this._rawConfig=e,jy(this._config,n))||(this._config=n,this._cardWideConfig={performance:n.performance,debug:n.debug},this._api.getConditionsManager().setConditionsFromConfig(),this._api.getConditionsManager().setState({view:void 0,displayMode:void 0,camera:void 0}),this._api.getMediaLoadedInfoManager().clear(),this._api.getInitializationManager().uninitialize($b.VIEW),this._api.getViewManager().reset(),this._api.getMessageManager().reset(),this._api.getStyleManager().setPerformance(),this._api.getStatusBarItemManager().removeAllDynamicStatusBarItems(),((e,t)=>{e.getAutomationsManager().deleteAutomations(t);const n=e.getConfigManager().getConfig()?.view.keyboard_shortcuts;if(!n)return;const i=rw(t,n);i.length&&e.getAutomationsManager().addAutomations(i)})(this._api,this),(i=this._api).getAutomationsManager().deleteAutomations(),i.getAutomationsManager().addAutomations(i.getConfigManager().getNonOverriddenConfig()?.automations??[]),this.computeOverrideConfig(),this._api.getCardElementManager().update())}computeOverrideConfig(){const e=this._api.getConditionsManager();if(!this._config)return;let t=null;try{t=ew(e,this._config,{configOverrides:this._config.overrides,schema:Pd})}catch(e){return void this._api.getMessageManager().setErrorIfHigherPriority(e)}if(jy(t,this._overriddenConfig))return;const n=this._overriddenConfig;this._overriddenConfig=t,this._api.getStyleManager().setMinMaxHeight(),!n||jy(n?.cameras,this._overriddenConfig?.cameras)&&jy(n?.cameras_global,this._overriddenConfig?.cameras_global)||this._api.getInitializationManager().uninitialize($b.CAMERAS),n&&n?.live.microphone.always_connected!==this._overriddenConfig?.live.microphone.always_connected&&this._api.getInitializationManager().uninitialize($b.MICROPHONE_CONNECT),this._initializeBackground(n)}async _initializeBackground(e){await this._api.getDefaultManager().initializeIfNecessary(e),await this._api.getMediaPlayerManager().initializeIfNecessary(e),this._api.getCardElementManager().update()}}class ow{constructor(e){this._timer=new bf,this._stateChangeHandler=()=>{this._setToDefaultIfAllowed()},this._api=e}async initializeIfNecessary(e){jy(e?.view.default_reset,this._api.getConfigManager().getConfig()?.view.default_reset)||await this.initialize()}async initialize(){this.uninitialize();const e=this._api.getConfigManager().getConfig()?.view.default_reset;e?.entities.length&&this._api.getHASSManager().getStateWatcher().subscribe(this._stateChangeHandler,e.entities);const t=this._api.getConfigManager().getConfig()?.view.default_reset.every_seconds;return t&&this._timer.startRepeated(t,(()=>this._setToDefaultIfAllowed())),this._api.getConfigManager().getConfig()?.view.default_reset.after_interaction&&this._api.getAutomationsManager().addAutomations([{actions:[pf("default")],conditions:[{condition:"interaction",interaction:!1}],tag:this}]),!0}uninitialize(){this._timer.stop(),this._api.getHASSManager().getStateWatcher().unsubscribe(this._stateChangeHandler),this._api.getAutomationsManager().deleteAutomations(this)}_setToDefaultIfAllowed(){this._isAutomatedUpdateAllowed()&&this._api.getViewManager().setViewDefault()}_isAutomatedUpdateAllowed(){const e=this._api.getConfigManager().getConfig()?.view.default_reset.interaction_mode;return!!e&&((e,t)=>{switch(e){case"all":return!0;case"active":return t;case"inactive":return!t}})(e,this._api.getInteractionManager().hasInteraction())}}const cw=(e,t="download")=>{const n=new URL(e).origin===window.location.origin,i=e.startsWith("data:");if(navigator.userAgent.startsWith("Home Assistant/")||navigator.userAgent.startsWith("HomeAssistant/")||!n&&!i)window.open(e,"_blank");else{const n=document.createElement("a");n.setAttribute("download",t),n.href=e,n.click(),n.remove()}},lw=async(e,t,n)=>{const i=await t.getMediaDownloadPath(n);if(!i)throw new $o(N_("error.download_no_media"));let a=i.endpoint;if(i.sign){let t;try{t=await _b(e,i.endpoint)}catch(e){Zm(e)}if(!t)throw new $o(N_("error.download_sign_failed"));a=t}cw(a)},dw=e=>{const t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;const n=t.getContext("2d");return n?(n.drawImage(e,0,0,t.width,t.height),t.toDataURL("image/jpeg")):null};class uw{constructor(e){this._api=e}async downloadViewerMedia(){const e=this._api.getViewManager().getView()?.queryResults?.getSelectedResult(),t=this._api.getHASSManager().getHASS();if(!e||!t)return!1;try{await lw(t,this._api.getCameraManager(),e)}catch(e){return this._api.getMessageManager().setErrorIfHigherPriority(e),!1}return!0}async downloadScreenshot(){const e=await(this._api.getMediaLoadedInfoManager().get()?.player?.getScreenshotURL());e&&cw(e,(e=>{if(e?.is("live")||e?.is("image"))return`${e.view}-${e.camera}-${qu(new Date,"yyyy-MM-dd-HH-mm-ss")}.jpg`;if(e?.isViewerView()){const t=e.queryResults?.getSelectedResult(),n=t?.getID()??null;return`${e.view}-${e.camera}${n?`-${n}`:""}.jpg`}return"screenshot.jpg"})(this._api.getViewManager().getView()))}}class hw{constructor(e){this._expanded=!1,this._api=e}initialize(){this._setConditionState()}isExpanded(){return this._expanded}toggleExpanded(){this.setExpanded(!this._expanded)}setExpanded(e){e&&this._api.getFullscreenManager().isInFullscreen()&&this._api.getFullscreenManager().stopFullscreen(),this._expanded=e,this._setConditionState(),this._api.getCardElementManager().update()}_setConditionState(){this._api.getConditionsManager()?.setState({expand:this._expanded})}}const pw=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],gw=(()=>{if("undefined"==typeof document)return!1;const e=pw[0],t={};for(const n of pw){const i=n?.[1];if(i in document){for(const[i,a]of n.entries())t[e[i]]=a;return t}}return!1})(),mw={change:gw.fullscreenchange,error:gw.fullscreenerror};let fw={request:(e=document.documentElement,t)=>new Promise(((n,i)=>{const a=()=>{fw.off("change",a),n()};fw.on("change",a);const r=e[gw.requestFullscreen](t);r instanceof Promise&&r.then(a).catch(i)})),exit:()=>new Promise(((e,t)=>{if(!fw.isFullscreen)return void e();const n=()=>{fw.off("change",n),e()};fw.on("change",n);const i=document[gw.exitFullscreen]();i instanceof Promise&&i.then(n).catch(t)})),toggle:(e,t)=>fw.isFullscreen?fw.exit():fw.request(e,t),onchange(e){fw.on("change",e)},onerror(e){fw.on("error",e)},on(e,t){const n=mw[e];n&&document.addEventListener(n,t,!1)},off(e,t){const n=mw[e];n&&document.removeEventListener(n,t,!1)},raw:gw};Object.defineProperties(fw,{isFullscreen:{get:()=>Boolean(document[gw.fullscreenElement])},element:{enumerable:!0,get:()=>document[gw.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[gw.fullscreenEnabled])}}),gw||(fw={isEnabled:!1});var _w=fw;class yw{constructor(e){this._fullscreenHandler=()=>{this._api.getExpandManager().setExpanded(!1),this._setConditionState(),this._api.getCardElementManager().update()},this._api=e}initialize(){this._setConditionState()}connect(){_w.isEnabled&&_w.on("change",this._fullscreenHandler)}disconnect(){_w.isEnabled&&_w.off("change",this._fullscreenHandler)}isInFullscreen(){return _w.isEnabled&&_w.isFullscreen}toggleFullscreen(){_w.toggle(this._api.getCardElementManager().getElement())}stopFullscreen(){_w.exit()}_setConditionState(){this._api.getConditionsManager()?.setState({fullscreen:this.isInFullscreen()})}}class vw{constructor(){this._watcherCallbacks=new Map}setHASS(e,t){if(e)for(const[n,i]of this._watcherCallbacks.entries()){const a=yb(t,e,i,{stateOnly:!0,firstOnly:!0});a.length&&n(a[0])}}subscribe(e,t){return!!t.length&&(this._watcherCallbacks.has(e)?this._watcherCallbacks.get(e)?.push(...t):this._watcherCallbacks.set(e,t),!0)}unsubscribe(e){this._watcherCallbacks.delete(e)}}class bw{constructor(e){this._hass=null,this._stateWatcher=new vw,this._api=e}getHASS(){return this._hass}hasHASS(){return!!this._hass}getStateWatcher(){return this._stateWatcher}setHASS(e){if(((e,t)=>e?.connected!==t?.connected)(this._hass,e)&&(e?.connected?this._api.getMessageManager().resetType("connection"):this._api.getMessageManager().setMessageIfHigherPriority({message:N_("error.reconnecting"),icon:"mdi:lan-disconnect",type:"connection",dotdotdot:!0})),!e)return;const t=this._hass;this._hass=e,this._api.getConditionsManager().hasHAStateConditions()&&this._api.getConditionsManager().setState({state:this._hass.states,user:this._hass.user}),this._api.getStyleManager().setLightOrDarkMode(),this._stateWatcher.setHASS(t,e)}}var ww=function(){return Ju.Date.now()},xw="Expected a function",Cw=Math.max,Mw=Math.min;function Sw(e,t,n){var i,a,r,s,o,c,l=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError(xw);function p(t){var n=i,r=a;return i=a=void 0,l=t,s=e.apply(r,n)}function g(e){var n=e-c;return void 0===c||n>=t||n<0||u&&e-l>=r}function m(){var e=ww();if(g(e))return f(e);o=setTimeout(m,function(e){var n=t-(e-c);return u?Mw(n,r-(e-l)):n}(e))}function f(e){return o=void 0,h&&i?p(e):(i=a=void 0,s)}function _(){var e=ww(),n=g(e);if(i=arguments,a=this,c=e,n){if(void 0===o)return function(e){return l=e,o=setTimeout(m,t),d?p(e):s}(c);if(u)return clearTimeout(o),o=setTimeout(m,t),p(c)}return void 0===o&&(o=setTimeout(m,t)),s}return t=wm(t)||0,dh(n)&&(d=!!n.leading,r=(u="maxWait"in n)?Cw(wm(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==o&&clearTimeout(o),l=0,i=c=a=o=void 0},_.flush=function(){return void 0===o?s:f(ww())},_}function kw(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return dh(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),Sw(e,t,{leading:i,maxWait:t,trailing:a})}class Ew{constructor(e){this._timer=new bf,this.reportInteraction=kw((()=>{this._reportInteraction()}),1e3),this._api=e}initialize(){this._api.getConditionsManager().setState({interaction:!1})}hasInteraction(){return this._timer.isRunning()}_reportInteraction(){this._timer.stop();const e=this._api.getConfigManager().getConfig()?.view.interaction_seconds;e&&(this._api.getConditionsManager().setState({interaction:!0}),this._timer.start(e,(()=>{this._api.getConditionsManager().setState({interaction:!1}),this._api.getStyleManager().setLightOrDarkMode()})))}}class $w{constructor(e){this._state={},this._handleKeydown=e=>{const t={state:"down",ctrl:e.ctrlKey,alt:e.altKey,meta:e.metaKey,shift:e.shiftKey};jy(this._state[e.key],t)||(this._state[e.key]=t,this._processStateChange())},this._handleKeyup=e=>{e.key in this._state&&"down"===this._state[e.key].state&&(this._state[e.key].state="up",this._processStateChange())},this._handleBlur=()=>{Object.keys(this._state).length&&(this._state={},this._processStateChange())},this._api=e}initialize(){const e=this._api.getCardElementManager().getElement();e.addEventListener("keydown",this._handleKeydown),e.addEventListener("keyup",this._handleKeyup),e.addEventListener("blur",this._handleBlur)}uninitialize(){const e=this._api.getCardElementManager().getElement();e.removeEventListener("keydown",this._handleKeydown),e.removeEventListener("keyup",this._handleKeyup),e.removeEventListener("blur",this._handleBlur)}_processStateChange(){this._api.getConditionsManager().setState({keys:this._state})}}function Aw(e,t){let n;return n=e instanceof Event?e.composedPath()[0]:e,n instanceof HTMLImageElement?{width:n.naturalWidth,height:n.naturalHeight,...t}:n instanceof HTMLVideoElement?{width:n.videoWidth,height:n.videoHeight,...t}:n instanceof HTMLCanvasElement?{width:n.width,height:n.height,player:t?.player,...t}:null}function Iw(e,t,n){const i=Aw(t,n);i&&zw(e,i)}function zw(e,t){Vm(e,"media:loaded",t)}function Tw(e){Vm(e,"media:unloaded")}function jw(e){Vm(e,"media:volumechange")}function Ow(e){Vm(e,"media:play")}function Dw(e){Vm(e,"media:pause")}class Rw{constructor(e){this._current=null,this._lastKnown=null,this._api=e}initialize(){this.clear()}set(e){var t;(t=e).height>=50&&t.width>=50&&(V_(this._api.getConfigManager().getCardWideConfig(),"Frigate Card media load: ",e),this._current=e,this._lastKnown=e,this._api.getConditionsManager().setState({media_loaded:!0}),this._api.getStyleManager().setExpandedMode(),this._api.getCardElementManager().update())}get(){return this._current}getLastKnown(){return this._lastKnown}clear(){this._current=null,this._api.getConditionsManager().setState({media_loaded:!1})}has(){return!!this._current}}class Pw{static isEvent(e){return this.isClip(e)||this.isSnapshot(e)}static isRecording(e){return"recording"===e.getMediaType()}static isClip(e){return"clip"===e.getMediaType()}static isSnapshot(e){return"snapshot"===e.getMediaType()}static isVideo(e){return this.isClip(e)||this.isRecording(e)}}class Lw{constructor(e){this._mediaPlayers=[],this._api=e}getMediaPlayers(){return this._mediaPlayers}hasMediaPlayers(){return this._mediaPlayers.length>0}async initializeIfNecessary(e){e?.menu.buttons.media_player.enabled!==this._api.getConfigManager().getConfig()?.menu.buttons.media_player.enabled&&await this.initialize()}async initialize(){const e=this._api.getHASSManager().getHASS();if(!e||!this._api.getConfigManager().getConfig()?.menu.buttons.media_player.enabled)return!1;const t=Object.keys(e.states).filter((t=>{if(t.startsWith("media_player.")){const n=e.states[t];if(n&&"unavailable"!==n.state&&kb(n,131072))return!0}return!1}));let n=null;try{n=await this._api.getEntityRegistryManager().getEntities(e,t)}catch(e){Zm(e)}return this._mediaPlayers=t.filter((e=>{const t=n?.get(e);return!t||!t.hidden_by})),!0}async stop(e){const t=this._api.getHASSManager().getHASS(),n=t?.states[e];if(!n)return;let i;if(kb(n,4096))i="media_stop";else{if(!kb(n,256))return;i="turn_off"}await t.callService("media_player",i,{entity_id:e})}async playLive(e,t){const n=this._api.getCameraManager().getStore().getCameraConfig(t);n&&("dashboard"===n.cast?.method?await this._playLiveDashboard(e,n):await this._playLiveStandard(e,t,n))}async _playLiveStandard(e,t,n){const i=this._api.getHASSManager().getHASS(),a=n?.camera_entity??null;if(!i||!a)return;const r=this._api.getCameraManager().getCameraMetadata(t)?.title??null,s=i.states[a]?.attributes?.entity_picture??null;await i.callService("media_player","play_media",{entity_id:e,media_content_id:`media-source://camera/${a}`,media_content_type:"application/vnd.apple.mpegurl",extra:{...r&&{title:r},...s&&{thumb:s}}})}async _playLiveDashboard(e,t){const n=this._api.getHASSManager().getHASS();if(!n)return;const i=t.cast?.dashboard;i?.dashboard_path&&i?.view_path?await n.callService("cast","show_lovelace_view",{entity_id:e,dashboard_path:i.dashboard_path,view_path:i.view_path}):this._api.getMessageManager().setMessageIfHigherPriority({type:"error",icon:"mdi:cast",message:N_("error.no_dashboard_or_view")})}async playMedia(e,t){const n=this._api.getHASSManager().getHASS();if(!n||!t)return;const i=t.getTitle(),a=t.getThumbnail();await n.callService("media_player","play_media",{entity_id:e,media_content_id:t.getContentID(),media_content_type:Pw.isVideo(t)?"video":"image",extra:{...i&&{title:i},...a&&{thumb:a}}})}}class Nw{constructor(e){this._message=null,this._api=e}getMessage(){return this._message}hasMessage(){return!!this._message}hasErrorMessage(){return"error"===this._message?.type}reset(){const e=this.hasMessage();this._message=null,e&&this._api.getCardElementManager().update()}resetType(e){this._message?.type===e&&this.reset()}setErrorIfHigherPriority(e,t){e&&"object"==typeof e&&"message"in e&&(Zm(e),this.setMessageIfHigherPriority({message:t?`${t}: ${e.message}`:e.message,type:"error",...e instanceof $o&&{context:e.context}}))}setMessageIfHigherPriority(e){const t=this._message?Ao[this._message.type]:0,n=Ao[e.type];return!(this._message&&ne.stop())),this._stream=void 0,this._setConditionState(),this._api.getCardElementManager().update()}getStream(){return this._stream??void 0}mute(){const e=this.isMuted();this._mute=!0,this._setMute(),this._setConditionState(),e||this._callListeners("muted")}async unmute(){if(!this.isSupported())return;const e=!this.isMuted(),t=()=>{this._mute=!1,this._setMute()};this.isConnected()||this.isForbidden()?this.isConnected()&&t():(t(),await this.connect()),this._setConditionState(),e||this._callListeners("unmuted")}isConnected(){return!!this._stream}isForbidden(){return null===this._stream}isMuted(){return!this._stream||this._stream.getTracks().every((e=>!e.enabled))}addListener(e){this._listeners.push(e)}removeListener(e){this._listeners=this._listeners.filter((t=>t!==e))}_callListeners(e){this._listeners.forEach((t=>t(e)))}_setMute(){this._stream?.getTracks().forEach((e=>{e.enabled=!this._mute})),this._startTimer(),this._api.getCardElementManager().update()}_startTimer(){const e=this._api.getConfigManager().getConfig()?.live.microphone;if(e?.always_connected)return;const t=e?.disconnect_seconds??0;t&&this._timer.start(t,(()=>{this.disconnect()}))}_setConditionState(){this._api.getConditionsManager().setState({microphone:{muted:this.isMuted(),connected:this.isConnected()}})}}class Vw{constructor(e){this._shouldRun=!0,this.requestExecution=()=>{this._shouldRun=!0,this._api.getCardElementManager().update()},this.executeIfNecessary=async()=>{this._shouldRun&&(this._shouldRun=!1,await this._executeViewRelated(this._calculateIntent()),await this._executeNonViewRelated(this._calculateIntent()))},this._isViewAction=e=>{switch(e.frigate_card_action){case"clip":case"clips":case"diagnostics":case"image":case"live":case"recording":case"recordings":case"snapshot":case"snapshots":case"timeline":return!0}return!1},this._api=e}hasViewRelatedActionsToRun(){return!!this._calculateIntent().view&&this._shouldRun}async _executeViewRelated(e){e.view&&(e.view.default?await this._api.getViewManager().setViewDefaultWithNewQuery({params:{camera:e.view.camera},...e.view.substream&&{modifiers:[new rb(e.view.substream)]}}):await this._api.getViewManager().setViewByParametersWithNewQuery({params:{...e.view.view&&{view:e.view.view},...e.view.camera&&{camera:e.view.camera}},...e.view.substream&&{modifiers:[new rb(e.view.substream)]}}))}async _executeNonViewRelated(e){e.other&&await this._api.getActionsManager().executeActions(e.other)}_calculateIntent(){const e={};for(const t of this._getActions())this._isViewAction(t)?((e.view??={}).view=t.frigate_card_action,(e.view??={}).default=void 0):"default"===t.frigate_card_action?((e.view??={}).default=!0,(e.view??={}).view=void 0):"camera_select"===t.frigate_card_action?(e.view??={}).camera=t.camera:"live_substream_select"===t.frigate_card_action?(e.view??={}).substream=t.camera:(e.other??=[]).push(t);return e}_getActions(){const e=new URLSearchParams(window.location.search),t=[],n=new RegExp(/^frigate-card-action([.:](?\w+))?[.:](?\w+)/);for(const[i,a]of e.entries()){const e=i.match(n);if(!e||!e.groups)continue;const r=e.groups.cardID,s=e.groups.action;let o=null;switch(s){case"camera_select":case"live_substream_select":a&&(o=gf(s,a,{cardID:r}));break;case"camera_ui":case"clip":case"clips":case"default":case"diagnostics":case"download":case"expand":case"image":case"live":case"menu_toggle":case"recording":case"recordings":case"snapshot":case"snapshots":case"timeline":o=pf(s,{cardID:r});break;default:console.warn(`Frigate card received unknown card action in query string: ${s}`)}o&&t.push(o)}return t}}class Hw{constructor(e){this._items=[],this._dynamicItems=[],this._api=e}addDynamicStatusBarItem(e){this._dynamicItems.includes(e)||this._dynamicItems.push(e),this._api.getCardElementManager().update()}removeDynamicStatusBarItem(e){this._dynamicItems=this._dynamicItems.filter((t=>!jy(t,e))),this._api.getCardElementManager().update()}removeAllDynamicStatusBarItems(){this._dynamicItems=[],this._api.getCardElementManager().update()}calculateItems(e){const t=e?.view?e?.cameraManager?.getCameraMetadata(e?.view?.camera):null,n=t?.engineIcon??null,i=e?.view?.is("live")?t?.title??null:e?.view?.isViewerView()?e?.view.queryResults?.getSelectedResult()?.getTitle()??null:null,a=e?.mediaLoadedInfo?this._calculateResolution(e?.mediaLoadedInfo):null,r=e?.mediaLoadedInfo?.technology?.length?e?.mediaLoadedInfo.technology[0]:null;return[...i?[{type:"custom:frigate-card-status-bar-string",string:i,expand:!0,sufficient:!0,...e?.statusConfig?.items.title}]:[],...a?[{type:"custom:frigate-card-status-bar-string",string:a,...e?.statusConfig?.items.resolution}]:[],...r&&"webrtc"===r?[{type:"custom:frigate-card-status-bar-icon",icon:"mdi:webrtc",...e?.statusConfig?.items.technology}]:r?[{type:"custom:frigate-card-status-bar-string",string:r.toUpperCase(),...e?.statusConfig?.items.technology}]:[],...n?[{type:"custom:frigate-card-status-bar-icon",icon:n,...e?.statusConfig?.items.engine}]:[],...this._dynamicItems]}_matchesWidthHeight(e,t,n){const i=.99*t,a=1.01*t,r=.99*n,s=1.01*n,o=(e,t,n)=>e>=t&&e<=n;return!!e&&(o(e.width,i,a)&&o(e.height,r,s)||o(e.height,i,a)&&o(e.width,r,s))}_calculateResolution(e){return this._matchesWidthHeight(e,1920,1080)?"1080p":this._matchesWidthHeight(e,1280,720)?"720p":this._matchesWidthHeight(e,640,480)?"VGA":this._matchesWidthHeight(e,3840,2160)?"4K":this._matchesWidthHeight(e,720,480)?"480p":this._matchesWidthHeight(e,720,576)?"576p":this._matchesWidthHeight(e,7680,4320)?"8K":`${e.width}x${e.height}`}}class Bw{constructor(e){this.setLightOrDarkMode=()=>{const e=this._api.getConfigManager().getConfig(),t="on"===e?.view.dark_mode||"auto"===e?.view.dark_mode&&(!this._api.getInteractionManager().hasInteraction()||!!this._api.getHASSManager().getHASS()?.themes.darkMode);af(this._api.getCardElementManager().getElement(),t,"dark")},this._api=e}setExpandedMode(){const e=this._api.getCardElementManager().getElement(),t=this._api.getViewManager().getView(),n=this._api.getMediaLoadedInfoManager().getLastKnown();e.style.setProperty("--frigate-card-expand-aspect-ratio",t?.isAnyMediaView()&&n?`${n.width} / ${n.height}`:"unset");const i=t?.isGrid();e.style.setProperty("--frigate-card-expand-width",!i&&t?.isAnyMediaView()?"none":"var(--frigate-card-expand-max-width)"),e.style.setProperty("--frigate-card-expand-height",!i&&t?.isAnyMediaView()?"none":"var(--frigate-card-expand-max-height)")}setMinMaxHeight(){const e=this._api.getConfigManager().getConfig();if(e){this._api.getCardElementManager().getElement().style.setProperty("--frigate-card-height",e.dimensions.height)}}setPerformance(){const e={box_shadow:"none",border_radius:"0px"},t=this._api.getCardElementManager().getElement(),n=this._api.getConfigManager().getCardWideConfig()?.performance,i=n?.style??{};for(const n of Object.keys(i)){const a=`--frigate-card-css-${n.replaceAll("_","-")}`;!1===i[n]?t.style.setProperty(a,e[n]):t.style.removeProperty(a)}}_isAspectRatioEnforced(e,t){const n=e.dimensions.aspect_ratio_mode;return!(this._api.getFullscreenManager().isInFullscreen()||this._api.getExpandManager().isExpanded()||"unconstrained"===n||"dynamic"===n&&(!t||t?.isAnyMediaView()||t?.is("timeline")||t?.is("diagnostics")))}getAspectRatioStyle(){const e=this._api.getConfigManager().getConfig(),t=this._api.getViewManager().getView();if(e){if(!this._isAspectRatioEnforced(e,t))return lf();const n=e.dimensions.aspect_ratio_mode,i=this._api.getMediaLoadedInfoManager().getLastKnown();return lf(i&&"dynamic"===n?{ratio:[i.width,i.height]}:{ratio:e.dimensions.aspect_ratio})}return lf({defaultStatic:!0})}}class qw{constructor(e){this._triggeredCameras=new Map,this._triggeredCameraTimers=new Map,this._throttledTriggerAction=kw(this._triggerAction.bind(this),1e3,{trailing:!0}),this._api=e}getTriggeredCameraIDs(){return new Set(this._triggeredCameras.keys())}isTriggered(){return!!this._triggeredCameras.size}getMostRecentlyTriggeredCameraID(){const e=Sy([...this._triggeredCameras.entries()],(e=>e[1].getTime()),"desc");return e.length?e[0][0]:null}async handleCameraEvent(e){const t=this._api.getConfigManager().getConfig()?.view.triggers,n=this._api.getViewManager().getView()?.camera;if(!t||!n)return;const i=this._api.getCameraManager().getStore().getAllDependentCameras(n);t.filter_selected_camera&&!i.has(e.cameraID)||("end"!==e.type?(this._triggeredCameras.set(e.cameraID,new Date),this._setConditionStateIfNecessary(),await this._throttledTriggerAction(e)):this._startUntriggerTimer(e.cameraID))}_hasAllowableInteractionStateForAction(){const e=this._api.getConfigManager().getConfig()?.view.triggers,t=this._api.getInteractionManager().hasInteraction();return!!e&&("all"===e.actions.interaction_mode||"active"===e.actions.interaction_mode&&t||"inactive"===e.actions.interaction_mode&&!t)}async _triggerAction(e){const t=this._api.getConfigManager().getConfig()?.view.triggers.actions.trigger,n=this._api.getConfigManager().getConfig()?.view.default;("high"!==e.fidelity||e.snapshot||e.clip||"live"===t||"default"===t&&"live"===n)&&(this._hasAllowableInteractionStateForAction()&&("update"===t?await this._api.getViewManager().setViewByParametersWithNewQuery({queryExecutorOptions:{useCache:!1}}):"live"===t?await this._api.getViewManager().setViewByParametersWithNewQuery({params:{view:"live",camera:e.cameraID}}):"default"===t?await this._api.getViewManager().setViewDefaultWithNewQuery({params:{camera:e.cameraID}}):"high"===e.fidelity&&"media"===t&&await this._api.getViewManager().setViewByParametersWithNewQuery({params:{view:e.clip?"clip":"snapshot",camera:e.cameraID}})),this._api.getCardElementManager().update())}_setConditionStateIfNecessary(){const e=new Set(this._triggeredCameras.keys()),t=e.size?e:void 0;jy(t,this._api.getConditionsManager().getState().triggered)||this._api.getConditionsManager().setState({triggered:t})}async _untriggerAction(e){const t=this._api.getConfigManager().getConfig()?.view.triggers.actions.untrigger;"default"===t&&this._hasAllowableInteractionStateForAction()&&await this._api.getViewManager().setViewDefaultWithNewQuery(),this._triggeredCameras.delete(e),this._deleteTimer(e),this._setConditionStateIfNecessary(),this._api.getCardElementManager().update()}_startUntriggerTimer(e){this._deleteTimer(e);const t=new bf;this._triggeredCameraTimers.set(e,t),t.start( +/* istanbul ignore next: the case of config being null here cannot be + reached, as there's no way to have the untrigger call happen without + a config. -- @preserve */ +this._api.getConfigManager().getConfig()?.view.triggers.untrigger_seconds??0,(async()=>{await this._untriggerAction(e)}))}_deleteTimer(e){this._triggeredCameraTimers.get(e)?.stop(),this._triggeredCameraTimers.delete(e)}}function Uw(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Fm(e,void 0,t):[]}class Ww{constructor(e){this._queries=null,e&&(this._queries=e)}clone(){return l_(this)}getQueries(){return this._queries}setQueries(e){return this._queries=e,this}getQueryCameraIDs(){if(!this._queries)return null;const e=new Set;return this._queries.forEach((t=>[...t.cameraIDs].forEach((t=>e.add(t))))),e}setQueryCameraIDs(e){if(!this._queries)return this;const t=[];return this._queries.forEach((n=>t.push({...n,cameraIDs:Um(e)}))),this._queries=Uw(t,jy),this}hasQueriesForCameraIDs(e){for(const t of e)if(!this._queries?.some((e=>e.cameraIDs.has(t))))return!1;return!0}}class Zw extends Ww{convertToClipsQueries(){for(const e of this._queries??[])delete e.hasSnapshot,e.hasClip=!0;return this}}class Qw extends Ww{}class Gw{static areEventQueries(e){return e instanceof Zw}static areRecordingQueries(e){return e instanceof Qw}static areClipsQueries(e){return this.areEventQueries(e)&&!!e?.getQueries()?.every((e=>e.hasClip))}static areSnapshotQueries(e){return this.areEventQueries(e)&&!!e?.getQueries()?.every((e=>e.hasSnapshot))}static getQueriesType(e){return this.areEventQueries(e)?"event":this.areRecordingQueries(e)?"recording":null}static getMediaType(e){return this.areClipsQueries(e)?"clips":this.areSnapshotQueries(e)?"snapshots":this.areRecordingQueries(e)?"recordings":null}}const Yw=(e,t,n)=>{const i={anyCapabilities:["clips","snapshots","recordings"]};switch(t){case"image":case"diagnostics":return e.getStore().getCameraIDs();case"live":case"clip":case"clips":case"snapshot":case"snapshots":case"recording":case"recordings":const a="clip"===t?"clips":"snapshot"===t?"snapshots":"recording"===t?"recordings":t;return n?e.getStore().getAllDependentCameras(n,a):e.getStore().getCameraIDsWithCapability(a);case"timeline":return e.getStore().getCameraIDsWithCapability(i);case"media":return n?e.getStore().getAllDependentCameras(n,i):e.getStore().getCameraIDsWithCapability(i)}},Kw=(e,t)=>Rv({},e,t);class Xw{constructor(e){this.view=e.view,this.camera=e.camera,this.query=e.query??null,this.queryResults=e.queryResults??null,this.context=e.context??null,this.displayMode=e.displayMode??null}clone(){return new Xw({view:this.view,camera:this.camera,query:this.query?.clone()??null,queryResults:this.queryResults?.clone()??null,context:this.context,displayMode:this.displayMode})}evolve(e){return new Xw({view:void 0!==e.view?e.view:this.view,camera:void 0!==e.camera?e.camera:this.camera,query:void 0!==e.query?e.query:this.query?.clone()??null,queryResults:void 0!==e.queryResults?e.queryResults:this.queryResults?.clone()??null,context:void 0!==e.context?e.context:this.context,displayMode:void 0!==e.displayMode?e.displayMode:this.displayMode})}mergeInContext(e){return this.context=Kw(this.context,e),this}removeContext(e){return this.context&&delete this.context[e],this}removeContextProperty(e,t){const n=this.context?.[e];return n&&delete n[t],this}is(e){return this.view==e}isGalleryView(){return["clips","snapshots","recordings"].includes(this.view)}isAnyMediaView(){return this.isViewerView()||this.is("live")||this.is("image")}isViewerView(){return["media","clip","snapshot","recording"].includes(this.view)}supportsMultipleDisplayModes(){return this.isViewerView()||this.is("live")}getDefaultMediaType(){return["clip","clips"].includes(this.view)?"clips":["snapshot","snapshots"].includes(this.view)?"snapshots":["recording","recordings"].includes(this.view)?"recordings":null}isGrid(){return"grid"===this.displayMode}}const Jw=(e,t)=>{t?.forEach((t=>t.modify(e)))};class ex extends $o{}class tx extends $o{}class nx{constructor(e){this._api=e}getViewDefault(e){const t=this._api.getConfigManager().getConfig();if(!t)return null;let n=null;const i=e?.params?.view??t.view.default;if(e?.params?.camera)n=e.params.camera;else{const a=[...Yw(this._api.getCameraManager(),i)];if(!a.length)return null;if(e?.baseView?.camera&&t.view.default_cycle_camera){const t=a.indexOf(e.baseView.camera);n=a[t+1>=a.length?0:t+1]}else n=a[0]}return this.getViewByParameters({params:{...e?.params,view:i,camera:n},baseView:e?.baseView})}getViewByParameters(e){const t=this._api.getConfigManager().getConfig();if(!t)return null;let n=e?.params?.camera??e?.baseView?.camera??null,i=e?.params?.view??e?.baseView?.view??t.view.default;const a=this._api.getCameraManager().getStore().getCameraIDs();if(!n||!a.has(n)){n=Yw(this._api.getCameraManager(),i).keys().next().value??null}if(!n){const e=[...this._api.getCameraManager().getStore().getCameras()].reduce(((e,[t,n])=>{const i=n.getCapabilities()?.getRawCapabilities();return i&&(e[t]=i),e}),{});throw new ex(N_("error.no_supported_cameras"),{view:i,cameras_capabilities:e})}if(!this.isViewSupportedByCamera(n,i)){if(!e?.failSafe||!this.isViewSupportedByCamera(n,Wo)){const e=this._api.getCameraManager().getStore().getCamera(n)?.getCapabilities()?.getRawCapabilities();throw new tx(N_("error.no_supported_camera"),{view:i,camera:n,...e&&{camera_capabilities:e}})}i=Wo}const r=e?.params?.displayMode??e?.baseView?.displayMode??this._getDefaultDisplayModeForView(i,t),s={...e?.params,view:i,camera:n,displayMode:r},o=e?.baseView?e.baseView.evolve(s):new Xw(s);return Jw(o,e?.modifiers),o}isViewSupportedByCamera(e,t){return!!Yw(this._api.getCameraManager(),t,e).size}_getDefaultDisplayModeForView(e,t){let n=null;switch(e){case"media":case"clip":case"recording":case"snapshot":n=t.media_viewer.display?.mode??null;break;case"live":n=t.live.display?.mode??null}return n??"single"}}class ix{constructor(e,t){this._key=e,this._property=t}modify(e){e.removeContextProperty(this._key,this._property)}}class ax{constructor(e){this._query=e?.query,this._queryResults=e?.queryResults}modify(e){void 0!==this._query&&(e.query=this._query),void 0!==this._queryResults&&(e.queryResults=this._queryResults)}}const rx=(e,t,n)=>{let i;for(const[a,r]of e.entries()){const e=r.getStartTime(),s=r.getUsableEndTime();if(r.includesTime(t)&&e&&s){const t=s.getTime()-e.getTime();(!i||n&&i.cameraID!==n&&r.getCameraID()===n||t>i.duration&&(!n||i.cameraID!==n||r.getCameraID()===n))&&(i={index:a,duration:t,cameraID:r.getCameraID()})}}return i?i.index:null};class sx{constructor(e){this._results=e?.results??[],this._selectedIndex=this._getInitialSelectedIndex(e)}_getInitialSelectedIndex(e){return null!=e?.selectedIndex?e.selectedIndex:e?.results&&e.results.length?e?.selectApproach&&"last"!==e?.selectApproach?0:e.results.length-1:null}clone(){return new sx({results:this._results,selectedIndex:this._selectedIndex})}getResults(){return this._results}getSelectedIndex(){return this._selectedIndex}getResultsCount(){return this.getResults().length}hasResults(){return 0!==this.getResultsCount()}getResult(e){return void 0===e?null:this._results[e]}getSelectedResult(){const e=this.getSelectedIndex();return null!==e?this.getResult(e):null}hasSelectedResult(){return null!==this.getSelectedResult()}resetSelectedResult(){this._selectedIndex=null}selectIndex(e){(null===e||e>=0&&ee.getID()))),n=new Set(e._main.getResults()?.map((e=>e.getID())));return!(!t.size||!n.size||t.has(null)||n.has(null))&&((e,t)=>{for(const n of t)if(!e.has(n))return!1;return!0})(t,n)}getCameraIDs(){return new Set(this._cameras.keys())}getSlice(e){return e?this._cameras.get(e)??null:this._main}getResults(e){return this.getSlice(e)?.getResults()??null}getResultsCount(e){return this.getSlice(e)?.getResultsCount()??0}hasResults(e){return 0!==this.getSlice(e)?.getResultsCount()}getResult(e,t){return this.getSlice(t)?.getResult(e)??null}getSelectedIndex(e){return this.getSlice(e)?.getSelectedIndex()??null}getSelectedResult(e){return this.getSlice(e)?.getSelectedResult()??null}getMultipleSelectedResults(e){const t=[];if(!e||e.main){const e=this.getSelectedResult();e&&t.push(e)}const n=this._getCameraIDsFromCriteria(e);for(const e of n??[]){const n=this.getSelectedResult(e);n&&t.push(n)}return t}hasSelectedResult(e){return this.getSlice(e)?.hasSelectedResult()??!1}resetSelectedResult(e){return this.getSlice(e)?.resetSelectedResult(),this}getResultsTimestamp(){return this._resultsTimestamp}selectIndex(e,t){return this.getSlice(t)?.selectIndex(e),t||this.demoteMainSelectionToCameraSelection(),this}demoteMainSelectionToCameraSelection(){const e=this.getSelectedResult();if(e){const t=e.getCameraID();this.resetSelectedResult(t),this.selectResultIfFound((t=>t===e),{cameraID:t})}return this}promoteCameraSelectionToMainSelection(e){const t=this.getSelectedResult(e);return this.resetSelectedResult(),this.selectResultIfFound((e=>e===t)),this}_getCameraIDsFromCriteria(e){return e?.allCameras?this.getCameraIDs():e?.cameraID?new Set([e.cameraID]):null}selectResultIfFound(e,t){t&&!t?.main||(this._main.selectResultIfFound(e),this.demoteMainSelectionToCameraSelection());const n=this._getCameraIDsFromCriteria(t);for(const t of n??[])this.getSlice(t)?.selectResultIfFound(e);return this}selectBestResult(e,t){t&&!t.main||(this._main.selectBestResult(e),this.demoteMainSelectionToCameraSelection());const n=this._getCameraIDsFromCriteria(t);for(const t of n??[])this.getSlice(t)?.selectBestResult(e);return this}}class cx{constructor(e){this._api=e}async executeDefaultEventQuery(e){const t=e?.eventsMediaType&&"all"!==e?.eventsMediaType?e.eventsMediaType:{anyCapabilities:["clips","snapshots"]},n=this._api.getCameraManager(),i=e?.cameraID?n.getStore().getAllDependentCameras(e.cameraID,t):n.getStore().getCameraIDsWithCapability(t);if(!i.size)return null;const a=n.generateDefaultEventQueries(i,{limit:this._getChunkLimit(),..."clips"===e?.eventsMediaType&&{hasClip:!0},..."snapshots"===e?.eventsMediaType&&{hasSnapshot:!0}});if(!a)return null;const r=new Zw(a),s=await this.execute(r,e?.executorOptions);return s?{query:r,queryResults:s}:null}async executeDefaultRecordingQuery(e){const t=this._api.getCameraManager(),n=e?.cameraID?t.getStore().getAllDependentCameras(e.cameraID,"recordings"):t.getStore().getCameraIDsWithCapability("recordings");if(!n.size)return null;const i=t.generateDefaultRecordingQueries(n,{limit:this._getChunkLimit()});if(!i)return null;const a=new Qw(i),r=await this.execute(a,e?.executorOptions);return r?{query:a,queryResults:r}:null}async execute(e,t){const n=e.getQueries();if(!n)return null;const i=await this._api.getCameraManager().executeMediaQueries(n,{useCache:t?.useCache});if(!i)return null;const a=new ox({results:i});return t?.rejectResults?.(a)?null:(t?.selectResult?.id?a.selectBestResult((e=>e.findIndex((e=>e.getID()===t.selectResult?.id)))):t?.selectResult?.func?a.selectResultIfFound(t.selectResult.func):t?.selectResult?.time&&a.selectBestResult((e=>rx(e,t.selectResult?.time?.time,t.selectResult?.time?.favorCameraID))),a)}_getChunkLimit(){const e=this._api.getConfigManager().getCardWideConfig();return e?.performance?.features.media_chunk_size??50}}class lx{constructor(e,t){this._api=e,this._executor=t??new cx(e)}async getExistingQueryModifiers(e,t){return e.query?[new ax({queryResults:await this._executor.execute(e.query,t)})]:[]}async getNewQueryModifiers(e,t){return await this._executeNewQuery(e,{useCache:!1,...t})}async _executeNewQuery(e,t){const n=this._api.getConfigManager().getConfig();if(!n)return null;const i=e?.getDefaultMediaType(),a=[],r=async n=>{ +/* istanbul ignore if: this path cannot be reached -- @preserve */ +if(!n)return[];const i="recordings"===n?await this._executor.executeDefaultRecordingQuery({...!e.isGrid()&&{cameraID:e.camera},executorOptions:t}):"clips"===n||"snapshots"===n||"all"===n?await this._executor.executeDefaultEventQuery({...!e.isGrid()&&{cameraID:e.camera},eventsMediaType:n,executorOptions:t}):/* istanbul ignore next -- @preserve */ +null;return i?[new ax(i)]:[]};switch(e.view){case"live":"none"!==n.live.controls.thumbnails.mode&&a.push(...await r("recordings"===n.live.controls.thumbnails.media_type?"recordings":n.live.controls.thumbnails.events_media_type));break;case"media":a.push(...await r("clips"));break;case"clip":case"clips":case"snapshot":case"snapshots":case"recording":case"recordings":a.push(...await r(i))}return a.push(...this._getTimelineWindowViewModifier(e)),a.push(...this._getSeekTimeModifier(t?.selectResult?.time?.time)),a}_getTimelineWindowViewModifier(e){if(e.is("live")){const e=new Date,t=this._api.getConfigManager().getConfig()?.live; +/* istanbul ignore if: this if branch cannot be reached as if the config is + empty this function is never called -- @preserve */ +return t?[new Zv({timeline:{window:{start:Wu(e,{seconds:t.controls.timeline.window_seconds}),end:e}}})]:[]}return[new ix("timeline","window")]}_getSeekTimeModifier(e){return e?[new Zv({mediaViewer:{seek:e}})]:[new ix("mediaViewer","seek")]}}class dx{constructor(e,t){this._view=null,this._epoch=this._createEpoch(),this._loadingIndex=1,this.setViewDefault=e=>this._setViewGeneric(this._viewFactory.getViewDefault.bind(this._viewFactory),e),this.setViewByParameters=e=>this._setViewGeneric(this._viewFactory.getViewByParameters.bind(this._viewFactory),e),this.setViewDefaultWithNewQuery=async e=>await this._setViewThenModifyAsync(this._viewFactory.getViewDefault.bind(this._viewFactory),this._viewQueryExecutor.getNewQueryModifiers.bind(this._viewQueryExecutor),e),this.setViewByParametersWithNewQuery=async e=>await this._setViewThenModifyAsync(this._viewFactory.getViewByParameters.bind(this._viewFactory),this._viewQueryExecutor.getNewQueryModifiers.bind(this._viewQueryExecutor),e),this.setViewByParametersWithExistingQuery=async e=>await this._setViewThenModifyAsync(this._viewFactory.getViewByParameters.bind(this._viewFactory),this._viewQueryExecutor.getExistingQueryModifiers.bind(this._viewQueryExecutor),e),this.initialize=async()=>(this._api.getQueryStringManager().hasViewRelatedActionsToRun()||this.setViewDefaultWithNewQuery({failSafe:!0}),!0),this._api=e,this._viewFactory=t?.viewFactory??new nx(e),this._viewQueryExecutor=t?.viewQueryExecutor??new lx(e)}getEpoch(){return this._epoch}_createEpoch(e){return{manager:this,...e&&{oldView:e}}}getView(){return this._view}hasView(){return!!this.getView()}reset(){this._view&&this._setView(null)}_setViewGeneric(e,t){let n=null;try{n=e({baseView:this._view,...t})}catch(e){this._api.getMessageManager().setErrorIfHigherPriority(e)}n&&this._setView(n)}_markViewLoadingQuery(e,t){return e.mergeInContext({loading:{query:t}})}_markViewAsNotLoadingQuery(e){return e.removeContextProperty("loading","query")}async _setViewThenModifyAsync(e,t,n){let i=null;try{i=e({baseView:this._view,...n,params:{query:null,queryResults:null,...n?.params}})}catch(e){this._api.getMessageManager().setErrorIfHigherPriority(e)}if(!i)return;if(this._view&&this._shouldAdoptQueryAndResults(i))return i.query=this._view.query,i.queryResults=this._view.queryResults,this._markViewAsNotLoadingQuery(i),void this._setView(i);const a=this._loadingIndex++;this._markViewLoadingQuery(i,a),this._setView(i);let r=null,s=null;try{r=await t(i,n?.queryExecutorOptions)}catch(e){s=e}if(this._view&&this.hasMajorMediaChange(this._view,i))return void(this._view.context?.loading?.query===a&&this._setView(this._markViewAsNotLoadingQuery(this._view.clone())));if(s)return void this._api.getMessageManager().setErrorIfHigherPriority(s); +/* istanbul ignore if: the if path cannot be reached as the view is set + above -- @preserve */if(!this._view)return;const o=this._view.clone();this._view.context?.loading?.query===a&&this._markViewAsNotLoadingQuery(o),Jw(o,r),this._setView(o)}_shouldAdoptQueryAndResults(e){const t=this._view?.isViewerView()&&e?.isGalleryView(),n=e?.getDefaultMediaType(),i=Gw.getMediaType(this._view?.query)===n;return!!t&&i}setViewWithMergedContext(e){if(this._view)return this._setView(this._view?.clone().mergeInContext(e))}isViewSupportedByCamera(e,t){return!!Yw(this._api.getCameraManager(),t,e).size}hasMajorMediaChange(e,t){const n=t??this._view;return!!e!=!!n||e?.view!==n?.view||e?.camera!==n?.camera||"live"===n?.view&&e&&xv(e)!==xv(n)||"live"!==n?.view&&e?.queryResults!==n?.queryResults}_setView(e){const t=this._view;V_(this._api.getConfigManager().getCardWideConfig(),"Frigate Card view change: ",e),this._view=e,this._epoch=this._createEpoch(t),this.hasMajorMediaChange(t)&&this._api.getMediaLoadedInfoManager().clear(),t?.view!==e?.view&&this._api.getCardElementManager().scrollReset(),this._api.getMessageManager().reset(),this._api.getStyleManager().setExpandedMode(),this._api.getConditionsManager()?.setState({view:e?.view,camera:e?.camera,displayMode:e?.displayMode??void 0}),this._api.getCardElementManager().update()}}class ux{constructor(e,t,n,i){this._deviceRegistryManager=new av(new nv((e=>e.id))),this._entityRegistryManager=new ov(new nv((e=>e.entity_id))),this._resolvedMediaCache=new lv,this._actionsManager=new pb(this),this._automationsManager=new gb(this),this._cameraManager=new tv(this),this._cameraURLManager=new mb(this),this._configManager=new sw(this),this._defaultManager=new ow(this),this._downloadManager=new uw(this),this._expandManager=new hw(this),this._fullscreenManager=new yw(this),this._hassManager=new bw(this),this._initializationManager=new Ab(this),this._interactionManager=new Ew(this),this._keyboardStateManager=new $w(this),this._mediaLoadedInfoManager=new Rw(this),this._mediaPlayerManager=new Lw(this),this._messageManager=new Nw(this),this._microphoneManager=new Fw(this),this._queryStringManager=new Vw(this),this._statusBarItemManager=new Hw(this),this._styleManager=new Bw(this),this._triggersManager=new qw(this),this._viewManager=new dx(this),e.addController(this),this._conditionsManager=new tw(this,i),this._cardElementManager=new Ib(this,e,t,n)}getActionsManager(){return this._actionsManager}getAutomationsManager(){return this._automationsManager}getCameraManager(){return this._cameraManager}getCameraURLManager(){return this._cameraURLManager}getCardElementManager(){return this._cardElementManager}getConditionsManager(){return this._conditionsManager}static async getConfigElement(){return await import("./editor-238b96c0.js"),document.createElement("frigate-card-editor")}getConfigManager(){return this._configManager}getDefaultManager(){return this._defaultManager}getDeviceRegistryManager(){return this._deviceRegistryManager}getDownloadManager(){return this._downloadManager}getEntityRegistryManager(){return this._entityRegistryManager}getExpandManager(){return this._expandManager}getFullscreenManager(){return this._fullscreenManager}getHASSManager(){return this._hassManager}getInitializationManager(){return this._initializationManager}getInteractionManager(){return this._interactionManager}getKeyboardStateManager(){return this._keyboardStateManager}getMediaLoadedInfoManager(){return this._mediaLoadedInfoManager}getMediaPlayerManager(){return this._mediaPlayerManager}getMessageManager(){return this._messageManager}getMicrophoneManager(){return this._microphoneManager}getQueryStringManager(){return this._queryStringManager}getResolvedMediaCache(){return this._resolvedMediaCache}getStatusBarItemManager(){return this._statusBarItemManager}static getStubConfig(e){return{cameras:[{camera_entity:e.find((e=>e.startsWith("camera.")))??"camera.demo"}]}}getStyleManager(){return this._styleManager}getTriggersManager(){return this._triggersManager}getViewManager(){return this._viewManager}hostConnected(){this.getCardElementManager().elementConnected()}hostDisconnected(){this.getCardElementManager().elementDisconnected()}}class hx{constructor(){this._dynamicMenuButtons=[]}addDynamicMenuButton(e){this._dynamicMenuButtons.includes(e)||this._dynamicMenuButtons.push(e)}removeDynamicMenuButton(e){this._dynamicMenuButtons=this._dynamicMenuButtons.filter((t=>t!=e))}calculateButtons(e,t,n,i){return[this._getDefaultButton(t),this._getCamerasButton(t,n,i?.view),this._getSubstreamsButton(t,n,i?.view),this._getLiveButton(t,i?.view,i?.viewManager),this._getClipsButton(t,i?.view,i?.viewManager),this._getSnapshotsButton(t,i?.view,i?.viewManager),this._getRecordingsButton(t,i?.view,i?.viewManager),this._getImageButton(t,i?.view,i?.viewManager),this._getTimelineButton(t,i?.view,i?.viewManager),this._getDownloadButton(t,n,i?.view),this._getCameraUIButton(t,i?.showCameraUIButton),this._getMicrophoneButton(t,i?.microphoneManager,i?.currentMediaLoadedInfo),this._getExpandButton(t,i?.inExpandedMode),this._getFullscreenButton(t,i?.inFullscreenMode),this._getCastButton(e,t,n,i?.view,i?.mediaPlayerController),this._getPlayPauseButton(t,i?.currentMediaLoadedInfo),this._getMuteUnmuteButton(t,i?.currentMediaLoadedInfo),this._getScreenshotButton(t,i?.currentMediaLoadedInfo),this._getDisplayModeButton(t,n,i?.view),this._getPTZControlsButton(t,n,i?.view),this._getPTZHomeButton(t,n,i?.view),...this._dynamicMenuButtons.map((e=>({style:this._getStyleFromActions(t,e,i),...e})))].filter(rf)}_getDefaultButton(e){return{icon:"frigate",...e.menu.buttons.frigate,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.frigate"),permanent:!0,tap_action:"hidden"===e.menu?.style?pf("menu_toggle"):pf("default"),hold_action:pf("diagnostics")}}_getCamerasButton(e,t,n){const i=t.getStore().getCameraIDsWithCapability("menu");if(i.size>1){const a=Array.from(i,(e=>{const i=gf("camera_select",e),a=t.getCameraMetadata(e);return{enabled:!0,icon:a?.icon.icon,entity:a?.icon.entity,state_color:!0,title:a?.title,selected:n?.camera===e,...i&&{tap_action:i}}}));return{icon:"mdi:video-switch",...e.menu.buttons.cameras,type:"custom:frigate-card-menu-submenu",title:N_("config.menu.buttons.cameras"),items:a}}return null}_getSubstreamsButton(e,t,n){if(!n)return null;const i=t.getStore().getAllDependentCameras(n.camera,"substream");if(i.size&&n.is("live")){const a=[...i].filter((e=>e!==n.camera)),r=[n.camera,...a],s=xv(n);if(2===r.length)return{icon:"mdi:video-input-component",style:s!==n.camera?this._getEmphasizedStyle():{},title:N_("config.menu.buttons.substreams"),...e.menu.buttons.substreams,type:"custom:frigate-card-menu-icon",tap_action:pf(Cv(n)?"live_substream_off":"live_substream_on")};if(r.length>2){const i=Array.from(r,(e=>{const n=gf("live_substream_select",e),i=t.getCameraMetadata(e)??void 0;return{enabled:!0,icon:i?.icon.icon,entity:i?.icon.entity,state_color:!0,title:i?.title,selected:s===e,...n&&{tap_action:n}}}));return{icon:"mdi:video-input-component",title:N_("config.menu.buttons.substreams"),style:s!==n.camera?this._getEmphasizedStyle():{},...e.menu.buttons.substreams,type:"custom:frigate-card-menu-submenu",items:i}}}return null}_getLiveButton(e,t,n){return t&&n?.isViewSupportedByCamera(t.camera,"live")?{icon:"mdi:cctv",...e.menu.buttons.live,type:"custom:frigate-card-menu-icon",title:N_("config.view.views.live"),style:t.is("live")?this._getEmphasizedStyle():{},tap_action:pf("live")}:null}_getClipsButton(e,t,n){return t&&n?.isViewSupportedByCamera(t.camera,"clips")?{icon:"mdi:filmstrip",...e.menu.buttons.clips,type:"custom:frigate-card-menu-icon",title:N_("config.view.views.clips"),style:t?.is("clips")?this._getEmphasizedStyle():{},tap_action:pf("clips"),hold_action:pf("clip")}:null}_getSnapshotsButton(e,t,n){return t&&n?.isViewSupportedByCamera(t.camera,"snapshots")?{icon:"mdi:camera",...e.menu.buttons.snapshots,type:"custom:frigate-card-menu-icon",title:N_("config.view.views.snapshots"),style:t?.is("snapshots")?this._getEmphasizedStyle():{},tap_action:pf("snapshots"),hold_action:pf("snapshot")}:null}_getRecordingsButton(e,t,n){return t&&n?.isViewSupportedByCamera(t.camera,"recordings")?{icon:"mdi:album",...e.menu.buttons.recordings,type:"custom:frigate-card-menu-icon",title:N_("config.view.views.recordings"),style:t.is("recordings")?this._getEmphasizedStyle():{},tap_action:pf("recordings"),hold_action:pf("recording")}:null}_getImageButton(e,t,n){return t&&n?.isViewSupportedByCamera(t.camera,"image")?{icon:"mdi:image",...e.menu.buttons.image,type:"custom:frigate-card-menu-icon",title:N_("config.view.views.image"),style:t?.is("image")?this._getEmphasizedStyle():{},tap_action:pf("image")}:null}_getTimelineButton(e,t,n){return t&&n?.isViewSupportedByCamera(t.camera,"timeline")?{icon:"mdi:chart-gantt",...e.menu.buttons.timeline,type:"custom:frigate-card-menu-icon",title:N_("config.view.views.timeline"),style:t.is("timeline")?this._getEmphasizedStyle():{},tap_action:pf("timeline")}:null}_getDownloadButton(e,t,n){const i=n?.queryResults?.getSelectedResult(),a=i?t?.getMediaCapabilities(i):null;return n?.isViewerView()&&a?.canDownload&&!fb()?{icon:"mdi:download",...e.menu.buttons.download,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.download"),tap_action:pf("download")}:null}_getCameraUIButton(e,t){return t?{icon:"mdi:web",...e.menu.buttons.camera_ui,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.camera_ui"),tap_action:pf("camera_ui")}:null}_getMicrophoneButton(e,t,n){if(t&&n?.capabilities?.supports2WayAudio){const n=t.isForbidden()||!t.isSupported(),i=t.isMuted(),a=e.menu.buttons.microphone.type;return{icon:n?"mdi:microphone-message-off":i?"mdi:microphone-off":"mdi:microphone",...e.menu.buttons.microphone,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.microphone"),style:n||i?{}:this._getEmphasizedStyle(!0),...!n&&"momentary"===a&&{start_tap_action:pf("microphone_unmute"),end_tap_action:pf("microphone_mute")},...!n&&"toggle"===a&&{tap_action:pf(i?"microphone_unmute":"microphone_mute")}}}return null}_getExpandButton(e,t){return{icon:t?"mdi:arrow-collapse-all":"mdi:arrow-expand-all",...e.menu.buttons.expand,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.expand"),tap_action:pf("expand"),style:t?this._getEmphasizedStyle():{}}}_getFullscreenButton(e,t){return fb()?null:{icon:t?"mdi:fullscreen-exit":"mdi:fullscreen",...e.menu.buttons.fullscreen,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.fullscreen"),tap_action:pf("fullscreen"),style:t?this._getEmphasizedStyle():{}}}_getCastButton(e,t,n,i,a){if(!i)return null;const r=n.getStore().getCameraConfig(i.camera);if(a?.hasMediaPlayers()&&(i.isViewerView()||i.is("live")&&r?.camera_entity)){const n=a.getMediaPlayers().map((t=>{const n=bb(e,t)||t,i=e.states[t],a=mf(t,"play"),r=mf(t,"stop"),s=!i||"unavailable"===i.state;return{enabled:!0,selected:!1,entity:t,state_color:!1,title:n,disabled:s,...!s&&a&&{tap_action:a},...!s&&r&&{hold_action:r}}}));return{icon:"mdi:cast",...t.menu.buttons.media_player,type:"custom:frigate-card-menu-submenu",title:N_("config.menu.buttons.media_player"),items:n}}return null}_getPlayPauseButton(e,t){if(t&&t.player&&t.capabilities?.supportsPause){const n=t.player.isPaused();return{icon:n?"mdi:play":"mdi:pause",...e.menu.buttons.play,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.play"),tap_action:pf(n?"play":"pause")}}return null}_getMuteUnmuteButton(e,t){if(t&&t.player&&t?.capabilities?.hasAudio){const n=t.player.isMuted();return{icon:n?"mdi:volume-off":"mdi:volume-high",...e.menu.buttons.mute,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.mute"),tap_action:pf(n?"unmute":"mute")}}return null}_getScreenshotButton(e,t){return t&&t.player?{icon:"mdi:monitor-screenshot",...e.menu.buttons.screenshot,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.screenshot"),tap_action:pf("screenshot")}:null}_getDisplayModeButton(e,t,n){const i=n?Yw(t,n.view):null;if(n?.supportsMultipleDisplayModes()&&i&&i.size>1){const t=n.isGrid();return{icon:t?"mdi:grid-off":"mdi:grid",...e.menu.buttons.display_mode,style:t?this._getEmphasizedStyle():{},type:"custom:frigate-card-menu-icon",title:N_(t?"display_modes.single":"display_modes.grid"),tap_action:(a=t?"single":"grid",{action:"fire-dom-event",frigate_card_action:"display_mode_select",display_mode:a,...r?.cardID&&{card_id:r.cardID}})}}var a,r;return null}_getPTZControlsButton(e,t,n){const i=n?.is("live")?e.live.controls.ptz:n?.isViewerView()?e.media_viewer.controls.ptz:null;if(!n||!i||"off"===i.mode)return null;const a=Ov(n,{cameraManager:t,..."auto"===i.mode&&{type:"ptz"}});if(a){const t=!1!==n.context?.ptzControls?.enabled&&("on"===i.mode||"auto"===i.mode&&"ptz"===a.type);return{icon:"mdi:pan",...e.menu.buttons.ptz_controls,style:t?this._getEmphasizedStyle():{},type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.ptz_controls"),tap_action:(r=!t,{action:"fire-dom-event",frigate_card_action:"ptz_controls",enabled:r,...s?.cardID&&{card_id:s.cardID}})}}var r,s;return null}_getPTZHomeButton(e,t,n){const i=n?Ov(n,{cameraManager:t}):null;return!i||(("digital"===i.type&&n?.context?.zoom?.[i.targetID]?.observed?.isDefault)??1)?null:{icon:"mdi:home",...e.menu.buttons.ptz_home,type:"custom:frigate-card-menu-icon",title:N_("config.menu.buttons.ptz_home"),tap_action:ff({targetID:i.targetID})}}_getEmphasizedStyle(e){return e?{animation:"pulse 3s infinite",color:"var(--error-color, white)"}:{color:"var(--primary-color, white)"}}_getStyleFromActions(e,t,n){for(const i of[t.tap_action,t.double_tap_action,t.hold_action,t.start_tap_action,t.end_tap_action]){const t=Array.isArray(i)?i:[i];for(const i of t){if(!i||"fire-dom-event"!==i.action||!("frigate_card_action"in i))continue;const t=i;if(Uo.some((e=>e===t.frigate_card_action&&n?.view?.is(t.frigate_card_action)))||"default"===t.frigate_card_action&&n?.view?.is(e.view.default)||"fullscreen"===t.frigate_card_action&&n?.inFullscreenMode||"camera_select"===t.frigate_card_action&&n?.view?.camera===t.camera)return this._getEmphasizedStyle()}}return{}}} +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +function px(e){return null==e}var gx=function(e,t){var n,i="";for(n=0;no&&(t=i-o+(r=" ... ").length),n-i>o&&(n=i+o-(s=" ...").length),{str:r+e.slice(t,n).replace(/\t/g,"→")+s,pos:i-t+r.length}}function bx(e,t){return mx.repeat(" ",t-e.length)+e}var wx=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,a=[0],r=[],s=-1;n=i.exec(e.buffer);)r.push(n.index),a.push(n.index+n[0].length),e.position<=n.index&&s<0&&(s=a.length-2);s<0&&(s=a.length-1);var o,c,l="",d=Math.min(e.line+t.linesAfter,r.length).toString().length,u=t.maxLength-(t.indent+d+3);for(o=1;o<=t.linesBefore&&!(s-o<0);o++)c=vx(e.buffer,a[s-o],r[s-o],e.position-(a[s]-a[s-o]),u),l=mx.repeat(" ",t.indent)+bx((e.line-o+1).toString(),d)+" | "+c.str+"\n"+l;for(c=vx(e.buffer,a[s],r[s],e.position,u),l+=mx.repeat(" ",t.indent)+bx((e.line+1).toString(),d)+" | "+c.str+"\n",l+=mx.repeat("-",t.indent+d+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(s+o>=r.length);o++)c=vx(e.buffer,a[s+o],r[s+o],e.position-(a[s]-a[s+o]),u),l+=mx.repeat(" ",t.indent)+bx((e.line+o+1).toString(),d)+" | "+c.str+"\n";return l.replace(/\n$/,"")},xx=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Cx=["scalar","sequence","mapping"];var Mx=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===xx.indexOf(t))throw new yx('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===Cx.indexOf(this.kind))throw new yx('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function Sx(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function kx(e){return this.extend(e)}kx.prototype.extend=function(e){var t=[],n=[];if(e instanceof Mx)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new yx("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof Mx))throw new yx("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new yx("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new yx("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof Mx))throw new yx("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(kx.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Sx(i,"implicit"),i.compiledExplicit=Sx(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Lx=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Nx=/^[-+]?[0-9]+e/;var Fx=new Mx("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Lx.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||mx.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(mx.isNegativeZero(e))return"-0.0";return n=e.toString(10),Nx.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Vx=zx.extend({implicit:[Tx,jx,Px,Fx]}),Hx=Vx,Bx=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),qx=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Ux=new Mx("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Bx.exec(e)||null!==qx.exec(e))},construct:function(e){var t,n,i,a,r,s,o,c,l=0,d=null;if(null===(t=Bx.exec(e))&&(t=qx.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,i,a));if(r=+t[4],s=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(d=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(d=-d)),c=new Date(Date.UTC(n,i,a,r,s,o,l)),d&&c.setTime(c.getTime()-d),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var Wx=new Mx("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Zx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Qx=new Mx("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,a=e.length,r=Zx;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),a=i.length,r=Zx,s=0,o=[];for(t=0;t>16&255),o.push(s>>8&255),o.push(255&s)),s=s<<6|r.indexOf(i.charAt(t));return 0===(n=a%4*6)?(o.push(s>>16&255),o.push(s>>8&255),o.push(255&s)):18===n?(o.push(s>>10&255),o.push(s>>2&255)):12===n&&o.push(s>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",a=0,r=e.length,s=Zx;for(t=0;t>18&63],i+=s[a>>12&63],i+=s[a>>6&63],i+=s[63&a]),a=(a<<8)+e[t];return 0===(n=r%3)?(i+=s[a>>18&63],i+=s[a>>12&63],i+=s[a>>6&63],i+=s[63&a]):2===n?(i+=s[a>>10&63],i+=s[a>>4&63],i+=s[a<<2&63],i+=s[64]):1===n&&(i+=s[a>>2&63],i+=s[a<<4&63],i+=s[64],i+=s[64]),i}}),Gx=Object.prototype.hasOwnProperty,Yx=Object.prototype.toString;var Kx=new Mx("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,a,r,s=[],o=e;for(t=0,n=o.length;t>10),56320+(e-65536&1023))}for(var kC=new Array(256),EC=new Array(256),$C=0;$C<256;$C++)kC[$C]=MC($C)?1:0,EC[$C]=MC($C);function AC(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||nC,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function IC(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=wx(n),new yx(t,n)}function zC(e,t){throw IC(e,t)}function TC(e,t){e.onWarning&&e.onWarning.call(null,IC(e,t))}var jC={YAML:function(e,t,n){var i,a,r;null!==e.version&&zC(e,"duplication of %YAML directive"),1!==n.length&&zC(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&zC(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),r=parseInt(i[2],10),1!==a&&zC(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=r<2,1!==r&&2!==r&&TC(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,a;2!==n.length&&zC(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],gC.test(i)||zC(e,"ill-formed tag handle (first argument) of the TAG directive"),iC.call(e.tagMap,i)&&zC(e,'there is a previously declared suffix for "'+i+'" tag handle'),mC.test(a)||zC(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch(t){zC(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a}};function OC(e,t,n,i){var a,r,s,o;if(t1&&(e.result+=mx.repeat("\n",t-1))}function VC(e,t){var n,i,a=e.tag,r=e.anchor,s=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,zC(e,"tab characters must not be used in indentation")),45===i)&&vC(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,LC(e,!0,-1)&&e.lineIndent<=t)s.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,qC(e,t,sC,!1,!0),s.push(e.result),LC(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)zC(e,"bad indentation of a sequence entry");else if(e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt?g=1:e.lineIndent===t?g=0:e.lineIndentt)&&(_&&(s=e.line,o=e.lineStart,c=e.position),qC(e,t,oC,!0,a)&&(_?m=e.result:f=e.result),_||(RC(e,h,p,g,m,f,s,o,c),g=m=f=null),LC(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===r||e.lineIndent>t)&&0!==l)zC(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===a?zC(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?zC(e,"repeat of an indentation width identifier"):(l=t+a-1,c=!0)}if(yC(r)){do{r=e.input.charCodeAt(++e.position)}while(yC(r));if(35===r)do{r=e.input.charCodeAt(++e.position)}while(!_C(r)&&0!==r)}for(;0!==r;){for(PC(e),e.lineIndent=0,r=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),_C(r))d++;else{if(e.lineIndent0){for(a=s,r=0;a>0;a--)(s=wC(o=e.input.charCodeAt(++e.position)))>=0?r=(r<<4)+s:zC(e,"expected hexadecimal character");e.result+=SC(r),e.position++}else zC(e,"unknown escape sequence");n=i=e.position}else _C(o)?(OC(e,n,i,!0),FC(e,LC(e,!1,t)),n=i=e.position):e.position===e.lineStart&&NC(e)?zC(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}zC(e,"unexpected end of the stream within a double quoted scalar")}(e,h)?f=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!vC(i)&&!bC(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&zC(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),iC.call(e.anchorMap,n)||zC(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],LC(e,!0,-1),!0}(e)?function(e,t,n){var i,a,r,s,o,c,l,d,u=e.kind,h=e.result;if(vC(d=e.input.charCodeAt(e.position))||bC(d)||35===d||38===d||42===d||33===d||124===d||62===d||39===d||34===d||37===d||64===d||96===d)return!1;if((63===d||45===d)&&(vC(i=e.input.charCodeAt(e.position+1))||n&&bC(i)))return!1;for(e.kind="scalar",e.result="",a=r=e.position,s=!1;0!==d;){if(58===d){if(vC(i=e.input.charCodeAt(e.position+1))||n&&bC(i))break}else if(35===d){if(vC(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&NC(e)||n&&bC(d))break;if(_C(d)){if(o=e.line,c=e.lineStart,l=e.lineIndent,LC(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}e.position=r,e.line=o,e.lineStart=c,e.lineIndent=l;break}}s&&(OC(e,a,r,!1),FC(e,e.line-o),a=r=e.position,s=!1),yC(d)||(r=e.position+1),d=e.input.charCodeAt(++e.position)}return OC(e,a,r,!1),!!e.result||(e.kind=u,e.result=h,!1)}(e,h,aC===n)&&(f=!0,null===e.tag&&(e.tag="?")):(f=!0,null===e.tag&&null===e.anchor||zC(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(f=o&&VC(e,p))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&zC(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c"),null!==e.result&&u.kind!==e.kind&&zC(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+u.kind+'", not "'+e.kind+'"'),u.resolve(e.result,e.tag)?(e.result=u.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):zC(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||f}function UC(e){var t,n,i,a,r=e.position,s=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(a=e.input.charCodeAt(e.position))&&(LC(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==a));){for(s=!0,a=e.input.charCodeAt(++e.position),t=e.position;0!==a&&!vC(a);)a=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&zC(e,"directive name must not be less than one character in length");0!==a;){for(;yC(a);)a=e.input.charCodeAt(++e.position);if(35===a){do{a=e.input.charCodeAt(++e.position)}while(0!==a&&!_C(a));break}if(_C(a))break;for(t=e.position;0!==a&&!vC(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==a&&PC(e),iC.call(jC,n)?jC[n](e,n,i):TC(e,'unknown document directive "'+n+'"')}LC(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,LC(e,!0,-1)):s&&zC(e,"directives end mark is expected"),qC(e,e.lineIndent-1,oC,!1,!0),LC(e,!0,-1),e.checkLineBreaks&&hC.test(e.input.slice(r,e.position))&&TC(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&NC(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,LC(e,!0,-1)):e.position=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function DM(e){return/^\n* /.test(e)}var RM=1,PM=2,LM=3,NM=4,FM=5;function VM(e,t,n,i,a,r,s,o){var c,l=0,d=null,u=!1,h=!1,p=-1!==i,g=-1,m=function(e){return zM(e)&&e!==YC&&!IM(e)&&e!==lM&&e!==pM&&e!==dM&&e!==cM&&e!==mM&&e!==fM&&e!==yM&&e!==bM&&e!==iM&&e!==rM&&e!==oM&&e!==tM&&e!==vM&&e!==uM&&e!==hM&&e!==sM&&e!==nM&&e!==aM&&e!==gM&&e!==_M}(OM(e,0))&&function(e){return!IM(e)&&e!==dM}(OM(e,e.length-1));if(t||s)for(c=0;c=65536?c+=2:c++){if(!zM(l=OM(e,c)))return FM;m=m&&jM(l,d,o),d=l}else{for(c=0;c=65536?c+=2:c++){if((l=OM(e,c))===XC)u=!0,p&&(h=h||c-g-1>i&&" "!==e[g+1],g=c);else if(!zM(l))return FM;m=m&&jM(l,d,o),d=l}h=h||p&&c-g-1>i&&" "!==e[g+1]}return u||h?n>9&&DM(e)?FM:s?r===kM?FM:PM:h?NM:LM:!m||s||a(e)?r===kM?FM:PM:RM}function HM(e,t,n,i,a){e.dump=function(){if(0===t.length)return e.quotingType===kM?'""':"''";if(!e.noCompatMode&&(-1!==xM.indexOf(t)||CM.test(t)))return e.quotingType===kM?'"'+t+'"':"'"+t+"'";var r=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-r),o=i||e.flowLevel>-1&&n>=e.flowLevel;switch(VM(t,o,e.indent,s,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+BM(t,e.indent)+qM($M(function(e,t){var n,i,a=/(\n+)([^\n]*)/g,r=(o=e.indexOf("\n"),o=-1!==o?o:e.length,a.lastIndex=o,UM(e.slice(0,o),t)),s="\n"===e[0]||" "===e[0];var o;for(;i=a.exec(e);){var c=i[1],l=i[2];n=" "===l[0],r+=c+(s||n||""===l?"":"\n")+UM(l,t),s=n}return r}(t,s),r));case FM:return'"'+function(e){for(var t,n="",i=0,a=0;a=65536?a+=2:a++)i=OM(e,a),!(t=wM[i])&&zM(i)?(n+=e[a],i>=65536&&(n+=e[a+1])):n+=t||MM(i);return n}(t)+'"';default:throw new yx("impossible error: invalid scalar style")}}()}function BM(e,t){var n=DM(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function qM(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function UM(e,t){if(""===e||" "===e[0])return e;for(var n,i,a=/ [^ ]/g,r=0,s=0,o=0,c="";n=a.exec(e);)(o=n.index)-r>t&&(i=s>r?s:o,c+="\n"+e.slice(r,i),r=i+1),s=o;return c+="\n",e.length-r>t&&s>r?c+=e.slice(r,s)+"\n"+e.slice(s+1):c+=e.slice(r),c.slice(1)}function WM(e,t,n,i){var a,r,s,o="",c=e.tag;for(a=0,r=n.length;a tag resolver accepts not "'+c+'" style');i=o.represent[c](t,c)}e.dump=i}return!0}return!1}function QM(e,t,n,i,a,r,s){e.tag=null,e.dump=n,ZM(e,n,!1)||ZM(e,n,!0);var o,c=QC.call(e.dump),l=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var d,u,h="[object Object]"===c||"[object Array]"===c;if(h&&(u=-1!==(d=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(a=!1),u&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&u&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),"[object Object]"===c)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var a,r,s,o,c,l,d="",u=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new yx("sortKeys must be a boolean or a function");for(a=0,r=h.length;a1024)&&(e.dump&&XC===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=AM(e,t)),QM(e,t+1,o,!0,c)&&(e.dump&&XC===e.dump.charCodeAt(0)?l+=":":l+=": ",d+=l+=e.dump));e.tag=u,e.dump=d||"{}"}(e,t,e.dump,a),u&&(e.dump="&ref_"+d+e.dump)):(!function(e,t,n){var i,a,r,s,o,c="",l=e.tag,d=Object.keys(n);for(i=0,a=d.length;i1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),QM(e,t,s,!1,!1)&&(c+=o+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),u&&(e.dump="&ref_"+d+" "+e.dump));else if("[object Array]"===c)i&&0!==e.dump.length?(e.noArrayIndent&&!s&&t>0?WM(e,t-1,e.dump,a):WM(e,t,e.dump,a),u&&(e.dump="&ref_"+d+e.dump)):(!function(e,t,n){var i,a,r,s="",o=e.tag;for(i=0,a=n.length;i",e.dump=o+" "+e.dump)}return!0}function GM(e,t){var n,i,a=[],r=[];for(YM(e,a,r),n=0,i=r.length;n`;if(this.icon?.icon)return q``;if(this.hass&&this.icon?.entity){const e=this._controller.createStateObjectForStateBadge(this.hass,this.icon.entity);if(e)return q``}return this.icon?.fallback?q``:q``}static get styles(){return s(":host {\n display: inline-block;\n width: var(--mdc-icon-size, 24px);\n height: var(--mdc-icon-size, 24px);\n --ha-icon-display: block;\n}\n\n* {\n display: block;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n}")}};e([he({attribute:!1})],tS.prototype,"hass",void 0),e([he({attribute:!1})],tS.prototype,"icon",void 0),tS=e([le("frigate-card-icon")],tS);let nS=class extends oe{constructor(){super(...arguments),this.message=""}render(){const e=this.icon?this.icon:"mdi:information-outline",t={dotdotdot:!!this.dotdotdot},n=e=>q`
${XM.dump(e)}
`;return q`
+
+
+ +
+
+ + ${this.message?q`${this.message}${this.context&&"string"==typeof this.context?": "+this.context:""}`:""} + + ${this.context&&Array.isArray(this.context)?this.context.map((e=>n(e))):"object"==typeof this.context?n(this.context):""} +
+
+
`}static get styles(){return s(JM)}};e([he({attribute:!1})],nS.prototype,"message",void 0),e([he({attribute:!1})],nS.prototype,"context",void 0),e([he({attribute:!1})],nS.prototype,"icon",void 0),e([he({attribute:!0,type:Boolean})],nS.prototype,"dotdotdot",void 0),nS=e([le("frigate-card-message")],nS);let iS=class extends oe{render(){if(this.message)return q` ${N_("error.troubleshooting")}.`} + .icon=${this.message.icon??"mdi:alert-circle"} + .context=${this.message.context} + .dotdotdot=${this.message.dotdotdot} + > + `}static get styles(){return s(JM)}};e([he({attribute:!1})],iS.prototype,"message",void 0),iS=e([le("frigate-card-error-message")],iS);let aS=class extends oe{constructor(){super(...arguments),this.message="",this.animated=!1,this.size="large"}render(){return q`
+ ${this.animated?q` + `:q``} + ${this.message?q`${this.message}`:q``} +
`}static get styles(){return s(JM)}};function rS(e){return"error"===e?.type?q` `:e?q` `:q``}function sS(e){return q` + + + `}function oS(e,t,n){!function(e,t,n,i){Vm(e,"message",{message:t,type:n,icon:i?.icon,context:i?.context})}(e,t,"error",{context:n?.context})}function cS(e,t){t instanceof Error&&oS(e,t.message,{...t instanceof $o&&{context:t.context}})}e([he({attribute:!1})],aS.prototype,"message",void 0),e([he({attribute:!1})],aS.prototype,"animated",void 0),e([he({attribute:!1})],aS.prototype,"size",void 0),aS=e([le("frigate-card-progress-indicator")],aS);let lS=class extends oe{constructor(){super(...arguments),this._root=null}createRenderRoot(){return this}_createRoot(){const e=customElements.get("hui-conditional-element");if(!e||!this.hass)throw new Error(N_("error.could_not_render_elements"));const t=new e;t.hass=this.hass;const n={type:"conditional",conditions:[],elements:this.elements};try{t.setConfig(n)}catch(e){throw Zm(e,console.error),new $o(N_("error.invalid_elements_config"))}return t}willUpdate(e){try{!this.elements||this._root&&!e.has("elements")||(this._root=this._createRoot())}catch(e){return cS(this,e)}}render(){return q`${this._root||""}`}updated(){this.hass&&this._root&&(this._root.hass=this.hass)}};e([he({attribute:!1})],lS.prototype,"elements",void 0),e([he({attribute:!1})],lS.prototype,"conditionsManagerEpoch",void 0),e([he({attribute:!1})],lS.prototype,"hass",void 0),lS=e([le("frigate-card-elements-core")],lS);let dS=class extends oe{constructor(){super(...arguments),this._menuRemoveHandler=e=>{Vm(this,"menu:remove",e.detail)},this._statusBarRemoveHandler=e=>{Vm(this,"status-bar:remove",e.detail)},this._menuAddHandler=e=>{const t=e.composedPath();t.length&&this._addHandler(t[0],"frigate-card:menu:remove",this._menuRemoveHandler)},this._statusBarAddHandler=e=>{const t=e.composedPath();t.length&&this._addHandler(t[0],"frigate-card:status-bar:add",this._statusBarRemoveHandler)}}_addHandler(e,t,n){e.removeEventListener(t,n),e.addEventListener(t,n)}connectedCallback(){super.connectedCallback(),this.addEventListener("frigate-card:menu:add",this._menuAddHandler),this.addEventListener("frigate-card:status-bar:add",this._statusBarAddHandler)}disconnectedCallback(){this.removeEventListener("frigate-card:menu:add",this._menuAddHandler),this.addEventListener("frigate-card:status-bar:add",this._statusBarAddHandler),super.disconnectedCallback()}render(){return q` + `}static get styles(){return s(":host {\n position: absolute;\n inset: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.element {\n position: absolute;\n transform: translate(-50%, -50%);\n pointer-events: auto;\n}\n\nhui-error-card.element {\n inset: 0px;\n transform: unset;\n}")}};e([he({attribute:!1})],dS.prototype,"hass",void 0),e([he({attribute:!1})],dS.prototype,"conditionsManagerEpoch",void 0),e([he({attribute:!1})],dS.prototype,"elements",void 0),dS=e([le("frigate-card-elements")],dS);let uS=class extends oe{setConfig(e){this._config=e}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.className=""}render(){if(function(e,t){if(!t)return!0;const n=new Jb(t,{bubbles:!0,composed:!0});return e.dispatchEvent(n),n.evaluation??!1}(this,this._config?.conditions))return q` + `}};e([he({attribute:!1,hasChanged:()=>!0})],uS.prototype,"hass",void 0),uS=e([le("frigate-card-conditional")],uS);class hS extends oe{constructor(e){super(),this._config=null,this._eventCategory=e}setConfig(e){this._config=e}connectedCallback(){super.connectedCallback(),this._config&&Vm(this,`${this._eventCategory}:add`,this._config)}disconnectedCallback(){this._config&&Vm(this,`${this._eventCategory}:remove`,this._config),super.disconnectedCallback()}}e([pe()],hS.prototype,"_config",void 0);class pS extends hS{constructor(){super("menu")}}let gS=class extends pS{};gS=e([le("frigate-card-menu-icon")],gS);let mS=class extends pS{};mS=e([le("frigate-card-menu-state-icon")],mS);let fS=class extends pS{};fS=e([le("frigate-card-menu-submenu")],fS);let _S=class extends pS{};_S=e([le("frigate-card-menu-submenu-select")],_S);class yS extends hS{constructor(){super("status-bar")}}let vS=class extends yS{};vS=e([le("frigate-card-status-bar-icon")],vS);let bS=class extends yS{};bS=e([le("frigate-card-status-bar-image")],bS);let wS=class extends yS{};wS=e([le("frigate-card-status-bar-string")],wS);let xS=class extends oe{render(){return q` `}static get styles(){return s(":host {\n width: intrinsic;\n height: intrinsic;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\nimg {\n width: 10%;\n animation: rotate 8s linear infinite;\n}\n\n@keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}")}};xS=e([le("frigate-card-loading")],xS);const CS=(e,t)=>{Vm(e,"action:execution-request",t)};class MS{constructor(e){this._config=null,this._buttons=[],this._expanded=!1,this._host=e}setMenuConfig(e){this._config=e,this._host.style.setProperty("--frigate-card-menu-button-size",`${e.button_size}px`),this._host.setAttribute("data-style",e.style),this._host.setAttribute("data-position",e.position),this._host.setAttribute("data-alignment",e.alignment),this._sortButtons(),this._host.requestUpdate()}getMenuConfig(){return this._config}isExpanded(){return this._expanded}setButtons(e){this._buttons=e,this._sortButtons(),this._host.requestUpdate()}getButtons(e){const t=e=>!this._isHidingMenu()||this._expanded||!!e.permanent;return this._buttons.filter((n=>(e=>!1!==e.enabled)(n)&&(t=>t.alignment===e||"matching"===e&&!t.alignment)(n)&&t(n)))}setExpanded(e){this._expanded=e,af(this._host,e,"expanded"),this._host.requestUpdate()}toggleExpanded(){this.setExpanded(!this._expanded)}actionHandler(e,t){if(e.stopPropagation(),e.detail.config&&(t=e.detail.config),!t)return;const n=e.detail.action,i=_f(n,t);if(!i)return;const a=qm(i);let r=!1;const s=a.filter((e=>rf(e)&&!this._isUnknownActionMenuToggleAction(e)));if(s.length!=a.length&&(r=!0),s.length&&CS(this._host,{action:a,config:t}),this._isHidingMenu())if(r)this.setExpanded(!this._expanded);else{const e=_f("hold",t),i=_f("double_tap",t),a=_f("tap",t),r=_f("end_tap",t);"end_tap"!==n&&("start_tap"!==n||e||i||a||r)&&("end_tap"===n||r)||this.setExpanded(!1)}}_sortButtons(){this._buttons=Sy(this._buttons,(e=>(e.priority??0)+(this._isHidingMenu()&&e.permanent?Bo:0)),["desc"])}_isHidingMenu(){return"hidden"===this._config?.style}_isUnknownActionMenuToggleAction(e){const t=hf(e);return!!t&&"menu_toggle"==t.frigate_card_action}}const SS=(e,t,n)=>{const i=e.states[t],a=n?.state?n.state:i?i.state:null;if(!a)return null;const r=Ye(t),s=i?i.attributes:null;return n?.entity?.translation_key&&e.localize(`component.${n.entity.platform}.entity.${r}.${n.entity.translation_key}.state.${a}`)||s?.device_class&&e.localize(`component.${r}.state.${s.device_class}.${a}`)||e.localize(`component.${r}.state._.${a}`)||a};let kS=class extends oe{_renderItem(e){if(!this.hass)return;const t=e.title??bb(this.hass,e.entity);return q` + {t.detail.config=e}} + .actionHandler=${Cf({hasHold:yf(e.hold_action),hasDoubleClick:yf(e.double_tap_action)})} + > + ${t??""} + ${e.subtitle?q`${e.subtitle}`:""} + + + `}render(){if(!this.submenu)return q``;const e=this.submenu.items;return q` + e.stopPropagation()} + @click=${e=>vf(e)} + > + + + + ${e.map(this._renderItem.bind(this))} + + `}static get styles(){return s("ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n:host {\n pointer-events: auto;\n}\n\nmwc-list-item {\n z-index: 20;\n}")}};e([he({attribute:!1})],kS.prototype,"hass",void 0),e([he({attribute:!1})],kS.prototype,"submenu",void 0),kS=e([le("frigate-card-submenu")],kS);let ES=class extends oe{shouldUpdate(e){const t=e.get("hass");return!e.has("hass")||!t||!this.submenuSelect||vb(this.hass,t,[this.submenuSelect.entity])}async _refreshOptionTitles(){if(!this.hass||!this.submenuSelect)return;const e=this.submenuSelect.entity,t=this.hass.states[e],n=t?.attributes?.options,i=await(this.entityRegistryManager?.getEntity(this.hass,e))??null,a={};for(const t of n){const n=SS(this.hass,e,{...i&&{entity:i},state:t});n&&(a[t]=n)}this._optionTitles=a}willUpdate(){if(!this.submenuSelect||!this.hass)return;this._optionTitles||this._refreshOptionTitles();const e=this.submenuSelect.entity,t=this.hass.states[e],n=t?.attributes?.options;if(!t||!n)return;const i=bb(this.hass,e),a={...i&&{title:i},...this.submenuSelect,icon:{icon:this.submenuSelect.icon,entity:e,fallback:"mdi:format-list-bulleted"},type:"custom:frigate-card-menu-submenu",items:[]};delete a.options;const r=a.items;for(const i of n){const n=this._optionTitles?.[i]??i;r.push({state_color:!0,selected:t.state===i,enabled:!0,title:n||i,...(e.startsWith("select.")||e.startsWith("input_select."))&&{tap_action:{action:"perform-action",perform_action:e.startsWith("select.")?"select.select_option":"input_select.select_option",target:{entity_id:e},data:{option:i}}},...this.submenuSelect.options&&this.submenuSelect.options[i]})}this._generatedSubmenu=a}render(){return q` `}};e([he({attribute:!1})],ES.prototype,"hass",void 0),e([he({attribute:!1})],ES.prototype,"submenuSelect",void 0),e([he({attribute:!1})],ES.prototype,"entityRegistryManager",void 0),e([pe()],ES.prototype,"_optionTitles",void 0),ES=e([le("frigate-card-submenu-select")],ES);let $S=class extends oe{constructor(){super(...arguments),this._controller=new MS(this)}set menuConfig(e){this._controller.setMenuConfig(e)}set buttons(e){this._controller.setButtons(e)}set expanded(e){this._controller.setExpanded(e)}toggleMenu(){this._controller.toggleExpanded()}_renderButton(e){if(!this.hass)return;if("custom:frigate-card-menu-submenu"===e.type)return q` this._controller.actionHandler(e)} + > + `;if("custom:frigate-card-menu-submenu-select"===e.type)return q` this._controller.actionHandler(e)} + > + `;const t=this.hass&&"custom:frigate-card-menu-state-icon"===e.type&&!e.title?bb(this.hass,e.entity):e.title;return q` this._controller.actionHandler(t,e)} + > + + `}render(){const e=this._controller.getMenuConfig(),t=e?.style;if(!e||"none"===t)return;const n=this._controller.getButtons("matching"),i=this._controller.getButtons("opposing");return q`
+ ${n.map((e=>this._renderButton(e)))} +
+
+ ${i.map((e=>this._renderButton(e)))} +
`}static get styles(){return s('ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n:host {\n --frigate-card-menu-button-size: 40px;\n --mdc-icon-button-size: var(--frigate-card-menu-button-size);\n --mdc-icon-size: calc(var(--mdc-icon-button-size) / 2);\n pointer-events: auto;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n overflow: visible;\n}\n\n/*******************************************************\n * Non-hover styles should not interact with the pointer\n *******************************************************/\n:host(:not([data-style*=hover])) {\n pointer-events: none;\n}\n\n/***********************************\n * Aligned divs: matching & opposing\n ***********************************/\ndiv.matching,\ndiv.opposing {\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: flex-start;\n min-width: 0px;\n min-height: 0px;\n}\n\ndiv.matching {\n justify-content: flex-start;\n}\n\ndiv.opposing {\n justify-content: flex-end;\n}\n\n/********************\n * Outside menu style\n ********************/\n:host([data-style=outside]) {\n width: 100%;\n background: var(--secondary-background-color);\n}\n\n/********************************************************\n * Hack: Ensure host & div expand for column flex layouts\n ********************************************************/\n:host(:not([data-style=outside])[data-position=left]) {\n writing-mode: vertical-lr;\n}\n\n:host(:not([data-style=outside])[data-position=right]) {\n writing-mode: vertical-rl;\n}\n\n:host(:not([data-style=outside])[data-style=overlay][data-position=left]) div > *,\n:host(:not([data-style=outside])[data-style=overlay][data-position=right]) div > *,\n:host(:not([data-style=outside])[data-style*=hover][data-position=left]) div > *,\n:host(:not([data-style=outside])[data-style*=hover][data-position=right]) div > *,\n:host(:not([data-style=outside])[data-style=hidden][data-position=left]) div > *,\n:host(:not([data-style=outside])[data-style=hidden][data-position=right]) div > * {\n writing-mode: horizontal-tb;\n}\n\n/**********************\n * "Reverse" alignments\n **********************/\n:host(:not([data-style=outside])[data-position=left][data-alignment=bottom]),\n:host(:not([data-style=outside])[data-position=right][data-alignment=bottom]),\n:host([data-position=top][data-alignment=right]),\n:host([data-position=bottom][data-alignment=right]),\n:host(:not([data-style=outside])[data-position=left][data-alignment=bottom]) div,\n:host(:not([data-style=outside])[data-position=right][data-alignment=bottom]) div,\n:host([data-position=top][data-alignment=right]) div,\n:host([data-position=bottom][data-alignment=right]) div {\n flex-direction: row-reverse;\n}\n\n/****************************\n * Wrap upwards on the bottom\n ****************************/\n:host(:not([data-style=outside])[data-position=bottom]) div {\n flex-wrap: wrap-reverse;\n}\n\n/********************************************\n * Positioning for absolute based menu styles\n ********************************************/\n:host([data-style=overlay][data-position=top]),\n:host([data-style=overlay][data-position=bottom]),\n:host([data-style*=hover][data-position=top]),\n:host([data-style*=hover][data-position=bottom]),\n:host([data-style=hidden][data-position=top]),\n:host([data-style=hidden][data-position=bottom]) {\n width: 100%;\n height: auto;\n}\n\n:host([data-style=overlay][data-position=top][data-alignment=left]),\n:host([data-style=overlay][data-position=bottom][data-alignment=left]),\n:host([data-style*=hover][data-position=top][data-alignment=left]),\n:host([data-style*=hover][data-position=bottom][data-alignment=left]),\n:host([data-style=hidden][data-position=top][data-alignment=left][expanded]),\n:host([data-style=hidden][data-position=bottom][data-alignment=left][expanded]) {\n background: linear-gradient(90deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n}\n\n:host([data-style=overlay][data-position=top][data-alignment=right]),\n:host([data-style=overlay][data-position=bottom][data-alignment=right]),\n:host([data-style*=hover][data-position=top][data-alignment=right]),\n:host([data-style*=hover][data-position=bottom][data-alignment=right]),\n:host([data-style=hidden][data-position=top][data-alignment=right][expanded]),\n:host([data-style=hidden][data-position=bottom][data-alignment=right][expanded]) {\n background: linear-gradient(270deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n}\n\n:host([data-style=overlay][data-position=left]),\n:host([data-style=overlay][data-position=right]),\n:host([data-style*=hover][data-position=left]),\n:host([data-style*=hover][data-position=right]),\n:host([data-style=hidden][data-position=left]),\n:host([data-style=hidden][data-position=right]) {\n width: auto;\n height: 100%;\n}\n\n:host([data-style=overlay][data-position=left][data-alignment=top]),\n:host([data-style=overlay][data-position=right][data-alignment=top]),\n:host([data-style*=hover][data-position=left][data-alignment=top]),\n:host([data-style*=hover][data-position=right][data-alignment=top]),\n:host([data-style=hidden][data-position=left][data-alignment=top][expanded]),\n:host([data-style=hidden][data-position=right][data-alignment=top][expanded]) {\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n}\n\n:host([data-style=overlay][data-position=left][data-alignment=bottom]),\n:host([data-style=overlay][data-position=right][data-alignment=bottom]),\n:host([data-style*=hover][data-position=left][data-alignment=bottom]),\n:host([data-style*=hover][data-position=right][data-alignment=bottom]),\n:host([data-style=hidden][data-position=left][data-alignment=bottom][expanded]),\n:host([data-style=hidden][data-position=right][data-alignment=bottom][expanded]) {\n background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n}')}};e([he({attribute:!1})],$S.prototype,"entityRegistryManager",void 0),e([he({attribute:!1})],$S.prototype,"hass",void 0),$S=e([le("frigate-card-menu")],$S);let AS=class extends oe{render(){return q` + + + + + `}static get styles(){return s("ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n:host {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\nslot {\n position: absolute;\n display: flex;\n}\n\n/***************\n * Slot position\n ***************/\nslot[name=top] {\n top: 0px;\n}\n\nslot[name=bottom] {\n bottom: 0px;\n}\n\nslot[name=left] {\n left: 0px;\n}\n\nslot[name=right] {\n right: 0px;\n}\n\n/***********\n * Slot size\n ***********/\nslot[name=top],\nslot[name=bottom] {\n width: 100%;\n flex-direction: column;\n}\n\nslot[name=left],\nslot[name=right] {\n height: 100%;\n flex-direction: row;\n}\n\nslot[name=top],\nslot[name=left] {\n justify-content: flex-start;\n}\n\nslot[name=bottom],\nslot[name=right] {\n justify-content: flex-end;\n}\n\n/*******************************\n * Match rounded corners to card\n *******************************/\n::slotted([slot=top]:first-child),\n::slotted([slot=left]:first-child) {\n border-top-left-radius: var(--ha-card-border-radius, 4px);\n}\n\n::slotted([slot=top]:first-child),\n::slotted([slot=right]:first-child) {\n border-top-right-radius: var(--ha-card-border-radius, 4px);\n}\n\n::slotted([slot=bottom]:last-child),\n::slotted([slot=left]:last-child) {\n border-bottom-left-radius: var(--ha-card-border-radius, 4px);\n}\n\n::slotted([slot=bottom]:last-child),\n::slotted([slot=right]:last-child) {\n border-bottom-right-radius: var(--ha-card-border-radius, 4px);\n}")}};AS=e([le("frigate-card-overlay")],AS);class IS{constructor(e){this._config=null,this._popupTimer=new bf,this._items=[],this._host=e}getRenderItems(){return this._items}setItems(e){const t=e.filter((e=>!!e.exclusive)),n=Sy(t.length?t:e,(e=>e.priority??50),"desc"),i=this._getSufficientValues(this._items),a=this._getSufficientValues(n);this._items=n,"popup"!==this._config?.style||jy(i,a)||(this._show(),this._popupTimer.start(this._config.popup_seconds,(()=>this._hide()))),this._host.requestUpdate()}setConfig(e){this._config=e,this._host.style.setProperty("--frigate-card-status-bar-height",`${e.height}px`),this._host.setAttribute("data-style",e.style),this._host.setAttribute("data-position",e.position),"popup"!==this._config?.style&&this._show(),this._host.requestUpdate()}shouldRender(){return this._items.some((e=>!1!==e.enabled&&e.sufficient))}actionHandler(e,t){e.stopPropagation();const n=_f(e.detail.action,t);n&&CS(this._host,{action:qm(n),config:t})}_getSufficientValue(e){ +/* istanbul ignore else: cannot happen -- @preserve */ +return"custom:frigate-card-status-bar-icon"===e.type?e.icon:"custom:frigate-card-status-bar-string"===e.type?e.string:"custom:frigate-card-status-bar-image"===e.type?e.image:null}_getSufficientValues(e){return e.filter((e=>!1!==e.enabled&&e.sufficient)).map((e=>this._getSufficientValue(e)))}_show(){af(this._host,!1,"hide")}_hide(){af(this._host,!0,"hide")}}let zS=class extends oe{constructor(){super(...arguments),this._controller=new IS(this)}willUpdate(e){e.has("config")&&this.config&&this._controller.setConfig(this.config),e.has("items")&&this._controller.setItems(this.items??[])}render(){if(this._controller.shouldRender())return q` +
+ ${this._controller.getRenderItems().map((e=>{if(!1===e.enabled)return;const t=_e({item:!0,expand:!!e.expand,action:!!Object.keys(e.actions??{}).length}),n=Cf({hasHold:yf(e.actions?.hold_action),hasDoubleClick:yf(e.actions?.double_tap_action)});return"custom:frigate-card-status-bar-string"===e.type?q`
this._controller.actionHandler(t,e.actions)} + > + ${e.string} +
`:"custom:frigate-card-status-bar-icon"===e.type?q`this._controller.actionHandler(t,e.actions)} + >`:"custom:frigate-card-status-bar-image"===e.type?q`this._controller.actionHandler(t,e.actions)} + />`:void 0}))} +
+ `}static get styles(){return s("ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n:host {\n --mdc-icon-size: calc(var(--frigate-card-status-bar-height) - 6px);\n display: block;\n width: 100%;\n pointer-events: auto;\n opacity: 1;\n transition: opacity 1s;\n}\n\n/*******************************************************\n * Non-hover styles should not interact with the pointer\n *******************************************************/\n:host(:not([data-style*=hover])) {\n pointer-events: none;\n}\n\n/***************\n * Outside style\n ***************/\n:host([data-style=outside]) {\n color: var(--primary-text-color);\n background: var(--secondary-background-color);\n}\n\n/*******************\n * Non-outside style\n *******************/\n:host(:not([data-style=outside])) {\n color: white;\n background: linear-gradient(90deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));\n}\n\n:host([data-style=popup][hide]) {\n opacity: 0;\n}\n\n/*********************\n * Status bar contents\n *********************/\n.status {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n overflow: hidden;\n width: 100%;\n height: var(--frigate-card-status-bar-height);\n}\n\n.item {\n display: inline-block;\n margin: 3px 5px;\n align-content: center;\n opacity: 0.7;\n}\n\n.item:first-child {\n margin-left: 10px;\n}\n\n.item:last-child {\n margin-right: 10px;\n}\n\n.item.expand {\n flex: 1;\n}\n\n.item.action {\n cursor: pointer;\n}\n\nimg.item {\n display: block;\n height: var(--mdc-icon-size, 24px);\n width: auto;\n}")}};e([he({attribute:!1})],zS.prototype,"items",void 0),e([he({attribute:!1})],zS.prototype,"config",void 0),zS=e([le("frigate-card-status-bar")],zS);function TS(e){return"number"==typeof e}function jS(e){return"string"==typeof e}function OS(e){return"boolean"==typeof e}function DS(e){return"[object Object]"===Object.prototype.toString.call(e)}function RS(e){return Math.abs(e)}function PS(e){return Math.sign(e)}function LS(e,t){return RS(e-t)}function NS(e){return qS(e).map(Number)}function FS(e){return e[VS(e)]}function VS(e){return Math.max(0,e.length-1)}function HS(e,t){return t===VS(e)}function BS(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function qS(e){return Object.keys(e)}function US(e,t){return[e,t].reduce(((e,t)=>(qS(t).forEach((n=>{const i=e[n],a=t[n],r=DS(i)&&DS(a);e[n]=r?US(i,a):a})),e)),{})}function WS(e,t){return void 0!==t.MouseEvent&&e instanceof t.MouseEvent}function ZS(){let e=[];const t={add:function(n,i,a,r={passive:!0}){let s;if("addEventListener"in n)n.addEventListener(i,a,r),s=()=>n.removeEventListener(i,a,r);else{const e=n;e.addListener(a),s=()=>e.removeListener(a)}return e.push(s),t},clear:function(){e=e.filter((e=>e()))}};return t}function QS(e,t,n,i){const a=ZS(),r=1e3/60;let s=null,o=0,c=0;function l(e){if(!c)return;s||(s=e);const a=e-s;for(s=e,o+=a;o>=r;)n(r),o-=r;i(o/r),c&&t.requestAnimationFrame(l)}function d(){t.cancelAnimationFrame(c),s=null,o=0,c=0}return{init:function(){a.add(e,"visibilitychange",(()=>{e.hidden&&(s=null,o=0)}))},destroy:function(){d(),a.clear()},start:function(){c||(c=t.requestAnimationFrame(l))},stop:d,update:()=>n(r),render:i}}function GS(e=0,t=0){const n=RS(e-t);function i(t){return tt}function r(e){return i(e)||a(e)}const s={length:n,max:t,min:e,constrain:function(n){return r(n)?i(n)?e:t:n},reachedAny:r,reachedMax:a,reachedMin:i,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}};return s}function YS(e,t,n){const{constrain:i}=GS(0,e),a=e+1;let r=s(t);function s(e){return n?RS((a+e)%a):i(e)}function o(){return r}function c(){return YS(e,o(),n)}const l={get:o,set:function(e){return r=s(e),l},add:function(e){return c().set(o()+e)},clone:c};return l}function KS(e,t,n,i,a,r,s,o,c,l,d,u,h,p,g,m,f,_,y){const{cross:v,direction:b}=e,w=["INPUT","SELECT","TEXTAREA"],x={passive:!1},C=ZS(),M=ZS(),S=GS(50,225).constrain(p.measure(20)),k={mouse:300,touch:400},E={mouse:500,touch:600},$=g?43:25;let A=!1,I=0,z=0,T=!1,j=!1,O=!1,D=!1;function R(e){if(!WS(e,i)&&e.touches.length>=2)return P(e);const t=r.readPoint(e),n=r.readPoint(e,v),s=LS(t,I),c=LS(n,z);if(!j&&!D){if(!e.cancelable)return P(e);if(j=s>c,!j)return P(e)}const d=r.pointerMove(e);s>m&&(O=!0),l.useFriction(.3).useDuration(.75),o.start(),a.add(b(d)),e.preventDefault()}function P(e){const t=d.byDistance(0,!1).index!==u.get(),n=r.pointerUp(e)*(g?E:k)[D?"mouse":"touch"],i=function(e,t){const n=u.add(-1*PS(e)),i=d.byDistance(e,!g).distance;return g||RS(e)=2,o&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return w.includes(t)}(e.target))return;T=!0,r.pointerDown(e),l.useFriction(0).useDuration(0),a.set(s),function(){const e=D?n:t;M.add(e,"touchmove",R,x).add(e,"touchend",P).add(e,"mousemove",R,x).add(e,"mouseup",P)}(),I=r.readPoint(e),z=r.readPoint(e,v),h.emit("pointerDown")}(o)}const c=t;C.add(c,"dragstart",(e=>e.preventDefault()),x).add(c,"touchmove",(()=>{}),x).add(c,"touchend",(()=>{})).add(c,"touchstart",o).add(c,"mousedown",o).add(c,"touchcancel",P).add(c,"contextmenu",P).add(c,"click",L,!0)},destroy:function(){C.clear(),M.clear()},pointerDown:function(){return T}}}function XS(e,t){let n,i;function a(e){return e.timeStamp}function r(n,i){const a="client"+("x"===(i||e.scroll)?"X":"Y");return(WS(n,t)?n:n.touches[0])[a]}return{pointerDown:function(e){return n=e,i=e,r(e)},pointerMove:function(e){const t=r(e)-r(i),s=a(e)-a(n)>170;return i=e,s&&(n=e),t},pointerUp:function(e){if(!n||!i)return 0;const t=r(i)-r(n),s=a(e)-a(n),o=a(e)-a(i)>170,c=t/s;return s&&!o&&RS(c)>.1?c:0},readPoint:r}}function JS(e,t,n,i,a,r,s){const o=[e].concat(i);let c,l,d=[],u=!1;function h(e){return a.measureSize(s.measure(e))}return{init:function(a){r&&(l=h(e),d=i.map(h),c=new ResizeObserver((n=>{(OS(r)||r(a,n))&&function(n){for(const r of n){if(u)return;const n=r.target===e,s=i.indexOf(r.target),o=n?l:d[s];if(RS(h(n?e:i[s])-o)>=.5){a.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{o.forEach((e=>c.observe(e)))})))},destroy:function(){u=!0,c&&c.disconnect()}}}function ek(e,t,n,i,a){const r=a.measure(10),s=a.measure(50),o=GS(.1,.99);let c=!1;function l(){return!c&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:l,constrain:function(a){if(!l())return;const c=e.reachedMin(t.get())?"min":"max",d=RS(e[c]-t.get()),u=n.get()-t.get(),h=o.constrain(d/s);n.subtract(u*h),!a&&RS(u)e.add(a)))}};return c}function nk(e,t,n,i,a){const{reachedAny:r,removeOffset:s,constrain:o}=i;function c(e){return e.concat().sort(((e,t)=>RS(e)-RS(t)))[0]}function l(t,i){const a=[t,t+n,t-n];if(!e)return t;if(!i)return c(a);const r=a.filter((e=>PS(e)===i));return r.length?c(r):FS(a)-n}return{byDistance:function(n,i){const c=a.get()+n,{index:d,distance:u}=function(n){const i=e?s(n):o(n),a=t.map(((e,t)=>({diff:l(e-i,0),index:t}))).sort(((e,t)=>RS(e.diff)-RS(t.diff))),{index:r}=a[0];return{index:r,distance:i}}(c),h=!e&&r(c);return!i||h?{index:d,distance:n}:{index:d,distance:n+l(t[d]-u,0)}},byIndex:function(e,n){return{index:e,distance:l(t[e]-a.get(),n)}},shortcut:l}}function ik(e,t,n,i,a,r,s,o){const c={passive:!0,capture:!0};let l=0;function d(e){"Tab"===e.code&&(l=(new Date).getTime())}return{init:function(u){o&&(r.add(document,"keydown",d,!1),t.forEach(((t,d)=>{r.add(t,"focus",(t=>{(OS(o)||o(u,t))&&function(t){if((new Date).getTime()-l>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const r=n.findIndex((e=>e.includes(t)));TS(r)&&(a.useDuration(0),i.index(r,0),s.emit("slideFocus"))}(d)}),c)})))}}}function ak(e){let t=e;function n(e){return TS(e)?e:e.get()}const i={get:function(){return t},set:function(e){t=n(e)},add:function(e){t+=n(e)},subtract:function(e){t-=n(e)}};return i}function rk(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},i=t.style;let a=!1;return{clear:function(){a||(i.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){a||(i.transform=n(e.direction(t)))},toggleActive:function(e){a=!e}}}function sk(e,t,n,i,a,r,s,o,c){const l=.5,d=NS(a),u=NS(a).reverse(),h=function(){const e=s[0];return m(g(u,e),n,!1)}().concat(function(){const e=t-s[0]-1;return m(g(d,e),-n,!0)}());function p(e,t){return e.reduce(((e,t)=>e-a[t]),t)}function g(e,t){return e.reduce(((e,n)=>p(e,t)>0?e.concat([n]):e),[])}function m(a,s,d){const u=function(e){return r.map(((n,a)=>({start:n-i[a]+l+e,end:n+t-l+e})))}(s);return a.map((t=>{const i=d?0:-n,a=d?n:0,r=d?"end":"start",s=u[t][r];return{index:t,loopPoint:s,slideLocation:ak(-1),translate:rk(e,c[t]),target:()=>o.get()>s?i:a}}))}const f={canLoop:function(){return h.every((({index:e})=>{const n=d.filter((t=>t!==e));return p(n,t)<=.1}))},clear:function(){h.forEach((e=>e.translate.clear()))},loop:function(){h.forEach((e=>{const{target:t,translate:n,slideLocation:i}=e,a=t();a!==i.get()&&(n.to(a),i.set(a))}))},loopPoints:h};return f}function ok(e,t,n){let i,a=!1;return{init:function(r){n&&(i=new MutationObserver((e=>{a||(OS(n)||n(r,e))&&function(e){for(const n of e)if("childList"===n.type){r.reInit(),t.emit("slidesChanged");break}}(e)})),i.observe(e,{childList:!0}))},destroy:function(){i&&i.disconnect(),a=!0}}}function ck(e,t,n,i){const a={};let r,s=null,o=null,c=!1;return{init:function(){r=new IntersectionObserver((e=>{c||(e.forEach((e=>{const n=t.indexOf(e.target);a[n]=e})),s=null,o=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:i}),t.forEach((e=>r.observe(e)))},destroy:function(){r&&r.disconnect(),c=!0},get:function(e=!0){if(e&&s)return s;if(!e&&o)return o;const t=function(e){return qS(a).reduce(((t,n)=>{const i=parseInt(n),{isIntersecting:r}=a[i];return(e&&r||!e&&!r)&&t.push(i),t}),[])}(e);return e&&(s=t),e||(o=t),t}}}function lk(e,t,n,i,a,r,s,o,c){const{startEdge:l,endEdge:d,direction:u}=e,h=TS(n);const p={groupSlides:function(e){return h?function(e,t){return NS(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?NS(e).reduce(((n,h,p)=>{const g=FS(n)||0,m=0===g,f=h===VS(e),_=a[l]-r[g][l],y=a[l]-r[h][d],v=!i&&m?u(s):0,b=RS(y-(!i&&f?u(o):0)-(_+v));return p&&b>t+c&&n.push(h),f&&n.push(e.length),n}),[]).map(((t,n,i)=>{const a=Math.max(i[n-1]||0);return e.slice(a,t)})):[]}(e)}};return p}function dk(e,t,n,i,a,r,s){const{align:o,axis:c,direction:l,startIndex:d,loop:u,duration:h,dragFree:p,dragThreshold:g,inViewThreshold:m,slidesToScroll:f,skipSnaps:_,containScroll:y,watchResize:v,watchSlides:b,watchDrag:w,watchFocus:x}=r,C={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:i,offsetHeight:a}=e;return{top:t,right:n+i,bottom:t+a,left:n,width:i,height:a}}},M=C.measure(t),S=n.map(C.measure),k=function(e,t){const n="rtl"===t,i="y"===e,a=!i&&n?-1:1,r={scroll:i?"y":"x",cross:i?"x":"y",startEdge:i?"top":n?"right":"left",endEdge:i?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return i?t:n},direction:function(e){return e*a}};return r}(c,l),E=k.measureSize(M),$=function(e){const t={measure:function(t){return e*(t/100)}};return t}(E),A=function(e,t){const n={start:function(){return 0},center:function(e){return i(e)/2},end:i};function i(e){return t-e}const a={measure:function(i,a){return jS(e)?n[e](i):e(t,i,a)}};return a}(o,E),I=!u&&!!y,z=u||!!y,{slideSizes:T,slideSizesWithGaps:j,startGap:O,endGap:D}=function(e,t,n,i,a,r){const{measureSize:s,startEdge:o,endEdge:c}=e,l=n[0]&&a,d=function(){if(!l)return 0;const e=n[0];return RS(t[o]-e[o])}(),u=function(){if(!l)return 0;const e=r.getComputedStyle(FS(i));return parseFloat(e.getPropertyValue(`margin-${c}`))}(),h=n.map(s),p=n.map(((e,t,n)=>{const i=!t,a=HS(n,t);return i?h[t]+d:a?h[t]+u:n[t+1][o]-e[o]})).map(RS);return{slideSizes:h,slideSizesWithGaps:p,startGap:d,endGap:u}}(k,M,S,n,z,a),R=lk(k,E,f,u,M,S,O,D,2),{snaps:P,snapsAligned:L}=function(e,t,n,i,a){const{startEdge:r,endEdge:s}=e,{groupSlides:o}=a,c=o(i).map((e=>FS(e)[s]-e[0][r])).map(RS).map(t.measure),l=i.map((e=>n[r]-e[r])).map((e=>-RS(e))),d=o(l).map((e=>e[0])).map(((e,t)=>e+c[t]));return{snaps:l,snapsAligned:d}}(k,A,M,S,R),N=-FS(P)+FS(j),{snapsContained:F,scrollContainLimit:V}=function(e,t,n,i,a){const r=GS(-t+e,0),s=n.map(((e,t)=>{const{min:i,max:a}=r,s=r.constrain(e),o=!t,l=HS(n,t);return o?a:l||c(i,s)?i:c(a,s)?a:s})).map((e=>parseFloat(e.toFixed(3)))),o=function(){const e=s[0],t=FS(s);return GS(s.lastIndexOf(e),s.indexOf(t)+1)}();function c(e,t){return LS(e,t)<1}return{snapsContained:function(){if(t<=e+a)return[r.max];if("keepSnaps"===i)return s;const{min:n,max:c}=o;return s.slice(n,c)}(),scrollContainLimit:o}}(E,N,L,y,2),H=I?F:L,{limit:B}=function(e,t,n){const i=t[0];return{limit:GS(n?i-e:FS(t),i)}}(N,H,u),q=YS(VS(H),d,u),U=q.clone(),W=NS(n),Z=QS(i,a,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:i}},a)=>{i||n.constrain(e.pointerDown()),t.seek(a)})(oe,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:i,scrollLooper:a,slideLooper:r,dragHandler:s,animation:o,eventHandler:c,scrollBounds:l,options:{loop:d}},u)=>{const h=e.settled(),p=!l.shouldConstrain(),g=d?h:h&&p;g&&!s.pointerDown()&&(o.stop(),c.emit("settle")),g||c.emit("scroll");const m=n.get()*u+Y.get()*(1-u);i.set(m),d&&(a.loop(e.direction()),r.loop()),t.to(i.get())})(oe,e))),Q=H[q.get()],G=ak(Q),Y=ak(Q),K=ak(Q),X=ak(Q),J=function(e,t,n,i,a,r){let s=0,o=0,c=a,l=r,d=e.get(),u=0;function h(e){return c=e,g}function p(e){return l=e,g}const g={direction:function(){return o},duration:function(){return c},velocity:function(){return s},seek:function(t){const a=t/1e3,r=c*a,h=i.get()-e.get();let p=0;return c?(n.set(e),s+=h/r,s*=l,d+=s,e.add(s*a),p=d-u):(s=0,n.set(i),e.set(i),p=h),o=PS(p),u=d,g},settled:function(){return RS(i.get()-t.get())<.001},useBaseFriction:function(){return p(r)},useBaseDuration:function(){return h(a)},useFriction:p,useDuration:h};return g}(G,K,Y,X,h,.68),ee=nk(u,H,N,B,X),te=function(e,t,n,i,a,r,s){function o(a){const o=a.distance,c=a.index!==t.get();r.add(o),o&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(a.index),s.emit("select"))}const c={distance:function(e,t){o(a.byDistance(e,t))},index:function(e,n){const i=t.clone().set(e);o(a.byIndex(i.get(),n))}};return c}(Z,q,U,J,ee,X,s),ne=function(e){const{max:t,length:n}=e,i={get:function(e){return n?(e-t)/-n:0}};return i}(B),ie=ZS(),ae=ck(t,n,s,m),{slideRegistry:re}=function(e,t,n,i,a,r){const{groupSlides:s}=a,{min:o,max:c}=i;return{slideRegistry:function(){const i=s(r),a=!e||"keepSnaps"===t;return 1===n.length?[r]:a?i:i.slice(o,c).map(((e,t,n)=>{const i=!t,a=HS(n,t);return i?BS(FS(n[0])+1):a?BS(VS(r)-FS(n)[0]+1,FS(n)[0]):e}))}()}}(I,y,H,V,R,W),se=ik(e,n,re,te,J,ie,s,x),oe={ownerDocument:i,ownerWindow:a,eventHandler:s,containerRect:M,slideRects:S,animation:Z,axis:k,dragHandler:KS(k,e,i,a,X,XS(k,a),G,Z,te,J,ee,q,s,$,p,g,_,.68,w),eventStore:ie,percentOfView:$,index:q,indexPrevious:U,limit:B,location:G,offsetLocation:K,previousLocation:Y,options:r,resizeHandler:JS(t,s,a,n,k,v,C),scrollBody:J,scrollBounds:ek(B,K,X,J,$),scrollLooper:tk(N,B,K,[G,K,Y,X]),scrollProgress:ne,scrollSnapList:H.map(ne.get),scrollSnaps:H,scrollTarget:ee,scrollTo:te,slideLooper:sk(k,E,N,T,j,P,H,K,n),slideFocus:se,slidesHandler:ok(t,s,b),slidesInView:ae,slideIndexes:W,slideRegistry:re,slidesToScroll:R,target:X,translate:rk(k,t)};return oe}const uk={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function hk(e){function t(e,t){return US(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const i=n.breakpoints||{},a=qS(i).filter((t=>e.matchMedia(t).matches)).map((e=>i[e])).reduce(((e,n)=>t(e,n)),{});return t(n,a)},optionsMediaQueries:function(t){return t.map((e=>qS(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function pk(e,t,n){const i=e.ownerDocument,a=i.defaultView,r=hk(a),s=function(e){let t=[];const n={init:function(n,i){return t=i.filter((({options:t})=>!1!==e.optionsAtMedia(t).active)),t.forEach((t=>t.init(n,e))),i.reduce(((e,t)=>Object.assign(e,{[t.name]:t})),{})},destroy:function(){t=t.filter((e=>e.destroy()))}};return n}(r),o=ZS(),c=function(){let e,t={};function n(e){return t[e]||[]}const i={init:function(t){e=t},emit:function(t){return n(t).forEach((n=>n(e,t))),i},off:function(e,a){return t[e]=n(e).filter((e=>e!==a)),i},on:function(e,a){return t[e]=n(e).concat([a]),i},clear:function(){t={}}};return i}(),{mergeOptions:l,optionsAtMedia:d,optionsMediaQueries:u}=r,{on:h,off:p,emit:g}=c,m=k;let f,_,y,v,b=!1,w=l(uk,pk.globalOptions),x=l(w),C=[];function M(t){const n=dk(e,y,v,i,a,t,c);if(t.loop&&!n.slideLooper.canLoop()){return M(Object.assign({},t,{loop:!1}))}return n}function S(t,n){b||(w=l(w,t),x=d(w),C=n||C,function(){const{container:t,slides:n}=x,i=jS(t)?e.querySelector(t):t;y=i||e.children[0];const a=jS(n)?y.querySelectorAll(n):n;v=[].slice.call(a||y.children)}(),f=M(x),u([w,...C.map((({options:e})=>e))]).forEach((e=>o.add(e,"change",k))),x.active&&(f.translate.to(f.location.get()),f.animation.init(),f.slidesInView.init(),f.slideFocus.init(I),f.eventHandler.init(I),f.resizeHandler.init(I),f.slidesHandler.init(I),f.options.loop&&f.slideLooper.loop(),y.offsetParent&&v.length&&f.dragHandler.init(I),_=s.init(I,C)))}function k(e,t){const n=A();E(),S(l({startIndex:n},e),t),c.emit("reInit")}function E(){f.dragHandler.destroy(),f.eventStore.clear(),f.translate.clear(),f.slideLooper.clear(),f.resizeHandler.destroy(),f.slidesHandler.destroy(),f.slidesInView.destroy(),f.animation.destroy(),s.destroy(),o.clear()}function $(e,t,n){x.active&&!b&&(f.scrollBody.useBaseFriction().useDuration(!0===t?0:x.duration),f.scrollTo.index(e,n||0))}function A(){return f.index.get()}const I={canScrollNext:function(){return f.index.add(1).get()!==A()},canScrollPrev:function(){return f.index.add(-1).get()!==A()},containerNode:function(){return y},internalEngine:function(){return f},destroy:function(){b||(b=!0,o.clear(),E(),c.emit("destroy"),c.clear())},off:p,on:h,emit:g,plugins:function(){return _},previousScrollSnap:function(){return f.indexPrevious.get()},reInit:m,rootNode:function(){return e},scrollNext:function(e){$(f.index.add(1).get(),e,-1)},scrollPrev:function(e){$(f.index.add(-1).get(),e,1)},scrollProgress:function(){return f.scrollProgress.get(f.location.get())},scrollSnapList:function(){return f.scrollSnapList},scrollTo:$,selectedScrollSnap:A,slideNodes:function(){return v},slidesInView:function(){return f.slidesInView.get()},slidesNotInView:function(){return f.slidesInView.get(!1)}};return S(t,n),setTimeout((()=>c.emit("init")),0),I}function gk(){return gk=Object.assign||function(e){for(var t=1;t=e;case"y":return Math.abs(a)>=e;case"z":return Math.abs(r)>=e;default:return!1}}(r,i)&&e.preventDefault(),l.isStarted?l.isMomentum&&r>Math.max(2,2*l.lastAbsDelta)&&(M(!0),x()):x(),0===r&&Object.is&&Object.is(e.deltaX,-0)?d=!0:(t=e,l.axisMovement=fk(l.axisMovement,i),l.lastAbsDelta=r,l.scrollPointsToMerge.push({axisDelta:i,timeStamp:a}),m(),p({axisDelta:i,isStart:!l.isStartPublished}),l.isStartPublished=!0,C())},m=function(){var e;l.scrollPointsToMerge.length===Mk?(l.scrollPoints.unshift({axisDeltaSum:l.scrollPointsToMerge.map((function(e){return e.axisDelta})).reduce(fk),timeStamp:(e=l.scrollPointsToMerge.map((function(e){return e.timeStamp})),e.reduce((function(e,t){return e+t}))/e.length)}),_(),l.scrollPointsToMerge.length=0,l.scrollPoints.length=1,l.isMomentum||b()):l.isStartPublished||f()},f=function(){var e;l.axisVelocity=(e=l.scrollPointsToMerge,e[e.length-1]).axisDelta.map((function(e){return e/l.willEndTimeout}))},_=function(){var e=l.scrollPoints,t=e[0],n=e[1];if(n&&t){var i=t.timeStamp-n.timeStamp;if(!(i<=0)){var a=t.axisDeltaSum.map((function(e){return e/i})),r=a.map((function(e,t){return e/(l.axisVelocity[t]||1)}));l.axisVelocity=a,l.accelerationFactors.push(r),y(i)}}},y=function(e){var t=10*Math.ceil(e/10)*1.2;l.isMomentum||(t=Math.max(100,2*t)),l.willEndTimeout=Math.min(1e3,Math.round(t))},v=function(e){return 0===e||e<=Ck&&e>=xk},b=function(){if(l.accelerationFactors.length>=Sk){if(d&&(d=!1,_k(l.axisVelocity)>=.2))return void w();var e=l.accelerationFactors.slice(-1*Sk);e.every((function(e){var t=!!e.reduce((function(e,t){return e&&e<1&&e===t?1:0})),n=e.filter(v).length===e.length;return t||n}))&&w(),l.accelerationFactors=e}},w=function(){l.isMomentum=!0},x=function(){(l=$k()).isStarted=!0,l.startTime=Date.now(),n=void 0,d=!1},C=function(){clearTimeout(i),i=setTimeout(M,l.willEndTimeout)},M=function(e){void 0===e&&(e=!1),l.isStarted&&(l.isMomentum&&e?p({isEnding:!0,isMomentumCancel:!0}):p({isEnding:!0}),l.isMomentum=!1,l.isStarted=!1)},S=function(e){var t=[],n=function(n){n.removeEventListener("wheel",e),t=t.filter((function(e){return e!==n}))};return yk({observe:function(i){return i.addEventListener("wheel",e,{passive:!1}),t.push(i),function(){return n(i)}},unobserve:n,disconnect:function(){t.forEach(n)}})}(u),k=S.observe,E=S.unobserve,$=S.disconnect;return h(e),yk({on:r,off:s,observe:k,unobserve:E,disconnect:$,feedWheel:u,updateOptions:h})}var Ik={active:!0,breakpoints:{},wheelDraggingClass:"is-wheel-dragging",forceWheelAxis:void 0,target:void 0};function zk(e){var t;void 0===e&&(e={});var n=function(){};var i={name:"wheelGestures",options:e,init:function(i,a){var r,s,o=a.mergeOptions,c=a.optionsAtMedia,l=o(Ik,zk.globalOptions),d=o(l,e);t=c(d);var u,h=i.internalEngine(),p=null!=(r=t.target)?r:i.containerNode().parentNode,g=null!=(s=t.forceWheelAxis)?s:h.options.axis,m=Ak({preventWheelAction:g,reverseSign:[!0,!0,!1]}),f=m.observe(p),_=m.on("wheel",(function(e){var i=e.axisDelta,a=i[0],r=i[1],s="x"===g?a:r,o="x"===g?r:a,c=e.isMomentum&&e.previous&&!e.previous.isMomentum,l=e.isEnding&&!e.isMomentum||c;Math.abs(s)>Math.abs(o)&&!y&&!e.isMomentum&&function(e){try{x(u=new MouseEvent("mousedown",e.event))}catch(e){return n()}y=!0,document.documentElement.addEventListener("mousemove",b,!0),document.documentElement.addEventListener("mouseup",b,!0),void document.documentElement.addEventListener("mousedown",b,!0),t.wheelDraggingClass&&p.classList.add(t.wheelDraggingClass)}(e);if(!y)return;l?function(e){y=!1,x(w("mouseup",e)),v(),t.wheelDraggingClass&&p.classList.remove(t.wheelDraggingClass)}(e):x(w("mousemove",e))})),y=!1;function v(){document.documentElement.removeEventListener("mousemove",b,!0),document.documentElement.removeEventListener("mouseup",b,!0),document.documentElement.removeEventListener("mousedown",b,!0)}function b(e){y&&e.isTrusted&&e.stopImmediatePropagation()}function w(e,t){var n,i;if(g===h.options.axis){var a=t.axisMovement;n=a[0],i=a[1]}else{var r=t.axisMovement;i=r[0],n=r[1]}if(!h.options.skipSnaps&&!h.options.dragFree){var s=h.containerRect.width,o=h.containerRect.height;n=n<0?Math.max(n,-s):Math.min(n,s),i=i<0?Math.max(i,-o):Math.min(i,o)}return new MouseEvent(e,{clientX:u.clientX+n,clientY:u.clientY+i,screenX:u.screenX+n,screenY:u.screenY+i,movementX:n,movementY:i,button:0,bubbles:!0,cancelable:!0,composed:!0})}function x(e){i.containerNode().dispatchEvent(e)}n=function(){f(),_(),v()}},destroy:function(){return n()}};return i}zk.globalOptions=void 0;class Tk{constructor(e,t,n){this._mutationObserver=new MutationObserver(((e,t)=>this._refreshCarouselContents())),this._refreshCarouselContents=()=>{const e=of(this._parent);!jy(this._carousel.slideNodes(),e)&&(this._carousel.destroy(),this._carousel=this._createCarousel(e))},this._root=e,this._parent=t,this._direction=n?.direction??"horizontal",this._transitionEffect=n?.transitionEffect??"slide",this._startIndex=n?.startIndex??0,this._dragFree=n?.dragFree??!1,this._loop=n?.loop??!1,this._draggable=n?.dragEnabled??!0,this._plugins=n?.plugins??[],this._textDirection=n?.textDirection??"ltr",this._carousel=this._createCarousel(of(this._parent)),t instanceof HTMLSlotElement&&t.addEventListener("slotchange",this._refreshCarouselContents),this._mutationObserver.observe(this._parent,{childList:!0})}destroy(){this._parent instanceof HTMLSlotElement&&this._parent.removeEventListener("slotchange",this._refreshCarouselContents),this._mutationObserver.disconnect(),this._carousel.destroy()}getSlide(e){return this._carousel.slideNodes()[e]??null}getSelectedSlide(){return this.getSlide(this.getSelectedIndex())}getSelectedIndex(){return this._carousel.selectedScrollSnap()}selectSlide(e){this._carousel.scrollTo(e,"none"===this._transitionEffect);const t=this.getSlide(e);t&&Vm(this._parent,"carousel:force-select",{index:e,element:t})}_createCarousel(e){const t=pk(this._root,{slides:e,axis:"horizontal"===this._direction?"x":"y",duration:20,startIndex:this._startIndex,dragFree:this._dragFree,loop:this._loop,containScroll:"trimSnaps",watchSlides:!1,watchResize:!0,watchDrag:this._draggable,direction:this._textDirection},[...this._plugins,...e.length>1?[zk({forceWheelAxis:"y"})]:[]]),n=()=>{const e=(()=>{const e=t.selectedScrollSnap(),n=t.slideNodes()[e]??null;return n?{index:e,element:n}:null})();e&&Vm(this._parent,"carousel:select",e)};return t.on("select",(()=>n())),t}}const jk=e=>"rtl"===getComputedStyle(e).direction?"rtl":"ltr";let Ok=class extends oe{constructor(){super(...arguments),this.direction="horizontal",this.dragEnabled=!0,this.selected=0,this._refParent=Ie(),this._refRoot=Ie(),this._carousel=null}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){this._carousel?.destroy(),this._carousel=null,super.disconnectedCallback()}willUpdate(e){e.has("direction")&&this.setAttribute("direction",this.direction);["direction","dragEnabled","dragFree","loop","plugins","transitionEffect"].some((t=>e.has(t)))&&(this._carousel?.destroy(),this._carousel=null)}render(){return q`
+ +
+
+ +
+
+ +
`}updated(e){!this._carousel&&this._refRoot.value&&this._refParent.value?this._carousel=new Tk(this._refRoot.value,this._refParent.value,{direction:this.direction,dragEnabled:this.dragEnabled,dragFree:this.dragFree,startIndex:this.selected,transitionEffect:this.transitionEffect,loop:this.loop,plugins:this.plugins,textDirection:jk(this)}):e.has("selected")&&this._carousel?.selectSlide(this.selected)}static get styles(){return s(":host {\n display: block;\n height: 100%;\n width: 100%;\n position: relative;\n}\n\n.embla {\n width: 100%;\n height: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.embla__container {\n display: flex;\n width: 100%;\n height: 100%;\n user-select: none;\n -webkit-touch-callout: none;\n -khtml-user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n:host([direction=vertical]) .embla__container {\n flex-direction: column;\n}\n\n:host([direction=horizontal]) .embla__container {\n flex-direction: row;\n}\n\n.embla__viewport {\n width: 100%;\n height: 100%;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n.embla__viewport.is-draggable {\n cursor: move;\n cursor: grab;\n}\n\n.embla__viewport.is-dragging {\n cursor: grabbing;\n}\n\n:host([direction=vertical]) ::slotted(.embla__slide) {\n margin-bottom: 5px;\n}\n\n:host([direction=horizontal]) ::slotted(.embla__slide) {\n margin-right: 5px;\n}")}};e([he({attribute:!0,reflect:!0})],Ok.prototype,"direction",void 0),e([he({attribute:!0})],Ok.prototype,"transitionEffect",void 0),e([he({attribute:!1})],Ok.prototype,"loop",void 0),e([he({attribute:!1})],Ok.prototype,"dragFree",void 0),e([he({attribute:!1})],Ok.prototype,"dragEnabled",void 0),e([he({attribute:!1})],Ok.prototype,"plugins",void 0),e([he({attribute:!1})],Ok.prototype,"selected",void 0),Ok=e([le("frigate-card-carousel")],Ok); +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Dk=window,Rk=Dk.ShadowRoot&&(void 0===Dk.ShadyCSS||Dk.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pk=Symbol(),Lk=new WeakMap;let Nk=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Pk)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Rk&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Lk.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Lk.set(t,e))}return e}toString(){return this.cssText}};const Fk=(e,t)=>{Rk?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const n=document.createElement("style"),i=Dk.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=t.cssText,e.appendChild(n)}))},Vk=Rk?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Nk("string"==typeof e?e:e+"",void 0,Pk))(t)})(e):e +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;var Hk;const Bk=window,qk=Bk.trustedTypes,Uk=qk?qk.emptyScript:"",Wk=Bk.reactiveElementPolyfillSupport,Zk={toAttribute(e,t){switch(t){case Boolean:e=e?Uk:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},Qk=(e,t)=>t!==e&&(t==t||e==e),Gk={attribute:!0,type:String,converter:Zk,reflect:!1,hasChanged:Qk},Yk="finalized";class Kk extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,n)=>{const i=this._$Ep(n,t);void 0!==i&&(this._$Ev.set(i,n),e.push(i))})),e}static createProperty(e,t=Gk){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const a=this[e];this[t]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Gk}static finalize(){if(this.hasOwnProperty(Yk))return!1;this[Yk]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of t)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(Vk(e))}else void 0!==e&&t.push(Vk(e));return t}static _$Ep(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,n;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return Fk(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=Gk){var i;const a=this.constructor._$Ep(e,n);if(void 0!==a&&!0===n.reflect){const r=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:Zk).toAttribute(t,n.type);this._$El=e,null==r?this.removeAttribute(a):this.setAttribute(a,r),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,a=i._$Ev.get(e);if(void 0!==a&&this._$El!==a){const e=i.getPropertyOptions(a),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(n=e.converter)||void 0===n?void 0:n.fromAttribute)?e.converter:Zk;this._$El=a,this[a]=r.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Qk)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(n)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}Kk[Yk]=!0,Kk.elementProperties=new Map,Kk.elementStyles=[],Kk.shadowRootOptions={mode:"open"},null==Wk||Wk({ReactiveElement:Kk}),(null!==(Hk=Bk.reactiveElementVersions)&&void 0!==Hk?Hk:Bk.reactiveElementVersions=[]).push("1.6.3"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const Xk=0,Jk=Symbol();class eE{constructor(e,t,n){this.o=0,this.status=0,this.autoRun=!0,this.i=e,this.i.addController(this);const i="object"==typeof t?t:{task:t,args:n};this.t=i.task,this.h=i.args,void 0!==i.autoRun&&(this.autoRun=i.autoRun),this.taskComplete=new Promise(((e,t)=>{this.l=e,this.u=t}))}hostUpdated(){this.performTask()}async performTask(){var e;const t=null===(e=this.h)||void 0===e?void 0:e.call(this);this.shouldRun(t)&&this.run(t)}shouldRun(e){return this.autoRun&&this.v(e)}async run(e){var t;let n,i;null!=e||(e=null===(t=this.h)||void 0===t?void 0:t.call(this)),2!==this.status&&3!==this.status||(this.taskComplete=new Promise(((e,t)=>{this.l=e,this.u=t}))),this.status=1,this._=void 0,this.m=void 0,this.i.requestUpdate();const a=++this.o;try{n=await this.t(e)}catch(e){i=e}this.o===a&&(n===Jk?this.status=0:(void 0===i?(this.status=2,this.l(n)):(this.status=3,this.u(i)),this.m=n,this._=i),this.i.requestUpdate())}get value(){return this.m}get error(){return this._}render(e){var t,n,i,a;switch(this.status){case 0:return null===(t=e.initial)||void 0===t?void 0:t.call(e);case 1:return null===(n=e.pending)||void 0===n?void 0:n.call(e);case 2:return null===(i=e.complete)||void 0===i?void 0:i.call(e,this.value);case 3:return null===(a=e.error)||void 0===a?void 0:a.call(e,this.error);default:this.status}}v(e){const t=this.T;return this.T=e,Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.some(((e,n)=>Qk(e,t[n]))):e!==t}}class tE{constructor(e){this._keys=e}modify(e){this._keys.forEach((t=>e.removeContext(t)))}}var nE=":host {\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-left: 5px;\n padding: 5px;\n color: var(--primary-text-color);\n overflow: hidden;\n column-gap: 5%;\n}\n\ndiv.title {\n font-size: 1.2rem;\n font-weight: bold;\n}\n\ndiv.details {\n flex: 1;\n justify-content: center;\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n --mdc-icon-size: 16px;\n min-height: 0px;\n}\n\ndiv.details div {\n display: flex;\n align-items: center;\n}\n\ndiv.details div * {\n margin: 0px 3px;\n}";const iE=(e,t,n)=>{const i={...n?.cardWideConfig&&{cardWideConfig:n.cardWideConfig}};return q` ${e.render({initial:()=>n?.inProgressFunc?.()??sS(i),pending:()=>n?.inProgressFunc?.()??sS(i),error:e=>{Zm(e),n?.errorFunc&&n.errorFunc(e)},complete:t})}`},aE=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,rE=(e,t,n,i=!0)=>new eE(e,{args:()=>[!!t(),n()],task:async([e,n])=>{const i=t();return e&&i&&n?(async(e,t)=>e&&t?t.startsWith("data:")||t.match(aE)?t:new Promise(((n,i)=>{e?e.fetchWithAuth(t).then((e=>e.blob())).then((e=>{const t=new FileReader;t.onload=()=>{const e=t.result;n("string"==typeof e?e:null)},t.onerror=e=>i(e),t.readAsDataURL(e)})).catch((e=>i(e))):i()})):null)(i,n):null},autoRun:i}),sE=300;let oE=class extends oe{constructor(){super(),this._thumbnailError=!1,this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this))}connectedCallback(){this._intersectionObserver.observe(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver.disconnect()}willUpdate(e){e.has("thumbnail")&&(this._embedThumbnailTask=rE(this,(()=>this.hass),(()=>this.thumbnail),!1),this._intersectionObserver.unobserve(this),this._intersectionObserver.observe(this))}_intersectionHandler(e){this._embedThumbnailTask?.status===Xk&&e.some((e=>e.isIntersecting))&&this._embedThumbnailTask?.run()}render(){const e=q` `;return!this._embedThumbnailTask||this._thumbnailError?e:q`${this.thumbnail?iE(this._embedThumbnailTask,(e=>e?q``:q``),{inProgressFunc:()=>e,errorFunc:()=>{this._thumbnailError=!0}}):e} `}static get styles(){return s(":host {\n display: block;\n overflow: hidden;\n aspect-ratio: 1/1;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\nimg {\n display: block;\n}\n\nimg,\nfrigate-card-icon {\n display: inline-block;\n vertical-align: top;\n margin: 0;\n border-radius: var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px));\n width: var(--frigate-card-thumbnail-size);\n max-height: 100%;\n aspect-ratio: 1/1;\n object-fit: cover;\n}\n\nfrigate-card-icon {\n --mdc-icon-size: 50%;\n color: var(--primary-text-color);\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(255, 255, 255, 0.3);\n box-sizing: border-box;\n opacity: 0.2;\n}")}};e([he({attribute:!1})],oE.prototype,"thumbnail",void 0),e([he({attribute:!1})],oE.prototype,"hass",void 0),e([pe()],oE.prototype,"_thumbnailError",void 0),oE=e([le("frigate-card-thumbnail-feature-thumbnail")],oE);let cE=class extends oe{render(){if(this.date)return q` + ${this.cameraMetadata?.engineIcon?q``:""} +
+
${qu(this.date,"HH:mm")}
+
${qu(this.date,"MMM do")}
+ ${this.showCameraTitle&&this.cameraMetadata?.title?q`
${this.cameraMetadata.title}
`:q``} +
+ `}static get styles(){return s(":host {\n display: block;\n max-width: var(--frigate-card-thumbnail-size);\n max-height: var(--frigate-card-thumbnail-size);\n aspect-ratio: 1/1;\n border: 1px solid var(--secondary-color);\n background-color: var(--secondary-background-color);\n border-radius: var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px));\n overflow: hidden;\n padding: 10px;\n box-sizing: border-box;\n position: relative;\n}\n\nfrigate-card-icon.background {\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n inset: 0;\n padding: 10%;\n box-sizing: border-box;\n pointer-events: none;\n opacity: 0.1;\n}\n\ndiv.content {\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n color: var(--primary-text-color);\n}\n\ndiv {\n text-align: center;\n}\n\ndiv.title {\n font-size: 1.5rem;\n}\n\ndiv.camera {\n font-size: 0.7em;\n}")}};e([he({attribute:!1})],cE.prototype,"date",void 0),e([he({attribute:!1})],cE.prototype,"cameraMetadata",void 0),e([he({attribute:!1})],cE.prototype,"showCameraTitle",void 0),cE=e([le("frigate-card-thumbnail-feature-text")],cE);let lE=class extends oe{render(){if(!this.media)return;const e=this.media.getScore(),t=e?(100*e).toFixed(2)+"%":null,n=this.media.getStartTime(),i=n?Gm(n):null,a=this.media.getEndTime(),r=n&&a?Xm(n,a):null,s=this.media.inProgress()?N_("event.in_progress"):null,o=Hm(this.media.getWhat()?.join(", "))??null,c=Hm(this.media.getWhere()?.join(", "))??null,l=Hm(this.media.getTags()?.join(", "))??null,d=o||l?(o??"")+(o&&l?": ":"")+(l??""):null,u=this.seek?qu(this.seek,"HH:mm:ss"):null;return q` + ${d?q`
+ ${d} + ${t?q`${t}`:""} +
`:""} +
+ ${i?q`
+ + ${i} +
+ ${r||s?q`
+ + ${r?q`${r}`:""} + ${s?q`${s}`:""} +
`:""}`:""} + ${this.cameraTitle?q`
+ + ${this.cameraTitle} +
`:""} + ${c?q`
+ + ${c} +
`:q``} + ${l?q`
+ + ${l} +
`:q``} + ${u?q`
+ + ${u} +
`:q``} +
+ `}static get styles(){return s(nE)}};e([he({attribute:!1})],lE.prototype,"media",void 0),e([he({attribute:!1})],lE.prototype,"seek",void 0),e([he({attribute:!1})],lE.prototype,"cameraTitle",void 0),lE=e([le("frigate-card-thumbnail-details-event")],lE);let dE=class extends oe{render(){if(!this.media)return;const e=this.media.getStartTime(),t=e?Gm(e):null,n=this.media.getEndTime(),i=e&&n?Xm(e,n):null,a=this.media.inProgress()?N_("recording.in_progress"):null,r=this.seek?qu(this.seek,"HH:mm:ss"):null,s=this.media.getEventCount();return q` + ${this.cameraTitle?q`
+ ${this.cameraTitle} +
`:""} +
+ ${t?q`
+ + ${t} +
+ ${i||a?q`
+ + ${i?q`${i}`:""} + ${a?q`${a}`:""} +
`:""}`:""} + ${r?q`
+ + ${r} +
`:q``} + ${null!==s?q`
+ + ${s} +
`:""} +
+ `}static get styles(){return s(nE)}};e([he({attribute:!1})],dE.prototype,"media",void 0),e([he({attribute:!1})],dE.prototype,"seek",void 0),e([he({attribute:!1})],dE.prototype,"cameraTitle",void 0),dE=e([le("frigate-card-thumbnail-details-recording")],dE);let uE=class extends oe{constructor(){super(...arguments),this.details=!1,this.show_favorite_control=!1,this.show_timeline_control=!1,this.show_download_control=!1}render(){if(!this.media||!this.cameraManager||!this.hass)return;const e=this.media.getThumbnail(),t=this.media.getTitle()??"",n={star:!0,starred:!!this.media?.isFavorite()},i=this.show_timeline_control&&(!Pw.isRecording(this.media)||this.media.getStartTime()&&this.media.getEndTime()),a=this.cameraManager?.getMediaCapabilities(this.media),r=this.show_favorite_control&&this.media&&this.hass&&a?.canFavorite,s=this.show_download_control&&this.hass&&this.media.getID()&&a?.canDownload,o=this.cameraManager.getCameraMetadata(this.media.getCameraID());return q` + ${Pw.isEvent(this.media)&&e?q``:Pw.isEvent(this.media)||Pw.isRecording(this.media)?q``:q``} + ${r?q` {if(vf(e),this.hass&&this.media){try{await(this.cameraManager?.favoriteMedia(this.media,!this.media?.isFavorite()))}catch(e){return void Zm(e)}this.requestUpdate()}}} + />`:""} + ${this.details&&Pw.isEvent(this.media)?q``:this.details&&Pw.isRecording(this.media)?q``:q``} + ${i?q`{vf(e),this.viewManagerEpoch&&this.media&&this.viewManagerEpoch.manager.setViewByParameters({params:{view:"timeline",queryResults:this.viewManagerEpoch?.manager.getView()?.queryResults?.clone().selectResultIfFound((e=>e===this.media))},modifiers:[new tE(["timeline"])]})}} + >`:""} + ${s?q` {if(vf(e),this.hass&&this.cameraManager&&this.media)try{await lw(this.hass,this.cameraManager,this.media)}catch(e){cS(this,e)}}} + >`:""} + `}static get styles(){return s(":host {\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n transition: transform 0.2s linear;\n}\n\n:host(:not([details])) {\n aspect-ratio: 1/1;\n}\n\n:host([details]) {\n border: 1px solid var(--primary-color);\n border-radius: var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px));\n padding: 2px;\n background-color: var(--primary-background-color, black);\n}\n\n:host(:hover) {\n transform: scale(1.04);\n}\n\nfrigate-card-icon {\n position: absolute;\n border-radius: 50%;\n opacity: 0.5;\n color: var(--primary-color);\n cursor: pointer;\n transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;\n}\n\nfrigate-card-icon:hover {\n opacity: 1;\n}\n\nfrigate-card-icon.star {\n top: 3px;\n left: 3px;\n}\n\nfrigate-card-icon.star.starred {\n color: gold;\n}\n\nfrigate-card-icon.timeline {\n top: 3px;\n right: 3px;\n}\n\nfrigate-card-icon.download {\n right: 3px;\n bottom: 3px;\n}\n\nfrigate-card-thumbnail-details-event,\nfrigate-card-thumbnail-details-recording {\n flex: 1;\n}")}};e([he({attribute:!1})],uE.prototype,"cameraManager",void 0),e([he({attribute:!1})],uE.prototype,"media",void 0),e([he({attribute:!0,type:Boolean})],uE.prototype,"details",void 0),e([he({attribute:!0,type:Boolean})],uE.prototype,"show_favorite_control",void 0),e([he({attribute:!0,type:Boolean})],uE.prototype,"show_timeline_control",void 0),e([he({attribute:!0,type:Boolean})],uE.prototype,"show_download_control",void 0),e([he({attribute:!1})],uE.prototype,"seek",void 0),uE=e([le("frigate-card-thumbnail")],uE);let hE=class extends oe{constructor(){super(...arguments),this.fadeThumbnails=!1,this._thumbnailSlides=[]}willUpdate(e){if(e.has("config")){this.config?.size&&this.style.setProperty("--frigate-card-thumbnail-size",`${this.config.size}px`);const e=this._getDirection();e?this.setAttribute("direction",e):this.removeAttribute("direction")}["cameraManager","config","transitionEffect","viewManagerEpoch"].some((t=>e.has(t)))&&(this._thumbnailSlides=this._renderSlides()),e.has("viewManagerEpoch")&&this.style.setProperty("--frigate-card-carousel-thumbnail-opacity",this.fadeThumbnails&&null!==this._getSelectedSlide()?"0.4":"1.0")}_getSelectedSlide(){return this.viewManagerEpoch?.manager.getView()?.queryResults?.getSelectedIndex()??null}_renderSlides(){const e=[],t=this.viewManagerEpoch?.manager.getView(),n=t?.context?.mediaViewer?.seek,i=this._getSelectedSlide();for(const a of t?.queryResults?.getResults()??[]){const t=e.length,r={embla__slide:!0,"slide-selected":i===t};e.push(q` {const n=this.viewManagerEpoch?.manager.getView();n&&n.queryResults&&Vm(this,"thumbnail-carousel:tap",{queryResults:n.queryResults.clone().selectIndex(t)}),vf(e)}} + > + `)}return e}_getDirection(){return"left"===this.config?.mode||"right"===this.config?.mode?"vertical":"above"===this.config?.mode||"below"===this.config?.mode?"horizontal":null}render(){const e=this._getDirection();if(this._thumbnailSlides.length&&this.config&&e)return q` + ${this._thumbnailSlides} + `}static get styles(){return s(":host {\n --frigate-card-thumbnail-size-max: 300px;\n --frigate-card-thumbnail-details-width: calc(\n var(--frigate-card-thumbnail-size) + 200px\n );\n}\n\n:host {\n display: block;\n width: 100%;\n height: 100%;\n --frigate-card-carousel-thumbnail-opacity: 1;\n}\n\n:host([direction=vertical]) {\n height: 100%;\n}\n\n:host([direction=horizontal]) {\n height: auto;\n}\n\n.embla__slide {\n flex: 0 0 auto;\n opacity: var(--frigate-card-carousel-thumbnail-opacity);\n}\n\n.embla__slide.slide-selected {\n opacity: 1;\n}\n\nfrigate-card-thumbnail {\n width: var(--frigate-card-thumbnail-size);\n height: var(--frigate-card-thumbnail-size);\n max-width: 100%;\n}\n\nfrigate-card-thumbnail[details] {\n width: var(--frigate-card-thumbnail-details-width);\n}")}};e([he({attribute:!1})],hE.prototype,"hass",void 0),e([he({attribute:!1})],hE.prototype,"viewManagerEpoch",void 0),e([he({attribute:!1})],hE.prototype,"cameraManager",void 0),e([he({attribute:!1})],hE.prototype,"config",void 0),e([he({attribute:!1})],hE.prototype,"fadeThumbnails",void 0),hE=e([le("frigate-card-thumbnail-carousel")],hE);var pE=":host {\n width: 100%;\n height: 100%;\n display: block;\n}";const gE=document.createElement("template");gE.innerHTML='\n
\n
\n';class mE extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"});e.appendChild(gE.content.cloneNode(!0)),this._freeSpaceDiv=e.getElementById("fs")}connectedCallback(){this._freeSpaceDiv&&this._freeSpaceDiv.addEventListener("click",this.handleFreeSpaceDivClick),this.upgradeProperty("open")}disconnectedCallback(){document.removeEventListener("keyup",this.handleKeyUp)}upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}handleKeyUp=e=>{if(!e.altKey&&"Escape"===e.key)e.preventDefault(),this.open=!1};get open(){return this.hasAttribute("open")}set open(e){e?this.hasAttribute("open")||this.setAttribute("open",""):this.hasAttribute("open")&&this.removeAttribute("open")}static get observedAttributes(){return["open"]}attributeChangedCallback(e,t,n){"open"===e&&(this.open?(this.setAttribute("tabindex","0"),this.setAttribute("aria-disabled","false"),this.focus({preventScroll:!0}),document.addEventListener("keyup",this.handleKeyUp),this.dispatchEvent(new CustomEvent("open",{bubbles:!0}))):(this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled","true"),document.removeEventListener("keyup",this.handleKeyUp),this.dispatchEvent(new CustomEvent("close",{bubbles:!0}))))}handleFreeSpaceDivClick=()=>{this.open=!1}}customElements.define("side-drawer",mE);let fE=class extends oe{constructor(){super(...arguments),this.location="left",this.control=!0,this.open=!1,this.empty=!0,this._refDrawer=Ie(),this._refSlot=Ie(),this._resizeObserver=new ResizeObserver((()=>this._hideDrawerIfNecessary())),this._isHoverableDevice=Qm()}firstUpdated(e){super.firstUpdated(e);const t=document.createElement("style");t.innerHTML=":host {\n width: unset;\n}\n\n#fs {\n display: none;\n width: 100%;\n inset: 0;\n}\n\n#d,\n#fs {\n height: 100%;\n position: absolute;\n}\n\n#d {\n overflow: visible;\n max-width: 90%;\n z-index: 10;\n}\n\n:host([location=right]) #d {\n left: unset;\n right: 0;\n transform: translateX(100%);\n}\n\n:host([location=right][open]) #d {\n transform: none;\n box-shadow: var(--frigate-card-css-box-shadow, 0px 0px 25px 0px black);\n}\n\n#ifs {\n height: 100%;\n}",this._refDrawer.value?.shadowRoot?.appendChild(t)}_slotChanged(){const e=this._refSlot.value?of(this._refSlot.value):[];this._resizeObserver.disconnect();for(const t of e)this._resizeObserver.observe(t);this._hideDrawerIfNecessary()}_hideDrawerIfNecessary(){if(!this._refDrawer.value)return;const e=this._refSlot.value?of(this._refSlot.value):null;this.empty=!e||!e.length||e.every((e=>{const t=e.getBoundingClientRect();return!t.width||!t.height}))}render(){return q` + {this.open&&(this.open=!1)}} + > + ${this.control?q` +
{vf(e),this.open=!this.open}} + > + {this._isHoverableDevice&&!this.open&&(this.open=!0)}} + > + +
+ `:""} + this._slotChanged()}> +
+ `}static get styles(){return s("side-drawer {\n background-color: var(--card-background-color);\n}\n\ndiv.control-surround {\n position: absolute;\n bottom: 50%;\n transform: translateY(50%);\n z-index: 0;\n padding-top: 20px;\n padding-bottom: 20px;\n}\n\n:host([location=left]) div.control-surround {\n padding-right: 12px;\n left: 100%;\n}\n\n:host([location=right]) div.control-surround {\n padding-left: 12px;\n right: 100%;\n}\n\n:host([empty]),\n:host([empty]) > * {\n visibility: hidden;\n}\n\n:host(:not([empty])),\n:host(:not([empty])) > * {\n visibility: visible;\n}\n\nfrigate-card-icon.control {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.7);\n opacity: 0.5;\n pointer-events: all;\n --mdc-icon-size: 20px;\n padding-top: 20px;\n padding-bottom: 20px;\n transition: opacity 0.5s ease;\n}\n\n:host([open]) frigate-card-icon.control,\nfrigate-card-icon.control:hover {\n opacity: 1;\n background-color: black;\n}\n\n:host([location=left]) frigate-card-icon.control {\n border-top-right-radius: 20px;\n border-bottom-right-radius: 20px;\n}\n\n:host([location=right]) frigate-card-icon.control {\n border-top-left-radius: 20px;\n border-bottom-left-radius: 20px;\n}")}};e([he({attribute:!0,reflect:!0})],fE.prototype,"location",void 0),e([he({attribute:!0,reflect:!0,type:Boolean})],fE.prototype,"control",void 0),e([he({type:Boolean,reflect:!0,attribute:!0})],fE.prototype,"open",void 0),e([he({attribute:!1})],fE.prototype,"icons",void 0),e([he({type:Boolean,reflect:!0,attribute:!0})],fE.prototype,"empty",void 0),fE=e([le("frigate-card-drawer")],fE);let _E=class extends oe{constructor(){super(...arguments),this._refDrawerLeft=Ie(),this._refDrawerRight=Ie(),this._boundDrawerHandler=this._drawerHandler.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("frigate-card:drawer:open",this._boundDrawerHandler),this.addEventListener("frigate-card:drawer:close",this._boundDrawerHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("frigate-card:drawer:open",this._boundDrawerHandler),this.removeEventListener("frigate-card:drawer:close",this._boundDrawerHandler)}_drawerHandler(e){const t=e.detail.drawer,n=e.type.endsWith(":open");"left"===t&&this._refDrawerLeft.value?this._refDrawerLeft.value.open=n:"right"===t&&this._refDrawerRight.value&&(this._refDrawerRight.value.open=n)}render(){return q` + + + + + + + + `}static get styles(){return s(":host {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: hidden;\n}\n\n::slotted(:not([slot])) {\n flex: 1;\n min-height: 0px;\n}")}};e([he({attribute:!1})],_E.prototype,"drawerIcons",void 0),_E=e([le("frigate-card-surround-basic")],_E);let yE=class extends oe{_hasDrawer(){return!!this.thumbnailConfig&&["left","right"].includes(this.thumbnailConfig.mode)}willUpdate(e){this.timelineConfig?.mode&&"none"!==this.timelineConfig.mode&&import("./timeline-core-14147786.js");const t=this.viewManagerEpoch?.manager.getView();e.has("viewManagerEpoch")&&(this.viewManagerEpoch?.manager.hasMajorMediaChange(this.viewManagerEpoch?.oldView)||this.viewManagerEpoch?.oldView?.displayMode!==t?.displayMode)&&(this._cameraIDsForTimeline=this._getCameraIDsForTimeline()??void 0)}_getCameraIDsForTimeline(){const e=this.viewManagerEpoch?.manager.getView();if(!e||!this.cameraManager)return null;if(e.is("live")){const t={anyCapabilities:["clips","snapshots","recordings"]};return e.supportsMultipleDisplayModes()&&e.isGrid()?this.cameraManager.getStore().getCameraIDsWithCapability(t):this.cameraManager.getStore().getAllDependentCameras(e.camera,t)}return e.isViewerView()?e.query?.getQueryCameraIDs()??null:null}render(){const e=this.viewManagerEpoch?.manager.getView();if(!this.hass||!e)return;const t=(e,t)=>{this.thumbnailConfig&&this._hasDrawer()&&Vm(e.composedPath()[0],"drawer:"+t,{drawer:this.thumbnailConfig.mode})};return q` t(e,"open")} + @frigate-card:thumbnails:close=${e=>t(e,"close")} + > + ${this.thumbnailConfig&&"none"!==this.thumbnailConfig.mode?q` {const n=e.detail.queryResults.getSelectedResult();n&&(this.viewManagerEpoch?.manager.setViewByParameters({params:{view:"media",queryResults:e.detail.queryResults,...n.getCameraID()&&{camera:n.getCameraID()}},modifiers:[new tE(["timeline","mediaViewer"])]}),t(e,"close"))}} + > + `:""} + ${this.timelineConfig&&"none"!==this.timelineConfig.mode?q` + `:""} + + `}static get styles(){return s(pE)}};e([he({attribute:!1})],yE.prototype,"hass",void 0),e([he({attribute:!1})],yE.prototype,"viewManagerEpoch",void 0),e([he({attribute:!1,hasChanged:Wm})],yE.prototype,"thumbnailConfig",void 0),e([he({attribute:!1,hasChanged:Wm})],yE.prototype,"timelineConfig",void 0),e([he({attribute:!1})],yE.prototype,"cameraManager",void 0),e([he({attribute:!1})],yE.prototype,"cardWideConfig",void 0),yE=e([le("frigate-card-surround")],yE);var vE="Tue, 24 Dec 2024 00:23:18 GMT",bE="bc95f55",wE="Mon, 23 Dec 2024 16:22:10 -0800";const xE=bi.object({domain:bi.string(),version:bi.string().optional()}).passthrough(),CE="hass_web_proxy",ME=(e,t)=>`/api/${CE}/v${t??0}/?url=${encodeURIComponent(e)}`,SE=(e,t,n="media")=>(e=>e.config.components.includes(CE))(e)&&!!t[n];async function kE(e,t,n){await e.callService(CE,"create_proxied_url",{url_pattern:t,...n&&{url_id:n.urlID,ssl_verification:n.sslVerification,ssl_ciphers:n.sslCiphers,open_limit:n.openLimit,ttl:n.ttl,allow_unauthenticated:n.allowUnauthenticated}})}const EE=async(e,t)=>{let n=null;if(t)try{n=await(async(e,t)=>await ky(e,xE,{type:"manifest/get",integration:t}))(t,e)}catch(e){}return{detected:!!n,...n?.version&&{version:n.version}}};let $E=class extends oe{constructor(){super(...arguments),this._diagnostics=null}async _fetchDiagnostics(){this._diagnostics=await(async(e,t,n)=>{const i=e&&t?await t.getMatchingDevices(e,(e=>"Frigate"===e.manufacturer)):[],a=new Map;return i?.forEach((e=>{e.config_entries.forEach((t=>{e.model&&a.set(t,e.model)}))})),{card_version:"6.1.2",browser:navigator.userAgent,date:new Date,lang:L_(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,git:{hash:bE,build_date:vE,commit_date:wE},...e&&{ha_version:e.config.version},custom_integrations:{frigate:{...await EE("frigate",e),...a.size&&{devices:Object.fromEntries(a)}},hass_web_proxy:await EE(CE,e)},...n&&{config:n}}})(this.hass,this.deviceRegistryManager,this.rawConfig)}shouldUpdate(){return!!this._diagnostics||(this._fetchDiagnostics().then((()=>this.requestUpdate())),!1)}render(){return rS({message:N_("error.diagnostics"),type:"diagnostics",icon:"mdi:information",context:this._diagnostics})}static get styles(){return s(pE)}};e([he({attribute:!1})],$E.prototype,"hass",void 0),e([he({attribute:!1})],$E.prototype,"deviceRegistryManager",void 0),e([he({attribute:!1})],$E.prototype,"rawConfig",void 0),e([pe()],$E.prototype,"_diagnostics",void 0),$E=e([le("frigate-card-diagnostics")],$E);let AE=class extends oe{willUpdate(e){if(e.has("viewManagerEpoch")||e.has("config")){const e=this.viewManagerEpoch?.manager.getView();(e?.is("live")||this._shouldLivePreload())&&import("./index-dd357256.js"),e?.isGalleryView()?import("./gallery-f478918c.js"):e?.isViewerView()?import("./index-befc50c0.js"):e?.is("image")?import("./image-04d4df35.js"):e?.is("timeline")&&import("./timeline-b24153cf.js")}e.has("hide")&&(this.hide?this.setAttribute("hidden",""):this.removeAttribute("hidden"))}shouldUpdate(e){return!0}_shouldLivePreload(){const e=this.viewManagerEpoch?.manager.getView();return!!this.overriddenConfig?.live.preload&&!e?.is("diagnostics")}render(){if(!(this.hass&&this.overriddenConfig&&this.nonOverriddenConfig&&this.cardWideConfig))return q``;const e=this.viewManagerEpoch?.manager.getView(),t={hidden:this._shouldLivePreload()&&!e?.is("live")},n={hidden:!!this.hide},i=e?.is("live")?this.overriddenConfig.live.controls.thumbnails:e?.isViewerView()?this.overriddenConfig.media_viewer.controls.thumbnails:e?.is("timeline")?this.overriddenConfig.timeline.controls.thumbnails:void 0,a=e?.is("live")?this.overriddenConfig.live.controls.timeline:e?.isViewerView()?this.overriddenConfig.media_viewer.controls.timeline:void 0,r=e?this.cameraManager?.getStore().getCameraConfig(e.camera)??null:null;return q` + ${!this.hide&&e?.is("image")&&r?q` + `:""} + ${!this.hide&&e?.isGalleryView()?q` + `:""} + ${!this.hide&&e?.isViewerView()?q` + + + `:""} + ${!this.hide&&e?.is("timeline")?q` + `:""} + ${!this.hide&&e?.is("diagnostics")?q` + `:""} + ${this._shouldLivePreload()||!this.hide&&e?.is("live")?q` + + + `:""} + `}static get styles(){return s(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n:host([hidden]),\n.hidden {\n display: none;\n}")}};e([he({attribute:!1})],AE.prototype,"hass",void 0),e([he({attribute:!1})],AE.prototype,"viewManagerEpoch",void 0),e([he({attribute:!1})],AE.prototype,"cameraManager",void 0),e([he({attribute:!1})],AE.prototype,"nonOverriddenConfig",void 0),e([he({attribute:!1})],AE.prototype,"overriddenConfig",void 0),e([he({attribute:!1})],AE.prototype,"cardWideConfig",void 0),e([he({attribute:!1})],AE.prototype,"rawConfig",void 0),e([he({attribute:!1})],AE.prototype,"resolvedMediaCache",void 0),e([he({attribute:!1})],AE.prototype,"conditionsManagerEpoch",void 0),e([he({attribute:!1})],AE.prototype,"hide",void 0),e([he({attribute:!1})],AE.prototype,"microphoneManager",void 0),e([he({attribute:!1})],AE.prototype,"triggeredCameraIDs",void 0),e([he({attribute:!1})],AE.prototype,"deviceRegistryManager",void 0),AE=e([le("frigate-card-views")],AE);console.info(`%c FRIGATE-HASS-CARD \n%c ${N_("common.version")} 6.1.2`,"color: pink; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"frigate-card",name:N_("common.frigate_card"),description:N_("common.frigate_card_description"),preview:!0,documentationURL:"https://github.com/dermotduffy/frigate-hass-card"});let IE=class extends oe{constructor(){super(...arguments),this._controller=new ux(this,(()=>this._refMain.value?.scroll({top:0})),(()=>this._refMenu.value?.toggleMenu()),this._requestUpdateForComponentsThatUseConditions.bind(this)),this._menuButtonController=new hx,this._refMenu=Ie(),this._refOverlay=Ie(),this._refMain=Ie(),this._refElements=Ie(),this._refViews=Ie()}get _config(){return this._controller.getConfigManager().getConfig()}get _hass(){return this._controller.getHASSManager().getHASS()}set hass(e){this._controller.getHASSManager().setHASS(e),this._refMenu.value&&(this._refMenu.value.hass=e),this._refElements.value&&(this._refElements.value.hass=e),this._refViews.value&&(this._refViews.value.hass=e)}static async getConfigElement(){return await ux.getConfigElement()}static getStubConfig(e,t){return ux.getStubConfig(t)}_requestUpdateForComponentsThatUseConditions(){this._refViews.value&&(this._refViews.value.conditionsManagerEpoch=this._controller.getConditionsManager().getEpoch()??void 0),this._refElements.value&&(this._refElements.value.conditionsManagerEpoch=this._controller.getConditionsManager().getEpoch()??void 0)}setConfig(e){this._controller.getConfigManager().setConfig(e)}shouldUpdate(){return!!this.isConnected&&(this._controller.getMessageManager().hasMessage()||this._controller.getInitializationManager().isInitializedMandatory()||this._controller.getInitializationManager().initializeMandatory(),!0)}_renderMenuStatusContainer(e){if(!this._config)return;const t=this._config.menu.style,n=this._config.menu.position,i=this._config.status_bar.style,a=this._config.status_bar.position;if("none"===t&&"none"===i||"overlay"===e&&"outside"===t&&"outside"===i||"overlay"!==e&&("outside"!==t||n!==e)&&("outside"!==i||a!==e))return;const r=e=>{const r="none"!==t&&("outside"===t&&"outerlay"===e||"outside"!==t&&"overlay"===e),s="none"!==i&&("outside"===i&&"outerlay"===e||"outside"!==i&&"overlay"===e),o="left"===n||"right"===n||"bottom"===n&&"hidden"===t&&"popup"!==i||"top"===n&&("hidden"!==t||"popup"===i);return q` + ${r&&o?this._renderMenu(n):""} + ${s?this._renderStatusBar(a):""} + ${r&&!o?this._renderMenu(n):""} + `};return q` + ${"overlay"===e?q`${r("overlay")}`:q`
+ ${r("outerlay")} +
`} + `}_renderMenu(e){const t=this._controller.getViewManager().getView();if(this._hass&&this._config)return q` + + `}_renderStatusBar(e){if(this._config)return q` + + `}updated(){this._controller.getInitializationManager().isInitializedMandatory()&&this._controller.getQueryStringManager().executeIfNecessary()}_renderInDialogIfNecessary(e){return this._controller.getExpandManager().isExpanded()?q` {this._controller.getExpandManager().setExpanded(!1)}} + > + ${e} + `:e}render(){if(!this._hass)return;const e={main:!0,"curve-top":"outside"!==this._config?.menu.style||"top"!==this._config?.menu.position,"curve-bottom":"outside"!==this._config?.menu.style||"top"===this._config?.menu.position},t=this._controller.getActionsManager().getMergedActions(),n=this._controller.getCameraManager(),i=!1!==this._config?.performance?.features.animated_progress_indicator&&!this._controller.getInitializationManager().wasEverInitialized()&&!this._controller.getMessageManager().hasMessage();return this._renderInDialogIfNecessary(q` this._controller.getMessageManager().setMessageIfHigherPriority(e.detail)} + @frigate-card:media:loaded=${e=>this._controller.getMediaLoadedInfoManager().set(e.detail)} + @frigate-card:media:unloaded=${()=>this._controller.getMediaLoadedInfoManager().clear()} + @frigate-card:media:volumechange=${()=>this.requestUpdate()} + @frigate-card:media:play=${()=>this.requestUpdate()} + @frigate-card:media:pause=${()=>this.requestUpdate()} + @frigate-card:focus=${()=>this.focus()} + > + ${i?q``:""} + ${this._renderMenuStatusContainer("top")} + ${this._renderMenuStatusContainer("overlay")} +
+ + ${rS(this._controller.getMessageManager().getMessage())} +
+ ${this._renderMenuStatusContainer("bottom")} + ${this._config?.elements?q` {this._menuButtonController.addDynamicMenuButton(e.detail),this.requestUpdate()}} + @frigate-card:menu:remove=${e=>{this._menuButtonController.removeDynamicMenuButton(e.detail),this.requestUpdate()}} + @frigate-card:status-bar:add=${e=>{this._controller.getStatusBarItemManager().addDynamicStatusBarItem(e.detail)}} + @frigate-card:status-bar:remove=${e=>{this._controller.getStatusBarItemManager().removeDynamicStatusBarItem(e.detail)}} + @frigate-card:conditions:evaluate=${e=>{e.evaluation=this._controller.getConditionsManager()?.evaluateConditions(e.conditions)}} + > + `:""} +
`)}static get styles(){return s(':host {\n display: block;\n position: relative;\n background-color: var(--card-background-color);\n border-radius: var(--ha-card-border-radius, 4px);\n height: var(--frigate-card-height);\n min-height: 100px;\n pointer-events: all;\n --frigate-card-expand-max-height: calc((100vh - (2 * 56px)) * 0.85);\n --frigate-card-expand-max-width: 85vw;\n --frigate-card-expand-width: none;\n --frigate-card-expand-height: none;\n --frigate-card-expand-aspect-ratio: unset;\n --frigate-card-height: auto;\n}\n\nfrigate-card-loading {\n position: absolute;\n inset: 0;\n z-index: 1;\n}\n\n:host([dark]) {\n filter: brightness(75%);\n}\n\n:host([panel]:not([casted])) {\n height: calc(100vh - var(--header-height));\n}\n\n:host([panel][casted]) {\n height: 100%;\n}\n\ndiv.main {\n position: relative;\n overflow: auto;\n width: 100%;\n height: 100%;\n margin: auto;\n display: block;\n transform: translateZ(0);\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n/* Hide scrollbar for Chrome, Safari and Opera */\ndiv.main::-webkit-scrollbar {\n display: none;\n}\n\ndiv.main.curve-top {\n border-top-left-radius: var(--ha-card-border-radius, 4px);\n border-top-right-radius: var(--ha-card-border-radius, 4px);\n}\n\ndiv.main.curve-bottom {\n border-bottom-left-radius: var(--ha-card-border-radius, 4px);\n border-bottom-right-radius: var(--ha-card-border-radius, 4px);\n}\n\nha-card {\n display: flex;\n flex-direction: column;\n margin: auto;\n border: 0px;\n overflow: visible;\n width: 100%;\n height: 100%;\n position: static;\n color: var(--secondary-text-color, white);\n}\n\n/************\n * Fullscreen\n *************/\n:host(:fullscreen) #ha-card {\n border-radius: 0px;\n box-shadow: none;\n margin: 0;\n}\n\n:host(:-webkit-full-screen) #ha-card {\n border-radius: 0px;\n box-shadow: none;\n margin: 0;\n}\n\n:host(:fullscreen) div.main,\n:host(:fullscreen) frigate-card-menu {\n border-radius: 0px;\n}\n\n:host(:-webkit-full-screen) div.main,\n:host(:-webkit-full-screen) frigate-card-menu {\n border-radius: 0px;\n}\n\n/***************\n * Expanded mode\n ***************/\nweb-dialog {\n --dialog-padding: 0px;\n --dialog-container-padding: 0px;\n --dialog-max-height: var(--frigate-card-expand-max-height);\n --dialog-max-width: var(--frigate-card-expand-max-width);\n --dialog-width: var(--frigate-card-expand-width);\n --dialog-height: var(--frigate-card-expand-height);\n --dialog-overflow-x: visible;\n --dialog-overflow-y: visible;\n max-height: 100vh;\n}\n\nweb-dialog::part(dialog) {\n aspect-ratio: var(--frigate-card-expand-aspect-ratio);\n border-radius: 0px;\n background: transparent;\n}\n\n/*************************************\n * "Outside" style for menu/status bar\n *************************************/\n.outerlay[data-position=top] > *:first-child {\n border-top-left-radius: var(--ha-card-border-radius, 4px);\n border-top-right-radius: var(--ha-card-border-radius, 4px);\n}\n\n.outerlay[data-position=bottom] > *:last-child {\n border-bottom-left-radius: var(--ha-card-border-radius, 4px);\n border-bottom-right-radius: var(--ha-card-border-radius, 4px);\n}\n\n/*******************\n * Menu hover styles\n *******************/\nfrigate-card-menu {\n z-index: 2;\n}\n\nfrigate-card-menu[data-style*=hover] {\n transition: opacity 0.5s ease;\n opacity: 0;\n}\n\nfrigate-card-menu[data-style*=hover]:hover,\nha-card:hover > frigate-card-overlay > frigate-card-menu[data-style=hover-card] {\n opacity: 1;\n}\n\n/*************************\n * Status bar hover styles\n *************************/\nfrigate-card-status-bar {\n z-index: 1;\n}\n\nfrigate-card-status-bar[data-style*=hover] {\n transition: opacity 0.5s ease;\n opacity: 0;\n}\n\nfrigate-card-status-bar[data-style*=hover]:hover,\nha-card:hover > frigate-card-overlay > frigate-card-status-bar[data-style=hover-card] {\n opacity: 1;\n}')}getCardSize(){return 6}};IE=e([le("frigate-card")],IE);export{Al as $,Ja as A,er as B,Ua as C,tr as D,nr as E,ir as F,Da as G,Ra as H,Pa as I,La as J,Na as K,Fa as L,Va as M,Ha as N,Ba as O,po as P,qo as Q,Js as R,Bo as S,Vs as T,Ps as U,Ls as V,Ns as W,Fs as X,Vo as Y,$l as Z,e as _,oe as a,cr as a$,F_ as a0,Pb as a1,et as a2,Lb as a3,ko as a4,ja as a5,za as a6,Ta as a7,Oa as a8,qa as a9,Qr as aA,as as aB,rs as aC,os as aD,cs as aE,ss as aF,ts as aG,ns as aH,is as aI,us as aJ,gs as aK,ms as aL,ls as aM,ds as aN,ps as aO,hs as aP,Xr as aQ,es as aR,Jr as aS,Yr as aT,Kr as aU,Gr as aV,ks as aW,$s as aX,Es as aY,dr as aZ,sr as a_,Ks as aa,Ys as ab,Gs as ac,Xs as ad,lo as ae,co as af,ho as ag,Ho as ah,uo as ai,Cs as aj,bs as ak,As as al,ws as am,xs as an,Hr as ao,Br as ap,qr as aq,Ur as ar,Ms as as,Ss as at,fs as au,vs as av,_s as aw,ys as ax,Wr as ay,Zr as az,pe as b,ji as b$,lr as b0,or as b1,rr as b2,hr as b3,pr as b4,gr as b5,mr as b6,br as b7,Fr as b8,wr as b9,Os as bA,Bs as bB,qs as bC,Ws as bD,Zs as bE,Us as bF,Hs as bG,fo as bH,mo as bI,_o as bJ,bo as bK,wo as bL,Eo as bM,xo as bN,So as bO,Mo as bP,Db as bQ,jb as bR,Bm as bS,xi as bT,Ki as bU,Qi as bV,Ri as bW,Pi as bX,Ci as bY,Ti as bZ,zi as b_,Cr as ba,xr as bb,fr as bc,vr as bd,_r as be,yr as bf,Mr as bg,Sr as bh,kr as bi,Tr as bj,$r as bk,Ir as bl,zr as bm,Ar as bn,Er as bo,Dr as bp,Lr as bq,Nr as br,jr as bs,Or as bt,Pr as bu,Rr as bv,js as bw,Ds as bx,zs as by,Ts as bz,Rb as c,eu as c$,Ii as c0,Zi as c1,Bi as c2,qi as c3,Ui as c4,Wi as c5,ma as c6,ga as c7,Oi as c8,Di as c9,na as cA,Mi as cB,Si as cC,ua as cD,da as cE,pa as cF,ha as cG,Ld as cH,wi as cI,Co as cJ,zw as cK,Ie as cL,Tw as cM,cf as cN,rS as cO,je as cP,Wm as cQ,ew as cR,Jl as cS,cS as cT,Gv as cU,jk as cV,vf as cW,xv as cX,ye as cY,pE as cZ,Nd as c_,Fi as ca,Hi as cb,Li as cc,Ni as cd,Vi as ce,Gi as cf,Yi as cg,Ji as ch,Xi as ci,_a as cj,fa as ck,ya as cl,va as cm,ki as cn,Ei as co,$i as cp,Ai as cq,ea as cr,ia as cs,aa as ct,ra as cu,sa as cv,oa as cw,ca as cx,la as cy,ta as cz,Nb as d,Gy as d$,c as d0,Zw as d1,Wy as d2,Qw as d3,Uw as d4,Gw as d5,Zm as d6,Sy as d7,qu as d8,Ym as d9,Sw as dA,rE as dB,iE as dC,_f as dD,CS as dE,ff as dF,Cf as dG,yf as dH,u_ as dI,d_ as dJ,Dy as dK,Ry as dL,Bd as dM,Ny as dN,Qm as dO,Gm as dP,rx as dQ,Zv as dR,Kw as dS,ru as dT,rf as dU,Ly as dV,Fm as dW,bi as dX,ef as dY,ky as dZ,$o as d_,Wu as da,Vm as db,kw as dc,tf as dd,sE as de,ox as df,sS as dg,dw as dh,Pw as di,dv as dj,Mb as dk,Sb as dl,SE as dm,kE as dn,_b as dp,ME as dq,Iw as dr,jw as ds,Ow as dt,Dw as du,ix as dv,me as dw,fe as dx,U as dy,bf as dz,_e as e,qy as e0,U_ as e1,W_ as e2,Qy as e3,Km as e4,Jm as e5,Zy as e6,Fy as e7,nf as e8,Iy as e9,uf as eA,Wv as eB,Om as eC,Uv as eD,o as eE,Ae as eF,ve as eG,W as eH,Aw as eI,eE as eJ,ge as eK,be as eL,xe as eM,vb as eN,Ay as ea,$y as eb,zy as ec,Yd as ed,Fd as ee,Zd as ef,Wd as eg,Qd as eh,fu as ei,Kd as ej,Xd as ek,_u as el,mu as em,Vd as en,tu as eo,pu as ep,Tu as eq,Pu as er,Lu as es,Ru as et,xb as eu,Uy as ev,of as ew,Hv as ex,Bv as ey,qv as ez,iw as f,wb as g,Ob as h,jy as i,bb as j,Hm as k,N_ as l,Ga as m,he as n,Za as o,Rd as p,Wa as q,s as r,af as s,le as t,Qa as u,Cb as v,Ya as w,q as x,Xa as y,Ka as z}; diff --git a/config/www/community/frigate-hass-card/card-e5d55e5b.js.gz b/config/www/community/frigate-hass-card/card-e5d55e5b.js.gz new file mode 100644 index 00000000..e4369e87 Binary files /dev/null and b/config/www/community/frigate-hass-card/card-e5d55e5b.js.gz differ diff --git a/config/www/community/frigate-hass-card/date-picker-d9927b87.js b/config/www/community/frigate-hass-card/date-picker-d9927b87.js new file mode 100644 index 00000000..b4b37fa3 --- /dev/null +++ b/config/www/community/frigate-hass-card/date-picker-d9927b87.js @@ -0,0 +1,15 @@ +import{_ as e,n as t,t as n,a as i,cL as a,x as r,l,cP as s,cW as c,r as o,db as p}from"./card-e5d55e5b.js";let u=class extends i{constructor(){super(...arguments),this._refInput=a()}get value(){return this._refInput.value?.value?new Date(this._refInput.value.value):null}reset(){this._refInput.value&&(this._refInput.value.value="")}render(){const e=()=>{const e=this._refInput.value?.value;p(this,"date-picker:change",{date:e?new Date(e):null})};return r`e()} + @change=${()=>e()} + /> + {c(e),this._refInput.value?.showPicker()}} + > + `}static get styles(){return o(":host {\n display: inline-block;\n position: relative;\n width: var(--mdc-icon-size, 24px);\n height: var(--mdc-icon-size, 24px);\n}\n\ninput {\n display: block;\n height: 100%;\n width: 100%;\n position: absolute;\n padding: 0px;\n border: 0px;\n}\n\n/**\n * Hack warning: Safari on iOS does not support showPicker with\n * datetime-local:\n * https://caniuse.com/mdn-api_htmlinputelement_showpicker_datetime_local_input\n *\n * The hack is to render the input element in front of the icon, with an\n * opacity of 0. This only works if the underlying input element accepts the\n * click at the exact place the user happens to click. From trial and error,\n * this seems to work better than expected / quite reliably, but had the user\n * manually changed icon sizes with Safari iOS their experience may vary.\n */\n@supports (-webkit-touch-callout: none) {\n input {\n opacity: 0;\n z-index: 1;\n }\n}\n@supports not (-webkit-touch-callout: none) {\n input {\n visibility: hidden;\n }\n}\nfrigate-card-icon {\n display: block;\n height: 100%;\n width: 100%;\n position: absolute;\n}")}};e([t({attribute:!1})],u.prototype,"icon",void 0),u=e([n("frigate-card-date-picker")],u);export{u as F}; diff --git a/config/www/community/frigate-hass-card/date-picker-d9927b87.js.gz b/config/www/community/frigate-hass-card/date-picker-d9927b87.js.gz new file mode 100644 index 00000000..46ca4ff6 Binary files /dev/null and b/config/www/community/frigate-hass-card/date-picker-d9927b87.js.gz differ diff --git a/config/www/community/frigate-hass-card/editor-238b96c0.js b/config/www/community/frigate-hass-card/editor-238b96c0.js new file mode 100644 index 00000000..b55f7a1a --- /dev/null +++ b/config/www/community/frigate-hass-card/editor-238b96c0.js @@ -0,0 +1,472 @@ +import{i as e,s as i,_ as t,n,t as a,a as s,x as o,e as r,l,r as c,b as d,c as u,d as m,p as h,f as _,g,h as b,j as p,k as v,C as f,m as $,o as y,q as w,u as S,v as x,w as M,y as I,z as k,A as O,B as C,D as z,E as A,F as N,G as T,H as B,I as E,J as P,K as H,L,M as V,N as K,O as U,P as j,Q as q,R,S as D,T as F,U as G,V as J,W as Q,X as W,Y as X,Z as Y,$ as Z,a0 as ee,a1 as ie,a2 as te,a3 as ne,a4 as ae,a5 as se,a6 as oe,a7 as re,a8 as le,a9 as ce,aa as de,ab as ue,ac as me,ad as he,ae as _e,af as ge,ag as be,ah as pe,ai as ve,aj as fe,ak as $e,al as ye,am as we,an as Se,ao as xe,ap as Me,aq as Ie,ar as ke,as as Oe,at as Ce,au as ze,av as Ae,aw as Ne,ax as Te,ay as Be,az as Ee,aA as Pe,aB as He,aC as Le,aD as Ve,aE as Ke,aF as Ue,aG as je,aH as qe,aI as Re,aJ as De,aK as Fe,aL as Ge,aM as Je,aN as Qe,aO as We,aP as Xe,aQ as Ye,aR as Ze,aS as ei,aT as ii,aU as ti,aV as ni,aW as ai,aX as si,aY as oi,aZ as ri,a_ as li,a$ as ci,b0 as di,b1 as ui,b2 as mi,b3 as hi,b4 as _i,b5 as gi,b6 as bi,b7 as pi,b8 as vi,b9 as fi,ba as $i,bb as yi,bc as wi,bd as Si,be as xi,bf as Mi,bg as Ii,bh as ki,bi as Oi,bj as Ci,bk as zi,bl as Ai,bm as Ni,bn as Ti,bo as Bi,bp as Ei,bq as Pi,br as Hi,bs as Li,bt as Vi,bu as Ki,bv as Ui,bw as ji,bx as qi,by as Ri,bz as Di,bA as Fi,bB as Gi,bC as Ji,bD as Qi,bE as Wi,bF as Xi,bG as Yi,bH as Zi,bI as et,bJ as it,bK as tt,bL as nt,bM as at,bN as st,bO as ot,bP as rt,bQ as lt,bR as ct,bS as dt,bT as ut,bU as mt,bV as ht,bW as _t,bX as gt,bY as bt,bZ as pt,b_ as vt,b$ as ft,c0 as $t,c1 as yt,c2 as wt,c3 as St,c4 as xt,c5 as Mt,c6 as It,c7 as kt,c8 as Ot,c9 as Ct,ca as zt,cb as At,cc as Nt,cd as Tt,ce as Bt,cf as Et,cg as Pt,ch as Ht,ci as Lt,cj as Vt,ck as Kt,cl as Ut,cm as jt,cn as qt,co as Rt,cp as Dt,cq as Ft,cr as Gt,cs as Jt,ct as Qt,cu as Wt,cv as Xt,cw as Yt,cx as Zt,cy as en,cz as tn,cA as nn,cB as an,cC as sn,cD as on,cE as rn,cF as ln,cG as cn,cH as dn,cI as un,cJ as mn}from"./card-e5d55e5b.js";class hn{constructor(e){this._assigning=!1,this._value=null,this._blurEventHandler=()=>{this._setAssigning(!1)},this._keydownEventHandler=e=>{e.key&&!["Control","Alt","Shift","Meta"].includes(e.key)&&(this.setValue({key:e.key,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey,meta:e.metaKey}),this._setAssigning(!1))},this._host=e,this._host.addController(this)}setValue(i){e(i,this._value)||(this._value=i,this._host.requestUpdate(),this._host.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this._value}})))}getValue(){return this._value}hasValue(){return!!this._value}isAssigning(){return this._assigning}toggleAssigning(){this._setAssigning(!this._assigning)}_setAssigning(e){this._assigning=e,i(this._host,this._assigning,"assigning"),this._assigning?this._host.addEventListener("keydown",this._keydownEventHandler):this._host.removeEventListener("keydown",this._keydownEventHandler),this._host.requestUpdate()}hostConnected(){this._host.addEventListener("blur",this._blurEventHandler)}hostDisconnected(){this._host.removeEventListener("blur",this._blurEventHandler)}}let _n=class extends s{constructor(){super(...arguments),this._controller=new hn(this)}willUpdate(e){e.has("value")&&this._controller.setValue(this.value??null)}render(){if(!this.label)return;const e=e=>o`
+
${e}
+
`;return o` +
${this.label}
+ {this._controller.toggleAssigning()}} + > + + + ${this._controller.isAssigning()?"":l("key_assigner.assign")} + + + ${this._controller.hasValue()?o`{this._controller.setValue(null)}} + > + + ${l("key_assigner.unassign")} + `:""} +
+ ${this.value?.ctrl?e(l("key_assigner.modifiers.ctrl")):""} + ${this.value?.shift?e(l("key_assigner.modifiers.shift")):""} + ${this.value?.meta?e(l("key_assigner.modifiers.meta")):""} + ${this.value?.alt?e(l("key_assigner.modifiers.alt")):""} + ${this.value?.key?e(this.value.key):""} +
+ `}static get styles(){return c('.dotdotdot:after {\n animation: dots 2s linear infinite;\n content: "";\n display: inline-block;\n width: 3em;\n}\n@keyframes dots {\n 0%, 20% {\n content: ".";\n }\n 40% {\n content: "..";\n }\n 60% {\n content: "...";\n }\n 90%, 100% {\n content: "";\n }\n}\n\n:host {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 10px;\n height: 56px;\n border: 1px solid var(--divider-color);\n}\n\n:host([assigning]) ha-button.assign span,\n:host([assigning]) ha-button.assign frigate-card-icon {\n color: var(--warning-color);\n}\n\nfrigate-card-icon {\n padding: 10px;\n}\n\ndiv.label {\n width: 100px;\n margin-left: 4px;\n}\n\ndiv.key-row {\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n padding-left: 10px;\n padding-right: 10px;\n}\n\ndiv.key {\n display: flex;\n align-items: center;\n height: 90%;\n width: min-content;\n margin-left: 5px;\n margin-right: 5px;\n}\n\ndiv.key-inner {\n height: 100%;\n width: 100%;\n padding-top: 2px;\n padding-bottom: 2px;\n padding-left: 4px;\n padding-right: 4px;\n border: 2px;\n border-radius: 4px;\n border-style: outset;\n border-color: var(--divider-color);\n font-family: monospace;\n text-transform: capitalize;\n}\n\ndiv.unassigned {\n font-style: italic;\n}\n\ndiv.key + div.key:before {\n display: flex;\n align-items: center;\n margin-right: 5px;\n content: " + ";\n}')}};t([n({attribute:!1})],_n.prototype,"label",void 0),t([n({attribute:!1})],_n.prototype,"value",void 0),_n=t([a("frigate-card-key-assigner")],_n);const gn="cameras",bn="options",pn={cameras:{icon:"video",name:l("editor.cameras"),secondary:l("editor.cameras_secondary")},view:{icon:"eye",name:l("editor.view"),secondary:l("editor.view_secondary")},menu:{icon:"menu",name:l("editor.menu"),secondary:l("editor.menu_secondary")},status_bar:{icon:"sign-text",name:l("editor.status_bar"),secondary:l("editor.status_bar_secondary")},live:{icon:"cctv",name:l("editor.live"),secondary:l("editor.live_secondary")},media_gallery:{icon:"grid",name:l("editor.media_gallery"),secondary:l("editor.media_gallery_secondary")},media_viewer:{icon:"filmstrip",name:l("editor.media_viewer"),secondary:l("editor.media_viewer_secondary")},image:{icon:"image",name:l("editor.image"),secondary:l("editor.image_secondary")},timeline:{icon:"chart-gantt",name:l("editor.timeline"),secondary:l("editor.timeline_secondary")},dimensions:{icon:"aspect-ratio",name:l("editor.dimensions"),secondary:l("editor.dimensions_secondary")},performance:{icon:"speedometer",name:l("editor.performance"),secondary:l("editor.performance_secondary")},profiles:{icon:"folder-wrench-outline",name:l("editor.profiles"),secondary:l("editor.profiles_secondary")},overrides:{icon:"file-replace",name:l("editor.overrides"),secondary:l("editor.overrides_secondary")}};let vn=class extends s{constructor(){super(...arguments),this._defaults=u(dn),this._initialized=!1,this._configUpgradeable=!1,this._expandedMenus={},this._viewModes=[{value:"",label:""},{value:"live",label:l("config.view.views.live")},{value:"clips",label:l("config.view.views.clips")},{value:"snapshots",label:l("config.view.views.snapshots")},{value:"recordings",label:l("config.view.views.recordings")},{value:"clip",label:l("config.view.views.clip")},{value:"snapshot",label:l("config.view.views.snapshot")},{value:"recording",label:l("config.view.views.recording")},{value:"image",label:l("config.view.views.image")},{value:"timeline",label:l("config.view.views.timeline")}],this._cameraSelectViewModes=[...this._viewModes,{value:"current",label:l("config.view.views.current")}],this._filterModes=[{value:"",label:""},{value:"none",label:l("config.common.controls.filter.modes.none")},{value:"left",label:l("config.common.controls.filter.modes.left")},{value:"right",label:l("config.common.controls.filter.modes.right")}],this._menuStyles=[{value:"",label:""},{value:"none",label:l("config.menu.styles.none")},{value:"hidden",label:l("config.menu.styles.hidden")},{value:"overlay",label:l("config.menu.styles.overlay")},{value:"hover",label:l("config.menu.styles.hover")},{value:"hover-card",label:l("config.menu.styles.hover-card")},{value:"outside",label:l("config.menu.styles.outside")}],this._menuPositions=[{value:"",label:""},{value:"left",label:l("config.menu.positions.left")},{value:"right",label:l("config.menu.positions.right")},{value:"top",label:l("config.menu.positions.top")},{value:"bottom",label:l("config.menu.positions.bottom")}],this._menuAlignments=[{value:"",label:""},{value:"left",label:l("config.menu.alignments.left")},{value:"right",label:l("config.menu.alignments.right")},{value:"top",label:l("config.menu.alignments.top")},{value:"bottom",label:l("config.menu.alignments.bottom")}],this._nextPreviousControlStyles=[{value:"",label:""},{value:"chevrons",label:l("config.common.controls.next_previous.styles.chevrons")},{value:"icons",label:l("config.common.controls.next_previous.styles.icons")},{value:"none",label:l("config.common.controls.next_previous.styles.none")},{value:"thumbnails",label:l("config.common.controls.next_previous.styles.thumbnails")}],this._aspectRatioModes=[{value:"",label:""},{value:"dynamic",label:l("config.dimensions.aspect_ratio_modes.dynamic")},{value:"static",label:l("config.dimensions.aspect_ratio_modes.static")},{value:"unconstrained",label:l("config.dimensions.aspect_ratio_modes.unconstrained")}],this._thumbnailModes=[{value:"",label:""},{value:"none",label:l("config.common.controls.thumbnails.modes.none")},{value:"above",label:l("config.common.controls.thumbnails.modes.above")},{value:"below",label:l("config.common.controls.thumbnails.modes.below")},{value:"left",label:l("config.common.controls.thumbnails.modes.left")},{value:"right",label:l("config.common.controls.thumbnails.modes.right")}],this._thumbnailMediaTypes=[{value:"",label:""},{value:"events",label:l("config.common.controls.thumbnails.media_types.events")},{value:"recordings",label:l("config.common.controls.thumbnails.media_types.recordings")}],this._thumbnailEventsMediaTypes=[{value:"",label:""},{value:"clips",label:l("config.common.controls.thumbnails.events_media_types.clips")},{value:"snapshots",label:l("config.common.controls.thumbnails.events_media_types.snapshots")}],this._transitionEffects=[{value:"",label:""},{value:"none",label:l("config.media_viewer.transition_effects.none")},{value:"slide",label:l("config.media_viewer.transition_effects.slide")}],this._imageModes=[{value:"",label:""},{value:"camera",label:l("config.common.image.modes.camera")},{value:"entity",label:l("config.common.image.modes.entity")},{value:"screensaver",label:l("config.common.image.modes.screensaver")},{value:"url",label:l("config.common.image.modes.url")}],this._timelineEventsMediaTypes=[{value:"",label:""},{value:"all",label:l("config.common.timeline.events_media_types.all")},{value:"clips",label:l("config.common.timeline.events_media_types.clips")},{value:"snapshots",label:l("config.common.timeline.events_media_types.snapshots")}],this._timelineStyleTypes=[{value:"",label:""},{value:"ribbon",label:l("config.common.timeline.styles.ribbon")},{value:"stack",label:l("config.common.timeline.styles.stack")}],this._darkModes=[{value:"",label:""},{value:"on",label:l("config.view.dark_modes.on")},{value:"off",label:l("config.view.dark_modes.off")},{value:"auto",label:l("config.view.dark_modes.auto")}],this._mediaActionNegativeConditions=[{value:"",label:""},{value:"unselected",label:l("config.common.media_action_conditions.unselected")},{value:"hidden",label:l("config.common.media_action_conditions.hidden")}],this._mediaActionPositiveConditions=[{value:"",label:""},{value:"selected",label:l("config.common.media_action_conditions.selected")},{value:"visible",label:l("config.common.media_action_conditions.visible")}],this._mediaLiveUnmuteConditions=[...this._mediaActionPositiveConditions,{value:"microphone",label:l("config.common.media_action_conditions.microphone_unmute")}],this._mediaLiveMuteConditions=[...this._mediaActionNegativeConditions,{value:"microphone",label:l("config.common.media_action_conditions.microphone_mute")}],this._layoutFits=[{value:"",label:""},{value:"contain",label:l("config.cameras.dimensions.layout.fits.contain")},{value:"cover",label:l("config.cameras.dimensions.layout.fits.cover")},{value:"fill",label:l("config.cameras.dimensions.layout.fits.fill")}],this._miniTimelineModes=[{value:"",label:""},{value:"none",label:l("config.common.controls.timeline.modes.none")},{value:"above",label:l("config.common.controls.timeline.modes.above")},{value:"below",label:l("config.common.controls.timeline.modes.below")}],this._profiles=[{value:"",label:""},{value:"casting",label:l("config.profiles.casting")},{value:"low-performance",label:l("config.profiles.low-performance")},{value:"scrubbing",label:l("config.profiles.scrubbing")}],this._go2rtcModes=[{value:"",label:""},{value:"mse",label:l("config.cameras.go2rtc.modes.mse")},{value:"webrtc",label:l("config.cameras.go2rtc.modes.webrtc")},{value:"mp4",label:l("config.cameras.go2rtc.modes.mp4")},{value:"mjpeg",label:l("config.cameras.go2rtc.modes.mjpeg")}],this._microphoneButtonTypes=[{value:"",label:""},{value:"momentary",label:l("config.menu.buttons.types.momentary")},{value:"toggle",label:l("config.menu.buttons.types.toggle")}],this._displayModes=[{value:"",label:""},{value:"single",label:l("display_modes.single")},{value:"grid",label:l("display_modes.grid")}],this._castMethods=[{value:"",label:""},{value:"standard",label:l("config.cameras.cast.methods.standard")},{value:"dashboard",label:l("config.cameras.cast.methods.dashboard")}],this._ptzModes=[{value:"",label:""},{value:"on",label:l("config.live.controls.ptz.modes.on")},{value:"off",label:l("config.live.controls.ptz.modes.off")}],this._ptzOrientations=[{value:"",label:""},{value:"vertical",label:l("config.live.controls.ptz.orientations.vertical")},{value:"horizontal",label:l("config.live.controls.ptz.orientations.horizontal")}],this._ptzPositions=[{value:"",label:""},{value:"top-left",label:l("config.live.controls.ptz.positions.top-left")},{value:"top-right",label:l("config.live.controls.ptz.positions.top-right")},{value:"bottom-left",label:l("config.live.controls.ptz.positions.bottom-left")},{value:"bottom-right",label:l("config.live.controls.ptz.positions.bottom-right")}],this._triggersActionsInteractionModes=[{value:"",label:""},{value:"all",label:l("config.view.triggers.actions.interaction_modes.all")},{value:"inactive",label:l("config.view.triggers.actions.interaction_modes.inactive")},{value:"active",label:l("config.view.triggers.actions.interaction_modes.active")}],this._triggersActionsTrigger=[{value:"",label:""},{value:"default",label:l("config.view.triggers.actions.triggers.default")},{value:"live",label:l("config.view.triggers.actions.triggers.live")},{value:"media",label:l("config.view.triggers.actions.triggers.media")},{value:"none",label:l("config.view.triggers.actions.triggers.none")}],this._triggersActionsUntrigger=[{value:"",label:""},{value:"default",label:l("config.view.triggers.actions.untriggers.default")},{value:"none",label:l("config.view.triggers.actions.untriggers.none")}],this._triggersEvents=[{value:"",label:""},{value:"events",label:l("config.cameras.triggers.events.events")},{value:"clips",label:l("config.cameras.triggers.events.clips")},{value:"snapshots",label:l("config.cameras.triggers.events.snapshots")}],this._timelinePanModes=[{value:"",label:""},{value:"pan",label:l("config.common.controls.timeline.pan_modes.pan")},{value:"seek",label:l("config.common.controls.timeline.pan_modes.seek")},{value:"seek-in-media",label:l("config.common.controls.timeline.pan_modes.seek-in-media")},{value:"seek-in-camera",label:l("config.common.controls.timeline.pan_modes.seek-in-camera")}],this._capabilities=[{value:"",label:""},{value:"live",label:l("config.cameras.capabilities.capabilities.live")},{value:"substream",label:l("config.cameras.capabilities.capabilities.substream")},{value:"clips",label:l("config.cameras.capabilities.capabilities.clips")},{value:"recordings",label:l("config.cameras.capabilities.capabilities.recordings")},{value:"snapshots",label:l("config.cameras.capabilities.capabilities.snapshots")},{value:"favorite-events",label:l("config.cameras.capabilities.capabilities.favorite-events")},{value:"favorite-recordings",label:l("config.cameras.capabilities.capabilities.favorite-recordings")},{value:"seek",label:l("config.cameras.capabilities.capabilities.seek")},{value:"ptz",label:l("config.cameras.capabilities.capabilities.ptz")},{value:"menu",label:l("config.cameras.capabilities.capabilities.menu")}],this._defaultResetInteractionModes=[{value:"",label:""},{value:"all",label:l("config.view.default_reset.interaction_modes.all")},{value:"inactive",label:l("config.view.default_reset.interaction_modes.inactive")},{value:"active",label:l("config.view.default_reset.interaction_modes.active")}],this._proxyMedia=[{value:"",label:""},{value:"auto",label:l("config.cameras.proxy.media.auto")},{value:!0,label:l("config.cameras.proxy.media.true")},{value:!1,label:l("config.cameras.proxy.media.false")}],this._proxySSLCiphers=[{value:"",label:""},{value:"auto",label:l("config.cameras.proxy.ssl_ciphers.auto")},{value:"default",label:l("config.cameras.proxy.ssl_ciphers.default")},{value:"insecure",label:l("config.cameras.proxy.ssl_ciphers.insecure")},{value:"intermediate",label:l("config.cameras.proxy.ssl_ciphers.intermediate")},{value:"modern",label:l("config.cameras.proxy.ssl_ciphers.modern")}],this._proxySSLVerification=[{value:"",label:""},{value:"auto",label:l("config.cameras.proxy.ssl_verification.auto")},{value:!0,label:l("config.cameras.proxy.ssl_verification.true")},{value:!1,label:l("config.cameras.proxy.ssl_verification.false")}],this._reolinkMediaResolution=[{value:"",label:""},{value:"high",label:l("config.cameras.reolink.media_resolution.high")},{value:"low",label:l("config.cameras.reolink.media_resolution.low")}],this._statusBarStyles=[{value:"",label:""},{value:"hover",label:l("config.status_bar.styles.hover")},{value:"hover-card",label:l("config.status_bar.styles.hover-card")},{value:"none",label:l("config.status_bar.styles.none")},{value:"outside",label:l("config.status_bar.styles.outside")},{value:"overlay",label:l("config.status_bar.styles.overlay")},{value:"popup",label:l("config.status_bar.styles.popup")}],this._statusBarPositions=[{value:"",label:""},{value:"top",label:l("config.status_bar.positions.top")},{value:"bottom",label:l("config.status_bar.positions.bottom")}]}setConfig(e){this._config=e,this._configUpgradeable=m(e);const i=h.safeParse(this._config.profiles);if(i.success){const e=u(dn);_(this._config,e,i.data),this._defaults=e}}willUpdate(){this._initialized||g().then((e=>{e&&(this._initialized=!0)}))}_renderOptionSetHeader(e,i){const t=pn[e];return o` +
+
+ +
${t.name}
+
+
${t.secondary}
+
+ `}_getLabel(e){const i=e.split(".").filter((e=>!e.match(/^\[[0-9]+\]$/))).join(".");return l(`config.${i}`)}_renderEntitySelector(e,i){if(this._config)return o` + this._valueChangedHandler(e,i)} + > + + `}_renderOptionSelector(e,i=[],t){if(this._config)return o` + this._valueChangedHandler(e,i)} + > + + `}_renderIconSelector(e,i){if(this._config)return o` + this._valueChangedHandler(e,i)} + > + + `}_renderNumberInput(e,i){if(!this._config)return;const t=b(this._config,e),n=void 0===i?.max?"box":"slider";return o` + this._valueChangedHandler(e,i)} + > + + `}_renderInfo(e){return o` ${e}`}_getEditorCameraTitle(e,i){return"string"==typeof i?.title&&i.title||("string"==typeof i?.camera_entity?p(this.hass,i.camera_entity):"")||"object"==typeof i?.webrtc_card&&i.webrtc_card&&"string"==typeof i.webrtc_card.entity&&i.webrtc_card.entity||("object"==typeof i?.frigate&&i.frigate&&"string"==typeof i?.frigate.camera_name&&i.frigate.camera_name?v(i.frigate.camera_name):"")||"string"==typeof i?.id&&i.id||l("editor.camera")+" #"+e}_renderViewDefaultResetMenu(){return this._putInSubmenu("view.default_reset",!0,`config.${f}.editor_label`,"mdi:restart",o` + ${this._renderSwitch($,this._defaults.view.default_reset.after_interaction)} + ${this._renderNumberInput(y)} + ${this._renderOptionSelector(w,this._defaultResetInteractionModes,{label:l("config.view.default_reset.interaction_mode")})}, + ${this._renderOptionSelector(S,this.hass?x(this.hass):[],{multiple:!0})} + `)}_renderViewTriggersMenu(){return this._putInSubmenu("view.triggers",!0,`config.${M}.editor_label`,"mdi:target-account",o` + ${this._renderSwitch(I,this._defaults.view.triggers.filter_selected_camera,{label:l(`config.${I}`)})} + ${this._renderSwitch(k,this._defaults.view.triggers.show_trigger_status,{label:l(`config.${k}`)})} + ${this._renderNumberInput(O,{default:this._defaults.view.triggers.untrigger_seconds})} + ${this._putInSubmenu("view.triggers.actions",!0,`config.${C}.editor_label`,"mdi:cogs",o` ${this._renderOptionSelector(z,this._triggersActionsTrigger,{label:l("config.view.triggers.actions.trigger")})} + ${this._renderOptionSelector(A,this._triggersActionsUntrigger,{label:l("config.view.triggers.actions.untrigger")})} + ${this._renderOptionSelector(N,this._triggersActionsInteractionModes,{label:l("config.view.triggers.actions.interaction_mode")})}`)} + `)}_renderKeyAssigner(e,i){return o` this._valueChangedHandler(e,i)} + >`}_renderViewKeyboardShortcutMenu(){return this._putInSubmenu("view.keyboard_shortcuts",!0,`config.${T}.editor_label`,"mdi:keyboard",o` + ${this._renderSwitch(B,this._defaults.view.keyboard_shortcuts.enabled,{label:l(`config.${B}`)})} + ${this._renderKeyAssigner(E,this._defaults.view.keyboard_shortcuts.ptz_left)} + ${this._renderKeyAssigner(P,this._defaults.view.keyboard_shortcuts.ptz_right)} + ${this._renderKeyAssigner(H,this._defaults.view.keyboard_shortcuts.ptz_up)} + ${this._renderKeyAssigner(L,this._defaults.view.keyboard_shortcuts.ptz_down)} + ${this._renderKeyAssigner(V,this._defaults.view.keyboard_shortcuts.ptz_zoom_in)} + ${this._renderKeyAssigner(K,this._defaults.view.keyboard_shortcuts.ptz_zoom_out)} + ${this._renderKeyAssigner(U,this._defaults.view.keyboard_shortcuts.ptz_home)} + `)}_renderStatusBarItem(e){return o` ${this._putInSubmenu("status_bar.items",e,`config.status_bar.items.${e}`,"mdi:feature-search",o` + ${this._renderSwitch(`${j}.${e}.enabled`,this._defaults.status_bar.items[e]?.enabled??!0,{label:l("config.status_bar.items.enabled")})} + ${this._renderNumberInput(`${j}.${e}.priority`,{max:q,default:this._defaults.status_bar.items[e]?.priority,label:l("config.status_bar.items.priority")})} + `)}`}_renderMenuButton(e,i){const t=[{value:"",label:""},{value:"matching",label:l("config.menu.buttons.alignments.matching")},{value:"opposing",label:l("config.menu.buttons.alignments.opposing")}];return o` ${this._putInSubmenu("menu.buttons",e,`config.menu.buttons.${e}`,"mdi:gesture-tap-button",o` + ${this._renderSwitch(`${R}.${e}.enabled`,this._defaults.menu.buttons[e]?.enabled??!0,{label:l("config.menu.buttons.enabled")})} + ${this._renderOptionSelector(`${R}.${e}.alignment`,t,{label:l("config.menu.buttons.alignment")})} + ${this._renderSwitch(`${R}.${e}.permanent`,this._defaults.menu.buttons[e]?.permanent??!1,{label:l("config.menu.buttons.permanent")})} + ${this._renderNumberInput(`${R}.${e}.priority`,{max:D,default:this._defaults.menu.buttons[e]?.priority,label:l("config.menu.buttons.priority")})} + ${this._renderIconSelector(`${R}.${e}.icon`,{label:l("config.menu.buttons.icon")})} + ${i} + `)}`}_putInSubmenu(e,i,t,n,a){const s=this._expandedMenus[e]===i;return o`
+ + ${s?o`
${a}
`:""} +
`}_renderMediaLayout(e,i,t,n,a,s,r,c,d,u,m,h){return this._putInSubmenu(e,!0,i,"mdi:page-layout-body",o` + ${this._renderNumberInput(u,{min:0,max:10,label:l("config.cameras.dimensions.layout.zoom"),step:.1})} + ${this._renderNumberInput(m,{min:0,max:100,label:l("config.cameras.dimensions.layout.pan.x")})} + ${this._renderNumberInput(h,{min:0,max:100,label:l("config.cameras.dimensions.layout.pan.y")})} + ${this._renderOptionSelector(t,this._layoutFits,{label:l("config.cameras.dimensions.layout.fit")})} + ${this._putInSubmenu(`${e}.position`,!0,"config.cameras.dimensions.layout.position.editor_label","mdi:aspect-ratio",o` ${this._renderNumberInput(n,{min:0,max:100,label:l("config.cameras.dimensions.layout.position.x")})} + ${this._renderNumberInput(a,{min:0,max:100,label:l("config.cameras.dimensions.layout.position.y")})}`)} + ${this._putInSubmenu(`${e}.view_box`,!0,"config.cameras.dimensions.layout.view_box.editor_label","mdi:crop",o` + ${this._renderNumberInput(s,{min:0,max:100,label:l("config.cameras.dimensions.layout.view_box.top")})} + ${this._renderNumberInput(r,{min:0,max:100,label:l("config.cameras.dimensions.layout.view_box.bottom")})} + ${this._renderNumberInput(c,{min:0,max:100,label:l("config.cameras.dimensions.layout.view_box.left")})} + ${this._renderNumberInput(d,{min:0,max:100,label:l("config.cameras.dimensions.layout.view_box.right")})} + `)} + `)}_renderTimelineCoreControls(e,i,t,n,a,s,r){return o` + ${this._renderOptionSelector(e,this._timelineStyleTypes,{label:l(`config.common.${F}`)})} + ${r?this._renderOptionSelector(r,this._timelinePanModes,{label:l("config.common.controls.timeline.pan_mode")}):""} + ${this._renderNumberInput(i,{label:l(`config.common.${G}`)})} + ${this._renderNumberInput(t,{label:l(`config.common.${J}`)})} + ${this._renderOptionSelector(n,this._timelineEventsMediaTypes,{label:l(`config.common.${Q}`)})} + ${this._renderSwitch(a,s,{label:l(`config.common.${W}`)})} + `}_renderMiniTimeline(e,i,t,n,a,s,r,c,d){return this._putInSubmenu(e,!0,"config.common.controls.timeline.editor_label","mdi:chart-gantt",o` ${this._renderOptionSelector(i,this._miniTimelineModes,{label:l("config.common.controls.timeline.mode")})} + ${this._renderTimelineCoreControls(t,n,a,s,r,c,d)}`)}_renderViewDisplay(e,i,t,n,a){return this._putInSubmenu(e,!0,"config.common.display.editor_label","mdi:palette-swatch",o` + ${this._renderOptionSelector(i,this._displayModes,{label:l("config.common.display.mode")})} + ${this._renderNumberInput(t,{min:0,label:l("config.common.display.grid_selected_width_factor")})} + ${this._renderNumberInput(n,{min:0,label:l("config.common.display.grid_columns")})} + ${this._renderNumberInput(a,{min:0,label:l("config.common.display.grid_max_columns")})} + `)}_renderNextPreviousControls(e,i,t,n){return this._putInSubmenu(e,!0,"config.common.controls.next_previous.editor_label","mdi:arrow-right-bold-circle",o` + ${this._renderOptionSelector(i,this._nextPreviousControlStyles.filter((e=>!(!n?.allowThumbnails&&"thumbnails"===e.value||!n?.allowIcons&&"icons"===e.value))),{label:l("config.common.controls.next_previous.style")})} + ${this._renderNumberInput(t,{min:X,label:l("config.common.controls.next_previous.size")})} + `)}_renderThumbnailsControls(e,i,t,n,a,s,r,c){return this._putInSubmenu(e,!0,"config.common.controls.thumbnails.editor_label","mdi:image-text",o` + ${c?.configPathMode?o`${this._renderOptionSelector(c.configPathMode,this._thumbnailModes,{label:l("config.common.controls.thumbnails.mode")})}`:o``} + ${c?.configPathMediaType?o`${this._renderOptionSelector(c.configPathMediaType,this._thumbnailMediaTypes,{label:l("config.common.controls.thumbnails.media_type")})}`:o``} + ${c?.configPathEventsMediaType?o`${this._renderOptionSelector(c.configPathEventsMediaType,this._thumbnailEventsMediaTypes,{label:l("config.common.controls.thumbnails.events_media_type")})}`:o``} + ${this._renderNumberInput(i,{min:Y,max:Z,label:l("config.common.controls.thumbnails.size")})} + ${this._renderSwitch(t,r.show_details,{label:l("config.common.controls.thumbnails.show_details")})} + ${this._renderSwitch(n,r.show_favorite_control,{label:l("config.common.controls.thumbnails.show_favorite_control")})} + ${this._renderSwitch(a,r.show_timeline_control,{label:l("config.common.controls.thumbnails.show_timeline_control")})} + ${this._renderSwitch(s,r.show_download_control,{label:l("config.common.controls.thumbnails.show_download_control")})} + `)}_renderFilterControls(e,i){return this._putInSubmenu(e,!0,"config.common.controls.filter.editor_label","mdi:filter-cog",o` + ${i?o`${this._renderOptionSelector(i,this._filterModes,{label:l("config.common.controls.filter.mode")})}`:o``} + `)}_renderImageOptions(e,i,t,n,a){return o` + ${this._renderOptionSelector(e,this._imageModes,{label:l("config.common.image.mode")})} + ${this._renderStringInput(i,{label:l("config.common.image.url")})} + ${this._renderOptionSelector(t,this.hass?x(this.hass):[],{label:l("config.common.image.entity")})} + ${this._renderStringInput(n,{label:l("config.common.image.entity_parameters")})} + ${this._renderNumberInput(a,{label:l("config.common.image.refresh_seconds")})} + `}_renderCamera(e,i,t,n){const a=[{value:"",label:""},{value:"auto",label:l("config.cameras.live_providers.auto")},{value:"ha",label:l("config.cameras.live_providers.ha")},{value:"image",label:l("config.cameras.live_providers.image")},{value:"jsmpeg",label:l("config.cameras.live_providers.jsmpeg")},{value:"go2rtc",label:l("config.cameras.live_providers.go2rtc")},{value:"webrtc-card",label:l("config.cameras.live_providers.webrtc-card")}],s=[];e.forEach(((e,t)=>{t!==i&&s.push({value:ee(e),label:this._getEditorCameraTitle(t,e)})}));const c=e=>{if(this._config){const i=u(this._config);e(i)&&this._updateConfig(i)}},d={submenu:!0,selected:this._expandedMenus[gn]===i};return o` +
+ + ${this._expandedMenus[gn]===i?o`
+
+ !n&&c((e=>!!(Array.isArray(e.cameras)&&i>0)&&(dt(e.cameras,i,i-1),this._openMenu(gn,i-1),!0)))} + > + + + =this._config.cameras.length-1} + @click=${()=>!n&&c((e=>!!(Array.isArray(e.cameras)&&i + + + {c((e=>!!Array.isArray(e.cameras)&&(e.cameras.splice(i,1),this._closeMenu(gn),!0)))}} + > + + +
+ ${this._renderEntitySelector(ie(ut,i),"camera")} + ${this._renderOptionSelector(ie(mt,i),a)} + ${this._renderStringInput(ie(ht,i))} + ${this._renderIconSelector(ie(_t,i),{label:l("config.cameras.icon")})} + ${this._renderStringInput(ie(gt,i))} + ${this._putInSubmenu("cameras.engine",!0,"config.cameras.engines.editor_label","mdi:engine",o`${this._putInSubmenu("cameras.frigate",i,"config.cameras.frigate.editor_label","frigate",o` + ${this._renderStringInput(ie(bt,i))} + ${this._renderStringInput(ie(pt,i))} + ${this._renderOptionSelector(ie(vt,i),[],{multiple:!0,label:l("config.cameras.frigate.labels")})} + ${this._renderOptionSelector(ie(ft,i),[],{multiple:!0,label:l("config.cameras.frigate.zones")})} + ${this._renderStringInput(ie($t,i))} + `)} + ${this._putInSubmenu("cameras.motioneye",i,"config.cameras.motioneye.editor_label","motioneye",o` ${this._renderStringInput(ie(yt,i))} + ${this._renderStringInput(ie(wt,i))} + ${this._renderStringInput(ie(St,i))} + ${this._renderStringInput(ie(xt,i))} + ${this._renderStringInput(ie(Mt,i))}`)} + ${this._putInSubmenu("cameras.reolink",i,"config.cameras.reolink.editor_label","reolink",o` ${this._renderStringInput(ie(It,i))} + ${this._renderOptionSelector(ie(kt,i),this._reolinkMediaResolution,{label:l("config.cameras.reolink.media_resolution.editor_label")})}`)}`)} + ${this._putInSubmenu("cameras.live_provider",!0,"config.cameras.live_provider_options.editor_label","mdi:cctv",o` ${this._putInSubmenu("cameras.go2rtc",i,"config.cameras.go2rtc.editor_label","mdi:alpha-g-circle",o`${this._renderOptionSelector(ie(Ot,i),this._go2rtcModes,{multiple:!0,label:l("config.cameras.go2rtc.modes.editor_label")})} + ${this._renderStringInput(ie(Ct,i))}`)} + ${this._putInSubmenu("cameras.image",!0,"config.cameras.image.editor_label","mdi:image",this._renderImageOptions(ie(zt,i),ie(At,i),ie(Nt,i),ie(Tt,i),ie(Bt,i)))} + ${this._putInSubmenu("cameras.webrtc_card",i,"config.cameras.webrtc_card.editor_label","mdi:webrtc",o`${this._renderEntitySelector(ie(Et,i),"camera")} + ${this._renderStringInput(ie(Pt,i))}`)}`)} + ${this._putInSubmenu("cameras.dependencies",i,"config.cameras.dependencies.editor_label","mdi:graph",o` ${this._renderSwitch(ie(Ht,i),this._defaults.cameras.dependencies.all_cameras)} + ${this._renderOptionSelector(ie(Lt,i),s,{multiple:!0})}`)} + ${this._putInSubmenu("cameras.triggers",i,"config.cameras.triggers.editor_label","mdi:magnify-scan",o` + ${this._renderSwitch(ie(Vt,i),this._defaults.cameras.triggers.occupancy)} + ${this._renderSwitch(ie(Kt,i),this._defaults.cameras.triggers.motion)} + ${this._renderOptionSelector(ie(Ut,i),t,{multiple:!0})} + ${this._renderOptionSelector(ie(jt,i),this._triggersEvents,{multiple:!0,label:l("config.cameras.triggers.events.editor_label")})} + `)} + ${this._putInSubmenu("cameras.cast",i,"config.cameras.cast.editor_label","mdi:cast",o` + ${this._renderOptionSelector(ie(qt,i),this._castMethods)} + ${this._renderStringInput(ie(Rt,i))} + ${this._renderStringInput(ie(Dt,i))} + `)} + ${this._putInSubmenu("cameras.dimensions",i,"config.cameras.dimensions.editor_label","mdi:aspect-ratio",o` + ${this._renderStringInput(ie(Ft,i))} + ${this._renderMediaLayout("cameras.dimensions.layout","config.cameras.dimensions.layout.editor_label",ie(Gt,i),ie(Jt,i),ie(Qt,i),ie(Wt,i),ie(Xt,i),ie(Yt,i),ie(Zt,i),ie(en,i),ie(tn,i),ie(nn,i))} + `)} + ${this._putInSubmenu("cameras.capabilities",i,"config.cameras.capabilities.editor_label","mdi:cog-stop",o` + ${this._renderOptionSelector(ie(an,i),this._capabilities,{multiple:!0})} + ${this._renderOptionSelector(ie(sn,i),this._capabilities,{multiple:!0})} + `)} + ${this._putInSubmenu("cameras.proxy",i,"config.cameras.proxy.editor_label","mdi:arrow-decision",o` + ${this._renderOptionSelector(ie(on,i),this._proxyMedia,{label:l("config.cameras.proxy.media.editor_label")})} + ${this._renderSwitch(ie(rn,i),this._defaults.cameras.proxy.dynamic)} + ${this._renderOptionSelector(ie(ln,i),this._proxySSLVerification,{label:l("config.cameras.proxy.ssl_verification.editor_label")})} + ${this._renderOptionSelector(ie(cn,i),this._proxySSLCiphers,{label:l("config.cameras.proxy.ssl_ciphers.editor_label")})} + `)} +
`:""} +
+ `}_renderStringInput(e,i){if(this._config)return o` + this._valueChangedHandler(e,i)} + > + + `}_renderSwitch(e,i,t){if(this._config)return o` + this._valueChangedHandler(e,i)} + > + + `}_updateConfig(e){this._config=e,te(this,"config-changed",{config:this._config})}render(){if(!this.hass||!this._config)return o``;const e=x(this.hass),i=b(this._config,un)||[];return o` + ${this._configUpgradeable?o`
+ ${l("editor.upgrade_available")} + + {if(this._config){const e=u(this._config);ne(e),this._updateConfig(e)}}} + > + + +
+
`:o``} +
+ ${this._renderOptionSetHeader("cameras")} + ${"cameras"===this._expandedMenus[bn]?o` +
+ ${i.map(((t,n)=>this._renderCamera(i,n,e)))} + ${this._renderCamera(i,i.length,e,!0)} +
+ `:""} + ${this._renderOptionSetHeader("profiles")} + ${"profiles"===this._expandedMenus[bn]?o`
+ ${this._renderOptionSelector(ae,this._profiles,{multiple:!0,label:l("config.profiles.editor_label")})} +
`:""} + ${this._renderOptionSetHeader("view")} + ${"view"===this._expandedMenus[bn]?o` +
+ ${this._renderOptionSelector(se,this._viewModes)} + ${this._renderOptionSelector(oe,this._cameraSelectViewModes)} + ${this._renderOptionSelector(re,this._darkModes)} + ${this._renderNumberInput(le)} + ${this._renderSwitch(ce,this._defaults.view.default_cycle_camera)} + ${this._renderViewDefaultResetMenu()} ${this._renderViewTriggersMenu()} + ${this._renderViewKeyboardShortcutMenu()} +
+ `:""} + ${this._renderOptionSetHeader("menu")} + ${"menu"===this._expandedMenus[bn]?o` +
+ ${this._renderOptionSelector(de,this._menuStyles)} + ${this._renderOptionSelector(ue,this._menuPositions)} + ${this._renderOptionSelector(me,this._menuAlignments)} + ${this._renderNumberInput(he,{min:X})} + ${this._renderMenuButton("frigate")} + ${this._renderMenuButton("cameras")} + ${this._renderMenuButton("substreams")} + ${this._renderMenuButton("live")} + ${this._renderMenuButton("clips")} + ${this._renderMenuButton("snapshots")} + ${this._renderMenuButton("recordings")} + ${this._renderMenuButton("image")} + ${this._renderMenuButton("download")} + ${this._renderMenuButton("camera_ui")} + ${this._renderMenuButton("fullscreen")} + ${this._renderMenuButton("expand")} + ${this._renderMenuButton("timeline")} + ${this._renderMenuButton("media_player")} + ${this._renderMenuButton("microphone",o`${this._renderOptionSelector(`${R}.microphone.type`,this._microphoneButtonTypes,{label:l("config.menu.buttons.type")})}`)} + ${this._renderMenuButton("play")} + ${this._renderMenuButton("mute")} + ${this._renderMenuButton("screenshot")} + ${this._renderMenuButton("display_mode")} + ${this._renderMenuButton("ptz_controls")} + ${this._renderMenuButton("ptz_home")} +
+ `:""} + ${this._renderOptionSetHeader("status_bar")} + ${"status_bar"===this._expandedMenus[bn]?o` +
+ ${this._renderOptionSelector(_e,this._statusBarStyles)} + ${this._renderOptionSelector(ge,this._statusBarPositions)} + ${this._renderNumberInput(be,{min:pe,label:l("config.status_bar.height")})} + ${this._renderNumberInput(ve,{min:0,max:60,default:this._defaults.status_bar.popup_seconds,label:l("config.status_bar.popup_seconds")})} + ${this._renderStatusBarItem("title")} + ${this._renderStatusBarItem("resolution")} + ${this._renderStatusBarItem("technology")} + ${this._renderStatusBarItem("engine")} +
+ `:""} + ${this._renderOptionSetHeader("live")} + ${"live"===this._expandedMenus[bn]?o` +
+ ${this._renderSwitch(fe,this._defaults.live.preload)} + ${this._renderSwitch($e,this._defaults.live.draggable)} + ${this._renderSwitch(ye,this._defaults.live.zoomable)} + ${this._renderSwitch(we,this._defaults.live.lazy_load)} + ${this._renderOptionSelector(Se,this._mediaActionNegativeConditions,{multiple:!0})} + ${this._renderOptionSelector(xe,this._mediaActionPositiveConditions,{multiple:!0})} + ${this._renderOptionSelector(Me,this._mediaActionNegativeConditions,{multiple:!0})} + ${this._renderOptionSelector(Ie,this._mediaLiveMuteConditions,{multiple:!0})} + ${this._renderOptionSelector(ke,this._mediaLiveUnmuteConditions,{multiple:!0})} + ${this._renderOptionSelector(Oe,this._transitionEffects)} + ${this._renderSwitch(Ce,this._defaults.live.show_image_during_load)} + ${this._renderViewDisplay("live.display",ze,Ae,Ne,Te)} + ${this._putInSubmenu("live.controls",!0,"config.live.controls.editor_label","mdi:gamepad",o` + ${this._renderSwitch(Be,this._defaults.live.controls.builtin,{label:l("config.common.controls.builtin")})} + ${this._renderNextPreviousControls("live.controls.next_previous",Ee,Pe,{allowIcons:!0})} + ${this._renderThumbnailsControls("live.controls.thumbnails",He,Le,Ve,Ke,Ue,this._defaults.live.controls.thumbnails,{configPathMediaType:je,configPathEventsMediaType:qe,configPathMode:Re})} + ${this._renderMiniTimeline("live.controls.timeline",De,Fe,Ge,Je,Qe,We,this._defaults.live.controls.timeline.show_recordings,Xe)} + ${this._putInSubmenu("live.controls.ptz",!0,"config.live.controls.ptz.editor_label","mdi:pan",o` + ${this._renderOptionSelector(Ye,this._ptzModes)} + ${this._renderOptionSelector(Ze,this._ptzPositions)} + ${this._renderOptionSelector(ei,this._ptzOrientations)} + ${this._renderSwitch(ii,this._defaults.live.controls.ptz.hide_pan_tilt,{label:l("config.live.controls.ptz.hide_pan_tilt")})} + ${this._renderSwitch(ti,this._defaults.live.controls.ptz.hide_pan_tilt,{label:l("config.live.controls.ptz.hide_zoom")})} + ${this._renderSwitch(ni,this._defaults.live.controls.ptz.hide_home,{label:l("config.live.controls.ptz.hide_home")})} + `)} + `)} + ${this._putInSubmenu("live.microphone",!0,"config.live.microphone.editor_label","mdi:microphone",o` + ${this._renderNumberInput(ai)} + ${this._renderSwitch(si,this._defaults.live.microphone.always_connected)} + ${this._renderNumberInput(oi)} + `)} +
+ `:""} + ${this._renderOptionSetHeader("media_gallery")} + ${"media_gallery"===this._expandedMenus[bn]?o`
+ ${this._renderThumbnailsControls("media_gallery.controls.thumbnails",ri,li,ci,di,ui,this._defaults.media_gallery.controls.thumbnails)} + ${this._renderFilterControls("media_gallery.controls.filter",mi)} +
`:""} + ${this._renderOptionSetHeader("media_viewer")} + ${"media_viewer"===this._expandedMenus[bn]?o`
+ ${this._renderOptionSelector(hi,this._mediaActionPositiveConditions,{multiple:!0})} + ${this._renderOptionSelector(_i,this._mediaActionNegativeConditions,{multiple:!0})} + ${this._renderOptionSelector(gi,this._mediaActionNegativeConditions,{multiple:!0})} + ${this._renderOptionSelector(bi,this._mediaActionPositiveConditions,{multiple:!0})} + ${this._renderSwitch(pi,this._defaults.media_viewer.draggable)} + ${this._renderSwitch(vi,this._defaults.media_viewer.zoomable)} + ${this._renderSwitch(fi,this._defaults.media_viewer.lazy_load)} + ${this._renderOptionSelector($i,this._transitionEffects)} + ${this._renderSwitch(yi,this._defaults.media_viewer.snapshot_click_plays_clip)} + ${this._renderViewDisplay("media_viewer.display",wi,Si,xi,Mi)} + ${this._putInSubmenu("media_viewer.controls",!0,"config.media_viewer.controls.editor_label","mdi:gamepad",o` + ${this._renderSwitch(Ii,this._defaults.media_viewer.controls.builtin,{label:l("config.common.controls.builtin")})} + ${this._renderNextPreviousControls("media_viewer.controls.next_previous",ki,Oi,{allowThumbnails:!0})} + ${this._renderThumbnailsControls("media_viewer.controls.thumbnails",Ci,zi,Ai,Ni,Ti,this._defaults.media_viewer.controls.thumbnails,{configPathMode:Bi})} + ${this._renderMiniTimeline("media_viewer.controls.timeline",Ei,Pi,Hi,Li,Vi,Ki,this._defaults.media_viewer.controls.timeline.show_recordings,Ui)} + `)} +
`:""} + ${this._renderOptionSetHeader("image")} + ${"image"===this._expandedMenus[bn]?o`
+ ${this._renderImageOptions(ji,qi,Ri,Di,Fi)} +
`:""} + ${this._renderOptionSetHeader("timeline")} + ${"timeline"===this._expandedMenus[bn]?o`
+ ${this._renderTimelineCoreControls(F,G,J,Q,W,this._defaults.timeline.show_recordings)} + ${this._renderThumbnailsControls("timeline.controls.thumbnails",Gi,Ji,Qi,Wi,Xi,this._defaults.timeline.controls.thumbnails,{configPathMode:Yi})} +
`:""} + ${this._renderOptionSetHeader("dimensions")} + ${"dimensions"===this._expandedMenus[bn]?o`
+ ${this._renderOptionSelector(Zi,this._aspectRatioModes)} + ${this._renderStringInput(et)} + ${this._renderStringInput(it)} +
`:""} + ${this._renderOptionSetHeader("performance","low"===b(this._config,mn)?"warning":void 0)} + ${"performance"===this._expandedMenus[bn]?o`
+ ${"low"===b(this._config,mn)?this._renderInfo(l("config.performance.warning")):o``} + ${this._putInSubmenu("performance.features",!0,"config.performance.features.editor_label","mdi:feature-search",o` + ${this._renderSwitch(tt,this._defaults.performance.features.animated_progress_indicator)} + ${this._renderNumberInput(nt,{max:at})} + ${this._renderNumberInput(st,{min:1})} + `)} + ${this._putInSubmenu("performance.style",!0,"config.performance.style.editor_label","mdi:palette-swatch-variant",o` + ${this._renderSwitch(ot,this._defaults.performance.style.border_radius)} + ${this._renderSwitch(rt,this._defaults.performance.style.box_shadow)} + `)} +
`:""} + ${void 0!==this._config.overrides?o` ${this._renderOptionSetHeader("overrides")} + ${"overrides"===this._expandedMenus[bn]?o`
+ ${this._renderInfo(l("config.overrides.info"))} +
`:""}`:o``} +
+ `}_closeMenu(e){delete this._expandedMenus[e],this.requestUpdate()}_openMenu(e,i){this._expandedMenus[e]=i,this.requestUpdate()}_toggleMenu(e){if(e&&e.target){const i=e.target.domain,t=e.target.key;this._expandedMenus[i]===t?this._closeMenu(i):this._openMenu(i,t)}}_valueChangedHandler(e,i){if(!this._config||!this.hass)return;let t;if(i.detail&&void 0!==i.detail.value&&(t=i.detail.value,"string"==typeof t&&(t=t.trim())),b(this._config,e)===t)return;const n=u(this._config);""===t||void 0===t?lt(n,e):ct(n,e,t),this._updateConfig(n)}static get styles(){return c('ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n.option {\n padding: 4px 4px;\n cursor: pointer;\n}\n\n.option.option-overrides .title {\n color: var(--warning-color);\n}\n\n.row {\n display: flex;\n margin-bottom: -14px;\n pointer-events: none;\n}\n\n.title {\n padding-left: 16px;\n margin-top: -6px;\n pointer-events: none;\n}\n\n.title.warning {\n color: var(--warning-color);\n}\n\n.secondary {\n padding-left: 40px;\n color: var(--secondary-text-color);\n pointer-events: none;\n}\n\n.values {\n background: var(--secondary-background-color);\n display: grid;\n}\n\n.values + .option,\n.submenu + .option {\n margin-top: 10px;\n}\n\ndiv.upgrade {\n width: auto;\n border: 1px dotted var(--primary-color);\n margin: 10px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\ndiv.upgrade span {\n padding: 10px;\n}\n\n.submenu-header {\n display: flex;\n padding: 10px;\n cursor: pointer;\n}\n\n.submenu.selected > .submenu-header {\n background-color: var(--primary-color);\n color: var(--primary-text-color);\n}\n\n.submenu-header * {\n flex-basis: auto;\n pointer-events: none;\n}\n\n.submenu-header .new-camera {\n font-style: italic;\n}\n\n.submenu:not(.selected) > .submenu-header .new-camera {\n color: var(--secondary-text-color, "black");\n}\n\n.submenu-header frigate-card-icon {\n margin-right: 15px;\n}\n\n.submenu.selected {\n border: 1px solid var(--primary-color);\n}\n\n.submenu {\n width: calc(100% - 20px);\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 10px;\n}\n\n.submenu:first-child,\n:not(.submenu) + .submenu {\n margin-top: 10px;\n}\n\n.submenu .controls {\n display: inline-block;\n margin-left: auto;\n margin-right: 0px;\n margin-bottom: 5px;\n}\n\n.submenu .controls ha-icon-button.button {\n --mdc-icon-button-size: 32px;\n --mdc-icon-size: calc(var(--mdc-icon-button-size) / 2);\n}\n\nspan.info {\n padding: 10px;\n}\n\nha-selector {\n padding: 10px;\n border: 1px solid var(--divider-color);\n}')}};t([n({attribute:!1})],vn.prototype,"hass",void 0),t([d()],vn.prototype,"_config",void 0),t([d()],vn.prototype,"_defaults",void 0),t([d()],vn.prototype,"_expandedMenus",void 0),vn=t([a("frigate-card-editor")],vn);export{vn as FrigateCardEditor}; diff --git a/config/www/community/frigate-hass-card/editor-238b96c0.js.gz b/config/www/community/frigate-hass-card/editor-238b96c0.js.gz new file mode 100644 index 00000000..8bf64ca9 Binary files /dev/null and b/config/www/community/frigate-hass-card/editor-238b96c0.js.gz differ diff --git a/config/www/community/frigate-hass-card/endOfDay-cfc9c86c.js b/config/www/community/frigate-hass-card/endOfDay-cfc9c86c.js new file mode 100644 index 00000000..21a501ad --- /dev/null +++ b/config/www/community/frigate-hass-card/endOfDay-cfc9c86c.js @@ -0,0 +1 @@ +import{c_ as r}from"./card-e5d55e5b.js";function o(o){const s=r(o);return s.setHours(23,59,59,999),s}export{o as e}; diff --git a/config/www/community/frigate-hass-card/endOfDay-cfc9c86c.js.gz b/config/www/community/frigate-hass-card/endOfDay-cfc9c86c.js.gz new file mode 100644 index 00000000..18abd50d Binary files /dev/null and b/config/www/community/frigate-hass-card/endOfDay-cfc9c86c.js.gz differ diff --git a/config/www/community/frigate-hass-card/endpoint-c9cec68c.js b/config/www/community/frigate-hass-card/endpoint-c9cec68c.js new file mode 100644 index 00000000..9ba5a795 --- /dev/null +++ b/config/www/community/frigate-hass-card/endpoint-c9cec68c.js @@ -0,0 +1 @@ +import{dp as t,d6 as n}from"./card-e5d55e5b.js";const r=async(r,a,e)=>{if(!a.sign)return a.endpoint;let s;try{s=await t(r,a.endpoint,e)}catch(t){n(t)}return s?s.replace(/^http/i,"ws"):null};export{r as c}; diff --git a/config/www/community/frigate-hass-card/endpoint-c9cec68c.js.gz b/config/www/community/frigate-hass-card/endpoint-c9cec68c.js.gz new file mode 100644 index 00000000..07601453 Binary files /dev/null and b/config/www/community/frigate-hass-card/endpoint-c9cec68c.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-86b0096c.js.gz b/config/www/community/frigate-hass-card/engine-86b0096c.js.gz index 0280383b..08f33685 100644 Binary files a/config/www/community/frigate-hass-card/engine-86b0096c.js.gz and b/config/www/community/frigate-hass-card/engine-86b0096c.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-frigate-be325e58.js b/config/www/community/frigate-hass-card/engine-frigate-be325e58.js new file mode 100644 index 00000000..d3a3d6b8 --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-frigate-be325e58.js @@ -0,0 +1,3 @@ +import{c_ as e,dW as t,dX as n,dY as a,dZ as r,d_ as i,l as s,d$ as o,e0 as c,e1 as g,e2 as l,d6 as u,dP as m,k as d,i as f,dc as h,e3 as p,di as _,d4 as y,d2 as b,e4 as w,e5 as D,e6 as C,dM as v,j as T,d7 as I,d9 as S,d8 as M}from"./card-e5d55e5b.js";import{C as F}from"./engine-86b0096c.js";import{C as $,G as z,g as N}from"./engine-generic-93cdbee6.js";import{a as E,V as R}from"./media-c9012082.js";import{s as Y,e as x}from"./startOfHour-34edc6a8.js";function H(t){return e(1e3*t)}const j=n.object({camera:n.string(),end_time:n.number().nullable(),false_positive:n.boolean().nullable(),has_clip:n.boolean(),has_snapshot:n.boolean(),id:n.string(),label:n.string(),sub_label:n.string().nullable(),start_time:n.number(),top_score:n.number().nullable(),zones:n.string().array(),retain_indefinitely:n.boolean().optional()}).array(),Z=n.object({hour:n.preprocess((e=>Number(e)),n.number().min(0).max(23)),duration:n.number().min(0),events:n.number().min(0)}),q=n.object({day:n.preprocess((e=>"string"==typeof e?a(e):e),n.date()),events:n.number(),hours:Z.array()}).array(),U=n.object({start_time:n.number(),end_time:n.number(),id:n.string()}).array(),W=n.object({success:n.boolean(),message:n.string()}),Q=n.object({camera:n.string(),day:n.string(),label:n.string(),sub_label:n.string().nullable(),zones:n.string().array()}).array(),P=n.object({name:n.string().optional(),features:n.string().array().optional(),presets:n.string().array().optional()}),k=n.object({camera:n.string(),snapshot:n.object({frame_time:n.number()}).nullable(),has_clip:n.boolean(),has_snapshot:n.boolean(),label:n.string(),current_zones:n.string().array()}),A=n.object({before:k,after:k,type:n.enum(["new","update","end"])});const O=async(e,t)=>await r(e,j,{type:"frigate/events/get",...t},!0),L=e=>"birdseye"===e.frigate.camera_name;class V extends ${constructor(e,t,n){super(e,t,n),this._frigateEventHandler=e=>{const t=!e.before.has_snapshot&&e.after.has_snapshot||e.before.snapshot?.frame_time!==e.after.snapshot?.frame_time,n=!e.before.has_clip&&e.after.has_clip,a=this.getConfig();if(a.frigate.zones?.length&&!a.frigate.zones.some((t=>e.after.current_zones.includes(t)))||a.frigate.labels?.length&&!a.frigate.labels.includes(e.after.label))return;const r=a.triggers.events;(r.includes("events")||r.includes("snapshots")&&t||r.includes("clips")&&n)&&this._eventCallback?.({fidelity:"high",cameraID:this.getID(),type:e.type,clip:n&&r.includes("clips"),snapshot:t&&r.includes("snapshots")})}}async initialize(e){return await this._initializeConfig(e.hass,e.entityRegistryManager),await this._initializeCapabilities(e.hass),await this._subscribeToEvents(e.hass,e.frigateEventWatcher),await super.initialize(e)}async _initializeConfig(e,n){const a=this.getConfig(),r=!!a.frigate?.camera_name,i=a.triggers.motion||a.triggers.occupancy;let g=null;const l=o(a);if(l&&(!r||i)&&(g=await n.getEntity(e,l),!g))throw new c(s("error.no_camera_entity"),a);if(g&&!r){const e=this._getFrigateCameraNameFromEntity(g);e&&(this._config.frigate.camera_name=e)}if(i){const r=await n.getMatchingEntities(e,(e=>e.config_entry_id===g?.config_entry_id&&!e.disabled_by&&e.entity_id.startsWith("binary_sensor.")));if(a.triggers.motion){const e=this._getMotionSensor(a,[...r.values()]);e&&a.triggers.entities.push(e)}if(a.triggers.occupancy){const e=this._getOccupancySensor(a,[...r.values()]);e&&a.triggers.entities.push(...e)}a.triggers.entities=(u=a.triggers.entities)&&u.length?t(u):[]}var u}async _initializeCapabilities(e){const t=this.getConfig(),n=g(this.getConfig()),a=await this._getPTZCapabilities(e,t),r=n||a?{...a,...n}:null,i=L(t);this._capabilities=new l({"favorite-events":!i,"favorite-recordings":!1,seek:!i,clips:!i,snapshots:!i,recordings:!i,live:!0,menu:!0,substream:!0,...r&&{ptz:r}},{disable:t.capabilities?.disable,disableExcept:t.capabilities?.disable_except})}_getFrigateCameraNameFromEntity(e){if("frigate"===e.platform&&e.unique_id&&"string"==typeof e.unique_id){const t=e.unique_id.match(/:camera:(?[^:]+)$/);if(t&&t.groups)return t.groups.camera}return null}async _getPTZCapabilities(e,t){if(!t.frigate.camera_name||L(t))return null;let n=null;try{n=await(async(e,t,n)=>await r(e,P,{type:"frigate/ptz/info",instance_id:t,camera:n},!0))(e,t.frigate.client_id,t.frigate.camera_name)}catch(e){return u(e),null}const a=[...n.features?.includes("pt")?["continuous"]:[]],i=[...n.features?.includes("zoom")?["continuous"]:[]],s=n.presets;return a.length||i.length||s?.length?{...a&&{left:a,right:a,up:a,down:a},...i&&{zoomIn:i,zoomOut:i},...s&&{presets:s}}:null}_getMotionSensor(e,t){return e.frigate.camera_name?t.find((t=>"string"==typeof t.unique_id&&!!t.unique_id?.match(new RegExp(`:motion_sensor:${e.frigate.camera_name}`))))?.entity_id??null:null}_getOccupancySensor(e,t){const n=[],a=(e,a)=>{const r=t.find((t=>"string"==typeof t.unique_id&&!!t.unique_id?.match(new RegExp(`:occupancy_sensor:${e}_${a}`))))?.entity_id??null;r&&n.push(r)};if(e.frigate.camera_name){const t=e.frigate.zones?.length?e.frigate.zones:[e.frigate.camera_name],r=e.frigate.labels?.length?e.frigate.labels:["all"];for(const e of t)for(const t of r)a(e,t);if(n.length)return n}return null}async _subscribeToEvents(e,t){const n=this.getConfig();if(!n.triggers.events.length||!n.frigate.camera_name)return; +/* istanbul ignore next -- exercising the matcher is not possible when the + test uses an event watcher -- @preserve */const a={instanceID:n.frigate.client_id,callback:e=>this._frigateEventHandler(e),matcher:e=>e.after.camera===n.frigate.camera_name};await t.subscribe(e,a),this._onDestroy((()=>t.unsubscribe(a)))}}class G{constructor(){this._requests=[],this._unsubscribeCallback={}}async subscribe(e,t){const n=!this._hasSubscribers(t.instanceID);this._requests.push(t),n&&(this._unsubscribeCallback[t.instanceID]=await e.connection.subscribeMessage((e=>this._receiveHandler(t.instanceID,e)),{type:"frigate/events/subscribe",instance_id:t.instanceID}))}async unsubscribe(e){this._requests=this._requests.filter((t=>t!==e)),this._hasSubscribers(e.instanceID)||(await this._unsubscribeCallback[e.instanceID](),delete this._unsubscribeCallback[e.instanceID])}_hasSubscribers(e){return!!this._requests.filter((t=>t.instanceID===e)).length}_receiveHandler(e,t){let n;try{n=JSON.parse(t)}catch(e){return void console.warn("Received non-JSON payload as Frigate event",t)}const a=A.safeParse(n);if(a.success)for(const t of this._requests)t.instanceID!==e||t.matcher&&!t.matcher(a.data)||t.callback(a.data);else console.warn("Received malformed Frigate event from Home Assistant",t)}}function J(e,t){const n=function(e){if(!B[e]){const t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===t;B[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return B[e]}(t);return"formatToParts"in n?function(e,t){try{const n=e.formatToParts(t),a=[];for(let e=0;e=0?i:1e3+i,a-r}function ie(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}const se={};function oe(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const ce=36e5,ge=6e4,le=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function me(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);const n=null==t.additionalDigits?le:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);const a=function(e){const t={};let n,a=ue.dateTimePattern.exec(e);a?(t.date=a[1],n=a[3]):(a=ue.datePattern.exec(e),a?(t.date=a[1],n=a[2]):(t.date=null,n=e));if(n){const e=ue.timeZone.exec(n);e?(t.time=n.replace(e[1],""),t.timeZone=e[1].trim()):t.time=n}return t}(e),{year:r,restDateString:i}=function(e,t){if(e){const n=ue.YYY[t],a=ue.YYYYY[t];let r=ue.YYYY.exec(e)||a.exec(e);if(r){const t=r[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(r=ue.YY.exec(e)||n.exec(e),r){const t=r[1];return{year:100*parseInt(t,10),restDateString:e.slice(t.length)}}}return{year:null}}(a.date,n),s=function(e,t){if(null===t)return null;let n,a,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let i=ue.MM.exec(e);if(i)return n=new Date(0),a=parseInt(i[1],10)-1,_e(t,a)?(n.setUTCFullYear(t,a),n):new Date(NaN);if(i=ue.DDD.exec(e),i){n=new Date(0);const e=parseInt(i[1],10);return function(e,t){if(t<1)return!1;const n=pe(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,e)?(n.setUTCFullYear(t,0,e),n):new Date(NaN)}if(i=ue.MMDD.exec(e),i){n=new Date(0),a=parseInt(i[1],10)-1;const e=parseInt(i[2],10);return _e(t,a,e)?(n.setUTCFullYear(t,a,e),n):new Date(NaN)}if(i=ue.Www.exec(e),i)return r=parseInt(i[1],10)-1,ye(r)?de(t,r):new Date(NaN);if(i=ue.WwwD.exec(e),i){r=parseInt(i[1],10)-1;const e=parseInt(i[2],10)-1;return ye(r,e)?de(t,r,e):new Date(NaN)}return null}(i,r);if(null===s||isNaN(s.getTime()))return new Date(NaN);if(s){const e=s.getTime();let n,r=0;if(a.time&&(r=function(e){let t,n,a=ue.HH.exec(e);if(a)return t=parseFloat(a[1].replace(",",".")),be(t)?t%24*ce:NaN;if(a=ue.HHMM.exec(e),a)return t=parseInt(a[1],10),n=parseFloat(a[2].replace(",",".")),be(t,n)?t%24*ce+n*ge:NaN;if(a=ue.HHMMSS.exec(e),a){t=parseInt(a[1],10),n=parseInt(a[2],10);const e=parseFloat(a[3].replace(",","."));return be(t,n,e)?t%24*ce+n*ge+1e3*e:NaN}return null}(a.time),null===r||isNaN(r)))return new Date(NaN);if(a.timeZone||t.timeZone){if(n=ae(a.timeZone||t.timeZone,new Date(e+r)),isNaN(n))return new Date(NaN)}else n=oe(new Date(e+r)),n=oe(new Date(e+r+n));return new Date(e+r+n)}return new Date(NaN)}function de(e,t,n){t=t||0,n=n||0;const a=new Date(0);a.setUTCFullYear(e,0,4);const r=7*t+n+1-(a.getUTCDay()||7);return a.setUTCDate(a.getUTCDate()+r),a}const fe=[31,28,31,30,31,30,31,31,30,31,30,31],he=[31,29,31,30,31,30,31,31,30,31,30,31];function pe(e){return e%400==0||e%4==0&&e%100!=0}function _e(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;const a=pe(e);if(a&&n>he[t])return!1;if(!a&&n>fe[t])return!1}return!0}function ye(e,t){return!(e<0||e>52)&&(null==t||!(t<0||t>6))}function be(e,t,n){return!(e<0||e>=25)&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}const we=e=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=Math.round(e.end_time?e.end_time-e.start_time:Date.now()/1e3-e.start_time),a=null!==e.top_score?` ${Math.round(100*e.top_score)}%`:"";return`${m(function(e,t,n){const a=ae(t,e=me(e,n),!0),r=new Date(e.getTime()-a),i=new Date(0);return i.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),i.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),i}(1e3*e.start_time,t))} [${n}s, ${d(e.label)}${a}]`};class De extends E{constructor(e,t,n,a,r,i){super(e,t),this._event=n,this._contentID=a,this._thumbnail=r,this._subLabels=i??null}getStartTime(){return H(this._event.start_time)}getEndTime(){return this._event.end_time?H(this._event.end_time):null}inProgress(){return!this.getEndTime()}getVideoContentType(){return R.HLS}getID(){return this._event.id}getContentID(){return this._contentID}getTitle(){return we(this._event)}getThumbnail(){return this._thumbnail}isFavorite(){return this._event.retain_indefinitely??null}setFavorite(e){this._event.retain_indefinitely=e}getWhat(){return[this._event.label]}getWhere(){const e=this._event.zones;return e.length?e:null}getScore(){return this._event.top_score}getTags(){return this._subLabels}isGroupableWith(e){return this.getMediaType()===e.getMediaType()&&f(this.getWhere(),e.getWhere())&&f(this.getWhat(),e.getWhat())}}class Ce extends E{constructor(e,t,n,a,r,i){super(e,t),this._recording=n,this._id=a,this._contentID=r,this._title=i}getID(){return this._id}getStartTime(){return this._recording.startTime}getEndTime(){return this._recording.endTime}inProgress(){return!this.getEndTime()}getVideoContentType(){return R.HLS}getContentID(){return this._contentID}getTitle(){return this._title}getEventCount(){return this._recording.events}}class ve{static createEventViewMedia(e,t,n,a,r){return"clip"===e&&!a.has_clip||"snapshot"===e&&!a.has_snapshot||!n.frigate.client_id||!n.frigate.camera_name?null:new De(e,t,a,((e,t,n,a)=>`media-source://frigate/${e}/event/${a}/${t}/${n.id}`)(n.frigate.client_id,n.frigate.camera_name,a,"clip"===e?"clips":"snapshots"),((e,t)=>`/api/frigate/${e}/thumbnail/${t.id}`)(n.frigate.client_id,a),r)}static createRecordingViewMedia(e,t,n,a){return n.frigate.client_id&&n.frigate.camera_name?new Ce("recording",e,t,((e,t)=>`${e.frigate?.client_id??""}/${e.frigate.camera_name??""}/${t.startTime.getTime()}/${t.endTime.getTime()}`)(n,t),((e,t,n)=>["media-source://frigate",e,"recordings",t,`${n.startTime.getFullYear()}-${String(n.startTime.getMonth()+1).padStart(2,"0")}-${String(String(n.startTime.getDate()).padStart(2,"0"))}`,String(n.startTime.getHours()).padStart(2,"0")].join("/"))(n.frigate.client_id,n.frigate.camera_name,t),((e,t)=>`${e} ${m(t.startTime)}`)(a,t)):null}}class Te{static isFrigateMedia(e){return this.isFrigateEvent(e)||this.isFrigateRecording(e)}static isFrigateEvent(e){return e instanceof De}static isFrigateRecording(e){return e instanceof Ce}}class Ie{static isFrigateEventQueryResults(e){return e.engine===p.Frigate&&e.type===C.Event}static isFrigateRecordingQueryResults(e){return e.engine===p.Frigate&&e.type===C.Recording}static isFrigateRecordingSegmentsResults(e){return e.engine===p.Frigate&&e.type===C.RecordingSegments}}class Se extends z{constructor(e,t,n,a,r){super(t,r),this._throttledSegmentGarbageCollector=h(this._garbageCollectSegments.bind(this),36e5,{leading:!1,trailing:!0}),this._entityRegistryManager=e,this._frigateEventWatcher=new G,this._recordingSegmentsCache=n,this._requestCache=a}getEngineType(){return p.Frigate}async createCamera(e,t){const n=new V(t,this,{eventCallback:this._eventCallback});return await n.initialize({hass:e,entityRegistryManager:this._entityRegistryManager,stateWatcher:this._stateWatcher,frigateEventWatcher:this._frigateEventWatcher})}async getMediaDownloadPath(e,t,n){return Te.isFrigateEvent(n)?{endpoint:`/api/frigate/${t.frigate.client_id}/notifications/${n.getID()}/`+(_.isClip(n)?"clip.mp4":"snapshot.jpg")+"?download=true",sign:!0}:Te.isFrigateRecording(n)?{endpoint:`/api/frigate/${t.frigate.client_id}/recording/${t.frigate.camera_name}/start/${Math.floor(n.getStartTime().getTime()/1e3)}/end/${Math.floor(n.getEndTime().getTime()/1e3)}?download=true`,sign:!0}:null}generateDefaultEventQuery(e,t,n){const a=[...e.getCameraConfigs(t)],r=y(a.map((e=>e?.frigate.zones)),f),i=y(a.map((e=>e?.frigate.labels)),f);if(1===r.length&&1===i.length)return[{type:b.Event,cameraIDs:t,...i[0]&&{what:new Set(i[0])},...r[0]&&{where:new Set(r[0])},...n}];const s=[];for(const a of t){const t=e.getCameraConfig(a);t&&s.push({type:b.Event,cameraIDs:new Set([a]),...t.frigate.labels&&{what:new Set(t.frigate.labels)},...t.frigate.zones&&{where:new Set(t.frigate.zones)},...n})}return s.length?s:null}generateDefaultRecordingQuery(e,t,n){return[{type:b.Recording,cameraIDs:t,...n}]}generateDefaultRecordingSegmentsQuery(e,t,n){return n.start&&n.end?[{type:b.RecordingSegments,cameraIDs:t,start:n.start,end:n.end,...n}]:null}async favoriteMedia(e,t,n,a){Te.isFrigateEvent(n)&&(await async function(e,t,n,a){const o={type:"frigate/event/retain",instance_id:t,event_id:n,retain:a},c=await r(e,W,o,!0);if(!c.success)throw new i(s("error.failed_retain"),{request:o,response:c})}(e,t.frigate.client_id,n.getID(),a),n.setFavorite(a))}_buildInstanceToCameraIDMapFromQuery(e,t){const n=new Map;for(const a of t){const t=this._getQueryableCameraConfig(e,a),r=t?.frigate.client_id;r&&(n.has(r)||n.set(r,new Set),n.get(r)?.add(a))}return n}_getFrigateCameraNamesForCameraIDs(e,t){const n=new Set;for(const a of t){const t=this._getQueryableCameraConfig(e,a);t?.frigate.camera_name&&n.add(t.frigate.camera_name)}return n}async getEvents(e,t,n,a){const r=new Map,i=async(i,s)=>{if(!s||!s.size)return;const o={...n,cameraIDs:s},c=a?.useCache??1?this._requestCache.get(o):null;if(c)return void r.set(n,c);const g={instance_id:i,cameras:Array.from(this._getFrigateCameraNamesForCameraIDs(t,s)),...n.what&&{labels:Array.from(n.what)},...n.where&&{zones:Array.from(n.where)},...n.tags&&{sub_labels:Array.from(n.tags)},...n.end&&{before:Math.floor(n.end.getTime()/1e3)},...n.start&&{after:Math.floor(n.start.getTime()/1e3)},...n.limit&&{limit:n.limit},...n.hasClip&&{has_clip:n.hasClip},...n.hasSnapshot&&{has_snapshot:n.hasSnapshot},...n.favorite&&{favorites:n.favorite},limit:n?.limit??F},l={type:C.Event,engine:p.Frigate,instanceID:i,events:await O(e,g),expiry:v(new Date,{seconds:60}),cached:!1};(a?.useCache??1)&&this._requestCache.set(n,{...l,cached:!0},l.expiry),r.set(o,l)},s=this._buildInstanceToCameraIDMapFromQuery(t,n.cameraIDs);return await Promise.all(Array.from(s.keys()).map((e=>i(e,s.get(e))))),r.size?r:null}async getRecordings(e,t,n,a){const i=new Map,s=async(n,s)=>{const o={...n,cameraIDs:new Set([s])},c=a?.useCache??1?this._requestCache.get(o):null;if(c)return void i.set(o,c);const g=this._getQueryableCameraConfig(t,s);if(!g||!g.frigate.camera_name)return;const l=await(async(e,t,n)=>await r(e,q,{type:"frigate/recordings/summary",instance_id:t,camera:n,timezone:e.config.time_zone},!0))(e,g.frigate.client_id,g.frigate.camera_name);let u=[];for(const e of l??[])for(const t of e.hours){const n=v(e.day,{hours:t.hour}),a=Y(n),r=x(n);(!o.start||a>=o.start)&&(!o.end||r<=o.end)&&u.push({cameraID:s,startTime:a,endTime:r,events:t.events})}void 0!==o.limit&&(u=I(u,(e=>e.startTime),"desc").slice(0,o.limit));const m={type:C.Recording,engine:p.Frigate,instanceID:g.frigate.client_id,recordings:u,expiry:v(new Date,{seconds:60}),cached:!1};(a?.useCache??1)&&this._requestCache.set(o,{...m,cached:!0},m.expiry),i.set(o,m)};return await Promise.all(Array.from(n.cameraIDs).map((e=>s(n,e)))),i.size?i:null}async getRecordingSegments(e,t,n,a){const i=new Map,s=async(n,s)=>{const o={...n,cameraIDs:new Set([s])},c=this._getQueryableCameraConfig(t,s);if(!c||!c.frigate.camera_name)return;const g={start:o.start,end:o.end},l=a?.useCache??1?this._recordingSegmentsCache.get(s,g):null;if(l)return void i.set(o,{type:C.RecordingSegments,engine:p.Frigate,instanceID:c.frigate.client_id,segments:l,cached:!0});const u={instance_id:c.frigate.client_id,camera:c.frigate.camera_name,after:Math.floor(o.start.getTime()/1e3),before:Math.floor(o.end.getTime()/1e3)},m=await(async(e,t)=>await r(e,U,{type:"frigate/recordings/get",...t},!0))(e,u);(a?.useCache??1)&&this._recordingSegmentsCache.add(s,g,m),i.set(o,{type:C.RecordingSegments,engine:p.Frigate,instanceID:c.frigate.client_id,segments:m,cached:!1})};return await Promise.all(Array.from(n.cameraIDs).map((e=>s(n,e)))),w((()=>this._throttledSegmentGarbageCollector(e,t))),i.size?i:null}_getCameraIDMatch(e,t,n,a){if(1===t.cameraIDs.size)return[...t.cameraIDs][0];for(const[t,r]of e.getCameraConfigEntries())if(r.frigate.client_id===n&&r.frigate.camera_name===a)return t;return null}generateMediaFromEvents(e,t,n,a){if(!Ie.isFrigateEventQueryResults(a))return null;const r=[];for(const e of a.events){const i=this._getCameraIDMatch(t,n,a.instanceID,e.camera);if(!i)continue;const s=this._getQueryableCameraConfig(t,i);if(!s)continue;let o=null;if(n.hasClip||n.hasSnapshot||!e.has_clip&&!e.has_snapshot?n.hasSnapshot&&e.has_snapshot?o="snapshot":n.hasClip&&e.has_clip&&(o="clip"):o=e.has_clip?"clip":"snapshot",!o)continue;const c=ve.createEventViewMedia(o,i,s,e,e.sub_label?this._splitSubLabels(e.sub_label):void 0);c&&r.push(c)}return r}generateMediaFromRecordings(e,t,n,a){if(!Ie.isFrigateRecordingQueryResults(a))return null;const r=[];for(const n of a.recordings){const a=this._getQueryableCameraConfig(t,n.cameraID);if(!a)continue;const i=ve.createRecordingViewMedia(n.cameraID,n,a,this.getCameraMetadata(e,a).title);i&&r.push(i)}return r}getQueryResultMaxAge(e){return e.type===b.Event||e.type===b.Recording?60:null}async getMediaSeekTime(e,t,n,a,r){const i=n.getStartTime(),s=n.getEndTime();if(!i||!s||as)return null;const o=n.getCameraID(),c={cameraIDs:new Set([o]),start:i,end:s,type:b.RecordingSegments},g=await this.getRecordingSegments(e,t,c,r);return g?this._getSeekTimeInSegments(i,a,Array.from(g.values())[0].segments):null}_getQueryableCameraConfig(e,t){const n=e.getCameraConfig(t);return!n||L(n)?null:n}_splitSubLabels(e){return e.split(",").map((e=>e.trim()))}async getMediaMetadata(e,t,n,a){const i=new Map;if((a?.useCache??1)&&this._requestCache.has(n)){const e=this._requestCache.get(n);if(e)return i.set(n,e),i}const s=new Set,o=new Set,c=new Set,g=new Set,l=this._buildInstanceToCameraIDMapFromQuery(t,n.cameraIDs),u=async(n,a)=>{const i=this._getFrigateCameraNamesForCameraIDs(t,a);for(const t of await(async(e,t)=>await r(e,Q,{type:"frigate/events/summary",instance_id:t,timezone:e.config.time_zone},!0))(e,n))i.has(t.camera)&&(t.label&&s.add(t.label),t.zones.length&&t.zones.forEach(o.add,o),t.day&&c.add(t.day),t.sub_label&&this._splitSubLabels(t.sub_label).forEach(g.add,g))},m=async n=>{const r=await this.getRecordings(e,t,{type:b.Recording,cameraIDs:n},a);if(r)for(const e of r.values())if(Ie.isFrigateRecordingQueryResults(e))for(const t of e.recordings)c.add(S(t.startTime))};await D([...l.entries()],(([e,t])=>(async()=>{await Promise.all([u(e,t),m(t)])})()));const d={type:C.MediaMetadata,engine:p.Frigate,metadata:{...s.size&&{what:s},...o.size&&{where:o},...c.size&&{days:c},...g.size&&{tags:g}},expiry:v(new Date,{seconds:60}),cached:!1};return(a?.useCache??1)&&this._requestCache.set(n,{...d,cached:!0},d.expiry),i.set(n,d),i}async _garbageCollectSegments(e,t){const n=this._recordingSegmentsCache.getCameraIDs(),a={cameraIDs:new Set(n),type:b.Recording},r=(e,t)=>`${e}/${t.getDate()}/${t.getHours()}`,i=await this.getRecordings(e,t,a);if(i)for(const[e,t]of i){if(!Ie.isFrigateRecordingQueryResults(t))continue;const n=new Set;for(const e of t.recordings)n.add(r(e.cameraID,e.startTime));const a=Array.from(e.cameraIDs)[0];this._recordingSegmentsCache.expireMatches(a,(e=>{const t=r(a,H(e.start_time));return!n.has(t)}))}}_getSeekTimeInSegments(e,t,n){if(!n.length)return null;let a=0;for(const r of n){const n=H(r.start_time);if(n>t)break;const i=H(r.end_time),s=nt?t:i).getTime()-s.getTime()}return a/1e3}getMediaCapabilities(e){return{canFavorite:_.isEvent(e),canDownload:!0}}getCameraMetadata(e,t){return{...super.getCameraMetadata(e,t),title:t.title??T(e,t.camera_entity)??T(e,t.webrtc_card?.entity)??d(t.frigate?.camera_name)??t.id??"",engineIcon:"frigate"}}getCameraEndpoints(e,t){const n=(()=>{if(!e.frigate.url)return null;if(!e.frigate.camera_name)return{endpoint:e.frigate.url};const n=`${e.frigate.url}/cameras/`+e.frigate.camera_name;if("live"===t?.view)return{endpoint:n};const a=`${e.frigate.url}/events?camera=`+e.frigate.camera_name,r=`${e.frigate.url}/recording/`+e.frigate.camera_name;switch(t?.media?.getMediaType()){case"clip":case"snapshot":return{endpoint:a};case"recording":const e=t.media.getStartTime();if(e)return{endpoint:r+M(e,"yyyy-MM-dd/HH")}}switch(t?.view){case"clip":case"clips":case"snapshots":case"snapshot":return{endpoint:a};case"recording":case"recordings":return{endpoint:r}}return{endpoint:n}})(),a=N(e,{url:e.go2rtc?.url??`/api/frigate/${e.frigate.client_id}/mse`,stream:e.go2rtc?.stream??e.frigate.camera_name}),r={endpoint:`/api/frigate/${e.frigate.client_id}/jsmpeg/${e.frigate.camera_name}`,sign:!0},i=(()=>{const t=e.frigate.camera_name?e.frigate.camera_name:null;return t?{endpoint:t}:null})();return{...super.getCameraEndpoints(e,t),...n&&{ui:n},...a&&{go2rtc:a},...r&&{jsmpeg:r},...i&&{webrtcCard:i}}}async executePTZAction(e,t,n,a){const r=t.camera_entity;("preset"!==n||a?.preset)&&await e.callService("frigate","ptz",{entity_id:r,action:"stop"===a?.phase?"stop":"zoom_in"===n||"zoom_out"===n?"zoom":"preset"===n?"preset":"move",..."stop"!==a?.phase&&{argument:"zoom_in"===n?"in":"zoom_out"===n?"out":"preset"===n?a?.preset:n}})}}export{Se as FrigateCameraManagerEngine}; diff --git a/config/www/community/frigate-hass-card/engine-frigate-be325e58.js.gz b/config/www/community/frigate-hass-card/engine-frigate-be325e58.js.gz new file mode 100644 index 00000000..a6c55ab7 Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-frigate-be325e58.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-generic-93cdbee6.js b/config/www/community/frigate-hass-card/engine-generic-93cdbee6.js new file mode 100644 index 00000000..a2e5baf0 --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-generic-93cdbee6.js @@ -0,0 +1 @@ +import{eu as e,ev as t,l as i,e3 as a,e2 as n,e1 as s,d$ as r,j as c}from"./card-e5d55e5b.js";class l{constructor(t,i,a){this._destroyCallbacks=[],this._stateChangeHandler=t=>{this._eventCallback?.({cameraID:this.getID(),type:e(t.newState.state)?"new":"end"})},this._config=t,this._engine=i,this._capabilities=a?.capabilities,this._eventCallback=a?.eventCallback}async initialize(e){return e.stateWatcher.subscribe(this._stateChangeHandler,this._config.triggers.entities),this._onDestroy((()=>e.stateWatcher.unsubscribe(this._stateChangeHandler))),this}async destroy(){this._destroyCallbacks.forEach((e=>e()))}getConfig(){return this._config}setID(e){this._config.id=e}getID(){if(this._config.id)return this._config.id;throw new t(i("error.no_camera_id"))}getEngine(){return this._engine}getCapabilities(){return this._capabilities??null}getProxyConfig(){return{dynamic:this._config.proxy.dynamic,media:"auto"!==this._config.proxy.media&&this._config.proxy.media,ssl_verification:!1!==this._config.proxy.ssl_verification,ssl_ciphers:"auto"===this._config.proxy.ssl_ciphers?"default":this._config.proxy.ssl_ciphers}}_onDestroy(e){this._destroyCallbacks.push(e)}}const o=(e,t)=>{const i=t?.url??e.go2rtc?.url,a=t?.stream??e.go2rtc?.stream;if(!i||!a)return null;const n=`${i}/api/ws?src=${a}`;return{endpoint:n,sign:n.startsWith("/")}};class u{constructor(e,t){this._stateWatcher=e,this._eventCallback=t}getEngineType(){return a.Generic}async createCamera(e,t){return await new l(t,this,{capabilities:new n({"favorite-events":!1,"favorite-recordings":!1,clips:!1,live:!0,menu:!0,recordings:!1,seek:!1,snapshots:!1,substream:!0,ptz:s(t)??void 0},{disable:t.capabilities?.disable,disableExcept:t.capabilities?.disable_except}),eventCallback:this._eventCallback}).initialize({stateWatcher:this._stateWatcher})}generateDefaultEventQuery(e,t,i){return null}generateDefaultRecordingQuery(e,t,i){return null}generateDefaultRecordingSegmentsQuery(e,t,i){return null}async getEvents(e,t,i,a){return null}async getRecordings(e,t,i,a){return null}async getRecordingSegments(e,t,i,a){return null}generateMediaFromEvents(e,t,i,a){return null}generateMediaFromRecordings(e,t,i,a){return null}async getMediaDownloadPath(e,t,i){return null}async favoriteMedia(e,t,i,a){}getQueryResultMaxAge(e){return null}async getMediaSeekTime(e,t,i,a,n){return null}async getMediaMetadata(e,t,i,a){return null}getCameraMetadata(e,t){const i=r(t);return{title:t.title??c(e,t.camera_entity)??c(e,t.webrtc_card?.entity)??t.id??"",icon:{entity:i??void 0,icon:t.icon,fallback:"mdi:video"}}}getMediaCapabilities(e){return null}getCameraEndpoints(e,t){const i=o(e);return i?{go2rtc:i}:null}async executePTZAction(e,t,i,a){}}var g=Object.freeze({__proto__:null,GenericCameraManagerEngine:u});export{l as C,u as G,g as e,o as g}; diff --git a/config/www/community/frigate-hass-card/engine-generic-93cdbee6.js.gz b/config/www/community/frigate-hass-card/engine-generic-93cdbee6.js.gz new file mode 100644 index 00000000..9d64cc0f Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-generic-93cdbee6.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-motioneye-aba6e54b.js b/config/www/community/frigate-hass-card/engine-motioneye-aba6e54b.js new file mode 100644 index 00000000..1d45d7ea --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-motioneye-aba6e54b.js @@ -0,0 +1 @@ +import{e7 as e,e3 as t,e2 as a,e1 as s,e8 as i,c$ as n,e5 as r,e6 as o,dM as c,e9 as d,ea as m,eb as l,d7 as h,d9 as u}from"./card-e5d55e5b.js";import{B as y,a as g,g as p,i as _}from"./within-dates-446c6430.js";import{C as M}from"./engine-86b0096c.js";import{p as f}from"./parse-214d78af.js";import{e as C}from"./endOfDay-cfc9c86c.js";import"./engine-generic-93cdbee6.js";import"./media-c9012082.js";class w extends y{getProxyConfig(){return{...super.getProxyConfig(),media:"auto"===this._config.proxy.media||this._config.proxy.media}}}class D{static isMotionEyeEventQueryResults(e){return e.engine===t.MotionEye&&e.type===o.Event}}const E={"%Y":"yyyy","%m":"MM","%d":"dd","%H":"HH","%M":"mm","%S":"ss"},v=new RegExp(/(%Y|%m|%d|%H|%M|%S)/g);class x extends g{constructor(){super(...arguments),this._directoryCache=new e,this._fileCache=new e}getEngineType(){return t.MotionEye}async createCamera(e,t){const i=new w(t,this,{capabilities:new a({"favorite-events":!1,"favorite-recordings":!1,clips:!0,live:!0,menu:!0,recordings:!1,seek:!1,snapshots:!0,substream:!0,ptz:s(t)??void 0},{disable:t.capabilities?.disable,disableExcept:t.capabilities?.disable_except}),eventCallback:this._eventCallback});return await i.initialize({entityRegistryManager:this._entityRegistryManager,hass:e,stateWatcher:this._stateWatcher})}_convertMotionEyeTimeFormatToDateFNS(e){return e.replace(v,((e,t)=>E[t]))}_motionEyeMetadataGeneratorFile(e,t,a,s){let n=s?._metadata?.startDate??new Date;if(t){const e=a.title.replace(/\.[^/.]+$/,"");if(n=f(e,t,n),!i(n))return null}return{cameraID:e,startDate:n,endDate:n}}_motionEyeMetadataGeneratorDirectory(e,t,a,s){let r=s?._metadata?.startDate??new Date;if(t){const e=f(a.title,t,r);if(!i(e))return null;r=n(e)}return{cameraID:e,startDate:r,endDate:s?._metadata?.endDate??C(r)}}async _getMatchingDirectories(e,t,a,s,i){const n=t.getCamera(a),r=n?.getConfig();if(!(n instanceof y&&r))return null;const o=n.getEntity(),c=o?.config_entry_id,d=o?.device_id;if(!c||!d)return null;const m=(e,t)=>{const i=e.shift();if(!i)return[];const n=i.includes("%")?this._convertMotionEyeTimeFormatToDateFNS(i):null;return[{targets:t,metadataGenerator:(e,t)=>this._motionEyeMetadataGeneratorDirectory(a,n,e,t),matcher:e=>e.can_expand&&(!!n||e.title===i)&&_(e,s?.start,s?.end),advance:t=>m(e,t)}]};return await this._browseMediaManager.walkBrowseMedias(e,[...!1===s?.hasClip||s?.hasSnapshot?[]:m(r.motioneye.movies.directory_pattern.split("/"),[`media-source://motioneye/${c}#${d}#movies`]),...!1===s?.hasSnapshot||s?.hasClip?[]:m(r.motioneye.images.directory_pattern.split("/"),[`media-source://motioneye/${c}#${d}#images`])],{...!1!==i?.useCache&&{cache:this._directoryCache}})}async getEvents(e,a,s,i){if(s.favorite||s.tags?.size||s.what?.size||s.where?.size)return null;const n=new Map,c=async r=>{const c={...s,cameraIDs:new Set([r])},d=i?.useCache??1?this._requestCache.get(c):null;if(d)return void n.set(c,d);const u=a.getCameraConfig(r);if(!u)return;const y=await this._getMatchingDirectories(e,a,r,c,i);if(!y||!y.length)return;const g=this._convertMotionEyeTimeFormatToDateFNS(u.motioneye.movies.file_pattern),p=this._convertMotionEyeTimeFormatToDateFNS(u.motioneye.images.file_pattern),f=c.limit??M,C=await this._browseMediaManager.walkBrowseMedias(e,[{targets:y,metadataGenerator:(e,t)=>e.media_class===m||e.media_class===l?this._motionEyeMetadataGeneratorFile(r,e.media_class===m?p:g,e,t):null,earlyExit:e=>e.length>=f,matcher:e=>!e.can_expand&&_(e,c.start,c.end)}],{...!1!==i?.useCache&&{cache:this._fileCache}}),w=h(C,(e=>e._metadata?.startDate),"desc").slice(0,c.limit??M),D={type:o.Event,engine:t.MotionEye,browseMedia:w};(i?.useCache??1)&&this._requestCache.set(c,{...D,cached:!0},D.expiry),n.set(c,D)};return await r(s.cameraIDs,(e=>c(e))),n.size?n:null}generateMediaFromEvents(e,t,a,s){return D.isMotionEyeEventQueryResults(s)?p(s.browseMedia):null}async getMediaMetadata(e,a,s,i){const n=new Map;if((i?.useCache??1)&&this._requestCache.has(s)){const e=this._requestCache.get(s);if(e)return n.set(s,e),n}const m=new Set,l=async t=>{const s=await this._getMatchingDirectories(e,a,t,null,i);for(const e of s??[])e._metadata&&m.add(u(e._metadata?.startDate))};await r(s.cameraIDs,(e=>l(e)));const h={type:o.MediaMetadata,engine:t.MotionEye,metadata:{...m.size&&{days:m}},expiry:c(new Date,{seconds:d}),cached:!1};return(i?.useCache??1)&&this._requestCache.set(s,{...h,cached:!0},h.expiry),n.set(s,h),n}getCameraMetadata(e,t){return{...super.getCameraMetadata(e,t),engineIcon:"motioneye"}}getCameraEndpoints(e,t){const a=e.motioneye?.url?{endpoint:e.motioneye.url}:null;return{...super.getCameraEndpoints(e,t),...a&&{ui:a}}}}export{x as MotionEyeCameraManagerEngine}; diff --git a/config/www/community/frigate-hass-card/engine-motioneye-aba6e54b.js.gz b/config/www/community/frigate-hass-card/engine-motioneye-aba6e54b.js.gz new file mode 100644 index 00000000..db70a4e7 Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-motioneye-aba6e54b.js.gz differ diff --git a/config/www/community/frigate-hass-card/engine-reolink-a43e6d37.js b/config/www/community/frigate-hass-card/engine-reolink-a43e6d37.js new file mode 100644 index 00000000..7e570268 --- /dev/null +++ b/config/www/community/frigate-hass-card/engine-reolink-a43e6d37.js @@ -0,0 +1,8 @@ +import{l as e,e0 as t,e7 as a,e3 as n,eb as s,e8 as i,dM as r,c$ as o,e2 as c,e1 as l,ec as u,e5 as h,e6 as d,e9 as g,d7 as m,d9 as _}from"./card-e5d55e5b.js";import{B as p,a as y,i as f,g as w}from"./within-dates-446c6430.js";import{C}from"./engine-86b0096c.js";import{p as M}from"./parse-214d78af.js";import{e as k}from"./endOfDay-cfc9c86c.js";import"./engine-generic-93cdbee6.js";import"./media-c9012082.js";class D extends t{}class b extends p{constructor(){super(...arguments),this._channel=null}async initialize(e){return await super.initialize(e),this._initializeChannel(),this}_initializeChannel(){const t=this._entity?.unique_id,a=t?String(t).match(/(.*)_(?\d+)/):null,n=a&&a.groups?.channel?Number(a.groups.channel):null;if(null===n)throw new D(e("error.camera_initialization_reolink"),this.getConfig());this._channel=n}getChannel(){return this._channel}getProxyConfig(){return{...super.getProxyConfig(),media:"auto"===this._config.proxy.media||this._config.proxy.media,ssl_verification:"auto"!==this._config.proxy.ssl_verification&&this._config.proxy.ssl_verification,ssl_ciphers:"auto"===this._config.proxy.ssl_ciphers?"intermediate":this._config.proxy.ssl_ciphers}}}class x{static isReolinkEventQueryResults(e){return e.engine===n.Reolink&&e.type===d.Event}}class v extends y{constructor(){super(...arguments),this._cache=new a}getEngineType(){return n.Reolink}_reolinkFileMetadataGenerator(e,t,a){ +/* istanbul ignore next: This situation cannot happen as the directory would + be rejected by _reolinkDirectoryMetadataGenerator if there was no start date + -- @preserve */ +if(!a?._metadata?.startDate||t.media_class!==s)return null;const n=t.title.split(/ +/);if(2!==n.length)return null;const o=M(n[0],"HH:mm:ss",a._metadata.startDate);if(!i(o))return null;const c=n[1].match(/(?\d+):(?\d+):(?\d+)/),l=c?.groups?{hours:Number(c.groups.hours),minutes:Number(c.groups.minutes),seconds:Number(c.groups.seconds)}:null;return{cameraID:e,startDate:o,endDate:l?r(o,l):o}}_reolinkDirectoryMetadataGenerator(e,t){const a=M(t.title,"yyyy/M/d",new Date);return i(a)?{cameraID:e,startDate:o(a),endDate:k(a)}:null}_reolinkCameraMetadataGenerator(e){const t=e.media_content_id.match(/^media-source:\/\/reolink\/CAM\|(?.+)\|(?\d+)$/);return t?.groups?{configEntryID:t.groups.configEntryID,channel:Number(t.groups.channel)}:null}async createCamera(e,t){const a=new b(t,this,{capabilities:new c({"favorite-events":!1,"favorite-recordings":!1,clips:!0,live:!0,menu:!0,recordings:!1,seek:!1,snapshots:!1,substream:!0,ptz:l(t)??void 0},{disable:t.capabilities?.disable,disableExcept:t.capabilities?.disable_except}),eventCallback:this._eventCallback});return await a.initialize({entityRegistryManager:this._entityRegistryManager,hass:e,stateWatcher:this._stateWatcher})}async _getMatchingDirectories(e,t,a,n){const s=t.getConfig(),i=t.getEntity(),r=i?.config_entry_id;if(null===t.getChannel()||!r)return null;const o=await this._browseMediaManager.walkBrowseMedias(e,[{targets:["media-source://reolink"],metadataGenerator:(e,t)=>this._reolinkCameraMetadataGenerator(e),matcher:e=>e._metadata?.channel===t.getChannel()&&e._metadata?.configEntryID===r}],{...!1!==n?.useCache&&{cache:this._cache}});return o?.length?await this._browseMediaManager.walkBrowseMedias(e,[{targets:[`media-source://reolink/RES|${r}|${t.getChannel()}|`+("low"===s.reolink?.media_resolution?"sub":"main")],metadataGenerator:(e,a)=>this._reolinkDirectoryMetadataGenerator(t.getID(),e),matcher:e=>e.can_expand&&f(e,a?.start,a?.end),sorter:e=>u(e)}],{...!1!==n?.useCache&&{cache:this._cache}}):null}async getEvents(e,t,a,s){if(a.favorite||a.tags?.size||a.what?.size||a.where?.size||a.hasSnapshot)return null;const i=new Map,r=async r=>{const o={...a,cameraIDs:new Set([r])},c=s?.useCache??1?this._requestCache.get(o):null;if(c)return void i.set(o,c);const l=t.getCamera(r),h=l&&l instanceof b?await this._getMatchingDirectories(e,l,o,s):null,g=o.limit??C;let _=[];h?.length&&(_=await this._browseMediaManager.walkBrowseMedias(e,[{targets:h,concurrency:1,metadataGenerator:(e,t)=>this._reolinkFileMetadataGenerator(r,e,t),earlyExit:e=>e.length>=g,matcher:e=>!e.can_expand&&f(e,o.start,o.end),sorter:e=>u(e)}],{...!1!==s?.useCache&&{cache:this._cache}}));const p=m(_,(e=>e._metadata?.startDate),"desc").slice(0,g),y={type:d.Event,engine:n.Reolink,browseMedia:p};(s?.useCache??1)&&this._requestCache.set(o,{...y,cached:!0},y.expiry),i.set(o,y)};return await h(a.cameraIDs,(e=>r(e))),i}generateMediaFromEvents(e,t,a,n){return x.isReolinkEventQueryResults(n)?w(n.browseMedia):null}async getMediaMetadata(e,t,a,s){const i=new Map,o=s?.useCache??1?this._requestCache.get(a):null;if(o)return i.set(a,o),i;const c=new Set,l=async a=>{const n=t.getCamera(a);if(!(n&&n instanceof b))return;const i=await this._getMatchingDirectories(e,n,null,s);for(const e of i??[]) +/* istanbul ignore next: This situation cannot happen as the directory + will not match without metadata -- @preserve */ +e._metadata&&c.add(_(e._metadata?.startDate))};await h(a.cameraIDs,(e=>l(e)));const u={type:d.MediaMetadata,engine:n.Reolink,metadata:{...c.size&&{days:c}},expiry:r(new Date,{seconds:g}),cached:!1};return(s?.useCache??1)&&this._requestCache.set(a,{...u,cached:!0},u.expiry),i.set(a,u),i}getCameraMetadata(e,t){return{...super.getCameraMetadata(e,t),engineIcon:"reolink"}}getCameraEndpoints(e,t){const a=e.reolink?.url?{endpoint:e.reolink.url}:null;return{...super.getCameraEndpoints(e,t),...a&&{ui:a}}}}export{v as ReolinkCameraManagerEngine,x as ReolinkQueryResultsClassifier}; diff --git a/config/www/community/frigate-hass-card/engine-reolink-a43e6d37.js.gz b/config/www/community/frigate-hass-card/engine-reolink-a43e6d37.js.gz new file mode 100644 index 00000000..88f09806 Binary files /dev/null and b/config/www/community/frigate-hass-card/engine-reolink-a43e6d37.js.gz differ diff --git a/config/www/community/frigate-hass-card/frigate-hass-card.js b/config/www/community/frigate-hass-card/frigate-hass-card.js index 2de29fba..1a65fc76 100644 --- a/config/www/community/frigate-hass-card/frigate-hass-card.js +++ b/config/www/community/frigate-hass-card/frigate-hass-card.js @@ -1 +1 @@ -import"./card-320adb66.js"; +import"./card-e5d55e5b.js"; diff --git a/config/www/community/frigate-hass-card/frigate-hass-card.js.gz b/config/www/community/frigate-hass-card/frigate-hass-card.js.gz index ecbc7fea..54558472 100644 Binary files a/config/www/community/frigate-hass-card/frigate-hass-card.js.gz and b/config/www/community/frigate-hass-card/frigate-hass-card.js.gz differ diff --git a/config/www/community/frigate-hass-card/frigate-hass-card.zip b/config/www/community/frigate-hass-card/frigate-hass-card.zip index f38ad2ef..460ac025 100644 Binary files a/config/www/community/frigate-hass-card/frigate-hass-card.zip and b/config/www/community/frigate-hass-card/frigate-hass-card.zip differ diff --git a/config/www/community/frigate-hass-card/gallery-f478918c.js b/config/www/community/frigate-hass-card/gallery-f478918c.js new file mode 100644 index 00000000..da0d97a6 --- /dev/null +++ b/config/www/community/frigate-hass-card/gallery-f478918c.js @@ -0,0 +1,184 @@ +import{c_ as e,c$ as t,d0 as r,l as i,d1 as o,d2 as n,d3 as a,d4 as s,i as l,d5 as c,d6 as d,k as h,d7 as g,d8 as u,d9 as m,da as p,_ as f,n as v,cQ as b,cL as y,db as w,x as $,cP as x,r as k,a as _,t as C,e as T,b as E,dc as O,dd as S,cH as M,de as z,df as L,cO as D,dg as A,cW as F}from"./card-e5d55e5b.js";import{e as I}from"./endOfDay-cfc9c86c.js";import{p as W}from"./parse-214d78af.js";import{F as R}from"./date-picker-d9927b87.js";function N(t){const r=e(t),i=r.getMonth();return r.setFullYear(r.getFullYear(),i+1,0),r.setHours(23,59,59,999),r}function H(){const e=new Date,t=e.getFullYear(),r=e.getMonth(),i=e.getDate(),o=new Date(0);return o.setFullYear(t,r,i-1),o.setHours(23,59,59,999),o}function V(){const e=new Date,t=e.getFullYear(),r=e.getMonth(),i=e.getDate(),o=new Date(0);return o.setFullYear(t,r,i-1),o.setHours(0,0,0,0),o}var j,B,P; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function q(e){return class extends e{createRenderRoot(){const e=this.constructor,{registry:t,elementDefinitions:i,shadowRootOptions:o}=e;i&&!t&&(e.registry=new CustomElementRegistry,Object.entries(i).forEach((([t,r])=>e.registry.define(t,r))));const n=this.renderOptions.creationScope=this.attachShadow({...o,customElements:e.registry});return r(n,this.constructor.elementStyles),n}}}!function(e){e.Favorite="favorite",e.NotFavorite="not-favorite"}(j||(j={})),function(e){e.Today="today",e.Yesterday="yesterday",e.PastWeek="past-week",e.PastMonth="past-month",e.Custom="custom"}(B||(B={})),function(e){e.Clips="clips",e.Snapshots="snapshots",e.Recordings="recordings"}(P||(P={}));class U{constructor(e){this._cameraOptions=[],this._whenOptions=[],this._metaDataWhenOptions=[],this._whatOptions=[],this._whereOptions=[],this._tagsOptions=[],this._defaults=null,this._viewManager=null,this._host=e,this._favoriteOptions=[{value:j.Favorite,label:i("media_filter.favorite")},{value:j.NotFavorite,label:i("media_filter.not_favorite")}],this._mediaTypeOptions=[{value:P.Clips,label:i("media_filter.media_types.clips")},{value:P.Snapshots,label:i("media_filter.media_types.snapshots")},{value:P.Recordings,label:i("media_filter.media_types.recordings")}],this._staticWhenOptions=[{value:B.Today,label:i("media_filter.whens.today")},{value:B.Yesterday,label:i("media_filter.whens.yesterday")},{value:B.PastWeek,label:i("media_filter.whens.past_week")},{value:B.PastMonth,label:i("media_filter.whens.past_month")},{value:B.Custom,label:i("media_filter.whens.custom")}],this._computeWhenOptions()}getMediaTypeOptions(){return this._mediaTypeOptions}getCameraOptions(){return this._cameraOptions}getWhenOptions(){return this._whenOptions}getWhatOptions(){return this._whatOptions}getWhereOptions(){return this._whereOptions}getTagsOptions(){return this._tagsOptions}getFavoriteOptions(){return this._favoriteOptions}getDefaults(){return this._defaults}setViewManager(e){this._viewManager=e}async valueChangeHandler(e,t,r,i){const s=e=>e&&Array.isArray(e)&&e.length&&!e.includes("")?new Set([...e]):null,l=s(r.camera)??this._getAllCameraIDs(e);if(!l.size||!r.mediaType)return;const c=this._getWhen(r.when),d=r.favorite?r.favorite===j.Favorite:null,h=t.performance?.features.media_chunk_size;if(r.mediaType===P.Clips||r.mediaType===P.Snapshots){const e=s(r.where),t=s(r.what),i=s(r.tags),a=new o([{type:n.Event,cameraIDs:l,...i&&{tags:i},...t&&{what:t},...e&&{where:e},...null!==d&&{favorite:d},...c&&{...c.start&&{start:c.start},...c.end&&{end:c.end}},...h&&{limit:h},...r.mediaType===P.Clips&&{hasClip:!0},...r.mediaType===P.Snapshots&&{hasSnapshot:!0}}]);this._viewManager?.setViewByParametersWithExistingQuery({params:{query:a,...1===l.size&&{camera:[...l][0]},view:r.mediaType===P.Clips?"clips":"snapshots"}})}else{const e=new a([{type:n.Recording,cameraIDs:l,...h&&{limit:h},...c&&{...c.start&&{start:c.start},...c.end&&{end:c.end}},...null!==d&&{favorite:d}}]);this._viewManager?.setViewByParametersWithExistingQuery({params:{query:e,...1===l.size&&{camera:[...l][0]},view:"recordings"}})}this._host.requestUpdate()}_getAllCameraIDs(e){return e.getStore().getCameraIDsWithCapability({anyCapabilities:["clips","snapshots","recordings"]})}computeInitialDefaultsFromView(e){const t=this._viewManager?.getView(),r=t?.query?.getQueries(),i=this._getAllCameraIDs(e);if(!t||!r||!i.size)return;let o,n,a,d,h,g;1!==s(r.map((e=>e.cameraIDs)),l).length||l(r[0].cameraIDs,i)||(n=[...r[0].cameraIDs]); +/* istanbul ignore else: the else path cannot be reached -- @preserve */ +if(1===s(r.map((e=>e.favorite)),l).length&&void 0!==r[0].favorite&&(h=r[0].favorite?j.Favorite:j.NotFavorite),c.areEventQueries(t.query)){const e=t.query.getQueries(); +/* istanbul ignore if: the if path cannot be reached -- @preserve */if(!e)return;const r=s(e.map((e=>e.hasClip)),l),i=s(e.map((e=>e.hasSnapshot)),l);1===r.length&&1===i.length&&(o=r[0]?P.Clips:i[0]?P.Snapshots:void 0);1===s(e.map((e=>e.what)),l).length&&e[0].what?.size&&(a=[...e[0].what]);1===s(e.map((e=>e.where)),l).length&&e[0].where?.size&&(d=[...e[0].where]);1===s(e.map((e=>e.tags)),l).length&&e[0].tags?.size&&(g=[...e[0].tags])}else c.areRecordingQueries(t.query)&&(o=P.Recordings);this._defaults={...o&&{mediaType:o},...n&&{cameraIDs:n},...a&&{what:a},...d&&{where:d},...void 0!==h&&{favorite:h},...g&&{tags:g}}}computeCameraOptions(e){this._cameraOptions=[...this._getAllCameraIDs(e)].map((t=>({value:t,label:e.getCameraMetadata(t)?.title??t})))}async computeMetadataOptions(e){let t=null;try{t=await e.getMediaMetadata()}catch(e){d(e)}if(t){if(t.what&&(this._whatOptions=[...t.what].sort().map((e=>({value:e,label:h(e)})))),t.where&&(this._whereOptions=[...t.where].sort().map((e=>({value:e,label:h(e)})))),t.tags&&(this._tagsOptions=[...t.tags].sort().map((e=>({value:e,label:h(e)})))),t.days){const e=new Set;[...t.days].forEach((t=>{e.add(t.substring(0,7))}));const r=[];e.forEach((e=>{r.push(W(e,"yyyy-MM",new Date))})),this._metaDataWhenOptions=g(r,(e=>e.getTime()),"desc").map((e=>({label:u(e,"MMMM yyyy"),value:this._dateRangeToString({start:e,end:N(e)})}))),this._computeWhenOptions()}this._host.requestUpdate()}}getControlsToShow(e){const t=this._viewManager?.getView(),r=c.areEventQueries(t?.query),i=c.areRecordingQueries(t?.query),o=e.getAggregateCameraCapabilities();return{events:r,recordings:i,favorites:r?o?.has("favorite-events"):!!i&&o?.has("favorite-recordings")}}_computeWhenOptions(){this._whenOptions=[...this._staticWhenOptions,...this._metaDataWhenOptions]}_dateRangeToString(e){return`${m(e.start)},${m(e.end)}`}_stringToDateRange(e){const t=e.split(",");return{start:W(t[0],"yyyy-MM-dd",new Date),end:I(W(t[1],"yyyy-MM-dd",new Date))}}_getWhen(e){if(e.from||e.to)return{...e.from&&{start:e.from},...e.to&&{end:e.to}};if(!e.selected||Array.isArray(e.selected))return null;const r=new Date;switch(e.selected){case B.Custom:return null;case B.Today:return{start:t(Date.now()),end:I(Date.now())};case B.Yesterday:return{start:V(),end:H()};case B.PastWeek:return{start:t(p(r,{days:7})),end:I(r)};case B.PastMonth:return{start:t(p(r,{months:1})),end:I(r)};default:return this._stringToDateRange(e.selected)}}}const K=!0,Y=!0,Q=!0,G=!1,X=!1;let Z,J,ee,te=!1,re=!1,ie=!1,oe=!1,ne=null,ae=!1;const se="http://www.w3.org/1999/xlink",le={},ce=e=>"object"===(e=typeof e)||"function"===e;const de=(e,t,...r)=>{let i=null,o=null,n=null,a=!1,s=!1;const l=[],c=t=>{for(let r=0;re[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,l,ue);const d=he(e,null);return d.$attrs$=t,l.length>0&&(d.$children$=l),d.$key$=o,d.$name$=n,d},he=(e,t)=>{const r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return r},ge={},ue={forEach:(e,t)=>e.map(me).forEach(t),map:(e,t)=>e.map(me).map(t).map(pe)},me=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),pe=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),de(e.vtag,t,...e.vchildren||[])}const t=he(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},fe=(e,t,r)=>{const i=e;return{emit:e=>ve(i,t,{bubbles:!!(4&r),composed:!!(2&r),cancelable:!!(1&r),detail:e})}},ve=(e,t,r)=>{const i=ht.ce(t,r);return e.dispatchEvent(i),i},be=new WeakMap,ye=e=>{const t=e.$cmpMeta$,r=e.$hostElement$,i=t.$flags$,o=(t.$tagName$,()=>{}),n=((e,t,r,i)=>{var o;let n=we(t,r);const a=at.get(n);if(e=11===e.nodeType?e:ct,a)if("string"==typeof a){e=e.head||e;let t,r=be.get(e);if(r||be.set(e,r=new Set),!r.has(n)){{t=ct.createElement("style"),t.innerHTML=a;const r=null!==(o=ht.$nonce$)&&void 0!==o?o:function(e){var t,r,i;return null!==(i=null===(r=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===r?void 0:r.getAttribute("content"))&&void 0!==i?i:void 0}(ct);null!=r&&t.setAttribute("nonce",r),e.insertBefore(t,e.querySelector("link"))}r&&r.add(n)}}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]);return n})(r.shadowRoot?r.shadowRoot:r.getRootNode(),t,e.$modeName$);10&i&&(r["s-sc"]=n,r.classList.add(n+"-h"),2&i&&r.classList.add(n+"-s")),o()},we=(e,t)=>"sc-"+(t&&32&e.$flags$?e.$tagName$+"-"+t:e.$tagName$),$e=(e,t,r,i,o,n)=>{if(r!==i){let a=ot(e,t),s=t.toLowerCase();if("class"===t){const t=e.classList,o=ke(r),n=ke(i);t.remove(...o.filter((e=>e&&!n.includes(e)))),t.add(...n.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in r)i&&null!=i[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in i)r&&i[t]===r[t]||(t.includes("-")?e.style.setProperty(t,i[t]):e.style[t]=i[t])}else if("key"===t);else if("ref"===t)i&&i(e);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){const l=ce(i);if((a||l&&null!==i)&&!o)try{if(e.tagName.includes("-"))e[t]=i;else{const o=null==i?"":i;"list"===t?a=!1:null!=r&&e[t]==o||(e[t]=o)}}catch(e){}let c=!1;s!==(s=s.replace(/^xlink\:?/,""))&&(t=s,c=!0),null==i||!1===i?!1===i&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(se,t):e.removeAttribute(t)):(!a||4&n||o)&&!l&&(i=!0===i?"":i,c?e.setAttributeNS(se,t,i):e.setAttribute(t,i))}else t="-"===t[2]?t.slice(3):ot(lt,s)?s.slice(2):s[2]+t.slice(3),r&&ht.rel(e,t,r,!1),i&&ht.ael(e,t,i,!1)}},xe=/\s/,ke=e=>e?e.split(xe):[],_e=(e,t,r,i)=>{const o=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,n=e&&e.$attrs$||le,a=t.$attrs$||le;for(i in n)i in a||$e(o,i,n[i],void 0,r,t.$flags$);for(i in a)$e(o,i,n[i],a[i],r,t.$flags$)},Ce=(e,t,r,i)=>{const o=t.$children$[r];let n,a,s,l=0;if(te||(ie=!0,"slot"===o.$tag$&&(Z&&i.classList.add(Z+"-s"),o.$flags$|=o.$children$?2:1)),null!==o.$text$)n=o.$elm$=ct.createTextNode(o.$text$);else if(1&o.$flags$)n=o.$elm$=ct.createTextNode("");else{if(oe||(oe="svg"===o.$tag$),n=o.$elm$=ct.createElementNS(oe?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&o.$flags$?"slot-fb":o.$tag$),oe&&"foreignObject"===o.$tag$&&(oe=!1),_e(null,o,oe),null!=Z&&n["s-si"]!==Z&&n.classList.add(n["s-si"]=Z),o.$children$)for(l=0;l{ht.$flags$|=1;const r=e.childNodes;for(let e=r.length-1;e>=0;e--){const i=r[e];i["s-hn"]!==ee&&i["s-ol"]&&(ze(i).insertBefore(i,Me(i)),i["s-ol"].remove(),i["s-ol"]=void 0,ie=!0),t&&Te(i,t)}ht.$flags$&=-2},Ee=(e,t,r,i,o,n)=>{let a,s=e["s-cr"]&&e["s-cr"].parentNode||e;for(s.shadowRoot&&s.tagName===ee&&(s=s.shadowRoot);o<=n;++o)i[o]&&(a=Ce(null,r,o,e),a&&(i[o].$elm$=a,s.insertBefore(a,Me(t))))},Oe=(e,t,r,i,o)=>{for(;t<=r;++t)(i=e[t])&&(o=i.$elm$,We(i),re=!0,o["s-ol"]?o["s-ol"].remove():Te(o,!0),o.remove())},Se=(e,t)=>e.$tag$===t.$tag$&&("slot"===e.$tag$?e.$name$===t.$name$:e.$key$===t.$key$),Me=e=>e&&e["s-ol"]||e,ze=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,Le=(e,t)=>{const r=t.$elm$=e.$elm$,i=e.$children$,o=t.$children$,n=t.$tag$,a=t.$text$;let s;null===a?(oe="svg"===n||"foreignObject"!==n&&oe,"slot"===n||_e(e,t,oe),null!==i&&null!==o?((e,t,r,i)=>{let o,n,a=0,s=0,l=0,c=0,d=t.length-1,h=t[0],g=t[d],u=i.length-1,m=i[0],p=i[u];for(;a<=d&&s<=u;)if(null==h)h=t[++a];else if(null==g)g=t[--d];else if(null==m)m=i[++s];else if(null==p)p=i[--u];else if(Se(h,m))Le(h,m),h=t[++a],m=i[++s];else if(Se(g,p))Le(g,p),g=t[--d],p=i[--u];else if(Se(h,p))"slot"!==h.$tag$&&"slot"!==p.$tag$||Te(h.$elm$.parentNode,!1),Le(h,p),e.insertBefore(h.$elm$,g.$elm$.nextSibling),h=t[++a],p=i[--u];else if(Se(g,m))"slot"!==h.$tag$&&"slot"!==p.$tag$||Te(g.$elm$.parentNode,!1),Le(g,m),e.insertBefore(g.$elm$,h.$elm$),g=t[--d],m=i[++s];else{for(l=-1,c=a;c<=d;++c)if(t[c]&&null!==t[c].$key$&&t[c].$key$===m.$key$){l=c;break}l>=0?(n=t[l],n.$tag$!==m.$tag$?o=Ce(t&&t[s],r,l,e):(Le(n,m),t[l]=void 0,o=n.$elm$),m=i[++s]):(o=Ce(t&&t[s],r,s,e),m=i[++s]),o&&ze(h.$elm$).insertBefore(o,Me(h.$elm$))}a>d?Ee(e,null==i[u+1]?null:i[u+1].$elm$,r,i,s,u):s>u&&Oe(t,a,d)})(r,i,t,o):null!==o?(null!==e.$text$&&(r.textContent=""),Ee(r,null,t,o,0,o.length-1)):null!==i&&Oe(i,0,i.length-1),oe&&"svg"===n&&(oe=!1)):(s=r["s-cr"])?s.parentNode.textContent=a:e.$text$!==a&&(r.data=a)},De=e=>{const t=e.childNodes;let r,i,o,n,a,s;for(i=0,o=t.length;i{let t,r,i,o,n,a,s=0;const l=e.childNodes,c=l.length;for(;s=0;a--)r=i[a],r["s-cn"]||r["s-nr"]||r["s-hn"]===t["s-hn"]||(Ie(r,o)?(n=Ae.find((e=>e.$nodeToRelocate$===r)),re=!0,r["s-sn"]=r["s-sn"]||o,n?n.$slotRefNode$=t:Ae.push({$slotRefNode$:t,$nodeToRelocate$:r}),r["s-sr"]&&Ae.map((e=>{Ie(e.$nodeToRelocate$,r["s-sn"])&&(n=Ae.find((e=>e.$nodeToRelocate$===r)),n&&!e.$slotRefNode$&&(e.$slotRefNode$=n.$slotRefNode$))}))):Ae.some((e=>e.$nodeToRelocate$===r))||Ae.push({$nodeToRelocate$:r}));1===t.nodeType&&Fe(t)}},Ie=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,We=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(We)},Re=(e,t)=>{const r=e.$hostElement$,i=e.$cmpMeta$,o=e.$vnode$||he(null,null),n=(a=t)&&a.$tag$===ge?t:de(null,null,t);var a;if(ee=r.tagName,i.$attrsToReflect$&&(n.$attrs$=n.$attrs$||{},i.$attrsToReflect$.map((([e,t])=>n.$attrs$[t]=r[e]))),n.$tag$=null,n.$flags$|=4,e.$vnode$=n,n.$elm$=o.$elm$=r.shadowRoot||r,Z=r["s-sc"],J=r["s-cr"],te=!!(1&i.$flags$),re=!1,Le(o,n),ht.$flags$|=1,ie){let e,t,r,i,o,a;Fe(n.$elm$);let s=0;for(;s{e.$flags$|=16,e.$ancestorComponent$;return $t((()=>He(e,t)))},He=(e,t)=>{const r=e.$hostElement$,i=(e.$cmpMeta$.$tagName$,()=>{}),o=r;let n;return n=Pe(o,t?"componentWillLoad":"componentWillUpdate"),n=qe(n,(()=>Pe(o,"componentWillRender"))),i(),qe(n,(()=>Ve(e,o,t)))},Ve=async(e,t,r)=>{const i=e.$hostElement$,o=(e.$cmpMeta$.$tagName$,()=>{});i["s-rc"],r&&ye(e);const n=(e.$cmpMeta$.$tagName$,()=>{});je(e,t,i),n(),o(),Be(e)},je=(e,t,r)=>{try{ne=t,t=t.render&&t.render(),e.$flags$&=-17,e.$flags$|=2,(K||Y)&&(Q||Y)&&(G||Re(e,t))}catch(t){nt(t,e.$hostElement$)}return ne=null,null},Be=e=>{e.$cmpMeta$.$tagName$;const t=()=>{},r=e.$hostElement$;e.$ancestorComponent$,Pe(r,"componentDidRender"),64&e.$flags$?(Pe(r,"componentDidUpdate"),t()):(e.$flags$|=64,Pe(r,"componentDidLoad"),t())},Pe=(e,t,r)=>{if(e&&e[t])try{return e[t](r)}catch(e){nt(e)}},qe=(e,t)=>e&&e.then?e.then(t):t(),Ue=(e,t,r,i)=>{const o=rt(e),n=e,a=o.$instanceValues$.get(t),s=o.$flags$,l=n;var c,d;c=r,d=i.$members$[t][0],r=null==c||ce(c)?c:4&d?"false"!==c&&(""===c||!!c):2&d?parseFloat(c):1&d?String(c):c;const h=Number.isNaN(a)&&Number.isNaN(r);if(r!==a&&!h){if(o.$instanceValues$.set(t,r),i.$watchers$&&128&s){const e=i.$watchers$[t];e&&e.map((e=>{try{l[e](r,a,t)}catch(e){nt(e,n)}}))}if(2==(18&s)){if(l.componentShouldUpdate&&!1===l.componentShouldUpdate(r,a,t))return;Ne(o,!1)}}},Ke=(e,t,r)=>{if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);const r=Object.entries(t.$members$),i=e.prototype;r.map((([e,[r]])=>{(31&r||32&r)&&Object.defineProperty(i,e,{get(){return t=e,rt(this).$instanceValues$.get(t);var t},set(r){Ue(this,e,r,t)},configurable:!0,enumerable:!0})}));{const o=new Map;i.attributeChangedCallback=function(e,t,r){ht.jmp((()=>{const t=o.get(e);if(this.hasOwnProperty(t))r=this[t],delete this[t];else if(i.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==r)return;this[t]=(null!==r||"boolean"!=typeof this[t])&&r}))},e.observedAttributes=r.filter((([e,t])=>15&t[0])).map((([e,r])=>{const i=r[1]||e;return o.set(i,e),512&r[0]&&t.$attrsToReflect$.push([e,i]),i}))}}return e},Ye=async(e,t,r,i,o)=>{if(!(32&t.$flags$)&&(o=e.constructor,t.$flags$|=32,customElements.whenDefined(r.$tagName$).then((()=>t.$flags$|=128)),o.style)){let i=o.style;"string"!=typeof i&&(i=i[t.$modeName$=(e=>st.map((t=>t(e))).find((e=>!!e)))(e)]);const n=we(r,t.$modeName$);if(!at.has(n)){const e=(r.$tagName$,()=>{});((e,t,r)=>{let i=at.get(e);mt&&r?(i=i||new CSSStyleSheet,"string"==typeof i?i=t:i.replaceSync(t)):i=t,at.set(e,i)})(n,i,!!(1&r.$flags$)),e()}}t.$ancestorComponent$;Ne(t,!0)},Qe=e=>{const t=e["s-cr"]=ct.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},Ge=(e,t)=>{const r={$flags$:t[0],$tagName$:t[1]};r.$members$=t[2],r.$listeners$=t[3],r.$watchers$=e.$watchers$,r.$attrsToReflect$=[],!gt&&1&r.$flags$&&(r.$flags$|=8);const i=e.prototype.connectedCallback,o=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){it(this,r)},connectedCallback(){(e=>{if(!(1&ht.$flags$)){const t=rt(e),r=t.$cmpMeta$,i=(r.$tagName$,()=>{});1&t.$flags$?(Xe(e,t,r.$listeners$),t.$lazyInstance$):(t.$flags$|=1,12&r.$flags$&&Qe(e),r.$members$&&Object.entries(r.$members$).map((([t,[r]])=>{if(31&r&&e.hasOwnProperty(t)){const r=e[t];delete e[t],e[t]=r}})),Ye(e,t,r)),i()}})(this),i&&i.call(this)},disconnectedCallback(){(e=>{if(!(1&ht.$flags$)){const t=rt(e);t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0)}})(this),o&&o.call(this)},__attachShadow(){gt?this.attachShadow({mode:"open",delegatesFocus:!!(16&r.$flags$)}):this.shadowRoot=this}}),e.is=r.$tagName$,Ke(e,r)},Xe=(e,t,r,i)=>{r&&r.map((([r,i,o])=>{const n=Je(e,r),a=Ze(t,o),s=et(r);ht.ael(n,i,a,s),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>ht.rel(n,i,a,s)))}))},Ze=(e,t)=>r=>{try{X||e.$hostElement$[t](r)}catch(e){nt(e)}},Je=(e,t)=>4&t?ct:8&t?lt:16&t?ct.body:e,et=e=>ut?{passive:!!(1&e),capture:!!(2&e)}:!!(2&e),tt=new WeakMap,rt=e=>tt.get(e),it=(e,t)=>{const r={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return Xe(e,r,t.$listeners$),tt.set(e,r)},ot=(e,t)=>t in e,nt=(e,t)=>(0,console.error)(e,t),at=new Map,st=[],lt="undefined"!=typeof window?window:{},ct=lt.document||{head:{}},dt=lt.HTMLElement||class{},ht={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,i)=>e.addEventListener(t,r,i),rel:(e,t,r,i)=>e.removeEventListener(t,r,i),ce:(e,t)=>new CustomEvent(e,t)},gt=!0,ut=(()=>{let e=!1;try{ct.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(e){}return e})(),mt=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),pt=[],ft=[],vt=(e,t)=>r=>{e.push(r),ae||(ae=!0,t&&4&ht.$flags$?wt(yt):ht.raf(yt))},bt=e=>{for(let t=0;t{bt(pt),bt(ft),(ae=pt.length>0)&&ht.raf(yt)},wt=e=>{return Promise.resolve(t).then(e);var t},$t=vt(ft,!0),xt=(e,t)=>{const r=!!e.label||e.hasLabelSlot,i=!!e.helpText||e.hasHelpTextSlot,o=!!e.invalidText||e.hasInvalidTextSlot,n=!e.invalid,a=!!e.invalid;return de("div",{class:{"form-control":!0,[`form-control-${e.size}`]:!0,"form-control-has-label":r,"form-control-has-help-text":i,"form-control-has-invalid-text":o}},de("label",{id:e.labelId,class:"form-control-label",htmlFor:e.inputId,"aria-hidden":r?"false":"true",onClick:e.onLabelClick},de("slot",{name:"label"},e.label),e.requiredIndicator&&de("div",{class:"asterisk"},de("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 1200 1200"},de("path",{fill:"currentColor",d:"M489.838 29.354v443.603L68.032 335.894 0 545.285l421.829 137.086-260.743 358.876 178.219 129.398L600.048 811.84l260.673 358.806 178.146-129.398-260.766-358.783L1200 545.379l-68.032-209.403-421.899 137.07V29.443H489.84l-.002-.089z"})))),de("div",{class:"form-control-input"},t),n&&de("div",{id:e.helpTextId,class:"form-control-help-text","aria-hidden":i?"false":"true"},de("slot",{name:"help-text"},e.helpText)),a&&de("div",{id:e.invalidTextId,class:"form-control-invalid-text","aria-hidden":o?"false":"true"},de("div",{class:"icon"},de("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},de("title",null,"Alert Circle"),de("path",{d:"M256,48C141.31,48,48,141.31,48,256s93.31,208,208,208,208-93.31,208-208S370.69,48,256,48Zm0,319.91a20,20,0,1,1,20-20A20,20,0,0,1,256,367.91Zm21.72-201.15-5.74,122a16,16,0,0,1-32,0l-5.74-121.94v-.05a21.74,21.74,0,1,1,43.44,0Z",fill:"currentColor"}))),de("div",{class:"text"},de("slot",{name:"invalid-text"},e.invalidText))))}; +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */ +function kt(e){const t=e?e.assignedNodes({flatten:!0}):[];let r="";return[...t].map((e=>{e.nodeType===Node.TEXT_NODE&&(r+=e.textContent)})),r}function _t(e,t){return t?null!==e.querySelector(`[slot="${t}"]`):[...e.childNodes].some((e=>{if(e.nodeType===e.TEXT_NODE&&""!==e.textContent.trim())return!0;if(e.nodeType===e.ELEMENT_NODE){if(!e.hasAttribute("slot"))return!0}return!1}))} +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */const Ct=(e,t=[])=>{const r={};return t.forEach((t=>{if(e.hasAttribute(t)){null!==e.getAttribute(t)&&(r[t]=e.getAttribute(t)),e.removeAttribute(t)}})),r},Tt=Ge(class extends dt{constructor(){super(),this.__registerHost(),this.__attachShadow()}render(){return de("span",{class:"spinner","aria-busy":"true","aria-live":"polite"})}static get style(){return":host{--track-color:var(--gr-color-light-shade);--indicator-color:var(--gr-color-primary);--stroke-width:2px;display:inline-flex;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.spinner{display:inline-block;width:1em;height:1em;border-radius:50%;border:solid var(--stroke-width) var(--track-color);border-top-color:var(--indicator-color);border-right-color:var(--indicator-color);animation:1s linear infinite spin}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}"}},[1,"gr-spinner"]);function Et(){if("undefined"==typeof customElements)return;["gr-spinner"].forEach((e=>{if("gr-spinner"===e)customElements.get(e)||customElements.define(e,Tt)}))}Et(); +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */ +const Ot=Ge(class extends dt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grFocus=fe(this,"gr-focus",7),this.grBlur=fe(this,"gr-blur",7),this.inheritedAttributes={},this.handleClick=e=>{if("button"!==this.type){const t=this.el.closest("form");if(t){e.preventDefault();const r=document.createElement("button");r.type=this.type,r.style.display="none",t.appendChild(r),r.click(),r.remove()}}},this.onFocus=()=>{this.grFocus.emit()},this.onBlur=()=>{this.grBlur.emit()},this.variant="default",this.disabled=!1,this.loading=!1,this.size="medium",this.caret=!1,this.pill=!1,this.expand=void 0,this.circle=!1,this.href=void 0,this.target=void 0,this.rel=void 0,this.type="button"}componentWillLoad(){this.inheritedAttributes=Ct(this.el,["aria-label","tabindex","title"])}async setFocus(e){this.button.focus(e)}async removeFocus(){this.button.blur()}render(){const{rel:e,target:t,href:r,variant:i,size:o,expand:n,type:a,inheritedAttributes:s,disabled:l}=this,c=void 0===r?"button":"a",d="button"===c?{type:a}:{href:r,rel:e,target:t};return de(ge,{onClick:this.handleClick,"aria-disabled":l?"true":null,class:{[`button-${i}`]:!0,[`button-${o}`]:!0,[`button-${n}`]:void 0!==n,"button-caret":this.caret,"button-circle":this.circle,"button-pill":this.pill,"button-disabled":l,"button-loading":this.loading}},de(c,Object.assign({ref:e=>this.button=e},d,{class:"button-native",disabled:l,onFocus:this.onFocus,onBlur:this.onBlur},s),de("span",{class:"button-inner"},de("slot",{name:"icon-only"}),de("slot",{name:"start"}),de("slot",null),de("slot",{name:"end"}),this.caret&&de("span",{class:"caret"},de("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},de("title",null,"Chevron Down"),de("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M112 184l144 144 144-144"})))),this.loading&&de("gr-spinner",null)))}get el(){return this}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{display:inline-block;width:auto;font-family:var(--gr-font-family);font-weight:var(--gr-font-weight-medium);font-size:var(--gr-form-element-font-size-medium);font-kerning:none;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;pointer-events:auto;--height:var(--gr-form-element-height-medium);--border-radius:var(--gr-form-element-border-radius-medium);--border-width:1px;--border-style:solid;--background:transparent;--background-hover:transparent;--background-focus:transparent;--color:var(--gr-color-dark-tint);--color-hover:var(--gr-color-dark-tint);--color-focus:var(--gr-color-dark-tint);--border-color:var(--gr-color-light-shade);--border-color-hover:var(--gr-color-medium);--border-color-focus:var(--gr-color-primary);--padding-top:0;--padding-start:var(--gr-spacing-medium);--padding-end:var(--gr-spacing-medium);--padding-bottom:0;--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33);--shadow:none;--transition:background-color 150ms linear, opacity 150ms linear, border 150ms linear, color 150ms linear}:host(.button-disabled){pointer-events:none;opacity:0.5}:host(.button-primary){--border-color:var(--gr-color-primary);--background:var(--gr-color-primary);--color:var(--gr-color-primary-contrast);--border-color-hover:var(--gr-color-primary-shade);--background-hover:var(--gr-color-primary-shade);--color-hover:var(--gr-color-primary-contrast);--border-color-focus:var(--gr-color-primary);--background-focus:var(--gr-color-primary-shade);--color-focus:var(--gr-color-primary-contrast);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33)}:host(.button-secondary){--border-color:var(--gr-color-light-shade);--background:transparent;--color:var(--gr-color-primary);--border-color-hover:var(--gr-color-primary);--background-hover:transparent;--color-hover:var(--gr-color-primary);--border-color-focus:var(--gr-color-primary);--background-focus:transparent;--color-focus:var(--gr-color-primary);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33)}:host(.button-danger){--border-color:var(--gr-color-danger);--background:transparent;--color:var(--gr-color-danger);--border-color-hover:var(--gr-color-danger);--background-hover:var(--gr-color-danger);--color-hover:var(--gr-color-danger-contrast);--border-color-focus:var(--gr-color-danger);--background-focus:var(--gr-color-danger);--color-focus:var(--gr-color-danger-contrast);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-danger-rgb), 0.33)}:host(.button-plain){--border-color:transparent;--background:transparent;--color:var(--gr-color-primary);--border-color-hover:transparent;--background-hover:transparent;--color-hover:var(--gr-color-primary-shade);--border-color-focus:transparent;--background-focus:transparent;--color-focus:var(--gr-color-primary-shade);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33)}:host(.button-small){--padding-start:var(--gr-spacing-small);--padding-end:var(--gr-spacing-small);--border-radius:var(--gr-form-element-border-radius-small);--height:var(--gr-form-element-height-small);font-size:var(--gr-form-element-font-size-small)}:host(.button-large){--padding-start:var(--gr-spacing-large);--padding-end:var(--gr-spacing-large);--border-radius:var(--gr-form-element-border-radius-large);--height:var(--gr-form-element-height-large);font-size:var(--gr-form-element-font-size-large)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content;border-radius:0;border-right-width:0;border-left-width:0}.button-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;padding-top:var(--padding-top);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-bottom:var(--padding-bottom);width:100%;height:var(--height);transition:var(--transition);border-radius:var(--border-radius);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);color:var(--color);box-shadow:var(--shadow);line-height:1;cursor:pointer;z-index:0;text-decoration:none;box-sizing:border-box}.button-native::-moz-focus-inner{border:0}.button-native:focus{outline:none;box-shadow:var(--focus-ring);border-color:var(--border-color-focus);background-color:var(--background-focus);color:var(--color-focus)}.button-native *,.button-native *:before,.button-native *:after{box-sizing:inherit}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.button-circle) .button-native{padding-top:0;padding-bottom:0;padding-left:0;padding-right:0;border-radius:50%;width:var(--height)}@media (any-hover: hover){.button-native:hover{color:var(--color-hover);background:var(--background-hover);border-color:var(--border-color-hover)}}:host(.button-caret) .caret{display:flex;align-items:center;margin-left:0.3em}:host(.button-caret) .caret svg{width:1em;height:1em}:host(.button-pill) .button-native{border-radius:var(--height)}::slotted(*){pointer-events:none}::slotted([slot=start]){margin-top:0;margin-left:-0.3em;margin-right:0.3em;margin-bottom:0}::slotted([slot=end]){margin-top:0;margin-left:0.3em;margin-right:-0.2em;margin-bottom:0}::slotted([slot=icon-only]){font-size:1.4em;pointer-events:none}:host(.button-loading){position:relative;pointer-events:none}:host(.button-loading) .caret{visibility:hidden}:host(.button-loading) slot[name=start],:host(.button-loading) slot[name=end],:host(.button-loading) slot[name=icon-only],:host(.button-loading) slot:not([name]){visibility:hidden}:host(.button-loading) gr-spinner{--indicator-color:currentColor;position:absolute;height:1em;width:1em;top:calc(50% - 0.5em);left:calc(50% - 0.5em)}@media not all and (min-resolution: 0.001dpcm){@supports (-webkit-appearance: none) and (stroke-color: transparent){:host([type=button]),:host([type=reset]),:host([type=submit]){-webkit-appearance:none !important}}}"}},[1,"gr-button",{variant:[513],disabled:[516],loading:[516],size:[513],caret:[4],pill:[516],expand:[513],circle:[516],href:[1],target:[1],rel:[1],type:[1],setFocus:[64],removeFocus:[64]}]);function St(){if("undefined"==typeof customElements)return;["gr-button","gr-spinner"].forEach((e=>{switch(e){case"gr-button":customElements.get(e)||customElements.define(e,Ot);break;case"gr-spinner":customElements.get(e)||Et()}}))}function Mt(e,t,r="vertical",i="smooth"){const o= +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */ +function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),n=o.top+t.scrollTop,a=o.left+t.scrollLeft,s=t.scrollLeft,l=t.scrollLeft+t.offsetWidth,c=t.scrollTop,d=t.scrollTop+t.offsetHeight;"horizontal"!==r&&"both"!==r||(al&&t.scrollTo({left:a-t.offsetWidth+e.clientWidth,behavior:i})),"vertical"!==r&&"both"!==r||(nd&&t.scrollTo({top:n-t.offsetHeight+e.clientHeight,behavior:i}))} +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */function zt(e){return e.tabIndex>-1}function Lt(e){if(zt(e))return e;if(e.shadowRoot){const t=[...e.shadowRoot.children].find(zt);if(t)return t}return e.children?[...e.children].map(Lt)[0]:null}St();var Dt="top",At="bottom",Ft="right",It="left",Wt="auto",Rt=[Dt,At,Ft,It],Nt="start",Ht="end",Vt="clippingParents",jt="viewport",Bt="popper",Pt="reference",qt=Rt.reduce((function(e,t){return e.concat([t+"-"+Nt,t+"-"+Ht])}),[]),Ut=[].concat(Rt,[Wt]).reduce((function(e,t){return e.concat([t,t+"-"+Nt,t+"-"+Ht])}),[]),Kt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Yt(e){return e?(e.nodeName||"").toLowerCase():null}function Qt(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Gt(e){return e instanceof Qt(e).Element||e instanceof Element}function Xt(e){return e instanceof Qt(e).HTMLElement||e instanceof HTMLElement}function Zt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Qt(e).ShadowRoot||e instanceof ShadowRoot)}const Jt={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var r=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];Xt(o)&&Yt(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],o=t.attributes[e]||{},n=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce((function(e,t){return e[t]="",e}),{});Xt(i)&&Yt(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function er(e){return e.split("-")[0]}var tr=Math.max,rr=Math.min,ir=Math.round;function or(e,t){void 0===t&&(t=!1);var r=e.getBoundingClientRect(),i=1,o=1;if(Xt(e)&&t){var n=e.offsetHeight,a=e.offsetWidth;a>0&&(i=ir(r.width)/a||1),n>0&&(o=ir(r.height)/n||1)}return{width:r.width/i,height:r.height/o,top:r.top/o,right:r.right/i,bottom:r.bottom/o,left:r.left/i,x:r.left/i,y:r.top/o}}function nr(e){var t=or(e),r=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:i}}function ar(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Zt(r)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function sr(e){return Qt(e).getComputedStyle(e)}function lr(e){return["table","td","th"].indexOf(Yt(e))>=0}function cr(e){return((Gt(e)?e.ownerDocument:e.document)||window.document).documentElement}function dr(e){return"html"===Yt(e)?e:e.assignedSlot||e.parentNode||(Zt(e)?e.host:null)||cr(e)}function hr(e){return Xt(e)&&"fixed"!==sr(e).position?e.offsetParent:null}function gr(e){for(var t=Qt(e),r=hr(e);r&&lr(r)&&"static"===sr(r).position;)r=hr(r);return r&&("html"===Yt(r)||"body"===Yt(r)&&"static"===sr(r).position)?t:r||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Xt(e)&&"fixed"===sr(e).position)return null;var r=dr(e);for(Zt(r)&&(r=r.host);Xt(r)&&["html","body"].indexOf(Yt(r))<0;){var i=sr(r);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return r;r=r.parentNode}return null}(e)||t}function ur(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function mr(e,t,r){return tr(e,rr(t,r))}function pr(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function fr(e,t){return t.reduce((function(t,r){return t[r]=e,t}),{})}const vr={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,i=e.name,o=e.options,n=r.elements.arrow,a=r.modifiersData.popperOffsets,s=er(r.placement),l=ur(s),c=[It,Ft].indexOf(s)>=0?"height":"width";if(n&&a){var d=function(e,t){return pr("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:fr(e,Rt))}(o.padding,r),h=nr(n),g="y"===l?Dt:It,u="y"===l?At:Ft,m=r.rects.reference[c]+r.rects.reference[l]-a[l]-r.rects.popper[c],p=a[l]-r.rects.reference[l],f=gr(n),v=f?"y"===l?f.clientHeight||0:f.clientWidth||0:0,b=m/2-p/2,y=d[g],w=v-h[c]-d[u],$=v/2-h[c]/2+b,x=mr(y,$,w),k=l;r.modifiersData[i]=((t={})[k]=x,t.centerOffset=x-$,t)}},effect:function(e){var t=e.state,r=e.options.element,i=void 0===r?"[data-popper-arrow]":r;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&ar(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function br(e){return e.split("-")[1]}var yr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wr(e){var t,r=e.popper,i=e.popperRect,o=e.placement,n=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,h=e.isFixed,g=a.x,u=void 0===g?0:g,m=a.y,p=void 0===m?0:m,f="function"==typeof d?d({x:u,y:p}):{x:u,y:p};u=f.x,p=f.y;var v=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),y=It,w=Dt,$=window;if(c){var x=gr(r),k="clientHeight",_="clientWidth";if(x===Qt(r)&&"static"!==sr(x=cr(r)).position&&"absolute"===s&&(k="scrollHeight",_="scrollWidth"),o===Dt||(o===It||o===Ft)&&n===Ht)w=At,p-=(h&&x===$&&$.visualViewport?$.visualViewport.height:x[k])-i.height,p*=l?1:-1;if(o===It||(o===Dt||o===At)&&n===Ht)y=Ft,u-=(h&&x===$&&$.visualViewport?$.visualViewport.width:x[_])-i.width,u*=l?1:-1}var C,T=Object.assign({position:s},c&&yr),E=!0===d?function(e){var t=e.x,r=e.y,i=window.devicePixelRatio||1;return{x:ir(t*i)/i||0,y:ir(r*i)/i||0}}({x:u,y:p}):{x:u,y:p};return u=E.x,p=E.y,l?Object.assign({},T,((C={})[w]=b?"0":"",C[y]=v?"0":"",C.transform=($.devicePixelRatio||1)<=1?"translate("+u+"px, "+p+"px)":"translate3d("+u+"px, "+p+"px, 0)",C)):Object.assign({},T,((t={})[w]=b?p+"px":"",t[y]=v?u+"px":"",t.transform="",t))}var $r={passive:!0};var xr={left:"right",right:"left",bottom:"top",top:"bottom"};function kr(e){return e.replace(/left|right|bottom|top/g,(function(e){return xr[e]}))}var _r={start:"end",end:"start"};function Cr(e){return e.replace(/start|end/g,(function(e){return _r[e]}))}function Tr(e){var t=Qt(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Er(e){return or(cr(e)).left+Tr(e).scrollLeft}function Or(e){var t=sr(e),r=t.overflow,i=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function Sr(e){return["html","body","#document"].indexOf(Yt(e))>=0?e.ownerDocument.body:Xt(e)&&Or(e)?e:Sr(dr(e))}function Mr(e,t){var r;void 0===t&&(t=[]);var i=Sr(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),n=Qt(i),a=o?[n].concat(n.visualViewport||[],Or(i)?i:[]):i,s=t.concat(a);return o?s:s.concat(Mr(dr(a)))}function zr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Lr(e,t){return t===jt?zr(function(e){var t=Qt(e),r=cr(e),i=t.visualViewport,o=r.clientWidth,n=r.clientHeight,a=0,s=0;return i&&(o=i.width,n=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,s=i.offsetTop)),{width:o,height:n,x:a+Er(e),y:s}}(e)):Gt(t)?function(e){var t=or(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):zr(function(e){var t,r=cr(e),i=Tr(e),o=null==(t=e.ownerDocument)?void 0:t.body,n=tr(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=tr(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-i.scrollLeft+Er(e),l=-i.scrollTop;return"rtl"===sr(o||r).direction&&(s+=tr(r.clientWidth,o?o.clientWidth:0)-n),{width:n,height:a,x:s,y:l}}(cr(e)))}function Dr(e,t,r){var i="clippingParents"===t?function(e){var t=Mr(dr(e)),r=["absolute","fixed"].indexOf(sr(e).position)>=0&&Xt(e)?gr(e):e;return Gt(r)?t.filter((function(e){return Gt(e)&&ar(e,r)&&"body"!==Yt(e)})):[]}(e):[].concat(t),o=[].concat(i,[r]),n=o[0],a=o.reduce((function(t,r){var i=Lr(e,r);return t.top=tr(i.top,t.top),t.right=rr(i.right,t.right),t.bottom=rr(i.bottom,t.bottom),t.left=tr(i.left,t.left),t}),Lr(e,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ar(e){var t,r=e.reference,i=e.element,o=e.placement,n=o?er(o):null,a=o?br(o):null,s=r.x+r.width/2-i.width/2,l=r.y+r.height/2-i.height/2;switch(n){case Dt:t={x:s,y:r.y-i.height};break;case At:t={x:s,y:r.y+r.height};break;case Ft:t={x:r.x+r.width,y:l};break;case It:t={x:r.x-i.width,y:l};break;default:t={x:r.x,y:r.y}}var c=n?ur(n):null;if(null!=c){var d="y"===c?"height":"width";switch(a){case Nt:t[c]=t[c]-(r[d]/2-i[d]/2);break;case Ht:t[c]=t[c]+(r[d]/2-i[d]/2)}}return t}function Fr(e,t){void 0===t&&(t={});var r=t,i=r.placement,o=void 0===i?e.placement:i,n=r.boundary,a=void 0===n?Vt:n,s=r.rootBoundary,l=void 0===s?jt:s,c=r.elementContext,d=void 0===c?Bt:c,h=r.altBoundary,g=void 0!==h&&h,u=r.padding,m=void 0===u?0:u,p=pr("number"!=typeof m?m:fr(m,Rt)),f=d===Bt?Pt:Bt,v=e.rects.popper,b=e.elements[g?f:d],y=Dr(Gt(b)?b:b.contextElement||cr(e.elements.popper),a,l),w=or(e.elements.reference),$=Ar({reference:w,element:v,strategy:"absolute",placement:o}),x=zr(Object.assign({},v,$)),k=d===Bt?x:w,_={top:y.top-k.top+p.top,bottom:k.bottom-y.bottom+p.bottom,left:y.left-k.left+p.left,right:k.right-y.right+p.right},C=e.modifiersData.offset;if(d===Bt&&C){var T=C[o];Object.keys(_).forEach((function(e){var t=[Ft,At].indexOf(e)>=0?1:-1,r=[Dt,At].indexOf(e)>=0?"y":"x";_[e]+=T[r]*t}))}return _}function Ir(e,t){void 0===t&&(t={});var r=t,i=r.placement,o=r.boundary,n=r.rootBoundary,a=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Ut:l,d=br(i),h=d?s?qt:qt.filter((function(e){return br(e)===d})):Rt,g=h.filter((function(e){return c.indexOf(e)>=0}));0===g.length&&(g=h);var u=g.reduce((function(t,r){return t[r]=Fr(e,{placement:r,boundary:o,rootBoundary:n,padding:a})[er(r)],t}),{});return Object.keys(u).sort((function(e,t){return u[e]-u[t]}))}const Wr={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var o=r.mainAxis,n=void 0===o||o,a=r.altAxis,s=void 0===a||a,l=r.fallbackPlacements,c=r.padding,d=r.boundary,h=r.rootBoundary,g=r.altBoundary,u=r.flipVariations,m=void 0===u||u,p=r.allowedAutoPlacements,f=t.options.placement,v=er(f),b=l||(v===f||!m?[kr(f)]:function(e){if(er(e)===Wt)return[];var t=kr(e);return[Cr(e),t,Cr(t)]}(f)),y=[f].concat(b).reduce((function(e,r){return e.concat(er(r)===Wt?Ir(t,{placement:r,boundary:d,rootBoundary:h,padding:c,flipVariations:m,allowedAutoPlacements:p}):r)}),[]),w=t.rects.reference,$=t.rects.popper,x=new Map,k=!0,_=y[0],C=0;C=0,M=S?"width":"height",z=Fr(t,{placement:T,boundary:d,rootBoundary:h,altBoundary:g,padding:c}),L=S?O?Ft:It:O?At:Dt;w[M]>$[M]&&(L=kr(L));var D=kr(L),A=[];if(n&&A.push(z[E]<=0),s&&A.push(z[L]<=0,z[D]<=0),A.every((function(e){return e}))){_=T,k=!1;break}x.set(T,A)}if(k)for(var F=function(e){var t=y.find((function(t){var r=x.get(t);if(r)return r.slice(0,e).every((function(e){return e}))}));if(t)return _=t,"break"},I=m?3:1;I>0;I--){if("break"===F(I))break}t.placement!==_&&(t.modifiersData[i]._skip=!0,t.placement=_,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Rr(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Nr(e){return[Dt,Ft,At,It].some((function(t){return e[t]>=0}))}const Hr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,i=e.name,o=r.offset,n=void 0===o?[0,0]:o,a=Ut.reduce((function(e,r){return e[r]=function(e,t,r){var i=er(e),o=[It,Dt].indexOf(i)>=0?-1:1,n="function"==typeof r?r(Object.assign({},t,{placement:e})):r,a=n[0],s=n[1];return a=a||0,s=(s||0)*o,[It,Ft].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(r,t.rects,n),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}};const Vr={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,i=e.name,o=r.mainAxis,n=void 0===o||o,a=r.altAxis,s=void 0!==a&&a,l=r.boundary,c=r.rootBoundary,d=r.altBoundary,h=r.padding,g=r.tether,u=void 0===g||g,m=r.tetherOffset,p=void 0===m?0:m,f=Fr(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),v=er(t.placement),b=br(t.placement),y=!b,w=ur(v),$="x"===w?"y":"x",x=t.modifiersData.popperOffsets,k=t.rects.reference,_=t.rects.popper,C="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,T="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(x){if(n){var S,M="y"===w?Dt:It,z="y"===w?At:Ft,L="y"===w?"height":"width",D=x[w],A=D+f[M],F=D-f[z],I=u?-_[L]/2:0,W=b===Nt?k[L]:_[L],R=b===Nt?-_[L]:-k[L],N=t.elements.arrow,H=u&&N?nr(N):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},j=V[M],B=V[z],P=mr(0,k[L],H[L]),q=y?k[L]/2-I-P-j-T.mainAxis:W-P-j-T.mainAxis,U=y?-k[L]/2+I+P+B+T.mainAxis:R+P+B+T.mainAxis,K=t.elements.arrow&&gr(t.elements.arrow),Y=K?"y"===w?K.clientTop||0:K.clientLeft||0:0,Q=null!=(S=null==E?void 0:E[w])?S:0,G=D+U-Q,X=mr(u?rr(A,D+q-Q-Y):A,D,u?tr(F,G):F);x[w]=X,O[w]=X-D}if(s){var Z,J="x"===w?Dt:It,ee="x"===w?At:Ft,te=x[$],re="y"===$?"height":"width",ie=te+f[J],oe=te-f[ee],ne=-1!==[Dt,It].indexOf(v),ae=null!=(Z=null==E?void 0:E[$])?Z:0,se=ne?ie:te-k[re]-_[re]-ae+T.altAxis,le=ne?te+k[re]+_[re]-ae-T.altAxis:oe,ce=u&&ne?function(e,t,r){var i=mr(e,t,r);return i>r?r:i}(se,te,le):mr(u?se:ie,te,u?le:oe);x[$]=ce,O[$]=ce-te}t.modifiersData[i]=O}},requiresIfExists:["offset"]};function jr(e,t,r){void 0===r&&(r=!1);var i,o,n=Xt(t),a=Xt(t)&&function(e){var t=e.getBoundingClientRect(),r=ir(t.width)/e.offsetWidth||1,i=ir(t.height)/e.offsetHeight||1;return 1!==r||1!==i}(t),s=cr(t),l=or(e,a),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(n||!n&&!r)&&(("body"!==Yt(t)||Or(s))&&(c=(i=t)!==Qt(i)&&Xt(i)?{scrollLeft:(o=i).scrollLeft,scrollTop:o.scrollTop}:Tr(i)),Xt(t)?((d=or(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):s&&(d.x=Er(s))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function Br(e){var t=new Map,r=new Set,i=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!r.has(e)){var i=t.get(e);i&&o(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){r.has(e.name)||o(e)})),i}var Pr={placement:"bottom",modifiers:[],strategy:"absolute"};function qr(){for(var e=arguments.length,t=new Array(e),r=0;r{},onAfterHide:()=>{},onTransitionEnd:()=>{}},r),this.isVisible=!1,this.popover.hidden=!0,this.popover.classList.remove(this.options.visibleClass),this.popover.addEventListener("transitionend",this.handleTransitionEnd)}handleTransitionEnd(e){e.target===this.options.transitionElement&&(this.options.onTransitionEnd.call(this,e),this.isVisible||this.popover.hidden||(this.popover.hidden=!0,this.popover.classList.remove(this.options.visibleClass),this.options.onAfterHide.call(this)))}destroy(){this.popover.removeEventListener("transitionend",this.handleTransitionEnd),this.popper&&(this.popper.destroy(),this.popper=null)}show(){this.isVisible=!0,this.popover.hidden=!1,requestAnimationFrame((()=>this.popover.classList.add(this.options.visibleClass))),this.popper&&this.popper.destroy(),this.popper=Kr(this.anchor,this.popover,{placement:this.options.placement,strategy:this.options.strategy,modifiers:[{name:"flip",options:{boundary:"viewport"}},{name:"offset",options:{offset:[this.options.skidding,this.options.distance]}}]}),this.popover.addEventListener("transitionend",(()=>this.options.onAfterShow.call(this)),{once:!0}),requestAnimationFrame((()=>this.popper.update()))}hide(){this.isVisible=!1,this.popover.classList.remove(this.options.visibleClass)}setOptions(e){this.options=Object.assign(this.options,e),this.isVisible?this.popover.classList.add(this.options.visibleClass):this.popover.classList.remove(this.options.visibleClass),this.popper&&(this.popper.setOptions({placement:this.options.placement,strategy:this.options.strategy}),requestAnimationFrame((()=>this.popper.update())))}}let Qr=0;const Gr=Ge(class extends dt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grShow=fe(this,"gr-show",7),this.grAfterShow=fe(this,"gr-after-show",7),this.grHide=fe(this,"gr-hide",7),this.grAfterHide=fe(this,"gr-after-hide",7),this.componentId="dropdown-"+ ++Qr,this.isVisible=!1,this.open=!1,this.placement="bottom-start",this.closeOnSelect=!0,this.containingElement=void 0,this.distance=2,this.skidding=0,this.hoist=!1}handleOpenChange(){this.open?this.show():this.hide(),this.updateAccessibleTrigger()}handlePopoverOptionsChange(){this.popoverElement.setOptions({strategy:this.hoist?"fixed":"absolute",placement:this.placement,distance:this.distance,skidding:this.skidding})}connectedCallback(){this.containingElement||(this.containingElement=this.el),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleTriggerClick=this.handleTriggerClick.bind(this),this.handleTriggerKeyDown=this.handleTriggerKeyDown.bind(this),this.handleTriggerKeyUp=this.handleTriggerKeyUp.bind(this),this.handleTriggerSlotChange=this.handleTriggerSlotChange.bind(this)}componentDidLoad(){this.popoverElement=new Yr(this.trigger,this.positioner,{strategy:this.hoist?"fixed":"absolute",placement:this.placement,distance:this.distance,skidding:this.skidding,transitionElement:this.panel,onAfterHide:()=>this.grAfterHide.emit(),onAfterShow:()=>this.grAfterShow.emit(),onTransitionEnd:()=>{this.open||(this.panel.scrollTop=0)}}),this.open&&this.show()}disconnectedCallback(){this.hide(),this.popoverElement.destroy()}async show(){if(this.isVisible)return;this.grShow.emit().defaultPrevented?this.open=!1:(this.panel.addEventListener("gr-activate",this.handleMenuItemActivate),this.panel.addEventListener("gr-select",this.handlePanelSelect),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.isVisible=!0,this.open=!0,this.popoverElement.show())}async hide(){if(!this.isVisible)return;this.grHide.emit().defaultPrevented?this.open=!0:(this.panel.removeEventListener("gr-activate",this.handleMenuItemActivate),this.panel.removeEventListener("gr-select",this.handlePanelSelect),document.addEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.isVisible=!1,this.open=!1,this.popoverElement.hide())}async focusOnTrigger(){const e=this.trigger.querySelector("slot").assignedElements({flatten:!0})[0];e&&("function"==typeof e.setFocus?e.setFocus():"function"==typeof e.focus&&e.focus())}getMenu(){return this.panel.querySelector("slot").assignedElements({flatten:!0}).filter((e=>"gr-menu"===e.tagName.toLowerCase()))[0]}handleDocumentKeyDown(e){var t;if("Escape"===e.key)return this.hide(),void this.focusOnTrigger();if("Tab"===e.key){if(this.open&&"gr-menu-item"===(null===(t=document.activeElement)||void 0===t?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{var e;const t=this.containingElement.getRootNode()instanceof ShadowRoot?null===(e=document.activeElement.shadowRoot)||void 0===e?void 0:e.activeElement:document.activeElement;(null==t?void 0:t.closest(this.containingElement.tagName.toLowerCase()))===this.containingElement||this.hide()}))}}handleDocumentMouseDown(e){e.composedPath().includes(this.containingElement)||this.hide()}handleMenuItemActivate(e){Mt(e.target,this.panel)}handlePanelSelect(e){const t=e.target;this.closeOnSelect&&"gr-menu"===t.tagName.toLowerCase()&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){const t=this.getMenu(),r=t?[...t.querySelectorAll("gr-menu-item")]:null,i=r[0],o=r[r.length-1];if("Escape"===e.key)return this.focusOnTrigger(),void this.hide();if([" ","Enter"].includes(e.key))return e.preventDefault(),void(this.open?this.hide():this.show());if(["ArrowDown","ArrowUp"].includes(e.key)){if(e.preventDefault(),this.open||this.show(),"ArrowDown"===e.key&&i)return void i.setFocus();if("ArrowUp"===e.key&&o)return void o.setFocus()}this.open&&t&&!["Tab","Shift","Meta","Ctrl","Alt"].includes(e.key)&&t.typeToSelect(e.key)}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.querySelector("slot").assignedElements({flatten:!0}).map(Lt)[0];e&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded",this.open?"true":"false"))}render(){return de(ge,{id:this.componentId,class:{"dropdown-open":this.open}},de("span",{class:"dropdown-trigger",ref:e=>this.trigger=e,onClick:this.handleTriggerClick,onKeyDown:this.handleTriggerKeyDown,onKeyUp:this.handleTriggerKeyUp},de("slot",{name:"trigger",onSlotchange:this.handleTriggerSlotChange})),de("div",{ref:e=>this.positioner=e,class:"dropdown-positioner"},de("div",{ref:e=>this.panel=e,class:"dropdown-panel",role:"menu","aria-hidden":this.open?"false":"true","aria-labelledby":this.componentId},de("slot",null))))}get el(){return this}static get watchers(){return{open:["handleOpenChange"],distance:["handlePopoverOptionsChange"],hoist:["handlePopoverOptionsChange"],placement:["handlePopoverOptionsChange"],skidding:["handlePopoverOptionsChange"]}}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{--panel-background-color:var(--gr-color-white);--panel-border-radius:var(--gr-border-radius-medium);--panel-border-color:var(--gr-panel-border-color);--panel-box-shadow:var(--gr-shadow-large);--transition:150ms opacity, 150ms transform;display:inline-block;position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.dropdown-trigger{display:block}.dropdown-positioner{position:absolute;z-index:var(--gr-z-index-dropdown)}.dropdown-panel{max-height:50vh;font-family:var(--gr-font-family);font-size:var(--gr-font-size-medium);font-weight:var(--gr-font-weight-normal);background-color:var(--panel-background-color);border:solid 1px var(--panel-border-color);border-radius:var(--panel-border-radius);box-shadow:var(--panel-box-shadow);opacity:0;overflow:auto;overscroll-behavior:none;pointer-events:none;transform:scale(0.9);transition:var(--transition)}.dropdown-positioner[data-popper-placement^=top] .dropdown-panel{transform-origin:bottom}.dropdown-positioner[data-popper-placement^=bottom] .dropdown-panel{transform-origin:top}.dropdown-positioner[data-popper-placement^=left] .dropdown-panel{transform-origin:right}.dropdown-positioner[data-popper-placement^=right] .dropdown-panel{transform-origin:left}.dropdown-positioner.popover-visible .dropdown-panel{opacity:1;transform:none;pointer-events:all}"}},[1,"gr-dropdown",{open:[1540],placement:[1],closeOnSelect:[4,"close-on-select"],containingElement:[1040],distance:[2],skidding:[2],hoist:[4],show:[64],hide:[64],focusOnTrigger:[64]}]);function Xr(){if("undefined"==typeof customElements)return;["gr-dropdown"].forEach((e=>{if("gr-dropdown"===e)customElements.get(e)||customElements.define(e,Gr)}))}Xr(); +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */ +const Zr=Ge(class extends dt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grSelect=fe(this,"gr-select",7),this.typeToSelectString=""}connectedCallback(){this.handleClick=this.handleClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}async typeToSelect(e){clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=setTimeout((()=>this.typeToSelectString=""),750),this.typeToSelectString+=e.toLowerCase();const t=this.getItems();for(const e of t){if(kt(e.shadowRoot.querySelector("slot:not([name])")).toLowerCase().trim().substring(0,this.typeToSelectString.length)===this.typeToSelectString){e.setFocus();break}}}getItems(){return[...this.menu.querySelector("slot").assignedElements({flatten:!0})].filter((e=>"gr-menu-item"===e.tagName.toLowerCase()&&!e.disabled))}getActiveItem(){return this.getItems().find((e=>e===document.activeElement))}setActiveItem(e){e.setFocus()}handleClick(e){const t=e.target.closest("gr-menu-item");t&&!t.disabled&&this.grSelect.emit({item:t})}handleKeyDown(e){if("Enter"===e.key){const t=this.getActiveItem();e.preventDefault(),t&&this.grSelect.emit({item:t})}if(" "===e.key&&e.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getItems(),r=this.getActiveItem();let i=t.indexOf(r);if(t.length)return e.preventDefault(),"ArrowDown"===e.key?i++:"ArrowUp"===e.key?i--:"Home"===e.key?i=0:"End"===e.key&&(i=t.length-1),i<0&&(i=0),i>t.length-1&&(i=t.length-1),void this.setActiveItem(t[i])}this.typeToSelect(e.key)}render(){return de("div",{ref:e=>this.menu=e,class:"menu",role:"menu",onClick:this.handleClick,onKeyDown:this.handleKeyDown},de("slot",null))}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{--padding-top:var(--gr-spacing-x-small);--padding-bottom:var(--gr-spacing-x-small);display:block;padding-top:var(--padding-top);padding-left:0;padding-right:0;padding-bottom:var(--padding-bottom);box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host:focus{outline:none}"}},[1,"gr-menu",{typeToSelect:[64]}]);function Jr(){if("undefined"==typeof customElements)return;["gr-menu"].forEach((e=>{if("gr-menu"===e)customElements.get(e)||customElements.define(e,Zr)}))}Jr(); +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */ +const ei=Ge(class extends dt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grClear=fe(this,"gr-clear",7),this.type="primary",this.size="medium",this.pill=!1,this.clearable=!1,this.truncate=!1,this.title=""}connectedCallback(){this.handleClearClick=this.handleClearClick.bind(this)}handleClearClick(){this.grClear.emit()}render(){return de(ge,{class:{[`tag-${this.type}`]:!0,[`tag-${this.size}`]:!0,"tag-pill":this.pill,"tag-clearable":this.clearable}},de("span",{class:"tag"},de("span",{class:{"tag-truncate":this.truncate},title:this.title},de("slot",null)),this.clearable&&de("gr-button",{variant:"plain",size:this.size,class:"tag-clear","aria-label":"clear",onClick:this.handleClearClick},de("svg",{slot:"icon-only",role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},de("title",null,"Close"),de("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144M368 144L144 368"})))))}static get style(){return":host{--height:calc(var(--gr-form-element-height-medium) * 0.8);--line-height:calc(var(--gr-form-element-height-medium) - 1px * 2);--border-radius:var(--gr-form-element-border-radius-medium);--border-width:1px;--border-style:solid;--padding-top:0;--padding-start:var(--gr-spacing-small);--padding-end:var(--gr-spacing-small);--padding-bottom:0;--font-size:var(--gr-form-element-font-size-medium);--background-color:rgba(var(--gr-color-primary-rgb), 0.05);--border-color:rgba(var(--gr-color-primary-rgb), 0.2);--color:var(--gr-color-primary-shade);--clear-color:var(--gr-color-primary);--clear-color-hover:var(--gr-color-primary-shade);--clear-margin-left:var(--gr-spacing-xx-small);--clear-margin-right:calc(-1 * var(--gr-spacing-xxx-small));display:inline-block;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host(.tag-success){--background-color:rgba(var(--gr-color-success-rgb), 0.05);--border-color:rgba(var(--gr-color-success-rgb), 0.2);--color:var(--gr-color-success-shade);--clear-color:var(--gr-color-success);--clear-color-hover:var(--gr-color-success-shade)}:host(.tag-info){--background-color:rgba(var(--gr-color-medium-rgb), 0.05);--border-color:rgba(var(--gr-color-medium-rgb), 0.2);--color:var(--gr-color-medium-shade);--clear-color:var(--gr-color-medium);--clear-color-hover:var(--gr-color-medium-shade)}:host(.tag-warning){--background-color:rgba(var(--gr-color-warning-rgb), 0.05);--border-color:rgba(var(--gr-color-warning-rgb), 0.2);--color:var(--gr-color-warning-shade);--clear-color:var(--gr-color-warning);--clear-color-hover:var(--gr-color-warning-shade)}:host(.tag-danger){--background-color:rgba(var(--gr-color-danger-rgb), 0.05);--border-color:rgba(var(--gr-color-danger-rgb), 0.2);--color:var(--gr-color-danger-shade);--clear-color:var(--gr-color-danger);--clear-color-hover:var(--gr-color-danger-shade)}:host(.tag-small){--font-size:var(--gr-form-element-font-size-small);--height:calc(var(--gr-form-element-height-small) * 0.8);--line-height:calc(var(--gr-form-element-height-small) - 1px * 2);--border-radius:var(--gr-form-element-border-radius-small);--padding-start:var(--gr-spacing-x-small);--padding-end:var(--gr-spacing-x-small);--clear-margin-left:var(--gr-spacing-xx-small);--clear-margin-right:calc(-1 * var(--gr-spacing-xxx-small))}:host(.tag-large){--font-size:var(--gr-form-element-font-size-large);--height:calc(var(--gr-form-element-height-large) * 0.8);--line-height:calc(var(--gr-form-element-height-large) - 1px * 2);--border-radius:var(--gr-form-element-border-radius-large);--padding:0 var(--gr-spacing-medium);--clear-margin-left:var(--gr-spacing-xx-small);--clear-margin-right:calc(-1 * var(--gr-spacing-x-small))}.tag{display:flex;align-items:center;border-style:var(--border-style);border-width:var(--border-width);border-radius:var(--border-radius);white-space:nowrap;user-select:none;cursor:default;font-family:var(--gr-font-family);font-size:var(--font-size);font-weight:var(--gr-font-weight-normal);height:var(--height);line-height:var(--line-height);padding-top:var(--padding-top);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-bottom:var(--padding-bottom);background-color:var(--background-color);border-color:var(--border-color);color:var(--color)}.tag-clear{--color:var(--clear-color);--color-hover:var(--clear-color-hover);--padding-start:0;--padding-end:0;margin-left:var(--clear-margin-left);margin-right:var(--clear-margin-right);--height:1em}.tag-clear svg{font-size:0.7em}.tag-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag-clear svg{width:1.1em;height:1.1em}:host(.tag-pill) .tag{border-radius:var(--height)}"}},[1,"gr-tag",{type:[513],size:[513],pill:[516],clearable:[516],truncate:[516],title:[513]}]);function ti(){if("undefined"==typeof customElements)return;["gr-tag","gr-button","gr-spinner"].forEach((e=>{switch(e){case"gr-tag":customElements.get(e)||customElements.define(e,ei);break;case"gr-button":customElements.get(e)||St();break;case"gr-spinner":customElements.get(e)||Et()}}))}ti(); +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */ +const ri="undefined"!=typeof HTMLElement?HTMLElement:class{};let ii=0;const oi=Ge(class extends dt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.grChange=fe(this,"gr-change",7),this.grFocus=fe(this,"gr-focus",7),this.grBlur=fe(this,"gr-blur",7),this.inputId="select-"+ ++ii,this.labelId=`select-label-${ii}`,this.helpTextId=`select-help-text-${ii}`,this.invalidTextId=`select-invalid-text-${ii}`,this.inheritedAttributes={},this.handleBlur=()=>{this.isOpen||(this.hasFocus=!1,this.grBlur.emit())},this.handleFocus=()=>{this.hasFocus||(this.hasFocus=!0,this.grFocus.emit())},this.hasFocus=!1,this.hasHelpTextSlot=!1,this.hasInvalidTextSlot=!1,this.hasLabelSlot=!1,this.isOpen=!1,this.items=[],this.displayLabel="",this.displayTags=[],this.multiple=!1,this.maxTagsVisible=3,this.disabled=!1,this.name="",this.placeholder="",this.size="medium",this.hoist=!1,this.value="",this.pill=!1,this.label="",this.requiredIndicator=!1,this.helpText="",this.invalidText="",this.invalid=!1,this.clearable=!1}handleDisabledChange(){this.disabled&&this.isOpen&&this.dropdown.hide()}handleLabelChange(){this.handleSlotChange()}handleMultipleChange(){const e=this.getValueAsArray();this.value=this.multiple?e:e[0]||"",this.syncItemsFromValue()}handleValueChange(){this.syncItemsFromValue(),this.grChange.emit()}connectedCallback(){this.handleClearClick=this.handleClearClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleLabelClick=this.handleLabelClick.bind(this),this.handleMenuHide=this.handleMenuHide.bind(this),this.handleMenuShow=this.handleMenuShow.bind(this),this.handleMenuSelect=this.handleMenuSelect.bind(this),this.handleSlotChange=this.handleSlotChange.bind(this),this.handleTagInteraction=this.handleTagInteraction.bind(this),this.el.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){this.handleSlotChange(),this.inheritedAttributes=Ct(this.el,["aria-label"])}componentDidLoad(){this.resizeObserver=new ResizeObserver((()=>this.resizeMenu())),this.reportDuplicateItemValues(),requestAnimationFrame((()=>this.syncItemsFromValue()))}disconnectedCallback(){this.el.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}async setFocus(){this.hasFocus=!0,this.grFocus.emit(),this.dropdown.focusOnTrigger()}getItemLabel(e){return kt(e.shadowRoot.querySelector("slot:not([name])"))}getItems(){return[...this.el.querySelectorAll("gr-menu-item")]}getValueAsArray(){return Array.isArray(this.value)?this.value:[this.value]}handleClearClick(e){e.stopPropagation(),this.value=this.multiple?[]:"",this.syncItemsFromValue()}handleKeyDown(e){const t=e.target,r=this.getItems(),i=r[0],o=r[r.length-1];if("gr-tag"!==t.tagName.toLowerCase())if("Tab"!==e.key){if(["ArrowDown","ArrowUp"].includes(e.key)){if(e.preventDefault(),this.isOpen||this.dropdown.show(),"ArrowDown"===e.key&&i)return void i.setFocus();if("ArrowUp"===e.key&&o)return void o.setFocus()}this.isOpen||1!==e.key.length||(e.stopPropagation(),e.preventDefault(),this.dropdown.show(),this.menu.typeToSelect(e.key))}else this.isOpen&&this.dropdown.hide()}handleLabelClick(){this.box.focus()}handleMenuSelect(e){const t=e.detail.item;this.multiple?this.value=this.value.includes(t.value)?this.value.filter((e=>e!==t.value)):[...this.value,t.value]:this.value=t.value,this.syncItemsFromValue()}handleMenuShow(e){this.disabled?e.preventDefault():(this.resizeMenu(),this.resizeObserver.observe(this.el),this.isOpen=!0)}handleMenuHide(){this.resizeObserver.unobserve(this.el),this.isOpen=!1,this.box.focus()}handleSlotChange(){this.hasHelpTextSlot=_t(this.el,"help-text"),this.hasInvalidTextSlot=_t(this.el,"invalid-text"),this.hasLabelSlot=_t(this.el,"label"),this.syncItemsFromValue(),this.reportDuplicateItemValues()}handleTagInteraction(e){e.composedPath().find((e=>{if(e instanceof ri)return e.classList.contains("tag-clear")}))&&e.stopPropagation()}reportDuplicateItemValues(){const e=this.getItems().map((e=>e.value)).filter(((e,t,r)=>r.indexOf(e)!==t));if(e.length)throw new Error('Duplicate value found on in : "'+e.join('", "')+'"')}resizeMenu(){this.menu.style.width=`${this.box.clientWidth}px`}syncItemsFromValue(){const e=this.getItems(),t=this.getValueAsArray();if(e.map((e=>e.checked=t.includes(e.value))),this.multiple){const r=[];if(t.map((t=>e.map((e=>e.value===t?r.push(e):null)))),this.displayTags=r.map((e=>de("gr-tag",{type:"info",size:this.size,pill:this.pill,clearable:!0,onClick:this.handleTagInteraction,onKeyDown:this.handleTagInteraction,"onGr-clear":t=>{t.stopPropagation(),this.disabled||(e.checked=!1,this.syncValueFromItems())}},this.getItemLabel(e)))),this.maxTagsVisible>0&&this.displayTags.length>this.maxTagsVisible){const e=this.displayTags.length;this.displayLabel="",this.displayTags=this.displayTags.slice(0,this.maxTagsVisible),this.displayTags.push(de("gr-tag",{type:"info",size:this.size,pill:this.pill},"+",e-this.maxTagsVisible))}}else{const r=e.filter((e=>e.value===t[0]))[0];this.displayLabel=r?this.getItemLabel(r):"",this.displayTags=[]}}syncValueFromItems(){const e=this.getItems().filter((e=>e.checked)).map((e=>e.value));this.multiple?this.value=this.value.filter((t=>e.includes(t))):this.value=e.length>0?e[0]:""}render(){var e;const t=this.multiple?this.value.length>0:""!==this.value,r=this.inheritedAttributes["aria-label"]?{"aria-label":this.inheritedAttributes["aria-label"]}:{"aria-labelledby":this.labelId};return((e,t,r,i)=>{let o=e.querySelector("input.aux-input");o||(o=e.ownerDocument.createElement("input"),o.type="hidden",o.classList.add("aux-input"),e.appendChild(o)),o.disabled=i,o.name=t,o.value=r||""})(this.el,this.name,ni(this.value),this.disabled),de(xt,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,invalidTextId:this.invalidTextId,invalidText:this.invalidText,invalid:this.invalid,hasInvalidTextSlot:this.hasInvalidTextSlot,size:this.size,onLabelClick:this.handleLabelClick,requiredIndicator:this.requiredIndicator},de("gr-dropdown",{ref:e=>this.dropdown=e,hoist:this.hoist,closeOnSelect:!this.multiple,containingElement:this.el,class:{select:!0,"select-open":this.isOpen,"select-empty":0===(null===(e=this.value)||void 0===e?void 0:e.length),"select-focused":this.hasFocus,"select-clearable":this.clearable,"select-disabled":this.disabled,"select-multiple":this.multiple,"select-has-tags":this.multiple&&t,"select-placeholder-visible":""===this.displayLabel,[`select-${this.size}`]:!0,"select-pill":this.pill,"select-invalid":this.invalid},"onGr-show":this.handleMenuShow,"onGr-hide":this.handleMenuHide},de("div",Object.assign({slot:"trigger",ref:e=>this.box=e,id:this.inputId,class:"select-box",role:"combobox"},r,{"aria-describedby":this.invalid?this.invalidTextId:this.helpTextId,"aria-haspopup":"true","aria-expanded":this.isOpen?"true":"false","aria-invalid":this.invalid?"true":"false","aria-required":this.requiredIndicator?"true":"false",tabIndex:this.disabled?-1:0,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown}),de("div",{class:"select-label"},this.displayTags.length?de("span",{class:"select-tags"},this.displayTags):this.displayLabel||this.placeholder),this.clearable&&t&&de("button",{class:"select-clear",type:"button",onClick:this.handleClearClick,"aria-label":"clear",tabindex:"-1"},de("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},de("title",null,"Close Circle"),de("path",{d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}),de("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M320 320L192 192M192 320l128-128"}))),de("span",{class:"caret"},de("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},de("title",null,"Chevron Down"),de("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M112 184l144 144 144-144"}))),de("input",{class:"select-hidden-select","aria-hidden":"true",value:t?"1":"",tabIndex:-1})),de("gr-menu",{ref:e=>this.menu=e,class:"select-menu","onGr-select":this.handleMenuSelect},de("slot",{onSlotchange:this.handleSlotChange}))))}get el(){return this}static get watchers(){return{disabled:["handleDisabledChange"],helpText:["handleLabelChange"],invalidText:["handleLabelChange"],label:["handleLabelChange"],multiple:["handleMultipleChange"],value:["handleValueChange"]}}static get style(){return".form-control .form-control-label{display:none}.form-control .form-control-help-text{display:none}.form-control .form-control-invalid-text{display:none}.form-control-has-label .form-control-label{display:flex;line-height:var(--gr-line-height-normal);color:var(--gr-form-element-label-color);margin-bottom:var(--gr-spacing-xxx-small)}.form-control-has-label.form-control-small .form-control-label{font-size:var(--gr-form-element-label-font-size-small)}.form-control-has-label.form-control-medium .form-control-label{font-size:var(--gr-form-element-label-font-size-medium)}.form-control-has-label.form-control-large .form-control-label{font-size:var(--gr-form-element-label-font-size-large)}.form-control-has-label .form-control-label .asterisk{margin-left:var(--gr-spacing-x-small);color:var(--gr-color-medium)}.form-control-has-label .form-control-label .asterisk svg{width:0.6em;height:0.6em;margin-bottom:var(--gr-spacing-xxx-small)}.form-control-has-help-text .form-control-help-text{display:block;line-height:var(--gr-line-height-normal);color:var(--gr-form-element-help-text-color);margin-top:var(--gr-spacing-xxx-small)}.form-control-has-help-text.form-control-small .form-control-help-text{font-size:var(--gr-form-element-help-text-font-size-small);min-height:1.625rem}.form-control-has-help-text.form-control-medium .form-control-help-text{font-size:var(--gr-form-element-help-text-font-size-medium);min-height:1.875rem}.form-control-has-help-text.form-control-large .form-control-help-text{font-size:var(--gr-form-element-help-text-font-size-large);min-height:2.125rem}.form-control-has-invalid-text .form-control-invalid-text{display:flex;margin-left:-2px;line-height:var(--gr-line-height-normal);color:var(--gr-form-element-invalid-text-color);margin-top:var(--gr-spacing-xxx-small)}.form-control-has-invalid-text .form-control-invalid-text .icon{margin-top:var(--gr-spacing-xxx-small);margin-right:var(--gr-spacing-xx-small)}.form-control-has-invalid-text .form-control-invalid-text .icon svg{width:1.4em;height:1.4em}.form-control-has-invalid-text.form-control-small .form-control-invalid-text{font-size:var(--gr-form-element-invalid-text-font-size-small);min-height:1.625rem}.form-control-has-invalid-text.form-control-medium .form-control-invalid-text{font-size:var(--gr-form-element-invalid-text-font-size-medium);min-height:1.875rem}.form-control-has-invalid-text.form-control-large .form-control-invalid-text{font-size:var(--gr-form-element-invalid-text-font-size-large);min-height:2.125rem}.gr-scroll-lock{overflow:hidden !important}:host{--font-size:var(--gr-form-element-font-size-medium);--font-weight:var(--gr-font-weight-normal);--background-color:var(--gr-color-white);--background-color-hover:var(--gr-color-white);--background-color-focus:var(--gr-color-white);--background-color-invalid:var(--gr-color-white);--background-color-invalid-hover:var(--gr-color-white);--border-radius:var(--gr-form-element-border-radius-small);--border-color:var(--gr-color-light-shade);--border-color-hover:var(--gr-color-medium);--border-color-focus:var(--gr-color-primary);--border-color-invalid:var(--gr-color-danger);--border-color-invalid-hover:var(--gr-color-danger-shade);--color:var(--gr-color-dark-tint);--placeholder-color:var(--gr-color-medium-tint);--min-height:var(--gr-form-element-height-medium);--label-margin-start:var(--gr-spacing-medium);--label-margin-end:var(--gr-spacing-medium);--clear-icon-margin-end:var(--gr-spacing-medium);--caret-margin-end:var(--gr-spacing-medium);--tags-padding-top:3px;--tags-padding-bottom:3px;--tags-margin-end:var(--gr-spacing-xx-small);--focus-ring:0 0 0 var(--gr-focus-ring-width) rgb(var(--gr-color-primary-rgb), 0.33);display:block;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.select-small{--font-size:var(--gr-form-element-font-size-small);--min-height:var(--gr-form-element-height-small);--label-margin-start:var(--gr-spacing-small);--label-margin-end:var(--gr-spacing-small);--clear-icon-margin-end:var(--gr-spacing-small);--caret-margin-end:var(--gr-spacing-small);--tags-padding-top:2px;--tags-padding-bottom:2px}.select-large{--font-size:var(--gr-form-element-font-size-large);--min-height:var(--gr-form-element-height-large);--label-margin-start:var(--gr-spacing-large);--label-margin-end:var(--gr-spacing-large);--clear-icon-margin-end:var(--gr-spacing-large);--caret-margin-end:var(--gr-spacing-large);--tags-padding-top:4px;--tags-padding-bottom:4px}.select{display:block}.select-box{display:inline-flex;align-items:center;justify-content:start;position:relative;width:100%;font-family:var(--gr-font-family);font-size:var(--font-size);font-weight:var(--font-weight);letter-spacing:normal;background-color:var(--background-color);border:solid 1px var(--border-color);border-radius:var(--border-radius);min-height:var(--min-height);color:var(--color);vertical-align:middle;overflow:hidden;transition:150ms color, 150ms border, 150ms box-shadow;cursor:pointer}.select.select-invalid:not(.select-disabled) .select-box{background-color:var(--background-color-invalid);border-color:var(--border-color-invalid)}.select.select-invalid:not(.select-disabled):not(.select-focused) .select-box:hover{background-color:var(--background-color-invalid-hover);border-color:var(--border-color-invalid-hover)}.select.select-invalid:not(.select-disabled) .select-box{background-color:var(--background-color-invalid);border-color:var(--border-color-invalid)}.select:not(.select-disabled) .select-box:hover{background-color:var(--background-color-hover);border-color:var(--border-color-hover)}.select.select-focused:not(.select-disabled) .select-box{outline:none;box-shadow:var(--focus-ring);border-color:var(--border-color-focus);background-color:var(--background-color-focus)}.select-disabled .select-box{opacity:0.5;cursor:not-allowed;outline:none}.select-disabled .select-tags,.select-disabled .select-clear{pointer-events:none}.select-label{flex:1 1 auto;display:flex;align-items:center;user-select:none;margin-top:0;margin-left:var(--label-margin-start);margin-right:var(--label-margin-end);margin-bottom:0;scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden;white-space:nowrap}.select-label::-webkit-scrollbar{width:0;height:0}.select-has-tags .select-label{margin-left:0}.select-clear{display:inline-flex;align-items:center;font-size:inherit;color:var(--gr-color-medium);border:none;background:none;padding:0;transition:150ms color;cursor:pointer;margin-right:var(--clear-icon-margin-end)}.select-clear:hover{color:var(--gr-color-dark)}.select-clear:focus{outline:none}.select-clear svg{width:1.2em;height:1.2em;font-size:var(--font-size)}.caret{flex:0 0 auto;display:inline-flex;transition:250ms transform ease;margin-right:var(--caret-margin-end)}.caret svg{width:1em;height:1em;font-size:var(--font-size)}.select-open .caret{transform:rotate(-180deg)}.select-placeholder-visible .select-label{color:var(--placeholder-color)}.select-tags{display:inline-flex;align-items:center;flex-wrap:wrap;justify-content:left;margin-left:var(--gr-spacing-xx-small);padding-bottom:var(--tags-padding-bottom)}.select-tags gr-tag{padding-top:var(--tags-padding-top)}.select-tags gr-tag:not(:last-of-type){margin-right:var(--tags-margin-end)}.select-hidden-select{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px;position:absolute;top:0;left:0;width:100%;height:100%}.select-pill .select-box{border-radius:var(--min-height)}"}},[1,"gr-select",{multiple:[4],maxTagsVisible:[2,"max-tags-visible"],disabled:[4],name:[1],placeholder:[1],size:[1],hoist:[4],value:[1025],pill:[4],label:[1],requiredIndicator:[4,"required-indicator"],helpText:[1,"help-text"],invalidText:[1,"invalid-text"],invalid:[516],clearable:[4],hasFocus:[32],hasHelpTextSlot:[32],hasInvalidTextSlot:[32],hasLabelSlot:[32],isOpen:[32],items:[32],displayLabel:[32],displayTags:[32],setFocus:[64]}]),ni=e=>{if(null!=e)return Array.isArray(e)?e.join(","):e.toString()};!function(){if("undefined"==typeof customElements)return;["gr-select","gr-button","gr-dropdown","gr-menu","gr-spinner","gr-tag"].forEach((e=>{switch(e){case"gr-select":customElements.get(e)||customElements.define(e,oi);break;case"gr-button":customElements.get(e)||St();break;case"gr-dropdown":customElements.get(e)||Xr();break;case"gr-menu":customElements.get(e)||Jr();break;case"gr-spinner":customElements.get(e)||Et();break;case"gr-tag":customElements.get(e)||ti()}}))}();const ai=oi,si=Ge(class extends dt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.hasFocus=!1,this.checked=!1,this.value="",this.disabled=!1}connectedCallback(){this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this)}async setFocus(e){this.el.focus(e)}async removeFocus(){this.el.blur()}handleBlur(){this.hasFocus=!1}handleFocus(){this.hasFocus=!0}handleMouseEnter(){this.setFocus()}handleMouseLeave(){this.removeFocus()}render(){return de(ge,{class:{"menu-item-checked":this.checked,"menu-item-disabled":this.disabled,"menu-item-focused":this.hasFocus},role:"menuitem","aria-disabled":this.disabled?"true":"false","aria-checked":this.checked?"true":"false",tabIndex:this.disabled?null:0,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},de("span",{class:"checkmark"},de("svg",{role:"img","aria-hidden":"true",viewBox:"0 0 512 512"},de("title",null,"Checkmark"),de("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"}))),de("span",{class:"start"},de("slot",{name:"start"})),de("span",{class:"label"},de("slot",null)),de("span",{class:"end"},de("slot",{name:"end"})))}get el(){return this}static get style(){return".gr-scroll-lock{overflow:hidden !important}:host{--line-height:var(--gr-line-height-normal);--background-color:transparent;--background-color-focused:var(--gr-color-primary);--color:var(--gr-color-dark);--color-focused:var(--gr-color-primary-contrast);--color-disabled:var(--gr-color-medium);--padding-top:var(--gr-spacing-xx-small);--padding-start:var(--gr-spacing-x-large);--padding-end:var(--gr-spacing-x-large);--padding-bottom:var(--gr-spacing-xx-small);--transition:background-color 150ms linear, color 150ms linear;position:relative;display:flex;align-items:stretch;font-family:var(--gr-font-family);font-size:var(--gr-font-size-medium);font-weight:var(--gr-font-weight-normal);line-height:var(--line-height);letter-spacing:var(--gr-letter-spacing-normal);text-align:left;background-color:var(--background-color);color:var(--color);padding-top:var(--padding-top);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-bottom:var(--padding-bottom);transition:var(--transition);user-select:none;white-space:nowrap;cursor:pointer;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host(.menu-item-focused:not(.menu-item-disabled)){outline:none;background-color:var(--background-color-focused);color:var(--color-focused)}:host(.menu-item-disabled){outline:none;color:var(--color-disabled);cursor:not-allowed}.checkmark{display:flex;position:absolute;left:0.5em;top:calc(50% - 0.5em);visibility:hidden;align-items:center;font-size:inherit}.checkmark svg{display:inline-block;width:1.1em;height:1.1em;contain:strict;fill:currentcolor;box-sizing:content-box !important}:host(.menu-item-checked) .checkmark{visibility:visible}.label{flex:1 1 auto}.start{flex:0 0 auto;display:flex;align-items:center}.start ::slotted(:last-child){margin-right:0.5em}.end{flex:0 0 auto;display:flex;align-items:center}.end ::slotted(:first-child){margin-left:0.5em}"}},[1,"gr-menu-item",{checked:[516],value:[513],disabled:[516],hasFocus:[32],setFocus:[64],removeFocus:[64]}]); +/*! + * (C) PAQT.com B.V. https://paqt.com - MIT License + */!function(){if("undefined"==typeof customElements)return;["gr-menu-item"].forEach((e=>{if("gr-menu-item"===e)customElements.get(e)||customElements.define(e,si)}))}();const li={"gr-select":ai,"gr-menu-item":si};class ci extends(q(_)){constructor(){super(...arguments),this.value=null,this.multiple=!1,this.clearable=!1,this._refSelect=y()}reset(){this.value=null}_valueChangedHandler(e){const t=this._refSelect.value?.value;if(void 0!==t&&!l(this.value,t)){const e=null===this.value;this.value=t,e||w(this,"select:change",t)}}willUpdate(e){e.has("initialValue")&&this.initialValue&&!this.value&&(this.value=this.initialValue)}render(){return $` + ${this.options?.map((e=>$`${e.label}`))} + `}static get styles(){return k(':root, :host {\n --gr-color-primary: #1079b2;\n --gr-color-primary-rgb: 16, 121, 178;\n --gr-color-primary-contrast: #ffffff;\n --gr-color-primary-contrast-rgb: 255, 255, 255;\n --gr-color-primary-shade: #0d6696;\n --gr-color-primary-tint: #1499e1;\n --gr-color-secondary: #051f2c;\n --gr-color-secondary-rgb: 5, 31, 44;\n --gr-color-secondary-contrast: #ffffff;\n --gr-color-secondary-contrast-rgb: 255, 255, 255;\n --gr-color-secondary-shade: #000000;\n --gr-color-secondary-tint: #0a415c;\n --gr-color-tertiary: #0c4a6e;\n --gr-color-tertiary-rgb: 12, 74, 110;\n --gr-color-tertiary-contrast: #ffffff;\n --gr-color-tertiary-contrast-rgb: 255, 255, 255;\n --gr-color-tertiary-shade: #083249;\n --gr-color-tertiary-tint: #106393;\n --gr-color-success: #0fbe78;\n --gr-color-success-rgb: 15, 190, 120;\n --gr-color-success-contrast: #000000;\n --gr-color-success-contrast-rgb: 0, 0, 0;\n --gr-color-success-shade: #057f4e;\n --gr-color-success-tint: #12e28f;\n --gr-color-warning: #fbbc4e;\n --gr-color-warning-rgb: 251, 188, 78;\n --gr-color-warning-contrast: #051f2c;\n --gr-color-warning-contrast-rgb: 5, 31, 44;\n --gr-color-warning-shade: #9e6400;\n --gr-color-warning-tint: #fdd187;\n --gr-color-danger: #e60017;\n --gr-color-danger-rgb: 230, 0, 23;\n --gr-color-danger-contrast: #ffffff;\n --gr-color-danger-contrast-rgb: 255, 255, 255;\n --gr-color-danger-shade: #cc0014;\n --gr-color-danger-tint: #ff1f35;\n --gr-color-light: #f4f5f8;\n --gr-color-light-rgb: 244, 245, 248;\n --gr-color-light-contrast: #051f2c;\n --gr-color-light-contrast-rgb: 5, 31, 44;\n --gr-color-light-shade: #d7d8da;\n --gr-color-light-tint: #f9fafb;\n --gr-color-medium: #5e6c78;\n --gr-color-medium-rgb: 94, 108, 120;\n --gr-color-medium-contrast: #ffffff;\n --gr-color-medium-contrast-rgb: 255, 255, 255;\n --gr-color-medium-shade: #48535b;\n --gr-color-medium-tint: #81909c;\n --gr-color-dark: #02131b;\n --gr-color-dark-rgb: 2, 19, 27;\n --gr-color-dark-contrast: #ffffff;\n --gr-color-dark-contrast-rgb: 255, 255, 255;\n --gr-color-dark-shade: #000000;\n --gr-color-dark-tint: #222428;\n --gr-color-white: #ffffff;\n --gr-color-black: #000000;\n --gr-border-radius-small: 0.125rem;\n --gr-border-radius-medium: 0.25rem;\n --gr-border-radius-large: 0.5rem;\n --gr-border-radius-x-large: 1rem;\n --gr-border-width-small: 0.063rem;\n --gr-border-width-medium: 0.125rem;\n --gr-border-width-large: 0.188rem;\n --gr-shadow-x-small: 0 1px 0 #0d131e0d;\n --gr-shadow-small: 0 1px 2px #0d131e1a;\n --gr-shadow-medium: 0 2px 4px #0d131e1a;\n --gr-shadow-large: 0 2px 8px #0d131e1a;\n --gr-shadow-x-large: 0 4px 16px #0d131e1a;\n --gr-spacing-xxx-small: 0.125rem;\n --gr-spacing-xx-small: 0.25rem;\n --gr-spacing-x-small: 0.5rem;\n --gr-spacing-small: 0.75rem;\n --gr-spacing-medium: 1rem;\n --gr-spacing-large: 1.25rem;\n --gr-spacing-x-large: 1.75rem;\n --gr-spacing-xx-large: 2.25rem;\n --gr-spacing-xxx-large: 3rem;\n --gr-spacing-xxxx-large: 4.5rem;\n --gr-font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,\n sans-serif;\n --gr-letter-spacing-dense: -0.015em;\n --gr-letter-spacing-normal: normal;\n --gr-letter-spacing-loose: 0.075em;\n --gr-line-height-dense: 1.4;\n --gr-line-height-normal: 1.8;\n --gr-line-height-loose: 2.2;\n --gr-font-size-xx-small: 0.625rem;\n --gr-font-size-x-small: 0.75rem;\n --gr-font-size-small: 0.875rem;\n --gr-font-size-medium: 1rem;\n --gr-font-size-large: 1.25rem;\n --gr-font-size-x-large: 1.5rem;\n --gr-font-size-xx-large: 2.25rem;\n --gr-font-size-xxx-large: 3rem;\n --gr-font-size-xxxx-large: 4.5rem;\n --gr-font-weight-thin: 100;\n --gr-font-weight-extra-light: 200;\n --gr-font-weight-light: 300;\n --gr-font-weight-normal: 400;\n --gr-font-weight-medium: 500;\n --gr-font-weight-semi-bold: 600;\n --gr-font-weight-bold: 700;\n --gr-font-weight-extra-bold: 800;\n --gr-font-weight-black: 900;\n --gr-form-element-font-size-x-small: var(--gr-font-size-x-small);\n --gr-form-element-font-size-small: var(--gr-font-size-small);\n --gr-form-element-font-size-medium: var(--gr-font-size-medium);\n --gr-form-element-font-size-large: var(--gr-font-size-large);\n --gr-form-element-height-small: 2.188rem;\n --gr-form-element-height-medium: 3.125rem;\n --gr-form-element-height-large: 4.063rem;\n --gr-form-element-border-radius-small: var(--gr-border-radius-medium);\n --gr-form-element-border-radius-medium: var(--gr-border-radius-medium);\n --gr-form-element-border-radius-large: var(--gr-border-radius-medium);\n --gr-focus-ring-width: 2px;\n --gr-form-element-label-font-size-small: var(--gr-font-size-small);\n --gr-form-element-label-font-size-medium: var(--gr-font-size-medium);\n --gr-form-element-label-font-size-large: var(--gr-font-size-large);\n --gr-form-element-label-color: inherit;\n --gr-form-element-help-text-font-size-small: var(--gr-font-size-x-small);\n --gr-form-element-help-text-font-size-medium: var(--gr-font-size-small);\n --gr-form-element-help-text-font-size-large: var(--gr-font-size-medium);\n --gr-form-element-help-text-color: var(--gr-color-medium);\n --gr-form-element-invalid-text-font-size-small: var(--gr-font-size-x-small);\n --gr-form-element-invalid-text-font-size-medium: var(--gr-font-size-small);\n --gr-form-element-invalid-text-font-size-large: var(--gr-font-size-medium);\n --gr-form-element-invalid-text-color: var(--gr-color-danger);\n --gr-toggle-size: 1rem;\n --gr-panel-border-color: var(--gr-color-light-shade);\n --gr-z-index-dropdown: 900;\n}\n\n')}}ci.elementDefinitions={...li},f([v({attribute:!1,hasChanged:b})],ci.prototype,"options",void 0),f([v({attribute:!1,hasChanged:b})],ci.prototype,"value",void 0),f([v({attribute:!1,hasChanged:b})],ci.prototype,"initialValue",void 0),f([v({attribute:!0})],ci.prototype,"label",void 0),f([v({attribute:!0})],ci.prototype,"placeholder",void 0),f([v({attribute:!0,type:Boolean})],ci.prototype,"multiple",void 0),f([v({attribute:!0,type:Boolean})],ci.prototype,"clearable",void 0);let di=class extends(q(_)){constructor(){super(...arguments),this._mediaFilterController=new U(this),this._refMediaType=y(),this._refCamera=y(),this._refWhen=y(),this._refWhenFrom=y(),this._refWhenTo=y(),this._refWhat=y(),this._refWhere=y(),this._refFavorite=y(),this._refTags=y()}willUpdate(e){e.has("viewManagerEpoch")&&this._mediaFilterController.setViewManager(this.viewManagerEpoch?.manager??null),e.has("cameraManager")&&this.cameraManager&&(this._mediaFilterController.computeCameraOptions(this.cameraManager),this._mediaFilterController.computeMetadataOptions(this.cameraManager)),!e.get("viewManager")&&this.viewManagerEpoch&&this.cameraManager&&this._mediaFilterController.computeInitialDefaultsFromView(this.cameraManager)}render(){const e=async()=>{this.cameraManager&&this.viewManagerEpoch&&this.cardWideConfig&&await this._mediaFilterController.valueChangeHandler(this.cameraManager,this.cardWideConfig,{camera:this._refCamera.value?.value??void 0,mediaType:this._refMediaType.value?.value??void 0,when:{selected:this._refWhen.value?.value??void 0,from:this._refWhenFrom.value?.value,to:this._refWhenTo.value?.value},favorite:this._refFavorite.value?.value??void 0,where:this._refWhere.value?.value??void 0,what:this._refWhat.value?.value??void 0,tags:this._refTags.value?.value??void 0})},t=async t=>{"custom"===t&&this._refWhen.value?this._refWhenFrom.value?.value||this._refWhenTo.value?.value?this._refWhen.value.value=B.Custom:this._refWhen.value.reset():this._refWhen.value?.value!==B.Custom&&(this._refWhenFrom.value?.reset(),this._refWhenTo.value?.reset()),await e()};if(!this.cameraManager||!this.viewManagerEpoch)return;const r=this._mediaFilterController.getControlsToShow(this.cameraManager),o=this._mediaFilterController.getDefaults(),n=this._mediaFilterController.getWhatOptions(),a=this._mediaFilterController.getTagsOptions(),s=this._mediaFilterController.getWhereOptions();return $` e()} + > + +
+ t("selected")} + > + + t("custom")} + > + + t("custom")} + > + +
+ e()} + > + + ${r.events&&n.length?$` e()} + > + `:""} + ${r.events&&a.length?$` e()} + > + `:""} + ${r.events&&s.length?$` e()} + > + `:""} + ${r.favorites?$` + e()} + > + + `:""}`}static get styles(){return k(":host {\n display: flex;\n flex-direction: column;\n overflow: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n height: 100%;\n width: 300px;\n margin: 5px;\n}\n\n/* Hide scrollbar for Chrome, Safari and Opera */\n:host::-webkit-scrollbar {\n display: none;\n}\n\nfrigate-card-select {\n padding: 5px;\n}\n\ndiv.when {\n display: inline-flex;\n align-items: flex-end;\n}\n\ndiv.when frigate-card-select {\n flex: 1;\n}\n\ndiv.when frigate-card-date-picker {\n padding-bottom: 5px;\n transition: width 0.5s ease-in-out;\n}\n\ndiv.when frigate-card-date-picker {\n color: var(--secondary-color);\n}\n\ndiv.when frigate-card-date-picker.selected {\n color: var(--primary-color);\n}\n\ndiv.when frigate-card-date-picker.hidden {\n width: 0px;\n}")}};di.elementDefinitions={"frigate-card-select":ci,"frigate-card-date-picker":R},f([v({attribute:!1})],di.prototype,"hass",void 0),f([v({attribute:!1})],di.prototype,"cameraManager",void 0),f([v({attribute:!1})],di.prototype,"viewManagerEpoch",void 0),f([v({attribute:!1})],di.prototype,"cardWideConfig",void 0),di=f([C("frigate-card-media-filter")],di);const hi={closed:"mdi:filter-cog-outline",open:"mdi:filter-cog"};let gi=class extends _{render(){const e=this.viewManagerEpoch?.manager.getView();if(this.hass&&e?.isGalleryView()&&this.cameraManager&&this.cardWideConfig)return $` + + ${this.galleryConfig&&"none"!==this.galleryConfig.controls.filter.mode?$` + `:""} + + + + `}static get styles(){return k(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\nfrigate-card-surround-basic {\n max-height: 110dvh;\n}")}};f([v({attribute:!1})],gi.prototype,"hass",void 0),f([v({attribute:!1})],gi.prototype,"viewManagerEpoch",void 0),f([v({attribute:!1})],gi.prototype,"galleryConfig",void 0),f([v({attribute:!1})],gi.prototype,"cameraManager",void 0),f([v({attribute:!1})],gi.prototype,"cardWideConfig",void 0),gi=f([C("frigate-card-gallery")],gi);let ui=class extends _{constructor(){super(),this._refLoaderBottom=y(),this._refSelected=y(),this._showLoaderBottom=!0,this._showLoaderTop=!1,this._boundWheelHandler=this._wheelHandler.bind(this),this._boundTouchStartHandler=this._touchStartHandler.bind(this),this._boundTouchEndHandler=this._touchEndHandler.bind(this),this._throttleExtendGalleryLater=O(this._extendGallery.bind(this),500,{leading:!0,trailing:!1}),this._touchScrollYPosition=null,this._resizeObserver=new ResizeObserver(this._resizeHandler.bind(this)),this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this))}_touchStartHandler(e){1===e.touches.length?this._touchScrollYPosition=e.touches[0].screenY:this._touchScrollYPosition=null}async _touchEndHandler(e){!this.scrollTop&&1===e.changedTouches.length&&this._touchScrollYPosition&&e.changedTouches[0].screenY>this._touchScrollYPosition&&await this._extendLater(),this._touchScrollYPosition=null}async _wheelHandler(e){!this.scrollTop&&e.deltaY<0&&await this._extendLater()}async _extendLater(){const e=new Date;this._showLoaderTop=!0,await this._throttleExtendGalleryLater("later",!1);const t=(new Date).getTime()-e.getTime();t<500&&await S(.5-t/1e3),this._showLoaderTop=!1}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.addEventListener("wheel",this._boundWheelHandler,{passive:!0}),this.addEventListener("touchstart",this._boundTouchStartHandler,{passive:!0}),this.addEventListener("touchend",this._boundTouchEndHandler),this.requestUpdate()}disconnectedCallback(){this.removeEventListener("wheel",this._boundWheelHandler),this.removeEventListener("touchstart",this._boundTouchStartHandler),this.removeEventListener("touchend",this._boundTouchEndHandler),this._resizeObserver.disconnect(),this._intersectionObserver.disconnect(),super.disconnectedCallback()}_setColumnCount(){const e=this.galleryConfig?.controls.thumbnails.size??M.media_gallery.controls.thumbnails.size,t=this.galleryConfig?.controls.thumbnails.show_details?Math.max(1,Math.floor(this.clientWidth/z)):Math.max(1,Math.ceil(this.clientWidth/e));this.style.setProperty("--frigate-card-gallery-columns",String(t))}_resizeHandler(){this._setColumnCount()}async _intersectionHandler(e){e.every((e=>!e.isIntersecting))||(this._showLoaderBottom=!1,await this._extendGallery("earlier"))}async _extendGallery(e,t=!0){const r=this.viewManagerEpoch?.manager.getView();if(!this.cameraManager||!this.hass||!r)return;const i=r.query,n=i?.getQueries()??null,s=r.queryResults?.getResults();if(!i||!n||!s)return;let l;try{l=await this.cameraManager.extendMediaQueries(n,s,e,{useCache:t})}catch(e){return void d(e)}if(l){const e=c.areEventQueries(i)?new o(l.queries):c.areRecordingQueries(i)?new a(l.queries):null;e&&this.viewManagerEpoch?.manager.setViewByParameters({baseView:r,params:{query:e,queryResults:new L({results:l.results}).selectResultIfFound((e=>e===r.queryResults?.getSelectedResult()))}})}}willUpdate(e){if(e.has("galleryConfig")&&(this.galleryConfig?.controls.thumbnails.show_details?this.setAttribute("details",""):this.removeAttribute("details"),this._setColumnCount(),this.galleryConfig?.controls.thumbnails.size&&this.style.setProperty("--frigate-card-thumbnail-size",`${this.galleryConfig.controls.thumbnails.size}px`)),e.has("viewManagerEpoch")){this._showLoaderBottom=!0;const e=this.viewManagerEpoch?.manager.getView(),t=this.viewManagerEpoch?.oldView;this._media&&t?.queryResults?.getResults()===e?.queryResults?.getResults()||(this._media=[...e?.queryResults?.getResults()??[]].reverse())}}render(){if(!this._media||!this.hass)return $``;const e=this.viewManagerEpoch?.manager.getView();if(!e?.queryResults||0===e.queryResults.getResultsCount()){const t=!!e?.context?.loading?.query;return D({type:"info",message:i(t?"error.awaiting_media":"common.no_media"),icon:"mdi:multimedia",dotdotdot:t})}const t=e.queryResults.getSelectedResult();return $`
+ ${this._showLoaderTop?$`${A({cardWideConfig:this.cardWideConfig,classes:{top:!0},size:"small"})}`:""} + ${this._media.map(((r,i)=>$`{this._media&&this.viewManagerEpoch?.manager.setViewByParameters({params:{view:"media",queryResults:e.queryResults?.clone().selectIndex(this._media.length-i-1)}}),F(t)}} + > + `))} + ${this._showLoaderBottom?$`${A({cardWideConfig:this.cardWideConfig,componentRef:this._refLoaderBottom})}`:""} +
`}updated(e){this._refLoaderBottom.value&&(this._intersectionObserver.disconnect(),this._intersectionObserver.observe(this._refLoaderBottom.value)),this.updateComplete.then((()=>{e.has("viewManagerEpoch")&&!e.get("viewManagerEpoch")&&this._refSelected.value&&this._refSelected.value.scrollIntoView({block:"center"})}))}static get styles(){return k(":host {\n width: 100%;\n height: 100%;\n display: block;\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n --frigate-card-gallery-gap: 3px;\n --frigate-card-gallery-columns: 4;\n}\n\n.grid {\n display: grid;\n grid-template-columns: repeat(var(--frigate-card-gallery-columns), minmax(0, 1fr));\n grid-auto-rows: min-content;\n gap: var(--frigate-card-gallery-gap);\n}\n\n:host::-webkit-scrollbar {\n display: none;\n}\n\nfrigate-card-thumbnail {\n height: 100%;\n max-height: var(--frigate-card-thumbnail-size);\n}\n\nfrigate-card-thumbnail:not([details]) {\n width: 100%;\n}\n\nfrigate-card-thumbnail.selected {\n border: 4px solid var(--accent-color);\n border-radius: calc(var(--frigate-card-css-border-radius, var(--ha-card-border-radius, 4px)) + 4px);\n}\n\nfrigate-card-progress-indicator.top {\n grid-column: 1/-1;\n}")}};f([v({attribute:!1})],ui.prototype,"hass",void 0),f([v({attribute:!1})],ui.prototype,"viewManagerEpoch",void 0),f([v({attribute:!1})],ui.prototype,"galleryConfig",void 0),f([v({attribute:!1})],ui.prototype,"cameraManager",void 0),f([v({attribute:!1})],ui.prototype,"cardWideConfig",void 0),f([E()],ui.prototype,"_showLoaderBottom",void 0),f([E()],ui.prototype,"_showLoaderTop",void 0),ui=f([C("frigate-card-gallery-core")],ui);export{gi as FrigateCardGallery,ui as FrigateCardGalleryCore}; diff --git a/config/www/community/frigate-hass-card/gallery-f478918c.js.gz b/config/www/community/frigate-hass-card/gallery-f478918c.js.gz new file mode 100644 index 00000000..3b44cfdb Binary files /dev/null and b/config/www/community/frigate-hass-card/gallery-f478918c.js.gz differ diff --git a/config/www/community/frigate-hass-card/get-technology-for-video-rtc-778a0c05.js.gz b/config/www/community/frigate-hass-card/get-technology-for-video-rtc-778a0c05.js.gz index 172bdaaa..51fc9c7a 100644 Binary files a/config/www/community/frigate-hass-card/get-technology-for-video-rtc-778a0c05.js.gz and b/config/www/community/frigate-hass-card/get-technology-for-video-rtc-778a0c05.js.gz differ diff --git a/config/www/community/frigate-hass-card/ha-45d9145a.js b/config/www/community/frigate-hass-card/ha-45d9145a.js new file mode 100644 index 00000000..68475589 --- /dev/null +++ b/config/www/community/frigate-hass-card/ha-45d9145a.js @@ -0,0 +1,68 @@ +import{dh as e,cO as t,x as s,cY as a,ds as i,dt as r,du as o,dr as d,r as h,eE as n,_ as l,t as c,eH as p,eI as u,cK as y,a as m,cL as _,cP as f,n as v}from"./card-e5d55e5b.js";import{c as g,e as $}from"./ha-hls-player-1787796f.js";import{s as b,d as w,h as L,c as R}from"./media-921a03ae.js";import{m as I}from"./audio-cf3a75aa.js";customElements.whenDefined("ha-web-rtc-player").then((()=>{let p=class extends(customElements.get("ha-web-rtc-player")){async play(){return this._video?.play()}async pause(){this._video?.pause()}async mute(){this._video&&(this._video.muted=!0)}async unmute(){this._video&&(this._video.muted=!1)}isMuted(){return this._video?.muted??!0}async seek(e){this._video&&(this._video.currentTime=e)}async setControls(e){this._video&&b(this._video,e??this.controls)}isPaused(){return this._video?.paused??!0}async getScreenshotURL(){return this._video?e(this._video):null}render(){return this._error?(w(this),t({type:"error",message:this._error,context:{entity_id:this.entityid}})):s` + + `}_loadedDataHandler(e){super._loadedData(),d(this,e,{player:this,capabilities:{supportsPause:!0,hasAudio:I(this._video)},technology:["webrtc"]})}static get styles(){return[super.styles,h(g),n` + :host { + width: 100%; + height: 100%; + } + video { + width: 100%; + height: 100%; + } + `]}};l([$("#remote-stream")],p.prototype,"_video",void 0),p=l([c("frigate-card-ha-web-rtc-player")],p)})),customElements.whenDefined("ha-camera-stream").then((()=>{const e="web_rtc",t="mjpeg";let a=class extends(customElements.get("ha-camera-stream")){constructor(){super(...arguments),this._mediaLoadedInfoPerStream={},this._mediaLoadedInfoDispatched=null}async play(){return this._player?.play()}async pause(){this._player?.pause()}async mute(){this._player?.mute()}async unmute(){this._player?.unmute()}isMuted(){return this._player?.isMuted()??!0}async seek(e){this._player?.seek(e)}async setControls(e){this._player&&this._player.setControls(e??this.controls)}isPaused(){return this._player?.isPaused()??!0}async getScreenshotURL(){return this._player?await this._player.getScreenshotURL():null}_storeMediaLoadedInfoHandler(e,t){this._storeMediaLoadedInfo(e,t.detail),t.stopPropagation()}_storeMediaLoadedInfo(e,t){this._mediaLoadedInfoPerStream[e]=t,this.requestUpdate()}_renderStream(a){return this.stateObj?a.type===t?s` + this._storeMediaLoadedInfo(t,u(e,{player:this,technology:["mjpeg"]}))} + .src=${void 0===this._connected||this._connected?(i=this.stateObj,`/api/camera_proxy_stream/${i.entity_id}?token=${i.attributes.access_token}`):this._posterUrl||""} + /> + `:"hls"===a.type?s` this._storeMediaLoadedInfoHandler("hls",e)} + @streams=${this._handleHlsStreams} + class="player ${a.visible?"":"hidden"}" + >`:a.type===e?s`this._storeMediaLoadedInfoHandler(e,t)} + @streams=${this._handleWebRtcStreams} + class="player ${a.visible?"":"hidden"}" + >`:p:p;var i}updated(e){super.updated(e);const t=this._streams(this._capabilities?.frontend_stream_types,this._hlsStreams,this._webRtcStreams).find((e=>e.visible))??null;if(t){const e=this._mediaLoadedInfoPerStream[t.type];e&&e!==this._mediaLoadedInfoDispatched&&(this._mediaLoadedInfoDispatched=e,y(this,e))}}static get styles(){return[super.styles,h(g),n` + :host { + width: 100%; + height: 100%; + } + img { + width: 100%; + height: 100%; + } + `]}};l([$(".player:not(.hidden)")],a.prototype,"_player",void 0),a=l([c("frigate-card-ha-camera-stream")],a)}));let P=class extends m{constructor(){super(...arguments),this.controls=!1,this._playerRef=_()}async play(){return this._playerRef.value?.play()}async pause(){this._playerRef.value?.pause()}async mute(){this._playerRef.value?.mute()}async unmute(){this._playerRef.value?.unmute()}isMuted(){return this._playerRef.value?.isMuted()??!0}async seek(e){this._playerRef.value?.seek(e)}async setControls(e){this._playerRef.value?.setControls(e??this.controls)}isPaused(){return this._playerRef.value?.isPaused()??!0}async getScreenshotURL(){return await(this._playerRef.value?.getScreenshotURL())??null}render(){if(this.hass)return s` + `}static get styles(){return h(":host {\n width: 100%;\n height: 100%;\n display: block;\n}")}};l([v({attribute:!1})],P.prototype,"hass",void 0),l([v({attribute:!1})],P.prototype,"cameraConfig",void 0),l([v({attribute:!0,type:Boolean})],P.prototype,"controls",void 0),P=l([c("frigate-card-live-ha")],P);export{P as FrigateCardLiveHA}; diff --git a/config/www/community/frigate-hass-card/ha-45d9145a.js.gz b/config/www/community/frigate-hass-card/ha-45d9145a.js.gz new file mode 100644 index 00000000..2cd9d2b4 Binary files /dev/null and b/config/www/community/frigate-hass-card/ha-45d9145a.js.gz differ diff --git a/config/www/community/frigate-hass-card/ha-hls-player-1787796f.js b/config/www/community/frigate-hass-card/ha-hls-player-1787796f.js new file mode 100644 index 00000000..09309062 --- /dev/null +++ b/config/www/community/frigate-hass-card/ha-hls-player-1787796f.js @@ -0,0 +1,34 @@ +import{dh as t,cO as e,d6 as i,x as s,ds as a,dt as o,du as r,dr as d,r as n,eE as h,_ as l,t as u}from"./card-e5d55e5b.js";import{h as c,s as v,d as y,c as p}from"./media-921a03ae.js";import{m}from"./audio-cf3a75aa.js"; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const _=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;function f(t,e){return(i,s,a)=>{const o=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof s?i:a??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return _(i,s,{get(){let i=t.call(this);return void 0===i&&(i=o(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return _(i,s,{get(){return o(this)}})}}var g="img,\nvideo {\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n object-view-box: inset(var(--frigate-card-media-layout-view-box-top, 0%) var(--frigate-card-media-layout-view-box-right, 0%) var(--frigate-card-media-layout-view-box-bottom, 0%) var(--frigate-card-media-layout-view-box-left, 0%));\n}";customElements.whenDefined("ha-hls-player").then((()=>{let _=class extends(customElements.get("ha-hls-player")){async play(){return this._video?.play()}async pause(){this._video?.pause()}async mute(){this._video&&(this._video.muted=!0)}async unmute(){this._video&&(this._video.muted=!1)}isMuted(){return this._video?.muted??!0}async seek(t){this._video&&(c(this._video),this._video.currentTime=t)}async setControls(t){this._video&&v(this._video,t??this.controls)}isPaused(){return this._video?.paused??!0}async getScreenshotURL(){return this._video?t(this._video):null}render(){if(this._error){if(this._errorIsFatal)return y(this),e({type:"error",message:this._error,context:{entity_id:this.entityid}});i(this._error,console.error)}return s` + + `}_loadedDataHandler(t){super._loadedData(),d(this,t,{player:this,capabilities:{supportsPause:!0,hasAudio:m(this._video)},technology:["hls"]})}static get styles(){return[super.styles,n(g),h` + :host { + width: 100%; + height: 100%; + } + video { + width: 100%; + height: 100%; + } + `]}};l([f("#video")],_.prototype,"_video",void 0),_=l([u("frigate-card-ha-hls-player")],_)}));export{g as c,f as e}; diff --git a/config/www/community/frigate-hass-card/ha-hls-player-1787796f.js.gz b/config/www/community/frigate-hass-card/ha-hls-player-1787796f.js.gz new file mode 100644 index 00000000..6ff649ac Binary files /dev/null and b/config/www/community/frigate-hass-card/ha-hls-player-1787796f.js.gz differ diff --git a/config/www/community/frigate-hass-card/image-04d4df35.js b/config/www/community/frigate-hass-card/image-04d4df35.js new file mode 100644 index 00000000..2613a125 --- /dev/null +++ b/config/www/community/frigate-hass-card/image-04d4df35.js @@ -0,0 +1,13 @@ +import{dw as A,dx as e,eK as t,eL as i,dy as a,eH as r,eM as g,dz as s,_ as o,n as c,cQ as h,b as C,t as l,a as I,cL as n,eN as E,dt as u,du as m,cO as w,x as Q,cP as M,eI as B,i as d,cK as b,l as L,r as D}from"./card-e5d55e5b.js"; +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const p=A(class extends e{constructor(A){if(super(A),A.type!==t.PROPERTY&&A.type!==t.ATTRIBUTE&&A.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!i(A))throw Error("`live` bindings can only contain a single expression")}render(A){return A}update(A,[e]){if(e===a||e===r)return e;const i=A.element,s=A.name;if(A.type===t.PROPERTY){if(e===i[s])return a}else if(A.type===t.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(s))return a}else if(A.type===t.ATTRIBUTE&&i.getAttribute(s)===e+"")return a;return g(A),e}});class k{constructor(A,e,t,i,a){this._timer=new s,this._timerSeconds=e,this._callback=t,this._timerStartCallback=i,this._timerStopCallback=a,(this._host=A).addController(this)}removeController(){this.stopTimer(),this._host.removeController(this)}get value(){return this._value}updateValue(){this._value=this._callback()}clearValue(){this._value=void 0}stopTimer(){this._timer.isRunning()&&(this._timer.stop(),this._timerStopCallback?.())}startTimer(){this.stopTimer(),this._timerStartCallback?.(),this._timer.startRepeated(this._timerSeconds,(()=>{this.updateValue(),this._host.requestUpdate()}))}hasTimer(){return this._timer.isRunning()}hostConnected(){this.updateValue(),this.startTimer(),this._host.requestUpdate()}hostDisconnected(){this.clearValue(),this.stopTimer()}}var U="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wgARCAEVAewDAREAAhEBAxEB/8QAGwAAAwEAAwEAAAAAAAAAAAAAAAECAwQFBgf/xAAaAQEBAQEBAQEAAAAAAAAAAAAAAQIDBAUG/9oADAMBAAIQAxAAAAHu/wBF+fKuKWoua2zblcOpTDeJqLJsVgAACCiNQEKJRCmEoMAhy1FzThq4VrCHDWbHCoilBWQKqzaa2xeTz3Uumd+Z+h4Sxy0VGmdbzV5AybMdZjUz1kEFA4AAEAAdEFAAEVKBDVxc1UtSgiaY1cSI4nPfl/N6eZrHp/Rw11mLJq83XO9c2ovO+Ry6ea+j4FY1uKl1zrSAAIucd5mlYUoBggA1ACiRiVgiCiW81w6JQqWpazQVTQCo6fz9vH+L2ec83o937PJ7P6HgsBAaZ1vjemdJNcb5HLr536PgACrioqFU2RZFkWLcAgAAokdoEhRKwgoHCCgrKpWrlQ1ctQpVU0jovN38P4fZ1HDta+y9HD3f1Pm2jEBrm78+muNXNVnW2N6Z15z6fz7zWSlDEkVnrMWKyaVgOCkA6AkBipwKBDhgIa1AC3KoaiuJtmPP+b0eM8Ps6Pl01lprsenL6V9T5vadMUJEa41y+XXXGqmrzrTOrzamvNfU+brnThgRrOdk2Z6yqSKxBTAQAgojBBRQAHDhhDViRLc1cpKhV5rzd/nnz/dw+PbkIqheXrH036nz+578LipVY42xvl8u14uk1pjeuNXNB5f6vzNc6uERc56znokjUEBBYAFACGAIAAAAKDyoqaEJRWVNOOn5dfnXz/b5rz9he1zutRGtfSvo/O731+aoYwjTOuRz6b893nW2N6Z3ebpnTXyf1/laZ0xM5azGpFioQAVgCiAAKmgAAoCAhgpDHLctZoNUvh/H6vnfzvfjHJl56taNNT6L9L5voPT59s1UAVLti8nl2rN1zrbn00zq860zoPJ/Y+SDM7nPUmxWIBiQoAKABAAAAAFEQ1BIBFTV5uktTXnOXX4/8n6euNbnYzWVjXkdMfR/qfL7X0cNM63xqpagKl5PLrrjdy643rjeuN641cpL4n73xUFmdzNCAACFAAFAAgAAogACCiQCiUlqWoqa0zfkXzvo+Z8fq7XnvmVx9Zmu27cvon1Pmcrvwcu+N6S689a51pnWmdb8+m/PppjeuNbZ3ea5QZ4H9D8JWISKhAKIApgAAgAK0SCiiACCwCEooOWocvTcuvx74v1+RjfZmk1jrPp/Z4/cfU+a9QHHIxupeRz3tjXJ5dXLvz6crl11570zqpXRDVnz39F8BwqlDUSCgwABgMIVORqkLEoAAJAFQAqsakOX5T8j6nQ+P19xNTc8nHXk9uP1L7fxI3hUK5d8a2xrk8+muNcnj25HPptjfI59NM6AHDVqHz79D+fCbFokAoHAAwAcEFEMWghKgALEgoAhaCiPLznm9Py3431+djXay8TU7vty919L5/YejzTYhDl3xrl8+nJ5dd+XTkc+nJ5ddcavOnKqCotoA+efovz9RGorEFMIYQUDQlYBAAtQAIKIVgoqRiqbAcuWNfH/AIv2ev4du3zrSqj6R9L5/fezxRYqRUC65vL5dOTx7crl15PLrtjd5tTRBTilagHzr9H+eZNgAwpwAADgGAQUAKwUQAQArjLG+s83p7P3+BhnXy/5H1vN+T1b5vPa1s9r34+++h87PWc9RwE2TV5cjn05vDvz/P6N+e9MbuWlBqAAQHzn9N+ecKwgGFjlBhBRDAIACkMSClEi0UOXTNpfN+L3ec+D+k7z6Xx+r8/o8FvlWddkbHP6Y+vfT+VyZqUmzTOtcbZnrNTXK49eVy67c9643rnVNAAAAAR84/TfnmgADgGADgAKcFEIBolKAEiRWhWbyMbivi3wf0EcuvKmuH38mWNdrbon036fy+768dsbcumd6Y1rjfL5dalBy0ry1zvXG6UAAAAA+cfpPzrAdAAMIcEFAACFoAISlCJSxQrUjl1zry3l9Pyz5P1MY1O72wxruK9F6vL7j6PzNc6359N8dORy6a43rje+NuAnRDjTGts7uaAAAAAPnH6T886IaFAQwGOEAAFAgAAAAAQ5Vm+D8Pt8J873xLKJeyrntdpL9I+n8vse/m1zvTOtM65vn9G/PpvjdQE1lrKRrUuuNbY3pNgAAAB85/S/niAdhBRDGAQUIKIgBSkEACpwEYvmPH7fCeH2dVx2mmVLFNnvLruq+o/R+ZyOvCprTO2c3z+jmce2uNMipsz1nPeHNa41rne3PWudtQAAAPnH6T86DAB0Q6IcFFJCBSwhKCBBQ43PfQ+fv5zyerzfl9XGzYRy6LCCiKucdxqfZPs/Fcu+OnJ5dUmmd87z+jkc9hOk2QznuXm6Z1pnWuN6501AEJGofOf0v51wAADGAQWCiClAgEEB13Lr82+T9TpOHaEUOXlzVmlaDlzlmzg3N12J9p+x8blaztjfJ5dtcbqORz68nl1cKgmxI2rmqy1xrSbYEiZais+c/pfzzQgAdOAAAAAKQQgpRwuXX5N8X6/X8+hHLObNaLnZRUFVL3HLp6P0eXzPSddJ0fPp9G4693+g+Lvm8nl15fHtU1rjV5rWpqoBDVxebpndytUJEjVqz5x+k/PMEFKcjAIKEFAAQhBWeNfJ/ifY6Xh25kvPWrMiluXVexzPQ/Q8HoPf4OT24llZvH8vp+X/ABPt9fqfSvT5fX/R8PL49eXx7OUVoS1LUuudENai860ztqwAEFAPnf6P88QtFRIU4YQUAOFaCRUiZfmHxvreb8vp5Evay1YWcatJe+9Pn9f7/ndp6fPGiSpRKl359PM/N9/kvN6uQfSvX5O81ORy63mxqTrNZ1rnTl0zqoqW86qaqVq4KAAAPnX6P8+IrFTHKIwhUwHCpWkIVnhPmfQ8N876HNl3rQYrnkdM/QfpfM7f1+VWCkXLedXCNcbvN+a/K+p6j0+fpPL6vqnq82+NXnUazNjNcbvOrlcC1LedXm0rUCAAoPm/6X88SA6ZWaBQhDBUipFZpb53y+r538f6txnWpVmusfTfqfL7D0cTWVQhDmtZrTN0zrTLfn00zrjY38u8fs+gduPF59PadMXmgE2VLctTSRq5by1zu86pQMgKAPm36b86wh2seQjUokqUEToi83qePb5b8b6153QrGdv25fRvq/K5PTDSLA0zqpXDW5dcXk8+nI5ddM6cvTZ347n07BPb9McrNqVjlcquW05QqXXFvOtJpqBAEAHzf9P+dACCql0zXEWMagkjSs3jc+nyf4/1sOfTSWyLO87+f6N9X5fJ1EBNjipdJalqWjbnvlce2/PprndZoeXzvgmlnsrnTN0zsVWRc3NXmuXTOtM6pQAAAAI+bfpfzgNUMoZWarCWgWbIoxr5b8f6/V8O2hcvYaz636Hz/Sezyck0zpWJLlZFgJbl0zeTy6czj25HLrU040zpnQY6d9rFDilCUVaY1rnVzTUAAAAAAPmv6T86wBGrCiAocriNJTwHyfq+U8Xr2NK9j6fN7j6Pz63ijk8+jgBBdsaqWUw6Yqa2xrXG+Xx7b8+ly1nVy6Z1WaCqNZVjzWVLpndKAAAAAAAB81/SfnC1hIDtBhDHKQjy/k9fgPk/V7beO69HD1Hp8/e+jz6ZrSbNM60zdM6i5z3nbn05fHtpnXH6c1W2N6Y1tjemdXnWmbedaZ2xIiNZjWQrOtc6poAAAAAAAAPmf6X845XRIwV2uAqLzoTi8uvnvH7O16c+768uRrNDluHGeo0vOtsbjWYueRz68nl10zus1rebct51UrlqNM7uVqIEmW+cay5rTGrmqUAAAAAAAD5l+l/OMYQwKtcripdc6uJ8nr7a5DXG9M6x3zy3loLFyJlvJLUa53yeXXbHTfnu86ZedVm6TQCOW5qpWoAJnc5ayy5qs22gAAAAAAAPmX6b825QcOiKtakmmdVLpm9t5PTyOfSprfnu86z1ni9uMazGs5bzFzjvIuubyuPXkcuu+OmmNXLeNbY1U01STqVLebTQAAJJQGtAoEFAAAAAAf/EACkQAAEEAgIBBAIDAQEBAAAAAAEAAgMEBREQIBITIUBQFCIGMDFBFSP/2gAIAQEAAQUC6hDofrwE1D+gIdDwfpNqxZggbNnAXQQ5Kwom+DOQgEBwEFrjXGkOpKJ+kuZKrWVvMWJUXeTsDVsMQ6gIDjSa1ALS8VpaWlrqfo7uUrVlcytqwhG8rwaFim0GzjqAgFpaQCA50tLS19Pcy9SBXMpYsrW0PZHax1J1ySjViqxjo0JoQHAC0tcBD6MdcjloKqu5GzaMMZI1pa4q1ZrMmMpMpxBDoxDkIchDk/R38hXptv5izYTimAl2zx4uKirSyyYim6pBpa6BNHAQCCHIQ5P0GuM1mPTT3lxUUJcgGtQCLXKNs7zhq81eu3s0IcBDgdifov5Db/GpOO1FE6VRQ/s4+y0CoK80rsZXdWqhBDjS0g1NatIBBqAQCAWlrja388chfyC3+TeVD/5Sy68/bijSltGnB+NXQQ4bwAgE0IBBqAQC19PtZu3+LRJ2q0fm4f7M0sQCxWMc6VrWsbwE3hqCAWkwIBAIfVZy3+TbYNuDWta9VnhyoVX2LX/OjUE1BNQag1AfV565+PVcdqkP3sBoR9xg6vqZCrTirSdAmhAJoTQmhBD6ueVkMN+y6zZHuWjxa8pgWDpehWIWuNLS0moJqaEAh119FJ5+Fa4JJOJHMijy+RdbkKrj9h/p91hcc90WkQtLS8V48NCaFGE0ID6cLSzNYPhNyz6dHMQyr+T+qXJo2QxrQG6VCo+1aiaGMCKAQCDV6a9JNjTWINQQ+nBQKc0OEkz6tya5t8V10jJmaMTSSxvtolYmr+LWCHDWrxTAgF4rxWuQh9O1ZvKNga874YdKPUsNc6k0Y34Wn52EE1BNCAQCHYIfTPLWMymb2nHyK1xVk0+WLb2bLMZCIqAagEE1NTUOu1tAoFD6OSRkTbmcgjV29YtO6FN9jE/yZjx52arDFXQWk1MTUOh5CCCHz5bEESsZupGrGctPUs75XE8BBjii0hNBJWlDoNx0xFkoIJqITE0odCtIBBBBD5t+3FUiu5OxYJcSt8AEoV3kCshGGoex9t+jomPyJBaWHRpvNexDI2aJqCaeAE1DrrkIfNu2Y6sF61Jan4ZXcQxjGD9db415BjduLC12Mr2JF/48L68uJsvnyGKsVZfJYa/tjSgmhNHA433CHzJZGRR5O263YUcBeoowxErSA9gAS6N8clenudmHb6sUEER2toFWofWiyNdvlVc6E4e2HhqYh12h1HzCQ1uYyBtSbUTNljkTobBBPu1U8XPMq9CrAieoQWaq+TcYIzas1pcbYxdgWa7Qh0HA/v38L+Q3/f3Ka1qPuWeyemD9Y60srocZTiPTSAXivFNavFZqia0uMljymOpSSYvJNIIHQcDqPl5e+K0etqb3LRzHDPIG1YparWhjOw4DUGoNVqsyxAPWxOTuwR36n8es7a3+sIIfIyVxlOB73zSjpjqL7hqwsrwddLS0gEAmBAIBaWVoMu18FZfTtZmF9O1XlbNDzrkchDgf3BHuFbnjrQXLEluf/gQTP2diKTprUUbI2865HRqaEBzpZrGC2zFWhbhwfq1rKCA6BaWkAtfB33c5rGZW665OOB/lWnNPHg6H47WMa0NatLS0vFeK1yEE1NQ5AWlexcdicMG9LXTSAWlr5Wcv+q5vuf8AuiXQYSQsjYGN0mhALS0tcNC8EYkWJrUGprUwIcaQWlpa7AIfLzdwwsmjeySWg+vRw2JLlSxsFZ4WlrgIcHhiHDmoNQagEAgEOB1PIQ+XcmbWrYyjM5UMXHA51dj3+C8V4rXGuBweGBDjS8UAtIDkIdSjyEPjjhn+zUhYm9NeCaxemnM77W0AmoIdNf1noPjjiP8A2M+yCHDgiODw7lqagghwAgOw+R//xAAsEQABBAEEAQQCAQQDAAAAAAABAAIDERAEEiAhMRMwQFAiQQUUQlFhIzIz/9oACAEDAQE/AfaPwB7Y+KPZHC0flj3GsLvCbpT/AHFF8bP+oRO43yGBms19WyB7kzSsHlCgtTM0jbypDLQgMUq+rZp3O89JkLWeFRVKXdR7rkEFSpUgM19VHpnO89JkLWeM0VI8Mbaklc/zxAQCrACr3L+gjgc/tRxtZ4QGaT3BnZU05k6/XIIZCH0tYGWROf4UcLWYGaTjtFlaicSdDm0YCpDA+mrEEO7s5rAVFF+3yVqJmyHpDgMAIYCGAPqImb3VgC0ETik+RrPJWolEh6QwOACa1UgEAgEAqVKs39EFpWU2/wDOGdFHMkzY/Kmm9U3zAQCAVIBAKlXC/pImb3bUEO1aIpV/lTztaKae0ST55BAIBUmhAIBV9VpY9rbP7yVGQfxKmf6Te047jfMBAJqpBqA+r00W92Go4lJjbam1DpBR5BAIBAIBDA+qaCTQUUQjbWbVLUybvx5hBNTQgPqGP2m1JpdzfUi7GAgLWn0+zs+cDMuo2t2DzwpUqxSATQgEFX09L+P1f9PJ+XgrV6COvUYEP42GZ/4Gv9KT+Pbpm7m8XvDBaJs2UEcAINXpr00I01iDcD6cZ0WtliYKUkrd++Ppf1Bcwschwnl3u4Bq2poQC2raqyEPpwoIPU7Pji3Gpk2NrAQQQCAQHMIfTBqi0v7egONILU9yFUqQQQQ52rVoH6NoLugo9I7+5MibH45hF+3tTyB77GaQTUPaH0DY3u8BN0bz56TNHGPPaaA3ocKVcSL6wEEFSaU08qwMD50URkNBRQNj8cdq2qs0qzSlidG6iggmnACbxpVwHzYozIaCYwMFDO3F8aUUrIzUnhanWxRvqMWjqYnC7UUgkvb+sSxCdlftVRo4AQCpDF+wPmMaXGgoYhGKxWL4EV5RLWi7Tte2ugn6iR/kqycBQSmJ+4I04bgmmlrIb/5AgE1DN5HEfMAtaeD0x/vgeEuqYwf5T9XI798KVYC0k1fgVKCOx5UMweFLF6bqQCHAfR6WGvyPEoJzwAn6p540qVKkAgoJN4o+VKwxutq/9WIIYpUhgcLQPy9LBvNnwq4lwCM7g40UST2eIQzSDVtTbabCNSNUTzE5TMo7ghwrA4hBD5EMRkKaABQ4yTNj8qSQvNn2qTRgBUmHaVIyxuCjdY2leOFKsDgAq+OExheaCYwMFDjPN6YTnuebPCuYQQGaTHbU9ldhOF94CrgMUgFXwb5tF9BQxemOBeB0VqZ+6aiS42UAqzSrgFSamhAZAVJppUq5AKlXytLBtG48HaloBTnF3lUqzWQFsXpotQC2oNQGKzSpVypAfL0sO47iimyBxoKXUbemqXUl/XIYOGoYIQag1AKlWQhwrgPlxx7zSfIB+A8KScu6b4Qc4CgqVKlXAK8tCGKVKlSriOJ+WMBR/iOltW1Bi2Itr2QE3AwM17RVKvkjDUzAQwQqwcHg1BDgAq9yvg//xAAsEQABBAEDBAICAgEFAAAAAAABAAIDERAEEiATITFQMEAiQTJhIxQVM0JR/9oACAECAQE/Afmr1h9q6RrPKdq/00JrJH/yKa0NFDiVeDwv4q9G/UMYn6qR3hdytLp3A7ieRKOS5Xi1fq5NSxvhSTverxCRY7WeRKJV4tHjfEZH3z2Umqa3wpJ3yec2omdR21RxNjHbiSiVeCVav1cuoaxSTOf5V8GMc801QacR9/3yKPrpJms8qTUOfxtNaXGgtNp+l+R88iUTgq/hHotRPt/EInjaazd4C00Do7JR5HJRzav00r9jC5WiawMWmRuf4WnhMY78bVolFytErcrVq1avNeiK1Ulu2/8AmHiwhmKB0nhQQiIVxOLVolWiVav4qVfelk6bd2CqQN40+nc424dkAB45FFEq04olWr9Vq5N7qH6yE8V+QUTOqaCY3aK5FFEpy3IuRPq9TL02/wB4Kbf7xC0SOpRQNjNjkUSiUSiUfkHoHODRZU0vUdeAqxpo9o3IHkUU5Eon46+5akZvb2UWrp3Tl7HJdS1M/U7Dxxi0+5284BVq1avBKJTiiUT6i1rtJ12WPIUGrk/gSv8AcJYmfl3TNc7UdjxYwyGggK7YCtWi5b11EZEXon1NZ1WnYZCms/Ha/uhEA4EJ2AqUMWxvAuVpxVrcr4H1BU8/T8eUTwKC08e43koolEon1xKm1f6Yib4DOmoMV5KKPCsUqVIhH6dfQc4N8qTWNH8VJM5/lXzDd3ZQsLGUVWSnchwKPoHSsb5KdrWDwn6158IuLvPxAoDBRQKciOVq8n70szYhZUuofJxtXmlavIKhlbK2wjgjFoo+mlkEbbKkkMhs5vFcbUkTpB+HlaXSyyMuTsv9PI00pWdKt37xDIdLLf8A1KsEWMOKJ+M/dc4NFlTSmR14vkDY7IbnnaGlN0Dv2UzTMZ4C2qlS1MDZmFpTCR+LvITm7gtDMW/4nIpyOaxXoiaWon6h/rgAqzFpXv8A6TNJG39IDhaONZp7/wAjfIUTgVNCWd1DN1GIlHgVfotZPf4DiMNYXJmkYONq1atEolTRdN1jwo3CRu0r/hfg4CtHnX2gtVqNg2jzya0lDTtLRaDQOwzfA4tbluTqcKKFxuUrBKxQusbSj6WaURNRcXGzxiidL4UcYY2hzvJKcVatWnjcFG7aaKe2nbgvPC/QPeGCypJDI6zx08XUd3TWBgocL5lEonNp4tMffYpprt8Fq1f0aVc3Gu5U8vUPANJFhaaDtbk1oaKCvF4tblfAopyvNq0RatWrzatEq/sjGr1G47RwZpX2E1oaKCtE4tWrwSt6EiDkXLci5OObVq1avA4X9zVT7BtHnDoy0WVDpy/u5Q6YR9z3Ob4jDkcAouRcrV/CD9+SQMbaZETbz5UUAb3d3KLWk2VuW5WrxfAYccWrW5WrV/EPulSfke63rei9b0Hc6wSjg5tX8YVq/tuT8FHDSgcDAyUUUckq8j7f/8QANxAAAQMBBQYEAwcFAQAAAAAAAQACAxEQEiExUQQTIjJBUCAjUmFxgaEwM0JikcHRBRRAYOFy/9oACAEBAAY/Av8Ab6zSNZ8Vc2SF0rtSr207RuG+iPNBoJNNTXvNHPvO9LVSOkDfqqm9I7Ulb2QNjachdxPeaV3j9Gq7euM0asli5MZGH7RL6rtGt7xRrt6/Rqu1uM0bZgsUQ0igzJVyMfE692LG+bJoMgvMfw+kZIuPguxtJVBi88x7rxuq/wBAzRAO7Z6W2YW4BXGNLj7Ihxq52Y07qdn2V3F+J6JJqbKnAKjRZkrsd4nQIia7U9Kd1ow0fJgLKMxOiN/CnS3NUiaXfBXH3b1endnXTwM4W2NkcMETbWMcIzJQiDr3dnUPG/BtlTkLcRgVvNoj8rQ9VdY0NGg7uSORuDVRUbYYZOU5exW4HKMSfZU7vum/eSfQWXim3MqY2M3gq0NvJ7468Xd3SyHhanSu62AIJt4G6TRCVxq+Rv6DuZ3brruhojBKN3M3NuvwtL5DdaOqutwiGQsrpbG+cNMRN673UzjB8Yr8kDxPLciM/wDqEZY/eIUfWMdLAFQWCMYDq5NY3JooO60OSk3D+AONEJIQY304qap7ZiX3lhlZihQVOSunmdi7ux2eE1lOZ9Pgu9eixWozRnrwRnD37qXvcGtHUoxbJgPWqnw32mlV+ZqiAFCRePc70j2tHuUWwN3h16KsrzTTp4/ZMiOF40qmRuIJaKdw8yVjfiV5YdIf0C8u7GPbNVke5x9zbgsrKWkE5j9FE8dHdvvyHHo3Vc11vpCxNuS6LFypZQ5K+OVUVFUYJklA6hyTZG5Htpkk+Q1Rlk+Q0swVTgsqqlLKqqp1V0ggoncl8XVB7b8cujslcMVPforoG8bdvVFjb3wcqjLtZkeaNCLzyjlFlcgsvn4ANVdkBb8QmhkjHh2gKBkc271DaqscQHgoOcYtRNKFVxwOaEROB5f47UXE0AV1hpE3L3sqVSytnWhR3g3TNXDFNoy84dXfYGdo/wDf8p2ybR93Nh8D0KDXGrDyuCvfjGDu0/2kRwHOf2sGGPgocNE3ynmvUBAhhcR6j9neZyHlP7Iwz4vbg7+VupuXI+7dVUZdn3bD5rvosVgKKtt9kbnNrSoChZtELS5jQgxoo0ZD7R0UgwP0V4jLP8wTZYqF1KsP7J2yP5o+WunZrxxeeUIySGpPhdQ3WjqUImZD6/b3cpBylHYNoq1pOFfwlM/qMHq4wmysPC4VHZDLIcB9UZH/ACGngwQMjDuhmrkbQ1un+DvI8J25fmT9g2webSmPX/qm/p0lSG8Ubuxl7jRozKwwjHKPBI9jcGDFGaVvG7IHorrGho0H+GzaGvMUrfxAKtMexnZ4j5beY6myiutFSozI+7XnGio0U6943EX3r/oFuSDeGaEsho954WdaaoTbU3h6N1V8cT9T07y6Z3T6p+3TU378Yw7ot7J5sxxLig9zAXNy73GZMY2Y3dT/ALh//8QAKhABAAICAQMCBgIDAQAAAAAAAQARECExQVFhIHEwQFCBkbGh8MHR4fH/2gAIAQEAAT8hhBgwyGCcYxl/LkIes9JlIkPQFrBxgwQxGLl4PywlSoQhCVhyPoUqnlt+0v1GjQfjlle9ehX5dIJpdTp+7hlQemI1GKhAQgQl4vIX8oQxUrJlzcuW1H8jLNvB3+cLdDmLsspP5nYYmQzVTli0emiCKwxYvliEPSYvCy4YnzLj3Zci14vyzd2PLHizFp5391bggZM2QZMEIZBFYWOH0vx6lQMkMVlZdCug5Yg/iR+Zd7bxfmdyOtVv23L+b92CH7ekPacvTz85HF8HBWIgipywqVGLFjFl/JmD1glRxxxep+RjO06NYmhA4mrRGK7XLzzq9D3ilv7Ug9AMOMIYCVK9BcUWLF+XIZqVCDh545f5dps1+pz7vWKtwkWgCbX3lzrCBlXpFociHEEkVWAhxkOAYBKgyWKLH5kYMMVhUuahoOng/wBxKycq8xblDb305gmhLtavywUCbl3GJvbsAs93rhWSBiGoZwggSsDLwLF+cIMGER7quOh1f73jKNIHkbYPUnuBQBQaAn2nSG+zLDLw1CW5s048X1yqBfw+vKmBci/QBhRLP+4zrHvVuzxEhg28957Iu+bIuCJ2ZCRKK3VZHUMCWyj1DKRWbjh+eJcIsFX/AGmMoHlCfhigapLHvHEdXqF1gLNN4XIeAojlwhDDNU5eggegJX0WwN/f/Mr+FzoN5i0NQ/b2vrK6B1dx4SqFlorcckUMGoYfQUGLwel+OfJEy6a/YzrJXS0R1arR2ZfbApLjOicfublHf0O2KlSvWoUwQl5IZJcX58lCAL9/ETXlo7HaDggkcnMVeype8hTNUSdPNWRUMGmLm+aECBKlQgPQfOVAg03UH3IFnSs15RzAYI0Nqm07fe8su7snLsKSaFXFSEKduqIaayC+LCYGiZgIECVK+gk2jPXsh3EDxj2Svnp+3mcaZ1KP4mySeLxZ/wCxIbjVtXHSXfLLVvEurDdGgg8UT2CcIZZKZdg+EXGRBiQPoxcRAAopGGmpi7KuEvrwnwja4FK9bgXcmyaiS8vVAJazQ6wj2dK48fbBSr9ABqUlIQQ+lU7YKP8ArcuXi9LHo7jg2uEnA9APiE7Ude7n+IOQzRlx6CEUUH6HUCcuIEoJWv8AA9b7doqIq4YNMo91A5OXUp0Sv8kEoH5VyGkW5xgghGLF9ITh9AvCTuHVL0u/1FqLoOh9pd4Emq1BHCoF7L7Mu5YfvTd2AOJeHCaMeRixwuEH0Jfid2whPBoWIPuv5Med4LpbLvmWWoMW+odaaeJWERumKnfRHXRLmFLhi3iYLJTFTmMfSA9avB8vtcXFyo3t9PSR60fvG2NaJl9/aM6ofaeYd5fR/wCwLDtwr2dF1C6a+GXF0i+wIGqIvf4l4dN08nhwWILwGo9RcVKwCGQ+Meo+AuXjqLtEo/QO0Xe5VtRx49nmDqs6qS7SR50QcbdOScPz1lBVVoo5Y4G++o5dpq8L48w6rWdZf5luthrrUXzFztAXT2igO5N6LQB3Dr7n6hIIKLE6zfFolYjgMH0GQ9R8qAstqy/A1dsjuDbaNMf700o3EUzls9sjcrV13drzHdAB0/d0QCeHuH5iRGlXy/zChRqXiRr0Nq9+z4eIu7Zfceo+YNNCD9cZvX/I+8ME4xIS4ODhgIEEPTXoD0nxTBCtXpGLOF/ZluI/AhCbbq9R93R1KAHMp8pd6cLRe5UHDf6Ihibra9+3ESLjmVFHqDpr+H96f+QQa3XqfB+vuxau/pf+JDSThTv39n0FzCCECEIYPgEXLyYPh2rsy6sJup3BnMOY2A5TYl1y3MVeJ8nZNiFLs/jiLeSHopolURBHSMO2cna/4/XtNW+8ngxKDTacdp7c/mEEFFidc0iYjlcGDFCHxCHpPSRnFwarp7yjAX1mogDsRDC9QT1NAXApUa0j9oUIlB0zUqEMSWTXh7UQeq6JOjBanC9T+6Yo4fLjyveK7T3zx+0WCJKhCXgyXx1ZIZYQ4jirQ77/AKjqX2rOcdk8S91KJOlNX2hv9x7u8rDCBDCesQFwq2f8b4mu0H8b7MA/R9x/pl0oUCEqEV6QggQfFMRkxccKBnEd3aKfz7A7QKpB0nPfBAqFXxFTNna+IDCuBAjKjAQwIQgyQSsKxhNuzsx0wG+Kf9JRFvQ0nb+b/MCDBWTgYpFfGJeRDDgRZbTpN6K6/wA8Nbh3hvQtdE5LA058HmKLU0Lg95UwehRgIYIMLXF4DE3BAgZKskHqq4uAVVilrEySGEQfIj0DLlxxzaur+1Y93RKJCdoDnk6o6feU7hbeV5Y4uj0Mlk3wKehCiCBCBCDEkYYrAPkzJgxUvPp3UnQTa9bmld1fuLt0iqBzXT7+xEhPS/ShhDpA3kDXojqJqWeoMBAggZqCMPkgyekgSp0veju6Ep0ieAfRYoWx5DxAlIjTi+YPEghNTlAY4JWFYDKuE0wmBUrIYqVBkRRfKHohqC4Xc0/7/t/mACqhiOkolSokqMXcJLYjgcECEBKwQh6RKgSsD5AyYMV9BBDKhQbiTjCKpeBDrEYGIJWHB6ySpUCV8b//2gAMAwEAAgADAAAAEH2HUWVRt01vusrnCqQdyy4N9XeYWWL2cdbhqRx0hGkn/wAs0nkte+AQgaKPE2wWfkGt2j1Y/JJpId4PnLAe3/kikDJPKyX9pQNglIi9KcD3LyLIV2KB7QVOhQZHc7sQaly8r7/4D4Qydu2J49xjIXy8xb5zVpyBHOglgjzzstSQq/p8m8/zqMBYezDcRwhuKVZtACMCW0WTFLAy1sZGYTVrfsdgKP3Q3F7rKImyM8xCB83o55LZ6wGYu5RdeI7Lp6AMoRWg4CLzuePJ7M55rLG3M4oebZO68kG2S/DT0p3Th/cUmwbUm7g/skONjaEm2qCyavWvb6KYFW2AmKms78tEtYtZbdAacIzaL9b6iRIf5emPy+0ABiRvgoxTAR8dgDbD5plFyEogUtcBEv8Am8krr0HX0PRe1t89izE+0Gjz8jUaolnmsk5yyiks1bZKkkNqS2w52KAqkjWVytEkmiuysoYxLaGX0Y/4aHqrhKS5MZ6YkkkmhsqzkkkQOp9gfQRBkAFYPmxJR4kkkkkb4Epj1ujAAUPLDQOrC6wQNRtM+AkkkkQzNwgHiYE28zo6YUo8csVUJJ3iREkkkCxdyIQYPqE2UUYrF8dAbxwpfhiBMkkk3+ww3QnxeW+y7PLTznY8DudN8XMMgHkrSWzu++IgiYVZqRZkUV/WYn7Xgnkk6khawJJQuMXP3iflDG6A+EBhYBPQQMn6A26DRwYBa/r+b/imdAcuoISNcLhqkgMkLg10wsUTJlq2+UaWXKVLueOM9rmmkkkncCt+MbCVspCfTY5xK9Il1hvLkmskmkHxIQqM7/EQmpcQNRUuLuw2WZXkoEm00oQG6Df4BzRLB39WcnufoYWtzmwfMmm2AKgGyksQOV3Rqr9fM2DZszWWBkgkkkkXW3qeeGsg2eGFYhkGJlRzvk65Ekkkkky+Ti1yD25a5AtyDMXfugXkmYkkkkkkkcL9pZf+MoG7i7OqkFJtorQTzkkkkkkkmCfngR+ZIUUu06s8RU1hhMJikkkkkkktGftSppknhiZ/VhReALFkhOoQkkkkkkInvAZg3jSpMLQ+AHeigckkv8Mmkkkkk//EACkRAAMAAgIBAwQBBQEAAAAAAAABERAhIDFBMFFhgaGx0XFAkeHw8cH/2gAIAQMBAT8QzRCdQmJkEkQsUuLxmLCjE5lBeiWKL0UTEwjQsExOi6GUXXF0XgPKxvitnR2LYmdjYniwTJiZIaEuE4I160SVh/H7NRZ+7H0ZQkJa4KGsEtEEFmjGxsvClKUTwhiJBZWh0QnlEEsJiylw2Mi+Tc7v/fBHEiAKv8ft8UhBCQlw6BojCQWIQbKP0IQgtkOxcJwQhEFhdCQuO+0fP6OiV+7E4hdiO6EX3/6TigooFQsZLCDRCEy+SylntYpRP0Esp4lEsLC24j2I+/8AY6tv3feE/Yttll2Nb09hMeFgWJUTJSIIXBvDLg2UfJCOspHWEXKEI7wkISFlZWkJNf2aLiUXtE1YaBrBD6wlj0ExLBBLCFijeG9FxOE4pZuKMWi0vG4Qg2EbxNe5tJX7sh2GNCd+BFGIkL0vPkhDoSEqJYEhBBBCEELDZRso+FFzomJEEPQxEEoXFELMCR8L/Ikkdis0uhLinsEKC8fIw0LQ0I8WEiFggihJmlGylLi5XGlEd8FjvhcIQtCYhEl+u3/H+X9qQb1E98kPpiGyF1rJ9xhDYhGNfEK3AmFkuDZdYReK4dYSFiUhcI6LwTwsLDae/wAPH7+olBtzJtNDYnv9g7SmEJCELDDEs1QXCsnil9FsuEMTEUhBaLcrZBawnjwRvDz/AB/nr6iC9mLYugo+A4ANa2UI7EKGjhCgo4JEy8P04QSIPsRJwb4rEZsTw3z34eBI0tLBT4/Hwyg9h7G7ZRYQhI0DBBGWCcEuLw2T0FyeE8JCWUjo7E0XFx2fS2//ABEp22Ik9D6Hle/Aj+D7kIQRBeBchYhZUQuNG/QWJvmsIuhDwsdkGsdiYldjFBfr8sSJMFsm+hzT0hqMgkQhMGEuSSEhYgkJcExvC9KE49Y6WFopKJQhDdlV5XwN7F8eUN4OZJKtil8j7EZ2LhbvIO9saJw0EHMcsSCCRCei+Gxems74rCwkpK5Jr2ur+xZlWn2ot/v8lYz+C/2d19RIRbpt9/7rwQREkJUug13YyRYJUiUGLHiFgWsEhejcLM9FcfOUxDwh6YwnUSjvappVPaHoLfa8X4+DvRev74oZdHR9LoT2JkpI2wVIIFAvWF6lwli4uVrPkQ1mxv8Aq+P4939P4SSKWD2MO00ntlpWKGjIrXBYYb0pl8exC5z0khjcP0n7/QhaRDY0JoVbQlZaD8CgQ0HrOovDobomUIr1BeKzRCxSiKJ4oncvDSFY1t4vv+jru/fyQQmIaF2N4IHHQ3rif6KI6GrHO/B9D1hCVFgvQby+D40sxOMxZ2drv6Hiv3fj9nlf+vgTRi+BvCFQ2EniC0hCNhuPIuhyyD5DwSEEsF1xvrJCR3yQkeHnlibSv3ZTR2JUTQQ0FoXyXL4ErcI04zsfhRjXg0wJXCkF1mDwpTCwXFcHyWeuKz1l4v4oIJJESCeLRKjZONFeJN4b+4p6jzap+z7KvP8Ab9D1P+HhlPb70/8AwbORtC40JzBNcFobEdBdZeEuEF6DFyRRA7GQL6kNxKD2yknoa80HZ10vktdv8iiPaH2HhmKH1PleRluhl4ifq84J4bMokIJcZwhMUvFcZwY0XYir7CEhPwNBMpdbIpbf75La0XwbPBMEEsL/AAvr4f8AkWPoDMn9UXU68YlINzKCQsJCWE56NGy5hMpTKFwR+Ji6Eh0SwhLYzNtaL6Ti+C0kEIQWBYqQdc0+6/wdBkzWrtCeMIMMaF4KLIXoLhOEwkQgsJEPZt9xItIYmM6O9Y/tTbHr7HiEEhBBCjFWBFkNDRTf+plS/qK8CzqUWSGKUTyYb0kpwj4IRMJYm/C7EpGkJ3FGyT7xjKEwiCQlhLJSyG2E4m6NoxbFhNwIJCwIJeiniiEIayhlySQUSQkIbRsU9lj1iWJrBLCKJiYtFwJJCSwfo+inxkKUSEokXBCCwUJ6SxM0QohcHv5BMfL7xTwPV2MrV1+R8ZWNEIJCvGCwlFgpghD3MYWntCQkSgkTCQwRSL1ITC5LNEe4f4I28NJC4W39mMq1GEEosoUsOhhiLiwpCEEkhIWU1BieIIQ9ZMvBbysJEIe3K/JCUWxl2zyK8x/gRwohIhEJbySEzQmi5DBEQQSgkIJwYagmL+gMWijwniYQkQetRmup3PwIuoObtMrBChoSNjCSD2JYkEqIyIIpEJMghZQg0JhMTE/6ClxRFwgtISsZt835xXDckQaPI+sJluNIJCaOsIJCEwlhLhBMEEhevcIRBZQp2G0XBSCmNUxo0FvCiEdMUEhbEpgSEg1hIXKDQgkJT1v/xAApEQEBAQACAgECBQUBAQAAAAABABEQISAxQTBRQGGhsdFxgZHB8OHx/9oACAECAQE/EA2zjLJJvXJEEEQ4PwJL5LznPx4MMMM8PBLOpj1y8M8ZZBBBHr8Gy2274NtsPkl7jkC9qG3I+xwgI42Uzp4L3Dbw2WZsssggiH198H1P0Q8es3X8rrOp/wB8yNq22gfv/B47wK23OJm8CbbbwPARHO/SbPDYbZeV43l4756Xs/8AfN7Fw+xYtfiOQ/2Pz+fXGx4gxZq52HhvIQ4OByeO22cPhvO28ZzvKWSBq3T9n9LoF19iLD5g/EmJz5/tZj2+88HGUspteBjNmbctjuIIizgYbedjgeM5PBs43y22DjpDtke09s5XLNG3Yu18/wAS+X2nqWWW22Z4DYIIIPE8S2J8N465ySeV5TgXt3dDuFswZFiwTrKlexn5W287ySymLPK8ZBCCPELJjrgPLOAs5ecsnjbbbt+39rR142D7y5AlebNsn38fbgPA2yzl2ertKWWeTLIIIPE8sstvjk52zjPFsmbOPfo/q/wfrl2g9p9dQi19pnDs/Hu/pJPqSXPMasa1rwBZwCzwzgILNg5Hfr5w+Dqnr93z/H9pbSD3euWMEnnQ+8pDu8MzCWczwnitbq+GQWcByZwcZZ4B4FsH00sstH5fH9f/AD3LL7XpENl+0AgNwZZwzw5eIBrrw3neCI8Mg43keFtjnbfpZZZD8N+75lg33CZf5fzJz6IAHxHLMpXRKfAB9Asg+k8D4t8cbb5By3pfbo/mW7GE0MIj8fmffL+kW22yy8SNSzwE+WQ8ngs4XLbPPOM4PANjrhmCdEiv18S8Cb7D3Fs9vANtttvEXTmFl5HJfFgQcnG8nVtt7jqY65HfMt4Mgsfhv8knw8bkQVepV8D9Zs2DL1MHoy9ch4yjwBFzGy+bbweWeSTzl1weAcsxA3c7h/1MRJnrt/4lzJ+bc/yRvpfeHr/v62zBzgEg9T7lOJuEUMHGrLs/S7+mtscZxmwSTHl8WTE7hyL8+fZ7mfgPT+X53R3kMZhw937ZJLc8CLtW7Xh/CngbL1wO85ZHAWckvAhOf+H5v+v+1F14L2Qul+QyyeC4MbWXgjhJJPwG2+BYyWZHBDxlnIxbbYmtjv8Ak/iRKvfgupugsFPmaskeuKl4IgcjxB+APBmWcZZBZ9DIbVkJnZvd+vtw9+A5Hd/dI4+pEbbuQmfcQRwyTJfwhn1vSherrF50nte287ls8k46fF0dz1wXfANLKYjg4Me5fJln0dtt4PpbfMX4JDtw+1t8cbY4HcmzMevm6Gx2cYWh/wD7weLcmvYdwXqG222WZ8D6nxznJ5rqc+G7bVhx6ZetsJpaQqPk/acN2+Mx9+/6XqP8WDTP9vtxlnt7/J/7+P6BXoZ65DdmyySyGGXkvgcbzvmcHPUPk6bolS9fHDi9wcfM6dwbdpk9haT0/wBO5rT2AdBZkX9pt+z8P9raLOhP9n5PsjUfUjp/R/7/AL/MpShk4JwSTjbSWfo7bHlkE8lngAV9T5np6/m22S04ZZKa9LuezAQcbw7TMg/uH3P5PZ/iZB9M0D2emHb5PfII7g5Fm2ec+jkHhsc7zkdcbbx+6f4ngMJ5OADZamv5wYQcLMYc7oY2l7H6P/v73zlLH8lns3ko4MmSySyfFtsfQe48Nth5WV9yX6Tq6wQRBKdEcHsicOoh4bbbwZzMYEeiGO6xP8iQjgt6tmyySySSfEbfobwS8jDPGo+X0TD2MxZHVqfbBvCZZeCy8gx4Ryl4Lj02zjeGwc9Syy+GWWfQZh8CIJZbaTmfcXTDr5ig4Sw2xF4eWfMLbGITvzYPntCpZZYYhl4Nbv0Ms8s5Ak5JgL6Jen0euPd84ToOizZ+/j8rDOEzYm8hu0smXFTNtmF2ae+d5EeQ38Klk8H1dh9H6w2R9pTLh+pZ5wjgL3w6xwwjHBrwPA0ltmMeDUMuFtn8GPFbeNvvq/Sx9sA6dhPQXZELaxN6mbZQ9cFFnyDWLLLLyXrgHZNmfw28NssqfxB9t+h/eX2/Yi5dljg8Q8NJkfALdJup4mbLPkT4SSz62eBznDwsLo/A+Pzu/ILvbbDwOwTMzgcyt4YzeXzURm2/WPotl6Q7jguEJYeDGCzwSl5FW8Lhnz22H6//xAAnEAEAAgICAgICAwADAQAAAAABABEhMRBBUWFxgSCRMKGxwdHw4f/aAAgBAQABPxC2JlBL4sxx8ApgIMpux1ERdxmuAzCVKmp1OuAlSoSqhCEqBBDmGJAxCahgl3waqdzqYlPqCRLJbKpvKuETFhQNuIYSptCFloXiMHAh4uMuLh56hycHAQiSvwIOBwWu5rBcBUqoMMtl4nsixcTCMaMsP0gy/RLS4pVHqh/wQHKKHM8Ob+ywZuV84lFY9w3eIZcOGUwsxLrFZTOOLcfmlU0xPCWR95iZYtRgeKgQhwEDkgQ7lQJUeWriBcIFAqGo4OJcRH5g3GkOsNMxsd3hdH236l5cx3z/AB9VGgo2kq/+9yhHi0mSiye1QlwFQY4q2ZYz1x6yzCXqUaRswFamJCvHRChEjruPURjweJWIk7hKlcdQODg5CVK3ByBKxKzOptBxGLnghtAknigi/QfVsY1dvbHjY/5GcQ5cMoh6802EsaKwCbA7a8p8Fy1gk1FmTHS6nqlRqXdT0ygg1BcsI4VN9So4LUKOPBlQh74BKzKgSoFcEJiHAQJpPhwkuKLFSoQFEvHElWCtGgJXuMW4vvX9XGgYqWQ/LbFJcld7hkA8soL2LxuINdBbc9bP/rqANGp5/b48EMKrgFy5mCNQRwSs7YMqhNYpUyhlqUOYeJuhDElQhMSuCVwQIHcz+HhB6ivECEYjDcylkKRYmYskuDnn+no+6mUB5H6V5+W2D22AO4YP2RC8/Us6/IhMqTrHyuiAnqtNDWh6P7/yg4dSs8ARJeMmGGYYYwPuPMRUEjG3ncOIqw5CE+uO+DXBDcPyJcWYoa4OB8V2blW1dkK8ej2/QxNHGFFP2f49RFZb9wqcEyGvcpTDpe0bXeGIMs81GGBqX9+Ja9BF1GvbnLMVyiFkqyMvDVmGiWvJimYoDxKMzAi1Em3PCrjqVUKj8zuEIy/xNfgsuHBOocHljIUwtDaXzKExlzbv2+f08xU8rYKe2LsrALILP6DzPlaYy/cQqfFSf7MoEE2McB+i0folIE6k83WX0wrVY3KrmUqETuDPEiyqM2CmCYuFa1LzBB1K02zbw2Tc6gwYzqH4Gp98kJ3+XXNwvzGyrcKptF6LKU9d9UQpVV7h9AgKlni4Qg0CGbOmDI8MA9RQbUwPZO2BgZuaRKfLoPmWQ1OYhqlS6UtvmjERUWZcVBWJpwRZV1LViKxPEc6jPUp3MMp4j+ZhHGo9suXcGXu51Dg4OCViGeA4PcxO/wAji4blIT5x+544Aaaf7H+qlh53L36hOvI99kuRUo/tFYmFuyUAkOBodTf648QGs6wLasDox/vG8sh1FcN9SpCi7qCmoB1PXBhnUpKJRCUstluLl2S4TPFwccnITrgPxXhhOp3Bjgw4AESubJZ/Qf2kYZsu4j829vRKlEG1IxCCADQ8j4iP3IH+kU5OwfRixrvxiawfkH0RWcbRQLZhl7TKo8RFOpeanrgkKr8AENcP4HAcXwQgSpUCVx55J3LnXJ+AwbllWoAWr1HrlUdAc/Zz8VAYQK18HcwrezzFqAUq/MtmE+C9npqk+PEbWLYrQgvkt6mHAMKtaKzwrHBzOipe8JRjpTLuoR1CIASw4DBArgQKlYmNwUiwlcHHmEN8HO0eTmuOo8GYstnrgmQPTTTp+zR9+ItxONeoGVYz2wKkm3OVuvSV/cxC9jGVJNmkgfsEtkOCValaY9/0RyR4FXqBtlzNfED1Kpj1KJiY/AeoMco7lAl0XghC4EODUCEMXL/O8Q5udQhEjB4AMuXldD2sarSF2OsegiV5K1U0Hlq9xeXo3AdgAnxYPkGKiIQaWtPstv1KVi+ouoi3XAEMEh1CRi1xUHFg4WiSj8FFZb+BAhDk1x1Dg4qp5/JlLLBBgWrBd4TZ/fhGOCax9kdiZg9I6XhaLQf/AH1Gi7Mb/wC3+fuFnsdsvfQvzL6L8ZnmcxEC/AWtYeG731ACAAKAMEvtqbS1LBqIbIt6iRTBVhmHMqJXxYJSU/IZ1yQhCEN8EITz+JyS4pxcUrgwUxKMV0d5iX5Nn/2EVBtV3yIsOsmHpLgK2JE85Y+iJwKjgsEaA9LbemtRC8Sh/BUuvcastj1K3Oi8dRwbK5RCl/OvuUFAHgKP8huKtE8SGskAajYcR1xAnUM2f1CMEI4GyUfwjDjEqUwhCVCHPTBK4vgjOp1xqXczBplDAgw9QGEdjFnKSNB0njRkmzq6q5umh3Lo7DKAtt+rmNKdvqW5sMy4sI+kjtFgrbYKimYaNFIV/d/cWZilzKM1MtRRpjtJj1AOoB1BRHmbR/xEMwhOuCEITrj75oPwvi/wYyrYDE6juwu2Bwg/+nzFdNr3K3OzgRJTY+Tr7gmWfdHZCr2ljflBPIqbtEF9ZDEVl1hvcCAxcSl1KSARCopUUWYfmD5ln8NQ5OA4Ic4qD+Oody8QZcshEmXCe/rKB8stY8tFfF6e3PxEqBartiK1EhbIeqLmGDZRjV9t/r9xWaGg1XklIMxbp3b9UfUqc6hB1FF8Uw4LIKiqYJXDgW9xZbFZ/CQg8EOCMvg3zcZfFwZcWDDtBuFXXUD8XuHhEotN+Nv9SuNNq+iMfcUnbLRzL2Yq4BRbdwMlkXpf80fqJp3FYCoa73Mt1xWgtBYOCj6iWO5bTg3VBMCKiZIuNhjWd0NcV/BmEPXA9cGp1Djrj44HHFy5cvMGXCGKtWhb63BSMxT+xz/U8Q3pg/8AGqj1G2sf9ytgIJWoa1awdKboah5ZkXmNhtq6gqFMBkJmAEpTbIX1fjplxA90Jkyez2J5EsiiL0xLviGmWLI4CwUmRcGIODhmTwUQQQcrUYtmnBxc7lwzCVidcY4Nfwo6DRn/AMx5YH2jMoPfa+2KlfawyqVnSxm0eAgoJsunKXwukLXH6A/vYLF701oRzHqvT5I+fS2YLWr+5nIZfBdYjcUVVJHbqRwyUiJnrMMtqmQ3t8+SUAD0afaHScKmYpRtgjZG5I3NYycEdQcXw6iy4Zg1DUNfgQ4V+OUYfhcJoX4b6Y/76jyctBo6B4lnivYQw5eiWxu1Zb6hQLFXWfhgdyyGiaq5NSptTPzEgl/0MS17TYo6muWAbHpGANMCADTfCL0eYudFQshFJkCVnq9MFoU2FyUDgUMDWaMSgnmVN6TLYtIXs8ywVEx6nUvTuhVe6M43YwgwealrA6R8RRq4BSaSmFoBAYhAhDBBU7w1GVKgQYzAxuBidSuCEJWJX4E6nmLF4ueJ+5j/AJfUfiys4/73axqy7hlWNC7RyV+4IKtslu6s/uXVGTIxu3Tuo1Ors7IHaFUUBfWXBDRmiEj0q0+CJhi1gWqFgPNw3n3SfFqyZAVG6vFpamiQaAoIeRlzcVKd0WCPqLXzfUBd3BKCoDwRH96RhpkMDAmd+e4egRX1nfhc/QzRwUbh4DqY98dqixY4wckeoHRCVKhFEo4wSo1FhMIQZ5mIQ7hNcMeGhIeoBtY/CU031/1HR9xbTMqcu7NsJpFZeGCSjc5auIwY/pjPXyHuIhvSmceEZwpGjfFg/vEKCpS/mNH0RRV4iLuC3ARLEQeNk4AoGxg/SqOqaYWVQI0s3OkV8Kks88zanD7VNX9oyx5TUYWH0ZPs6lEFES5hFZmy0lE1rgMrzX8HRERi4QTuaRYQhi5eIvFRICtEOwWzcdFvB37x1Ea5tFEGl5SXb8Re6vEOlM7nV1UVijkWr9RJHgUxNKNVjOYuLgPsnaK/pEytgwgvXJNjUMtRNCJblQWI7EggZ/hTK3z0vcKQhne/c8+XyN4c6dHBstgd/wDRh+1IWB0j4gxKxLJtmDMXAaJXhpgsVk0/gGXiHHtMItwnXAxAxGOoMNkIDURAa9mU7e/H78ShO1pS1VyxAlFBUFAf8TMPiHaBAlrwRH0rTotY7yfuKaaooDJdLzv3bKgehoHqJEg258YczXgRIU0aQPETAnY6O10j/wCphElp4z36H+inUaJ/HxPgGiOk9MvnWnBXq99vHwniBUsqoBIE2xCxwXmW3HuCxvA/4SEGDBgmUnHtw+omL4hmEMcCpfsfT/5LulM7i2OpS1LepeQZgT4I8FJblW0rurfr3K1R6aU2vbARwRZhthQ3qHjHlHBT1MHAwYBqs0u/Y78YZbKUdva/s1dJtjjQAWBWFa6bH3nbL7mruk0+zT7iuGFp6JUJqK5UBiLylH8BUOLhxp3AckSBBGOEVsAsrFHZnoHtjpcq+oiGQMsUKZXcJewgwdeHAv2xEprNlOrna1rNRrw4NHy+X3MdwQSRN1KYcwFRZqU6mbiXsxcBkBWo2NR34wwDXu8P040YVwFGV38nnF7GB+vSxNLbWQU6YeI8DSMTPCRd1PXBIAP4RhDWZ3CfOYQuVF3FiKdRS8xmU2KAbY0UMjs8/bDFquOsrjIooA7jfHPFauqgzs/AwpRt07VHtMV4vzCbIsGH0RdxQqZJ6ZcaiqsIi1ESCJdjXxrSk4V4G3UPndE3VoYtK3eoVDIHJC6L8Fv7ZXxAGBUQrXCqz1z1wCAH8h4hCHBYLBmCEaRy8zvwyMB17D+36jdWP8J6TLjoABaszbLUdZB5Wb8e4scGky608qxHqUOSF04F4gNSp1ANVEPBGSwjNJLiUxL1KXBaTZjhu4KkGoOAXC/CZ1/MMHi4TSEqCAyxG44Q21oLdMX8uiEGcKIGaTySpP57oF+AMK3nqYALQfoM/wBjG7ZxjD0NPvfxCdwXMHKpRGsNwyBUrPEoC2JZupX1L+pT1OqohOiYuM6lYjuNphgqKoiVhr+YZSDGKDCViE3lpBrUISz264D5YKF1GYNausUdEv6MPYNtQ9325+Jc5wNXCnzCbJpqOMQJbpL2gCAOYzaVYXXjoISNwkPFAOoPiV9QMPCCaTSdSkpMEOXh5iBX84MGDdwfMIOY5cILlEDQy4hKCxcD6C6O30zTlAPEC8EHxAdIl2ph1CRqUtIQGVYRzFyxLiVkFsKsyg43zPMcR3ACHMMOPwSypjY5szwoQZmn8twgwXDc7/AwiVE0iM3ZCvUGrgIjCQcCMwUyVjhqKWDLmFBhVBUF1AZQgSBiDHBghr8QSJgCBUAfzf/Z";let y=class extends I{constructor(){super(...arguments),this._message=null,this._refImage=n(),this._boundVisibilityHandler=this._visibilityHandler.bind(this),this._mediaLoadedInfo=null}async play(){this._cachedValueController?.startTimer()}async pause(){this._cachedValueController?.stopTimer()}async mute(){}async unmute(){}isMuted(){return!0}async seek(A){}async setControls(A){}isPaused(){return!this._cachedValueController?.hasTimer()}async getScreenshotURL(){return this._cachedValueController?.value??null}_getCameraEntity(){return(this.cameraConfig?.camera_entity||this.cameraConfig?.webrtc_card?.entity)??null}shouldUpdate(A){if(!this.hass||"visible"!==document.visibilityState)return!1;const e=this._getRelevantEntityForMode(this._resolveMode(this.imageConfig?.mode));return!A.has("hass")||1!=A.size||!e||(E(this.hass,A.get("hass"),[e])?(this._cachedValueController?.clearValue(),!0):!this.hasUpdated)}willUpdate(A){A.has("imageConfig")&&(this._cachedValueController&&this._cachedValueController.removeController(),this.imageConfig&&(this._cachedValueController=new k(this,this.imageConfig.refresh_seconds,this._getImageSource.bind(this),(()=>u(this)),(()=>m(this)))));const e=this._getRelevantEntityForMode(this._resolveMode(this.imageConfig?.mode));(A.has("cameraConfig")||A.has("view")||e&&!this._getAcceptableState(e))&&this._cachedValueController?.clearValue(),this._cachedValueController?.value||this._cachedValueController?.updateValue(),["imageConfig","view"].some((e=>A.has(e)))&&(this._message=null)}_getAcceptableState(A){const e=(A?this.hass?.states[A]:null)??null;return this.hass&&this.hass.connected&&e&&Date.now()-Date.parse(e.last_updated)<3e5?e:null}connectedCallback(){super.connectedCallback(),document.addEventListener("visibilitychange",this._boundVisibilityHandler),this._cachedValueController?.startTimer()}disconnectedCallback(){this._cachedValueController?.stopTimer(),this._message=null,document.removeEventListener("visibilitychange",this._boundVisibilityHandler),super.disconnectedCallback()}_visibilityHandler(){this._refImage.value&&("hidden"===document.visibilityState?(this._cachedValueController?.stopTimer(),this._cachedValueController?.clearValue(),this._forceSafeImage()):(this._cachedValueController?.startTimer(),this.requestUpdate()))}_buildImageURL(A){return A.searchParams.append("_t",String(Date.now())),A.toString()}_addQueryParametersToURL(A,e){if(e){const t=new URLSearchParams(e);for(const[e,i]of t.entries())A.searchParams.append(e,i)}return A}_getRelevantEntityForMode(A){return"camera"===A?this._getCameraEntity():"entity"===A?this.imageConfig?.entity??null:null}_resolveMode(A){if(!A)return"screensaver";if("auto"!==A)return A;const e=this._getCameraEntity();return this.imageConfig?.entity?"entity":this.imageConfig?.url?"url":e?"camera":"screensaver"}_getImageSource(){const A=this._resolveMode(this.imageConfig?.mode);if(this.hass&&"camera"===A){const A=this._getAcceptableState(this._getCameraEntity());if(A?.attributes.entity_picture){const e=new URL(A.attributes.entity_picture,document.baseURI);return this._addQueryParametersToURL(e,this.imageConfig?.entity_parameters),this._buildImageURL(e)}}if(this.hass&&"entity"===A&&this.imageConfig?.entity){const A=this._getAcceptableState(this.imageConfig?.entity);if(A?.attributes.entity_picture){const e=new URL(A.attributes.entity_picture,document.baseURI);return this._addQueryParametersToURL(e,this.imageConfig?.entity_parameters),this._buildImageURL(e)}}return"url"===A&&this.imageConfig?.url?this._buildImageURL(new URL(this.imageConfig.url,document.baseURI)):U}_forceSafeImage(A){this._refImage.value&&(this._refImage.value.src=!A&&this.imageConfig?.url?this.imageConfig.url:U)}render(){if(this._message)return w(this._message);const A=this._cachedValueController?.value;return A?Q` + {const e=B(A,{player:this,capabilities:{supportsPause:!!this.imageConfig?.refresh_seconds}});e&&!d(this._mediaLoadedInfo,e)&&(this._mediaLoadedInfo=e,b(this,e))}} + @error=${()=>{const A=this._resolveMode(this.imageConfig?.mode);"camera"===A||"entity"===A?this._forceSafeImage(!0):"url"===A&&(this._message={type:"error",message:L("error.image_load_error"),context:this.imageConfig})}} + /> + `:Q``}static get styles(){return D(':host {\n background-color: var(--primary-background-color);\n background-position: center;\n background-repeat: no-repeat;\n background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4yLjIgKGIwYTg0ODY1NDEsIDIwMjItMTItMDEpIgogICBzb2RpcG9kaTpkb2NuYW1lPSJjYW1lcmEtaXJpcy5zdmciCiAgIGlkPSJzdmc0IgogICB2ZXJzaW9uPSIxLjEiCiAgIHZpZXdCb3g9IjAgMCAyNCAyNCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZGVmcwogICAgIGlkPSJkZWZzOCIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaWQ9Im5hbWVkdmlldzYiCiAgICAgcGFnZWNvbG9yPSIjYjkzZTNlIgogICAgIGJvcmRlcmNvbG9yPSIjMDAwMDAwIgogICAgIGJvcmRlcm9wYWNpdHk9IjAuMjUiCiAgICAgaW5rc2NhcGU6c2hvd3BhZ2VzaGFkb3c9IjIiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAuNjA3ODQzMTQiCiAgICAgaW5rc2NhcGU6cGFnZWNoZWNrZXJib2FyZD0iZmFsc2UiCiAgICAgaW5rc2NhcGU6ZGVza2NvbG9yPSIjZDFkMWQxIgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpbmtzY2FwZTp6b29tPSIyNi42MjUwNiIKICAgICBpbmtzY2FwZTpjeD0iLTEuOTM0MjY4IgogICAgIGlua3NjYXBlOmN5PSIxNS42ODA3MTYiCiAgICAgaW5rc2NhcGU6d2luZG93LXdpZHRoPSIzODQwIgogICAgIGlua3NjYXBlOndpbmRvdy1oZWlnaHQ9IjE1MjciCiAgICAgaW5rc2NhcGU6d2luZG93LXg9IjEwODAiCiAgICAgaW5rc2NhcGU6d2luZG93LXk9IjIyNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctbWF4aW1pemVkPSIxIgogICAgIGlua3NjYXBlOmN1cnJlbnQtbGF5ZXI9InN2ZzQiIC8+CiAgPGcKICAgICBpZD0iZzExMTkiCiAgICAgc3R5bGU9ImZpbGwtb3BhY2l0eTowLjA1O2ZpbGw6I2ZmZmZmZiI+CiAgICA8Y2lyY2xlCiAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eTowLjA1O3N0cm9rZS13aWR0aDoxLjM5NzI5IgogICAgICAgaWQ9InBhdGgxNzAiCiAgICAgICBjeD0iMTIiCiAgICAgICBjeT0iMTIiCiAgICAgICBpbmtzY2FwZTpsYWJlbD0iV2hpdGUgQmFja2dyb3VuZCIKICAgICAgIHI9IjExLjI1IiAvPgogICAgPHBhdGgKICAgICAgIGQ9Ik0gMTMuNzMwMDAxLDE1IDkuODMwMDAwMywyMS43NiBDIDEwLjUzLDIxLjkxIDExLjI1LDIyIDEyLDIyIGMgMi40MDAwMDEsMCA0LjYsLTAuODUgNi4zMiwtMi4yNSBMIDE0LjY2MDAwMSwxMy40IE0gMi40NjAwMDAzLDE1IGMgMC45MiwyLjkyIDMuMTUsNS4yNiA1Ljk5LDYuMzQgTCAxMi4xMiwxNSBtIC0zLjU3OTk5OTcsLTMgLTMuOSwtNi43NDk5OTk2IGMgLTEuNjQsMS43NDk5OTkgLTIuNjQsNC4xMzk5OTkzIC0yLjY0LDYuNzQ5OTk5NiAwLDAuNjggMC4wNywxLjM1IDAuMiwyIGggNy40OSBNIDIxLjgsOS45OTk5OTk3IEggMTQuMzEwMDAxIEwgMTQuNjAwMDAxLDEwLjUgMTkuMzYsMTguNzUgQyAyMSwxNi45NyAyMiwxNC42IDIyLDEyIDIyLDExLjMxIDIxLjkzLDEwLjY0IDIxLjgsOS45OTk5OTk3IG0gLTAuMjYsLTEgQyAyMC42Miw2LjA3MDAwMDUgMTguMzksMy43NDAwMDAyIDE1LjU1MDAwMSwyLjY2MDAwMDIgTCAxMS44OCw4Ljk5OTk5OTcgTSA5LjQwMDAwMDMsMTAuNSAxNC4xNzAwMDEsMi4yNDAwMDAyIGMgLTAuNywtMC4xNSAtMS40MjAwMDEsLTAuMjQgLTIuMTcwMDAxLC0wLjI0IC0yLjM5OTk5OTcsMCAtNC41OTk5OTk3LDAuODQgLTYuMzE5OTk5NywyLjI1MDAwMDMgbCAzLjY2LDYuMzQ5OTk5NSB6IgogICAgICAgaWQ9InBhdGgyIgogICAgICAgaW5rc2NhcGU6bGFiZWw9IklyaXMiCiAgICAgICBzdHlsZT0iZmlsbC1vcGFjaXR5OjAuMDU7ZmlsbDojZmZmZmZmIiAvPgogIDwvZz4KPC9zdmc+Cg==");\n background-size: 10%;\n background-position: center;\n}\n\nimg {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n object-view-box: inset(var(--frigate-card-media-layout-view-box-top, 0%) var(--frigate-card-media-layout-view-box-right, 0%) var(--frigate-card-media-layout-view-box-bottom, 0%) var(--frigate-card-media-layout-view-box-left, 0%));\n}')}};o([c({attribute:!1})],y.prototype,"hass",void 0),o([c({attribute:!1})],y.prototype,"view",void 0),o([c({attribute:!1})],y.prototype,"cameraConfig",void 0),o([c({attribute:!1})],y.prototype,"cameraManager",void 0),o([c({attribute:!1,hasChanged:h})],y.prototype,"imageConfig",void 0),o([C()],y.prototype,"_message",void 0),y=o([l("frigate-card-image")],y);export{y as FrigateCardImage}; diff --git a/config/www/community/frigate-hass-card/image-04d4df35.js.gz b/config/www/community/frigate-hass-card/image-04d4df35.js.gz new file mode 100644 index 00000000..57775fd4 Binary files /dev/null and b/config/www/community/frigate-hass-card/image-04d4df35.js.gz differ diff --git a/config/www/community/frigate-hass-card/image-c4c28ccb.js b/config/www/community/frigate-hass-card/image-c4c28ccb.js new file mode 100644 index 00000000..7f878690 --- /dev/null +++ b/config/www/community/frigate-hass-card/image-c4c28ccb.js @@ -0,0 +1,9 @@ +import{a as e,cL as a,x as t,cP as s,r as i,cZ as r,_ as u,n as g,t as m}from"./card-e5d55e5b.js";import"./image-04d4df35.js";let n=class extends e{constructor(){super(...arguments),this._refImage=a()}async play(){await(this._refImage.value?.play())}async pause(){await(this._refImage.value?.pause())}async mute(){await(this._refImage.value?.mute())}async unmute(){await(this._refImage.value?.unmute())}isMuted(){return!!this._refImage.value?.isMuted()}async seek(e){await(this._refImage.value?.seek(e))}async setControls(e){await(this._refImage.value?.setControls(e))}isPaused(){return this._refImage.value?.isPaused()??!0}async getScreenshotURL(){return await(this._refImage.value?.getScreenshotURL())??null}render(){if(this.hass&&this.cameraConfig)return t` + + + `}static get styles(){return i(r)}};u([g({attribute:!1})],n.prototype,"hass",void 0),u([g({attribute:!1})],n.prototype,"cameraConfig",void 0),n=u([m("frigate-card-live-image")],n);export{n as FrigateCardLiveImage}; diff --git a/config/www/community/frigate-hass-card/image-c4c28ccb.js.gz b/config/www/community/frigate-hass-card/image-c4c28ccb.js.gz new file mode 100644 index 00000000..2a705da2 Binary files /dev/null and b/config/www/community/frigate-hass-card/image-c4c28ccb.js.gz differ diff --git a/config/www/community/frigate-hass-card/index-33ed76c0.js b/config/www/community/frigate-hass-card/index-33ed76c0.js new file mode 100644 index 00000000..86217596 --- /dev/null +++ b/config/www/community/frigate-hass-card/index-33ed76c0.js @@ -0,0 +1 @@ +import{dr as e,ds as t,dt as i,du as s,a as n,dh as o,l as a,cO as c,x as r,r as h,_ as d,n as l,b as p,t as m}from"./card-e5d55e5b.js";import{s as u,h as v,c as y,d as g}from"./media-921a03ae.js";import{c as f}from"./endpoint-c9cec68c.js";import"./image-04d4df35.js";import{m as b}from"./audio-cf3a75aa.js";import{g as w}from"./get-technology-for-video-rtc-778a0c05.js";class S extends HTMLElement{constructor(){super(),this.DISCONNECT_TIMEOUT=5e3,this.RECONNECT_TIMEOUT=15e3,this.CODECS=["avc1.640029","avc1.64002A","avc1.640033","hvc1.1.6.L153.B0","mp4a.40.2","mp4a.40.5","flac","opus"],this.mode="webrtc,mse,hls,mjpeg",this.media="video,audio",this.background=!1,this.visibilityThreshold=0,this.visibilityCheck=!0,this.pcConfig={bundlePolicy:"max-bundle",iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"},this.wsState=WebSocket.CLOSED,this.pcState=WebSocket.CLOSED,this.video=null,this.ws=null,this.wsURL="",this.pc=null,this.connectTS=0,this.mseCodecs="",this.disconnectTID=0,this.reconnectTID=0,this.ondata=null,this.onmessage=null,this.microphoneStream=null,this.containingPlayer=null,this.controls=!0}reconnect(){this.wsState!==WebSocket.CLOSED?(this.ws?.addEventListener("close",(()=>this.onconnect())),this.ondisconnect()):(this.ondisconnect(),this.onconnect())}set src(e){"string"!=typeof e&&(e=e.toString()),e.startsWith("http")?e="ws"+e.substring(4):e.startsWith("/")&&(e="ws"+location.origin.substring(4)+e),this.wsURL=e,this.onconnect()}play(){}send(e){this.ws&&this.ws.send(JSON.stringify(e))}codecs(e){return this.CODECS.filter((e=>this.media.indexOf(e.indexOf("vc1")>0?"video":"audio")>=0)).filter((t=>e(`video/mp4; codecs="${t}"`))).join()}connectedCallback(){if(this.disconnectTID&&(clearTimeout(this.disconnectTID),this.disconnectTID=0),this.video){const e=this.video.seekable;e.length>0&&(this.video.currentTime=e.end(e.length-1)),this.play()}else this.oninit();this.onconnect()}disconnectedCallback(){this.background||this.disconnectTID||this.wsState===WebSocket.CLOSED&&this.pcState===WebSocket.CLOSED||(this.disconnectTID=setTimeout((()=>{this.reconnectTID&&(clearTimeout(this.reconnectTID),this.reconnectTID=0),this.disconnectTID=0,this.ondisconnect()}),this.DISCONNECT_TIMEOUT))}oninit(){this.video=document.createElement("video"),u(this.video,this.controls),this.video.playsInline=!0,this.video.preload="auto",this.video.style.display="block",this.video.style.width="100%",this.video.style.height="100%",this.appendChild(this.video),this.video.addEventListener("error",(e=>{this.ws&&this.wsState===WebSocket.OPEN&&this.ws.close()}));const n=window.navigator.userAgent.match(/Version\/(\d+).+Safari/);if(n){const e=n[1]<"13"?"mp4a.40.2":n[1]<"14"?"flac":"opus";this.CODECS.splice(this.CODECS.indexOf(e))}if(!this.background){if("hidden"in document&&this.visibilityCheck&&document.addEventListener("visibilitychange",(()=>{document.hidden?this.disconnectedCallback():this.isConnected&&this.connectedCallback()})),"IntersectionObserver"in window&&this.visibilityThreshold){new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting?this.isConnected&&this.connectedCallback():this.disconnectedCallback()}))}),{threshold:this.visibilityThreshold}).observe(this)}this.video.onloadeddata=()=>{this.controls&&v(this.video,y),e(this,this.video,{player:this.containingPlayer,capabilities:{supports2WayAudio:!!this.pc,supportsPause:!0,hasAudio:b(this.video)},technology:w(this)})},this.video.onvolumechange=()=>t(this),this.video.onplay=()=>i(this),this.video.onpause=()=>s(this),this.video.muted=!0}}onconnect(){return!(!this.isConnected||!this.wsURL||this.ws||this.pc)&&(this.wsState=WebSocket.CONNECTING,this.connectTS=Date.now(),this.ws=new WebSocket(this.wsURL),this.ws.binaryType="arraybuffer",this.ws.addEventListener("open",(e=>this.onopen(e))),this.ws.addEventListener("close",(e=>this.onclose(e))),!0)}ondisconnect(){this.wsState=WebSocket.CLOSED,this.ws&&(this.ws.close(),this.ws=null),this.pcState=WebSocket.CLOSED,this.pc&&(this.pc.getSenders().forEach((e=>{e.track&&e.track.stop()})),this.pc.close(),this.pc=null),this.video.src="",this.video.srcObject=null}onopen(){this.wsState=WebSocket.OPEN,this.ws.addEventListener("message",(e=>{if("string"==typeof e.data){const t=JSON.parse(e.data);for(const e in this.onmessage)this.onmessage[e](t)}else this.ondata(e.data)})),this.ondata=null,this.onmessage={};const e=[];return this.mode.indexOf("mse")>=0&&("MediaSource"in window||"ManagedMediaSource"in window)?(e.push("mse"),this.onmse()):this.mode.indexOf("hls")>=0&&this.video.canPlayType("application/vnd.apple.mpegurl")?(e.push("hls"),this.onhls()):this.mode.indexOf("mp4")>=0&&(e.push("mp4"),this.onmp4()),this.mode.indexOf("webrtc")>=0&&"RTCPeerConnection"in window&&(e.push("webrtc"),this.onwebrtc()),this.mode.indexOf("mjpeg")>=0&&(e.length?this.onmessage.mjpeg=t=>{"error"===t.type&&0===t.value.indexOf(e[0])&&this.onmjpeg()}:(e.push("mjpeg"),this.onmjpeg())),e}onclose(){if(this.wsState===WebSocket.CLOSED)return!1;this.wsState=WebSocket.CONNECTING,this.ws=null;const e=Math.max(this.RECONNECT_TIMEOUT-(Date.now()-this.connectTS),0);return this.reconnectTID=setTimeout((()=>{this.reconnectTID=0,this.onconnect()}),e),!0}onmse(){let e;if("ManagedMediaSource"in window){const t=window.ManagedMediaSource;e=new t,e.addEventListener("sourceopen",(()=>{this.send({type:"mse",value:this.codecs(t.isTypeSupported)})}),{once:!0}),this.video.disableRemotePlayback=!0,this.video.srcObject=e}else e=new MediaSource,e.addEventListener("sourceopen",(()=>{URL.revokeObjectURL(this.video.src),this.send({type:"mse",value:this.codecs(MediaSource.isTypeSupported)})}),{once:!0}),this.video.src=URL.createObjectURL(e),this.video.srcObject=null;this.play(),this.mseCodecs="",this.onmessage.mse=t=>{if("mse"!==t.type)return;this.mseCodecs=t.value;const i=e.addSourceBuffer(t.value);i.mode="segments",i.addEventListener("updateend",(()=>{if(!i.updating)try{if(n>0){const e=s.slice(0,n);n=0,i.appendBuffer(e)}else if(i.buffered&&i.buffered.length){const t=i.buffered.end(i.buffered.length-1)-15,s=i.buffered.start(0);t>s&&(i.remove(s,t),e.setLiveSeekableRange(t,t+15))}}catch(e){}}));const s=new Uint8Array(2097152);let n=0;this.ondata=e=>{if(i.updating||n>0){const t=new Uint8Array(e);s.set(t,n),n+=t.byteLength}else try{i.appendBuffer(e)}catch(e){}}}}onwebrtc(){const e=new RTCPeerConnection(this.pcConfig);e.addEventListener("icecandidate",(e=>{if(e.candidate&&this.mode.indexOf("webrtc/tcp")>=0&&"udp"===e.candidate.protocol)return;const t=e.candidate?e.candidate.toJSON().candidate:"";this.send({type:"webrtc/candidate",value:t})})),e.addEventListener("connectionstatechange",(()=>{if("connected"===e.connectionState){const t=e.getTransceivers().filter((e=>"recvonly"===e.currentDirection)).map((e=>e.receiver.track)),i=document.createElement("video");i.addEventListener("loadeddata",(()=>this.onpcvideo(i)),{once:!0}),i.srcObject=new MediaStream(t)}else"failed"!==e.connectionState&&"disconnected"!==e.connectionState||(e.close(),this.pcState=WebSocket.CLOSED,this.pc=null,this.onconnect())})),this.onmessage.webrtc=t=>{switch(t.type){case"webrtc/candidate":if(this.mode.indexOf("webrtc/tcp")>=0&&t.value.indexOf(" udp ")>0)return;e.addIceCandidate({candidate:t.value,sdpMid:"0"}).catch((e=>{console.warn(e)}));break;case"webrtc/answer":e.setRemoteDescription({type:"answer",sdp:t.value}).catch((e=>{console.warn(e)}));break;case"error":if(t.value.indexOf("webrtc/offer")<0)return;e.close()}},this.createOffer(e).then((e=>{this.send({type:"webrtc/offer",value:e.sdp})})),this.pcState=WebSocket.CONNECTING,this.pc=e}async createOffer(e){this.microphoneStream?.getTracks().forEach((t=>{e.addTransceiver(t,{direction:"sendonly"})}));try{if(this.media.indexOf("microphone")>=0){(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach((t=>{e.addTransceiver(t,{direction:"sendonly"})}))}}catch(e){console.warn(e)}for(const t of["video","audio"])this.media.indexOf(t)>=0&&e.addTransceiver(t,{direction:"recvonly"});const t=await e.createOffer();return await e.setLocalDescription(t),t}onpcvideo(e){if(this.pc){let t=0,i=0;const s=e.srcObject;s.getVideoTracks().length>0&&(t+=544),s.getAudioTracks().length>0&&(t+=258),this.mseCodecs.indexOf("hvc1.")>=0&&(i+=560),this.mseCodecs.indexOf("avc1.")>=0&&(i+=528),this.mseCodecs.indexOf("mp4a.")>=0&&(i+=257),t>=i?(this.video.srcObject=s,this.play(),this.pcState=WebSocket.OPEN,this.wsState=WebSocket.CLOSED,this.ws&&(this.ws.close(),this.ws=null)):(this.pcState=WebSocket.CLOSED,this.pc&&(this.pc.close(),this.pc=null))}e.srcObject=null}onmjpeg(){let t=!1;this.ondata=i=>{u(this.video,!1),this.video.poster="data:image/jpeg;base64,"+S.btoa(i),t||(t=!0,e(this,this.video,{player:this.containingPlayer,technology:["mjpeg"]}))},this.send({type:"mjpeg"})}onhls(){this.onmessage.hls=e=>{if("hls"!==e.type)return;const t="http"+this.wsURL.substring(2,this.wsURL.indexOf("/ws"))+"/hls/",i=e.value.replace("hls/",t);this.video.src="data:application/vnd.apple.mpegurl;base64,"+btoa(i),this.play()},this.send({type:"hls",value:this.codecs((e=>this.video.canPlayType(e)))})}onmp4(){const t=document.createElement("canvas");let i;const s=document.createElement("video");s.autoplay=!0,s.playsInline=!0,s.muted=!0,s.addEventListener("loadeddata",(n=>{i||(t.width=s.videoWidth,t.height=s.videoHeight,i=t.getContext("2d"),e(this,s,{player:this.containingPlayer,technology:["mp4"]})),i.drawImage(s,0,0,t.width,t.height),u(this.video,!1),this.video.poster=t.toDataURL("image/jpeg")})),this.ondata=e=>{s.src="data:video/mp4;base64,"+S.btoa(e)},this.send({type:"mp4",value:this.codecs(this.video.canPlayType)})}static btoa(e){const t=new Uint8Array(e),i=t.byteLength;let s="";for(let e=0;e!e.hasSelectedResult()}}))}async _setURL(){const e=this.media?.getContentID();if(!this.media||!e||!this.hass||this.viewerConfig?.lazy_load&&!this.load)return;let i=this.resolvedMediaCache?.get(e)??null;if(i||(i=await l(this.hass,e,this.resolvedMediaCache)),!i)return;const t=i.url;if(g(t))return void(this._url=h(this.hass,t));const a=this.cameraManager?.getStore().getCamera(this.media.getCameraID()),r=a?.getProxyConfig();if(r&&c(this.hass,r,"media")){if(r.dynamic){const e=t.split(/#/)[0];await u(this.hass,e,{sslVerification:r.ssl_verification,sslCiphers:r.ssl_ciphers,openLimit:0})}try{this._url=await m(this.hass,v(t))}catch(e){C(e)}}else this._url=t}willUpdate(e){if((e.has("load")||e.has("media")||e.has("viewerConfig")||e.has("resolvedMediaCache")||e.has("hass"))&&this._setURL().then((()=>{this.requestUpdate()})),e.has("viewerConfig")&&this.viewerConfig?.zoomable&&import("./zoomer-2b03f2ed.js"),e.has("media")||e.has("cameraManager")){const e=this.media?.getCameraID(),i=e?this.cameraManager?.getStore().getCameraConfig(e):null;S(this,i?.dimensions?.layout),this.style.aspectRatio=p({ratio:i?.dimensions?.aspect_ratio})}}_useZoomIfRequired(e){if(!this.media)return e;const i=this.media.getCameraID(),t=this.media.getID()??void 0,a=this.cameraManager?.getStore().getCameraConfig(i),r=this.viewManagerEpoch?.manager.getView();return this.viewerConfig?.zoomable?w` a?.dimensions?.layout?{pan:a.dimensions.layout.pan,zoom:a.dimensions.layout.zoom}:void 0))} + .settings=${t?r?.context?.zoom?.[t]?.requested:void 0} + @frigate-card:zoom:zoomed=${()=>this.setControls(!1)} + @frigate-card:zoom:unzoomed=${()=>this.setControls()} + @frigate-card:zoom:change=${e=>f(e,this.viewManagerEpoch?.manager,t)} + > + ${e} + `:e}render(){if(this.load&&this.media&&this.hass&&this.viewerConfig)return this._url?this._useZoomIfRequired(w` + ${n.isVideo(this.media)?this.media.getVideoContentType()===Q.HLS?w` + `:w` + + `:w`{this.viewerConfig?.snapshot_click_plays_clip&&this._switchToRelatedClipView()}} + @load=${e=>{y(this,e,{player:this,technology:["jpg"]})}} + />`} + `):I({cardWideConfig:this.cardWideConfig})}static get styles(){return D(':host {\n background-color: var(--primary-background-color);\n background-position: center;\n background-repeat: no-repeat;\n background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4yLjIgKGIwYTg0ODY1NDEsIDIwMjItMTItMDEpIgogICBzb2RpcG9kaTpkb2NuYW1lPSJjYW1lcmEtaXJpcy5zdmciCiAgIGlkPSJzdmc0IgogICB2ZXJzaW9uPSIxLjEiCiAgIHZpZXdCb3g9IjAgMCAyNCAyNCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZGVmcwogICAgIGlkPSJkZWZzOCIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaWQ9Im5hbWVkdmlldzYiCiAgICAgcGFnZWNvbG9yPSIjYjkzZTNlIgogICAgIGJvcmRlcmNvbG9yPSIjMDAwMDAwIgogICAgIGJvcmRlcm9wYWNpdHk9IjAuMjUiCiAgICAgaW5rc2NhcGU6c2hvd3BhZ2VzaGFkb3c9IjIiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAuNjA3ODQzMTQiCiAgICAgaW5rc2NhcGU6cGFnZWNoZWNrZXJib2FyZD0iZmFsc2UiCiAgICAgaW5rc2NhcGU6ZGVza2NvbG9yPSIjZDFkMWQxIgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpbmtzY2FwZTp6b29tPSIyNi42MjUwNiIKICAgICBpbmtzY2FwZTpjeD0iLTEuOTM0MjY4IgogICAgIGlua3NjYXBlOmN5PSIxNS42ODA3MTYiCiAgICAgaW5rc2NhcGU6d2luZG93LXdpZHRoPSIzODQwIgogICAgIGlua3NjYXBlOndpbmRvdy1oZWlnaHQ9IjE1MjciCiAgICAgaW5rc2NhcGU6d2luZG93LXg9IjEwODAiCiAgICAgaW5rc2NhcGU6d2luZG93LXk9IjIyNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctbWF4aW1pemVkPSIxIgogICAgIGlua3NjYXBlOmN1cnJlbnQtbGF5ZXI9InN2ZzQiIC8+CiAgPGcKICAgICBpZD0iZzExMTkiCiAgICAgc3R5bGU9ImZpbGwtb3BhY2l0eTowLjA1O2ZpbGw6I2ZmZmZmZiI+CiAgICA8Y2lyY2xlCiAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eTowLjA1O3N0cm9rZS13aWR0aDoxLjM5NzI5IgogICAgICAgaWQ9InBhdGgxNzAiCiAgICAgICBjeD0iMTIiCiAgICAgICBjeT0iMTIiCiAgICAgICBpbmtzY2FwZTpsYWJlbD0iV2hpdGUgQmFja2dyb3VuZCIKICAgICAgIHI9IjExLjI1IiAvPgogICAgPHBhdGgKICAgICAgIGQ9Ik0gMTMuNzMwMDAxLDE1IDkuODMwMDAwMywyMS43NiBDIDEwLjUzLDIxLjkxIDExLjI1LDIyIDEyLDIyIGMgMi40MDAwMDEsMCA0LjYsLTAuODUgNi4zMiwtMi4yNSBMIDE0LjY2MDAwMSwxMy40IE0gMi40NjAwMDAzLDE1IGMgMC45MiwyLjkyIDMuMTUsNS4yNiA1Ljk5LDYuMzQgTCAxMi4xMiwxNSBtIC0zLjU3OTk5OTcsLTMgLTMuOSwtNi43NDk5OTk2IGMgLTEuNjQsMS43NDk5OTkgLTIuNjQsNC4xMzk5OTkzIC0yLjY0LDYuNzQ5OTk5NiAwLDAuNjggMC4wNywxLjM1IDAuMiwyIGggNy40OSBNIDIxLjgsOS45OTk5OTk3IEggMTQuMzEwMDAxIEwgMTQuNjAwMDAxLDEwLjUgMTkuMzYsMTguNzUgQyAyMSwxNi45NyAyMiwxNC42IDIyLDEyIDIyLDExLjMxIDIxLjkzLDEwLjY0IDIxLjgsOS45OTk5OTk3IG0gLTAuMjYsLTEgQyAyMC42Miw2LjA3MDAwMDUgMTguMzksMy43NDAwMDAyIDE1LjU1MDAwMSwyLjY2MDAwMDIgTCAxMS44OCw4Ljk5OTk5OTcgTSA5LjQwMDAwMDMsMTAuNSAxNC4xNzAwMDEsMi4yNDAwMDAyIGMgLTAuNywtMC4xNSAtMS40MjAwMDEsLTAuMjQgLTIuMTcwMDAxLC0wLjI0IC0yLjM5OTk5OTcsMCAtNC41OTk5OTk3LDAuODQgLTYuMzE5OTk5NywyLjI1MDAwMDMgbCAzLjY2LDYuMzQ5OTk5NSB6IgogICAgICAgaWQ9InBhdGgyIgogICAgICAgaW5rc2NhcGU6bGFiZWw9IklyaXMiCiAgICAgICBzdHlsZT0iZmlsbC1vcGFjaXR5OjAuMDU7ZmlsbDojZmZmZmZmIiAvPgogIDwvZz4KPC9zdmc+Cg==");\n background-size: 10%;\n background-position: center;\n}\n\n:host {\n display: block;\n width: 100%;\n height: 100%;\n}\n\nimg,\nvideo,\nfrigate-card-ha-hls-player {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n object-view-box: inset(var(--frigate-card-media-layout-view-box-top, 0%) var(--frigate-card-media-layout-view-box-right, 0%) var(--frigate-card-media-layout-view-box-bottom, 0%) var(--frigate-card-media-layout-view-box-left, 0%));\n}\n\nfrigate-card-progress-indicator {\n padding: 30px;\n box-sizing: border-box;\n}')}};e([i({attribute:!1})],H.prototype,"hass",void 0),e([i({attribute:!1})],H.prototype,"viewManagerEpoch",void 0),e([i({attribute:!1})],H.prototype,"media",void 0),e([i({attribute:!1})],H.prototype,"viewerConfig",void 0),e([i({attribute:!1})],H.prototype,"resolvedMediaCache",void 0),e([i({attribute:!1})],H.prototype,"load",void 0),e([i({attribute:!1})],H.prototype,"cameraManager",void 0),e([i({attribute:!1})],H.prototype,"cardWideConfig",void 0),e([t()],H.prototype,"_url",void 0),H=e([a("frigate-card-viewer-provider")],H);let q=class extends r{constructor(){super(...arguments),this.showControls=!0,this._selected=0,this._media=null,this._mediaActionsController=new O,this._player=null,this._refCarousel=s()}updated(e){super.updated(e),e.has("viewManagerEpoch")&&this.viewManagerEpoch?.manager.getView()?.context?.mediaViewer!==this.viewManagerEpoch?.oldView?.context?.mediaViewer&&this._seekHandler(),!this._mediaActionsController.hasRoot()&&this._refCarousel.value&&this._mediaActionsController.initialize(this._refCarousel.value)}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){this._mediaActionsController.destroy(),super.disconnectedCallback()}_getTransitionEffect(){return this.viewerConfig?.transition_effect??k.media_viewer.transition_effect}_getPlugins(){return[R({...this.viewerConfig?.lazy_load&&{lazyLoadCallback:(e,i)=>this._lazyloadSlide(i)}}),U(),Y()]}_getMediaNeighbors(){const e=this._media?.length??0;if(!this._media)return null;const i=this._selected>0?this._selected-1:null,t=this._selected+1{if(!i||!this._media)return;const t=("previous"===e?i.previous?.index:i.next?.index)??null;null!==t&&this._setViewSelectedIndex(t)},a=T(this),r="ltr"===a&&"left"===e||"rtl"===a&&"right"===e?"previous":"next";return w` {t(r),$(e)}} + >`}render(){const e=this._media?.length??0;if(!this._media||!e)return z({message:L("common.no_media"),type:"info",icon:"mdi:multimedia",...this.viewFilterCameraID&&{context:{camera_id:this.viewFilterCameraID}}});const i=this._media[this._selected]??this._media[e-1];if(!this.hass||!this.cameraManager||!i)return;const t=this._getMediaNeighbors(),a=this.viewManagerEpoch?.manager.getView();return w` + {this._setViewSelectedIndex(e.detail.index)}} + @frigate-card:media:loaded=${e=>{this._player=e.detail.player??null,this._seekHandler()}} + @frigate-card:media:unloaded=${()=>{this._player=null}} + > + ${this.showControls?this._renderNextPrevious("left",t):""} + ${W([this._media,a],(()=>this._getSlides()))} + ${this.showControls?this._renderNextPrevious("right",t):""} + + ${a?w` + `:""} +
+ + +
+ `}async _seekHandler(){const e=this.viewManagerEpoch?.manager.getView(),i=e?.context?.mediaViewer?.seek;if(!(this.hass&&i&&this._media&&this._player))return;const t=this._media[this._selected];if(!t)return;const a=t.includesTime(i);N(this,!a,"unseekable"),a||this._player.isPaused()?a&&this._player.isPaused()&&this._player.play():this._player.pause();const r=await(this.cameraManager?.getMediaSeekTime(t,i))??null;null!==r&&this._player.seek(r)}_renderMediaItem(e){const i=this.viewManagerEpoch?.manager.getView();return this.hass&&i&&this.viewerConfig?w`
+ +
`:null}static get styles(){return D(":host {\n position: relative;\n --video-max-height: none;\n}\n\n:host([unselected]) frigate-card-carousel,\n:host([unselected]) .seek-warning {\n pointer-events: none;\n}\n\n:host([unseekable]) frigate-card-carousel {\n filter: brightness(50%);\n}\n\n:host([unseekable]) .seek-warning {\n display: block;\n}\n\n.seek-warning {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n color: white;\n}\n\n.embla__slide {\n height: 100%;\n flex: 0 0 100%;\n}")}};e([i({attribute:!1})],q.prototype,"hass",void 0),e([i({attribute:!1})],q.prototype,"viewManagerEpoch",void 0),e([i({attribute:!1})],q.prototype,"viewFilterCameraID",void 0),e([i({attribute:!1,hasChanged:j})],q.prototype,"viewerConfig",void 0),e([i({attribute:!1})],q.prototype,"resolvedMediaCache",void 0),e([i({attribute:!1})],q.prototype,"cardWideConfig",void 0),e([i({attribute:!1})],q.prototype,"cameraManager",void 0),e([i({attribute:!1})],q.prototype,"showControls",void 0),e([t()],q.prototype,"_selected",void 0),q=e([a("frigate-card-viewer-carousel")],q);let X=class extends r{_renderCarousel(e){const i=this.viewManagerEpoch?.manager.getView()?.camera;return w` + + + `}willUpdate(e){e.has("viewManagerEpoch")&&this._needsGrid()&&import("./media-grid-82029e37.js")}_needsGrid(){const e=this.viewManagerEpoch?.manager.getView(),i=e?.queryResults?.getCameraIDs();return!!e?.isGrid()&&!!e?.supportsMultipleDisplayModes()&&(i?.size??0)>1}_gridSelectCamera(e){const i=this.viewManagerEpoch?.manager.getView();this.viewManagerEpoch?.manager.setViewByParameters({params:{camera:e,queryResults:i?.queryResults?.clone().promoteCameraSelectionToMainSelection(e)}})}render(){const e=this.viewManagerEpoch?.manager.getView(),i=e?.queryResults?.getCameraIDs();return i&&this._needsGrid()?w` + this._gridSelectCamera(e.detail.selected)} + > + ${[...i].map((e=>this._renderCarousel(e)))} + + `:this._renderCarousel()}static get styles(){return D(E)}};e([i({attribute:!1})],X.prototype,"hass",void 0),e([i({attribute:!1})],X.prototype,"viewManagerEpoch",void 0),e([i({attribute:!1})],X.prototype,"viewerConfig",void 0),e([i({attribute:!1})],X.prototype,"resolvedMediaCache",void 0),e([i({attribute:!1})],X.prototype,"cardWideConfig",void 0),e([i({attribute:!1})],X.prototype,"cameraManager",void 0),X=e([a("frigate-card-viewer-grid")],X);let J=class extends r{render(){if(this.hass&&this.viewManagerEpoch&&this.viewerConfig&&this.cameraManager&&this.cardWideConfig){if(!this.viewManagerEpoch.manager.getView()?.queryResults?.hasResults()){const e=!!this.viewManagerEpoch.manager.getView()?.context?.loading?.query;return z({type:"info",message:L(e?"error.awaiting_media":"common.no_media"),icon:"mdi:multimedia",dotdotdot:e})}return w` + `}}static get styles(){return D(":host {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 5px;\n}\n\nfrigate-card-viewer-carousel {\n flex: 1;\n min-height: 0;\n}")}};e([i({attribute:!1})],J.prototype,"hass",void 0),e([i({attribute:!1})],J.prototype,"viewManagerEpoch",void 0),e([i({attribute:!1})],J.prototype,"viewerConfig",void 0),e([i({attribute:!1})],J.prototype,"resolvedMediaCache",void 0),e([i({attribute:!1})],J.prototype,"cameraManager",void 0),e([i({attribute:!1})],J.prototype,"cardWideConfig",void 0),J=e([a("frigate-card-viewer")],J);export{J as FrigateCardViewer}; diff --git a/config/www/community/frigate-hass-card/index-befc50c0.js.gz b/config/www/community/frigate-hass-card/index-befc50c0.js.gz new file mode 100644 index 00000000..b7807a40 Binary files /dev/null and b/config/www/community/frigate-hass-card/index-befc50c0.js.gz differ diff --git a/config/www/community/frigate-hass-card/index-dd357256.js b/config/www/community/frigate-hass-card/index-dd357256.js new file mode 100644 index 00000000..49b3b189 --- /dev/null +++ b/config/www/community/frigate-hass-card/index-dd357256.js @@ -0,0 +1,154 @@ +import{cK as e,_ as i,n as a,b as t,t as r,a as o,cL as s,cH as n,cM as d,cN as g,x as c,cO as h,l,cP as m,e as v,r as p,cQ as u,cR as C,cS as f,cT as I,cU as M,cV as _,cW as w,cX as b,cY as y,cZ as L}from"./card-e5d55e5b.js";import{p as A,u as D,i as $,d as j,M as z,A as E,a as S,b as N}from"./media-921a03ae.js";class k{constructor(e){this._inBackground=!1,this._lastMediaLoadedInfo=null,this._handleMediaLoaded=e=>{this._lastMediaLoadedInfo={source:e.composedPath()[0],mediaLoadedInfo:e.detail},this._inBackground&&e.stopPropagation()},this._host=e,e.addController(this),this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this))}hostConnected(){this._intersectionObserver.observe(this._host),this._host.addEventListener("frigate-card:media:loaded",this._handleMediaLoaded)}hostDisconnected(){this._intersectionObserver.disconnect(),this._host.removeEventListener("frigate-card:media:loaded",this._handleMediaLoaded)}isInBackground(){return this._inBackground}_intersectionHandler(i){const a=this._inBackground;this._inBackground=!i.some((e=>e.isIntersecting)),!this._inBackground&&this._lastMediaLoadedInfo&&e(this._lastMediaLoadedInfo.source,this._lastMediaLoadedInfo.mediaLoadedInfo),a!==this._inBackground&&this._host.requestUpdate()}}let x=class extends o{constructor(){super(...arguments),this.load=!1,this.label="",this._isVideoMediaLoaded=!1,this._hasProviderError=!1,this._refProvider=s(),this._importPromises=[]}async play(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await A(this,this._refProvider.value)}async pause(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.pause())}async mute(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.mute())}async unmute(){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.unmute())}isMuted(){return this._refProvider.value?.isMuted()??!0}async seek(e){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.seek(e))}async setControls(e){await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.setControls(e))}isPaused(){return this._refProvider.value?.isPaused()??!0}async getScreenshotURL(){return await this.updateComplete,await(this._refProvider.value?.updateComplete),await(this._refProvider.value?.getScreenshotURL())??null}_getResolvedProvider(){return"auto"===this.cameraConfig?.live_provider?this.cameraConfig?.webrtc_card?.entity||this.cameraConfig?.webrtc_card?.url?"webrtc-card":this.cameraConfig?.camera_entity?"ha":this.cameraConfig?.frigate.camera_name?"jsmpeg":n.cameras.live_provider:this.cameraConfig?.live_provider||"image"}_shouldShowImageDuringLoading(){return!(!this.cameraConfig?.camera_entity||!this.hass||!this.liveConfig?.show_image_during_load||this._hasProviderError)}disconnectedCallback(){this._isVideoMediaLoaded=!1}_videoMediaShowHandler(){this._isVideoMediaLoaded=!0}_providerErrorHandler(){this._hasProviderError=!0}willUpdate(e){if(e.has("load")&&(this.load||(this._isVideoMediaLoaded=!1,d(this))),e.has("liveConfig")&&(this.liveConfig?.show_image_during_load&&this._importPromises.push(import("./image-c4c28ccb.js")),this.liveConfig?.zoomable&&this._importPromises.push(import("./zoomer-2b03f2ed.js"))),e.has("cameraConfig")){const e=this._getResolvedProvider();"jsmpeg"===e?this._importPromises.push(import("./jsmpeg-1cb0aa9d.js")):"ha"===e?this._importPromises.push(import("./ha-45d9145a.js")):"webrtc-card"===e?this._importPromises.push(import("./webrtc-card-bb4c56e2.js")):"image"===e?this._importPromises.push(import("./image-c4c28ccb.js")):"go2rtc"===e&&this._importPromises.push(import("./index-33ed76c0.js")),D(this,this.cameraConfig?.dimensions?.layout),this.style.aspectRatio=g({ratio:this.cameraConfig?.dimensions?.aspect_ratio})}}async getUpdateComplete(){const e=await super.getUpdateComplete();return await Promise.all(this._importPromises),this._importPromises=[],e}_useZoomIfRequired(e){return this.liveConfig?.zoomable?c` this.cameraConfig?.dimensions?.layout?{pan:this.cameraConfig.dimensions.layout.pan,zoom:this.cameraConfig.dimensions.layout.zoom}:void 0))} + .settings=${this.zoomSettings} + @frigate-card:zoom:zoomed=${()=>this.setControls(!1)} + @frigate-card:zoom:unzoomed=${()=>this.setControls()} + > + ${e} + `:e}render(){if(!(this.load&&this.hass&&this.liveConfig&&this.cameraConfig))return;this.title=this.label,this.ariaLabel=this.label;const e=this._getResolvedProvider(),i=!this._isVideoMediaLoaded&&this._shouldShowImageDuringLoading(),a={hidden:i};if("ha"===e||"image"===e||this.cameraConfig?.camera_entity&&this.cameraConfig.always_error_if_entity_unavailable){if(!this.cameraConfig?.camera_entity)return j(this),h({message:l("error.no_live_camera"),type:"error",icon:"mdi:camera",context:this.cameraConfig});const e=this.hass.states[this.cameraConfig.camera_entity];if(!e)return j(this),h({message:l("error.live_camera_not_found"),type:"error",icon:"mdi:camera",context:this.cameraConfig});if("unavailable"===e.state)return j(this),d(this),h({message:`${l("error.live_camera_unavailable")}${this.label?`: ${this.label}`:""}`,type:"info",icon:"mdi:cctv-off",dotdotdot:!0})}return c`${this._useZoomIfRequired(c` + ${i||"image"===e?c` this._providerErrorHandler()} + @frigate-card:media:loaded=${i=>{"image"===e?this._videoMediaShowHandler():i.stopPropagation()}} + > + `:c``} + ${"ha"===e?c` this._providerErrorHandler()} + @frigate-card:media:loaded=${this._videoMediaShowHandler.bind(this)} + > + `:"go2rtc"===e?c`this._providerErrorHandler()} + @frigate-card:media:loaded=${this._videoMediaShowHandler.bind(this)} + > + `:"webrtc-card"===e?c`this._providerErrorHandler()} + @frigate-card:media:loaded=${this._videoMediaShowHandler.bind(this)} + > + `:"jsmpeg"===e?c` this._providerErrorHandler()} + @frigate-card:media:loaded=${this._videoMediaShowHandler.bind(this)} + > + `:c``} + `)} + ${i&&!this._isVideoMediaLoaded?c``:""} `}static get styles(){return p(':host {\n background-color: var(--primary-background-color);\n background-position: center;\n background-repeat: no-repeat;\n background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4yLjIgKGIwYTg0ODY1NDEsIDIwMjItMTItMDEpIgogICBzb2RpcG9kaTpkb2NuYW1lPSJjYW1lcmEtaXJpcy5zdmciCiAgIGlkPSJzdmc0IgogICB2ZXJzaW9uPSIxLjEiCiAgIHZpZXdCb3g9IjAgMCAyNCAyNCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZGVmcwogICAgIGlkPSJkZWZzOCIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaWQ9Im5hbWVkdmlldzYiCiAgICAgcGFnZWNvbG9yPSIjYjkzZTNlIgogICAgIGJvcmRlcmNvbG9yPSIjMDAwMDAwIgogICAgIGJvcmRlcm9wYWNpdHk9IjAuMjUiCiAgICAgaW5rc2NhcGU6c2hvd3BhZ2VzaGFkb3c9IjIiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAuNjA3ODQzMTQiCiAgICAgaW5rc2NhcGU6cGFnZWNoZWNrZXJib2FyZD0iZmFsc2UiCiAgICAgaW5rc2NhcGU6ZGVza2NvbG9yPSIjZDFkMWQxIgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpbmtzY2FwZTp6b29tPSIyNi42MjUwNiIKICAgICBpbmtzY2FwZTpjeD0iLTEuOTM0MjY4IgogICAgIGlua3NjYXBlOmN5PSIxNS42ODA3MTYiCiAgICAgaW5rc2NhcGU6d2luZG93LXdpZHRoPSIzODQwIgogICAgIGlua3NjYXBlOndpbmRvdy1oZWlnaHQ9IjE1MjciCiAgICAgaW5rc2NhcGU6d2luZG93LXg9IjEwODAiCiAgICAgaW5rc2NhcGU6d2luZG93LXk9IjIyNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctbWF4aW1pemVkPSIxIgogICAgIGlua3NjYXBlOmN1cnJlbnQtbGF5ZXI9InN2ZzQiIC8+CiAgPGcKICAgICBpZD0iZzExMTkiCiAgICAgc3R5bGU9ImZpbGwtb3BhY2l0eTowLjA1O2ZpbGw6I2ZmZmZmZiI+CiAgICA8Y2lyY2xlCiAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eTowLjA1O3N0cm9rZS13aWR0aDoxLjM5NzI5IgogICAgICAgaWQ9InBhdGgxNzAiCiAgICAgICBjeD0iMTIiCiAgICAgICBjeT0iMTIiCiAgICAgICBpbmtzY2FwZTpsYWJlbD0iV2hpdGUgQmFja2dyb3VuZCIKICAgICAgIHI9IjExLjI1IiAvPgogICAgPHBhdGgKICAgICAgIGQ9Ik0gMTMuNzMwMDAxLDE1IDkuODMwMDAwMywyMS43NiBDIDEwLjUzLDIxLjkxIDExLjI1LDIyIDEyLDIyIGMgMi40MDAwMDEsMCA0LjYsLTAuODUgNi4zMiwtMi4yNSBMIDE0LjY2MDAwMSwxMy40IE0gMi40NjAwMDAzLDE1IGMgMC45MiwyLjkyIDMuMTUsNS4yNiA1Ljk5LDYuMzQgTCAxMi4xMiwxNSBtIC0zLjU3OTk5OTcsLTMgLTMuOSwtNi43NDk5OTk2IGMgLTEuNjQsMS43NDk5OTkgLTIuNjQsNC4xMzk5OTkzIC0yLjY0LDYuNzQ5OTk5NiAwLDAuNjggMC4wNywxLjM1IDAuMiwyIGggNy40OSBNIDIxLjgsOS45OTk5OTk3IEggMTQuMzEwMDAxIEwgMTQuNjAwMDAxLDEwLjUgMTkuMzYsMTguNzUgQyAyMSwxNi45NyAyMiwxNC42IDIyLDEyIDIyLDExLjMxIDIxLjkzLDEwLjY0IDIxLjgsOS45OTk5OTk3IG0gLTAuMjYsLTEgQyAyMC42Miw2LjA3MDAwMDUgMTguMzksMy43NDAwMDAyIDE1LjU1MDAwMSwyLjY2MDAwMDIgTCAxMS44OCw4Ljk5OTk5OTcgTSA5LjQwMDAwMDMsMTAuNSAxNC4xNzAwMDEsMi4yNDAwMDAyIGMgLTAuNywtMC4xNSAtMS40MjAwMDEsLTAuMjQgLTIuMTcwMDAxLC0wLjI0IC0yLjM5OTk5OTcsMCAtNC41OTk5OTk3LDAuODQgLTYuMzE5OTk5NywyLjI1MDAwMDMgbCAzLjY2LDYuMzQ5OTk5NSB6IgogICAgICAgaWQ9InBhdGgyIgogICAgICAgaW5rc2NhcGU6bGFiZWw9IklyaXMiCiAgICAgICBzdHlsZT0iZmlsbC1vcGFjaXR5OjAuMDU7ZmlsbDojZmZmZmZmIiAvPgogIDwvZz4KPC9zdmc+Cg==");\n background-size: 10%;\n background-position: center;\n}\n\n:host {\n display: block;\n height: 100%;\n width: 100%;\n position: relative;\n}\n\n.hidden {\n display: none;\n}\n\nfrigate-card-icon {\n position: absolute;\n top: 10px;\n right: 10px;\n color: var(--primary-color);\n}')}};i([a({attribute:!1})],x.prototype,"hass",void 0),i([a({attribute:!1})],x.prototype,"cameraConfig",void 0),i([a({attribute:!1})],x.prototype,"cameraEndpoints",void 0),i([a({attribute:!1})],x.prototype,"liveConfig",void 0),i([a({attribute:!0,type:Boolean})],x.prototype,"load",void 0),i([a({attribute:!1})],x.prototype,"label",void 0),i([a({attribute:!1})],x.prototype,"cardWideConfig",void 0),i([a({attribute:!1})],x.prototype,"microphoneStream",void 0),i([a({attribute:!1})],x.prototype,"zoomSettings",void 0),i([t()],x.prototype,"_isVideoMediaLoaded",void 0),i([t()],x.prototype,"_hasProviderError",void 0),x=i([r("frigate-card-live-provider")],x);const P="frigate-card-live-provider";let T=class extends o{constructor(){super(...arguments),this._cameraToSlide={},this._refPTZControl=s(),this._refCarousel=s(),this._mediaActionsController=new z,this._mediaHasLoaded=!1}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){this._mediaActionsController.destroy(),super.disconnectedCallback()}_getTransitionEffect(){return this.overriddenLiveConfig?.transition_effect??n.live.transition_effect}_getSelectedCameraIndex(){if(this.viewFilterCameraID)return 0;const e=this.cameraManager?.getStore().getCameraIDsWithCapability("live"),i=this.viewManagerEpoch?.manager.getView();return e?.size&&i?Math.max(0,Array.from(e).indexOf(i.camera)):0}willUpdate(e){(e.has("microphoneManager")||e.has("overriddenLiveConfig"))&&this._mediaActionsController.setOptions({playerSelector:P,...this.overriddenLiveConfig?.auto_play&&{autoPlayConditions:this.overriddenLiveConfig.auto_play},...this.overriddenLiveConfig?.auto_pause&&{autoPauseConditions:this.overriddenLiveConfig.auto_pause},...this.overriddenLiveConfig?.auto_mute&&{autoMuteConditions:this.overriddenLiveConfig.auto_mute},...this.overriddenLiveConfig?.auto_unmute&&{autoUnmuteConditions:this.overriddenLiveConfig.auto_unmute},...(this.overriddenLiveConfig?.auto_unmute||this.overriddenLiveConfig?.auto_mute)&&{microphoneManager:this.microphoneManager,microphoneMuteSeconds:this.overriddenLiveConfig.microphone.mute_after_microphone_mute_seconds}})}_getPlugins(){return[E({...this.overriddenLiveConfig?.lazy_load&&{lazyLoadCallback:(e,i)=>this._lazyloadOrUnloadSlide("load",e,i)},lazyUnloadConditions:this.overriddenLiveConfig?.lazy_unload,lazyUnloadCallback:(e,i)=>this._lazyloadOrUnloadSlide("unload",e,i)}),S(),N()]}_getLazyLoadCount(){return!1===this.overriddenLiveConfig?.lazy_load?null:0}_getSlides(){if(!this.cameraManager)return[[],{}];const e=this.viewManagerEpoch?.manager.getView(),i=this.viewFilterCameraID?new Set([this.viewFilterCameraID]):this.cameraManager?.getStore().getCameraIDsWithCapability("live"),a=[],t={};for(const[r,o]of this.cameraManager.getStore().getCameraConfigEntries(i)){const i=this._getSubstreamCameraID(r,e),s=r===i?o:this.cameraManager?.getStore().getCameraConfig(i),n=s?this._renderLive(i,s):null;n&&(t[r]=a.length,a.push(n))}return[a,t]}_setViewHandler(e){const i=this.cameraManager?.getStore().getCameraIDsWithCapability("live");i?.size&&e.detail.index!==this._getSelectedCameraIndex()&&this._setViewCameraID([...i][e.detail.index])}_setViewCameraID(e){e&&this.viewManagerEpoch?.manager.setViewByParametersWithNewQuery({params:{camera:e}})}_lazyloadOrUnloadSlide(e,i,a){a instanceof HTMLSlotElement&&(a=a.assignedElements({flatten:!0})[0]);const t=a?.querySelector(P);t&&(t.load="load"===e)}_renderLive(e,i){if(!(this.overriddenLiveConfig&&this.nonOverriddenLiveConfig&&this.hass&&this.cameraManager&&this.conditionsManagerEpoch))return;let a=null;try{a=C(this.conditionsManagerEpoch.manager,{live:this.nonOverriddenLiveConfig},{configOverrides:this.overrides,stateOverrides:{camera:e},schema:f}).live}catch(e){return I(this,e)}const t=this.cameraManager.getCameraMetadata(e),r=this.viewManagerEpoch?.manager.getView();return c` +
+ this.cameraManager?.getCameraEndpoints(e)??void 0))} + .label=${t?.title??""} + .liveConfig=${a} + .hass=${this.hass} + .cardWideConfig=${this.cardWideConfig} + .zoomSettings=${r?.context?.zoom?.[e]?.requested} + @frigate-card:zoom:change=${i=>M(i,this.viewManagerEpoch?.manager,e)} + > + +
+ `}_getSubstreamCameraID(e,i){return i?.context?.live?.overrides?.get(e)??e}_getCameraNeighbors(){const e=this.cameraManager?[...this.cameraManager?.getStore().getCameraIDsWithCapability("live")]:[],i=this.viewManagerEpoch?.manager.getView();if(this.viewFilterCameraID||e.length<=1||!i||!this.hass)return{};const a=this.viewFilterCameraID??i.camera,t=e.indexOf(a);if(t<0)return{};const r=e[t>0?t-1:e.length-1],o=e[t+1{this._setViewCameraID(t?.id),w(e)}} + > + `}render(){const e=this.viewManagerEpoch?.manager.getView();if(!(this.overriddenLiveConfig&&this.hass&&e&&this.cameraManager))return;const[i,a]=this._getSlides();if(this._cameraToSlide=a,!i.length)return;const t=i.length>1,r=this._getCameraNeighbors(),o=!(!this._mediaHasLoaded||this.viewFilterCameraID&&this.viewFilterCameraID!==e.camera||!1===e.context?.ptzControls?.enabled)&&e.context?.ptzControls?.enabled;return c` + {this._mediaHasLoaded=!0}} + @frigate-card:media:unloaded=${()=>{this._mediaHasLoaded=!1}} + > + ${this._renderNextPrevious("left",r)} + + ${i} + + ${this._renderNextPrevious("right",r)} + + + + `}_setMediaTarget(){const e=this.viewManagerEpoch?.manager.getView(),i=this._getSelectedCameraIndex();this.viewFilterCameraID?this._mediaActionsController.setTarget(i,e?.camera===this.viewFilterCameraID):this._mediaActionsController.setTarget(i,!0)}updated(e){super.updated(e);let i=!1;!this._mediaActionsController.hasRoot()&&this._refCarousel.value&&(this._mediaActionsController.initialize(this._refCarousel.value),i=!0),(i||e.has("viewManagerEpoch"))&&this._setMediaTarget()}static get styles(){return p(":host {\n display: block;\n --video-max-height: none;\n}\n\n:host(:not([grid-id])) {\n height: 100%;\n}\n\n:host([unselected]) frigate-card-carousel {\n pointer-events: none;\n}\n\n.embla__slide {\n display: flex;\n justify-content: center;\n height: 100%;\n flex: 0 0 100%;\n}")}};i([a({attribute:!1})],T.prototype,"hass",void 0),i([a({attribute:!1})],T.prototype,"viewManagerEpoch",void 0),i([a({attribute:!1})],T.prototype,"nonOverriddenLiveConfig",void 0),i([a({attribute:!1})],T.prototype,"overriddenLiveConfig",void 0),i([a({attribute:!1,hasChanged:u})],T.prototype,"overrides",void 0),i([a({attribute:!1})],T.prototype,"conditionsManagerEpoch",void 0),i([a({attribute:!1})],T.prototype,"cardWideConfig",void 0),i([a({attribute:!1})],T.prototype,"cameraManager",void 0),i([a({attribute:!1})],T.prototype,"microphoneManager",void 0),i([a({attribute:!1})],T.prototype,"viewFilterCameraID",void 0),i([t()],T.prototype,"_mediaHasLoaded",void 0),T=i([r("frigate-card-live-carousel")],T);let Z=class extends o{_renderCarousel(e){const i=this.viewManagerEpoch?.manager.getView(),a=e??i?.camera;return c` + + + `}_gridSelectCamera(e){this.viewManagerEpoch?.manager.setViewByParameters({params:{camera:e}})}_needsGrid(){const e=this.cameraManager?.getStore().getCameraIDsWithCapability("live"),i=this.viewManagerEpoch?.manager.getView();return!!i?.isGrid()&&!!i?.supportsMultipleDisplayModes()&&!!e&&e.size>1}willUpdate(e){e.has("viewManagerEpoch")&&this._needsGrid()&&import("./media-grid-82029e37.js")}render(){if(!this.conditionsManagerEpoch||!this.nonOverriddenLiveConfig)return;const e=this.cameraManager?.getStore().getCameraIDsWithCapability("live");return e?.size&&this._needsGrid()?c` + this._gridSelectCamera(e.detail.selected)} + > + ${[...e].map((e=>this._renderCarousel(e)))} + + `:this._renderCarousel()}static get styles(){return p(":host {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n@keyframes warning-pulse {\n 0% {\n border: solid 2px var(--frigate-card-triggered-color-1, rgba(0, 0, 0, 0));\n }\n 50% {\n border: solid 2px var(--frigate-card-triggered-color-2, var(--warning-color));\n }\n 100% {\n border: solid 2px var(--frigate-card-triggered-color-1, rgba(0, 0, 0, 0));\n }\n}\nfrigate-card-live-carousel[triggered] {\n animation: warning-pulse 5s infinite;\n}\n\nfrigate-card-live-carousel[selected] {\n --frigate-card-triggered-color-1: var(--primary-color);\n}")}};i([a({attribute:!1})],Z.prototype,"hass",void 0),i([a({attribute:!1})],Z.prototype,"viewManagerEpoch",void 0),i([a({attribute:!1})],Z.prototype,"nonOverriddenLiveConfig",void 0),i([a({attribute:!1})],Z.prototype,"overriddenLiveConfig",void 0),i([a({attribute:!1,hasChanged:u})],Z.prototype,"overrides",void 0),i([a({attribute:!1})],Z.prototype,"conditionsManagerEpoch",void 0),i([a({attribute:!1})],Z.prototype,"cardWideConfig",void 0),i([a({attribute:!1})],Z.prototype,"cameraManager",void 0),i([a({attribute:!1})],Z.prototype,"microphoneManager",void 0),i([a({attribute:!1})],Z.prototype,"triggeredCameraIDs",void 0),Z=i([r("frigate-card-live-grid")],Z);let G=class extends o{constructor(){super(...arguments),this._controller=new k(this)}render(){if(this.hass&&this.nonOverriddenLiveConfig&&this.cameraManager)return c` + + + `}static get styles(){return p(L)}};i([a({attribute:!1})],G.prototype,"conditionsManagerEpoch",void 0),i([a({attribute:!1})],G.prototype,"hass",void 0),i([a({attribute:!1})],G.prototype,"viewManagerEpoch",void 0),i([a({attribute:!1})],G.prototype,"nonOverriddenLiveConfig",void 0),i([a({attribute:!1})],G.prototype,"overriddenLiveConfig",void 0),i([a({attribute:!1,hasChanged:u})],G.prototype,"overrides",void 0),i([a({attribute:!1})],G.prototype,"cameraManager",void 0),i([a({attribute:!1})],G.prototype,"cardWideConfig",void 0),i([a({attribute:!1})],G.prototype,"microphoneManager",void 0),i([a({attribute:!1})],G.prototype,"triggeredCameraIDs",void 0),G=i([r("frigate-card-live")],G);export{G as FrigateCardLive}; diff --git a/config/www/community/frigate-hass-card/index-dd357256.js.gz b/config/www/community/frigate-hass-card/index-dd357256.js.gz new file mode 100644 index 00000000..ff41f0f4 Binary files /dev/null and b/config/www/community/frigate-hass-card/index-dd357256.js.gz differ diff --git a/config/www/community/frigate-hass-card/jsmpeg-1cb0aa9d.js b/config/www/community/frigate-hass-card/jsmpeg-1cb0aa9d.js new file mode 100644 index 00000000..47a35a5f --- /dev/null +++ b/config/www/community/frigate-hass-card/jsmpeg-1cb0aa9d.js @@ -0,0 +1,12 @@ +import{dw as A,eF as t,dy as i,eG as e,a as s,dz as o,dt as g,du as I,dr as a,l as B,cO as r,x as C,dg as n,r as E,_ as Q,n as h,b as d,t as c}from"./card-e5d55e5b.js";import{d as l}from"./media-921a03ae.js";import{c as u}from"./endpoint-c9cec68c.js";function w(){return w=Object.assign?Object.assign.bind():function(A){for(var t=1;t"string"==typeof A&&A.constructor===String,f=function(A){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=A,"Promise"===Object.prototype.toString.call(t).slice(8,-1)?A:new Promise((t=>{A(),setTimeout(t,i)}))};var y="WJ3NAvwFY9",R="tR2-0dd-e1",k="ZgIIHVSSYI",b="kAA8SjbHe2",G="OueN4AU4CJ";!function(A,t){void 0===t&&(t={});var i=t.insertAt;if(A&&"undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s),s.styleSheet?s.styleSheet.cssText=A:s.appendChild(document.createTextNode(A))}}(".WJ3NAvwFY9,.ZgIIHVSSYI,.kAA8SjbHe2,.tR2-0dd-e1{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ZgIIHVSSYI{-ms-flex-pack:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:center;justify-content:center}.WJ3NAvwFY9,.tR2-0dd-e1{display:block}.tR2-0dd-e1.OueN4AU4CJ{display:none}.ZgIIHVSSYI,.kAA8SjbHe2{-webkit-tap-highlight-color:rgba(255,0,0,0);cursor:pointer;opacity:.7}.OueN4AU4CJ.ZgIIHVSSYI,.OueN4AU4CJ.kAA8SjbHe2{display:none}.ZgIIHVSSYI{z-index:10}.ZgIIHVSSYI>svg{fill:#fff;height:12vw;max-height:60px;max-width:60px;width:12vw}.kAA8SjbHe2{-ms-flex-pack:end;-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:flex-end;justify-content:flex-end;z-index:10}.kAA8SjbHe2>svg{fill:#fff;height:9vw;margin:0 15px 15px 0;max-height:40px;max-width:40px;width:9vw}");var S=function(){function A(A,t,i,e){var s=void 0===i?{}:i,o=s.canvas,g=void 0===o?"":o,I=s.poster,a=void 0===I?"":I,B=s.autoplay,r=void 0!==B&&B,C=s.autoSetWrapperSize,n=void 0!==C&&C,E=s.loop,Q=void 0!==E&&E,h=s.control,d=void 0===h||h,c=s.decodeFirstFrame,l=void 0===c||c,u=s.picMode,p=void 0!==u&&u,m=s.progressive,f=void 0===m||m,y=s.chunkSize,R=void 0===y?1048576:y,k=s.hooks,b=void 0===k?{}:k;void 0===e&&(e={}),this.options=w({videoUrl:t,canvas:g,poster:a,picMode:p,autoplay:r,autoSetWrapperSize:n,loop:Q,control:d,decodeFirstFrame:l,progressive:f,chunkSize:R,hooks:w({play:function(){},pause:function(){},stop:function(){},load:function(){}},b)},e),this.options.needPlayButton=this.options.control&&!this.options.picMode,this.player=null,this.els={wrapper:D(A)?document.querySelector(A):A,canvas:null,playButton:document.createElement("div"),unmuteButton:null,poster:null},"static"===window.getComputedStyle(this.els.wrapper).getPropertyValue("position")&&(this.els.wrapper.style.position="relative"),this.els.wrapper.clientRect=this.els.wrapper.getBoundingClientRect(),this.initCanvas(),this.initPlayButton(),this.initPlayer()}var t=A.prototype;return t.initCanvas=function(){this.options.canvas?this.els.canvas=D(this.options.canvas)?document.querySelector(this.options.canvas):this.options.canvas:(this.els.canvas=document.createElement("canvas"),this.els.canvas.classList.add(y),this.els.wrapper.appendChild(this.els.canvas))},t.initPlayer=function(){var A=this;this.options=w(this.options,{canvas:this.els.canvas});var t=w({},this.options,{autoplay:!1});if(this.player=new Z(this.options.videoUrl,t,{play:function(){A.options.needPlayButton&&A.els.playButton.classList.add(G),A.els.poster&&A.els.poster.classList.add(G),A.options.hooks.play()},pause:function(){A.options.needPlayButton&&A.els.playButton.classList.remove(G),A.options.hooks.pause()},stop:function(){A.els.poster&&A.els.poster.classList.remove(G),A.options.hooks.stop()},load:function(){A.options.autoplay&&A.play(),A._autoSetWrapperSize(),A.options.hooks.load()}}),this._copyPlayerFuncs(),this.els.wrapper.playerInstance=this.player,!this.options.poster||this.options.autoplay||this.player.options.streaming||(this.options.decodeFirstFrame=!1,this.els.poster=new Image,this.els.poster.src=this.options.poster,this.els.poster.classList.add(R),this.els.wrapper.appendChild(this.els.poster)),this.player.options.streaming||this.els.wrapper.addEventListener("click",this.onClick.bind(this)),(this.options.autoplay||this.player.options.streaming)&&this.els.playButton.classList.add(G),this.player.audioOut&&!this.player.audioOut.unlocked){var i=this.els.wrapper;(this.options.autoplay||this.player.options.streaming)&&(this.els.unmuteButton=document.createElement("div"),this.els.unmuteButton.innerHTML='\n\n \n\n',this.els.unmuteButton.classList.add(b),this.els.wrapper.appendChild(this.els.unmuteButton),i=this.els.unmuteButton),this.unlockAudioBound=this.onUnlockAudio.bind(this,i),i.addEventListener("touchstart",this.unlockAudioBound,!1),i.addEventListener("click",this.unlockAudioBound,!0)}},t.initPlayButton=function(){this.options.needPlayButton&&(this.els.playButton.classList.add(k),this.els.playButton.innerHTML='\n\n \n\n',this.els.wrapper.appendChild(this.els.playButton))},t._autoSetWrapperSize=function(){var A=this;if(!this.options.autoSetWrapperSize)return Promise.resolve();var t=this.player.video.destination;return t?Promise.resolve().then((function(){return f((function(){A.els.wrapper.style.width=t.width+"px",A.els.wrapper.style.height=t.height+"px"}))})):Promise.resolve()},t.onUnlockAudio=function(A,t){var i=this;this.els.unmuteButton&&(t.preventDefault(),t.stopPropagation()),this.player.audioOut.unlock((function(){i.els.unmuteButton&&i.els.unmuteButton.classList.add(G),A.removeEventListener("touchstart",i.unlockAudioBound),A.removeEventListener("click",i.unlockAudioBound)}))},t.onClick=function(){this.options.control&&(this.player.isPlaying?this.pause():this.play())},t._copyPlayerFuncs=function(){var A=this;this.play=function(){return A.player.play()},this.pause=function(){return A.player.pause()},this.stop=function(){return A.player.stop()},this.destroy=function(){A.player.destroy(),A.els.wrapper.innerHTML="",A.els.wrapper.playerInstance=null}},A}(),F=function(){return window.performance?window.performance.now()/1e3:Date.now()/1e3},M=function(A,t){if(A.fill)A.fill(t);else for(var i=0;iA&&this.loadNextChunk())},t.destroy=function(){this.request.abort(),this.aborted=!0},t.loadNextChunk=function(){var A=this,t=this.loadedSize,i=Math.min(this.loadedSize+this.chunkSize-1,this.fileSize-1);if(t>=this.fileSize||this.aborted)return this.completed=!0,void(this.onCompletedCallback&&this.onCompletedCallback(this));this.isLoading=!0,this.loadStartTime=F(),this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){A.request.readyState===A.request.DONE&&A.request.status>=200&&A.request.status<300?A.onChunkLoad(A.request.response):A.request.readyState===A.request.DONE&&A.loadFails++<3&&A.loadNextChunk()},0===t&&(this.request.onprogress=this.onProgress.bind(this)),this.request.open("GET",this.url+"?"+t+"-"+i),this.request.setRequestHeader("Range","bytes="+t+"-"+i),this.request.responseType="arraybuffer",this.request.send()},t.onProgress=function(A){this.progress=A.loaded/A.total},t.onChunkLoad=function(A){var t=!this.established;this.established=!0,this.progress=1,this.loadedSize+=A.byteLength,this.loadFails=0,this.isLoading=!1,t&&this.hookOnEstablished&&this.hookOnEstablished(),t&&this.onEstablishedCallback&&this.onEstablishedCallback(this),this.destination&&this.destination.write(A),this.loadTime=F()-this.loadStartTime,this.throttled||this.loadNextChunk()},A}(),U=function(){function A(A,t){this.url=A,this.options=t,this.socket=null,this.streaming=!0,this.callbacks={connect:[],data:[]},this.destination=null,this.reconnectInterval=void 0!==t.reconnectInterval?t.reconnectInterval:5,this.shouldAttemptReconnect=!!this.reconnectInterval,this.completed=!1,this.established=!1,this.progress=0,this.reconnectTimeoutId=0,this.onEstablishedCallback=t.onSourceEstablished,this.onCompletedCallback=t.onSourceCompleted,t.hookOnEstablished&&(this.hookOnEstablished=t.hookOnEstablished)}var t=A.prototype;return t.connect=function(A){this.destination=A},t.destroy=function(){clearTimeout(this.reconnectTimeoutId),this.shouldAttemptReconnect=!1,this.socket.close()},t.start=function(){this.shouldAttemptReconnect=!!this.reconnectInterval,this.progress=0,this.established=!1,this.options.protocols?this.socket=new WebSocket(this.url,this.options.protocols):this.socket=new WebSocket(this.url),this.socket.binaryType="arraybuffer",this.socket.onmessage=this.onMessage.bind(this),this.socket.onopen=this.onOpen.bind(this),this.socket.onerror=this.onClose.bind(this),this.socket.onclose=this.onClose.bind(this)},t.resume=function(){},t.onOpen=function(){this.progress=1},t.onClose=function(){var A=this;this.shouldAttemptReconnect&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=setTimeout((function(){A.start()}),1e3*this.reconnectInterval))},t.onMessage=function(A){var t=!this.established;this.established=!0,t&&this.hookOnEstablished&&this.hookOnEstablished(),t&&this.onEstablishedCallback&&this.onEstablishedCallback(this),this.destination&&this.destination.write(A.data)},A}(),J=function(){function A(t,i){"object"==typeof t?(this.bytes=t instanceof Uint8Array?t:new Uint8Array(t),this.byteLength=this.bytes.length):(this.bytes=new Uint8Array(t||1048576),this.byteLength=0),this.mode=i||A.MODE.EXPAND,this.index=0}var t=A.prototype;return t.resize=function(A){var t=new Uint8Array(A);0!==this.byteLength&&(this.byteLength=Math.min(this.byteLength,A),t.set(this.bytes,0,this.byteLength)),this.bytes=t,this.index=Math.min(this.index,this.byteLength<<3)},t.evict=function(A){var t=this.index>>3,i=this.bytes.length-this.byteLength;if(this.index===this.byteLength<<3||A>i+t)return this.byteLength=0,void(this.index=0);0!==t&&(this.bytes.copyWithin?this.bytes.copyWithin(0,t,this.byteLength):this.bytes.set(this.bytes.subarray(t,this.byteLength)),this.byteLength-=t,this.index-=t<<3)},t.write=function(t){var i="object"==typeof t[0],e=0,s=this.bytes.length-this.byteLength;if(i){e=0;for(var o=0;os)if(this.mode===A.MODE.EXPAND){var g=Math.max(2*this.bytes.length,e-s);this.resize(g)}else this.evict(e);if(i)for(var I=0;I>3;A>3;return A>=this.byteLength||0===this.bytes[A]&&0===this.bytes[A+1]&&1===this.bytes[A+2]},t.peek=function(A){for(var t=this.index,i=0;A;){var e=8-(7&t),s=e>3]&255>>8-s<>o,t+=s,A-=s}return i},t.read=function(A){var t=this.peek(A);return this.index+=A,t},t.skip=function(A){return this.index+=A},t.rewind=function(A){this.index=Math.max(this.index-A,0)},t.has=function(A){return(this.byteLength<<3)-this.index>=A},A}();J.MODE={EVICT:1,EXPAND:2};var T=function(){function A(){this.bits=null,this.leftoverBytes=null,this.guessVideoFrameEnd=!0,this.pidsToStreamIds={},this.pesPacketInfo={},this.startTime=0,this.currentTime=0}var t=A.prototype;return t.connect=function(A,t){this.pesPacketInfo[A]={destination:t,currentLength:0,totalLength:0,pts:0,buffers:[]}},t.write=function(A){if(this.leftoverBytes){var t=A.byteLength+this.leftoverBytes.byteLength;this.bits=new J(t),this.bits.write([this.leftoverBytes,A])}else this.bits=new J(A);for(;this.bits.has(1504)&&this.parsePacket(););var i=this.bits.byteLength-(this.bits.index>>3);this.leftoverBytes=i>0?this.bits.bytes.subarray(this.bits.index>>3):null},t.parsePacket=function(){if(71!==this.bits.read(8)&&!this.resync())return!1;var A=187+(this.bits.index>>3);this.bits.read(1);var t=this.bits.read(1);this.bits.read(1);var i=this.bits.read(13);this.bits.read(2);var e=this.bits.read(2);this.bits.read(4);var s=this.pidsToStreamIds[i];if(t&&s){var o=this.pesPacketInfo[s];o&&o.currentLength&&this.packetComplete(o)}if(1&e){if(2&e){var g=this.bits.read(8);this.bits.skip(g<<3)}if(t&&this.bits.nextBytesAreStartCode()){this.bits.skip(24),s=this.bits.read(8),this.pidsToStreamIds[i]=s;var I=this.bits.read(16);this.bits.skip(8);var a=this.bits.read(2);this.bits.skip(6);var B=this.bits.read(8),r=this.bits.index+(B<<3),C=this.pesPacketInfo[s];if(C){var n=0;if(2&a){this.bits.skip(4);var E=this.bits.read(3);this.bits.skip(1);var Q=this.bits.read(15);this.bits.skip(1);var h=this.bits.read(15);this.bits.skip(1),n=(1073741824*E+32768*Q+h)/9e4,this.currentTime=n,-1===this.startTime&&(this.startTime=n)}var d=I?I-B-3:0;this.packetStart(C,n,d)}this.bits.index=r}if(s){var c=this.pesPacketInfo[s];if(c){var l=this.bits.index>>3,u=!t&&2&e;(this.packetAddData(c,l,A)||this.guessVideoFrameEnd&&u)&&this.packetComplete(c)}}}return this.bits.index=A<<3,!0},t.resync=function(){if(!this.bits.has(9024))return!1;for(var A=this.bits.index>>3,t=0;t<187;t++)if(71===this.bits.bytes[A+t]){for(var i=!0,e=1;e<5;e++)if(71!==this.bits.bytes[A+t+188*e]){i=!1;break}if(i)return this.bits.index=A+t+1<<3,!0}return console.warn("JSMpeg: Possible garbage data. Skipping."),this.bits.skip(1496),!1},t.packetStart=function(A,t,i){A.totalLength=i,A.currentLength=0,A.pts=t},t.packetAddData=function(A,t,i){return A.buffers.push(this.bits.bytes.subarray(t,i)),A.currentLength+=i-t,0!==A.totalLength&&A.currentLength>=A.totalLength},t.packetComplete=function(A){A.destination.write(A.pts,A.buffers),A.totalLength=0,A.currentLength=0,A.buffers=[]},A}();T.STREAM={PACK_HEADER:186,SYSTEM_HEADER:187,PROGRAM_MAP:188,PRIVATE_1:189,PADDING:190,PRIVATE_2:191,AUDIO_1:192,VIDEO_1:224,DIRECTORY:255};var v=function(){function A(A){this.destination=null,this.canPlay=!1,this.collectTimestamps=!A.streaming,this.bytesWritten=0,this.timestamps=[],this.timestampIndex=0,this.startTime=0,this.decodedTime=0,Object.defineProperty(this,"currentTime",{get:this.getCurrentTime})}var t=A.prototype;return t.destroy=function(){},t.connect=function(A){this.destination=A},t.bufferGetIndex=function(){return this.bits.index},t.bufferSetIndex=function(A){this.bits.index=A},t.bufferWrite=function(A){return this.bits.write(A)},t.write=function(A,t){this.collectTimestamps&&(0===this.timestamps.length&&(this.startTime=A,this.decodedTime=A),this.timestamps.push({index:this.bytesWritten<<3,time:A})),this.bytesWritten+=this.bufferWrite(t),this.canPlay=!0},t.seek=function(A){if(this.collectTimestamps){this.timestampIndex=0;for(var t=0;tA);t++)this.timestampIndex=t;var i=this.timestamps[this.timestampIndex];i?(this.bufferSetIndex(i.index),this.decodedTime=i.time):(this.bits.index=0,this.decodedTime=this.startTime)}},t.decode=function(){this.advanceDecodedTime(0)},t.advanceDecodedTime=function(A){if(this.collectTimestamps){for(var t=-1,i=this.bufferGetIndex(),e=this.timestampIndex;ei);e++)t=e;if(-1!==t&&t!==this.timestampIndex)return this.timestampIndex=t,void(this.decodedTime=this.timestamps[this.timestampIndex].time)}this.decodedTime+=A},t.getCurrentTime=function(){return this.decodedTime},A}(),x=function(A){function t(t){var i;(i=A.call(this,t)||this).onDecodeCallback=t.onVideoDecode;var e=t.videoBufferSize||524288,s=t.streaming?J.MODE.EVICT:J.MODE.EXPAND;return i.bits=new J(e,s),i.customIntraQuantMatrix=new Uint8Array(64),i.customNonIntraQuantMatrix=new Uint8Array(64),i.blockData=new Int32Array(64),i.currentFrame=0,i.decodeFirstFrame=!1!==t.decodeFirstFrame,i}p(t,A);var i=t.prototype;return i.write=function(A,i){if(v.prototype.write.call(this,A,i),!this.hasSequenceHeader){if(-1===this.bits.findStartCode(t.START.SEQUENCE))return!1;this.decodeSequenceHeader(),this.decodeFirstFrame&&this.decode()}},i.decode=function(){var A=F();if(!this.hasSequenceHeader)return!1;if(-1===this.bits.findStartCode(t.START.PICTURE))return!1;this.decodePicture(),this.advanceDecodedTime(1/this.frameRate);var i=F()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,i),!0},i.readHuffman=function(A){var t=0;do{t=A[t+this.bits.read(1)]}while(t>=0&&0!==A[t]);return A[t+2]},i.decodeSequenceHeader=function(){var A=this.bits.read(12),i=this.bits.read(12);if(this.bits.skip(4),this.frameRate=t.PICTURE_RATE[this.bits.read(4)],this.bits.skip(30),A===this.width&&i===this.height||(this.width=A,this.height=i,this.initBuffers(),this.destination&&this.destination.resize(A,i)),this.bits.read(1)){for(var e=0;e<64;e++)this.customIntraQuantMatrix[t.ZIG_ZAG[e]]=this.bits.read(8);this.intraQuantMatrix=this.customIntraQuantMatrix}if(this.bits.read(1)){for(var s=0;s<64;s++){var o=t.ZIG_ZAG[s];this.customNonIntraQuantMatrix[o]=this.bits.read(8)}this.nonIntraQuantMatrix=this.customNonIntraQuantMatrix}this.hasSequenceHeader=!0},i.initBuffers=function(){this.intraQuantMatrix=t.DEFAULT_INTRA_QUANT_MATRIX,this.nonIntraQuantMatrix=t.DEFAULT_NON_INTRA_QUANT_MATRIX,this.mbWidth=this.width+15>>4,this.mbHeight=this.height+15>>4,this.mbSize=this.mbWidth*this.mbHeight,this.codedWidth=this.mbWidth<<4,this.codedHeight=this.mbHeight<<4,this.codedSize=this.codedWidth*this.codedHeight,this.halfWidth=this.mbWidth<<3,this.halfHeight=this.mbHeight<<3,this.currentY=new Uint8ClampedArray(this.codedSize),this.currentY32=new Uint32Array(this.currentY.buffer),this.currentCr=new Uint8ClampedArray(this.codedSize>>2),this.currentCr32=new Uint32Array(this.currentCr.buffer),this.currentCb=new Uint8ClampedArray(this.codedSize>>2),this.currentCb32=new Uint32Array(this.currentCb.buffer),this.forwardY=new Uint8ClampedArray(this.codedSize),this.forwardY32=new Uint32Array(this.forwardY.buffer),this.forwardCr=new Uint8ClampedArray(this.codedSize>>2),this.forwardCr32=new Uint32Array(this.forwardCr.buffer),this.forwardCb=new Uint8ClampedArray(this.codedSize>>2),this.forwardCb32=new Uint32Array(this.forwardCb.buffer)},i.decodePicture=function(){if(this.currentFrame++,this.bits.skip(10),this.pictureType=this.bits.read(3),this.bits.skip(16),!(this.pictureType<=0||this.pictureType>=t.PICTURE_TYPE.B)){if(this.pictureType===t.PICTURE_TYPE.PREDICTIVE){if(this.fullPelForward=this.bits.read(1),this.forwardFCode=this.bits.read(3),0===this.forwardFCode)return;this.forwardRSize=this.forwardFCode-1,this.forwardF=1<=t.START.SLICE_FIRST&&A<=t.START.SLICE_LAST;)this.decodeSlice(255&A),A=this.bits.findNextStartCode();if(-1!==A&&this.bits.rewind(32),this.destination&&this.destination.render(this.currentY,this.currentCr,this.currentCb,!0),this.pictureType===t.PICTURE_TYPE.INTRA||this.pictureType===t.PICTURE_TYPE.PREDICTIVE){var i=this.forwardY,e=this.forwardY32,s=this.forwardCr,o=this.forwardCr32,g=this.forwardCb,I=this.forwardCb32;this.forwardY=this.currentY,this.forwardY32=this.currentY32,this.forwardCr=this.currentCr,this.forwardCr32=this.currentCr32,this.forwardCb=this.currentCb,this.forwardCb32=this.currentCb32,this.currentY=i,this.currentY32=e,this.currentCr=s,this.currentCr32=o,this.currentCb=g,this.currentCb32=I}}},i.decodeSlice=function(A){for(this.sliceBegin=!0,this.macroblockAddress=(A-1)*this.mbWidth-1,this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0,this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.quantizerScale=this.bits.read(5);this.bits.read(1);)this.bits.skip(8);do{this.decodeMacroblock()}while(!this.bits.nextBytesAreStartCode())},i.decodeMacroblock=function(){for(var A=0,i=this.readHuffman(t.MACROBLOCK_ADDRESS_INCREMENT);34===i;)i=this.readHuffman(t.MACROBLOCK_ADDRESS_INCREMENT);for(;35===i;)A+=33,i=this.readHuffman(t.MACROBLOCK_ADDRESS_INCREMENT);if(A+=i,this.sliceBegin)this.sliceBegin=!1,this.macroblockAddress+=A;else{if(this.macroblockAddress+A>=this.mbSize)return;for(A>1&&(this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.pictureType===t.PICTURE_TYPE.PREDICTIVE&&(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0));A>1;)this.macroblockAddress++,this.mbRow=this.macroblockAddress/this.mbWidth|0,this.mbCol=this.macroblockAddress%this.mbWidth,this.copyMacroblock(this.motionFwH,this.motionFwV,this.forwardY,this.forwardCr,this.forwardCb),A--;this.macroblockAddress++}this.mbRow=this.macroblockAddress/this.mbWidth|0,this.mbCol=this.macroblockAddress%this.mbWidth;var e=t.MACROBLOCK_TYPE[this.pictureType];this.macroblockType=this.readHuffman(e),this.macroblockIntra=1&this.macroblockType,this.macroblockMotFw=8&this.macroblockType,16&this.macroblockType&&(this.quantizerScale=this.bits.read(5)),this.macroblockIntra?(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0):(this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.decodeMotionVectors(),this.copyMacroblock(this.motionFwH,this.motionFwV,this.forwardY,this.forwardCr,this.forwardCb));for(var s=2&this.macroblockType?this.readHuffman(t.CODE_BLOCK_PATTERN):this.macroblockIntra?63:0,o=0,g=32;o<6;o++)s&g&&this.decodeBlock(o),g>>=1},i.decodeMotionVectors=function(){var A,i,e=0;this.macroblockMotFw?(0!==(A=this.readHuffman(t.MOTION))&&1!==this.forwardF?(e=this.bits.read(this.forwardRSize),i=(Math.abs(A)-1<(this.forwardF<<4)-1?this.motionFwHPrev-=this.forwardF<<5:this.motionFwHPrev<-this.forwardF<<4&&(this.motionFwHPrev+=this.forwardF<<5),this.motionFwH=this.motionFwHPrev,this.fullPelForward&&(this.motionFwH<<=1),0!==(A=this.readHuffman(t.MOTION))&&1!==this.forwardF?(e=this.bits.read(this.forwardRSize),i=(Math.abs(A)-1<(this.forwardF<<4)-1?this.motionFwVPrev-=this.forwardF<<5:this.motionFwVPrev<-this.forwardF<<4&&(this.motionFwVPrev+=this.forwardF<<5),this.motionFwV=this.motionFwVPrev,this.fullPelForward&&(this.motionFwV<<=1)):this.pictureType===t.PICTURE_TYPE.PREDICTIVE&&(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0)},i.copyMacroblock=function(A,t,i,e,s){var o,g,I,a,B,r,C,n,E,Q,h,d,c,l,u,w,p,m,D,f=this.currentY32,y=this.currentCb32,R=this.currentCr32;if(g=(o=this.codedWidth)-16,I=A>>1,a=t>>1,B=!(1&~A),r=!(1&~t),C=((this.mbRow<<4)+a)*o+(this.mbCol<<4)+I,E=(n=this.mbRow*o+this.mbCol<<2)+(o<<2),B)if(r)for(;n>2&255,c|=(h=i[++C]+i[C+o])+d+2<<6&65280,c|=h+(d=i[++C]+i[C+o])+2<<14&16711680,h=i[++C]+i[C+o],C++,c|=h+d+2<<22&4278190080,f[n++]=c;n+=g>>2,C+=g-1}else for(;n>1&255,c|=(h=i[C++])+d+1<<7&65280,c|=h+(d=i[C++])+1<<15&16711680,c|=(h=i[C++])+d+1<<23&4278190080,f[n++]=c;n+=g>>2,C+=g-1}else if(r)for(;n>1&255,c|=i[++C]+i[C+o]+1<<7&65280,c|=i[++C]+i[C+o]+1<<15&16711680,c|=i[++C]+i[C+o]+1<<23&4278190080,C++,f[n++]=c;n+=g>>2,C+=g}else for(;n>2,C+=g}if(g=(o=this.halfWidth)-8,I=A/2>>1,a=t/2>>1,B=1==(A/2&1),r=1==(t/2&1),C=((this.mbRow<<3)+a)*o+(this.mbCol<<3)+I,E=(n=this.mbRow*o+this.mbCol<<1)+(o<<1),B)if(r)for(;n>2&255,D=p+(m=s[C]+s[C+o])+2>>2&255,w|=(l=e[++C]+e[C+o])+u+2<<6&65280,D|=(p=s[C]+s[C+o])+m+2<<6&65280,w|=l+(u=e[++C]+e[C+o])+2<<14&16711680,D|=p+(m=s[C]+s[C+o])+2<<14&16711680,l=e[++C]+e[C+o],p=s[C]+s[C+o],C++,w|=l+u+2<<22&4278190080,D|=p+m+2<<22&4278190080,R[n]=w,y[n]=D,n++;n+=g>>2,C+=g-1}else for(;n>1&255,D=p+(m=s[C++])+1>>1&255,w|=(l=e[C])+u+1<<7&65280,D|=(p=s[C++])+m+1<<7&65280,w|=l+(u=e[C])+1<<15&16711680,D|=p+(m=s[C++])+1<<15&16711680,w|=(l=e[C])+u+1<<23&4278190080,D|=(p=s[C++])+m+1<<23&4278190080,R[n]=w,y[n]=D,n++;n+=g>>2,C+=g-1}else if(r)for(;n>1&255,D=s[C]+s[C+o]+1>>1&255,w|=e[++C]+e[C+o]+1<<7&65280,D|=s[C]+s[C+o]+1<<7&65280,w|=e[++C]+e[C+o]+1<<15&16711680,D|=s[C]+s[C+o]+1<<15&16711680,w|=e[++C]+e[C+o]+1<<23&4278190080,D|=s[C]+s[C+o]+1<<23&4278190080,C++,R[n]=w,y[n]=D,n++;n+=g>>2,C+=g}else for(;n>2,C+=g}},i.decodeBlock=function(A){var i,e=0;if(this.macroblockIntra){var s,o;if(A<4?(s=this.dcPredictorY,o=this.readHuffman(t.DCT_DC_SIZE_LUMINANCE)):(s=4===A?this.dcPredictorCr:this.dcPredictorCb,o=this.readHuffman(t.DCT_DC_SIZE_CHROMINANCE)),o>0){var g=this.bits.read(o);this.blockData[0]=g&1<0&&0===this.bits.read(1))break;65535===n?(C=this.bits.read(6),0===(r=this.bits.read(8))?r=this.bits.read(8):128===r?r=this.bits.read(8)-256:r>128&&(r-=256)):(C=n>>8,r=255&n,this.bits.read(1)&&(r=-r)),e+=C;var E=t.ZIG_ZAG[e];e++,r<<=1,this.macroblockIntra||(r+=r<0?-1:1),1&(r=r*this.quantizerScale*i[E]>>4)||(r-=r>0?1:-1),r>2047?r=2047:r<-2048&&(r=-2048),this.blockData[E]=r*t.PREMULTIPLIER_MATRIX[E]}A<4?(I=this.currentY,B=this.codedWidth-8,a=this.mbRow*this.codedWidth+this.mbCol<<4,1&A&&(a+=8),2&A&&(a+=this.codedWidth<<3)):(I=4===A?this.currentCb:this.currentCr,B=(this.codedWidth>>1)-8,a=(this.mbRow*this.codedWidth<<2)+(this.mbCol<<3)),this.macroblockIntra?1===e?(t.CopyValueToDestination(this.blockData[0]+128>>8,I,a,B),this.blockData[0]=0):(t.IDCT(this.blockData),t.CopyBlockToDestination(this.blockData,I,a,B),M(this.blockData,0)):1===e?(t.AddValueToDestination(this.blockData[0]+128>>8,I,a,B),this.blockData[0]=0):(t.IDCT(this.blockData),t.AddBlockToDestination(this.blockData,I,a,B),M(this.blockData,0)),e=0},t.CopyBlockToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]=A[s+0],t[i+1]=A[s+1],t[i+2]=A[s+2],t[i+3]=A[s+3],t[i+4]=A[s+4],t[i+5]=A[s+5],t[i+6]=A[s+6],t[i+7]=A[s+7]},t.AddBlockToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]+=A[s+0],t[i+1]+=A[s+1],t[i+2]+=A[s+2],t[i+3]+=A[s+3],t[i+4]+=A[s+4],t[i+5]+=A[s+5],t[i+6]+=A[s+6],t[i+7]+=A[s+7]},t.CopyValueToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]=A,t[i+1]=A,t[i+2]=A,t[i+3]=A,t[i+4]=A,t[i+5]=A,t[i+6]=A,t[i+7]=A},t.AddValueToDestination=function(A,t,i,e){for(var s=0;s<64;s+=8,i+=e+8)t[i+0]+=A,t[i+1]+=A,t[i+2]+=A,t[i+3]+=A,t[i+4]+=A,t[i+5]+=A,t[i+6]+=A,t[i+7]+=A},t.IDCT=function(A){for(var t,i,e,s,o,g,I,a,B,r,C,n,E,Q,h,d,c,l,u=0;u<8;++u)t=A[32+u],i=A[16+u]+A[48+u],e=A[40+u]-A[24+u],g=A[8+u]+A[56+u],I=A[24+u]+A[40+u],B=(E=(473*(s=A[8+u]-A[56+u])-196*e+128>>8)-(o=g+I))-(362*(g-I)+128>>8),Q=(r=(a=A[0+u])-t)+(C=(362*(A[16+u]-A[48+u])+128>>8)-i),h=(n=a+t)+i,d=r-C,c=n-i,l=-B-(473*e+196*s+128>>8),A[0+u]=o+h,A[8+u]=E+Q,A[16+u]=d-B,A[24+u]=c-l,A[32+u]=c+l,A[40+u]=B+d,A[48+u]=Q-E,A[56+u]=h-o;for(var w=0;w<64;w+=8)t=A[4+w],i=A[2+w]+A[6+w],e=A[5+w]-A[3+w],g=A[1+w]+A[7+w],I=A[3+w]+A[5+w],B=(E=(473*(s=A[1+w]-A[7+w])-196*e+128>>8)-(o=g+I))-(362*(g-I)+128>>8),Q=(r=(a=A[0+w])-t)+(C=(362*(A[2+w]-A[6+w])+128>>8)-i),h=(n=a+t)+i,d=r-C,c=n-i,l=-B-(473*e+196*s+128>>8),A[0+w]=o+h+128>>8,A[1+w]=E+Q+128>>8,A[2+w]=d-B+128>>8,A[3+w]=c-l+128>>8,A[4+w]=c+l+128>>8,A[5+w]=B+d+128>>8,A[6+w]=Q-E+128>>8,A[7+w]=h-o+128>>8},t}(v);x.prototype.frameRate=30,x.prototype.currentY=null,x.prototype.currentCr=null,x.prototype.currentCb=null,x.prototype.pictureType=0,x.prototype.forwardY=null,x.prototype.forwardCr=null,x.prototype.forwardCb=null,x.prototype.fullPelForward=!1,x.prototype.forwardFCode=0,x.prototype.forwardRSize=0,x.prototype.forwardF=0,x.prototype.quantizerScale=0,x.prototype.sliceBegin=!1,x.prototype.macroblockAddress=0,x.prototype.mbRow=0,x.prototype.mbCol=0,x.prototype.macroblockType=0,x.prototype.macroblockIntra=!1,x.prototype.macroblockMotFw=!1,x.prototype.motionFwH=0,x.prototype.motionFwV=0,x.prototype.motionFwHPrev=0,x.prototype.motionFwVPrev=0,x.prototype.dcPredictorY=0,x.prototype.dcPredictorCr=0,x.prototype.dcPredictorCb=0,x.prototype.blockData=null,x.PICTURE_RATE=[0,23.976,24,25,29.97,30,50,59.94,60,0,0,0,0,0,0,0],x.ZIG_ZAG=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),x.DEFAULT_INTRA_QUANT_MATRIX=new Uint8Array([8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,29,34,38,46,56,69,27,29,35,38,46,56,69,83]),x.DEFAULT_NON_INTRA_QUANT_MATRIX=new Uint8Array([16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]),x.PREMULTIPLIER_MATRIX=new Uint8Array([32,44,42,38,32,25,17,9,44,62,58,52,44,35,24,12,42,58,55,49,42,33,23,12,38,52,49,44,38,30,20,10,32,44,42,38,32,25,17,9,25,35,33,30,25,20,14,7,17,24,23,20,17,14,9,5,9,12,12,10,9,7,5,2]),x.MACROBLOCK_ADDRESS_INCREMENT=new Int16Array([3,6,0,9,12,0,0,0,1,15,18,0,21,24,0,27,30,0,33,36,0,0,0,3,0,0,2,39,42,0,45,48,0,0,0,5,0,0,4,51,54,0,57,60,0,0,0,7,0,0,6,63,66,0,69,72,0,75,78,0,81,84,0,-1,87,0,-1,90,0,93,96,0,99,102,0,105,108,0,111,114,0,0,0,9,0,0,8,117,120,0,123,126,0,129,132,0,135,138,0,0,0,15,0,0,14,0,0,13,0,0,12,0,0,11,0,0,10,141,-1,0,-1,144,0,147,150,0,153,156,0,159,162,0,165,168,0,171,174,0,177,180,0,183,-1,0,-1,186,0,189,192,0,195,198,0,201,204,0,207,210,0,213,216,0,219,222,0,0,0,21,0,0,20,0,0,19,0,0,18,0,0,17,0,0,16,0,0,35,0,0,34,0,0,33,0,0,32,0,0,31,0,0,30,0,0,29,0,0,28,0,0,27,0,0,26,0,0,25,0,0,24,0,0,23,0,0,22]),x.MACROBLOCK_TYPE_INTRA=new Int8Array([3,6,0,-1,9,0,0,0,1,0,0,17]),x.MACROBLOCK_TYPE_PREDICTIVE=new Int8Array([3,6,0,9,12,0,0,0,10,15,18,0,0,0,2,21,24,0,0,0,8,27,30,0,33,36,0,-1,39,0,0,0,18,0,0,26,0,0,1,0,0,17]),x.MACROBLOCK_TYPE_B=new Int8Array([3,6,0,9,15,0,12,18,0,24,21,0,0,0,12,27,30,0,0,0,14,39,42,0,36,33,0,0,0,4,0,0,6,54,48,0,45,51,0,0,0,8,0,0,10,-1,57,0,0,0,1,60,63,0,0,0,30,0,0,17,0,0,22,0,0,26]),x.MACROBLOCK_TYPE=[null,x.MACROBLOCK_TYPE_INTRA,x.MACROBLOCK_TYPE_PREDICTIVE,x.MACROBLOCK_TYPE_B],x.CODE_BLOCK_PATTERN=new Int16Array([6,3,0,9,18,0,12,15,0,24,33,0,36,39,0,27,21,0,30,42,0,60,57,0,54,48,0,69,51,0,81,75,0,63,84,0,45,66,0,72,78,0,0,0,60,105,120,0,132,144,0,114,108,0,126,141,0,87,93,0,117,96,0,0,0,32,135,138,0,99,123,0,129,102,0,0,0,4,90,111,0,0,0,8,0,0,16,0,0,44,150,168,0,0,0,28,0,0,52,0,0,62,183,177,0,156,180,0,0,0,1,165,162,0,0,0,61,0,0,56,171,174,0,0,0,2,0,0,40,153,186,0,0,0,48,192,189,0,147,159,0,0,0,20,0,0,12,240,249,0,0,0,63,231,225,0,195,219,0,252,198,0,0,0,24,0,0,36,0,0,3,207,261,0,243,237,0,204,213,0,210,234,0,201,228,0,216,222,0,258,255,0,264,246,0,-1,282,0,285,291,0,0,0,33,0,0,9,318,330,0,306,348,0,0,0,5,0,0,10,279,267,0,0,0,6,0,0,18,0,0,17,0,0,34,339,357,0,309,312,0,270,276,0,327,321,0,351,354,0,303,297,0,294,288,0,300,273,0,342,345,0,315,324,0,336,333,0,363,375,0,0,0,41,0,0,14,0,0,21,372,366,0,360,369,0,0,0,11,0,0,19,0,0,7,0,0,35,0,0,13,0,0,50,0,0,49,0,0,58,0,0,37,0,0,25,0,0,45,0,0,57,0,0,26,0,0,29,0,0,38,0,0,53,0,0,23,0,0,43,0,0,46,0,0,42,0,0,22,0,0,54,0,0,51,0,0,15,0,0,30,0,0,39,0,0,47,0,0,55,0,0,27,0,0,59,0,0,31]),x.MOTION=new Int16Array([3,6,0,12,9,0,0,0,0,18,15,0,24,21,0,0,0,-1,0,0,1,27,30,0,36,33,0,0,0,2,0,0,-2,42,45,0,48,39,0,60,54,0,0,0,3,0,0,-3,51,57,0,-1,69,0,81,75,0,78,63,0,72,66,0,96,84,0,87,93,0,-1,99,0,108,105,0,0,0,-4,90,102,0,0,0,4,0,0,-7,0,0,5,111,123,0,0,0,-5,0,0,7,114,120,0,126,117,0,0,0,-6,0,0,6,153,162,0,150,147,0,135,138,0,156,141,0,129,159,0,132,144,0,0,0,10,0,0,9,0,0,8,0,0,-8,171,198,0,0,0,-9,180,192,0,168,183,0,165,186,0,174,189,0,0,0,-10,177,195,0,0,0,12,0,0,16,0,0,13,0,0,14,0,0,11,0,0,15,0,0,-16,0,0,-12,0,0,-14,0,0,-15,0,0,-11,0,0,-13]),x.DCT_DC_SIZE_LUMINANCE=new Int8Array([6,3,0,18,15,0,9,12,0,0,0,1,0,0,2,27,24,0,21,30,0,0,0,0,36,33,0,0,0,4,0,0,3,39,42,0,0,0,5,0,0,6,48,45,0,51,-1,0,0,0,7,0,0,8]),x.DCT_DC_SIZE_CHROMINANCE=new Int8Array([6,3,0,12,9,0,18,15,0,24,21,0,0,0,2,0,0,1,0,0,0,30,27,0,0,0,3,36,33,0,0,0,4,42,39,0,0,0,5,48,45,0,0,0,6,51,-1,0,0,0,7,0,0,8]),x.DCT_COEFF=new Int32Array([3,6,0,12,9,0,0,0,1,21,24,0,18,15,0,39,27,0,33,30,0,42,36,0,0,0,257,60,66,0,54,63,0,48,57,0,0,0,513,51,45,0,0,0,2,0,0,3,81,75,0,87,93,0,72,78,0,96,90,0,0,0,1025,69,84,0,0,0,769,0,0,258,0,0,1793,0,0,65535,0,0,1537,111,108,0,0,0,1281,105,102,0,117,114,0,99,126,0,120,123,0,156,150,0,162,159,0,144,147,0,129,135,0,138,132,0,0,0,2049,0,0,4,0,0,514,0,0,2305,153,141,0,165,171,0,180,168,0,177,174,0,183,186,0,0,0,2561,0,0,3329,0,0,6,0,0,259,0,0,5,0,0,770,0,0,2817,0,0,3073,228,225,0,201,210,0,219,213,0,234,222,0,216,231,0,207,192,0,204,189,0,198,195,0,243,261,0,273,240,0,246,237,0,249,258,0,279,276,0,252,255,0,270,282,0,264,267,0,0,0,515,0,0,260,0,0,7,0,0,1026,0,0,1282,0,0,4097,0,0,3841,0,0,3585,315,321,0,333,342,0,312,291,0,375,357,0,288,294,0,-1,369,0,285,303,0,318,363,0,297,306,0,339,309,0,336,348,0,330,300,0,372,345,0,351,366,0,327,354,0,360,324,0,381,408,0,417,420,0,390,378,0,435,438,0,384,387,0,0,0,2050,396,402,0,465,462,0,0,0,8,411,399,0,429,432,0,453,414,0,426,423,0,0,0,10,0,0,9,0,0,11,0,0,5377,0,0,1538,0,0,771,0,0,5121,0,0,1794,0,0,4353,0,0,4609,0,0,4865,444,456,0,0,0,1027,459,450,0,0,0,261,393,405,0,0,0,516,447,441,0,516,519,0,486,474,0,510,483,0,504,498,0,471,537,0,507,501,0,522,513,0,534,531,0,468,477,0,492,495,0,549,546,0,525,528,0,0,0,263,0,0,2562,0,0,2306,0,0,5633,0,0,5889,0,0,6401,0,0,6145,0,0,1283,0,0,772,0,0,13,0,0,12,0,0,14,0,0,15,0,0,517,0,0,6657,0,0,262,540,543,0,480,489,0,588,597,0,0,0,27,609,555,0,606,603,0,0,0,19,0,0,22,591,621,0,0,0,18,573,576,0,564,570,0,0,0,20,552,582,0,0,0,21,558,579,0,0,0,23,612,594,0,0,0,25,0,0,24,600,615,0,0,0,31,0,0,30,0,0,28,0,0,29,0,0,26,0,0,17,0,0,16,567,618,0,561,585,0,654,633,0,0,0,37,645,648,0,0,0,36,630,636,0,0,0,34,639,627,0,663,666,0,657,624,0,651,642,0,669,660,0,0,0,35,0,0,267,0,0,40,0,0,268,0,0,266,0,0,32,0,0,264,0,0,265,0,0,38,0,0,269,0,0,270,0,0,33,0,0,39,0,0,7937,0,0,6913,0,0,7681,0,0,4098,0,0,7425,0,0,7169,0,0,271,0,0,274,0,0,273,0,0,272,0,0,1539,0,0,2818,0,0,3586,0,0,3330,0,0,3074,0,0,3842]),x.PICTURE_TYPE={INTRA:1,PREDICTIVE:2,B:3},x.START={SEQUENCE:179,SLICE_FIRST:1,SLICE_LAST:175,PICTURE:0,EXTENSION:181,USER_DATA:178};var Y=function(A){function t(t){var i;return(i=A.call(this,t)||this).onDecodeCallback=t.onVideoDecode,i.module=t.wasmModule,i.bufferSize=t.videoBufferSize||524288,i.bufferMode=t.streaming?J.MODE.EVICT:J.MODE.EXPAND,i.decodeFirstFrame=!1!==t.decodeFirstFrame,i.hasSequenceHeader=!1,i}p(t,A);var i=t.prototype;return i.initializeWasmDecoder=function(){this.module.instance?(this.instance=this.module.instance,this.functions=this.module.instance.exports,this.decoder=this.functions._mpeg1_decoder_create(this.bufferSize,this.bufferMode)):console.warn("JSMpeg: WASM module not compiled yet")},i.destroy=function(){this.decoder&&this.functions._mpeg1_decoder_destroy(this.decoder)},i.bufferGetIndex=function(){if(this.decoder)return this.functions._mpeg1_decoder_get_index(this.decoder)},i.bufferSetIndex=function(A){this.decoder&&this.functions._mpeg1_decoder_set_index(this.decoder,A)},i.bufferWrite=function(A){this.decoder||this.initializeWasmDecoder();for(var t=0,i=0;i>2)),g=this.instance.heapU8.subarray(e,e+(this.codedSize>>2));this.destination.render(s,o,g,!1)}this.advanceDecodedTime(1/this.frameRate);var I=F()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,I),!0},t}(v),H=function(A){function t(i){var e;(e=A.call(this,i)||this).onDecodeCallback=i.onAudioDecode;var s=i.audioBufferSize||131072,o=i.streaming?J.MODE.EVICT:J.MODE.EXPAND;e.bits=new J(s,o),e.left=new Float32Array(1152),e.right=new Float32Array(1152),e.sampleRate=44100,e.D=new Float32Array(1024),e.D.set(t.SYNTHESIS_WINDOW,0),e.D.set(t.SYNTHESIS_WINDOW,512),e.V=[new Float32Array(1024),new Float32Array(1024)],e.U=new Int32Array(32),e.VPos=0,e.allocation=[new Array(32),new Array(32)],e.scaleFactorInfo=[new Uint8Array(32),new Uint8Array(32)],e.scaleFactor=[new Array(32),new Array(32)],e.sample=[new Array(32),new Array(32)];for(var g=0;g<2;g++)for(var I=0;I<32;I++)e.scaleFactor[g][I]=[0,0,0],e.sample[g][I]=[0,0,0];return e}p(t,A);var i=t.prototype;return i.decode=function(){var A=F(),t=this.bits.index>>3;if(t>=this.bits.byteLength)return!1;var i=this.decodeFrame(this.left,this.right);if(this.bits.index=t+i<<3,!i)return!1;this.destination&&this.destination.play(this.sampleRate,this.left,this.right),this.advanceDecodedTime(this.left.length/this.sampleRate);var e=F()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,e),!0},i.getCurrentTime=function(){var A=this.destination?this.destination.enqueuedTime:0;return this.decodedTime-A},i.decodeFrame=function(A,i){var e=this.bits.read(11),s=this.bits.read(2),o=this.bits.read(2),g=!this.bits.read(1);if(e!==t.FRAME_SYNC||s!==t.VERSION.MPEG_1||o!==t.LAYER.II)return 0;var I=this.bits.read(4)-1;if(I>13)return 0;var a=this.bits.read(2),B=t.SAMPLE_RATE[a];if(3===a)return 0;s===t.VERSION.MPEG_2&&(a+=4,I+=14);var r=this.bits.read(1);this.bits.read(1);var C=this.bits.read(2),n=0;C===t.MODE.JOINT_STEREO?n=this.bits.read(2)+1<<2:(this.bits.skip(2),n=C===t.MODE.MONO?0:32),this.bits.skip(4),g&&this.bits.skip(16);var E=144e3*t.BIT_RATE[I]/(B=t.SAMPLE_RATE[a])+r|0,Q=0,h=0;if(s===t.VERSION.MPEG_2)Q=2,h=30;else{var d=C===t.MODE.MONO?0:1,c=t.QUANT_LUT_STEP_1[d][I];h=63&(Q=t.QUANT_LUT_STEP_2[c][a]),Q>>=6}n>h&&(n=h);for(var l=0;l>1),U=this.VPos%128>>1;U<1024;){for(var J=0;J<32;++J)this.U[J]+=this.D[L++]*this.V[N][U++];U+=96,L+=32}for(U=1120-U,L-=480;U<1024;){for(var T=0;T<32;++T)this.U[T]+=this.D[L++]*this.V[N][U++];U+=96,L+=32}for(var v=0===N?A:i,x=0;x<32;x++)v[R+x]=this.U[x]/2147418112}R+=32}}return this.sampleRate=B,E},i.readAllocation=function(A,i){var e=t.QUANT_LUT_STEP_3[i][A],s=t.QUANT_LUT_STEP4[15&e][this.bits.read(e>>4)];return s?t.QUANT_TAB[s-1]:0},i.readSamples=function(A,i,e){var s=this.allocation[A][i],o=this.scaleFactor[A][i][e],g=this.sample[A][i],I=0;if(s){if(63===o)o=0;else{var a=o/3|0;o=t.SCALEFACTOR_BASE[o%3]+(1<>1)>>a}var B=s.levels;s.group?(I=this.bits.read(s.bits),g[0]=I%B,I=I/B|0,g[1]=I%B,g[2]=I/B|0):(g[0]=this.bits.read(s.bits),g[1]=this.bits.read(s.bits),g[2]=this.bits.read(s.bits));var r=65536/(B+1)|0;I=((B=(B+1>>1)-1)-g[0])*r,g[0]=I*(o>>12)+(I*(4095&o)+2048>>12)>>12,I=(B-g[1])*r,g[1]=I*(o>>12)+(I*(4095&o)+2048>>12)>>12,I=(B-g[2])*r,g[2]=I*(o>>12)+(I*(4095&o)+2048>>12)>>12}else g[0]=g[1]=g[2]=0},t.MatrixTransform=function(A,t,i,e){var s,o,g,I,a,B,r,C,n,E,Q,h,d,c,l,u,w,p,m,D,f,y,R,k,b,G,S,F,M,q,N,L,U;s=A[0][t]+A[31][t],o=.500602998235*(A[0][t]-A[31][t]),g=A[1][t]+A[30][t],I=.505470959898*(A[1][t]-A[30][t]),a=A[2][t]+A[29][t],B=.515447309923*(A[2][t]-A[29][t]),r=A[3][t]+A[28][t],C=.53104259109*(A[3][t]-A[28][t]),n=A[4][t]+A[27][t],E=.553103896034*(A[4][t]-A[27][t]),Q=A[5][t]+A[26][t],h=.582934968206*(A[5][t]-A[26][t]),d=A[6][t]+A[25][t],c=.622504123036*(A[6][t]-A[25][t]),l=A[7][t]+A[24][t],u=.674808341455*(A[7][t]-A[24][t]),w=A[8][t]+A[23][t],p=.744536271002*(A[8][t]-A[23][t]),m=A[9][t]+A[22][t],D=.839349645416*(A[9][t]-A[22][t]),f=A[10][t]+A[21][t],y=.972568237862*(A[10][t]-A[21][t]),R=A[11][t]+A[20][t],k=1.16943993343*(A[11][t]-A[20][t]),b=A[12][t]+A[19][t],G=1.48416461631*(A[12][t]-A[19][t]),S=A[13][t]+A[18][t],F=2.05778100995*(A[13][t]-A[18][t]),M=A[14][t]+A[17][t],q=3.40760841847*(A[14][t]-A[17][t]),U=s+(N=A[15][t]+A[16][t]),N=.502419286188*(s-N),s=g+M,M=.52249861494*(g-M),g=a+S,S=.566944034816*(a-S),a=r+b,b=.64682178336*(r-b),r=n+R,R=.788154623451*(n-R),n=Q+f,f=1.06067768599*(Q-f),Q=d+m,m=1.72244709824*(d-m),d=l+w,w=5.10114861869*(l-w),l=U+d,d=.509795579104*(U-d),U=s+Q,s=.601344886935*(s-Q),Q=g+n,n=.899976223136*(g-n),g=a+r,r=2.56291544774*(a-r),a=l+g,l=.541196100146*(l-g),g=U+Q,Q=1.30656296488*(U-Q),U=a+g,a=.707106781187*(a-g),g=l+Q,g+=l=.707106781187*(l-Q),Q=d+r,d=.541196100146*(d-r),r=s+n,n=1.30656296488*(s-n),s=Q+r,r=.707106781187*(Q-r),Q=d+n,s+=Q+=d=.707106781187*(d-n),Q+=r,r+=d,n=N+w,N=.509795579104*(N-w),w=M+m,M=.601344886935*(M-m),m=S+f,f=.899976223136*(S-f),S=b+R,R=2.56291544774*(b-R),b=n+S,n=.541196100146*(n-S),S=w+m,m=1.30656296488*(w-m),w=b+S,S=.707106781187*(b-S),b=n+m,m=.707106781187*(n-m),n=N+R,N=.541196100146*(N-R),R=M+f,f=1.30656296488*(M-f),M=n+R,R=.707106781187*(n-R),n=N+f,w+=M+=n+=N=.707106781187*(N-f),M+=b+=m,b+=n+=R,n+=S,S+=R+=N,R+=m,m+=N,f=o+(L=10.1900081235*(A[15][t]-A[16][t])),o=.502419286188*(o-L),L=I+q,I=.52249861494*(I-q),q=B+F,F=.566944034816*(B-F),B=C+G,C=.64682178336*(C-G),G=E+k,E=.788154623451*(E-k),k=h+y,y=1.06067768599*(h-y),h=c+D,D=1.72244709824*(c-D),c=u+p,u=5.10114861869*(u-p),p=f+c,c=.509795579104*(f-c),f=L+h,L=.601344886935*(L-h),h=q+k,k=.899976223136*(q-k),q=B+G,G=2.56291544774*(B-G),B=p+q,p=.541196100146*(p-q),q=f+h,h=1.30656296488*(f-h),f=B+q,q=.707106781187*(B-q),B=p+h,h=.707106781187*(p-h),p=c+G,G=.541196100146*(c-G),c=L+k,k=1.30656296488*(L-k),L=p+c,c=.707106781187*(p-c),p=G+k,L+=p+=k=.707106781187*(G-k),p+=c,G=c+k,c=o+u,o=.509795579104*(o-u),u=I+D,I=.601344886935*(I-D),D=F+y,y=.899976223136*(F-y),F=C+E,E=2.56291544774*(C-E),C=c+F,c=.541196100146*(c-F),F=u+D,D=1.30656296488*(u-D),u=C+F,F=.707106781187*(C-F),C=c+D,D=.707106781187*(c-D),c=o+E,o=.541196100146*(o-E),E=I+y,y=1.30656296488*(I-y),I=c+E,E=.707106781187*(c-E),c=o+y,f+=u+=I+=c+=o=.707106781187*(o-y),u+=L,L+=I+=C+=D,I+=B+=h,B+=C+=c+=E,C+=p,p+=c+=F,c+=q,q+=F+=E+=o,F+=G,G+=E+=D,E+=h,h+=D+=o,D+=k,k+=o,i[e+48]=-U,i[e+49]=i[e+47]=-f,i[e+50]=i[e+46]=-w,i[e+51]=i[e+45]=-u,i[e+52]=i[e+44]=-s,i[e+53]=i[e+43]=-L,i[e+54]=i[e+42]=-M,i[e+55]=i[e+41]=-I,i[e+56]=i[e+40]=-g,i[e+57]=i[e+39]=-B,i[e+58]=i[e+38]=-b,i[e+59]=i[e+37]=-C,i[e+60]=i[e+36]=-Q,i[e+61]=i[e+35]=-p,i[e+62]=i[e+34]=-n,i[e+63]=i[e+33]=-c,i[e+32]=-a,i[e+0]=a,i[e+31]=-q,i[e+1]=q,i[e+30]=-S,i[e+2]=S,i[e+29]=-F,i[e+3]=F,i[e+28]=-r,i[e+4]=r,i[e+27]=-G,i[e+5]=G,i[e+26]=-R,i[e+6]=R,i[e+25]=-E,i[e+7]=E,i[e+24]=-l,i[e+8]=l,i[e+23]=-h,i[e+9]=h,i[e+22]=-m,i[e+10]=m,i[e+21]=-D,i[e+11]=D,i[e+20]=-d,i[e+12]=d,i[e+19]=-k,i[e+13]=k,i[e+18]=-N,i[e+14]=N,i[e+17]=-o,i[e+15]=o,i[e+16]=0},t}(v);H.FRAME_SYNC=2047,H.VERSION={MPEG_2_5:0,MPEG_2:2,MPEG_1:3},H.LAYER={III:1,II:2,I:3},H.MODE={STEREO:0,JOINT_STEREO:1,DUAL_CHANNEL:2,MONO:3},H.SAMPLE_RATE=new Uint16Array([44100,48e3,32e3,0,22050,24e3,16e3,0]),H.BIT_RATE=new Uint16Array([32,48,56,64,80,96,112,128,160,192,224,256,320,384,8,16,24,32,40,48,56,64,80,96,112,128,144,160]),H.SCALEFACTOR_BASE=new Uint32Array([33554432,26632170,21137968]),H.SYNTHESIS_WINDOW=new Float32Array([0,-.5,-.5,-.5,-.5,-.5,-.5,-1,-1,-1,-1,-1.5,-1.5,-2,-2,-2.5,-2.5,-3,-3.5,-3.5,-4,-4.5,-5,-5.5,-6.5,-7,-8,-8.5,-9.5,-10.5,-12,-13,-14.5,-15.5,-17.5,-19,-20.5,-22.5,-24.5,-26.5,-29,-31.5,-34,-36.5,-39.5,-42.5,-45.5,-48.5,-52,-55.5,-58.5,-62.5,-66,-69.5,-73.5,-77,-80.5,-84.5,-88,-91.5,-95,-98,-101,-104,106.5,109,111,112.5,113.5,114,114,113.5,112,110.5,107.5,104,100,94.5,88.5,81.5,73,63.5,53,41.5,28.5,14.5,-1,-18,-36,-55.5,-76.5,-98.5,-122,-147,-173.5,-200.5,-229.5,-259.5,-290.5,-322.5,-355.5,-389.5,-424,-459.5,-495.5,-532,-568.5,-605,-641.5,-678,-714,-749,-783.5,-817,-849,-879.5,-908.5,-935,-959.5,-981,-1000.5,-1016,-1028.5,-1037.5,-1042.5,-1043.5,-1040,-1031.5,1018.5,1e3,976,946.5,911,869.5,822,767.5,707,640,565.5,485,397,302.5,201,92.5,-22.5,-144,-272.5,-407,-547.5,-694,-846,-1003,-1165,-1331.5,-1502,-1675.5,-1852.5,-2031.5,-2212.5,-2394,-2576.5,-2758.5,-2939.5,-3118.5,-3294.5,-3467.5,-3635.5,-3798.5,-3955,-4104.5,-4245.5,-4377.5,-4499,-4609.5,-4708,-4792.5,-4863.5,-4919,-4958,-4979.5,-4983,-4967.5,-4931.5,-4875,-4796,-4694.5,-4569.5,-4420,-4246,-4046,-3820,-3567,3287,2979.5,2644,2280.5,1888,1467.5,1018.5,541,35,-499,-1061,-1650,-2266.5,-2909,-3577,-4270,-4987.5,-5727.5,-6490,-7274,-8077.5,-8899.5,-9739,-10594.5,-11464.5,-12347,-13241,-14144.5,-15056,-15973.5,-16895.5,-17820,-18744.5,-19668,-20588,-21503,-22410.5,-23308.5,-24195,-25068.5,-25926.5,-26767,-27589,-28389,-29166.5,-29919,-30644.5,-31342,-32009.5,-32645,-33247,-33814.5,-34346,-34839.5,-35295,-35710,-36084.5,-36417.5,-36707.5,-36954,-37156.5,-37315,-37428,-37496,37519,37496,37428,37315,37156.5,36954,36707.5,36417.5,36084.5,35710,35295,34839.5,34346,33814.5,33247,32645,32009.5,31342,30644.5,29919,29166.5,28389,27589,26767,25926.5,25068.5,24195,23308.5,22410.5,21503,20588,19668,18744.5,17820,16895.5,15973.5,15056,14144.5,13241,12347,11464.5,10594.5,9739,8899.5,8077.5,7274,6490,5727.5,4987.5,4270,3577,2909,2266.5,1650,1061,499,-35,-541,-1018.5,-1467.5,-1888,-2280.5,-2644,-2979.5,3287,3567,3820,4046,4246,4420,4569.5,4694.5,4796,4875,4931.5,4967.5,4983,4979.5,4958,4919,4863.5,4792.5,4708,4609.5,4499,4377.5,4245.5,4104.5,3955,3798.5,3635.5,3467.5,3294.5,3118.5,2939.5,2758.5,2576.5,2394,2212.5,2031.5,1852.5,1675.5,1502,1331.5,1165,1003,846,694,547.5,407,272.5,144,22.5,-92.5,-201,-302.5,-397,-485,-565.5,-640,-707,-767.5,-822,-869.5,-911,-946.5,-976,-1e3,1018.5,1031.5,1040,1043.5,1042.5,1037.5,1028.5,1016,1000.5,981,959.5,935,908.5,879.5,849,817,783.5,749,714,678,641.5,605,568.5,532,495.5,459.5,424,389.5,355.5,322.5,290.5,259.5,229.5,200.5,173.5,147,122,98.5,76.5,55.5,36,18,1,-14.5,-28.5,-41.5,-53,-63.5,-73,-81.5,-88.5,-94.5,-100,-104,-107.5,-110.5,-112,-113.5,-114,-114,-113.5,-112.5,-111,-109,106.5,104,101,98,95,91.5,88,84.5,80.5,77,73.5,69.5,66,62.5,58.5,55.5,52,48.5,45.5,42.5,39.5,36.5,34,31.5,29,26.5,24.5,22.5,20.5,19,17.5,15.5,14.5,13,12,10.5,9.5,8.5,8,7,6.5,5.5,5,4.5,4,3.5,3.5,3,2.5,2.5,2,2,1.5,1.5,1,1,1,1,.5,.5,.5,.5,.5,.5]),H.QUANT_LUT_STEP_1=[[0,0,1,1,1,2,2,2,2,2,2,2,2,2],[0,0,0,0,0,0,1,1,1,2,2,2,2,2]],H.QUANT_TAB={A:91,B:94,C:8,D:12},H.QUANT_LUT_STEP_2=[[H.QUANT_TAB.C,H.QUANT_TAB.C,H.QUANT_TAB.D],[H.QUANT_TAB.A,H.QUANT_TAB.A,H.QUANT_TAB.A],[H.QUANT_TAB.B,H.QUANT_TAB.A,H.QUANT_TAB.B]],H.QUANT_LUT_STEP_3=[[68,68,52,52,52,52,52,52,52,52,52,52],[67,67,67,66,66,66,66,66,66,66,66,49,49,49,49,49,49,49,49,49,49,49,49,32,32,32,32,32,32,32],[69,69,69,69,52,52,52,52,52,52,52,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36]],H.QUANT_LUT_STEP4=[[0,1,2,17],[0,1,2,3,4,5,6,17],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17],[0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17],[0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,17],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],H.QUANT_TAB=[{levels:3,group:1,bits:5},{levels:5,group:1,bits:7},{levels:7,group:0,bits:3},{levels:9,group:1,bits:10},{levels:15,group:0,bits:4},{levels:31,group:0,bits:5},{levels:63,group:0,bits:6},{levels:127,group:0,bits:7},{levels:255,group:0,bits:8},{levels:511,group:0,bits:9},{levels:1023,group:0,bits:10},{levels:2047,group:0,bits:11},{levels:4095,group:0,bits:12},{levels:8191,group:0,bits:13},{levels:16383,group:0,bits:14},{levels:32767,group:0,bits:15},{levels:65535,group:0,bits:16}];var P=function(A){function t(t){var i;return(i=A.call(this,t)||this).onDecodeCallback=t.onAudioDecode,i.module=t.wasmModule,i.bufferSize=t.audioBufferSize||131072,i.bufferMode=t.streaming?J.MODE.EVICT:J.MODE.EXPAND,i.sampleRate=0,i}p(t,A);var i=t.prototype;return i.initializeWasmDecoder=function(){this.module.instance?(this.instance=this.module.instance,this.functions=this.module.instance.exports,this.decoder=this.functions._mp2_decoder_create(this.bufferSize,this.bufferMode)):console.warn("JSMpeg: WASM module not compiled yet")},i.destroy=function(){this.decoder&&this.functions._mp2_decoder_destroy(this.decoder)},i.bufferGetIndex=function(){if(this.decoder)return this.functions._mp2_decoder_get_index(this.decoder)},i.bufferSetIndex=function(A){this.decoder&&this.functions._mp2_decoder_set_index(this.decoder,A)},i.bufferWrite=function(A){this.decoder||this.initializeWasmDecoder();for(var t=0,i=0;i>4<<4;this.gl.viewport(0,0,i,this.height)},t.createTexture=function(A,t){var i=this.gl,e=i.createTexture();return i.bindTexture(i.TEXTURE_2D,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.uniform1i(i.getUniformLocation(this.program,t),A),e},t.createProgram=function(A,t){var i=this.gl,e=i.createProgram();return i.attachShader(e,this.compileShader(i.VERTEX_SHADER,A)),i.attachShader(e,this.compileShader(i.FRAGMENT_SHADER,t)),i.linkProgram(e),i.useProgram(e),e},t.compileShader=function(A,t){var i=this.gl,e=i.createShader(A);if(i.shaderSource(e,t),i.compileShader(e),!i.getShaderParameter(e,i.COMPILE_STATUS))throw new Error(i.getShaderInfoLog(e));return e},t.allowsClampedTextureData=function(){var A=this.gl,t=A.createTexture();return A.bindTexture(A.TEXTURE_2D,t),A.texImage2D(A.TEXTURE_2D,0,A.LUMINANCE,1,1,0,A.LUMINANCE,A.UNSIGNED_BYTE,new Uint8ClampedArray([0])),0===A.getError()},t.renderProgress=function(A){var t=this.gl;t.useProgram(this.loadingProgram);var i=t.getUniformLocation(this.loadingProgram,"progress");t.uniform1f(i,A),t.drawArrays(t.TRIANGLE_STRIP,0,4)},t.render=function(A,t,i,e){if(this.enabled){var s=this.gl,o=this.width+15>>4<<4,g=this.height,I=o>>1,a=g>>1;e&&this.shouldCreateUnclampedViews&&(A=new Uint8Array(A.buffer),t=new Uint8Array(t.buffer),i=new Uint8Array(i.buffer)),s.useProgram(this.program),this.updateTexture(s.TEXTURE0,this.textureY,o,g,A),this.updateTexture(s.TEXTURE1,this.textureCb,I,a,t),this.updateTexture(s.TEXTURE2,this.textureCr,I,a,i),s.drawArrays(s.TRIANGLE_STRIP,0,4)}},t.updateTexture=function(A,t,i,e,s){var o=this.gl;o.activeTexture(A),o.bindTexture(o.TEXTURE_2D,t),this.hasTextureData[A]?o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,e,o.LUMINANCE,o.UNSIGNED_BYTE,s):(this.hasTextureData[A]=!0,o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,i,e,0,o.LUMINANCE,o.UNSIGNED_BYTE,s))},t.deleteTexture=function(A,t){var i=this.gl;i.activeTexture(A),i.bindTexture(i.TEXTURE_2D,null),i.deleteTexture(t)},A.IsSupported=function(){try{if(!window.WebGLRenderingContext)return!1;var A=document.createElement("canvas");return!(!A.getContext("webgl")&&!A.getContext("experimental-webgl"))}catch(A){return!1}},A}();_.SHADER={FRAGMENT_YCRCB_TO_RGBA:["precision mediump float;","uniform sampler2D textureY;","uniform sampler2D textureCb;","uniform sampler2D textureCr;","varying vec2 texCoord;","mat4 rec601 = mat4(","1.16438, 0.00000, 1.59603, -0.87079,","1.16438, -0.39176, -0.81297, 0.52959,","1.16438, 2.01723, 0.00000, -1.08139,","0, 0, 0, 1",");","void main() {","float y = texture2D(textureY, texCoord).r;","float cb = texture2D(textureCb, texCoord).r;","float cr = texture2D(textureCr, texCoord).r;","gl_FragColor = vec4(y, cr, cb, 1.0) * rec601;","}"].join("\n"),FRAGMENT_LOADING:["precision mediump float;","uniform float progress;","varying vec2 texCoord;","void main() {","float c = ceil(progress-(1.0-texCoord.y));","gl_FragColor = vec4(c,c,c,1);","}"].join("\n"),VERTEX_IDENTITY:["attribute vec2 vertex;","varying vec2 texCoord;","void main() {","texCoord = vertex;","gl_Position = vec4((vertex * 2.0 - 1.0) * vec2(1, -1), 0.0, 1.0);","}"].join("\n")};var O=function(){function A(A){A.canvas?(this.canvas=A.canvas,this.ownsCanvasElement=!1):(this.canvas=document.createElement("canvas"),this.ownsCanvasElement=!0),this.width=this.canvas.width,this.height=this.canvas.height,this.enabled=!0,this.context=this.canvas.getContext("2d")}var t=A.prototype;return t.destroy=function(){this.ownsCanvasElement&&this.canvas.remove()},t.resize=function(A,t){this.width=0|A,this.height=0|t,this.canvas.width=this.width,this.canvas.height=this.height,this.imageData=this.context.getImageData(0,0,this.width,this.height),M(this.imageData.data,255)},t.renderProgress=function(A){var t=this.canvas.width,i=this.canvas.height,e=this.context;e.fillStyle="#222",e.fillRect(0,0,t,i),e.fillStyle="#fff",e.fillRect(0,i-i*A,t,i*A)},t.render=function(A,t,i){this.YCbCrToRGBA(A,t,i,this.imageData.data),this.context.putImageData(this.imageData,0,0)},t.YCbCrToRGBA=function(A,t,i,e){if(this.enabled)for(var s,o,g,I,a,B=this.width+15>>4<<4,r=B>>1,C=0,n=B,E=B+(B-this.width),Q=0,h=r-(this.width>>1),d=0,c=4*this.width,l=4*this.width,u=this.width>>1,w=this.height>>1,p=0;p>8)-179,I=(88*o>>8)-44+(183*s>>8)-91,a=o+(198*o>>8)-227;var D=A[C++],f=A[C++];e[d]=D+g,e[d+1]=D-I,e[d+2]=D+a,e[d+4]=f+g,e[d+5]=f-I,e[d+6]=f+a,d+=8;var y=A[n++],R=A[n++];e[c]=y+g,e[c+1]=y-I,e[c+2]=y+a,e[c+4]=R+g,e[c+5]=R-I,e[c+6]=R+a,c+=8}C+=E,n+=E,d+=l,c+=l,Q+=h}},A}(),K=function(){function A(){this.context=A.CachedContext=A.CachedContext||new(window.AudioContext||window.webkitAudioContext),this.gain=this.context.createGain(),this.destination=this.gain,this.gain.connect(this.context.destination),this.context._connections=(this.context._connections||0)+1,this.startTime=0,this.buffer=null,this.wallclockStartTime=0,this.volume=1,this.enabled=!0,this.unlocked=!A.NeedsUnlocking(),Object.defineProperty(this,"enqueuedTime",{get:this.getEnqueuedTime})}var t=A.prototype;return t.destroy=function(){this.gain.disconnect(),this.context._connections--,0===this.context._connections&&(this.context.close(),A.CachedContext=null)},t.play=function(A,t,i){if(this.enabled){if(!this.unlocked){var e=F();return this.wallclockStartTimethis.memory.buffer.byteLength){var i=this.brk-this.memory.buffer.byteLength,e=Math.ceil(i/this.pageSize);this.memory.grow(e),this.createHeapViews()}return t},t.c_abort=function(A){console.warn("JSMPeg: WASM abort",arguments)},t.c_assertFail=function(A){console.warn("JSMPeg: WASM ___assert_fail",arguments)},t.readDylinkSection=function(A){var t=new Uint8Array(A),i=0,e=function(){for(var A=0,e=1;;){var s=t[i++];if(A+=(127&s)*e,e*=128,!(128&s))return A}},s=function(A){for(var e=0;ethis.maxAudioLag&&(this.audioOut.resetEnqueuedTime(),this.audioOut.enabled=!1),A=this.audio.decode()}while(A);this.audioOut.enabled=!0}},t.updateForStaticFile=function(){var A=!1,t=0;if(this.audio&&this.audio.canPlay){for(;!A&&this.audio.decodedTime-this.audio.currentTime<.25;)A=!this.audio.decode();this.video&&this.video.currentTime0&&(e>2*s&&(this.startTime+=e),A=!this.video.decode()),t=this.demuxer.currentTime-i}this.source.resume(t),A&&this.source.completed?this.loop?this.seek(0):(this.stop(),this.options.onEnded&&this.options.onEnded(this)):A&&this.options.onStalled&&this.options.onStalled(this)},A}(),j={Player:Z,VideoElement:S,BitBuffer:J,Source:{Ajax:N,AjaxProgressive:L,WebSocket:U,Fetch:function(){function A(A,t){this.url=A,this.destination=null,this.request=null,this.streaming=!0,this.completed=!1,this.established=!1,this.progress=0,this.aborted=!1,this.onEstablishedCallback=t.onSourceEstablished,this.onCompletedCallback=t.onSourceCompleted,t.hookOnEstablished&&(this.hookOnEstablished=t.hookOnEstablished)}var t=A.prototype;return t.connect=function(A){this.destination=A},t.start=function(){var A=this,t={method:"GET",headers:new Headers,cache:"default"};self.fetch(this.url,t).then((function(t){if(t.ok&&t.status>=200&&t.status<=299)return A.progress=1,A.established=!0,A.pump(t.body.getReader())})).catch((function(A){throw A}))},t.pump=function(A){var t=this;return A.read().then((function(i){if(!i.done)return t.aborted?A.cancel():(t.destination&&t.destination.write(i.value.buffer),t.pump(A));t.completed=!0})).catch((function(A){throw A}))},t.resume=function(){},t.abort=function(){this.aborted=!0},A}()},Demuxer:{TS:T},Decoder:{Base:v,MPEG1Video:x,MPEG1VideoWASM:Y,MP2Audio:H,MP2AudioWASM:P},Renderer:{WebGL:_,Canvas2D:O},AudioOutput:{WebAudio:K},WASMModule:X,Now:F,CreateVideoElements:function(){for(var A=document.querySelectorAll(".jsmpeg"),t=0;tthis.q=A))}resume(){this.q?.(),this.Z=this.q=void 0}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const $=A=>!e(A)&&"function"==typeof A.then,AA=1073741823;const tA=A(class extends t{constructor(){super(...arguments),this._$Cwt=AA,this._$Cbt=[],this._$CK=new V(this),this._$CX=new z}render(...A){return A.find((A=>!$(A)))??i}update(A,t){const e=this._$Cbt;let s=e.length;this._$Cbt=t;const o=this._$CK,g=this._$CX;this.isConnected||this.disconnected();for(let A=0;Athis._$Cwt);A++){const i=t[A];if(!$(i))return this._$Cwt=A,i;A{for(;g.get();)await g.get();const t=o.deref();if(void 0!==t){const e=t._$Cbt.indexOf(i);e>-1&&eA.has(t)))&&(this._message=null)}async _createJSMPEGPlayer(A){this._jsmpegVideoPlayer=await new Promise((t=>{let i=!1;const e=new j.VideoElement(this,A,{canvas:this._jsmpegCanvasElement},{pauseWhenHidden:!1,autoplay:!1,protocols:[],audio:!1,videoBufferSize:4194304,preserveDrawingBuffer:!0,...this.cameraConfig?.jsmpeg?.options,reconnectInterval:0,onVideoDecode:()=>{!i&&this._jsmpegCanvasElement&&(i=!0,t(e))},onPlay:()=>g(this),onPause:()=>I(this)})})),this._jsmpegCanvasElement&&a(this,this._jsmpegCanvasElement,{player:this,capabilities:{supportsPause:!0},technology:["jsmpeg"]})}_resetPlayer(){if(this._message=null,this._refreshPlayerTimer.stop(),this._jsmpegVideoPlayer){try{this._jsmpegVideoPlayer.destroy()}catch(A){}this._jsmpegVideoPlayer=void 0}this._jsmpegCanvasElement&&(this._jsmpegCanvasElement.remove(),this._jsmpegCanvasElement=void 0)}connectedCallback(){super.connectedCallback(),this.isConnected&&this.requestUpdate()}disconnectedCallback(){this.isConnected||this._resetPlayer(),super.disconnectedCallback()}async _refreshPlayer(){if(!this.hass)return;this._resetPlayer(),this._jsmpegCanvasElement=document.createElement("canvas"),this._jsmpegCanvasElement.className="media";const A=this.cameraEndpoints?.jsmpeg;if(!A)return this._message={message:B("error.live_camera_no_endpoint"),type:"error",context:this.cameraConfig},void l(this);const t=await u(this.hass,A,86400);if(!t)return this._message={type:"error",message:B("error.failed_sign"),context:this.cameraConfig},void l(this);await this._createJSMPEGPlayer(t),this._refreshPlayerTimer.start(82800,(()=>this.requestUpdate()))}render(){if(this._message)return r(this._message);return C`${tA((async()=>{if(await this._refreshPlayer(),this._jsmpegVideoPlayer&&this._jsmpegCanvasElement)return C`${this._jsmpegCanvasElement}`;this._message||(this._message={message:B("error.jsmpeg_no_player"),type:"error",context:this.cameraConfig},l(this))})(),n({cardWideConfig:this.cardWideConfig}))}`}static get styles(){return E(":host {\n width: 100%;\n height: 100%;\n display: flex;\n}\n\ncanvas {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--frigate-card-media-layout-fit, contain);\n object-position: var(--frigate-card-media-layout-position-x, 50%) var(--frigate-card-media-layout-position-y, 50%);\n object-view-box: inset(var(--frigate-card-media-layout-view-box-top, 0%) var(--frigate-card-media-layout-view-box-right, 0%) var(--frigate-card-media-layout-view-box-bottom, 0%) var(--frigate-card-media-layout-view-box-left, 0%));\n}")}};Q([h({attribute:!1})],iA.prototype,"cameraConfig",void 0),Q([h({attribute:!1})],iA.prototype,"cameraEndpoints",void 0),Q([h({attribute:!1})],iA.prototype,"cardWideConfig",void 0),Q([d()],iA.prototype,"_message",void 0),iA=Q([c("frigate-card-live-jsmpeg")],iA);export{iA as FrigateCardLiveJSMPEG}; diff --git a/config/www/community/frigate-hass-card/jsmpeg-1cb0aa9d.js.gz b/config/www/community/frigate-hass-card/jsmpeg-1cb0aa9d.js.gz new file mode 100644 index 00000000..5cf5f725 Binary files /dev/null and b/config/www/community/frigate-hass-card/jsmpeg-1cb0aa9d.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-ca-99b9960f.js b/config/www/community/frigate-hass-card/lang-ca-99b9960f.js new file mode 100644 index 00000000..b6b710be --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-ca-99b9960f.js @@ -0,0 +1 @@ +var e={frigate_card:"Tarjeta Frigate",frigate_card_description:"Una targeta Lovelace per a utilitzar amb Frigate",live:"En directe",no_media:"No hi ha suport per mostrar",recordings:"Enregistraments",version:"Versió"},a={cameras:{camera_entity:"Entitat de càmera",capabilities:{capabilities:{clips:"","favorite-events":"","favorite-recordings":"",live:"",menu:"",ptz:"",recordings:"",seek:"",snapshots:"",substream:""},disable:"",disable_except:"",editor_label:""},cast:{dashboard:{dashboard_path:"Ruta del tauler de control",view_path:"Ruta de la visualització"},editor_label:"Opcions d'emissió",method:"Mètode d'emissió",methods:{dashboard:"Tauler de control",standard:"Estàndard"}},dependencies:{all_cameras:"Mostra els esdeveniments de totes les càmeres amb aquesta càmera",cameras:"Mostra esdeveniments per a càmeres específiques amb aquesta càmera",editor_label:"Opcions de dependències"},dimensions:{aspect_ratio:"Relació d'aspecte estàtica",editor_label:"Dimensions de la càmera",layout:{editor_label:"Maquetació de la càmera",fit:"Ajust de la maquetació",fits:{contain:"Els mitjans multimèdia estan continguts/en bústia",cover:"El suport s'expandeix proporcionalment per cobrir la targeta",fill:"El suport s'estira per omplir la targeta"},pan:{x:"",y:""},position:{editor_label:"",x:"Percentatge d'emplaçament horitzontal",y:"Percentatge d'emplaçament vertical"},view_box:{bottom:"",editor_label:"",left:"",right:"",top:""},zoom:""}},engines:{editor_label:"Opcions del motor de càmera"},frigate:{camera_name:"Nom de la càmera de Frigate (detecció automàtica de l'entitat)",client_id:"Identificador de client de Frigate (per a > 1 servidor de Frigate)",editor_label:"Opcions de Frigate",labels:"Etiquetes de Frigate/filtres d'objectes",url:"URL del servidor de Frigate",zones:"Zones de Frigate"},go2rtc:{editor_label:"Opcions de go2rtc",modes:{editor_label:"Modes de go2rtc",mjpeg:"",mp4:"",mse:"",webrtc:""},stream:"nom del flux de go2rtc"},icon:"Icona d'aquesta càmera (detecció automàtica des de l'entitat)",id:"Identificador únic per a aquesta càmera en aquesta targeta",image:{editor_label:"Opcions d'imatge",refresh_seconds:"Nombre de segons després dels quals actualitzar la imatge en directe (0=mai)",url:"URL de la imatge que cal utilitzar en lloc de la instantània de l'entitat de la càmera"},live_provider:"Proveïdor de visualització en directe per a aquesta càmera",live_provider_options:{editor_label:"Opcions de proveïdor en directe"},live_providers:{auto:"Automàtic",go2rtc:"",ha:"Transmissió de vídeo de Home Assistant (és a dir, HLS, LL-HLS, WebRTC mitjançant HA)",image:"Imatges de Home Assistant",jsmpeg:"","webrtc-card":"Targeta WebRTC (és a dir, la targeta WebRTC d'AlexxIT)"},motioneye:{editor_label:"Opcions de MotionEye",images:{directory_pattern:"Patró del directori d'imatges",file_pattern:"Patró de fitxer d'imatges"},movies:{directory_pattern:"Patró del directori de pel·lícules",file_pattern:"Patró de fitxer de pel·lícules"},url:"URL de la interfície d'usuari de MotionEye"},proxy:{dynamic:"",editor_label:"",media:{auto:"",editor_label:"",false:"",true:""},ssl_ciphers:{auto:"",default:"",editor_label:"",insecure:"",intermediate:"",modern:""},ssl_verification:{auto:"",editor_label:"",false:"",true:""}},reolink:{editor_label:"",media_resolution:{editor_label:"",high:"",low:""},url:""},title:"Títol d'aquesta càmera (detecció automàtica de l'entitat)",triggers:{editor_label:"Opcions d'activació",entities:"Activador d'altres entitats",events:{clips:"Esdeveniments amb nous clips",editor_label:"Activar esdeveniments",events:"Tots els esdeveniments",snapshots:"Esdeveniments amb noves instantànies"},motion:"Activa la detecció automàtica del sensor de moviment",occupancy:"Activa la detecció automàtica del sensor d'ocupació"},webrtc_card:{editor_label:"Opcions de la targeta WebRTC",entity:"Entitat de càmera de targeta WebRTC (no una càmera de Frigate)",url:"URL de la càmera de la targeta WebRTC"}},common:{controls:{builtin:"Controls de vídeo integrats",filter:{editor_label:"Filtre multimèdia",mode:"Mode de filtre",modes:{left:"Filtre multimèdia en un calaix a l'esquerra",none:"Sense filtre multimèdia",right:"Filtre multimèdia en un calaix a la dreta"}},next_previous:{editor_label:"Següent i anterior",size:"Mida del control següent i anterior en píxels",style:"Estil de control següent i anterior",styles:{chevrons:"Xebrons",icons:"Icones",none:"Cap",thumbnails:"Miniatures"}},thumbnails:{editor_label:"Miniatures",events_media_type:"Si voleu mostrar miniatures d'esdeveniments de clips o instantànies",events_media_types:{clips:"Miniatures de clips",snapshots:"Miniatures d'instantànies"},media_type:"Si voleu mostrar miniatures d'esdeveniments o enregistraments",media_types:{events:"Esdeveniments",recordings:"Enregistraments"},mode:"Mode de miniatures",modes:{above:"Miniatures a dalt",below:"Miniatures a baix",left:"Miniatures en un calaix a l'esquerra",none:"Sense miniatures",right:"Miniatures en un calaix a la dreta"},show_details:"Mostra els detalls amb miniatures",show_download_control:"Mostra el control de descàrrega a les miniatures",show_favorite_control:"Mostra el control preferit a les miniatures",show_timeline_control:"Mostra el control de la línia de temps a les miniatures",size:"Mida de les miniatures en píxels"},timeline:{editor_label:"Mini cronologia",mode:"Mode",modes:{above:"A dalt",below:"Baix",none:"Cap"},pan_mode:"Mode d'escombratge predeterminat",pan_modes:{pan:"Escombratge",seek:"Cerca d'escombratge en tots els mitjans","seek-in-camera":"Cerca d'escombratge només a la càmera seleccionada","seek-in-media":"Cerca d'escombratge només dins de l'element multimèdia seleccionat"}}},display:{editor_label:"Visualització",grid_columns:"Nombre exacte de columnes de la graella",grid_max_columns:"Nombre màxim de columnes de la graella",grid_selected_width_factor:"Augmenta l'amplada del suport multimèdia seleccionat en aquest factor",mode:"Mode"},image:{entity:"",entity_parameters:"",mode:"Mode de visualització d'imatges",modes:{camera:"Instantània de l'entitat de la càmera de Home Assistant",entity:"",screensaver:"Logotip de Frigate incrustat",url:"Imatge arbitrària especificada per URL"},refresh_seconds:"Nombre de segons després dels quals cal actualitzar (0=mai)",url:"URL d'imatge estàtica per a la visualització d'imatges"},media_action_conditions:{all:"Totes les oportunitats",hidden:"A l'amagat del navegador/pestanya",microphone_mute:"Si el micròfon està en silenci",microphone_unmute:"Si el micròfon no està en silenci",never:"Mai",selected:"A la selecció",unselected:"En desselecció",visible:"En la visualització del navegador/pestanya"},timeline:{clustering_threshold:"El recompte d'esdeveniments en què s'agrupen (0=sense agrupació)",events_media_type:"Els esdeveniments multimèdia que mostra la línia de temps",events_media_types:{all:"Tots els tipus de mitjans",clips:"Clips",snapshots:"Imatges instantànies"},show_recordings:"Mostra les gravacions",style:"Estil de cronologia",styles:{ribbon:"Esdeveniments en una sola cinta",stack:"Esdeveniments apilats i agrupats"},window_seconds:"La durada predeterminada de la visualització de la línia de temps en segons"}},dimensions:{aspect_ratio:"Relació d'aspecte predeterminada (p. ex., '16:9')",aspect_ratio_mode:"Mode de relació d'aspecte",aspect_ratio_modes:{dynamic:"La relació d'aspecte s'ajusta al suport multimèdia",static:"Relació d'aspecte estàtica",unconstrained:"Relació d'aspecte sense restriccions"},height:""},live:{auto_mute:"Silencia automàticament les càmeres en directe",auto_pause:"Posa en pausa automàticament les càmeres en directe",auto_play:"Reprodueix automàticament les càmeres en directe",auto_unmute:"Activa automàticament el so de les càmeres en directe",controls:{editor_label:"Controls del directe",ptz:{editor_label:"PTZ",hide_home:"Amaga el control de casa",hide_pan_tilt:"Amaga el control d'escombratge i inclinació",hide_zoom:"Amaga el control de zoom",mode:"Mode",modes:{off:"Desactivat",on:"Activat"},orientation:"Orientació",orientations:{horizontal:"Horitzontal",vertical:"Vertical"},position:"Posició",positions:{"bottom-left":"Inferior esquerra","bottom-right":"Inferior dreta","top-left":"Superior left","top-right":"Superior dreta"}}},draggable:"La vista de càmeres en directe es pot arrossegar/lliscar",lazy_load:"Les càmeres en directe es carreguen amb mandra",lazy_unload:"Les càmeres en directe es descarreguen amb mandra",microphone:{always_connected:"Mantingueu sempre el micròfon connectat",disconnect_seconds:"Segons després dels quals desconnectar el micròfon (0=mai)",editor_label:"Micròfon",enabled:"El micròfon està activat",mute_after_microphone_mute_seconds:"Segons després de silenciar el micròfon per silenciar l'àudio entrant"},preload:"Carregueu prèviament la visualització en directe en segon pla",show_image_during_load:"Mostra la imatge fixa mentre es carrega la reproducció en directe",transition_effect:"Efecte de transició de càmera en directe",zoomable:"Les càmeres en directe es poden ampliar/escombrar"},media_viewer:{auto_mute:"Silencia automàticament els continguts multimèdia",auto_pause:"Atura automàticament el contingut multimèdia",auto_play:"Reprodueix automàticament els continguts multimèdia",auto_unmute:"Activa automàticament el so del contingut multimèdia",controls:{editor_label:"Controls del visualitzador de contingut multimèdia"},draggable:"El visualitzador de mitjans es pot arrossegar/lliscar",lazy_load:"El contingut multimèdia del visualitzador multimèdia es carreguen amb mandra al carrusel",snapshot_click_plays_clip:"Si feu clic a una instantània, es reprodueix un clip relacionat",transition_effect:"Efecte de transició del visualitzador multimèdia",transition_effects:{none:"Sense transició",slide:"Transició de diapositives"},zoomable:"El visualitzador de mitjans es pot ampliar/escombrar"},menu:{alignment:"Alineació del menú",alignments:{bottom:"Alineat a la part inferior",left:"Alineat a l'esquerra",right:"Alineat a la dreta",top:"Alineat a la part superior"},button_size:"Mida del botó del menú en píxels",buttons:{alignment:"Alineació de botons",alignments:{matching:"Coincideix amb l'alineació del menú",opposing:"Oposat a l'alineació del menú"},camera_ui:"Interfície d'usuari de la càmera",cameras:"Càmeres",clips:"Clips",display_mode:"Mode de visualització",download:"Descarregar",enabled:"Botó habilitat",expand:"Expandir",frigate:"Menú de Frigate / Vista per defecte",fullscreen:"Pantalla completa",icon:"Icona",image:"Imatge",live:"En directe",media_player:"Envia al reproductor multimèdia",microphone:"Micròfon",mute:"Silenciar / Activar el so",permanent:"",play:"Reproduir / Pausa",priority:"Prioritat",ptz_controls:"",ptz_home:"",recordings:"Enregistraments",screenshot:"Captura de pantalla",snapshots:"Imatges instantànies",substreams:"Subfluxos",timeline:"Cronologia",type:"Tipus de botó",types:{momentary:"Momentani",toggle:"Commuta"}},position:"Posició del menú",positions:{bottom:"Situat a la part inferior",left:"Situat a l'esquerra",right:"Situat a la dreta",top:"Situat a la part superior"},style:"Estil de menú",styles:{hidden:"Menú ocult",hover:"Menú passant el cursor","hover-card":"Menú passant el cursor (a tota la targeta)",none:"Sense menú",outside:"Menú exterior",overlay:"Menú superposat"}},overrides:{info:"Aquesta configuració de targeta ha especificat manualment substitucions configurades que poden anul·lar els valors que es mostren a l'editor visual; consulteu l'editor de codi per veure/modificar aquestes substitucions."},performance:{features:{animated_progress_indicator:"Indicador animat del progrés",editor_label:"Opcions de característiques",max_simultaneous_engine_requests:"",media_chunk_size:"Mida del fragment multimèdia"},style:{border_radius:"Corbes",box_shadow:"Ombres",editor_label:"Opcions d'estil"},warning:"Aquesta targeta està en mode de perfil baix, de manera que els valors predeterminats han canviat per optimitzar el rendiment"},profiles:{casting:"",editor_label:"","low-performance":"",scrubbing:""},status_bar:{height:"",items:{enabled:"",engine:"",live_provider:"",priority:"",resolution:"",technology:"",title:""},popup_seconds:"",position:"",positions:{bottom:"",top:""},style:"",styles:{hover:"","hover-card":"",none:"",outside:"",overlay:"",popup:""}},view:{camera_select:"Visualitza les càmeres seleccionades recentment",dark_mode:"Mode fosc",dark_modes:{auto:"Automàtic",off:"Desactivat",on:"Activat"},default:"Vista per defecte",default_cycle_camera:"Passeu per les càmeres quan s'actualitzi la vista predeterminada",default_reset:{after_interaction:"Restableix la vista predeterminada després de la interacció de l'usuari",editor_label:"",entities:"",every_seconds:"Actualitza la vista predeterminada cada X segons (0=mai)",interaction_mode:"",interaction_modes:{active:"",all:"",inactive:""}},interaction_seconds:"Segons després de l'acció de l'usuari per continuar interactuant (0=mai)",keyboard_shortcuts:{editor_label:"",enabled:"",ptz_down:"",ptz_home:"",ptz_left:"",ptz_right:"",ptz_up:"",ptz_zoom_in:"",ptz_zoom_out:""},triggers:{actions:{editor_label:"Activar accions",interaction_mode:"Com gestionar les accions quan la targeta té interacció humana",interaction_modes:{active:"Activa només accions quan la targeta té interacció humana",all:"Activa accions independentment de la interacció humana",inactive:"Només activa accions quan la targeta no té interacció humana"},trigger:"Activar l'acció",triggers:{default:"Canvia o actualitza la vista predeterminada",live:"Canvia o actualitza la visualització en directe",media:"Canvieu a la visualització de mitjans rellevants per als nous mitjans",none:"Sense acció"},untrigger:"Desactiva l'acció",untriggers:{default:"Canvia a la vista/càmera predeterminada",none:"Sense acció"}},editor_label:"Comportament quan s'activa una càmera",filter_selected_camera:"Activa només a la càmera seleccionada",show_trigger_status:"Mostra la vora intermitent quan s'activa",untrigger_seconds:"Segons després del canvi d'estat inactiu a desactivat"},views:{clip:"Clip més recent",clips:"Galeria de clips",current:"Vista actual",image:"Imatge estàtica",live:"Visualització en directe",recording:"Enregistrament més recent",recordings:"Galeria d'enregistraments",snapshot:"Instantània més recent",snapshots:"Galeria d'instantànies",timeline:"Vista cronològica"}}},i={grid:"Mostra el visualitzador multimèdia per a cada càmera d'una quadrícula",single:"Mostra un visualitzador multimèdia únic"},t={add_new_camera:"Afegeix una càmera nova",button:"Botó",camera:"Càmera",cameras:"Càmeres",cameras_secondary:"Quines càmeres renderitzar en aquesta targeta",delete:"Suprimeix",dimensions:"Dimensions",dimensions_secondary:"Opcions de dimensions i forma",image:"Imatge",image_secondary:"Opcions de visualització d'imatges estàtiques",live:"En directe",live_secondary:"Opcions de visualització de la càmera en directe",media_gallery:"Galeria multimèdia",media_gallery_secondary:"Opcions de la galeria multimèdia",media_viewer:"Visor multimèdia",media_viewer_secondary:"Visor de suports estàtics (clips, instantànies o enregistraments)",menu:"Menú",menu_secondary:"Opcions d'aspecte del menú",move_down:"Moure cap avall",move_up:"Moure cap amunt",overrides:"Les substitucions estan actives",overrides_secondary:"S'han detectat substitucions de configuració dinàmica",performance:"Rendiment",performance_secondary:"Opcions de rendiment de la targeta",profiles:"",profiles_secondary:"",status_bar:"",status_bar_secondary:"",timeline:"Cronologia",timeline_secondary:"Opcions de la cronologia d'esdeveniments",upgrade:"Upgrade",upgrade_available:"Hi ha disponible una actualització automàtica de la configuració de la targeta",view:"Vista",view_secondary:"Què ha de mostrar la targeta i com mostrar-la"},r={ptz:{down:"Avall",home:"Casa",left:"Esquerra",right:"Dreta",up:"Amunt",zoom_in:"Ampliar",zoom_out:"Reduir"}},s={awaiting_live:"S'està esperant que es carregui la transmissió en directe ...",awaiting_media:"",camera_initialization:"",camera_initialization_reolink:"",could_not_render_elements:"No s'han pogut representar els elements de la imatge",could_not_resolve:"No s'ha pogut resoldre l'URL multimèdia",diagnostics:"Diagnòstic de targetes. Reviseu la informació confidencial abans de compartir-la",download_no_media:"No hi ha contingut multimèdia per descarregar",download_sign_failed:"No s'ha pogut signar l'URL multimèdia per baixar-la",duplicate_camera_id:"Duplica l'identificador de la càmera Frigate per a la següent càmera, utilitza el paràmetre 'id' per identificar les càmeres de manera única",empty_response:"S'ha rebut una resposta buida de Home Assistant per a la sol·licitud",failed_response:"No s'ha pogut rebre la resposta de Home Assistant per a la sol·licitud",failed_retain:"No s'ha pogut retenir l'esdeveniment",failed_sign:"No s'ha pogut signar l'URL de Home Assistant",image_load_error:"No s'ha pogut carregar la imatge",invalid_configuration:"Configuració no vàlida",invalid_configuration_no_hint:"No hi ha cap indicació d'ubicació disponible (tipus dolent o faltant?)",invalid_configuration_override:"",invalid_elements_config:"La configuració dels elements de la imatge no és vàlida",invalid_response:"S'ha rebut una resposta no vàlida de Home Assistant per a la sol·licitud",jsmpeg_no_player:"No s'ha pogut iniciar el reproductor JSMPEG",live_camera_no_endpoint:"No s'ha pogut obtenir el punt final de la càmera per a aquest proveïdor en directe (configuració incompleta?)",live_camera_not_found:"No s'ha trobat la 'camera_entity' (entitat de la càmera) configurada",live_camera_unavailable:"Càmera no disponible",no_camera_engine:"No s'ha pogut determinar el motor adequat per a la càmera",no_camera_entity:"No s'ha pogut trobar l'entitat de la càmera",no_camera_entity_for_triggers:"Es requereix una entitat de càmera per detectar automàticament els activadors",no_camera_id:"No s'ha pogut determinar l'identificador de la càmera per a la següent càmera, és possible que hagis d'establir el paràmetre 'id' manualment",no_camera_name:"No s'ha pogut determinar el nom de la càmera Frigate per a la càmera (o una de les seves dependències), especifiqueu 'camera_entity' o 'camera_name'",no_dashboard_or_view:"Tant els paràmetres 'dashboard_path' com 'view_path' són necessaris per al mètode d'emissió 'dashboard'",no_live_camera:"El paràmetre 'camera_entity' s'ha de configurar i validar per a aquest proveïdor en directe",no_supported_camera:"",no_supported_cameras:"",reconnecting:"Reconnectant",too_many_automations:"Hi ha massa trucades d'automatització imbricades, comproveu la vostra configuració per veure si hi ha bucles",troubleshooting:"Comproveu la resolució de problemes",unknown:"Error desconegut",upgrade_available:"Hi ha disponible una actualització automàtica de la configuració de la targeta; visiteu l'editor de targetes visuals",webrtc_card_reported_error:"La targeta WebRTC ha informat d'un error",webrtc_card_waiting:"S'està esperant que es carregui la targeta WebRTC ..."},n={camera:"Càmera",duration:"Durada",in_progress:"En procés",score:"Puntuació",seek:"Buscar",start:"Començar",tag:"Etiqueta",what:"Què",where:"On"},o={assign:"",modifiers:{alt:"",ctrl:"",meta:"",shift:""},unassign:""},l={all:"Tots",camera:"Càmera",favorite:"Preferit",media_type:"Tipus de suport multimèdia",media_types:{clips:"Clips",recordings:"Enregistraments",snapshots:"Imatges instantànies"},not_favorite:"No preferit",select_camera:"Selecciona la càmera...",select_favorite:"Selecciona el preferit...",select_media_type:"Selecciona el tipus de suport multimèdia...",select_tag:"Selecciona l'etiqueta...",select_what:"Selecciona el què...",select_when:"Selecciona quan...",select_where:"Selecciona on...",tag:"Etiqueta",what:"Què",when:"Quan",whens:{custom:"Personalitzat",past_month:"El mes passat",past_week:"La setmana passada",today:"Avui",yesterday:"Ahir"},where:"On"},d={unseekable:"Busqueu temps no trobat als mitjans multimèdia"},c={camera:"Càmera",duration:"Durada",events:"Esdeveniments",in_progress:"En procés",seek:"Buscar",start:"Començar"},m={download:"Descarregar mitjans multimèdia",no_thumbnail:"No hi ha cap miniatura disponible",retain_indefinitely:"Els mitjans multimèdia es conservaran indefinidament",timeline:"Veure els mitjans multimèdia a la línia de temps"},u={select_date:"Escolliu la data"},p={common:e,config:a,display_modes:i,editor:t,elements:r,error:s,event:n,key_assigner:o,media_filter:l,media_viewer:d,recording:c,thumbnail:m,timeline:u};export{e as common,a as config,p as default,i as display_modes,t as editor,r as elements,s as error,n as event,o as key_assigner,l as media_filter,d as media_viewer,c as recording,m as thumbnail,u as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-ca-99b9960f.js.gz b/config/www/community/frigate-hass-card/lang-ca-99b9960f.js.gz new file mode 100644 index 00000000..2ea98978 Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-ca-99b9960f.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-fr-e5e97bbf.js b/config/www/community/frigate-hass-card/lang-fr-e5e97bbf.js new file mode 100644 index 00000000..d4bfda6b --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-fr-e5e97bbf.js @@ -0,0 +1 @@ +var e={frigate_card:"Carte Frigate",frigate_card_description:"Une carte Lovelace à utiliser avec Frigate",live:"En direct",no_media:"Aucun média à afficher",recordings:"Enregistrements",version:"Version"},a={cameras:{camera_entity:"Entité caméra",capabilities:{capabilities:{clips:"Clips","favorite-events":"Événements favoris","favorite-recordings":"Enregistrements favoris",live:"Vue en direct",menu:"Menu",ptz:"PTZ",recordings:"Enregistrements",seek:"Recherche",snapshots:"Snapshots",substream:"flux secondaire"},disable:"Désactiver",disable_except:"Désactive sauf",editor_label:"Capacités de la caméra"},cast:{dashboard:{dashboard_path:"Chemin du tableau de bord",view_path:"Voir le chemin"},editor_label:"Options de diffusion",method:"Méthodes de diffusion",methods:{dashboard:"Dashboard",standard:"Standard"}},dependencies:{all_cameras:"Afficher les événements pour toutes les caméras avec cette caméra",cameras:"Afficher les événements pour des caméras spécifiques avec cette caméra",editor_label:"Options de dépendance"},dimensions:{aspect_ratio:"Rapport d'aspect d'image",editor_label:"Dimensions de la caméra",layout:{editor_label:"Disposition de la caméra",fit:"Ajustement de la disposition",fits:{contain:"Le média est contenu",cover:"Le média s'étend proportionnellement pour couvrir la carte",fill:"Le média est étiré pour remplir la carte"},pan:{x:"Pourcentage de panoramique horizontal",y:"Pourcentage de panoramique vertical"},position:{editor_label:"Position de la couverture",x:"Pourcentage de positionnement horizontal",y:"Pourcentage de positionnement vertical"},view_box:{bottom:"",editor_label:"",left:"",right:"",top:""},zoom:"Facteur de zoom"}},engines:{editor_label:"Options du moteur de caméra"},frigate:{camera_name:"Nom de la caméra Frigate (détecté automatiquement par l'entité)",client_id:"ID client Frigate (Si plus d'un serveur Frigate)",editor_label:"Options de Frigate",labels:"Étiquettes de Frigate/filtres d'objets",url:"URL du serveur Frigate",zones:"Zones Frigate"},go2rtc:{editor_label:"Options go2rtc",modes:{editor_label:"Modes go2rtc",mjpeg:"Motion JPEG (MJPEG)",mp4:"MPEG-4 (MP4)",mse:"Extensions de sources multimédias (MSE)",webrtc:"Web Real-Time Communication (WebRTC)"},stream:"nom du flux go2rtc"},icon:"Icône pour cette caméra (auto-détectée par l'entité)",id:"ID unique pour cette caméra dans cette carte",image:{editor_label:"Options d'images",refresh_seconds:"Nombre de secondes après lesquelles actualiser l'image en direct (0=jamais)",url:"URL de l'image à utiliser à la place de l'instantané de l'entité de la caméra"},live_provider:"Fournisseur de visualisation en direct pour cette caméra",live_provider_options:{editor_label:"Options du fournisseur en direct"},live_providers:{auto:"Automatique",go2rtc:"go2rtc",ha:"Flux vidéo Home Assistant (c'est-à-dire HLS, LL-HLS, WebRTC via HA)",image:"Images d'Home Assistant",jsmpeg:"JSMpeg","webrtc-card":"Carte WebRTC (c.-⁠à-⁠d. La carte WebRTC d'AlexxIT)"},motioneye:{editor_label:"Options de MotionEye",images:{directory_pattern:"Modèle de répertoire d'images",file_pattern:"Modèle de fichier images"},movies:{directory_pattern:"Modèle de répertoire de films",file_pattern:"Modèle de fichier de films"},url:"URL de l’interface MotionEye"},proxy:{dynamic:"",editor_label:"",media:{auto:"",editor_label:"",false:"",true:""},ssl_ciphers:{auto:"",default:"",editor_label:"",insecure:"",intermediate:"",modern:""},ssl_verification:{auto:"",editor_label:"",false:"",true:""}},reolink:{editor_label:"Option Reolink",media_resolution:{editor_label:"Désolution du média",high:"Haute résolution",low:"Basse résolution"},url:"URL de l'interface utilisateur Reolink"},title:"Titre de cette caméra (détection automatique à partir de l'entité)",triggers:{editor_label:"Modèle de répertoire des films",entities:"Déclencheur à partir d'autres entités",events:{clips:"Événements avec de nouveaux clips",editor_label:"Événements déclencheurs",events:"Tous les événements",snapshots:"Événements avec de nouveaux instantanés"},motion:"Déclenchement par détection automatique du capteur de mouvement",occupancy:"Déclenchement par détection automatique du capteur de présence"},webrtc_card:{editor_label:"Options de la carte WebRTC",entity:"Entité de caméra de carte WebRTC (pas une caméra de Frigate)",url:"URL de la caméra de la carte WebRTC"}},common:{controls:{builtin:"Commandes vidéo intégrées",filter:{editor_label:"Filtre multimédia",mode:"Mode de filtre",modes:{left:"Filtre média dans un menu à gauche",none:"Pas de filtre média",right:"Filtre média dans un menu à droite"}},next_previous:{editor_label:"Suivant et précédent",size:"Taille des contrôles suivant et précédent en pixels",style:"Style de contrôle suivant et précédent",styles:{chevrons:"Chevrons",icons:"Icônes",none:"Aucun",thumbnails:"Vignettes"}},thumbnails:{editor_label:"Vignettes",events_media_type:"S'il faut afficher des vignettes de clips ou des instantanés",events_media_types:{clips:"Vignettes de clips",snapshots:"Vignettes d'instantanés"},media_type:"Afficher ou non les vignettes des événements ou des enregistrements",media_types:{events:"Événements",recordings:"Enregistrements"},mode:"Mode vignettes",modes:{above:"Vignettes en haut",below:"Vignettes en bas",left:"Vignettes dans un menu à gauche",none:"Aucune vignette",right:"Vignettes dans un menu à droite"},show_details:"Afficher les détails avec des vignettes",show_download_control:"Afficher le contrôle de téléchargement sur les vignettes",show_favorite_control:"Afficher le contrôle favori sur les vignettes",show_timeline_control:"Afficher le contrôle de la chronologie sur les vignettes",size:"Taille des vignettes en pixels"},timeline:{editor_label:"Mini-chronologie",mode:"Mode",modes:{above:"Au-dessus",below:"En dessous",none:"Aucun"},pan_mode:"Mode panoramique par défaut",pan_modes:{pan:"Pan",seek:"Pan cherche parmi toutes les caméras","seek-in-camera":"Pan ne cherche que parmi la caméra sélectionnée","seek-in-media":"Pan ne cherche que parmi les médias sélectionnés"}}},display:{editor_label:"Affichage",grid_columns:"Nombre de colonnes de la grille",grid_max_columns:"Nombre maximum de colonnes de la grille",grid_selected_width_factor:"Augmenter la largeur du média sélectionnée par ce facteur",mode:"Mode"},image:{entity:"Entité à utiliser avec le mode entité",entity_parameters:"Paramètres de requête ajoutés aux URL des images basées sur l'entité (par exemple, width=1920&height=1080)",mode:"Mode d'affichage des images",modes:{camera:"Instantané de la caméra Home Assistant de l'entité caméra",entity:"Entité avec l'attribut entity_picture",screensaver:"Logo Frigate intégré",url:"Image arbitraire spécifiée par URL"},refresh_seconds:"Nombre de secondes après lesquelles actualiser (0=jamais)",url:"URL d'image statique pour l'affichage de l'image"},media_action_conditions:{all:"Toutes les opportunités",hidden:"Sur le navigateur/onglet masqué",microphone_mute:"Sourdine du microphone activée",microphone_unmute:"Sourdine du microphone désactivée",never:"Jamais",selected:"Sur sélection",unselected:"Lors de la désélection",visible:"Sur la visibilité du navigateur/onglet"},timeline:{clustering_threshold:"Le nombre d'événements pour lesquels ils sont regroupés (0 = pas de clustering)",events_media_type:"Les médias affichés par la chronologie",events_media_types:{all:"Tous types de médias",clips:"Extraits",snapshots:"Instantanés"},show_recordings:"Afficher les enregistrements",style:"Style de chronologie",styles:{ribbon:"Événements sur un seul ruban",stack:"Événements empilés et groupés"},window_seconds:"La durée par défaut de la vue chronologique en secondes"}},dimensions:{aspect_ratio:"Format d'image par défaut (par exemple '16:9')",aspect_ratio_mode:"Mode rapport hauteur/largeur",aspect_ratio_modes:{dynamic:"Le rapport hauteur/largeur s'adapte au média",static:"Rapport hauteur/largeur statique",unconstrained:"Rapport hauteur/largeur sans contrainte"},height:"Hauteur de la carte en unités CSS (par exemple, '500px')"},live:{auto_mute:"Couper automatiquement le son des caméras en direct",auto_pause:"Mettre automatiquement en pause les caméras en direct",auto_play:"Lire automatiquement les caméras en direct",auto_unmute:"Activer automatiquement le son des caméras en direct",controls:{editor_label:"Contrôles en direct",ptz:{editor_label:"PTZ",hide_home:"Cacher le bouton position d'origine",hide_pan_tilt:"Cacher les boutons panoramiques/inclinaison",hide_zoom:"Cacher le bouton de zoom",mode:"Mode",modes:{off:"Eteint",on:"Allumé"},orientation:"",orientations:{horizontal:"Horizontale",vertical:"Verticale"},position:"",positions:{"bottom-left":"En bas à gauche","bottom-right":"En bas à droite","top-left":"En haut à gauche","top-right":"En haut à droite"}}},draggable:"La vue des caméras en direct peut être déplacée/glissée",lazy_load:"Les caméras en direct sont chargeés en différé",lazy_unload:"Les caméras en direct sont déchargés en différé",microphone:{always_connected:"Toujours garder le microphone connecté",disconnect_seconds:"Secondes après quoi déconnecter le microphone (0=jamais)",editor_label:"Microphone",enabled:"Microphone activé",mute_after_microphone_mute_seconds:"Secondes après la mise en sourdine du microphone pour couper l'audio entrant"},preload:"Précharger la vue en direct en arrière-plan",show_image_during_load:"Afficher une image fixe pendant le chargement du flux en direct",transition_effect:"Effet de transition de caméra en direct",zoomable:"Les caméras en direct peuvent être zoomées/panoramiques"},media_viewer:{auto_mute:"Couper automatiquement le son des médias",auto_pause:"Mettre automatiquement en pause les médias",auto_play:"Lire automatiquement les médias",auto_unmute:"Activer automatiquement le son des médias",controls:{editor_label:"Commandes de la visionneuse multimédia"},draggable:"La visionneuse multimédia peut être déplacée/glissée",lazy_load:"Les médias Media Viewer sont chargés en différé dans le carrousel",snapshot_click_plays_clip:"Cliquer sur un instantané lit l'extrait associé",transition_effect:"Effet de transition de la visionneuse multimédia",transition_effects:{none:"Pas de transition",slide:"Transition de diapositive"},zoomable:"La visionneuse multimédia peut être zoomée/panoramique"},menu:{alignment:"Alignement des menus",alignments:{bottom:"Aligné vers le bas",left:"Aligné à gauche",right:"Aligné à droite",top:"Aligné vers le haut"},button_size:"Taille du bouton de menu en pixels",buttons:{alignment:"Alignement des boutons",alignments:{matching:"Faire correspondre l'alignement du menu",opposing:"S'opposer à l'alignement des menus"},camera_ui:"Interface utilisateur de la caméra",cameras:"Cameras",clips:"Extraits",display_mode:"Mode d'afficahge",download:"Télécharger",enabled:"Bouton activé",expand:"Développer",frigate:"Menu Frigate / Vue par défaut",fullscreen:"Plein écran",icon:"Icône",image:"Image",live:"En direct",media_player:"Envoyer au lecteur multimédia",microphone:"Microphone",mute:"Désactiver/Réactiver le son",permanent:"Afficher lorsque le menu est caché",play:"Jouer / Pause",priority:"Priorité",ptz_controls:"Afficher les controles PTZ",ptz_home:"Position d'origine PTZ",recordings:"Enregistrements",screenshot:"Capture d'écran",snapshots:"Instantanés",substreams:"flux secondaires",timeline:"Chronologie",type:"Type de bouton",types:{momentary:"Momentané",toggle:"Basculer"}},position:"Emplacement des menus",positions:{bottom:"Positionné en bas",left:"Positionné à gauche",right:"Positionné à droite",top:"Positionné en haut"},style:"Style de menu",styles:{hidden:"Menu caché",hover:"Menu survolé","hover-card":"Menu survolé (à l'échelle de la carte)",none:"Pas de menu",outside:"Menu extérieur",overlay:"Menu superposé"}},overrides:{info:"Cette configuration de carte comporte des remplacements spécifiés manuellement et configurés qui peuvent remplacer les valeurs affichées dans l'éditeur visuel. Veuillez consulter l'éditeur de code pour afficher/modifier ces remplacements."},performance:{features:{animated_progress_indicator:"Indicateur de progression animé",editor_label:"Options de fonctionnalités",max_simultaneous_engine_requests:"Nombre maximal de requêtes simultanées au moteur de caméra",media_chunk_size:"Taille du morceau de média"},style:{border_radius:"Courbes",box_shadow:"Ombres",editor_label:"Options de style"},warning:"Cette carte est en mode profil bas, les paramètres par défaut ont donc été modifiés pour optimiser les performances."},profiles:{casting:"Diffusion",editor_label:"Configuration des profils","low-performance":"Basse performance",scrubbing:"Balayage vidéo"},status_bar:{height:"Hauteur de la barre d'état en pixels",items:{enabled:"Item activé",engine:"Moteur de camera",live_provider:"fournisseur de flux en direc",priority:"Priorité de l'item",resolution:"Résolution",technology:"Technologie",title:"Titre"},popup_seconds:"Secondes de popup de la barre d'état",position:"Position de la barre d'état",positions:{bottom:"Postionné en bas",top:"Postionné en haut"},style:"Style de la barre d'état",styles:{hover:"Barre d'état au survol","hover-card":"Barre d'état au survol (sur toute la carte)",none:"Pas de barre d'état",outside:"Barre d'état extérieure",overlay:"Barre d'état superposée",popup:"Barre d'état contextuelle"}},view:{camera_select:"Afficher les caméras nouvellement sélectionnées",dark_mode:"Mode sombre",dark_modes:{auto:"Automatique",off:"Désactivé",on:"Activé"},default:"Vue par défaut",default_cycle_camera:"Parcourez les caméras lorsque la vue par défaut est mise à jour",default_reset:{after_interaction:"Réinitialiser à la vue par défaut après la fin de l'interaction de l'utilisateur",editor_label:"Comportement de réinitialisation de la vue par défaut",entities:"Réinitialiser à la vue par défaut lors du changement d'état de l'entité",every_seconds:"Actualiser la vue par défaut toutes les X secondes (0=jamais)",interaction_mode:"Comment la réinitialisation par défaut se comporte lorsque la carte a une interaction humaine",interaction_modes:{active:"Autoriser la réinitialisation uniquement lorsque la carte a une interaction humaine active",all:"Réinitialiser indépendamment de l'interaction humaine",inactive:"Réinitialiser uniquement lorsque la carte n'a pas d'interaction humaine"}},interaction_seconds:"Secondes après l'action de l'utilisateur pour maintenir l'interaction (0=jamais)",keyboard_shortcuts:{editor_label:"Raccourcis clavier",enabled:"Raccourcis clavier activés",ptz_down:"PTZ bas",ptz_home:"PTZ position d'origine",ptz_left:"PTZ gauche",ptz_right:"PTZ droite",ptz_up:"PTZ haut",ptz_zoom_in:"PTZ zoomer",ptz_zoom_out:"PTZ dézoomer"},triggers:{actions:{editor_label:"Actions de déclenchement",interaction_mode:"Comment gérer les actions lorsque la carte comporte une interaction humaine ?",interaction_modes:{active:"Ne déclencher des actions que lorsque la carte a une interaction humaine",all:"Déclencher des actions sans interaction humaine",inactive:"Ne déclencher des actions que lorsque la carte n'a pas d'interaction humaine"},trigger:"Actions de déclenchement",triggers:{default:"Changement ou mise à jour de la vue par défaut",live:"Change ou met a jour la vue en direct",media:"Changement d'affichage pour les nouveaux médias",none:"Pas d'acction"},untrigger:"Action de désactivation",untriggers:{default:"Passage à la vue/caméra par défaut",none:"Pas d'action"}},editor_label:"Comportement en cas de déclenchement d'une caméra",filter_selected_camera:"Déclenchement uniquement sur la caméra sélectionnée",show_trigger_status:"Afficher la bordure clignotante lors du déclenchement",untrigger_seconds:"Quelques secondes après le changement d'état inactif pour débloquer"},views:{clip:"Clip le plus récent",clips:"Galerie de clips",current:"Vue actuelle",image:"Image statique",live:"Vue en direct",recording:"Enregistrement le plus récent",recordings:"Galerie d'enregistrements",snapshot:"Instantané le plus récent",snapshots:"Galerie d'instantanés",timeline:"Vue chronologique"}}},t={grid:"Afficher la visionneuse de médias pour chaque caméra d'une grille",single:"Afficher une seule visionneuse"},i={add_new_camera:"Ajouter une nouvelle caméra",button:"Bouton",camera:"Caméra",cameras:"Caméras",cameras_secondary:"Quelles caméras afficher sur cette carte",delete:"Supprimer",dimensions:"Dimensions",dimensions_secondary:"Options de dimensions et de forme",image:"Image",image_secondary:"Options d'affichage d'image statique",live:"En direct",live_secondary:"Options d'affichage de la caméra en direct",media_gallery:"Galerie des médias",media_gallery_secondary:"Options de la galerie multimédia",media_viewer:"Visionneuse de médias",media_viewer_secondary:"Visionneuse de médias statiques (clips, instantanés ou enregistrements)",menu:"Menu",menu_secondary:"Options d'apparence et de convivialité du menu",move_down:"Descendre",move_up:"Déplacer vers le haut",overrides:"Les remplacements sont actifs",overrides_secondary:"Remplacements de configuration dynamique détectés",performance:"Performance",performance_secondary:"Options de performances de la carte",profiles:"Profils de confi",profiles_secondary:"Choisir des ensembles de paramètres par défaut pré-configurés",status_bar:"Barre d'état",status_bar_secondary:"Options d'apparence et de comportement de la barre d'état",timeline:"Chronologie",timeline_secondary:"Options de chronologie des événements",upgrade:"Mise à niveau",upgrade_available:"Une mise à niveau automatique de la configuration de la carte est disponible",view:"Voir",view_secondary:"Ce que la carte doit montrer et comment la montrer"},n={ptz:{down:"Bas",home:"Origine",left:"Gauche",right:"Droite",up:"Haut",zoom_in:"Zoomer",zoom_out:"Dézoomer"}},r={awaiting_live:"En attente du flux en direct...",awaiting_media:"En attente du chargement des médias",camera_initialization:"Échec de l'initialisation de la caméra",camera_initialization_reolink:"Impossible d'initialiser la caméra Reolink",could_not_render_elements:"Impossible de restituer les éléments de l'image",could_not_resolve:"Impossible de résoudre l'URL du média",diagnostics:"Diagnostic de la carte. Veuillez enlever les informations confidentielles avant de les partager",download_no_media:"Aucun média à télécharger",download_sign_failed:"Impossible de signer l'URL du média à télécharger",duplicate_camera_id:"ID de caméra Frigate en double pour la caméra suivante, utilisez le paramètre « ID » pour identifier de manière unique les caméras",empty_response:"Réponse vide reçue de Home Assistant pour la demande",failed_response:"Échec de la réponse de Home Assistant à la demande",failed_retain:"Impossible de conserver l'événement",failed_sign:"Impossible de signer l'URL de Home Assistant",image_load_error:"L'image n'a pas pu être chargée",invalid_configuration:"Configuration invalide",invalid_configuration_no_hint:"Aucune indication de localisation disponible (type incorrect ou manquant ?)",invalid_configuration_override:"Configuration de remplacement invalide",invalid_elements_config:"Configuration des éléments d'image invalide",invalid_response:"Réponse non valide reçue de Home Assistant pour la demande",jsmpeg_no_player:"Impossible de démarrer le lecteur JSMPEG",live_camera_no_endpoint:"Impossible d'obtenir le point de terminaison de la caméra pour ce fournisseur en direct (configuration incomplète ?)",live_camera_not_found:"L'entité caméra configurée n'a pas été trouvée",live_camera_unavailable:"Caméra indisponible",no_camera_engine:"Impossible de déterminer le moteur approprié pour la caméra",no_camera_entity:"Impossible de trouver l'entité de caméra",no_camera_entity_for_triggers:"Une entité caméra est requise pour détecter automatiquement les déclencheurs",no_camera_id:"Impossible de déterminer l'identifiant de la caméra suivante. Il faudra peut-être définir le paramètre « ID » manuellement",no_camera_name:"Impossible de déterminer le nom de la caméra Frigate pour la caméra (ou l'une de ses dépendances). Veuillez spécifier soit « camera_entity » soit « camera_name ».",no_dashboard_or_view:"Les paramètres 'dashboard_path' et 'view_path' sont requis pour la méthode de conversion 'dashboard'",no_live_camera:"Le paramètre camera_entity doit être défini et valide pour ce fournisseur en direct",no_supported_camera:"La caméra sélectionnée ne prend pas en charge cette vue",no_supported_cameras:"Aucune caméra ne prend en charge cette vue",reconnecting:"Reconnexion",too_many_automations:"Trop d'appels d'automatisation imbriqués, veuillez vérifier votre configuration pour les boucles",troubleshooting:"Vérifier le dépannage",unknown:"Erreur inconnue",upgrade_available:"Une mise à niveau automatisée de la configuration de la carte est disponible, veuillez visiter l'éditeur visuel de la carte",webrtc_card_reported_error:"La carte WebRTC a signalé une erreur",webrtc_card_waiting:"En attente du chargement de la carte WebRTC..."},o={camera:"Caméra",duration:"Durée",in_progress:"En cours",score:"Score",seek:"Chercher",start:"Commencer",tag:"Étiqueter",what:"Quoi",where:"Où"},s={assign:"Assigner",modifiers:{alt:"",ctrl:"",meta:"",shift:""},unassign:"Désassigner"},l={all:"Tous",camera:"Caméra",favorite:"Préféré",media_type:"Type de support",media_types:{clips:"Extraits",recordings:"Enregistrements",snapshots:"Instantanés"},not_favorite:"Pas favori",select_camera:"Sélectionnez une caméra...",select_favorite:"Sélectionnez un favori...",select_media_type:"Sélectionnez le type de média...",select_tag:"Sélectionnez la balise...",select_what:"Sélectionnez quoi...",select_when:"Sélectionnez quand...",select_where:"Sélectionnez où...",tag:"Étiqueter",what:"Quoi",when:"Quand",whens:{custom:"",past_month:"Mois passé",past_week:"La semaine dernière",today:"Aujourd'hui",yesterday:"Hier"},where:"Où"},d={unseekable:"Temps non trouvé dans les médias"},c={camera:"Caméra",duration:"Durée",events:"Événements",in_progress:"En cours",seek:"Chercher",start:"Commencer"},u={download:"Télécharger des médias",no_thumbnail:"Aucune vignette disponible",retain_indefinitely:"Les médias seront conservés indéfiniment",timeline:"Voir les médias dans la chronologie"},m={select_date:"Choisir une date"},p={common:e,config:a,display_modes:t,editor:i,elements:n,error:r,event:o,key_assigner:s,media_filter:l,media_viewer:d,recording:c,thumbnail:u,timeline:m};export{e as common,a as config,p as default,t as display_modes,i as editor,n as elements,r as error,o as event,s as key_assigner,l as media_filter,d as media_viewer,c as recording,u as thumbnail,m as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-fr-e5e97bbf.js.gz b/config/www/community/frigate-hass-card/lang-fr-e5e97bbf.js.gz new file mode 100644 index 00000000..d75d09d2 Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-fr-e5e97bbf.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-it-7713a746.js b/config/www/community/frigate-hass-card/lang-it-7713a746.js new file mode 100644 index 00000000..40b44cc8 --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-it-7713a746.js @@ -0,0 +1 @@ +var e={frigate_card:"Frigate card",frigate_card_description:"Una scheda Lovelace per l'uso con Frigate",live:"Live",no_media:"Nessun contenuto multimediale da visualizzare",recordings:"Registrazioni",version:"Versione"},i={cameras:{camera_entity:"Entità della telecamera",capabilities:{capabilities:{clips:"","favorite-events":"","favorite-recordings":"",live:"",menu:"",ptz:"",recordings:"",seek:"",snapshots:"",substream:""},disable:"",disable_except:"",editor_label:""},cast:{dashboard:{dashboard_path:"",view_path:""},editor_label:"",method:"",methods:{dashboard:"",standard:""}},dependencies:{all_cameras:"Mostra eventi per tutte le telecamere con questa telecamera",cameras:"Mostra eventi per telecamere specifiche con questa telecamera",editor_label:"Opzioni di dipendenza"},dimensions:{aspect_ratio:"",editor_label:"",layout:{editor_label:"",fit:"Adatta al layout",fits:{contain:"Il supporto è contenuto/in cassetta delle lettere",cover:"Il supporto si espande proporzionalmente per coprire la scheda",fill:"Il supporto viene allungato per riempire la scheda"},pan:{x:"",y:""},position:{editor_label:"",x:"Percentuale di posizionamento orizzontale",y:"Percentuale di posizionamento verticale"},view_box:{bottom:"",editor_label:"",left:"",right:"",top:""},zoom:""}},engines:{editor_label:"Opzioni del motore della fotocamera"},frigate:{camera_name:"Nome della telecamera frigate (autodificato dall'entità)",client_id:"ID client Frigate (per > 1 Frigate server)",editor_label:"Frigate Opzione",labels:"Etichette per fregate/filtri per oggetti",url:"Frigate URL del server",zones:"Frigate Zone"},go2rtc:{editor_label:"Opzioni go2rtc",modes:{editor_label:"Modalità go2rtc",mjpeg:"JPEG animato (MJPEG)",mp4:"MPEG-4 (MP4)",mse:"Estensioni sorgente multimediale (MSE)",webrtc:"Comunicazione Web in tempo reale (WebRTC)"},stream:"nome del flusso go2rtc"},icon:"Icona per questa telecamera (Autoidentificato dall'entità)",id:"ID univoco per questa telecamera in questa carta",image:{editor_label:"Opzioni immagine",refresh_seconds:"Numero di secondi dopo i quali aggiornare l'immagine live (0=mai)",url:"URL dell'immagine da utilizzare al posto dell'istantanea dell'entità fotocamera"},live_provider:"Provider di visualizzazione dal vivo per questa telecamera",live_provider_options:{editor_label:"Opzioni del fornitore in tempo reale"},live_providers:{auto:"Automatica",go2rtc:"go2rtc",ha:"Streaming video di Home Assistant (ovvero HLS, LL-HLS, WebRTC tramite HA)",image:"Immagini Home Assistant",jsmpeg:"JSMpeg","webrtc-card":"Scheda WebRTC (ovvero la scheda WebRTC di Alexxit)"},motioneye:{editor_label:"Opzioni di MotionEye",images:{directory_pattern:"Modello di directory delle immagini",file_pattern:"Modello di file di immagini"},movies:{directory_pattern:"Modello di directory dei film",file_pattern:"Modello di file di film"},url:"URL dell'interfaccia utente di MotionEye"},proxy:{dynamic:"",editor_label:"",media:{auto:"",editor_label:"",false:"",true:""},ssl_ciphers:{auto:"",default:"",editor_label:"",insecure:"",intermediate:"",modern:""},ssl_verification:{auto:"",editor_label:"",false:"",true:""}},reolink:{editor_label:"",media_resolution:{editor_label:"",high:"",low:""},url:""},title:"Titolo per questa telecamera (Autoidentificato dall'entità)",triggers:{editor_label:"Trigger Opzioni",entities:"Trigger da altre entità",events:{clips:"",editor_label:"",events:"",snapshots:""},motion:"Trigger rilevando automaticamente dal sensore di movimento",occupancy:"Attivare rilevando automatico tramite il sensore di presenza"},webrtc_card:{editor_label:"Opzioni della scheda WebRTC",entity:"Entità della telecamera della scheda WebRTC (non una telecamera Frigate)",url:"URL della telecamera della scheda WebRTC"}},common:{controls:{builtin:"",filter:{editor_label:"Filtro multimediale",mode:"Modalità filtro",modes:{left:"Filtro multimediale in un cassetto a sinistra",none:"Nessun filtro multimediale",right:"Filtro multimediale in un cassetto a destra"}},next_previous:{editor_label:"Successivo e precedente",size:"Successiva e Precedenti dimensioni di controllo nei pixel",style:"Stile di controllo successivo e precedente",styles:{chevrons:"Chevrons",icons:"Icone",none:"Nessuno",thumbnails:"Miniature"}},thumbnails:{editor_label:"Miniature",events_media_type:"Se mostrare miniature di clip o istantanee",events_media_types:{clips:"Miniature di clip",snapshots:"Miniature istantanee"},media_type:"",media_types:{events:"",recordings:""},mode:"Modalità miniatura",modes:{above:"Miniature sopra",below:"Miniature sotto",left:"Miniature in un cassetto a sinistra",none:"Nessuna miniatura",right:"Miniature in un cassetto a destra"},show_details:"Mostra i dettagli con le miniature",show_download_control:"Mostra il controllo del download sulle miniature",show_favorite_control:"Mostra il controllo preferito sulle miniature",show_timeline_control:"Mostra il controllo della sequenza temporale sulle miniature",size:"Dimensione delle miniature in pixel"},timeline:{editor_label:"Mini Cronologia",mode:"Modalità",modes:{above:"sopra",below:"sotto",none:"sessuna"},pan_mode:"",pan_modes:{pan:"",seek:"","seek-in-camera":"","seek-in-media":""}}},display:{editor_label:"",grid_columns:"",grid_max_columns:"",grid_selected_width_factor:"",mode:""},image:{entity:"",entity_parameters:"",mode:"Modalità Visualizza immagine",modes:{camera:"Istantanea della telecamera di Home Assistant dell'entità telecamera",entity:"",screensaver:"Logo Frigate incorporato",url:"Immagine arbitraria specificata dall'URL"},refresh_seconds:"Numero di secondi dopo i quali aggiornare (0 = mai)",url:"URL di immagine statica per la vista dell'immagine"},media_action_conditions:{all:"Tutte le opportunità",hidden:"Sul browser/nascondere le schede",microphone_mute:"",microphone_unmute:"",never:"Mai",selected:"Sulla selezione",unselected:"Sulla non selezione",visible:"Sul browser/visibilità della scheda"},timeline:{clustering_threshold:"Il conteggio degli eventi in cui sono raggruppati (0 = nessun clustering)",events_media_type:"I media vengono visualizzati la sequenza temporale",events_media_types:{all:"Tutti i tipi di media",clips:"Clip",snapshots:"Istantanee"},show_recordings:"Mostra registrazioni",style:"",styles:{ribbon:"",stack:""},window_seconds:"La lunghezza predefinita della vista della sequenza temporale in secondi"}},dimensions:{aspect_ratio:"Proporzioni predefinite (ad es. '16:9')",aspect_ratio_mode:"Modalità proporzioni",aspect_ratio_modes:{dynamic:"Le proporzioni si adattano ai media",static:"Proporzioni statiche",unconstrained:"Proporzioni non vincolate"},height:""},live:{auto_mute:"Muta automaticamente le telecamere in diretta",auto_pause:"Metti in pausa automaticamente le telecamere in diretta",auto_play:"Gioca automaticamente le telecamere dal vivo",auto_unmute:"Riattiva automaticamente l'audio delle telecamere live",controls:{editor_label:"Controlli dal vivo",ptz:{editor_label:"",hide_home:"",hide_pan_tilt:"",hide_zoom:"",mode:"",modes:{off:"",on:""},orientation:"",orientations:{horizontal:"",vertical:""},position:"",positions:{"bottom-left":"","bottom-right":"","top-left":"","top-right":""}}},draggable:"Il Visualizzatore eventi può essere trascinato oppure puoi scorrere",lazy_load:"Le telecamere dal vivo sono pigramente cariche",lazy_unload:"Le telecamere dal vivo sono pigramente non caricate",microphone:{always_connected:"",disconnect_seconds:"",editor_label:"",enabled:"",mute_after_microphone_mute_seconds:""},preload:"Precarica Live View in background",show_image_during_load:"Mostra un'immagine fissa durante il caricamento del live streaming",transition_effect:"Effetto di transizione della telecamera dal vivo",zoomable:""},media_viewer:{auto_mute:"Muta automaticamente i media",auto_pause:"Metti in Pausa automaticamente i media",auto_play:"Riproduci automaticamente i contenuti multimediali",auto_unmute:"Riattiva automaticamente i contenuti multimediali",controls:{editor_label:"Controlli di visualizzatore multimediale"},draggable:"Il visualizzatore multimediale può essere trascinato oppure può scorrere",lazy_load:"Il media Viewer viene caricato pigramente nel carosello",snapshot_click_plays_clip:"",transition_effect:"Effetto di transizione del visualizzatore multimediale",transition_effects:{none:"Nessuna transizione",slide:"Transizione diapositiva"},zoomable:""},menu:{alignment:"Allineamento dei menu",alignments:{bottom:"Allineato al fondo",left:"Allineato a sinistra",right:"Allineato a destra",top:"Allineato in cima"},button_size:"Dimensione del pulsante menu in pixel",buttons:{alignment:"Allineamento dei pulsanti",alignments:{matching:"Corrispondenza con l'allineamento del menu",opposing:"Contrastare l'allineamento del menu"},camera_ui:"Interfaccia utente della fotocamera",cameras:"Telecamere",clips:"Clip",display_mode:"",download:"Download",enabled:"Pulsante abilitato",expand:"Espandere",frigate:"Frigate menu / Visualizzazione predefinita",fullscreen:"A schermo intero",icon:"Icona",image:"Immagine",live:"Abitare",media_player:"Invia a Media Player",microphone:"",mute:"",permanent:"",play:"",priority:"Priorità",ptz_controls:"",ptz_home:"",recordings:"",screenshot:"",snapshots:"Istantanee",substreams:"Flusso/i secondario/i",timeline:"Timeline",type:"",types:{momentary:"",toggle:""}},position:"Posizione del menu",positions:{bottom:"Posizionato sul fondo",left:"Posizionato a sinistra",right:"Posizionato a destra",top:"Posizionato in alto"},style:"Stile menu",styles:{hidden:"Menu nascosto",hover:"Menu al passaggio del mouse","hover-card":"",none:"Nessun menu",outside:"Menu esterno",overlay:"Menu di overlay"}},overrides:{info:"Questa configurazione della scheda ha specificato manualmente le sostituzioni configurate che possono sostituire i valori mostrati nell'editor visivo, consultare l'editor di codice per visualizzare/modificare queste sostituzioni"},performance:{features:{animated_progress_indicator:"Indicatore di avanzamento animato",editor_label:"Opzioni funzionalità",max_simultaneous_engine_requests:"",media_chunk_size:"Dimensione del blocco multimediale"},style:{border_radius:"Curve",box_shadow:"Ombre",editor_label:"Opzione di stile"},warning:"Questa scheda è in modalità basso profilo, quindi le impostazioni predefinite sono state modificate per ottimizzare le prestazioni"},profiles:{casting:"",editor_label:"","low-performance":"",scrubbing:""},status_bar:{height:"",items:{enabled:"",engine:"",live_provider:"",priority:"",resolution:"",technology:"",title:""},popup_seconds:"",position:"",positions:{bottom:"",top:""},style:"",styles:{hover:"","hover-card":"",none:"",outside:"",overlay:"",popup:""}},view:{camera_select:"Visualizza per le telecamere appena selezionate",dark_mode:"Tema scuro",dark_modes:{auto:"auto",off:"Off",on:"On"},default:"Visualizzazione predefinita",default_cycle_camera:"Scorri le telecamere quando si aggiorna la visualizzazione predefinita",default_reset:{after_interaction:"",editor_label:"",entities:"",every_seconds:"Aggiorna la visualizzazione predefinita ogni x secondi (0 = mai)",interaction_mode:"",interaction_modes:{active:"",all:"",inactive:""}},interaction_seconds:"",keyboard_shortcuts:{editor_label:"",enabled:"",ptz_down:"",ptz_home:"",ptz_left:"",ptz_right:"",ptz_up:"",ptz_zoom_in:"",ptz_zoom_out:""},triggers:{actions:{editor_label:"",interaction_mode:"",interaction_modes:{active:"",all:"",inactive:""},trigger:"",triggers:{default:"",live:"",media:"",none:""},untrigger:"",untriggers:{default:"",none:""}},editor_label:"",filter_selected_camera:"",show_trigger_status:"Mostra bordo pulsante quando attivato",untrigger_seconds:"Reimposta la vista ai valori predefiniti dopo aver annullato l'attivazione"},views:{clip:"Clip più recente",clips:"Galleria delle clip",current:"Vista corrente",image:"Immagine statica",live:"Dal vivo",recording:"",recordings:"",snapshot:"Snapshot più recente",snapshots:"Galleria delle istantanee",timeline:"Vista della timeline"}}},a={grid:"",single:""},t={add_new_camera:"Aggiungi nuova telecamera",button:"Pulsante",camera:"Telecamera",cameras:"Telecamere",cameras_secondary:"Quali telecamere visualizzare su questa card",delete:"Elimina",dimensions:"",dimensions_secondary:"",image:"Immagine",image_secondary:"Opzioni di visualizzazione dell'immagine statica",live:"Live",live_secondary:"Opzioni di visualizzazione della telecamera live",media_gallery:"Galleria multimediale",media_gallery_secondary:"Opzioni della galleria multimediale",media_viewer:"Visualizzatore dei media",media_viewer_secondary:"Visualizzatore per supporti statici (clip, istantanee o registrazioni)",menu:"Menu",menu_secondary:"Opzioni di aspetto e funzionalità del menu",move_down:"Sposta verso il basso",move_up:"Sposta verso l'alto",overrides:"La sovrascrittura è attiva",overrides_secondary:"Rilevate sovrascritture della configurazione dinamica",performance:"",performance_secondary:"",profiles:"",profiles_secondary:"",status_bar:"",status_bar_secondary:"",timeline:"Timeline",timeline_secondary:"Opzioni della timeline degli eventi",upgrade:"Aggiornamento",upgrade_available:"È disponibile un aggiornamento della configurazione della scheda automatica",view:"Visualizzazione",view_secondary:"Cosa dovrebbe mostrare la carta e come mostrarla"},o={ptz:{down:"Giù",home:"Home",left:"Sinistra",right:"Destra",up:"Su",zoom_in:"Ingrandire",zoom_out:"Zoom indietro"}},n={awaiting_live:"",awaiting_media:"",camera_initialization:"",camera_initialization_reolink:"",could_not_render_elements:"Impossibile renderizzare gli elementi dell'immagine",could_not_resolve:"Impossibile risolvere l'URL dei media",diagnostics:"Diagnostica delle carte.Si prega di rivedere per informazioni riservate prima di condividere",download_no_media:"Nessun media da scaricare",download_sign_failed:"Impossibile firmare URL multimediale per il download",duplicate_camera_id:"Duplicato ID dellla telecamera Frigate, utilizzare il parametro 'ID' per identificare in modo univoco le telecamere",empty_response:"Ricevuto risposta vuota da Home Assistant per la richiesta",failed_response:"Impossibile ricevere risposta da Home Assistant per la richiesta",failed_retain:"Impossibile conservare l'evento",failed_sign:"Impossibile firmare l'URL ad Home Assistant",image_load_error:"L'immagine non può essere caricata",invalid_configuration:"Configurazione non valida",invalid_configuration_no_hint:"Nessun suggerimento di posizione disponibile (tipo difettoso o mancante?)",invalid_configuration_override:"",invalid_elements_config:"Configurazione degli elementi di immagine non valida",invalid_response:"Ricevuta una risposta non valida da Home Assistant per la richiesta",jsmpeg_no_player:"Impossibile avviare JSMPEG Player",live_camera_no_endpoint:"Impossibile ottenere l'endpoint della videocamera per questo provider live (configurazione incompleta?)",live_camera_not_found:"La telecamera configurata non è stata trovata",live_camera_unavailable:"Telecamera non disponibile",no_camera_engine:"Impossibile determinare il motore adatto per la fotocamera",no_camera_entity:"Impossibile trovare l'entità fotocamera",no_camera_entity_for_triggers:"È necessaria un'entità telecamera per rilevare automaticamente i trigger",no_camera_id:"Impossibile determinare l'ID della telecamera , potrebbe essere necessario impostare manualmente il parametro 'ID'",no_camera_name:"Impossibile determinare un nome della telecamera in Frigate, si prega di specificare 'camera_enty' o 'camera_name'",no_dashboard_or_view:"",no_live_camera:"Il parametro fotocamera_enty deve essere impostato e valido per questo provider live",no_supported_camera:"",no_supported_cameras:"",reconnecting:"Riconnessione",too_many_automations:"",troubleshooting:"Controllare la risoluzione dei problemi",unknown:"Errore sconosciuto",upgrade_available:"È disponibile un aggiornamento di configurazione della scheda automatizzato, visitare l'editor di schede visive",webrtc_card_reported_error:"La scheda WebRTC ha riportato un errore",webrtc_card_waiting:"Aspettando che la scheda WebRTC si carichi ..."},r={camera:"Camera",duration:"Durata",in_progress:"In corso",score:"Punteggio",seek:"Cercare",start:"Avvia",tag:"",what:"Che cosa",where:"Dove"},l={assign:"",modifiers:{alt:"",ctrl:"",meta:"",shift:""},unassign:""},s={all:"Tutto",camera:"Telecamera",favorite:"Preferito",media_type:"Tipo di supporto",media_types:{clips:"Clip",recordings:"Registrazioni",snapshots:"Istantanee"},not_favorite:"Non preferito",select_camera:"Seleziona fotocamera...",select_favorite:"Seleziona preferito...",select_media_type:"Seleziona il tipo di supporto...",select_tag:"",select_what:"Seleziona cosa...",select_when:"Seleziona quando...",select_where:"Seleziona dove...",tag:"Tag",what:"Che cosa",when:"Quando",whens:{custom:"",past_month:"Mese scorso",past_week:"Settimana scorso",today:"Oggi",yesterday:"Ieri"},where:"Dove"},d={unseekable:""},m={camera:"Camera",duration:"Durata",events:"Eventi",in_progress:"In corso",seek:"Cercare",start:"Inizio"},c={download:"",no_thumbnail:"Nessuna miniatura disponibile",retain_indefinitely:"L'evento sarà mantenuto indefinitamente",timeline:"Vedi evento nella timeline"},u={select_date:"Scegli la data"},p={common:e,config:i,display_modes:a,editor:t,elements:o,error:n,event:r,key_assigner:l,media_filter:s,media_viewer:d,recording:m,thumbnail:c,timeline:u};export{e as common,i as config,p as default,a as display_modes,t as editor,o as elements,n as error,r as event,l as key_assigner,s as media_filter,d as media_viewer,m as recording,c as thumbnail,u as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-it-7713a746.js.gz b/config/www/community/frigate-hass-card/lang-it-7713a746.js.gz new file mode 100644 index 00000000..27adcdd7 Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-it-7713a746.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-pt-BR-ea76ed6c.js b/config/www/community/frigate-hass-card/lang-pt-BR-ea76ed6c.js new file mode 100644 index 00000000..980be008 --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-pt-BR-ea76ed6c.js @@ -0,0 +1 @@ +var e={frigate_card:"Cartão Frigate",frigate_card_description:"Um cartão da Lovelace para usar com Frigate",live:"Ao Vivo",no_media:"Nenhuma mídia para exibir",recordings:"Gravações",version:"Versão"},a={cameras:{camera_entity:"Entidade da Câmera",capabilities:{capabilities:{clips:"","favorite-events":"","favorite-recordings":"",live:"",menu:"",ptz:"",recordings:"",seek:"",snapshots:"",substream:""},disable:"",disable_except:"",editor_label:""},cast:{dashboard:{dashboard_path:"",view_path:""},editor_label:"",method:"",methods:{dashboard:"",standard:""}},dependencies:{all_cameras:"Mostrar eventos para todas as câmeras nesta câmera",cameras:"Mostrar eventos para câmeras específicas nesta câmera",editor_label:"Opções de dependência"},dimensions:{aspect_ratio:"",editor_label:"",layout:{editor_label:"",fit:"Ajuste de layout",fits:{contain:"A mídia é contida no cartão",cover:"A mídia se expande proporcionalmente para cobrir o cartão",fill:"A mídia é esticada para preencher o cartão"},pan:{x:"",y:""},position:{editor_label:"",x:"Porcentagem do posicionamento horizontal",y:"Porcentagem do posicionamento vertical"},view_box:{bottom:"",editor_label:"",left:"",right:"",top:""},zoom:""}},engines:{editor_label:"Opções do motor da câmera"},frigate:{camera_name:"Nome da câmera do Frigate (detectado automaticamente pela entidade)",client_id:"ID do cliente do Frigate (para >1 servidor Frigate)",editor_label:"Opções do Frigate",labels:"Rótulos do Frigate/filtros de objetos",url:"URL do servidor Frigate",zones:"Zonas do Frigate"},go2rtc:{editor_label:"Opções do go2rtc",modes:{editor_label:"Modos do go2rtc",mjpeg:"Motion JPEG (MJPEG)",mp4:"MPEG-4 (MP4)",mse:"Media Source Extensions (MSE)",webrtc:"Web Real-Time Communication (WebRTC)"},stream:"Nome do stream do go2rtc"},icon:"Ícone para esta câmera (detectado automaticamente pela entidade)",id:"ID exclusivo para esta câmera nesse cartão",image:{editor_label:"Opções de Imagem",refresh_seconds:"Número de segundos após os quais atualizar a imagem ao vivo (0=nunca)",url:"URL da imagem para usar em vez do instantâneo da entidade da câmera"},live_provider:"Provedor de visualização ao vivo para esta câmera",live_provider_options:{editor_label:"Opções do provedor de visualização ao vivo"},live_providers:{auto:"Automatico",go2rtc:"go2rtc",ha:"Stream de vídeo do Home Assistant (ou seja, HLS, LL-HLS, WebRTC via HA)",image:"Imagens do Home Assistant",jsmpeg:"JSMpeg","webrtc-card":"Cartão WebRTC (de @AlexxIT)"},motioneye:{editor_label:"Opções do MotionEye",images:{directory_pattern:"Padrão de diretório de imagens",file_pattern:"Padrão de arquivo de imagens"},movies:{directory_pattern:"Padrão de diretório de filmes",file_pattern:"Padrão de arquivo de filmes"},url:"URL da interface de usuário do MotionEye"},proxy:{dynamic:"",editor_label:"",media:{auto:"",editor_label:"",false:"",true:""},ssl_ciphers:{auto:"",default:"",editor_label:"",insecure:"",intermediate:"",modern:""},ssl_verification:{auto:"",editor_label:"",false:"",true:""}},reolink:{editor_label:"",media_resolution:{editor_label:"",high:"",low:""},url:""},title:"Título para esta câmera (detectado automaticamente pela entidade)",triggers:{editor_label:"Opções de acionamento",entities:"Acionar a partir de outras entidades",events:{clips:"",editor_label:"",events:"",snapshots:""},motion:"Acionar detectando automaticamente o sensor de movimento",occupancy:"Acionar detectando automaticamente o sensor de ocupação"},webrtc_card:{editor_label:"Opções do cartão WebRTC",entity:"Entidade de câmera de cartão WebRTC (não é uma câmera Frigate)",url:"URL da câmera do cartão WebRTC"}},common:{controls:{builtin:"",filter:{editor_label:"Filtro de Mídia",mode:"Modo do filtro",modes:{left:"Filtro de mídia em uma gaveta à esquerda",none:"Sem filtro de mídia",right:"Filtro de mídia em uma gaveta à direita"}},next_previous:{editor_label:"Próximo",size:"Tamanho de controle próximo e anterior",style:"Estilo do controle próximo e anterior",styles:{chevrons:"Setas",icons:"Ícones",none:"Nenhum",thumbnails:"Miniaturas"}},thumbnails:{editor_label:"Miniaturas",events_media_type:"Se deve mostrar miniaturas de clipes ou snapshots",events_media_types:{clips:"Miniaturas de clipes",snapshots:"Miniaturas de Snapshots"},media_type:"",media_types:{events:"",recordings:""},mode:"Modo de miniaturas",modes:{above:"Miniaturas acima da mídia",below:"Miniaturas abaixo da mídia",left:"Miniaturas em uma gaveta à esquerda",none:"Sem miniaturas",right:"Miniaturas em uma gaveta à direita"},show_details:"Mostrar detalhes com miniaturas",show_download_control:"Mostrar controle de download nas miniaturas",show_favorite_control:"Mostrar controle de favorito nas miniaturas",show_timeline_control:"Mostrar controle da linha do tempo nas miniaturas",size:"Tamanho das miniaturas em pixels"},timeline:{editor_label:"Controles da linha do tempo",mode:"Modo",modes:{above:"Acima",below:"Abaixo",none:"Nenhum"},pan_mode:"",pan_modes:{pan:"",seek:"","seek-in-camera":"","seek-in-media":""}}},display:{editor_label:"",grid_columns:"",grid_max_columns:"",grid_selected_width_factor:"",mode:""},image:{entity:"",entity_parameters:"",mode:"Modo de visualização de imagem",modes:{camera:"Instantâneo da câmera do Home Assistant, da entidade de câmera",entity:"",screensaver:"Logo Frigate embutido",url:"Imagem arbitrária especificada por URL"},refresh_seconds:"Número de segundos após o qual atualizar (0 = nunca)",url:"Imagem arbitrária especificada por URL"},media_action_conditions:{all:"Todas as oportunidades",hidden:"Ao ocultar o navegador/aba",microphone_mute:"",microphone_unmute:"",never:"Nunca",selected:"Ao selecionar",unselected:"Ao desselecionar",visible:"Ao mostrar o navegador/aba"},timeline:{clustering_threshold:"A contagem de eventos nos quais eles são agrupados (0 = sem agrupamento)",events_media_type:"A mídia que a linha do tempo exibe",events_media_types:{all:"Todos os tipos de mídia",clips:"Clipes",snapshots:"Instantâneos"},show_recordings:"Mostrar gravações",style:"",styles:{ribbon:"",stack:""},window_seconds:"A duração padrão da visualização da linha do tempo em segundos"}},dimensions:{aspect_ratio:"Proporção padrão (e.g. '16:9')",aspect_ratio_mode:"Modo de proporção",aspect_ratio_modes:{dynamic:"A proporção se ajusta à mídia",static:"Proporção estática",unconstrained:"Proporção irrestrita"},height:""},live:{auto_mute:"Silenciar câmeras ao vivo automaticamente",auto_pause:"Pausar câmeras ao vivo automaticamente",auto_play:"Reproduzir câmeras ao vivo automaticamente",auto_unmute:"Ativar automaticamente o som das câmeras ao vivo",controls:{editor_label:"Controles da visualização ao vivo",ptz:{editor_label:"",hide_home:"",hide_pan_tilt:"",hide_zoom:"",mode:"",modes:{off:"",on:""},orientation:"",orientations:{horizontal:"",vertical:""},position:"",positions:{"bottom-left":"","bottom-right":"","top-left":"","top-right":""}}},draggable:"A visualização ao vivo das câmeras pode ser arrastada/deslizada",lazy_load:"As câmeras ao vivo são carregadas lentamente",lazy_unload:"As câmeras ao vivo são descarregadas preguiçosamente",microphone:{always_connected:"",disconnect_seconds:"",editor_label:"",enabled:"",mute_after_microphone_mute_seconds:""},preload:"Pré-carregar a visualização ao vivo em segundo plano",show_image_during_load:"Mostrar imagem estática enquanto a transmissão ao vivo está carregando",transition_effect:"Efeito de transição de câmera ao vivo",zoomable:""},media_viewer:{auto_mute:"Silenciar mídia automaticamente",auto_pause:"Pausar mídia automaticamente",auto_play:"Reproduzir mídia automaticamente",auto_unmute:"Ativar mídia automaticamente",controls:{editor_label:"Controles do visualizador de mídia"},draggable:"Visualizador de eventos pode ser arrastado/deslizado",lazy_load:"A mídia do Visualizador de eventos é carregada lentamente no carrossel",snapshot_click_plays_clip:"Clicar em um instantâneo reproduz um clipe relacionado",transition_effect:"Efeito de transição do Visualizador de eventos",transition_effects:{none:"Sem transição",slide:"Transição de slides"},zoomable:""},menu:{alignment:"Alinhamento do menu",alignments:{bottom:"Alinhado à parte inferior",left:"Alinhado à esquerda",right:"Alinhado à direita",top:"Alinhado ao topo"},button_size:"Tamanho do botão de menu (e.g. '40px')",buttons:{alignment:"Alinhamento do botão",alignments:{matching:"Mesmo alinhamento do menu",opposing:"Opor-se ao alinhamento do menu"},camera_ui:"Interface de usuário da câmera",cameras:"Selecionar câmera",clips:"Clipes",display_mode:"",download:"Baixe a mídia do evento",enabled:"Botão ativado",expand:"Expandir",frigate:"Frigate menu / Visualização padrão",fullscreen:"Tela cheia",icon:"Ícone",image:"Imagem",live:"Ao vivo",media_player:"Enviar para o reprodutor de mídia",microphone:"",mute:"",permanent:"",play:"",priority:"Prioridade",ptz_controls:"",ptz_home:"",recordings:"Gravações",screenshot:"",snapshots:"Instantâneos",substreams:"Substream(s)",timeline:"Linha do tempo",type:"",types:{momentary:"",toggle:""}},position:"Posição do menu",positions:{bottom:"Posicionado na parte inferior",left:"Posicionado à esquerda",right:"Posicionado à direita",top:"Posicionado no topo"},style:"Estilo do menu",styles:{hidden:"Menu oculto",hover:"Menu suspenso","hover-card":"Menu suspenso (em todo o cartão)",none:"Sem menu",outside:"Menu externo",overlay:"Menu sobreposto"}},overrides:{info:"Esta configuração do cartão especificou manualmente as substituições configuradas que podem substituir os valores mostrados no editor visual, consulte o editor de código para visualizar/modificar essas substituições"},performance:{features:{animated_progress_indicator:"Indicador de Carregamento Animado",editor_label:"Opções de recursos",max_simultaneous_engine_requests:"",media_chunk_size:"Tamanho do bloco de mídia"},style:{border_radius:"Curvas",box_shadow:"Sombras",editor_label:"Opções de estilo"},warning:"Este cartão está no modo de baixo desempenho, então os padrões foram alterados para otimizar o desempenho"},profiles:{casting:"",editor_label:"","low-performance":"",scrubbing:""},status_bar:{height:"",items:{enabled:"",engine:"",live_provider:"",priority:"",resolution:"",technology:"",title:""},popup_seconds:"",position:"",positions:{bottom:"",top:""},style:"",styles:{hover:"","hover-card":"",none:"",outside:"",overlay:"",popup:""}},view:{camera_select:"Visualização de câmeras recém-selecionadas",dark_mode:"Modo escuro",dark_modes:{auto:"Automático",off:"Desligado",on:"Ligado"},default:"Visualização padrão",default_cycle_camera:"Percorrer as câmeras quando a visualização padrão for atualizada",default_reset:{after_interaction:"",editor_label:"",entities:"",every_seconds:"Atualize a visualização padrão a cada X segundos (0 = nunca)",interaction_mode:"",interaction_modes:{active:"",all:"",inactive:""}},interaction_seconds:"",keyboard_shortcuts:{editor_label:"",enabled:"",ptz_down:"",ptz_home:"",ptz_left:"",ptz_right:"",ptz_up:"",ptz_zoom_in:"",ptz_zoom_out:""},triggers:{actions:{editor_label:"",interaction_mode:"",interaction_modes:{active:"",all:"",inactive:""},trigger:"",triggers:{default:"",live:"",media:"",none:""},untrigger:"",untriggers:{default:"",none:""}},editor_label:"",filter_selected_camera:"",show_trigger_status:"Pulsar borda quando acionado",untrigger_seconds:"Segundos após a mudar para o estado inativo para desacionar"},views:{clip:"Clipe mais recente",clips:"Galeria de clipes",current:"Visualização atual",image:"Imagem estática",live:"Visualização ao vivo",recording:"Gravação mais recente",recordings:"Galeria de gravações",snapshot:"Snapshot mais recente",snapshots:"Galeria de Snapshots",timeline:"Visualização da linha do tempo"}}},o={grid:"",single:""},i={add_new_camera:"Adicionar nova câmera",button:"Botão",camera:"Câmera",cameras:"Câmeras",cameras_secondary:"Quais câmeras renderizar neste cartão",delete:"Excluir",dimensions:"",dimensions_secondary:"",image:"Imagem",image_secondary:"Opções de visualização de imagem estática",live:"Ao vivo",live_secondary:"Opções de visualização da câmera ao vivo",media_gallery:"Galeria de mídia",media_gallery_secondary:"Opções da galeria de mídia",media_viewer:"Visualizador de eventos",media_viewer_secondary:"Opções do visualizador de Snapshots e clipes",menu:"Menu",menu_secondary:"Opções de aparência do menu",move_down:"Descer",move_up:"Subir",overrides:"As substituições estão ativas",overrides_secondary:"Substituições de configuração dinâmica detectadas",performance:"Desempenho",performance_secondary:"Opções de desempenho do cartão",profiles:"",profiles_secondary:"",status_bar:"",status_bar_secondary:"",timeline:"Linha do tempo",timeline_secondary:"Opções do evento da linha do tempo",upgrade:"Upgrade",upgrade_available:"Um upgrade automático da configuração de cartão está disponível",view:"Visualizar",view_secondary:"O que o cartão deve mostrar e como mostrá-lo"},r={ptz:{down:"Baixo",home:"Casa",left:"Esquerda",right:"Direita",up:"Cima",zoom_in:"Aumentar Zoom",zoom_out:"Reduzir Zoom"}},t={awaiting_live:"",awaiting_media:"",camera_initialization:"",camera_initialization_reolink:"",could_not_render_elements:"Não foi possível renderizar os elementos da imagem",could_not_resolve:"Não foi possível resolver o URL de mídia",diagnostics:"Diagnósticos do cartão. Revise as informações confidenciais antes de compartilhar",download_no_media:"Nenhuma mídia para download",download_sign_failed:"Não foi possível assinar o URL de mídia para download",duplicate_camera_id:"Duplique o ID da câmera Frigate para a câmera a seguir, use o parâmetro 'id' para identificar exclusivamente as câmeras",empty_response:"Sem resposta do Home Assistant para a solicitação",failed_response:"Falha ao receber resposta do Home Assistant para solicitação",failed_retain:"Não foi possível reter o evento",failed_sign:"Não foi possível assinar a URL do Home Assistant",image_load_error:"A imagem não pôde ser carregada",invalid_configuration:"Configuração inválida",invalid_configuration_no_hint:"Nenhuma dica de local disponível (tipo incorreto ou ausente?)",invalid_configuration_override:"",invalid_elements_config:"Configuração de elementos de imagem inválida",invalid_response:"Resposta inválida recebida do Home Assistant para a solicitação",jsmpeg_no_player:"Não foi possível iniciar o player JSMPEG",live_camera_no_endpoint:"Não foi possível obter o endereço da câmera para este provedor ao vivo (configuração incompleta?)",live_camera_not_found:"A entidade de câmera configurada não foi encontrada",live_camera_unavailable:"Câmera indisponível",no_camera_engine:"Não foi possível determinar o motor adequado para a câmera",no_camera_entity:"Não foi possível encontrar a entidade da câmera",no_camera_entity_for_triggers:"Uma entidade de câmera é necessária para detectar automaticamente os gatilhos",no_camera_id:"Não foi possível determinar o ID da câmera para a câmera a seguir, pode ser necessário definir o parâmetro 'id' manualmente",no_camera_name:"Não foi possível determinar o nome da câmera da Frigate, especifique 'camera_entity' ou 'camera_name' para a câmera a seguir",no_dashboard_or_view:"",no_live_camera:"O parâmetro camera_entity deve ser definido e válido para este provedor ativo",no_supported_camera:"",no_supported_cameras:"",reconnecting:"Reconectando",too_many_automations:"",troubleshooting:"Verifique a solução de problemas",unknown:"Erro desconhecido",upgrade_available:"Uma atualização automatizada da configuração do cartão está disponível, visite o editor visual do cartão",webrtc_card_reported_error:"O cartão WebRTC relatou um erro",webrtc_card_waiting:"Aguardando o cartão WebRTC carregar ..."},s={camera:"Câmera",duration:"Duração",in_progress:"Em andamento",score:"Pontuação",seek:"Procurar",start:"Início",tag:"Etiqueta",what:"O que",where:"Onde"},n={assign:"",modifiers:{alt:"",ctrl:"",meta:"",shift:""},unassign:""},d={all:"Todos",camera:"Câmera",favorite:"Favorito",media_type:"Tipo de mídia",media_types:{clips:"Clipes",recordings:"Gravações",snapshots:"Instantâneos"},not_favorite:"Não favorito",select_camera:"Selecione a câmera...",select_favorite:"Selecione favorito...",select_media_type:"Selecione o tipo de mídia...",select_tag:"Selecione a etiqueta...",select_what:"Selecione o que...",select_when:"Selecione quando...",select_where:"Selecione onde...",tag:"Etiqueta",what:"O que",when:"Quando",whens:{custom:"",past_month:"Mês passado",past_week:"Semana passada",today:"Hoje",yesterday:"Ontem"},where:"Onde"},m={unseekable:""},l={camera:"Câmera",duration:"Duração",events:"Eventos",in_progress:"Em andamento",seek:"Procurar",start:"Começar"},c={download:"Baixar mídia",no_thumbnail:"Nenhuma miniatura disponível",retain_indefinitely:"Evento será retido por tempo indeterminado",timeline:"Ver evento na linha do tempo"},u={select_date:"Escolha a data"},p={common:e,config:a,display_modes:o,editor:i,elements:r,error:t,event:s,key_assigner:n,media_filter:d,media_viewer:m,recording:l,thumbnail:c,timeline:u};export{e as common,a as config,p as default,o as display_modes,i as editor,r as elements,t as error,s as event,n as key_assigner,d as media_filter,m as media_viewer,l as recording,c as thumbnail,u as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-pt-BR-ea76ed6c.js.gz b/config/www/community/frigate-hass-card/lang-pt-BR-ea76ed6c.js.gz new file mode 100644 index 00000000..e0d063bf Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-pt-BR-ea76ed6c.js.gz differ diff --git a/config/www/community/frigate-hass-card/lang-pt-PT-16f39312.js b/config/www/community/frigate-hass-card/lang-pt-PT-16f39312.js new file mode 100644 index 00000000..d9be6a80 --- /dev/null +++ b/config/www/community/frigate-hass-card/lang-pt-PT-16f39312.js @@ -0,0 +1 @@ +var e={frigate_card:"Cartão Frigate",frigate_card_description:"Um cartão da Lovelace para usar com Frigate",live:"Ao Vivo",no_media:"Sem média",recordings:"Gravações",version:"Versão"},a={cameras:{camera_entity:"Entidade da Câmera",capabilities:{capabilities:{clips:"","favorite-events":"","favorite-recordings":"",live:"",menu:"",ptz:"",recordings:"",seek:"",snapshots:"",substream:""},disable:"",disable_except:"",editor_label:""},cast:{dashboard:{dashboard_path:"",view_path:""},editor_label:"",method:"",methods:{dashboard:"",standard:""}},dependencies:{all_cameras:"Mostrar eventos para todas as câmeras nesta câmera",cameras:"Mostrar eventos para câmeras específicas nesta câmera",editor_label:"Opções de dependência"},dimensions:{aspect_ratio:"",editor_label:"",layout:{editor_label:"",fit:"Fit",fits:{contain:"Conter",cover:"Tapar",fill:"Preencher"},pan:{x:"",y:""},position:{editor_label:"",x:"Percentagem da localização horizontal",y:"Percentagem da localização vertical"},view_box:{bottom:"",editor_label:"",left:"",right:"",top:""},zoom:""}},engines:{editor_label:"Editor de etiquetas"},frigate:{camera_name:"Nome da câmera do Frigate (detectado automaticamente pela entidade)",client_id:"ID do cliente do Frigate (para >1 servidor Frigate)",editor_label:"Opções do Frigate",labels:"Etiquetas",url:"URL do servidor Frigate",zones:"Zonas"},go2rtc:{editor_label:"Editor de etiquetas",modes:{editor_label:"Editor de etiquetas",mjpeg:"Mjpeg",mp4:"Mp4",mse:"Mse",webrtc:"Webrtc"},stream:"Stream"},icon:"Ícone para esta câmera (detectado automaticamente pela entidade)",id:"ID exclusivo para esta câmera nesse cartão",image:{editor_label:"Editor etiquetas",refresh_seconds:"Atualizar em segundos",url:"Link"},live_provider:"Fonte de visualização ao vivo para esta câmera",live_provider_options:{editor_label:"Editor de etiquetas"},live_providers:{auto:"Automatico",go2rtc:"Go2rtc",ha:"Ha",image:"Imagem",jsmpeg:"JSMpeg","webrtc-card":"Cartão WebRTC (de @AlexxIT)"},motioneye:{editor_label:"Directoria pre-definido",images:{directory_pattern:"Directoria pre-definido",file_pattern:"Ficheiro pre-definido"},movies:{directory_pattern:"Directoria pre-definida",file_pattern:"Ficheiro pre-definido"},url:"Link"},proxy:{dynamic:"",editor_label:"",media:{auto:"",editor_label:"",false:"",true:""},ssl_ciphers:{auto:"",default:"",editor_label:"",insecure:"",intermediate:"",modern:""},ssl_verification:{auto:"",editor_label:"",false:"",true:""}},reolink:{editor_label:"",media_resolution:{editor_label:"",high:"",low:""},url:""},title:"Título para esta câmera (detectado automaticamente pela entidade)",triggers:{editor_label:"Opções de activação",entities:"Activar a partir de outras entidades",events:{clips:"",editor_label:"",events:"",snapshots:""},motion:"Activar detectando automaticamente o sensor de movimento",occupancy:"Activar detectando automaticamente o sensor de ocupação"},webrtc_card:{editor_label:"Opções do cartão WebRTC",entity:"Entidade de câmera de cartão WebRTC (não é uma câmera Frigate)",url:"URL da câmera do cartão WebRTC"}},common:{controls:{builtin:"",filter:{editor_label:"Editor de titulos",mode:"Modo",modes:{left:"Esquerda",none:"Nenhum",right:"Direita"}},next_previous:{editor_label:"Editor de titulos",size:"Tamanho de controle próximo e anterior",style:"Estilo do controle próximo e anterior",styles:{chevrons:"Setas",icons:"Ícones",none:"Nenhum",thumbnails:"Miniaturas"}},thumbnails:{editor_label:"Editor de titulos",events_media_type:"Mostrar miniaturas de clipes ou snapshots",events_media_types:{clips:"Miniaturas de clipes",snapshots:"Miniaturas de Snapshots"},media_type:"",media_types:{events:"",recordings:""},mode:"Modos",modes:{above:"Miniaturas acima da mídia",below:"Miniaturas abaixo da mídia",left:"Miniaturas em uma gaveta à esquerda",none:"Sem miniaturas",right:"Miniaturas em uma gaveta à direita"},show_details:"Mostrar detalhes",show_download_control:"Mostrar o botão de download",show_favorite_control:"Mostrar o botão de favorito nas miniaturas",show_timeline_control:"Mostrar a linha do tempo nas miniaturas",size:"Tamanho das miniaturas em pixels"},timeline:{editor_label:"Controles de linha do tempo",mode:"Modo",modes:{above:"Por cima",below:"Abaixo",none:"Nenhum"},pan_mode:"",pan_modes:{pan:"",seek:"","seek-in-camera":"","seek-in-media":""}}},display:{editor_label:"",grid_columns:"",grid_max_columns:"",grid_selected_width_factor:"",mode:""},image:{entity:"",entity_parameters:"",mode:"Modo de visualização de imagem",modes:{camera:"Instantâneo da câmera do Home Assistant, da entidade de câmera",entity:"",screensaver:"Logo Frigate embutido",url:"Imagem arbitrária especificada por URL"},refresh_seconds:"Número de segundos após o qual atualizar (0 = nunca)",url:"Imagem arbitrária especificada por URL"},media_action_conditions:{all:"Todas as oportunidades",hidden:"Ao ocultar o navegador/aba",microphone_mute:"",microphone_unmute:"",never:"Nunca",selected:"Ao selecionar",unselected:"Ao desselecionar",visible:"Ao mostrar o navegador/aba"},timeline:{clustering_threshold:"A contagem de eventos nos quais eles são agrupados (0 = sem agrupamento)",events_media_type:"A mídia que a linha do tempo exibe",events_media_types:{all:"Todos os tipos de mídia",clips:"Clipes",snapshots:"Instantâneos"},show_recordings:"Mostrar gravações",style:"",styles:{ribbon:"",stack:""},window_seconds:"A duração padrão da visualização da linha do tempo em segundos"}},dimensions:{aspect_ratio:"Proporção padrão (e.g. '16:9')",aspect_ratio_mode:"Modo de proporção",aspect_ratio_modes:{dynamic:"A proporção se ajusta à mídia",static:"Proporção estática",unconstrained:"Proporção irrestrita"},height:""},live:{auto_mute:"Silenciar câmeras ao vivo automaticamente",auto_pause:"Parar câmeras ao vivo automaticamente",auto_play:"Reproduzir câmeras ao vivo automaticamente",auto_unmute:"Ativar automaticamente o som das câmeras ao vivo",controls:{editor_label:"Controles da visualização ao vivo",ptz:{editor_label:"",hide_home:"",hide_pan_tilt:"",hide_zoom:"",mode:"",modes:{off:"",on:""},orientation:"",orientations:{horizontal:"",vertical:""},position:"",positions:{"bottom-left":"","bottom-right":"","top-left":"","top-right":""}}},draggable:"A visualização ao vivo das câmeras pode ser arrastada/deslizada",lazy_load:"As câmeras ao vivo são carregadas lentamente",lazy_unload:"As câmeras ao vivo são descarregadas preguiçosamente",microphone:{always_connected:"",disconnect_seconds:"",editor_label:"",enabled:"",mute_after_microphone_mute_seconds:""},preload:"Pré-carregar a visualização ao vivo em segundo plano",show_image_during_load:"Mostar imagem durante o carregamento",transition_effect:"Efeito de transição de câmera ao vivo",zoomable:""},media_viewer:{auto_mute:"Silenciar mídia automaticamente",auto_pause:"Parar mídia automaticamente",auto_play:"Reproduzir mídia automaticamente",auto_unmute:"Ativar mídia automaticamente",controls:{editor_label:"Controles do visualizador de mídia"},draggable:"Visualizador de eventos pode ser arrastado/deslizado",lazy_load:"A mídia do Visualizador de eventos é carregada lentamente no carrossel",snapshot_click_plays_clip:"",transition_effect:"Efeito de transição do Visualizador de eventos",transition_effects:{none:"Sem transição",slide:"Transição de slides"},zoomable:""},menu:{alignment:"Alinhamento do menu",alignments:{bottom:"Alinhado à parte inferior",left:"Alinhado à esquerda",right:"Alinhado à direita",top:"Alinhado ao topo"},button_size:"Tamanho do botão de menu (e.g. '40px')",buttons:{alignment:"Alinhamento do botão",alignments:{matching:"Mesmo alinhamento do menu",opposing:"Opor-se ao alinhamento do menu"},camera_ui:"Camera",cameras:"Selecionar câmera",clips:"Clipes",display_mode:"",download:"Descarregar mídia do evento",enabled:"Botão ativado",expand:"Expandir",frigate:"Frigate menu / Visualização padrão",fullscreen:"Tela cheia",icon:"Ícone",image:"Imagem",live:"Ao vivo",media_player:"Enviar para o reprodutor de mídia",microphone:"",mute:"",permanent:"",play:"",priority:"Prioridade",ptz_controls:"",ptz_home:"",recordings:"",screenshot:"",snapshots:"Instantâneos",substreams:"substreams",timeline:"Linha do tempo",type:"",types:{momentary:"",toggle:""}},position:"Posição do menu",positions:{bottom:"Posicionado na parte inferior",left:"Posicionado à esquerda",right:"Posicionado à direita",top:"Posicionado no topo"},style:"Estilo do menu",styles:{hidden:"Menu oculto",hover:"Menu suspenso","hover-card":"",none:"Sem menu",outside:"Menu externo",overlay:"Menu sobreposto"}},overrides:{info:"Esta configuração do cartão especificou manualmente as substituições configuradas que podem substituir os valores mostrados no editor visual, consulte o editor de código para visualizar/modificar essas substituições"},performance:{features:{animated_progress_indicator:"Animação na barra de progresso",editor_label:"Editor de etiquetas",max_simultaneous_engine_requests:"",media_chunk_size:"Tamanho do ficheiro"},style:{border_radius:"Tamanho do bordo",box_shadow:"Caixa de Fundo",editor_label:"Editor de etiquetas"},warning:"Avisos"},profiles:{casting:"",editor_label:"","low-performance":"",scrubbing:""},status_bar:{height:"",items:{enabled:"",engine:"",live_provider:"",priority:"",resolution:"",technology:"",title:""},popup_seconds:"",position:"",positions:{bottom:"",top:""},style:"",styles:{hover:"","hover-card":"",none:"",outside:"",overlay:"",popup:""}},view:{camera_select:"Visualização de câmeras recém-selecionadas",dark_mode:"Modo escuro",dark_modes:{auto:"Automático",off:"Desligado",on:"Ligado"},default:"Visualização padrão",default_cycle_camera:"Percorrer as câmeras quando a visualização padrão for atualizada",default_reset:{after_interaction:"",editor_label:"",entities:"",every_seconds:"Atualize a visualização padrão a cada X segundos (0 = nunca)",interaction_mode:"",interaction_modes:{active:"",all:"",inactive:""}},interaction_seconds:"",keyboard_shortcuts:{editor_label:"",enabled:"",ptz_down:"",ptz_home:"",ptz_left:"",ptz_right:"",ptz_up:"",ptz_zoom_in:"",ptz_zoom_out:""},triggers:{actions:{editor_label:"",interaction_mode:"",interaction_modes:{active:"",all:"",inactive:""},trigger:"",triggers:{default:"",live:"",media:"",none:""},untrigger:"",untriggers:{default:"",none:""}},editor_label:"",filter_selected_camera:"",show_trigger_status:"Exibir estado do gatilho",untrigger_seconds:"Segundos após a mudar para o estado inativo para desacionar"},views:{clip:"Clipe mais recente",clips:"Galeria de clipes",current:"Visualização atual",image:"Imagem estática",live:"Visualização ao vivo",recording:"",recordings:"",snapshot:"Snapshot mais recente",snapshots:"Galeria de Snapshots",timeline:"Visualização da linha do tempo"}}},o={grid:"",single:""},i={add_new_camera:"Adicionar nova câmera",button:"Botão",camera:"Câmera",cameras:"Câmeras",cameras_secondary:"Câmeras para renderizar neste cartão",delete:"Excluir",dimensions:"",dimensions_secondary:"",image:"Imagem",image_secondary:"Opções de visualização de imagem estática",live:"Ao vivo",live_secondary:"Opções de visualização da câmera ao vivo",media_gallery:"Galeria",media_gallery_secondary:"Galeria Secundaria",media_viewer:"Visualizador de eventos",media_viewer_secondary:"Opções do visualizador de Snapshots e clipes",menu:"Menu",menu_secondary:"Opções de aparência do menu",move_down:"Descer",move_up:"Subir",overrides:"As substituições estão ativas",overrides_secondary:"Substituições de configuração dinâmica detectadas",performance:"",performance_secondary:"",profiles:"",profiles_secondary:"",status_bar:"",status_bar_secondary:"",timeline:"Linha do tempo",timeline_secondary:"Opções do evento da linha do tempo",upgrade:"Actualização",upgrade_available:"Está disponível uma atualização automática do cartão",view:"Visualizar",view_secondary:"O que deve ser mostrado neste cartão"},t={ptz:{down:"Baixo",home:"Origem",left:"Esquerda",right:"Direira",up:"Cima",zoom_in:"Ampliar",zoom_out:"Reduzir"}},r={awaiting_live:"",awaiting_media:"",camera_initialization:"",camera_initialization_reolink:"",could_not_render_elements:"Não foi possível renderizar os elementos da imagem",could_not_resolve:"Não foi possível resolver o URL de mídia",diagnostics:"Diagnósticos do cartão. Reveja as informações confidenciais antes de partilhar",download_no_media:"Nenhuma mídia para download",download_sign_failed:"Não foi possível assinar o URL de mídia para download",duplicate_camera_id:"Duplique o ID da câmera Frigate para a câmera a seguir, use o parâmetro 'id' para identificar exclusivamente as câmeras",empty_response:"Sem resposta do Home Assistant para a solicitação",failed_response:"Falha ao receber resposta do Home Assistant para solicitação",failed_retain:"Não foi possível reter o evento",failed_sign:"Não foi possível assinar a URL do Home Assistant",image_load_error:"A imagem não pôde ser carregada",invalid_configuration:"Configuração inválida",invalid_configuration_no_hint:"Nenhuma dica de local disponível (tipo incorreto ou ausente?)",invalid_configuration_override:"",invalid_elements_config:"Configuração de elementos de imagem inválida",invalid_response:"Resposta inválida recebida do Home Assistant para a solicitação",jsmpeg_no_player:"Não foi possível iniciar o player JSMPEG",live_camera_no_endpoint:"Nenhuma câmera ao vivo",live_camera_not_found:"Nenhuma câmera ao vivo não foi encontrada",live_camera_unavailable:"Câmera ao vivo indisponivel",no_camera_engine:"Não existe câmera",no_camera_entity:"Não existe uma entidade câmera",no_camera_entity_for_triggers:"Não existe camera para a acção",no_camera_id:"Não foi possível determinar o ID da câmera para a câmera a seguir, pode ser necessário definir o parâmetro 'id' manualmente",no_camera_name:"Não foi possível determinar o nome da câmera da Frigate, especifique 'camera_entity' ou 'camera_name' para a câmera a seguir",no_dashboard_or_view:"",no_live_camera:"O parâmetro camera_entity deve ser definido e válido para este serviço ativo",no_supported_camera:"",no_supported_cameras:"",reconnecting:"A voltar a ligar",too_many_automations:"",troubleshooting:"Verifique a solução de problemas",unknown:"Erro desconhecido",upgrade_available:"Uma atualização automatizada da configuração do cartão está disponível, visite o editor visual do cartão",webrtc_card_reported_error:"O cartão WebRTC relatou um erro",webrtc_card_waiting:"Aguardar o cartão WebRTC carregar ..."},s={camera:"Camera",duration:"Duração",in_progress:"Em andamento",score:"Pontuação",seek:"Procurar",start:"Início",tag:"",what:"O quê",where:"Onde"},n={assign:"",modifiers:{alt:"",ctrl:"",meta:"",shift:""},unassign:""},d={all:"Todos",camera:"Camera",favorite:"Favoritos",media_type:"Tipos de media",media_types:{clips:"Clips",recordings:"Gravações",snapshots:"Imagens"},not_favorite:"Não favorito",select_camera:"Seleciona a camara",select_favorite:"Seleciona o favorito",select_media_type:"Seleciona o tipo de media",select_tag:"",select_what:"Seleciona",select_when:"Seleciona quando",select_where:"Seleciona onde",tag:"",what:"O que",when:"Quando",whens:{custom:"",past_month:"O mes passado",past_week:"A semana passada",today:"Hoje",yesterday:"Ontem"},where:"Onde"},l={unseekable:""},m={camera:"Camera",duration:"Duração",events:"Eventos",in_progress:"Em andamento",seek:"Procurar",start:"Começar"},c={download:"",no_thumbnail:"Nenhuma miniatura disponível",retain_indefinitely:"Evento será retido por tempo indeterminado",timeline:"Ver evento na linha do tempo"},u={select_date:"Selecionar a data"},_={common:e,config:a,display_modes:o,editor:i,elements:t,error:r,event:s,key_assigner:n,media_filter:d,media_viewer:l,recording:m,thumbnail:c,timeline:u};export{e as common,a as config,_ as default,o as display_modes,i as editor,t as elements,r as error,s as event,n as key_assigner,d as media_filter,l as media_viewer,m as recording,c as thumbnail,u as timeline}; diff --git a/config/www/community/frigate-hass-card/lang-pt-PT-16f39312.js.gz b/config/www/community/frigate-hass-card/lang-pt-PT-16f39312.js.gz new file mode 100644 index 00000000..5bffb3b1 Binary files /dev/null and b/config/www/community/frigate-hass-card/lang-pt-PT-16f39312.js.gz differ diff --git a/config/www/community/frigate-hass-card/media-921a03ae.js b/config/www/community/frigate-hass-card/media-921a03ae.js new file mode 100644 index 00000000..286e04e3 --- /dev/null +++ b/config/www/community/frigate-hass-card/media-921a03ae.js @@ -0,0 +1,33 @@ +import{dw as t,dx as i,dy as e,dz as n,cK as o,dA as a,_ as s,n as r,b as l,t as c,a as d,dB as h,x as p,e as u,dC as f,r as _,dD as g,dE as m,dF as v,dG as b,dH as y,l as z,db as w}from"./card-e5d55e5b.js"; +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const C={},x=t(class extends i{constructor(){super(...arguments),this.ot=C}render(t,i){return i()}update(t,[i,n]){if(Array.isArray(i)){if(Array.isArray(this.ot)&&this.ot.length===i.length&&i.every(((t,i)=>t===this.ot[i])))return e}else if(this.ot===i)return e;return this.ot=Array.isArray(i)?Array.from(i):i,this.render(i,n)}});class I{constructor(){this._options=null,this._viewportIntersecting=null,this._microphoneMuteTimer=new n,this._root=null,this._eventListeners=new Map,this._children=[],this._target=null,this._mutationObserver=new MutationObserver(this._mutationHandler.bind(this)),this._intersectionObserver=new IntersectionObserver(this._intersectionHandler.bind(this)),this._mediaLoadedHandler=async t=>{this._target?.index===t&&(await this._unmuteTargetIfConfigured(this._target.selected?"selected":"visible"),await this._playTargetIfConfigured(this._target.selected?"selected":"visible"))},this._visibilityHandler=async()=>{await this._changeVisibility("visible"===document.visibilityState)},this._changeVisibility=async t=>{t?(await this._unmuteTargetIfConfigured("visible"),await this._playTargetIfConfigured("visible")):(await this._pauseAllIfConfigured("hidden"),await this._muteAllIfConfigured("hidden"))},this._microphoneChangeHandler=async t=>{"unmuted"===t?await this._unmuteTargetIfConfigured("microphone"):"muted"===t&&this._options?.autoMuteConditions?.includes("microphone")&&this._microphoneMuteTimer.start(this._options.microphoneMuteSeconds??60,(async()=>{await this._muteTargetIfConfigured("microphone")}))}}setOptions(t){this._options=t,this._options?.microphoneManager&&(this._options.microphoneManager.removeListener(this._microphoneChangeHandler),this._options.microphoneManager.addListener(this._microphoneChangeHandler))}hasRoot(){return!!this._root}destroy(){this._viewportIntersecting=null,this._microphoneMuteTimer.stop(),this._root=null,this._removeChildHandlers(),this._children=[],this._target=null,this._mutationObserver.disconnect(),this._intersectionObserver.disconnect(),this._options?.microphoneManager?.removeListener(this._microphoneChangeHandler),document.removeEventListener("visibilitychange",this._visibilityHandler)}async setTarget(t,i){this._target?.index===t&&this._target?.selected===i||(this._target?.selected&&(await this._pauseTargetIfConfigured("unselected"),await this._muteTargetIfConfigured("unselected"),this._microphoneMuteTimer.stop()),this._target={selected:i,index:t},i?(await this._unmuteTargetIfConfigured("selected"),await this._playTargetIfConfigured("selected")):(await this._unmuteTargetIfConfigured("visible"),await this._playTargetIfConfigured("visible")))}unsetTarget(){this._target=null}async _playTargetIfConfigured(t){null!==this._target&&this._options?.autoPlayConditions?.includes(t)&&await this._play(this._target.index)}async _play(t){await(this._children[t]?.play())}async _unmuteTargetIfConfigured(t){null!==this._target&&this._options?.autoUnmuteConditions?.includes(t)&&await this._unmute(this._target.index)}async _unmute(t){await(this._children[t]?.unmute())}async _pauseAllIfConfigured(t){if(this._options?.autoPauseConditions?.includes(t))for(const t of this._children.keys())await this._pause(t)}async _pauseTargetIfConfigured(t){null!==this._target&&this._options?.autoPauseConditions?.includes(t)&&await this._pause(this._target.index)}async _pause(t){await(this._children[t]?.pause())}async _muteAllIfConfigured(t){if(this._options?.autoMuteConditions?.includes(t))for(const t of this._children.keys())await this._mute(t)}async _muteTargetIfConfigured(t){null!==this._target&&this._options?.autoMuteConditions?.includes(t)&&await this._mute(this._target.index)}async _mute(t){await(this._children[t]?.mute())}_mutationHandler(t,i){this._initializeRoot()}_removeChildHandlers(){for(const[t,i]of this._eventListeners.entries())t.removeEventListener("frigate-card:media:loaded",i);this._eventListeners.clear()}initialize(t){this._root=t,this._initializeRoot(),document.addEventListener("visibilitychange",this._visibilityHandler),this._intersectionObserver.disconnect(),this._intersectionObserver.observe(t),this._mutationObserver.disconnect(),this._mutationObserver.observe(this._root,{childList:!0,subtree:!0})}_initializeRoot(){if(this._options&&this._root){this._removeChildHandlers(),this._children=[...this._root.querySelectorAll(this._options.playerSelector)];for(const[t,i]of this._children.entries()){const e=()=>this._mediaLoadedHandler(t);this._eventListeners.set(i,e),i.addEventListener("frigate-card:media:loaded",e)}}}async _intersectionHandler(t){const i=this._viewportIntersecting;this._viewportIntersecting=t.some((t=>t.isIntersecting)),null!==i&&i!==this._viewportIntersecting&&await this._changeVisibility(this._viewportIntersecting)}}const A={active:!0,breakpoints:{},lazyLoadCount:0};function S(t={}){let i,e,n;const o=new Set,a=["init","select"],s=["select"];function r(){"hidden"===document.visibilityState&&i.lazyUnloadConditions?.includes("hidden")?o.forEach((t=>{i.lazyUnloadCallback&&(i.lazyUnloadCallback(t,n[t]),o.delete(t))})):"visible"===document.visibilityState&&i.lazyLoadCallback&&c()}function l(t){return o.has(t)}function c(){const t=i.lazyLoadCount,a=e.selectedScrollSnap(),s=new Set;for(let i=1;i<=t&&a-i>=0;i++)s.add(a-i);s.add(a);for(let i=1;i<=t&&a+i{!l(t)&&i.lazyLoadCallback&&(o.add(t),i.lazyLoadCallback(t,n[t]))}))}function d(){const t=e.previousScrollSnap();l(t)&&i.lazyUnloadCallback&&(i.lazyUnloadCallback(t,n[t]),o.delete(t))}return{name:"autoLazyLoad",options:t,init:function(o,l){const{mergeOptions:h,optionsAtMedia:p}=l,u=h(A,t);i=p(u),e=o,n=e.slideNodes(),i.lazyLoadCallback&&a.forEach((t=>e.on(t,c))),i.lazyUnloadCallback&&i.lazyUnloadConditions?.includes("unselected")&&s.forEach((t=>e.on(t,d))),document.addEventListener("visibilitychange",r)},destroy:function(){i.lazyLoadCallback&&a.forEach((t=>e.off(t,c))),i.lazyUnloadCallback&&s.forEach((t=>e.off(t,d))),document.removeEventListener("visibilitychange",r)}}}function T(){let t,i=[];const e=[];function n(n){const o=n.composedPath();for(const[a,s]of[...i.entries()].reverse())if(o.includes(s)){e[a]=n.detail,a!==t.selectedScrollSnap()&&n.stopPropagation();break}}function a(n){const o=n.composedPath();for(const[a,s]of i.entries())if(o.includes(s)){delete e[a],a!==t.selectedScrollSnap()&&n.stopPropagation();break}}function s(){const n=t.selectedScrollSnap(),a=e[n];a&&o(i[n],a)}return{name:"autoMediaLoadedInfo",options:{},init:function(e){t=e,i=t.slideNodes();for(const t of i)t.addEventListener("frigate-card:media:loaded",n),t.addEventListener("frigate-card:media:unloaded",a);t.on("init",s),t.containerNode().addEventListener("frigate-card:carousel:force-select",s)},destroy:function(){for(const t of i)t.removeEventListener("frigate-card:media:loaded",n),t.removeEventListener("frigate-card:media:unloaded",a);t.off("init",s),t.containerNode().removeEventListener("frigate-card:carousel:force-select",s)}}}class ${constructor(t){this._scrolling=!1,this._shouldReInitOnScrollStop=!1,this._scrollingStart=()=>{this._scrolling=!0},this._scrollingStop=()=>{this._scrolling=!1,this._shouldReInitOnScrollStop&&(this._shouldReInitOnScrollStop=!1,this._debouncedReInit())},this._debouncedReInit=a((()=>{this._scrolling=!1,this._shouldReInitOnScrollStop=!1,this._emblaApi?.reInit()}),500,{trailing:!0}),this._emblaApi=t,this._emblaApi.on("scroll",this._scrollingStart),this._emblaApi.on("settle",this._scrollingStop),this._emblaApi.on("destroy",this.destroy)}destroy(){this._emblaApi.off("scroll",this._scrollingStart),this._emblaApi.off("settle",this._scrollingStop),this._emblaApi.off("destroy",this.destroy)}reinit(){this._scrolling?this._shouldReInitOnScrollStop=!0:this._debouncedReInit()}}function L(){let t,i=null,e=null;const n=new Map,o=new ResizeObserver((function(t){let i=!1;for(const e of t){const t={height:e.contentRect.height,width:e.contentRect.width},o=n.get(e.target);t.width&&t.height&&(o?.height!==t.height||o?.width!==t.width)&&(n.set(e.target,t),i=!0)}i&&r()})),s=new IntersectionObserver((function(t){const n=t.some((t=>t.isIntersecting));if(n!==e){const t=n&&null!==e;e=n,t&&i?.reinit()}})),r=a((()=>function(){const{slideRegistry:e,options:{axis:n}}=t.internalEngine();if("y"===n)return;t.containerNode().style.removeProperty("max-height");const o=e[t.selectedScrollSnap()],a=t.slideNodes(),s=Math.max(...o.map((t=>a[t].getBoundingClientRect().height)));!isNaN(s)&&s>0&&(t.containerNode().style.maxHeight=`${s}px`);i?.reinit()}()),200,{trailing:!0});return{name:"autoSize",options:{},init:function(e){t=e,i=new $(t),s.observe(t.containerNode()),o.observe(t.containerNode());for(const i of t.slideNodes())o.observe(i);t.containerNode().addEventListener("frigate-card:media:loaded",r),t.on("settle",r)},destroy:function(){s.disconnect(),o.disconnect(),i?.destroy(),t.containerNode().removeEventListener("frigate-card:media:loaded",r),t.off("settle",r)}}}let P=class extends d{constructor(){super(...arguments),this.disabled=!1,this.label="",this._thumbnailError=!1,this._embedThumbnailTask=h(this,(()=>this.hass),(()=>this.thumbnail))}set controlConfig(t){t?.size&&this.style.setProperty("--frigate-card-next-prev-size",`${t.size}px`),this._controlConfig=t}render(){if(this.disabled||!this._controlConfig||"none"==this._controlConfig.style)return p``;const t=!this.thumbnail||["chevrons","icons"].includes(this._controlConfig.style)||this._thumbnailError,i={controls:!0,left:"left"===this.side,right:"right"===this.side,thumbnails:!t,icons:t,button:t};if(t){const t=this.icon&&!this._thumbnailError&&"chevrons"!==this._controlConfig.style?this.icon:"left"===this.side?{icon:"mdi:chevron-left"}:{icon:"mdi:chevron-right"};return p` + + `}return f(this._embedThumbnailTask,(t=>t?p``:p``),{inProgressFunc:()=>p`
`,errorFunc:t=>{this._thumbnailError=!0}})}static get styles(){return _("ha-icon-button.button {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n padding: 0px;\n margin: 3px;\n --ha-icon-display: block;\n /* Buttons can always be clicked */\n pointer-events: auto;\n opacity: 0.9;\n}\n\n:host {\n --frigate-card-next-prev-size: 48px;\n --frigate-card-next-prev-size-hover: calc(var(--frigate-card-next-prev-size) * 2);\n --frigate-card-left-position: 45px;\n --frigate-card-right-position: 45px;\n --mdc-icon-button-size: var(--frigate-card-next-prev-size);\n --mdc-icon-size: calc(var(--mdc-icon-button-size) / 2);\n}\n\n.controls {\n position: absolute;\n z-index: 1;\n overflow: hidden;\n}\n\n.controls.left {\n left: var(--frigate-card-left-position);\n}\n\n.controls.right {\n right: var(--frigate-card-right-position);\n}\n\n.controls.icons {\n top: calc(50% - var(--frigate-card-next-prev-size) / 2);\n}\n\n.controls.thumbnails {\n border-radius: 50%;\n height: var(--frigate-card-next-prev-size);\n top: calc(50% - var(--frigate-card-next-prev-size) / 2);\n box-shadow: var(--frigate-card-css-box-shadow, 0px 0px 20px 5px black);\n transition: all 0.2s ease-out;\n opacity: 0.8;\n aspect-ratio: 1/1;\n}\n\n.controls.thumbnails:hover {\n opacity: 1 !important;\n height: var(--frigate-card-next-prev-size-hover);\n top: calc(50% - var(--frigate-card-next-prev-size-hover) / 2);\n}\n\n.controls.left.thumbnails:hover {\n left: calc(var(--frigate-card-left-position) - (var(--frigate-card-next-prev-size-hover) - var(--frigate-card-next-prev-size)) / 2);\n}\n\n.controls.right.thumbnails:hover {\n right: calc(var(--frigate-card-right-position) - (var(--frigate-card-next-prev-size-hover) - var(--frigate-card-next-prev-size)) / 2);\n}")}};s([r({attribute:!1})],P.prototype,"side",void 0),s([r({attribute:!1})],P.prototype,"hass",void 0),s([l()],P.prototype,"_controlConfig",void 0),s([r({attribute:!1})],P.prototype,"thumbnail",void 0),s([r({attribute:!1})],P.prototype,"icon",void 0),s([r({attribute:!0,type:Boolean})],P.prototype,"disabled",void 0),s([r()],P.prototype,"label",void 0),s([l()],P.prototype,"_thumbnailError",void 0),P=s([c("frigate-card-next-previous-control")],P);class E{constructor(t){this._config=null,this._hass=null,this._cameraManager=null,this._cameraID=null,this._host=t}setConfig(t){this._config=t??null,this._host.setAttribute("data-orientation",t?.orientation??"horizontal"),this._host.setAttribute("data-position",t?.position??"bottom-right"),this._host.setAttribute("style",Object.entries(t?.style??{}).map((([t,i])=>`${t}:${i}`)).join(";"))}getConfig(){return this._config}setCamera(t,i){this._cameraManager=t??null,this._cameraID=i??null}setForceVisibility(t){this._forceVisibility=t}handleAction(t,i){t.stopPropagation();const e=t.detail.action,n=g(e,i);n&&m(this._host,{action:n,...i&&{config:i}})}hasUsefulAction(){const t={pt:!0,z:!0,home:!0};if(!this._cameraID)return t;const i=this._cameraManager?.getCameraCapabilities(this._cameraID);if(!i||!i.hasPTZCapability())return t;const e=i.getPTZCapabilities();return{pt:!!(e?.up||e?.down||e?.left||e?.right),z:!!e?.zoomIn||!!e?.zoomOut,home:!!e?.presets?.length}}shouldDisplay(){return void 0!==this._forceVisibility?this._forceVisibility:"auto"===this._config?.mode?!!this._cameraID&&!!this._cameraManager?.getCameraCapabilities(this._cameraID)?.hasPTZCapability():"on"===this._config?.mode}getPTZActions(){const t=t=>({start_tap_action:v({ptzAction:t?.ptzAction,ptzPhase:"start",ptzPreset:t?.preset}),end_tap_action:v({ptzAction:t?.ptzAction,ptzPhase:"stop",ptzPreset:t?.preset})}),i={};return i.up=t({ptzAction:"up"}),i.down=t({ptzAction:"down"}),i.left=t({ptzAction:"left"}),i.right=t({ptzAction:"right"}),i.zoom_in=t({ptzAction:"zoom_in"}),i.zoom_out=t({ptzAction:"zoom_out"}),i.home={tap_action:v()},i}}let M=class extends d{constructor(){super(...arguments),this._controller=new E(this),this._actions=this._controller.getPTZActions(),this._actionPresence=null}willUpdate(t){t.has("config")&&this._controller.setConfig(this.config),(t.has("cameraManager")||t.has("cameraID"))&&this._controller.setCamera(this.cameraManager,this.cameraID),t.has("forceVisibility")&&this._controller.setForceVisibility(this.forceVisibility),(t.has("cameraID")||t.has("cameraManager"))&&(this._actionPresence=this._controller.hasUsefulAction())}render(){if(!this._controller.shouldDisplay())return;const t=(t,i,e)=>e?p`this._controller.handleAction(t,e)} + >`:p``,i=this._controller.getConfig();return p`
+ ${!i?.hide_pan_tilt&&this._actionPresence?.pt?p`
+ ${t("right","mdi:arrow-right",this._actions.right)} + ${t("left","mdi:arrow-left",this._actions.left)} + ${t("up","mdi:arrow-up",this._actions.up)} + ${t("down","mdi:arrow-down",this._actions.down)} +
`:""} + ${!i?.hide_zoom&&this._actionPresence?.z?p`
+ ${t("zoom_in","mdi:plus",this._actions.zoom_in)} + ${t("zoom_out","mdi:minus",this._actions.zoom_out)} +
`:p``} + ${!i?.hide_home&&this._actionPresence?.home?p`
+ ${t("home","mdi:home",this._actions.home)} +
`:p``} +
`}static get styles(){return _(":host {\n position: absolute;\n width: fit-content;\n height: fit-content;\n --frigate-card-ptz-icon-size: 24px;\n}\n\n:host([data-position$=-left]) {\n left: 5%;\n}\n\n:host([data-position$=-right]) {\n right: 5%;\n}\n\n:host([data-position^=top-]) {\n top: 5%;\n}\n\n:host([data-position^=bottom-]) {\n bottom: 5%;\n}\n\n/*****************\n * Main Containers\n *****************/\n.ptz {\n display: flex;\n gap: 10px;\n color: var(--light-primary-color);\n opacity: 0.4;\n transition: opacity 0.3s ease-in-out;\n}\n\n:host([data-orientation=vertical]) .ptz {\n flex-direction: column;\n}\n\n:host([data-orientation=horizontal]) .ptz {\n flex-direction: row;\n}\n\n.ptz:hover {\n opacity: 1;\n}\n\n:host([data-orientation=vertical]) .ptz div {\n width: calc(var(--frigate-card-ptz-icon-size) * 3);\n}\n\n:host([data-orientation=horizontal]) .ptz div {\n height: calc(var(--frigate-card-ptz-icon-size) * 3);\n}\n\n.ptz-move,\n.ptz-zoom,\n.ptz-home {\n position: relative;\n background-color: rgba(0, 0, 0, 0.3);\n}\n\n.ptz-move {\n height: calc(var(--frigate-card-ptz-icon-size) * 3);\n width: calc(var(--frigate-card-ptz-icon-size) * 3);\n border-radius: 50%;\n}\n\n:host([data-orientation=horizontal]) .ptz .ptz-zoom,\n:host([data-orientation=horizontal]) .ptz .ptz-home {\n width: calc(var(--frigate-card-ptz-icon-size) * 1.5);\n}\n\n:host([data-orientation=vertical]) .ptz .ptz-zoom,\n:host([data-orientation=vertical]) .ptz .ptz-home {\n height: calc(var(--frigate-card-ptz-icon-size) * 1.5);\n}\n\n.ptz-zoom,\n.ptz-home {\n border-radius: var(--ha-card-border-radius, 4px);\n}\n\n/***********\n * PTZ Icons\n ***********/\nfrigate-card-icon {\n position: absolute;\n --mdc-icon-size: var(--frigate-card-ptz-icon-size);\n}\n\nfrigate-card-icon:not(.disabled) {\n cursor: pointer;\n}\n\n.disabled {\n color: var(--disabled-text-color);\n}\n\n.up {\n top: 5px;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.down {\n bottom: 5px;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.left {\n left: 5px;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.right {\n right: 5px;\n top: 50%;\n transform: translateY(-50%);\n}\n\n:host([data-orientation=vertical]) .zoom_in {\n right: 5px;\n top: 50%;\n}\n\n:host([data-orientation=vertical]) .zoom_out {\n left: 5px;\n top: 50%;\n}\n\n:host([data-orientation=horizontal]) .zoom_in {\n left: 50%;\n top: 5px;\n}\n\n:host([data-orientation=horizontal]) .zoom_out {\n left: 50%;\n bottom: 5px;\n}\n\n:host([data-orientation=vertical]) .zoom_in,\n:host([data-orientation=vertical]) .zoom_out {\n transform: translateY(-50%);\n}\n\n:host([data-orientation=horizontal]) .zoom_in,\n:host([data-orientation=horizontal]) .zoom_out {\n transform: translateX(-50%);\n}\n\n.home {\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n}")}};function H(t){w(t,"live:error")}s([r({attribute:!1})],M.prototype,"config",void 0),s([r({attribute:!1})],M.prototype,"cameraManager",void 0),s([r({attribute:!1})],M.prototype,"cameraID",void 0),s([r({attribute:!1})],M.prototype,"forceVisibility",void 0),M=s([c("frigate-card-ptz")],M);const k=(t,i)=>{void 0!==i?.fit?t.style.setProperty("--frigate-card-media-layout-fit",i.fit):t.style.removeProperty("--frigate-card-media-layout-fit");for(const e of["x","y"])void 0!==i?.position?.[e]?t.style.setProperty(`--frigate-card-media-layout-position-${e}`,`${i.position[e]}%`):t.style.removeProperty(`--frigate-card-media-layout-position-${e}`);for(const e of["top","bottom","left","right"])void 0!==i?.view_box?.[e]?t.style.setProperty(`--frigate-card-media-layout-view-box-${e}`,`${i.view_box[e]}%`):t.style.removeProperty(`--frigate-card-media-layout-view-box-${e}`)},O=2,R=(t,i)=>{t._controlsHideTimer&&(t._controlsHideTimer.stop(),delete t._controlsHideTimer,delete t._controlsOriginalValue),t.controls=i},N=(t,i=1)=>{const e=t._controlsOriginalValue??t.controls;R(t,!1),t._controlsHideTimer??=new n,t._controlsOriginalValue=e;const o=()=>{R(t,e),t.removeEventListener("loadstart",o)};t.addEventListener("loadstart",o),t._controlsHideTimer.start(i,(()=>{R(t,e)}))},D=async(t,i)=>{if(i?.play)try{await i.play()}catch(e){if("NotAllowedError"===e.name&&!t.isMuted()){await t.mute();try{await i.play()}catch(t){}}}};export{S as A,I as M,T as a,L as b,O as c,H as d,N as h,x as i,D as p,R as s,k as u}; diff --git a/config/www/community/frigate-hass-card/media-921a03ae.js.gz b/config/www/community/frigate-hass-card/media-921a03ae.js.gz new file mode 100644 index 00000000..d82e8e01 Binary files /dev/null and b/config/www/community/frigate-hass-card/media-921a03ae.js.gz differ diff --git a/config/www/community/frigate-hass-card/media-c9012082.js.gz b/config/www/community/frigate-hass-card/media-c9012082.js.gz index c6837be4..175c6ca1 100644 Binary files a/config/www/community/frigate-hass-card/media-c9012082.js.gz and b/config/www/community/frigate-hass-card/media-c9012082.js.gz differ diff --git a/config/www/community/frigate-hass-card/media-grid-82029e37.js b/config/www/community/frigate-hass-card/media-grid-82029e37.js new file mode 100644 index 00000000..5b5f8c37 --- /dev/null +++ b/config/www/community/frigate-hass-card/media-grid-82029e37.js @@ -0,0 +1,22 @@ +import{dJ as t,dI as e,dc as i,ew as n,i as o,db as s,cK as r,cM as a,s as h,_ as l,n as d,t as u,a as c,cL as f,x as m,cP as p,r as g}from"./card-e5d55e5b.js";var v,y={exports:{}},_={exports:{}},b={exports:{}};function C(){return v||(v=1,e=b,i="undefined"!=typeof window?window:t,n=function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o