first commit

This commit is contained in:
Your Name committed 2024-01-11 15:10:51 +03:00
commit eddf07c652
602 files changed
+67154

No files matched your search

@@ -0,0 +1,5 @@
"""HACS Frontend"""
from .version import VERSION
def locate_dir():
return __path__[0]
@@ -0,0 +1 @@
var t=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),e="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,n="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),r="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(n):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var i=["top","right","bottom","left","width","height","size","weight"],o="undefined"!=typeof MutationObserver,s=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,i=!1,o=0;function s(){n&&(n=!1,t()),i&&c()}function a(){r(s)}function c(){var t=Date.now();if(n){if(t-o<2)return;i=!0}else n=!0,i=!1,setTimeout(a,e);o=t}return c}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){e&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){e&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;i.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),a=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},c=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||n},h=l(0,0,0,0);function u(t){return parseFloat(t)||0}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+u(t["border-"+n+"-width"])}),0)}function d(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return h;var r=c(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=t["padding-"+i];e[i]=u(o)}return e}(r),o=i.left+i.right,s=i.top+i.bottom,a=u(r.width),d=u(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==e&&(a-=f(r,"left","right")+o),Math.round(d+s)!==n&&(d-=f(r,"top","bottom")+s)),!function(t){return t===c(t).document.documentElement}(t)){var p=Math.round(a+o)-e,v=Math.round(d+s)-n;1!==Math.abs(p)&&(a-=p),1!==Math.abs(v)&&(d-=v)}return l(i.left,i.top,a,d)}var p="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof c(t).SVGGraphicsElement}:function(t){return t instanceof c(t).SVGElement&&"function"==typeof t.getBBox};function v(t){return e?p(t)?function(t){var e=t.getBBox();return l(0,0,e.width,e.height)}(t):d(t):h}function l(t,e,n,r){return{x:t,y:e,width:n,height:r}}var _=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=l(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=v(this.target);return thiLine truncated
@@ -0,0 +1 @@
var t="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,e="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),n=function(){if("function"==typeof requestAnimationFrame)return requestAnimationFrame.bind(e);return function(t){return setTimeout((function(){t(+Date.now())}),1e3/60)}}();var r=["top","right","bottom","left","width","height","size","weight"],i="undefined"!=typeof MutationObserver,o=t&&HTMLElement.prototype.attachShadow&&-1!==HTMLElement.prototype.attachShadow.toString().indexOf("[native code]")?HTMLElement.prototype.attachShadow:null,s=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var r=!1,i=!1,o=0;function s(){r&&(r=!1,t()),i&&c()}function a(){n(s)}function c(){var t=Date.now();if(r){if(t-o<2)return;i=!0}else r=!0,i=!1,setTimeout(a,e);o=t}return c}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},e.prototype.connect_=function(){if(t&&!this.connected_){if(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),i){this.mutationsObserver_=new MutationObserver(this.refresh);var e={attributes:!0,childList:!0,characterData:!0,subtree:!0};if(this.mutationsObserver_.observe(document,e),o){var n=this;!function t(r){var i=r.shadowRoot;i&&(n.mutationsObserver_.observe(i,e),t(i));for(var o=r.firstElementChild;o;)t(o),o=o.nextElementSibling}(document),HTMLElement.prototype.attachShadow=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=o.apply(this,t);return n.mutationsObserver_.observe(i,e),i}}}else document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0;this.connected_=!0}},e.prototype.disconnect_=function(){t&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&(this.mutationsObserver_.disconnect(),o&&(HTMLElement.prototype.attachShadow=o)),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;r.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},e.getInstance=function(){return e.instance_||(e.instance_=new e),e.instance_},e.instance_=null,e}();function a(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}var c=function(t,e){var n,r;try{for(var i=a(Object.keys(e)),o=i.next();!o.done;o=i.next()){var s=o.value;Object.defineProperty(t,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},h=function(t){var n;return(null===(n=null==t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView)||e},u=_(0,0,0,0);function f(t){return"number"==typeof t?t:parseFloat(t)||0}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+f(t["border-"+n+"-width"])}),0)}function l(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return u;var r=h(t).getComputedStyle(t),i=function(t){var e=t;return{top:f(e["padding-top"]),right:f(e["padding-right"]),bottom:f(e["padding-bottom"]),left:f(e["padding-left"])}}(r),o=i.left+i.right,s=i.top+i.bottom,a=f(r.width),c=f(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==e&&(a-=d(r,"left","right")+o),Math.round(c+s)!==n&&(c-=d(r,"top","bottom")+s)),!function(t){return t===h(t).document.documentElement}(t)){var l=Math.round(a+o)-e,v=Math.round(c+s)-n;1!==Math.abs(l)&&(a-=l),1!==Math.abs(v)&&(c-=v)}return _(i.left,i.top,a,c)}var v="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof h(t).SVGGraphicsElement}:function(t){return t instanceof h(t).SVGElement&&"function"==typeof t.getBBox};function p(e){return t?v(e)?function(t){var e=t.getBBox();return _(0,0,e.width,e.height)}(e):l(e):u}function _(t,e,n,r){return{x:t,y:e,width:n,height:r}}var b=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_(0,0,0,0),this.target=t}returLine truncated
@@ -0,0 +1,78 @@
import{_ as i,j as a,e as t,t as s,i as o,$ as e,L as r,p as l,k as n,J as d,d as c,n as m}from"./main-bd0f996b.js";import"./c.1ccf0777.js";import"./c.edefd651.js";import"./c.8e28b461.js";i([m("dialog-box")],(function(i,a){return{F:class extends a{constructor(...a){super(...a),i(this)}},d:[{kind:"field",decorators:[t({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[s()],key:"_params",value:void 0},{kind:"field",decorators:[o("ha-textfield")],key:"_textField",value:void 0},{kind:"method",key:"showDialog",value:async function(i){this._params=i}},{kind:"method",key:"closeDialog",value:function(){var i,a;return!(null!==(i=this._params)&&void 0!==i&&i.confirmation||null!==(a=this._params)&&void 0!==a&&a.prompt)&&(!this._params||(this._dismiss(),!0))}},{kind:"method",key:"render",value:function(){if(!this._params)return e``;const i=this._params.confirmation||this._params.prompt;return e`
<ha-dialog
open
?scrimClickAction=${i}
?escapeKeyAction=${i}
@closed=${this._dialogClosed}
defaultAction="ignore"
.heading=${e`${this._params.warning?e`<ha-svg-icon
.path=${r}
style="color: var(--warning-color)"
></ha-svg-icon> `:""}${this._params.title?this._params.title:this._params.confirmation&&this.hass.localize("ui.dialogs.generic.default_confirmation_title")}`}
>
<div>
${this._params.text?e`
<p class=${this._params.prompt?"no-bottom-padding":""}>
${this._params.text}
</p>
`:""}
${this._params.prompt?e`
<ha-textfield
dialogInitialFocus
value=${l(this._params.defaultValue)}
.placeholder=${l(this._params.placeholder)}
.label=${this._params.inputLabel?this._params.inputLabel:""}
.type=${this._params.inputType?this._params.inputType:"text"}
></ha-textfield>
`:""}
</div>
${i&&e`
<mwc-button @click=${this._dismiss} slot="secondaryAction">
${this._params.dismissText?this._params.dismissText:this.hass.localize("ui.dialogs.generic.cancel")}
</mwc-button>
`}
<mwc-button
@click=${this._confirm}
?dialogInitialFocus=${!this._params.prompt}
slot="primaryAction"
class=${n({destructive:this._params.destructive||!1})}
>
${this._params.confirmText?this._params.confirmText:this.hass.localize("ui.dialogs.generic.ok")}
</mwc-button>
</ha-dialog>
`}},{kind:"method",key:"_dismiss",value:function(){var i;null!==(i=this._params)&&void 0!==i&&i.cancel&&this._params.cancel(),this._close()}},{kind:"method",key:"_confirm",value:function(){var i;this._params.confirm&&this._params.confirm(null===(i=this._textField)||void 0===i?void 0:i.value);this._close()}},{kind:"method",key:"_dialogClosed",value:function(i){"ignore"!==i.detail.action&&this._dismiss()}},{kind:"method",key:"_close",value:function(){this._params&&(this._params=void 0,d(this,"dialog-closed",{dialog:this.localName}))}},{kind:"get",static:!0,key:"styles",value:function(){return c`
:host([inert]) {
pointer-events: initial !important;
cursor: initial !important;
}
a {
color: var(--primary-color);
}
p {
margin: 0;
color: var(--primary-text-color);
}
.no-bottom-padding {
padding-bottom: 0;
}
.secondary {
color: var(--secondary-text-color);
}
.destructive {
--mdc-theme-primary: var(--error-color);
}
ha-dialog {
--mdc-dialog-heading-ink-color: var(--primary-text-color);
--mdc-dialog-content-ink-color: var(--primary-text-color);
/* Place above other dialogs */
--dialog-z-index: 104;
}
@media all and (min-width: 600px) {
ha-dialog {
--mdc-dialog-min-width: 400px;
}
}
ha-textfield {
width: 100%;
}
`}}]}}),a);
@@ -0,0 +1,152 @@
import{l as t,o as e,f as i,i as r,h as n,e as o,t as s,j as a,R as c,$ as d,k as l,d as p,n as m,M as h,B as u,p as g,q as f,u as _,v as y,x as v,y as b,z as x,A as E,C as I,_ as T,F as A,D as w,E as O,G as R}from"./main-bd0f996b.js";import{o as S}from"./c.8e28b461.js";function C(i,r,n){let o,s=i;return"object"==typeof i?(s=i.slot,o=i):o={flatten:r},n?t({slot:s,flatten:r,selector:n}):e({descriptor:t=>({get(){var t,e;const i="slot"+(s?`[name=${s}]`:":not([name])"),r=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==r?void 0:r.assignedNodes(o))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}function k(t){const e=t.language||"en";return t.translationMetadata.translations[e]&&t.translationMetadata.translations[e].isRTL||!1}function F(t){return k(t)?"rtl":"ltr"}class N extends a{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new c((()=>(this.shouldRenderRipple=!0,this.ripple))),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:t=>{const e=t.type;this.onDown("mousedown"===e?"mouseup":"touchend",t)}}]}get text(){const t=this.textContent;return t?t.trim():""}render(){const t=this.renderText(),e=this.graphic?this.renderGraphic():d``,i=this.hasMeta?this.renderMeta():d``;return d`
${this.renderRipple()}
${e}
${t}
${i}`}renderRipple(){return this.shouldRenderRipple?d`
<mwc-ripple
.activated=${this.activated}>
</mwc-ripple>`:this.activated?d`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const t={multi:this.multipleGraphics};return d`
<span class="mdc-deprecated-list-item__graphic material-icons ${l(t)}">
<slot name="graphic"></slot>
</span>`}renderMeta(){return d`
<span class="mdc-deprecated-list-item__meta material-icons">
<slot name="meta"></slot>
</span>`}renderText(){const t=this.twoline?this.renderTwoline():this.renderSingleLine();return d`
<span class="mdc-deprecated-list-item__text">
${t}
</span>`}renderSingleLine(){return d`<slot></slot>`}renderTwoline(){return d`
<span class="mdc-deprecated-list-item__primary-text">
<slot></slot>
</span>
<span class="mdc-deprecated-list-item__secondary-text">
<slot name="secondary"></slot>
</span>
`}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(t,e){const i=()=>{window.removeEventListener(t,i),this.rippleHandlers.endPress()};window.addEventListener(t,i),this.rippleHandlers.startPress(e)}fireRequestSelected(t,e){if(this.noninteractive)return;const i=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:e,selected:t}});this.dispatchEvent(i)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const t of this.listeners)for(const e of t.eventNames)t.target.addEventListener(e,t.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)for(const e of t.eventNames)t.target.removeEventListener(e,t.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const t=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}i([r("slot")],N.prototype,"slotElement",void 0),i([n("mwc-ripple")],N.prototype,"ripple",void 0),i([o({type:String})],N.prototype,"value",void 0),i([o({type:String,reflect:!0})],N.prototype,"group",void 0),i([o({type:Number,reflect:!0})],N.prototype,"tabindex",void 0),i([o({type:Boolean,reflect:!0}),S((function(t){t?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")}))],N.prototype,"disabled",void 0),i([o({type:Boolean,reflect:!0})],N.prototype,"twoline",void 0),i([o({type:Boolean,reflect:!0})],N.prototype,"activated",void 0),i([o({type:String,reflect:!0})],N.prototype,"graphic",void 0),i([o({type:Boolean})],N.prototype,"multipleGraphics",void 0),i([o({type:Boolean})],N.prototype,"hasMeta",void 0),i([o({type:Boolean,reflect:!0}),S((function(t){t?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")}))],N.prototype,"noninteractive",void 0),i([o({type:Boolean,reflect:!0}),S((function(t){const e=this.getAttribute("role"),i="gridcell"===e||"option"===e||"row"===e||"tab"===e;i&&t?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged?this._firstChanged=!1:this._skipPropRequest||this.fireRequestSelected(t,"property")}))],N.prototype,"selected",void 0),i([s()],N.prototype,"shouldRenderRipple",void 0),i([s()],N.prototype,"_managingList",void 0);const M=p`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size, 24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-deprecated-list-item__meta ::slotted(.material-icons),.mdc-deprecated-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px) !important}.mdc-deprecated-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:Line truncated
<!-- @ts-ignore -->
<ul
tabindex=${i}
role="${g(t)}"
aria-label="${g(e)}"
class="mdc-deprecated-list"
@keydown=${this.onKeydown}
@focusin=${this.onFocusIn}
@focusout=${this.onFocusOut}
@request-selected=${this.onRequestSelected}
@list-item-rendered=${this.onListItemConnected}>
<slot></slot>
${this.renderPlaceholder()}
</ul>
`}renderPlaceholder(){var t;const e=null!==(t=this.assignedElements)&&void 0!==t?t:[];return void 0!==this.emptyMessage&&0===e.length?d`
<mwc-list-item noninteractive>${this.emptyMessage}</mwc-list-item>
`:null}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusIn(t,e)}}onFocusOut(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusOut(t,e)}}onKeydown(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t),i=t.target,r=yt(i);this.mdcFoundation.handleKeydown(t,r,e)}}onRequestSelected(t){if(this.mdcFoundation){let e=this.getIndexOfTarget(t);if(-1===e&&(this.layout(),e=this.getIndexOfTarget(t),-1===e))return;if(this.items[e].disabled)return;const i=t.detail.selected,r=t.detail.source;this.mdcFoundation.handleSingleSelection(e,"interaction"===r,i),t.stopPropagation()}}getIndexOfTarget(t){const e=this.items,i=t.composedPath();for(const t of i){let i=-1;if(f(t)&&yt(t)&&(i=e.indexOf(t)),-1!==i)return i}return-1}createAdapter(){return this.mdcAdapter={getListItemCount:()=>this.mdcRoot?this.items.length:0,getFocusedElementIndex:this.getFocusedItemIndex,getAttributeForElementIndex:(t,e)=>{if(!this.mdcRoot)return"";const i=this.items[t];return i?i.getAttribute(e):""},setAttributeForElementIndex:(t,e,i)=>{if(!this.mdcRoot)return;const r=this.items[t];r&&r.setAttribute(e,i)},focusItemAtIndex:t=>{const e=this.items[t];e&&e.focus()},setTabIndexForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.tabindex=e)},notifyAction:t=>{const e={bubbles:!0,composed:!0};e.detail={index:t};const i=new CustomEvent("action",e);this.dispatchEvent(i)},notifySelected:(t,e)=>{const i={bubbles:!0,composed:!0};i.detail={index:t,diff:e};const r=new CustomEvent("selected",i);this.dispatchEvent(r)},isFocusInsideList:()=>_(this),isRootFocused:()=>{const t=this.mdcRoot;return t.getRootNode().activeElement===t},setDisabledStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.disabled=e)},getDisabledStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.disabled},setSelectedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.selected=e)},getSelectedStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.selected},setActivatedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.activated=e)}},this.mdcAdapter}selectUi(t,e=!1){const i=this.items[t];i&&(i.selected=!0,i.activated=e)}deselectUi(t){const e=this.items[t];e&&(e.selected=!1,e.activated=!1)}select(t){this.mdcFoundation&&this.mdcFoundation.setSelectedIndex(t)}toggle(t,e){this.multi&&this.mdcFoundation.toggleMultiAtIndex(t,e)}onListItemConnected(t){const e=t.target;this.layout(-1===this.items.indexOf(e))}layout(t=!0){t&&this.updateItems();const e=this.items[0];for(const t of this.items)t.tabindex=-1;e&&(this.noninteractive?this.previousTabindex||(this.previousTabindex=e):e.tabindex=0),this.itemsReadyResolver()}getFocusedItemIndex(){if(!this.mdcRoot)return-1;if(!this.items.length)return-1;const t=y();if(!t.length)return-1;for(let e=t.length-1;e>=0;e--){const i=t[e];if(yt(i))return this.items.indexOf(i)}return-1}focusItemAtIndex(t){for(const t of this.items)if(0===t.tabindex){t.tabindex=-1;break}this.items[t].tabindex=0,this.items[t].focus()}focus(){const t=this.mdcRoot;t&&t.focus()}blur(){const t=this.mdcRoot;t&&t.blur()}}i([o({type:String})],bt.prototype,"emptyMessage",void 0),i([r(".mdc-deprecated-list")],bt.prototype,"mdcRoot",void 0),i([C("",!0,"*")],bt.prototype,"assignedElements",void 0),i([C("",!0,'[tabindex="0"]')],bt.prototype,"tabbableElements",void 0),i([o({type:Boolean}),S((function(t){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(t)}))],bt.prototype,"activatable",void 0),i([o({type:Boolean}),S((function(t,e){this.mdcFoundation&&this.mdcFoundation.setMulti(t),void 0!==e&&this.layout()}))],bt.prototype,"multi",void 0),i([o({type:Boolean}),S((function(t){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(t)}))],bt.prototype,"wrapFocus",void 0),i([o({type:String}),S((function(t,e){void 0!==e&&this.updateItems()}))],bt.prototype,"itemRoles",void 0),i([o({type:String})],bt.prototype,"innerRole",void 0),i([o({type:String})],bt.prototype,"innerAriaLabel",void 0),i([o({type:Boolean})],bt.prototype,"rootTabbable",void 0),i([o({type:Boolean,reflect:!0}),S((function(t){var e,i;if(t){const t=null!==(i=null===(e=this.tabbableElements)||void 0===e?void 0:e[0])&&void 0!==i?i:null;this.previousTabindex=t,t&&t.setAttribute("tabindex","-1")}else!t&&this.previousTabindex&&(this.previousTabindex.setAttribute("tabindex","0"),this.previousTabindex=null)}))],bt.prototype,"noninteractive",void 0);const xt=p`@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{frLine truncated
<div
class="mdc-menu-surface ${l(t)}"
style="${E(e)}"
@keydown=${this.onKeydown}
@opened=${this.registerBodyClick}
@closed=${this.deregisterBodyClick}>
<slot></slot>
</div>`}createAdapter(){return Object.assign(Object.assign({},I(this.mdcRoot)),{hasAnchor:()=>!!this.anchor,notifyClose:()=>{const t=new CustomEvent("closed",{bubbles:!0,composed:!0});this.open=!1,this.mdcRoot.dispatchEvent(t)},notifyClosing:()=>{const t=new CustomEvent("closing",{bubbles:!0,composed:!0});this.mdcRoot.dispatchEvent(t)},notifyOpen:()=>{const t=new CustomEvent("opened",{bubbles:!0,composed:!0});this.open=!0,this.mdcRoot.dispatchEvent(t)},isElementInContainer:()=>!1,isRtl:()=>!!this.mdcRoot&&"rtl"===getComputedStyle(this.mdcRoot).direction,setTransformOrigin:t=>{this.mdcRoot&&(this.styleTransformOrigin=t)},isFocused:()=>_(this),saveFocus:()=>{const t=y(),e=t.length;e||(this.previouslyFocused=null),this.previouslyFocused=t[e-1]},restoreFocus:()=>{this.previouslyFocused&&"focus"in this.previouslyFocused&&this.previouslyFocused.focus()},getInnerDimensions:()=>{const t=this.mdcRoot;return t?{width:t.offsetWidth,height:t.offsetHeight}:{width:0,height:0}},getAnchorDimensions:()=>{const t=this.anchor;return t?t.getBoundingClientRect():null},getBodyDimensions:()=>({width:document.body.clientWidth,height:document.body.clientHeight}),getWindowDimensions:()=>({width:window.innerWidth,height:window.innerHeight}),getWindowScroll:()=>({x:window.pageXOffset,y:window.pageYOffset}),setPosition:t=>{this.mdcRoot&&(this.styleLeft="left"in t?`${t.left}px`:"",this.styleRight="right"in t?`${t.right}px`:"",this.styleTop="top"in t?`${t.top}px`:"",this.styleBottom="bottom"in t?`${t.bottom}px`:"")},setMaxHeight:async t=>{this.mdcRoot&&(this.styleMaxHeight=t,await this.updateComplete,this.styleMaxHeight=`var(--mdc-menu-max-height, ${t})`)}})}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onBodyClick(t){if(this.stayOpenOnBodyClick)return;-1===t.composedPath().indexOf(this)&&this.close()}registerBodyClick(){this.onBodyClickBound=this.onBodyClick.bind(this),document.body.addEventListener("click",this.onBodyClickBound,{passive:!0,capture:!0})}deregisterBodyClick(){document.body.removeEventListener("click",this.onBodyClickBound,{capture:!0})}close(){this.open=!1}show(){this.open=!0}}i([r(".mdc-menu-surface")],kt.prototype,"mdcRoot",void 0),i([r("slot")],kt.prototype,"slotElement",void 0),i([o({type:Boolean}),S((function(t){this.mdcFoundation&&!this.fixed&&this.mdcFoundation.setIsHoisted(t)}))],kt.prototype,"absolute",void 0),i([o({type:Boolean})],kt.prototype,"fullwidth",void 0),i([o({type:Boolean}),S((function(t){this.mdcFoundation&&!this.absolute&&this.mdcFoundation.setFixedPosition(t)}))],kt.prototype,"fixed",void 0),i([o({type:Number}),S((function(t){this.mdcFoundation&&null!==this.y&&null!==t&&(this.mdcFoundation.setAbsolutePosition(t,this.y),this.mdcFoundation.setAnchorMargin({left:t,top:this.y,right:-t,bottom:this.y}))}))],kt.prototype,"x",void 0),i([o({type:Number}),S((function(t){this.mdcFoundation&&null!==this.x&&null!==t&&(this.mdcFoundation.setAbsolutePosition(this.x,t),this.mdcFoundation.setAnchorMargin({left:this.x,top:t,right:-this.x,bottom:t}))}))],kt.prototype,"y",void 0),i([o({type:Boolean}),S((function(t){this.mdcFoundation&&this.mdcFoundation.setQuickOpen(t)}))],kt.prototype,"quick",void 0),i([o({type:Boolean,reflect:!0}),S((function(t,e){this.mdcFoundation&&(t?this.mdcFoundation.open():void 0!==e&&this.mdcFoundation.close())}))],kt.prototype,"open",void 0),i([o({type:Boolean})],kt.prototype,"stayOpenOnBodyClick",void 0),i([s(),S((function(t){this.mdcFoundation&&this.mdcFoundation.setAnchorCorner(t)}))],kt.prototype,"bitwiseCorner",void 0),i([o({type:String}),S((function(t){if(this.mdcFoundation){const e="START"===t||"END"===t,i=null===this.previousMenuCorner,r=!i&&t!==this.previousMenuCorner,n=i&&"END"===t;e&&(r||n)&&(this.bitwiseCorner=this.bitwiseCorner^It.RIGHT,this.mdcFoundation.flipCornerHorizontally(),this.previousMenuCorner=t)}}))],kt.prototype,"menuCorner",void 0),i([o({type:String}),S((function(t){if(this.mdcFoundation&&t){let e=Ct[t];"END"===this.menuCorner&&(e^=It.RIGHT),this.bitwiseCorner=e}}))],kt.prototype,"corner",void 0),i([s()],kt.prototype,"styleTop",void 0),i([s()],kt.prototype,"styleLeft",void 0),i([s()],kt.prototype,"styleRight",void 0),i([s()],kt.prototype,"styleBottom",void 0),i([s()],kt.prototype,"styleMaxHeight",void 0),i([s()],kt.prototype,"styleTransformOrigin",void 0);const Ft=p`.mdc-menu-surface{display:none;position:absolute;box-sizing:border-box;max-width:calc(100vw - 32px);max-width:var(--mdc-menu-max-width, calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:var(--mdc-menu-max-height, calc(100vh - 32px));margin:0;padding:0;transform:scale(1);transform-origin:top left;opacity:0;overflow:auto;will-change:transform,opacity;z-index:8;transition:opacity .03s linear,transform .12s cubic-bezier(0, 0, 0.2, 1),height 250ms cubic-bezier(0, 0, 0.2, 1);box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);color:#000;Line truncated
<mwc-menu-surface
?hidden=${!this.open}
.anchor=${this.anchor}
.open=${this.open}
.quick=${this.quick}
.corner=${this.corner}
.x=${this.x}
.y=${this.y}
.absolute=${this.absolute}
.fixed=${this.fixed}
.fullwidth=${this.fullwidth}
.menuCorner=${this.menuCorner}
?stayOpenOnBodyClick=${this.stayOpenOnBodyClick}
class="mdc-menu mdc-menu-surface"
@closed=${this.onClosed}
@opened=${this.onOpened}
@keydown=${this.onKeydown}>
<mwc-list
rootTabbable
.innerAriaLabel=${this.innerAriaLabel}
.innerRole=${this.innerRole}
.multi=${this.multi}
class="mdc-deprecated-list"
.itemRoles=${t}
.wrapFocus=${this.wrapFocus}
.activatable=${this.activatable}
@action=${this.onAction}>
<slot></slot>
</mwc-list>
</mwc-menu-surface>`}createAdapter(){return{addClassToElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&("mdc-menu-item--selected"===e?this.forceGroupSelection&&!r.selected&&i.toggle(t,!0):r.classList.add(e))},removeClassFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&("mdc-menu-item--selected"===e?r.selected&&i.toggle(t,!1):r.classList.remove(e))},addAttributeToElementAtIndex:(t,e,i)=>{const r=this.listElement;if(!r)return;const n=r.items[t];n&&n.setAttribute(e,i)},removeAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&r.removeAttribute(e)},getAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return null;const r=i.items[t];return r?r.getAttribute(e):null},elementContainsClass:(t,e)=>t.classList.contains(e),closeSurface:()=>{this.open=!1},getElementIndex:t=>{const e=this.listElement;return e?e.items.indexOf(t):-1},notifySelected:()=>{},getMenuItemCount:()=>{const t=this.listElement;return t?t.items.length:0},focusItemAtIndex:t=>{const e=this.listElement;if(!e)return;const i=e.items[t];i&&i.focus()},focusListRoot:()=>{this.listElement&&this.listElement.focus()},getSelectedSiblingOfItemAtIndex:t=>{const e=this.listElement;if(!e)return-1;const i=e.items[t];if(!i||!i.group)return-1;for(let r=0;r<e.items.length;r++){if(r===t)continue;const n=e.items[r];if(n.selected&&n.group===i.group)return r}return-1},isSelectableItemAtIndex:t=>{const e=this.listElement;if(!e)return!1;const i=e.items[t];return!!i&&i.hasAttribute("group")}}}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onAction(t){const e=this.listElement;if(this.mdcFoundation&&e){const i=t.detail.index,r=e.items[i];r&&this.mdcFoundation.handleItemAction(r)}}onOpened(){this.open=!0,this.mdcFoundation&&this.mdcFoundation.handleMenuSurfaceOpened()}onClosed(){this.open=!1}async getUpdateComplete(){await this._listUpdateComplete;return await super.getUpdateComplete()}async firstUpdated(){super.firstUpdated();const t=this.listElement;t&&(this._listUpdateComplete=t.updateComplete,await this._listUpdateComplete)}select(t){const e=this.listElement;e&&e.select(t)}close(){this.open=!1}show(){this.open=!0}getFocusedItemIndex(){const t=this.listElement;return t?t.getFocusedItemIndex():-1}focusItemAtIndex(t){const e=this.listElement;e&&e.focusItemAtIndex(t)}layout(t=!0){const e=this.listElement;e&&e.layout(t)}}i([r(".mdc-menu")],Pt.prototype,"mdcRoot",void 0),i([r("slot")],Pt.prototype,"slotElement",void 0),i([o({type:Object})],Pt.prototype,"anchor",void 0),i([o({type:Boolean,reflect:!0})],Pt.prototype,"open",void 0),i([o({type:Boolean})],Pt.prototype,"quick",void 0),i([o({type:Boolean})],Pt.prototype,"wrapFocus",void 0),i([o({type:String})],Pt.prototype,"innerRole",void 0),i([o({type:String})],Pt.prototype,"innerAriaLabel",void 0),i([o({type:String})],Pt.prototype,"corner",void 0),i([o({type:Number})],Pt.prototype,"x",void 0),i([o({type:Number})],Pt.prototype,"y",void 0),i([o({type:Boolean})],Pt.prototype,"absolute",void 0),i([o({type:Boolean})],Pt.prototype,"multi",void 0),i([o({type:Boolean})],Pt.prototype,"activatable",void 0),i([o({type:Boolean})],Pt.prototype,"fixed",void 0),i([o({type:Boolean})],Pt.prototype,"forceGroupSelection",void 0),i([o({type:Boolean})],Pt.prototype,"fullwidth",void 0),i([o({type:String})],Pt.prototype,"menuCorner",void 0),i([o({type:Boolean})],Pt.prototype,"stayOpenOnBodyClick",void 0),i([o({type:String}),S((function(t){this.mdcFoundation&&this.mdcFoundation.setDefaultFocusState(Mt[t])}))],Pt.prototype,"defaultFocus",void 0);const Ht=p`mwc-list ::slotted([mwc-list-item]:not([twoline])),mwc-list ::slotted([noninteractive]:not([twoline])){height:var(--mdc-menu-item-height, 48px)}`;let Ut=class extends Pt{};Ut.styles=[Ht],Ut=i([m("mwc-menu")],Ut),T([m("ha-button-menu")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:A,value:void 0},{kind:"field",decorators:[o()],key:"corner",value:()=>"TOP_START"},{kind:"field",decorators:[o()],key:"menuCorner",value:()=>"START"},{kind:"field",decorators:[o({type:Number})],key:"x",value:()=>null},{kind:"field",decorators:[o({type:Number})],key:"y",value:()=>null},{kind:"field",decorators:[o({type:Boolean})],key:"multi",value:()=>!1},{kind:"field",decorators:[o({type:Boolean})],key:"activatable",value:()=>!1},{kind:"field",decorators:[o({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[o({type:Boolean})],key:"fixed",value:()=>!1},{kind:"field",decorators:[r("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var t;return null===(t=this._menu)||void 0===t?void 0:t.items}},{kind:"get",key:"selected",value:function(){var t;return null===(t=this._menu)||void 0===t?void 0:t.selected}},{kind:"method",key:"focus",value:function(){var t,e;null!==(t=this._menu)&&void 0!==t&&t.open?this._menu.focusItemAtIndex(0):null===(e=this._triggerButton)||void 0===e|Line truncated
<div @click=${this._handleClick}>
<slot name="trigger" @slotchange=${this._setTriggerAria}></slot>
</div>
<mwc-menu
.corner=${this.corner}
.menuCorner=${this.menuCorner}
.fixed=${this.fixed}
.multi=${this.multi}
.activatable=${this.activatable}
.y=${this.y}
.x=${this.x}
>
<slot></slot>
</mwc-menu>
`}},{kind:"method",key:"firstUpdated",value:function(t){w(O(i.prototype),"firstUpdated",this).call(this,t),"rtl"===document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((t=>{const e=document.createElement("style");e.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",t.shadowRoot.appendChild(e)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"get",static:!0,key:"styles",value:function(){return p`
:host {
display: inline-block;
position: relative;
}
::slotted([disabled]) {
color: var(--disabled-text-color);
}
`}}]}}),a);var $t='/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE\n */\n.mdc-touch-target-wrapper{display:inline}.mdc-deprecated-chip-trailing-action__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.mdc-deprecated-chip-trailing-action{border:none;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;padding:0;outline:none;cursor:pointer;-webkit-appearance:none;background:none}.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__icon{height:18px;width:18px;font-size:18px}.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__touch{width:26px}.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__icon{fill:currentColor;color:inherit}@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-deprecated-chip-trailing-action{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity}.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__ripple::before,.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__ripple::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-deprecated-chip-trailing-action .mdc-deprecated-chip-trailing-action__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded .mdc-deprecated-chip-trailing-action__ripple::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale, 1));transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded .mdc-deprecated-chip-trailing-action__ripple::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded--unbounded .mdc-deprecated-chip-trailing-action__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded--foreground-activation .mdc-deprecated-chip-trailing-action__ripple::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-deprecated-chip-trailing-action.mdc-ripple-upgraded--foreground-deactivation .mdc-deprecated-chip-trailing-action__ripple::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end, 0)) sca Line truncated
<div class="mdc-chip ${this.noText?"no-text":""}">
${this.hasIcon?d`<div class="mdc-chip__icon mdc-chip__icon--leading">
<slot name="icon"></slot>
</div>`:null}
<div class="mdc-chip__ripple"></div>
<span role="gridcell">
<span role="button" tabindex="0" class="mdc-chip__primary-action">
<span class="mdc-chip__text"><slot></slot></span>
</span>
</span>
${this.hasTrailingIcon?d`<div class="mdc-chip__icon mdc-chip__icon--trailing">
<slot name="trailing-icon"></slot>
</div>`:null}
</div>
`}},{kind:"get",static:!0,key:"styles",value:function(){return p`
${R($t)}
.mdc-chip {
background-color: var(
--ha-chip-background-color,
rgba(var(--rgb-primary-text-color), 0.15)
);
color: var(--ha-chip-text-color, var(--primary-text-color));
}
.mdc-chip.no-text {
padding: 0 10px;
}
.mdc-chip:hover {
color: var(--ha-chip-text-color, var(--primary-text-color));
}
.mdc-chip__icon--leading,
.mdc-chip__icon--trailing {
--mdc-icon-size: 18px;
line-height: 14px;
color: var(--ha-chip-icon-color, var(--ha-chip-text-color));
}
.mdc-chip.mdc-chip--selected .mdc-chip__checkmark,
.mdc-chip .mdc-chip__icon--leading:not(.mdc-chip__icon--leading-hidden) {
margin-right: -4px;
margin-inline-start: -4px;
margin-inline-end: 4px;
direction: var(--direction);
}
span[role="gridcell"] {
line-height: 14px;
}
`}}]}}),a);export{Tt as C,B as K,N as L,it as a,$t as b,k as c,F as d,mt as n,C as o,M as s};
@@ -0,0 +1 @@
let t,i;async function s(){return i||async function(){t=window.EventTarget;try{new t}catch{t=(await import("./c.86b125b8.js")).EventTarget}return i=t}()}function e(t){return"horizontal"===t?"width":"height"}function o(t){return"horizontal"===t?"height":"width"}class h{constructor(t){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._scrollToIndex=-1,this._scrollToAnchor=0,this._firstVisible=0,this._lastVisible=0,this._eventTargetPromise=s().then((t=>{this._eventTarget=new t})),this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._totalItems=0,this._scrollSize=1,this._overhang=1e3,this._eventTarget=null,Promise.resolve().then((()=>this.config=t||this._defaultConfig))}get _defaultConfig(){return{direction:"vertical"}}set config(t){Object.assign(this,Object.assign({},this._defaultConfig,t))}get config(){return{direction:this.direction}}get totalItems(){return this._totalItems}set totalItems(t){const i=Number(t);i!==this._totalItems&&(this._totalItems=i,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:i,_viewDim2:s}=this;Object.assign(this._viewportSize,t),s!==this._viewDim2?this._scheduleLayoutUpdate():i!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const i=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],i!==this._scrollPosition&&(this._scrollPositionChanged(i,this._scrollPosition),this._updateVisibleIndices({emit:!0})),this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}scrollToIndex(t,i="start"){if(Number.isFinite(t)){switch(t=Math.min(this.totalItems,Math.max(0,t)),this._scrollToIndex=t,"nearest"===i&&(i=t>this._first+this._num/2?"end":"start"),i){case"start":this._scrollToAnchor=0;break;case"center":this._scrollToAnchor=.5;break;case"end":this._scrollToAnchor=1;break;default:throw new TypeError("position must be one of: start, center, end, nearest")}this._scheduleReflow()}}async dispatchEvent(t){await this._eventTargetPromise,this._eventTarget.dispatchEvent(t)}async addEventListener(t,i,s){await this._eventTargetPromise,this._eventTarget.addEventListener(t,i,s)}async removeEventListener(t,i,s){await this._eventTargetPromise,this._eventTarget.removeEventListener(t,i,s)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._getActiveItems(),this._scrollIfNeeded(),this._updateVisibleIndices(),this._emitScrollSize(),this._emitRange(),this._emitChildPositions(),this._emitScrollError()}_scrollIfNeeded(){if(-1===this._scrollToIndex)return;const t=this._scrollToIndex,i=this._scrollToAnchor,s=this._getItemPosition(t)[this._positionDim],e=this._getItemSize(t)[this._sizeDim],o=this._scrollPosition+this._viewDim1*i,h=s+e*i,r=Math.floor(Math.min(this._scrollSize-this._viewDim1,Math.max(0,this._scrollPosition-o+h)));this._scrollError+=this._scrollPosition-r,this._scrollPosition=r}_emitRange(t){const i=Object.assign({first:this._first,last:this._last,num:this._num,firstVisible:this._firstVisible,lastVisible:this._lastVisible},t);this.dispatchEvent(new CustomEvent("rangechange",{detail:i}))}_emitScrollSize(){const t={[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null};this.dispatchEvent(new CustomEvent("scrollsizechange",{detail:t}))}_emitScrollError(){if(this._scrollError){const t={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0};this.dispatchEvent(new CustomEvent("scrollerrorchange",{detail:t})),this._scrollError=0}}_emitChildPositions(){const t={};for(let i=this._first;i<=this._last;i++)t[i]=this._getItemPosition(i);this.dispatchEvent(new CustomEvent("itempositionchange",{detail:t}))}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),i=Math.minLine truncated
@@ -0,0 +1 @@
let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let e=1;e<t.length;e++)t[e]+=t[e-1];function e(e){for(let i=1;i<t.length;i+=2)if(t[i]>e)return t[i-1]<=e;return!1}function i(t){return t>=127462&&t<=127487}function n(t,e,i=!0,n=!0){return(i?s:r)(t,e,n)}function s(t,n,s){if(n==t.length)return n;n&&o(t.charCodeAt(n))&&l(t.charCodeAt(n-1))&&n--;let r=h(t,n);for(n+=c(r);n<t.length;){let o=h(t,n);if(8205==r||8205==o||s&&e(o))n+=c(o),r=o;else{if(!i(o))break;{let e=0,s=n-2;for(;s>=0&&i(h(t,s));)e++,s-=2;if(e%2==0)break;n+=2}}}return n}function r(t,e,i){for(;e>0;){let n=s(t,e-2,i);if(n<e)return n;e--}return 0}function o(t){return t>=56320&&t<57344}function l(t){return t>=55296&&t<56320}function h(t,e){let i=t.charCodeAt(e);if(!l(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return o(n)?n-56320+(i-55296<<10)+65536:i}function a(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function c(t){return t<65536?1:2}function u(t,e,i=t.length){let s=0;for(let r=0;r<i;)9==t.charCodeAt(r)?(s+=e-s%e,r++):(s++,r=n(t,r));return s}function f(t,e,i,s){for(let s=0,r=0;;){if(r>=e)return s;if(s==t.length)break;r+=9==t.charCodeAt(s)?i-r%i:1,s=n(t,s)}return!0===s?-1:t.length}class d{constructor(){}lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),m.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){let i=[];return this.decompose(t,e,i,0),m.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new w(this),s=new w(t);for(let t=e,r=e;;){if(n.next(t),s.next(t),t=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(r+=n.value.length,n.done||r>=i)return!0}}iter(t=1){return new w(this,t)}iterRange(t,e=this.length){return new y(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new b(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new p(t):m.from(p.split(t,[])):d.empty}}class p extends d{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let s=0;;s++){let r=this.text[s],o=n+r.length;if((e?i:o)>=t)return new x(n,o,i,r);n=o+1,i++}}decompose(t,e,i,n){let s=t<=0&&e>=this.length?this:new p(v(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&n){let t=i.pop(),e=g(s.text,t.text.slice(),0,s.length);if(e.length<=32)i.push(new p(e,t.length+s.length));else{let t=e.length>>1;i.push(new p(e.slice(0,t)),new p(e.slice(t)))}}else i.push(s)}replace(t,e,i){if(!(i instanceof p))return super.replace(t,e,i);let n=g(this.text,g(i.text,v(this.text,0,t)),e),s=this.length+i.length-(e-t);return n.length<=32?new p(n,s):m.from(p.split(n,[]),s)}sliceString(t,e=this.length,i="\n"){let n="";for(let s=0,r=0;s<=e&&r<this.text.length;r++){let o=this.text[r],l=s+o.length;s>t&&r&&(n+=i),t<l&&e>s&&(n+=o.sliLine truncated
@@ -0,0 +1,112 @@
import{x as t,y as e,M as i,f as o,i as n,e as a,B as d,C as r,ab as s,ac as c,$ as l,k as m,d as h,_ as u,F as g,D as p,E as f,n as _,I as b}from"./main-bd0f996b.js";import{o as v}from"./c.8e28b461.js";(()=>{var t,e,i;const o=Symbol(),n=Symbol(),a=Symbol(),d=Symbol(),r=Symbol(),s=Symbol(),c=Symbol(),l=Symbol(),m=Symbol(),h=Symbol(),u=Symbol(),g=Symbol(),p=Symbol();class f{constructor(){this[t]=[],this[e]=[],this[i]=new Set}destructor(){this[m](this[a]);const t=this;t[o]=null,t[a]=null,t[n]=null}get top(){const t=this[o];return t[t.length-1]||null}push(t){t&&t!==this.top&&(this.remove(t),this[s](t),this[o].push(t))}remove(t){const e=this[o].indexOf(t);return-1!==e&&(this[o].splice(e,1),e===this[o].length&&this[s](this.top),!0)}pop(){const t=this.top;return t&&this.remove(t),t}has(t){return-1!==this[o].indexOf(t)}[(t=o,e=a,i=n,s)](t){const e=this[n],i=this[a];if(!t)return this[m](i),e.clear(),void(this[a]=[]);const o=this[h](t);if(o[o.length-1].parentNode!==document.body)throw Error("Non-connected element cannot be a blocking element");this[a]=o;const d=this[u](t);if(!i.length)return void this[l](o,d,e);let r=i.length-1,s=o.length-1;for(;r>0&&s>0&&i[r]===o[s];)r--,s--;i[r]!==o[s]&&this[c](i[r],o[s]),r>0&&this[m](i.slice(0,r)),s>0&&this[l](o.slice(0,s),d,null)}[c](t,e){const i=t[d];this[g](t)&&!t.inert&&(t.inert=!0,i.add(t)),i.has(e)&&(e.inert=!1,i.delete(e)),e[r]=t[r],e[d]=i,t[r]=void 0,t[d]=void 0}[m](t){for(const e of t){e[r].disconnect(),e[r]=void 0;const t=e[d];for(const e of t)e.inert=!1;e[d]=void 0}}[l](t,e,i){for(const o of t){const t=o.parentNode,n=t.children,a=new Set;for(let t=0;t<n.length;t++){const d=n[t];d===o||!this[g](d)||e&&e.has(d)||(i&&d.inert?i.add(d):(d.inert=!0,a.add(d)))}o[d]=a;const s=new MutationObserver(this[p].bind(this));o[r]=s;let c=t;const l=c;l.__shady&&l.host&&(c=l.host),s.observe(c,{childList:!0})}}[p](t){const e=this[a],i=this[n];for(const o of t){const t=o.target.host||o.target,n=t===document.body?e.length:e.indexOf(t),a=e[n-1],r=a[d];for(let t=0;t<o.removedNodes.length;t++){const e=o.removedNodes[t];if(e===a)return console.info("Detected removal of the top Blocking Element."),void this.pop();r.has(e)&&(e.inert=!1,r.delete(e))}for(let t=0;t<o.addedNodes.length;t++){const e=o.addedNodes[t];this[g](e)&&(i&&e.inert?i.add(e):(e.inert=!0,r.add(e)))}}}[g](t){return!1===/^(style|template|script)$/.test(t.localName)}[h](t){const e=[];let i=t;for(;i&&i!==document.body;)if(i.nodeType===Node.ELEMENT_NODE&&e.push(i),i.assignedSlot){for(;i=i.assignedSlot;)e.push(i);i=e.pop()}else i=i.parentNode||i.host;return e}[u](t){const e=t.shadowRoot;if(!e)return null;const i=new Set;let o,n,a;const d=e.querySelectorAll("slot");if(d.length&&d[0].assignedNodes)for(o=0;o<d.length;o++)for(a=d[o].assignedNodes({flatten:!0}),n=0;n<a.length;n++)a[n].nodeType===Node.ELEMENT_NODE&&i.add(a[n]);return i}}document.$blockingElements=new f})();var y=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}();function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}!function(){if("undefined"!=typeof window){var t=Array.prototype.slice,e=Element.prototype.matches||Element.prototype.msMatchesSelector,i=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),o=function(){function o(t,e){x(this,o),this._inertManager=e,this._rootElement=t,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return y(o,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach((function(t){this._unmanageNode(t.node)}),this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(t){var e=this;r(t,(function(t){return e._visitNode(t)}));var i=document.activeElement;if(!document.body.contains(t)){for(var o=t,n=void 0;o;){if(o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){n=o;break}o=o.parentNode}n&&(i=n.activeElement)}t.contains(i)&&(i.blur(),i===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=t;o!==this._rootElement&&o.hasAttribute("inert")&&this._adoptInertRoot(o),(e.call(oLine truncated
<div class="mdc-dialog ${m(t)}"
role="alertdialog"
aria-modal="true"
aria-labelledby="title"
aria-describedby="content">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
${e}
<div id="content" class="mdc-dialog__content">
<slot id="contentSlot"></slot>
</div>
<footer
id="actions"
class="${m(i)}">
<span>
<slot name="secondaryAction"></slot>
</span>
<span>
<slot name="primaryAction"></slot>
</span>
</footer>
</div>
</div>
<div class="mdc-dialog__scrim"></div>
</div>`}renderHeading(){return l`
<h2 id="title" class="mdc-dialog__title">${this.heading}</h2>`}firstUpdated(){super.firstUpdated(),this.mdcFoundation.setAutoStackButtons(!0),this.initialSupressDefaultPressSelector?this.suppressDefaultPressSelector=this.initialSupressDefaultPressSelector:this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,"mwc-textarea","mwc-menu mwc-list-item","mwc-select mwc-list-item"].join(", "),this.boundHandleClick=this.mdcFoundation.handleClick.bind(this.mdcFoundation),this.boundHandleKeydown=this.mdcFoundation.handleKeydown.bind(this.mdcFoundation),this.boundHandleDocumentKeydown=this.mdcFoundation.handleDocumentKeydown.bind(this.mdcFoundation)}connectedCallback(){super.connectedCallback(),this.open&&this.mdcFoundation&&!this.mdcFoundation.isOpen()&&(this.setEventListeners(),this.mdcFoundation.open())}disconnectedCallback(){super.disconnectedCallback(),this.open&&this.mdcFoundation&&(this.removeEventListeners(),this.closingDueToDisconnect=!0,this.mdcFoundation.close(this.currentAction||this.defaultAction),this.closingDueToDisconnect=!1,this.currentAction=void 0,I.remove(this))}forceLayout(){this.mdcFoundation.layout()}focus(){const t=this.getInitialFocusEl();t&&t.focus()}blur(){if(!this.shadowRoot)return;const t=this.shadowRoot.activeElement;if(t)t instanceof HTMLElement&&t.blur();else{const t=this.getRootNode(),e=t instanceof Document?t.activeElement:null;e instanceof HTMLElement&&e.blur()}}setEventListeners(){this.boundHandleClick&&this.mdcRoot.addEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.addEventListener("keydown",this.boundHandleKeydown,k()),this.boundHandleDocumentKeydown&&document.addEventListener("keydown",this.boundHandleDocumentKeydown,k())}removeEventListeners(){this.boundHandleClick&&this.mdcRoot.removeEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.removeEventListener("keydown",this.boundHandleKeydown),this.boundHandleDocumentKeydown&&document.removeEventListener("keydown",this.boundHandleDocumentKeydown)}close(){this.open=!1}show(){this.open=!0}}o([n(".mdc-dialog")],T.prototype,"mdcRoot",void 0),o([n('slot[name="primaryAction"]')],T.prototype,"primarySlot",void 0),o([n('slot[name="secondaryAction"]')],T.prototype,"secondarySlot",void 0),o([n("#contentSlot")],T.prototype,"contentSlot",void 0),o([n(".mdc-dialog__content")],T.prototype,"contentElement",void 0),o([n(".mdc-container")],T.prototype,"conatinerElement",void 0),o([a({type:Boolean})],T.prototype,"hideActions",void 0),o([a({type:Boolean}),v((function(){this.forceLayout()}))],T.prototype,"stacked",void 0),o([a({type:String})],T.prototype,"heading",void 0),o([a({type:String}),v((function(t){this.mdcFoundation.setScrimClickAction(t)}))],T.prototype,"scrimClickAction",void 0),o([a({type:String}),v((function(t){this.mdcFoundation.setEscapeKeyAction(t)}))],T.prototype,"escapeKeyAction",void 0),o([a({type:Boolean,reflect:!0}),v((function(t){this.mdcFoundation&&this.isConnected&&(t?(this.setEventListeners(),this.mdcFoundation.open()):(this.removeEventListeners(),this.mdcFoundation.close(this.currentAction||this.defaultAction),this.currentAction=void 0))}))],T.prototype,"open",void 0),o([a()],T.prototype,"defaultAction",void 0),o([a()],T.prototype,"actionAttribute",void 0),o([a()],T.prototype,"initialFocusAttribute",void 0);const O=h`.mdc-dialog .mdc-dialog__surface{background-color:#fff;background-color:var(--mdc-theme-surface, #fff)}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__surface-scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__title{color:rgba(0,0,0,.87)}.mdc-dialog .mdc-dialog__content{color:rgba(0,0,0,.6)}.mdc-dialog .mdc-dialog__close{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-dialog .mdc-dialog__close:hover .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close.mdc-ripple-surface--hover .mdc-icon-button__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-dialog .mdc-dialog__close.mdc-ripple-upgraded--background-focused .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded):focus .mdc-icon-button__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded) .mdc-icon-button__ripple::after{transition:opacity 150ms linear}.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded):active .mdc-icon-button__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-dialog .mdc-dialog__close.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,.mdc-dialog.mdc-dialog--scrollaLine truncated
<div class="header_title">${e}</div>
<ha-icon-button
.label=${t.localize("ui.dialogs.generic.close")}
.path=${b}
dialogAction="close"
class="header_button"
></ha-icon-button>
`;u([_("ha-dialog")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:g,value:void 0},{kind:"method",key:"scrollToPos",value:function(t,e){var i;null===(i=this.contentElement)||void 0===i||i.scrollTo(t,e)}},{kind:"method",key:"renderHeading",value:function(){return l`<slot name="heading"> ${p(f(i.prototype),"renderHeading",this).call(this)} </slot>`}},{kind:"field",static:!0,key:"styles",value:()=>[O,h`
.mdc-dialog {
--mdc-dialog-scroll-divider-color: var(--divider-color);
z-index: var(--dialog-z-index, 7);
-webkit-backdrop-filter: var(--dialog-backdrop-filter, none);
backdrop-filter: var(--dialog-backdrop-filter, none);
--mdc-dialog-box-shadow: var(--dialog-box-shadow, none);
--mdc-typography-headline6-font-weight: 400;
--mdc-typography-headline6-font-size: 1.574rem;
}
.mdc-dialog__actions {
justify-content: var(--justify-action-buttons, flex-end);
padding-bottom: max(env(safe-area-inset-bottom), 24px);
}
.mdc-dialog__actions span:nth-child(1) {
flex: var(--secondary-action-button-flex, unset);
}
.mdc-dialog__actions span:nth-child(2) {
flex: var(--primary-action-button-flex, unset);
}
.mdc-dialog__container {
align-items: var(--vertial-align-dialog, center);
}
.mdc-dialog__title {
padding: 24px 24px 0 24px;
}
.mdc-dialog__actions {
padding: 0 24px 24px 24px;
}
.mdc-dialog__title::before {
display: block;
height: 0px;
}
.mdc-dialog .mdc-dialog__content {
position: var(--dialog-content-position, relative);
padding: var(--dialog-content-padding, 24px);
}
:host([hideactions]) .mdc-dialog .mdc-dialog__content {
padding-bottom: max(
var(--dialog-content-padding, 24px),
env(safe-area-inset-bottom)
);
}
.mdc-dialog .mdc-dialog__surface {
position: var(--dialog-surface-position, relative);
top: var(--dialog-surface-top);
margin-top: var(--dialog-surface-margin-top);
min-height: var(--mdc-dialog-min-height, auto);
border-radius: var(--ha-dialog-border-radius, 28px);
}
:host([flexContent]) .mdc-dialog .mdc-dialog__content {
display: flex;
flex-direction: column;
}
.header_button {
position: absolute;
right: 16px;
top: 14px;
text-decoration: none;
color: inherit;
}
.header_title {
margin-right: 32px;
margin-inline-end: 32px;
margin-inline-start: initial;
direction: var(--direction);
}
.header_button {
inset-inline-start: initial;
inset-inline-end: 16px;
direction: var(--direction);
}
.dialog-actions {
inset-inline-start: initial !important;
inset-inline-end: 0px !important;
direction: var(--direction);
}
`]}]}}),T);export{D as c};
@@ -0,0 +1,7 @@
import{_ as r,j as e,e as t,t as s,$ as i,ae as o,n as a}from"./main-bd0f996b.js";import{e as n,c}from"./c.50bfd408.js";const d={hacs_repository:{redirect:"/hacs/repository",params:{owner:"string",repository:"string",category:"string?"}}};r([a("hacs-my-redirect")],(function(r,e){return{F:class extends e{constructor(...e){super(...e),r(this)}},d:[{kind:"field",decorators:[t({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[t({attribute:!1})],key:"hacs",value:void 0},{kind:"field",decorators:[t({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[s()],key:"_error",value:void 0},{kind:"method",key:"firstUpdated",value:function(r){const e=this.route.path.indexOf("/",1),t=this.route.path.substr(e+1),s=d[t];if(!s)return void(this._error=this.hacs.localize("my.not_supported",{link:i`<a
target="_blank"
rel="noreferrer noopener"
href="https://my.home-assistant.io/faq.html#supported-pages"
>
${this.hacs.localize("my.faq_link")}
</a>`}));let a;try{a=this._createRedirectUrl(s)}catch(r){return void(this._error=this.hacs.localize("my.error"))}o(a,{replace:!0})}},{kind:"method",key:"render",value:function(){return this._error?i`<hass-error-screen .error=${this._error}></hass-error-screen>`:i``}},{kind:"method",key:"_createRedirectUrl",value:function(r){const e=this._createRedirectParams(r);return`${r.redirect}${e}`}},{kind:"method",key:"_createRedirectParams",value:function(r){const e=n();if(!r.params&&!Object.keys(e).length)return"";const t={};for(const[s,i]of Object.entries(r.params||{}))if(e[s]||!i.endsWith("?")){if(!e[s]||!this._checkParamType(i,e[s]))throw Error();t[s]=e[s]}return`?${c(t)}`}},{kind:"method",key:"_checkParamType",value:function(r,e){return"string"===r||"string?"===r}}]}}),e);export{d as REDIRECTS};
@@ -0,0 +1,176 @@
import{V as t,W as i,X as a}from"./main-bd0f996b.js";t({_template:i`
<style>
:host {
display: block;
position: absolute;
outline: none;
z-index: 1002;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
cursor: default;
}
#tooltip {
display: block;
outline: none;
@apply --paper-font-common-base;
font-size: 10px;
line-height: 1;
background-color: var(--paper-tooltip-background, #616161);
color: var(--paper-tooltip-text-color, white);
padding: 8px;
border-radius: 2px;
@apply --paper-tooltip;
}
@keyframes keyFrameScaleUp {
0% {
transform: scale(0.0);
}
100% {
transform: scale(1.0);
}
}
@keyframes keyFrameScaleDown {
0% {
transform: scale(1.0);
}
100% {
transform: scale(0.0);
}
}
@keyframes keyFrameFadeInOpacity {
0% {
opacity: 0;
}
100% {
opacity: var(--paper-tooltip-opacity, 0.9);
}
}
@keyframes keyFrameFadeOutOpacity {
0% {
opacity: var(--paper-tooltip-opacity, 0.9);
}
100% {
opacity: 0;
}
}
@keyframes keyFrameSlideDownIn {
0% {
transform: translateY(-2000px);
opacity: 0;
}
10% {
opacity: 0.2;
}
100% {
transform: translateY(0);
opacity: var(--paper-tooltip-opacity, 0.9);
}
}
@keyframes keyFrameSlideDownOut {
0% {
transform: translateY(0);
opacity: var(--paper-tooltip-opacity, 0.9);
}
10% {
opacity: 0.2;
}
100% {
transform: translateY(-2000px);
opacity: 0;
}
}
.fade-in-animation {
opacity: 0;
animation-delay: var(--paper-tooltip-delay-in, 500ms);
animation-name: keyFrameFadeInOpacity;
animation-iteration-count: 1;
animation-timing-function: ease-in;
animation-duration: var(--paper-tooltip-duration-in, 500ms);
animation-fill-mode: forwards;
@apply --paper-tooltip-animation;
}
.fade-out-animation {
opacity: var(--paper-tooltip-opacity, 0.9);
animation-delay: var(--paper-tooltip-delay-out, 0ms);
animation-name: keyFrameFadeOutOpacity;
animation-iteration-count: 1;
animation-timing-function: ease-in;
animation-duration: var(--paper-tooltip-duration-out, 500ms);
animation-fill-mode: forwards;
@apply --paper-tooltip-animation;
}
.scale-up-animation {
transform: scale(0);
opacity: var(--paper-tooltip-opacity, 0.9);
animation-delay: var(--paper-tooltip-delay-in, 500ms);
animation-name: keyFrameScaleUp;
animation-iteration-count: 1;
animation-timing-function: ease-in;
animation-duration: var(--paper-tooltip-duration-in, 500ms);
animation-fill-mode: forwards;
@apply --paper-tooltip-animation;
}
.scale-down-animation {
transform: scale(1);
opacity: var(--paper-tooltip-opacity, 0.9);
animation-delay: var(--paper-tooltip-delay-out, 500ms);
animation-name: keyFrameScaleDown;
animation-iteration-count: 1;
animation-timing-function: ease-in;
animation-duration: var(--paper-tooltip-duration-out, 500ms);
animation-fill-mode: forwards;
@apply --paper-tooltip-animation;
}
.slide-down-animation {
transform: translateY(-2000px);
opacity: 0;
animation-delay: var(--paper-tooltip-delay-out, 500ms);
animation-name: keyFrameSlideDownIn;
animation-iteration-count: 1;
animation-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);
animation-duration: var(--paper-tooltip-duration-out, 500ms);
animation-fill-mode: forwards;
@apply --paper-tooltip-animation;
}
.slide-down-animation-out {
transform: translateY(0);
opacity: var(--paper-tooltip-opacity, 0.9);
animation-delay: var(--paper-tooltip-delay-out, 500ms);
animation-name: keyFrameSlideDownOut;
animation-iteration-count: 1;
animation-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
animation-duration: var(--paper-tooltip-duration-out, 500ms);
animation-fill-mode: forwards;
@apply --paper-tooltip-animation;
}
.cancel-animation {
animation-delay: -30s !important;
}
/* Thanks IE 10. */
.hidden {
display: none !important;
}
</style>
<div id="tooltip" class="hidden">
<slot></slot>
</div>
`,is:"paper-tooltip",hostAttributes:{role:"tooltip",tabindex:-1},properties:{for:{type:String,observer:"_findTarget"},manualMode:{type:Boolean,value:!1,observer:"_manualModeChanged"},position:{type:String,value:"bottom"},fitToVisibleBounds:{type:Boolean,value:!1},offset:{type:Number,value:14},marginTop:{type:Number,value:14},animationDelay:{type:Number,value:500,observer:"_delayChange"},animationEntry:{type:String,value:""},animationExit:{type:String,value:""},animationConfig:{type:Object,value:function(){return{entry:[{name:"fade-in-animation",node:this,timing:{delay:0}}],exit:[{name:"fade-out-animation",node:this}]}}},_showing:{type:Boolean,value:!1}},listeners:{webkitAnimationEnd:"_onAnimationEnd"},get target(){var t=a(this).parentNode,i=a(this).getOwnerRoot();return this.for?a(i).querySelector("#"+this.for):t.nodeType==Node.DOCUMENT_FRAGMENT_NODE?i.host:t},attached:function(){this._findTarget()},detached:function(){this.manualMode||this._removeListeners()},playAnimation:function(t){"entry"===t?this.show():"exit"===t&&this.hide()},cancelAnimation:function(){this.$.tooltip.classList.add("cancel-animation")},show:function(){if(!this._showing){if(""===a(this).textContent.trim()){for(var t=!0,i=a(this).getEffectiveChildNodes(),n=0;n<i.length;n++)if(""!==i[n].textContent.trim()){t=!1;break}if(t)return}this._showing=!0,this.$.tooltip.classList.remove("hidden"),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.updatePosition(),this._animationPlaying=!0,this.$.tooltip.classList.add(this._getAnimationType("entry"))}},hide:function(){if(this._showing){if(this._animationPlaying)return this._showing=!1,void this._cancelAnimation();this._onAnimationFinish(),this._showing=!1,this._animationPlaying=!0}},updatePosition:function(){if(this._target&&this.offsetParent){var t=this.offset;14!=this.marginTop&&14==this.offset&&(t=this.marginTop);var i,a,n=this.offsetParent.getBoundingClientRect(),e=this._target.getBoundingClientRect(),o=this.getBoundingClientRect(),s=(e.width-o.width)/2,r=(e.height-o.height)/2,l=e.left-n.left,p=e.top-n.top;switch(this.position){case"top":i=l+s,a=p-o.height-t;break;case"bottom":i=l+s,a=p+e.height+t;break;case"left":i=l-o.width-t,a=p+r;break;case"right":i=l+e.width+t,a=p+r}this.fitToVisibleBounds?(n.left+i+o.width>window.innerWidth?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),n.top+a+o.height>window.innerHeight?(this.style.bottom=n.height-p+t+"px",this.style.top="auto"):(this.style.top=Math.max(-n.top,a)+"px",this.style.bottom="auto")):(this.style.left=i+"px",this.style.top=a+"px")}},_addListeners:function(){this._target&&(this.listen(this._target,"mouseenter","show"),this.listen(this._target,"focus","show"),this.listen(this._target,"mouseleave","hide"),this.listen(this._target,"blur","hide"),this.listen(this._target,"tap","hide")),this.listen(this.$.tooltip,"animationend","_onAnimationEnd"),this.listen(this,"mouseenter","hide")},_findTarget:function(){this.manualMode||this._removeListeners(),this._target=this.target,this.manualMode||this._addListeners()},_delayChange:function(t){500!==t&&this.updateStyles({"--paper-tooltip-delay-in":t+"ms"})},_manualModeChanged:function(){this.manualMode?this._removeListeners():this._addListeners()},_cancelAnimation:function(){this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add("hidden")},_onAnimationFinish:function(){this._showing&&(this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add(this._getAnimationType("exit")))},_onAnimationEnd:function(){this._animationPlaying=!1,this._showing||(this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.add("hidden"))},_getAnimationType:function(t){if("entry"===t&&""!==this.animationEntry)return this.animationEntry;if("exit"===t&&""!==this.animationExit)return this.animationExit;if(this.animationConfig[t]&&"string"==typeof this.animationConfig[t][0].name){if(this.animationConfig[t][0].timing&&this.animationConfig[t][0].timing.delay&&0!==this.animationConfig[t][0].timing.delay){var i=this.animationConfig[t][0].timing.delay;"entry"===t?this.updateStyles({"--paper-tooltip-delay-in":i+"ms"}):"exit"===t&&this.updateStyles({"--paper-tooltip-delay-out":i+"ms"})}return this.animationConfig[t][0].name}},_removeListeners:function(){this._target&&(this.unlisten(this._target,"mouseenter","show"),this.unlisten(this._target,"focus","show"),this.unlisten(this._target,"mouseleave","hide"),this.unlisten(this._target,"blur","hide"),this.unlisten(this._target,"tap","hide")),this.unlisten(this.$.tooltip,"animationend","_onAnimationEnd"),this.unlisten(this,"mouseenter","hide")}});
@@ -0,0 +1 @@
import{S as t,f as e,e as i,t as s,j as r,$ as n}from"./main-bd0f996b.js";import{c as l}from"./c.35e839f3.js";class o{constructor(e=!0){t(this,"_storage",{}),t(this,"_listeners",{}),e&&window.addEventListener("storage",(t=>{t.key&&this.hasKey(t.key)&&(this._storage[t.key]=t.newValue?JSON.parse(t.newValue):t.newValue,this._listeners[t.key]&&this._listeners[t.key].forEach((e=>e(t.oldValue?JSON.parse(t.oldValue):t.oldValue,this._storage[t.key]))))}))}addFromStorage(t){if(!this._storage[t]){const e=window.localStorage.getItem(t);e&&(this._storage[t]=JSON.parse(e))}}subscribeChanges(t,e){return this._listeners[t]?this._listeners[t].push(e):this._listeners[t]=[e],()=>{this.unsubscribeChanges(t,e)}}unsubscribeChanges(t,e){if(!(t in this._listeners))return;const i=this._listeners[t].indexOf(e);-1!==i&&this._listeners[t].splice(i,1)}hasKey(t){return t in this._storage}getValue(t){return this._storage[t]}setValue(t,e){this._storage[t]=e;try{void 0===e?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e))}catch(t){}}}const h=new o,a=(t,e,i=!0,s)=>r=>{const n=i?h:new o(!1),l=String(r.key);t=t||String(r.key);const a=r.initializer?r.initializer():void 0;n.addFromStorage(t);const c=()=>n.hasKey(t)?n.getValue(t):a;return{kind:"method",placement:"prototype",key:r.key,descriptor:{set(i){((i,s)=>{let l;e&&(l=c()),n.setValue(t,s),e&&i.requestUpdate(r.key,l)})(this,i)},get:()=>c(),enumerable:!0,configurable:!0},finisher(o){if(e&&i){const e=o.prototype.connectedCallback,i=o.prototype.disconnectedCallback;o.prototype.connectedCallback=function(){var i;e.call(this),this[`__unbsubLocalStorage${l}`]=(i=this,n.subscribeChanges(t,(t=>{i.requestUpdate(r.key,t)})))},o.prototype.disconnectedCallback=function(){i.call(this),this[`__unbsubLocalStorage${l}`]()}}e&&o.createProperty(r.key,{noAccessor:!0,...s})}}};let c,u;async function _(){return u||async function(){if(c)return(await c).default;c=window.ResizeObserver;try{new c((function(){}))}catch(t){c=import("./c.033798e3.js"),c=(await c).default}return u=c}()}const d=Symbol("virtualizerRef");class m extends Event{constructor(t){super(m.eventName,{bubbles:!0}),this.first=t.first,this.last=t.last}}m.eventName="rangeChanged";class p extends Event{constructor(t){super(p.eventName,{bubbles:!0}),this.first=t.first,this.last=t.last}}p.eventName="visibilityChanged";class y{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._mutationPromise=null,this._mutationPromiseResolver=null,this._mutationsObserved=!1,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollToIndex=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,!t)throw new Error("Virtualizer constructor requires a configuration object");if(!t.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(t)}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t),this._initLayout(t)}async _initObservers(){this._mutationObserver=new MutationObserver(this._observeMutations.bind(this));const t=await _();this._hostElementRO=new t((()=>this._hostElementSizeChanged())),this._childrenRO=new t(this._childrenSizeChanged.bind(this))}async _initLayout(t){t.layout?this.layout=t.layout:this.layout=(await import("./c.f3491693.js")).FlowLayout}_initHostElement(t){const e=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),e[d]=this}async connected(){await this._initObservers();const t=this._isScroller;this._clippingAncestors=function(t,e=!1){return function(t,e=!1){const i=[];let s=e?t:g(t);for(;null!==s;)i.push(s),s=g(s);return i}(t,e).filter((t=>"visible"!==getComputedStyle(t).overflow))}(this._hostElement,t),this._schedule(this._updateLayout),this._observeAndListen()}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._mutationPromise=new Promise((t=>this._mutationPromiseResolver=t)),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)})),this._children.forEach((t=>this._childrenRO.observe(t))),this._scrollEventListeners.forEach((t=>t.addEventListener("scroll",this,this._scrollEventListeneLine truncated
@@ -0,0 +1,183 @@
import{P as t,T as e,a4 as i,_ as s,j as n,e as o,t as a,$ as r,eM as l,J as d,d as h,n as c,I as m,m as u,aa as p}from"./main-bd0f996b.js";import{o as g,M as f}from"./c.d1feaea4.js";import{d as v}from"./c.09c1108b.js";import{c as _}from"./c.35e839f3.js";import{i as y,u as b,r as k,b as w}from"./c.acc74bcb.js";import{a as $,s as x}from"./c.7692ecb7.js";import"./c.1ccf0777.js";import"./c.b764d104.js";import"./c.eef9df6a.js";import"./c.8e28b461.js";import"./c.743a15a1.js";import"./c.edefd651.js";import"./c.f2bb3724.js";import"./c.23be34f7.js";import"./c.9e27c745.js";import"./c.2a9c4717.js";import"./c.10b44dbb.js";import"./c.f10ce4af.js";const I=new WeakMap;let A=0;const C=new Map,j=new WeakSet,O=()=>new Promise((t=>requestAnimationFrame(t))),z=(t,e)=>{const i=t-e;return 0===i?void 0:i},S=(t,e)=>{const i=t/e;return 1===i?void 0:i},D={left:(t,e)=>{const i=z(t,e);return{value:i,transform:i&&`translateX(${i}px)`}},top:(t,e)=>{const i=z(t,e);return{value:i,transform:i&&`translateY(${i}px)`}},width:(t,e)=>{const i=S(t,e);return{value:i,transform:i&&`scaleX(${i})`}},height:(t,e)=>{const i=S(t,e);return{value:i,transform:i&&`scaleY(${i})`}}},F={duration:333,easing:"ease-in-out"},P=["left","top","width","height","opacity","color","background"],U=new WeakMap;const E=t(class extends g{constructor(t){if(super(t),this.t=null,this.i=null,this.o=!0,this.shouldLog=!1,t.type===e.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;null===(t=this.resolveFinished)||void 0===t||t.call(this),this.finished=new Promise((t=>{this.h=t}))}async resolveFinished(){var t;null===(t=this.h)||void 0===t||t.call(this),this.h=void 0}render(t){return i}getController(){return I.get(this.l)}isDisabled(){var t;return this.options.disabled||(null===(t=this.getController())||void 0===t?void 0:t.disabled)}update(t,[e]){var i;const s=void 0===this.l;return s&&(this.l=null===(i=t.options)||void 0===i?void 0:i.host,this.l.addController(this),this.element=t.element,U.set(this.element,this)),this.optionsOrCallback=e,(s||"function"!=typeof e)&&this.u(e),this.render(e)}u(t){var e,i;t=null!=t?t:{};const s=this.getController();void 0!==s&&((t={...s.defaultOptions,...t}).keyframeOptions={...s.defaultOptions.keyframeOptions,...t.keyframeOptions}),null!==(e=(i=t).properties)&&void 0!==e||(i.properties=P),this.options=t}v(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach((s=>{var n;const o=null!==(n=e[s])&&void 0!==n?n:D[s]?void 0:i[s],a=Number(o);t[s]=isNaN(a)?o+"":a})),t}p(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((t,e)=>{if(Array.isArray(t)){if(Array.isArray(e)&&e.length===t.length&&t.every(((t,i)=>t===e[i])))return!1}else if(e===t)return!1;return!0})(t,this.m)),this.o=this.l.hasUpdated&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.o&&(this.m=Array.isArray(t)?Array.from(t):t),this.o}hostUpdate(){var t;"function"==typeof this.optionsOrCallback&&this.u(this.optionsOrCallback()),this.p()&&(this.g=this.v(),this.t=null!==(t=this.t)&&void 0!==t?t:this.element.parentNode,this.i=this.element.nextSibling)}async hostUpdated(){if(!this.o||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await O;const e=this._(),i=this.A(this.options.keyframeOptions,e),s=this.v();if(void 0!==this.g){const{from:i,to:n}=this.O(this.g,s,e);this.log("measured",[this.g,s,i,n]),t=this.calculateKeyframes(i,n)}else{const i=C.get(this.options.inId);if(i){C.delete(this.options.inId);const{from:n,to:o}=this.O(i,s,e);t=this.calculateKeyframes(n,o),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,A++,t.forEach((t=>t.zIndex=A))}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){var t;void 0!==this.P&&(this.element.setAttribute("style",null!==(t=this.P)&&void 0!==t?t:""),this.P=void 0)}commitStyles(){var t,e;this.P=this.element.getAttribute("style"),null===(t=this.webAnimation)||void 0===t||t.commitStyles(),null===(e=this.webAnimation)||void 0===e||e.cancel()}reconnected(){}async disconnected(){var t;if(!this.o)return;if(void 0!==this.options.id&&C.set(this.options.id,this.g),void 0===this.options.out)return;if(this.prepare(),await O(),null===(t=this.t)||void 0===t?void 0:t.isConnected){const t=this.i&&this.i.parentNode===this.t?this.i:null;if(this.t.insertBefore(this.element,t),this.options.stabilizeOut){const t=this.v();this.log("stabilizing out");const e=this.g.left-t.left,i=this.g.top-t.top;!("static"===getComputedStyle(this.element).position)||0===e&&0===i||(this.element.style.position="relative"),0!==e&&(this.element.style.left=e+"px"),0!==i&&(this.element.style.top=i+"px")}}const e=this.A(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;null===(e=(t=this.options).onStart)||void 0===e||e.caLine truncated
<mwc-button
.label=${this._uploading>0?this.hass.localize("ui.components.media-browser.file_management.uploading",{count:this._uploading}):this.hass.localize("ui.components.media-browser.file_management.add_media")}
.disabled=${this._uploading>0}
@click=${this._startUpload}
>
${this._uploading>0?r`
<ha-circular-progress
size="tiny"
active
alt=""
slot="icon"
></ha-circular-progress>
`:r` <ha-svg-icon .path=${l} slot="icon"></ha-svg-icon> `}
</mwc-button>
`:r``}},{kind:"method",key:"_startUpload",value:async function(){if(this._uploading>0)return;const t=document.createElement("input");t.type="file",t.accept="audio/*,video/*,image/*",t.multiple=!0,t.addEventListener("change",(async()=>{d(this,"uploading");const e=t.files;document.body.removeChild(t);const i=this.currentItem.media_content_id;for(let t=0;t<e.length;t++){this._uploading=e.length-t;try{await b(this.hass,i,e[t])}catch(t){$(this,{text:this.hass.localize("ui.components.media-browser.file_management.upload_failed",{reason:t.message||t})});break}}this._uploading=0,d(this,"media-refresh")}),{once:!0}),t.style.display="none",document.body.append(t),t.click()}},{kind:"field",static:!0,key:"styles",value:()=>h`
mwc-button {
/* We use icon + text to show disabled state */
--mdc-button-disabled-ink-color: --mdc-theme-primary;
}
ha-svg-icon[slot="icon"],
ha-circular-progress[slot="icon"] {
vertical-align: middle;
}
ha-svg-icon[slot="icon"] {
margin-inline-start: 0px;
margin-inline-end: 8px;
direction: var(--direction);
}
`}]}}),n),s([c("dialog-media-manage")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[o({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[a()],key:"_currentItem",value:void 0},{kind:"field",decorators:[a()],key:"_params",value:void 0},{kind:"field",decorators:[a()],key:"_uploading",value:()=>!1},{kind:"field",decorators:[a()],key:"_deleting",value:()=>!1},{kind:"field",decorators:[a()],key:"_selected",value:()=>new Set},{kind:"field",key:"_filesChanged",value:()=>!1},{kind:"method",key:"showDialog",value:function(t){this._params=t,this._refreshMedia()}},{kind:"method",key:"closeDialog",value:function(){this._filesChanged&&this._params.onClose&&this._params.onClose(),this._params=void 0,this._currentItem=void 0,this._uploading=!1,this._deleting=!1,this._filesChanged=!1,d(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){var t,e,i,s;if(!this._params)return r``;const n=(null===(t=this._currentItem)||void 0===t||null===(e=t.children)||void 0===e?void 0:e.filter((t=>!t.can_expand)))||[];let o=0;return r`
<ha-dialog
open
scrimClickAction
escapeKeyAction
hideActions
flexContent
.heading=${this._params.currentItem.title}
@closed=${this.closeDialog}
>
<ha-header-bar slot="heading">
${0===this._selected.size?r`
<span slot="title">
${this.hass.localize("ui.components.media-browser.file_management.title")}
</span>
<ha-media-upload-button
.disabled=${this._deleting}
.hass=${this.hass}
.currentItem=${this._params.currentItem}
@uploading=${this._startUploading}
@media-refresh=${this._doneUploading}
slot="actionItems"
></ha-media-upload-button>
${this._uploading?"":r`
<ha-icon-button
.label=${this.hass.localize("ui.dialogs.generic.close")}
.path=${m}
dialogAction="close"
slot="actionItems"
class="header_button"
dir=${v(this.hass)}
></ha-icon-button>
`}
`:r`
<mwc-button
class="danger"
slot="title"
.disabled=${this._deleting}
.label=${this.hass.localize("ui.components.media-browser.file_management."+(this._deleting?"deleting":"delete"),{count:this._selected.size})}
@click=${this._handleDelete}
>
<ha-svg-icon .path=${u} slot="icon"></ha-svg-icon>
</mwc-button>
${this._deleting?"":r`
<mwc-button
slot="actionItems"
.label=${"Deselect all"}
@click=${this._handleDeselectAll}
>
<ha-svg-icon
.path=${m}
slot="icon"
></ha-svg-icon>
</mwc-button>
`}
`}
</ha-header-bar>
${this._currentItem?n.length?r`
<mwc-list multi @selected=${this._handleSelected}>
${_(n,(t=>t.media_content_id),(t=>{const e=r`
<ha-svg-icon
slot="graphic"
.path=${f["directory"===t.media_class&&t.children_media_class||t.media_class].icon}
></ha-svg-icon>
`;return r`
<ha-check-list-item
${E({id:t.media_content_id,skipInitial:!0})}
graphic="icon"
.disabled=${this._uploading||this._deleting}
.selected=${this._selected.has(o++)}
.item=${t}
>
${e} ${t.title}
</ha-check-list-item>
`}))}
</mwc-list>
`:r`<div class="no-items">
<p>
${this.hass.localize("ui.components.media-browser.file_management.no_items")}
</p>
${null!==(i=this._currentItem)&&void 0!==i&&null!==(s=i.children)&&void 0!==s&&s.length?r`<span class="folders"
>${this.hass.localize("ui.components.media-browser.file_management.folders_not_supported")}</span
>`:""}
</div>`:r`
<div class="refresh">
<ha-circular-progress active></ha-circular-progress>
</div>
`}
</ha-dialog>
`}},{kind:"method",key:"_handleSelected",value:function(t){this._selected=t.detail.index}},{kind:"method",key:"_startUploading",value:function(){this._uploading=!0,this._filesChanged=!0}},{kind:"method",key:"_doneUploading",value:function(){this._uploading=!1,this._refreshMedia()}},{kind:"method",key:"_handleDeselectAll",value:function(){this._selected.size&&(this._selected=new Set)}},{kind:"method",key:"_handleDelete",value:async function(){if(!await x(this,{text:this.hass.localize("ui.components.media-browser.file_management.confirm_delete",{count:this._selected.size}),warning:!0}))return;this._filesChanged=!0,this._deleting=!0;const t=[];let e=0;this._currentItem.children.forEach((i=>{i.can_expand||this._selected.has(e++)&&t.push(i)}));try{await Promise.all(t.map((async t=>{await k(this.hass,t.media_content_id),this._currentItem={...this._currentItem,children:this._currentItem.children.filter((e=>e!==t))}})))}finally{this._deleting=!1,this._selected=new Set}}},{kind:"method",key:"_refreshMedia",value:async function(){this._selected=new Set,this._currentItem=void 0,this._currentItem=await w(this.hass,this._params.currentItem.media_content_id)}},{kind:"get",static:!0,key:"styles",value:function(){return[p,h`
ha-dialog {
--dialog-z-index: 8;
--dialog-content-padding: 0;
}
@media (min-width: 800px) {
ha-dialog {
--mdc-dialog-max-width: 800px;
--dialog-surface-position: fixed;
--dialog-surface-top: 40px;
--mdc-dialog-max-height: calc(100vh - 72px);
}
}
ha-header-bar {
--mdc-theme-on-primary: var(--primary-text-color);
--mdc-theme-primary: var(--mdc-theme-surface);
flex-shrink: 0;
border-bottom: 1px solid var(--divider-color, rgba(0, 0, 0, 0.12));
}
ha-media-upload-button,
mwc-button {
--mdc-theme-primary: var(--mdc-theme-on-primary);
}
mwc-list {
direction: ltr;
}
.danger {
--mdc-theme-primary: var(--error-color);
}
ha-svg-icon[slot="icon"] {
vertical-align: middle;
}
ha-svg-icon[slot="icon"] {
margin-inline-start: 0px !important;
margin-inline-end: 8px !important;
direction: var(--direction);
}
.refresh {
display: flex;
height: 200px;
justify-content: center;
align-items: center;
}
.no-items {
text-align: center;
padding: 16px;
}
.folders {
color: var(--secondary-text-color);
font-style: italic;
}
`]}}]}}),n);
@@ -0,0 +1 @@
import{c as a,u as n}from"./c.743a15a1.js";import{eL as t}from"./main-bd0f996b.js";import{l as r}from"./c.b2e63d8e.js";var e=a((function(a,n){Object.defineProperty(n,"__esModule",{value:!0}),n.parseUnicodeLocaleId=n.parseUnicodeLanguageId=n.isUnicodeVariantSubtag=n.isUnicodeScriptSubtag=n.isUnicodeRegionSubtag=n.isStructurallyValidLanguageTag=n.isUnicodeLanguageSubtag=n.SEPARATOR=void 0;var r=/^[a-z0-9]{1,8}$/i,e=/^[a-z0-9]{2,8}$/i,L=/^[a-z0-9]{3,8}$/i,i=/^[a-z0-9][a-z]$/i,u=/^[a-z0-9]{3,8}$/i,Z=/^[a-z]{4}$/i,d=/^[0-9a-svwyz]$/i,o=/^([a-z]{2}|[0-9]{3})$/i,s=/^([a-z0-9]{5,8}|[0-9][a-z0-9]{3})$/i,l=/^([a-z]{2,3}|[a-z]{5,8})$/i,g=/^[a-z][0-9]$/i;function b(a){return l.test(a)}function c(a){return o.test(a)}function m(a){return Z.test(a)}function k(a){return s.test(a)}function h(a){"string"==typeof a&&(a=a.split(n.SEPARATOR));var t,r,e=a.shift();if(!e)throw new RangeError("Missing unicode_language_subtag");if("root"===e)return{lang:"root",variants:[]};if(!b(e))throw new RangeError("Malformed unicode_language_subtag");a.length&&m(a[0])&&(t=a.shift()),a.length&&c(a[0])&&(r=a.shift());for(var L={};a.length&&k(a[0]);){var i=a.shift();if(i in L)throw new RangeError('Duplicate variant "'.concat(i,'"'));L[i]=1}return{lang:e,script:t,region:r,variants:Object.keys(L)}}function p(a){for(var n,t=[];a.length&&(n=f(a));)t.push(n);if(t.length)return{type:"u",keywords:t,attributes:[]};for(var r=[];a.length&&L.test(a[0]);)r.push(a.shift());for(;a.length&&(n=f(a));)t.push(n);if(t.length||r.length)return{type:"u",attributes:r,keywords:t};throw new RangeError("Malformed unicode_extension")}function f(a){var t;if(i.test(a[0])){t=a.shift();for(var r=[];a.length&&u.test(a[0]);)r.push(a.shift());var e="";return r.length&&(e=r.join(n.SEPARATOR)),[t,e]}}function y(a){var t;try{t=h(a)}catch(a){}for(var r=[];a.length&&g.test(a[0]);){for(var e=a.shift(),i=[];a.length&&L.test(a[0]);)i.push(a.shift());if(!i.length)throw new RangeError('Missing tvalue for tkey "'.concat(e,'"'));r.push([e,i.join(n.SEPARATOR)])}if(r.length)return{type:"t",fields:r,lang:t};throw new RangeError("Malformed transformed_extension")}function A(a){for(var t=[];a.length&&r.test(a[0]);)t.push(a.shift());if(t.length)return{type:"x",value:t.join(n.SEPARATOR)};throw new RangeError("Malformed private_use_extension")}function v(a){for(var t=[];a.length&&e.test(a[0]);)t.push(a.shift());return t.length?t.join(n.SEPARATOR):""}n.SEPARATOR="-",n.isUnicodeLanguageSubtag=b,n.isStructurallyValidLanguageTag=function(a){try{h(a.split(n.SEPARATOR))}catch(a){return!1}return!0},n.isUnicodeRegionSubtag=c,n.isUnicodeScriptSubtag=m,n.isUnicodeVariantSubtag=k,n.parseUnicodeLanguageId=h,n.parseUnicodeLocaleId=function(a){var r=a.split(n.SEPARATOR),e=h(r);return(0,t.__assign)({lang:e},function(a){if(!a.length)return{extensions:[]};var n,t,r,e=[],L={};do{var i=a.shift();switch(i){case"u":case"U":if(n)throw new RangeError("There can only be 1 -u- extension");n=p(a),e.push(n);break;case"t":case"T":if(t)throw new RangeError("There can only be 1 -t- extension");t=y(a),e.push(t);break;case"x":case"X":if(r)throw new RangeError("There can only be 1 -x- extension");r=A(a),e.push(r);break;default:if(!d.test(i))throw new RangeError("Malformed extension type");if(i in L)throw new RangeError("There can only be 1 -".concat(i,"- extension"));var u={type:i,value:v(a)};L[u.type]=u,e.push(u)}}while(a.length);return{extensions:e}}(r))}}));n(e),e.parseUnicodeLocaleId,e.parseUnicodeLanguageId,e.isUnicodeVariantSubtag,e.isUnicodeScriptSubtag,e.isUnicodeRegionSubtag,e.isStructurallyValidLanguageTag,e.isUnicodeLanguageSubtag,e.SEPARATOR;var L=a((function(a,n){function r(a){return a?(0,t.__spreadArray)([a.lang,a.script,a.region],a.variants||[],!0).filter(Boolean).join("-"):""}Object.defineProperty(n,"__esModule",{value:!0}),n.emitUnicodeLocaleId=n.emitUnicodeLanguageId=void 0,n.emitUnicodeLanguageId=r,n.emitUnicodeLocaleId=function(a){for(var n=a.lang,e=a.extensions,L=[r(n)],i=0,u=e;i<u.length;i++){var Z=u[i];switch(L.push(Z.type),Z.type){case"u":L.push.apply(L,(0,t.__spreadArray)((0,t.__spreadArray)([],Z.attributes,!1),Z.keywords.reduce((function(a,n){return a.concat(n)}),[]),!1));break;case"t":L.push.apply(L,(0,t.__spreadArray)([r(Z.lang)],Z.fields.reduce((function(a,n){return a.concat(n)}),[]),!1));break;default:L.push(Z.value)}}return L.filter(Boolean).join("-")}}));n(L),L.emitUnicodeLocaleId,L.emitUnicodeLanguageId;var i=a((function(a,n){Object.defineProperty(n,"__esModule",{value:!0}),n.variantAlias=n.scriptAlias=n.territoryAlias=n.languageAlias=void 0,n.languageAlias={"aa-saaho":"ssy",aam:"aas",aar:"aa",abk:"ab",adp:"dz",afr:"af",agp:"apf",ais:"ami",aju:"jrb",aka:"ak",alb:"sq",als:"sq",amh:"am",ara:"ar",arb:"ar",arg:"an",arm:"hy","art-lojban":"jbo",asd:"snz",asm:"as",aue:"ktz",ava:"av",ave:"ae",aym:"ay",ayr:"ay",ayx:"nun",aze:"az",azj:"az",bak:"ba",bam:"bm",baq:"eu",baz:"nvo",bcc:"bal",bcl:"bik",bel:"be",ben:"bn",bgm:"bcg",bh:"bho",bhk:"fbl",bic:"bir",bih:"bho",bis:"bi",bjd:"drl",bjq:"bzc",bkb:"ebk",blg:"iba"Line truncated
@@ -0,0 +1 @@
import{P as e,Q as t,T as s,U as r}from"./main-bd0f996b.js";import{a as n,c as o,u as i,m as l,s as a}from"./c.b764d104.js";function f(e){if(!e||"object"!=typeof e)return e;if("[object Date]"==Object.prototype.toString.call(e))return new Date(e.getTime());if(Array.isArray(e))return e.map(f);var t={};return Object.keys(e).forEach((function(s){t[s]=f(e[s])})),t}const c=(e,t,s)=>{const r=new Map;for(let n=t;n<=s;n++)r.set(e[n],n);return r},u=e(class extends t{constructor(e){if(super(e),e.type!==s.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,s){let r;void 0===s?s=t:void 0!==t&&(r=t);const n=[],o=[];let i=0;for(const t of e)n[i]=r?r(t,i):i,o[i]=s(t,i),i++;return{values:o,keys:n}}render(e,t,s){return this.dt(e,t,s).values}update(e,[t,s,f]){var u;const d=n(e),{values:p,keys:h}=this.dt(t,s,f);if(!Array.isArray(d))return this.at=h,p;const y=null!==(u=this.at)&&void 0!==u?u:this.at=[],v=[];let b,m,g=0,j=d.length-1,x=0,A=p.length-1;for(;g<=j&&x<=A;)if(null===d[g])g++;else if(null===d[j])j--;else if(y[g]===h[x])v[x]=o(d[g],p[x]),g++,x++;else if(y[j]===h[A])v[A]=o(d[j],p[A]),j--,A--;else if(y[g]===h[A])v[A]=o(d[g],p[A]),i(e,v[A+1],d[g]),g++,A--;else if(y[j]===h[x])v[x]=o(d[j],p[x]),i(e,d[g],d[j]),j--,x++;else if(void 0===b&&(b=c(h,x,A),m=c(y,g,j)),b.has(y[g]))if(b.has(y[j])){const t=m.get(h[x]),s=void 0!==t?d[t]:null;if(null===s){const t=i(e,d[g]);o(t,p[x]),v[x]=t}else v[x]=o(s,p[x]),i(e,d[g],s),d[t]=null;x++}else l(d[j]),j--;else l(d[g]),g++;for(;x<=A;){const t=i(e,v[A+1]);o(t,p[x]),v[x++]=t}for(;g<=j;){const e=d[g++];null!==e&&l(e)}return this.at=h,a(e,v),r}}),d=(e,t)=>e&&e.config.components.includes(t);export{u as c,f as d,d as i};
@@ -0,0 +1,6 @@
import{_ as t,H as e,e as i,a7 as o,$ as s,n as r}from"./main-bd0f996b.js";import{m as a}from"./c.ebd7ac98.js";import"./c.f6e28485.js";import"./c.d2f07ffa.js";import"./c.743a15a1.js";import"./c.1ccf0777.js";import"./c.8e28b461.js";let d=t([r("hacs-generic-dialog")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[i({type:Boolean})],key:"markdown",value:()=>!1},{kind:"field",decorators:[i()],key:"repository",value:void 0},{kind:"field",decorators:[i()],key:"header",value:void 0},{kind:"field",decorators:[i()],key:"content",value:void 0},{kind:"field",key:"_getRepository",value:()=>o(((t,e)=>null==t?void 0:t.find((t=>String(t.id)===e))))},{kind:"method",key:"render",value:function(){if(!this.active||!this.repository)return s``;const t=this._getRepository(this.hacs.repositories,this.repository);return s`
<hacs-dialog .active=${this.active} .narrow=${this.narrow} .hass=${this.hass}>
<div slot="header">${this.header||""}</div>
${this.markdown?this.repository?a.html(this.content||"",t):a.html(this.content||""):this.content||""}
</hacs-dialog>
`}}]}}),e);export{d as HacsGenericDialog};
@@ -0,0 +1 @@
import{c as e,u as t}from"./c.743a15a1.js";import{x as n,eL as r}from"./main-bd0f996b.js";import{k as a,m as u,n as i}from"./c.d1feaea4.js";import"./c.eef9df6a.js";import"./c.b764d104.js";import"./c.8e28b461.js";import"./c.09c1108b.js";import"./c.35e839f3.js";import"./c.7692ecb7.js";import"./c.edefd651.js";import"./c.f2bb3724.js";import"./c.23be34f7.js";import"./c.9e27c745.js";function o(e){return Intl.getCanonicalLocales(e)}function l(e){if("symbol"==typeof e)throw TypeError("Cannot convert a Symbol value to a string");return String(e)}function s(e){if(void 0===e)return NaN;if(null===e)return 0;if("boolean"==typeof e)return e?1:0;if("number"==typeof e)return e;if("symbol"==typeof e||"bigint"==typeof e)throw new TypeError("Cannot convert symbol/bigint to number");return Number(e)}function c(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function f(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e){return new Array(e)}function p(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function d(e,t){return e-Math.floor(e/t)*t}function g(e){return Math.floor(e/864e5)}function D(e){return Date.UTC(e,0)/864e5}function y(e){return new Date(e).getUTCFullYear()}function v(e){return e%4!=0?365:e%100!=0?366:e%400!=0?365:366}function b(e){return g(e)-D(y(e))}function h(e){return 365===v(y(e))?0:1}function F(e){var t=b(e),n=h(e);if(t>=0&&t<31)return 0;if(t<59+n)return 1;if(t<90+n)return 2;if(t<120+n)return 3;if(t<151+n)return 4;if(t<181+n)return 5;if(t<212+n)return 6;if(t<243+n)return 7;if(t<273+n)return 8;if(t<304+n)return 9;if(t<334+n)return 10;if(t<365+n)return 11;throw new Error("Invalid time")}function E(e){return void 0===e?Object.create(null):c(e)}function C(e,t,n,r){if(void 0!==e){if(e=Number(e),isNaN(e)||e<t||e>n)throw new RangeError("".concat(e," is outside of range [").concat(t,", ").concat(n,"]"));return Math.floor(e)}return r}function S(e,t,n,r,a){return C(e[t],n,r,a)}function w(e,t,n,r,a){if("object"!=typeof e)throw new TypeError("Options must be an object");var u=e[t];if(void 0!==u){if("boolean"!==n&&"string"!==n)throw new TypeError("invalid type");if("boolean"===n&&(u=Boolean(u)),"string"===n&&(u=l(u)),void 0!==r&&!r.filter((function(e){return e==u})).length)throw new RangeError("".concat(u," is not within ").concat(r.join(", ")));return u}return a}var T=["angle-degree","area-acre","area-hectare","concentr-percent","digital-bit","digital-byte","digital-gigabit","digital-gigabyte","digital-kilobit","digital-kilobyte","digital-megabit","digital-megabyte","digital-petabyte","digital-terabit","digital-terabyte","duration-day","duration-hour","duration-millisecond","duration-minute","duration-month","duration-second","duration-week","duration-year","length-centimeter","length-foot","length-inch","length-kilometer","length-meter","length-mile-scandinavian","length-mile","length-millimeter","length-yard","mass-gram","mass-kilogram","mass-ounce","mass-pound","mass-stone","temperature-celsius","temperature-fahrenheit","volume-fluid-ounce","volume-gallon","volume-liter","volume-milliliter"];function A(e){return e.slice(e.indexOf("-")+1)}var M=T.map(A);function L(e){return M.indexOf(e)>-1}var I=/[^A-Z]/;function B(e){return 3===(e=e.replace(/([a-z])/g,(function(e,t){return t.toUpperCase()}))).length&&!I.test(e)}function N(e){if(L(e=e.replace(/([A-Z])/g,(function(e,t){return t.toLowerCase()}))))return!0;var t=e.split("-per-");if(2!==t.length)return!1;var n=t[0],r=t[1];return!(!L(n)||!L(r))}function O(e){return Math.floor(Math.log(e)*Math.LOG10E)}function k(e,t){if("function"==typeof e.repeat)return e.repeat(t);for(var n=new Array(t),r=0;r<n.length;r++)n[r]=e;return n.join("")}function j(e,t,n,r){e.get(t)||e.set(t,Object.create(null)),e.get(t)[n]=r}function P(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=e.get(t);if(!a)throw new TypeError("".concat(t," InternalSlot has not been initialized"));return n.reduce((function(e,t){return e[t]=a[t],e}),Object.create(null))}function R(e,t,n){if(void 0===n&&(n=Error),!e)throw new n(t)}function G(e,t,n){var r=(0,n.getInternalSlots)(e),a=r.notation,u=r.dataLocaleData,i=r.numberingSystem;switch(a){case"standard":return 0;case"scientific":return t;case"engineering":return 3*Math.floor(t/3);default:var o=r.compactDisplay,l=r.style,s=r.currencyDisplay,c=void 0;if("currency"===l&&"name"!==s){c=(u.numbers.currency[i]||u.numbers.currency[u.numbers.nu[0]]).short}else{var f=u.numbers.decimal[i]||u.numbers.decimal[u.numbers.nu[0]];c="long"===o?f.long:f.short}if(!c)return 0;var m=String(Math.pow(10,t)),p=Object.keys(c);if(m<p[0])return 0;if(m>p[p.length-1])return p[p.length-1].length-1;var d=p.indexOf(m);if(-1===d)return 0;var g=p[d];return"0"===c[g].other?0:g.length-c[g].other.match(/0+/)[0].length}}function x(e,t,n){var r,a,u,i,o=n;if(0===e)r=k("0",o),a=0,u=0;else{var l=e.toString(),s=l.indexOf("e"),c=l.split("e"),f=c[0],m=c[1],p=f.replace(".","");if(s>=0&&p.length<=o)a=+m,r=p+k(Line truncated
@@ -0,0 +1 @@
const e=()=>{const e={},r=new URLSearchParams(location.search);for(const[n,t]of r.entries())e[n]=t;return e},r=e=>{const r=new URLSearchParams;return Object.entries(e).forEach((([e,n])=>{r.append(e,n)})),r.toString()};export{r as c,e};
@@ -0,0 +1,259 @@
import{_ as o,j as t,e,$ as i,au as a,k as s,aB as r,d as n,n as l,D as h,E as c,a3 as d,t as p,af as u,r as f,g as m,a7 as y,aw as v,aC as b,aD as g,aE as _,N as k,aF as w,I as $,aG as x,aH as z,aI as I,aJ as C,aK as j,aL as R,ae as L,ah as F,aM as S,aN as O,aO as T,c as P}from"./main-bd0f996b.js";import{e as E}from"./c.50bfd408.js";import{c as M}from"./c.09c1108b.js";import"./c.f10ce4af.js";import"./c.23be34f7.js";import{g as U}from"./c.f2bb3724.js";import{s as B}from"./c.7692ecb7.js";import{r as A}from"./c.e65203af.js";import"./c.d2f07ffa.js";import{f as D}from"./c.fe747ba2.js";import{m as K}from"./c.ebd7ac98.js";import"./c.8e28b461.js";import"./c.743a15a1.js";o([l("ha-icon-overflow-menu")],(function(o,t){return{F:class extends t{constructor(...t){super(...t),o(this)}},d:[{kind:"field",decorators:[e({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[e({type:Array})],key:"items",value:()=>[]},{kind:"field",decorators:[e({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return i`
${this.narrow?i` <!-- Collapsed representation for small screens -->
<ha-button-menu
@click=${this._handleIconOverflowMenuOpened}
@closed=${this._handleIconOverflowMenuClosed}
class="ha-icon-overflow-menu-overflow"
corner="BOTTOM_START"
absolute
>
<ha-icon-button
.label=${this.hass.localize("ui.common.overflow_menu")}
.path=${a}
slot="trigger"
></ha-icon-button>
${this.items.map((o=>o.divider?i`<li divider role="separator"></li>`:i`<mwc-list-item
graphic="icon"
?disabled=${o.disabled}
@click=${o.action}
class=${s({warning:Boolean(o.warning)})}
>
<div slot="graphic">
<ha-svg-icon
class=${s({warning:Boolean(o.warning)})}
.path=${o.path}
></ha-svg-icon>
</div>
${o.label}
</mwc-list-item> `))}
</ha-button-menu>`:i`
<!-- Icon representation for big screens -->
${this.items.map((o=>o.narrowOnly?"":o.divider?i`<div role="separator"></div>`:i`<div>
${o.tooltip?i`<paper-tooltip animation-delay="0" position="left">
${o.tooltip}
</paper-tooltip>`:""}
<ha-icon-button
@click=${o.action}
.label=${o.label}
.path=${o.path}
?disabled=${o.disabled}
></ha-icon-button>
</div> `))}
`}
`}},{kind:"method",key:"_handleIconOverflowMenuOpened",value:function(o){o.stopPropagation();const t=this.closest(".mdc-data-table__row");t&&(t.style.zIndex="1")}},{kind:"method",key:"_handleIconOverflowMenuClosed",value:function(){const o=this.closest(".mdc-data-table__row");o&&(o.style.zIndex="")}},{kind:"get",static:!0,key:"styles",value:function(){return[r,n`
:host {
display: flex;
justify-content: flex-end;
}
li[role="separator"] {
border-bottom-color: var(--divider-color);
}
div[role="separator"] {
border-right: 1px solid var(--divider-color);
width: 1px;
}
`]}}]}}),t);o([l("hass-subpage")],(function(o,t){class a extends t{constructor(...t){super(...t),o(this)}}return{F:a,d:[{kind:"field",decorators:[e({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[e()],key:"header",value:void 0},{kind:"field",decorators:[e({type:Boolean,attribute:"main-page"})],key:"mainPage",value:()=>!1},{kind:"field",decorators:[e({type:String,attribute:"back-path"})],key:"backPath",value:void 0},{kind:"field",decorators:[e()],key:"backCallback",value:void 0},{kind:"field",decorators:[e({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[e({type:Boolean})],key:"supervisor",value:()=>!1},{kind:"field",decorators:[A(".content")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"willUpdate",value:function(o){if(h(c(a.prototype),"willUpdate",this).call(this,o),!o.has("hass"))return;const t=o.get("hass");var e,i,s;t&&t.locale===this.hass.locale||(e=this,i="rtl",void 0!==(s=M(this.hass))&&(s=!!s),e.hasAttribute(i)?s||e.removeAttribute(i):!1!==s&&e.setAttribute(i,""))}},{kind:"method",key:"render",value:function(){var o;return i`
<div class="toolbar">
${this.mainPage||null!==(o=history.state)&&void 0!==o&&o.root?i`
<ha-menu-button
.hassio=${this.supervisor}
.hass=${this.hass}
.narrow=${this.narrow}
></ha-menu-button>
`:this.backPath?i`
<a href=${this.backPath}>
<ha-icon-button-arrow-prev
.hass=${this.hass}
></ha-icon-button-arrow-prev>
</a>
`:i`
<ha-icon-button-arrow-prev
.hass=${this.hass}
@click=${this._backTapped}
></ha-icon-button-arrow-prev>
`}
<div class="main-title">${this.header}</div>
<slot name="toolbar-icon"></slot>
</div>
<div class="content" @scroll=${this._saveScrollPos}><slot></slot></div>
<div id="fab">
<slot name="fab"></slot>
</div>
`}},{kind:"method",decorators:[d({passive:!0})],key:"_saveScrollPos",value:function(o){this._savedScrollPos=o.target.scrollTop}},{kind:"method",key:"_backTapped",value:function(){this.backCallback?this.backCallback():history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return n`
:host {
display: block;
height: 100%;
background-color: var(--primary-background-color);
}
:host([narrow]) {
width: 100%;
position: fixed;
}
.toolbar {
display: flex;
align-items: center;
font-size: 20px;
height: var(--header-height);
padding: 0 16px;
pointer-events: none;
background-color: var(--app-header-background-color);
font-weight: 400;
color: var(--app-header-text-color, white);
border-bottom: var(--app-header-border-bottom, none);
box-sizing: border-box;
}
.toolbar a {
color: var(--sidebar-text-color);
text-decoration: none;
}
ha-menu-button,
ha-icon-button-arrow-prev,
::slotted([slot="toolbar-icon"]) {
pointer-events: auto;
color: var(--sidebar-icon-color);
}
.main-title {
margin: 0 0 0 24px;
line-height: 20px;
flex-grow: 1;
}
.content {
position: relative;
width: 100%;
height: calc(100% - 1px - var(--header-height));
overflow-y: auto;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#fab {
position: fixed;
right: calc(16px + env(safe-area-inset-right));
bottom: calc(16px + env(safe-area-inset-bottom));
z-index: 1;
}
:host([narrow]) #fab.tabs {
bottom: calc(84px + env(safe-area-inset-bottom));
}
#fab[is-wide] {
bottom: 24px;
right: 24px;
}
:host([rtl]) #fab {
right: auto;
left: calc(16px + env(safe-area-inset-left));
}
:host([rtl][is-wide]) #fab {
bottom: 24px;
left: 24px;
right: auto;
}
`}}]}}),t);let W=o([l("hacs-repository-panel")],(function(o,t){class a extends t{constructor(...t){super(...t),o(this)}}return{F:a,d:[{kind:"field",decorators:[e({attribute:!1})],key:"hacs",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"narrow",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"isWide",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[e({attribute:!1})],key:"_repository",value:void 0},{kind:"field",decorators:[p()],key:"_error",value:void 0},{kind:"method",key:"connectedCallback",value:function(){h(c(a.prototype),"connectedCallback",this).call(this),document.body.addEventListener("keydown",this._generateMyLink)}},{kind:"method",key:"disconnectedCallback",value:function(){h(c(a.prototype),"disconnectedCallback",this).call(this),document.body.removeEventListener("keydown",this._generateMyLink)}},{kind:"field",key:"_generateMyLink",value(){return o=>{if(!(o.ctrlKey||o.shiftKey||o.metaKey||o.altKey)&&"m"===o.key&&u.location.pathname.startsWith("/hacs/repository/")){if(!this._repository)return;const o=new URLSearchParams({redirect:"hacs_repository",owner:this._repository.full_name.split("/")[0],repository:this._repository.full_name.split("/")[1],category:this._repository.category});window.open(`https://my.home-assistant.io/create-link/?${o.toString()}`,"_blank")}}}},{kind:"method",key:"firstUpdated",value:async function(o){h(c(a.prototype),"firstUpdated",this).call(this,o);const t=E();if(Object.entries(t).length){let o;const e=`${t.owner}/${t.repository}`;if(o=this.hacs.repositories.find((o=>o.full_name.toLocaleLowerCase()===e.toLocaleLowerCase())),!o&&t.category){if(!await B(this,{title:this.hacs.localize("my.add_repository_title"),text:this.hacs.localize("my.add_repository_description",{repository:e}),confirmText:this.hacs.localize("common.add"),dismissText:this.hacs.localize("common.cancel")}))return void(this._error=this.hacs.localize("my.repository_not_found",{repository:e}));try{await f(this.hass,e,t.category),this.hacs.repositories=await m(this.hass),o=this.hacs.repositories.find((o=>o.full_name.toLocaleLowerCase()===e.toLocaleLowerCase()))}catch(o){return void(this._error=o)}}o?this._fetchRepository(String(o.id)):this._error=this.hacs.localize("my.repository_not_found",{repository:e})}else{const o=this.route.path.indexOf("/",1),t=this.route.path.substr(o+1);if(!t)return void(this._error="Missing repositoryId from route");this._fetchRepository(t)}}},{kind:"method",key:"updated",value:function(o){h(c(a.prototype),"updated",this).call(this,o),o.has("repositories")&&this._repository&&this._fetchRepository()}},{kind:"method",key:"_fetchRepository",value:async function(o){try{this._repository=await D(this.hass,o||String(this._repository.id))}catch(o){this._error=null==o?void 0:o.message}}},{kind:"field",key:"_getAuthors",value:()=>y((o=>{const t=[];if(!o.authors)return t;if(o.authors.forEach((o=>t.push(o.replace("@","")))),0===t.length){const e=o.full_name.split("/")[0];if(["custom-cards","custom-components","home-assistant-community-themes"].includes(e))return t;t.push(e)}return t}))},{kind:"method",key:"render",value:function(){if(this._error)return i`<hass-error-screen .error=${this._error}></hass-error-screen>`;if(!this._repository)return i`<hass-loading-screen></hass-loading-screen>`;const o=this._getAuthors(this._repository);return i`
<hass-subpage
.hass=${this.hass}
.narrow=${this.narrow}
.route=${this.route}
.header=${this._repository.name}
hasFab
>
<ha-icon-overflow-menu
slot="toolbar-icon"
narrow
.hass=${this.hass}
.items=${[{path:v,label:this.hacs.localize("common.repository"),action:()=>u.open(`https://github.com/${this._repository.full_name}`,"_blank","noreferrer=true")},{path:b,label:this.hacs.localize("repository_card.update_information"),action:()=>this._refreshReopsitoryInfo()},{path:g,label:this.hacs.localize("repository_card.redownload"),action:()=>this._downloadRepositoryDialog(),hideForUninstalled:!0},{category:"plugin",hideForUninstalled:!0,path:_,label:this.hacs.localize("repository_card.open_source"),action:()=>u.open(`/hacsfiles/${this._repository.local_path.split("/").pop()}/${this._repository.file_name}`,"_blank","noreferrer=true")},{path:k,label:this.hacs.localize("repository_card.open_issue"),action:()=>u.open(`https://github.com/${this._repository.full_name}/issues`,"_blank","noreferrer=true")},{hideForId:"172733314",path:w,label:this.hacs.localize("repository_card.report"),hideForUninstalled:!0,action:()=>u.open(`https://github.com/hacs/integration/issues/new?assignees=ludeeus&labels=flag&template=removal.yml&repo=${this._repository.full_name}&title=Request for removal of ${this._repository.full_name}`,"_blank","noreferrer=true")},{hideForId:"172733314",hideForUninstalled:!0,path:$,label:this.hacs.localize("common.remove"),action:()=>this._removeRepositoryDialog()}].filter((o=>(!o.category||this._repository.category===o.category)&&(!o.hideForId||String(this._repository.id)!==o.hideForId)&&(!o.hideForUninstalled||this._repository.installed_version)))}
>
</ha-icon-overflow-menu>
<div class="content">
<div class="chips">
${this._repository.installed?i`
<ha-chip title="${this.hacs.localize("dialog_info.version_installed")}" hasIcon>
<ha-svg-icon slot="icon" .path=${x}></ha-svg-icon>
${this._repository.installed_version}
</ha-chip>
`:""}
${o?o.map((o=>i`<hacs-link .url="https://github.com/${o}">
<ha-chip title="${this.hacs.localize("dialog_info.author")}" hasIcon>
<ha-svg-icon slot="icon" .path=${z}></ha-svg-icon>
@${o}
</ha-chip>
</hacs-link>`)):""}
${this._repository.downloads?i` <ha-chip hasIcon title="${this.hacs.localize("dialog_info.downloads")}">
<ha-svg-icon slot="icon" .path=${I}></ha-svg-icon>
${this._repository.downloads}
</ha-chip>`:""}
<ha-chip title="${this.hacs.localize("dialog_info.stars")}" hasIcon>
<ha-svg-icon slot="icon" .path=${C}></ha-svg-icon>
${this._repository.stars}
</ha-chip>
<hacs-link .url="https://github.com/${this._repository.full_name}/issues">
<ha-chip title="${this.hacs.localize("dialog_info.open_issues")}" hasIcon>
<ha-svg-icon slot="icon" .path=${j}></ha-svg-icon>
${this._repository.issues}
</ha-chip>
</hacs-link>
</div>
${K.html(this._repository.additional_info||this.hacs.localize("dialog_info.no_info"),this._repository)}
</div>
${this._repository.installed_version?"":i`<ha-fab
.label=${this.hacs.localize("common.download")}
.extended=${!this.narrow}
@click=${this._downloadRepositoryDialog}
>
<ha-svg-icon slot="icon" .path=${R}></ha-svg-icon>
</ha-fab>`}
</hass-subpage>
`}},{kind:"method",key:"_downloadRepositoryDialog",value:function(){this.dispatchEvent(new CustomEvent("hacs-dialog",{detail:{type:"download",repository:this._repository.id},bubbles:!0,composed:!0}))}},{kind:"method",key:"_removeRepositoryDialog",value:async function(){if("integration"===this._repository.category&&this._repository.config_flow){if((await U(this.hass)).some((o=>o.domain===this._repository.domain))){if(await B(this,{title:this.hacs.localize("dialog.configured.title"),text:this.hacs.localize("dialog.configured.message",{name:this._repository.name}),dismissText:this.hacs.localize("common.ignore"),confirmText:this.hacs.localize("common.navigate"),confirm:()=>{L("/config/integrations",{replace:!0})}}))return}}this.dispatchEvent(new CustomEvent("hacs-dialog",{detail:{type:"progress",title:this.hacs.localize("dialog.remove.title"),confirmText:this.hacs.localize("dialog.remove.title"),content:this.hacs.localize("dialog.remove.message",{name:this._repository.name}),confirm:async()=>{await this._repositoryRemove()}},bubbles:!0,composed:!0}))}},{kind:"method",key:"_repositoryRemove",value:async function(){var o;if("plugin"===this._repository.category&&"yaml"!==(null===(o=this.hacs.info)||void 0===o?void 0:o.lovelace_mode)){(await F(this.hass)).filter((o=>o.url.startsWith(`/hacsfiles/${this._repository.full_name.split("/")[1]}/${this._repository.file_name}`))).forEach((async o=>{await S(this.hass,String(o.id))}))}await O(this.hass,String(this._repository.id)),history.back()}},{kind:"method",key:"_refreshReopsitoryInfo",value:async function(){await T(this.hass,String(this._repository.id))}},{kind:"get",static:!0,key:"styles",value:function(){return[P,n`
hass-loading-screen {
--app-header-background-color: var(--sidebar-background-color);
--app-header-text-color: var(--sidebar-text-color);
height: 100vh;
}
hass-subpage {
position: absolute;
width: 100vw;
}
ha-svg-icon {
color: var(--hcv-text-color-on-background);
}
ha-fab {
position: fixed;
float: right;
right: calc(18px + env(safe-area-inset-right));
bottom: calc(16px + env(safe-area-inset-bottom));
z-index: 1;
}
ha-fab.rtl {
float: left;
right: auto;
left: calc(18px + env(safe-area-inset-left));
}
.content {
padding: 12px;
margin-bottom: 64px;
}
.chips {
display: flex;
flex-wrap: wrap;
padding-bottom: 8px;
gap: 4px;
}
@media all and (max-width: 500px) {
.content {
margin: 8px 4px 64px;
}
}
`]}}]}}),t);export{W as HacsRepositoryPanel};
File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
import{c as e,u as t}from"./c.743a15a1.js";import{x as a,eL as r}from"./main-bd0f996b.js";import{k as n,m as i,n as o}from"./c.d1feaea4.js";import"./c.eef9df6a.js";import"./c.b764d104.js";import"./c.8e28b461.js";import"./c.09c1108b.js";import"./c.35e839f3.js";import"./c.7692ecb7.js";import"./c.edefd651.js";import"./c.f2bb3724.js";import"./c.23be34f7.js";import"./c.9e27c745.js";function u(e){return Intl.getCanonicalLocales(e)}function l(e){if("symbol"==typeof e)throw TypeError("Cannot convert a Symbol value to a string");return String(e)}function s(e){if(void 0===e)return NaN;if(null===e)return 0;if("boolean"==typeof e)return e?1:0;if("number"==typeof e)return e;if("symbol"==typeof e||"bigint"==typeof e)throw new TypeError("Cannot convert symbol/bigint to number");return Number(e)}function c(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function m(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t}function f(e){return new Array(e)}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function p(e,t){return e-Math.floor(e/t)*t}function g(e){return Math.floor(e/864e5)}function D(e){return Date.UTC(e,0)/864e5}function v(e){return new Date(e).getUTCFullYear()}function h(e){return e%4!=0?365:e%100!=0?366:e%400!=0?365:366}function y(e){return g(e)-D(v(e))}function F(e){return 365===h(v(e))?0:1}function T(e){var t=y(e),a=F(e);if(t>=0&&t<31)return 0;if(t<59+a)return 1;if(t<90+a)return 2;if(t<120+a)return 3;if(t<151+a)return 4;if(t<181+a)return 5;if(t<212+a)return 6;if(t<243+a)return 7;if(t<273+a)return 8;if(t<304+a)return 9;if(t<334+a)return 10;if(t<365+a)return 11;throw new Error("Invalid time")}function b(e){return void 0===e?Object.create(null):c(e)}function A(e,t,a,r){if(void 0!==e){if(e=Number(e),isNaN(e)||e<t||e>a)throw new RangeError("".concat(e," is outside of range [").concat(t,", ").concat(a,"]"));return Math.floor(e)}return r}function S(e,t,a,r,n){return A(e[t],a,r,n)}function P(e,t,a,r,n){if("object"!=typeof e)throw new TypeError("Options must be an object");var i=e[t];if(void 0!==i){if("boolean"!==a&&"string"!==a)throw new TypeError("invalid type");if("boolean"===a&&(i=Boolean(i)),"string"===a&&(i=l(i)),void 0!==r&&!r.filter((function(e){return e==i})).length)throw new RangeError("".concat(i," is not within ").concat(r.join(", ")));return i}return n}var E=["angle-degree","area-acre","area-hectare","concentr-percent","digital-bit","digital-byte","digital-gigabit","digital-gigabyte","digital-kilobit","digital-kilobyte","digital-megabit","digital-megabyte","digital-petabyte","digital-terabit","digital-terabyte","duration-day","duration-hour","duration-millisecond","duration-minute","duration-month","duration-second","duration-week","duration-year","length-centimeter","length-foot","length-inch","length-kilometer","length-meter","length-mile-scandinavian","length-mile","length-millimeter","length-yard","mass-gram","mass-kilogram","mass-ounce","mass-pound","mass-stone","temperature-celsius","temperature-fahrenheit","volume-fluid-ounce","volume-gallon","volume-liter","volume-milliliter"];function C(e){return e.slice(e.indexOf("-")+1)}var w=E.map(C);function M(e){return w.indexOf(e)>-1}var k=/[^A-Z]/;function O(e){return 3===(e=e.replace(/([a-z])/g,(function(e,t){return t.toUpperCase()}))).length&&!k.test(e)}function L(e){if(M(e=e.replace(/([A-Z])/g,(function(e,t){return t.toLowerCase()}))))return!0;var t=e.split("-per-");if(2!==t.length)return!1;var a=t[0],r=t[1];return!(!M(a)||!M(r))}function _(e){return Math.floor(Math.log(e)*Math.LOG10E)}function I(e,t){if("function"==typeof e.repeat)return e.repeat(t);for(var a=new Array(t),r=0;r<a.length;r++)a[r]=e;return a.join("")}function N(e,t,a,r){e.get(t)||e.set(t,Object.create(null)),e.get(t)[a]=r}function B(e,t){for(var a=[],r=2;r<arguments.length;r++)a[r-2]=arguments[r];var n=e.get(t);if(!n)throw new TypeError("".concat(t," InternalSlot has not been initialized"));return a.reduce((function(e,t){return e[t]=n[t],e}),Object.create(null))}function j(e,t,a){if(void 0===a&&(a=Error),!e)throw new a(t)}function R(e,t,a){var r=(0,a.getInternalSlots)(e),n=r.notation,i=r.dataLocaleData,o=r.numberingSystem;switch(n){case"standard":return 0;case"scientific":return t;case"engineering":return 3*Math.floor(t/3);default:var u=r.compactDisplay,l=r.style,s=r.currencyDisplay,c=void 0;if("currency"===l&&"name"!==s){c=(i.numbers.currency[o]||i.numbers.currency[i.numbers.nu[0]]).short}else{var m=i.numbers.decimal[o]||i.numbers.decimal[i.numbers.nu[0]];c="long"===u?m.long:m.short}if(!c)return 0;var f=String(Math.pow(10,t)),d=Object.keys(c);if(f<d[0])return 0;if(f>d[d.length-1])return d[d.length-1].length-1;var p=d.indexOf(f);if(-1===p)return 0;var g=d[p];return"0"===c[g].other?0:g.length-c[g].other.match(/0+/)[0].length}}function G(e,t,a){var r,n,i,o,u=a;if(0===e)r=I("0",u),n=0,i=0;else{var l=e.toString(),s=l.indexOf("e"),c=l.split("e"),m=c[0],f=c[1],d=m.replace(".","");if(s>=0&&d.length<=u)n=+f,r=d+I(Line truncated
@@ -0,0 +1 @@
var a=[];export{a as default};
@@ -0,0 +1 @@
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,o){return e(o={exports:{}},o.exports),o.exports}function n(e){return e&&e.default||e}export{e as a,t as c,n as g,o as u};
@@ -0,0 +1 @@
import{J as o}from"./main-bd0f996b.js";const a=()=>import("./c.07c9df8d.js"),i=(i,l,m)=>new Promise((n=>{const r=l.cancel,s=l.confirm;o(i,"show-dialog",{dialogTag:"dialog-box",dialogImport:a,dialogParams:{...l,...m,cancel:()=>{n(!(null==m||!m.prompt)&&null),r&&r()},confirm:o=>{n(null==m||!m.prompt||o),s&&s(o)}}})})),l=(o,a)=>i(o,a),m=(o,a)=>i(o,a,{confirmation:!0}),n=(o,a)=>i(o,a,{prompt:!0});export{l as a,n as b,m as s};
@@ -0,0 +1 @@
export{j as dump}from"./c.d1feaea4.js";import"./main-bd0f996b.js";import"./c.eef9df6a.js";import"./c.b764d104.js";import"./c.8e28b461.js";import"./c.09c1108b.js";import"./c.35e839f3.js";import"./c.743a15a1.js";import"./c.7692ecb7.js";import"./c.edefd651.js";import"./c.f2bb3724.js";import"./c.23be34f7.js";import"./c.9e27c745.js";
@@ -0,0 +1 @@
import{u as e,c as t,a as n}from"./c.743a15a1.js";var r=t((function(e,t){function r(e,t,...n){if(!e)throw new TypeError(a(t,n))}function a(e,t){let n=0;return e.replace(/%[os]/gu,(()=>o(t[n++])))}function o(e){return"object"!=typeof e||null===e?String(e):Object.prototype.toString.call(e)}let i;Object.defineProperty(t,"__esModule",{value:!0});const s="undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n?n:"undefined"!=typeof globalThis?globalThis:void 0;let l;class c{constructor(e,t){this.code=e,this.message=t}warn(...e){var t;try{if(l)return void l({...this,args:e});const n=(null!==(t=(new Error).stack)&&void 0!==t?t:"").replace(/^(?:.+?\n){2}/gu,"\n");console.warn(this.message,...e,n)}catch(e){}}}const u=new c("W01","Unable to initialize event under dispatching."),p=new c("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),g=new c("W03","Assigning any truthy value to 'returnValue' property has no effect."),f=new c("W04","Unable to preventDefault on non-cancelable events."),b=new c("W05","Unable to preventDefault inside passive event listener invocation."),d=new c("W06","An event listener wasn't added because it has been added already: %o, %o"),E=new c("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),v=new c("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o"),h=new c("W09","Event attribute handler must be a function: %o");class y{static get NONE(){return m}static get CAPTURING_PHASE(){return R}static get AT_TARGET(){return T}static get BUBBLING_PHASE(){return P}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=null!=t?t:{};w.set(this,{type:String(e),bubbles:Boolean(n.bubbles),cancelable:Boolean(n.cancelable),composed:Boolean(n.composed),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return _(this).type}get target(){return _(this).target}get srcElement(){return _(this).target}get currentTarget(){return _(this).currentTarget}composedPath(){const e=_(this).currentTarget;return e?[e]:[]}get NONE(){return m}get CAPTURING_PHASE(){return R}get AT_TARGET(){return T}get BUBBLING_PHASE(){return P}get eventPhase(){return _(this).dispatchFlag?2:0}stopPropagation(){_(this).stopPropagationFlag=!0}get cancelBubble(){return _(this).stopPropagationFlag}set cancelBubble(e){e?_(this).stopPropagationFlag=!0:p.warn()}stopImmediatePropagation(){const e=_(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return _(this).bubbles}get cancelable(){return _(this).cancelable}get returnValue(){return!_(this).canceledFlag}set returnValue(e){e?g.warn():O(_(this))}preventDefault(){O(_(this))}get defaultPrevented(){return _(this).canceledFlag}get composed(){return _(this).composed}get isTrusted(){return!1}get timeStamp(){return _(this).timeStamp}initEvent(e,t=!1,n=!1){const r=_(this);r.dispatchFlag?u.warn():w.set(this,{...r,type:String(e),bubbles:Boolean(t),cancelable:Boolean(n),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}}const m=0,R=1,T=2,P=3,w=new WeakMap;function _(e,t="this"){const n=w.get(e);return r(null!=n,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),n}function O(e){e.inPassiveListenerFlag?b.warn():e.cancelable?e.canceledFlag=!0:f.warn()}Object.defineProperty(y,"NONE",{enumerable:!0}),Object.defineProperty(y,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(y,"AT_TARGET",{enumerable:!0}),Object.defineProperty(y,"BUBBLING_PHASE",{enumerable:!0});const A=Object.getOwnPropertyNames(y.prototype);for(let e=0;e<A.length;++e)"constructor"!==A[e]&&Object.defineProperty(y.prototype,A[e],{enumerable:!0});let I;void 0!==s&&void 0!==s.Event&&Object.setPrototypeOf(y.prototype,s.Event.prototype);const S={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function N(e){const t=Object.keys(S);for(let n=0;n<t.length;++n){const r=t[n],a=S[r];Object.defineProperty(e,r,{get:()=>a,configurable:!0,enumerable:!0})}}class j extends y{static wrap(e){return new(L(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),B.set(this,{original:e});const t=Object.keys(e);for(let n=0;n<t.length;++n){const r=t[n];r in this||Object.defineProperty(this,r,k(e,r)Line truncated
@@ -0,0 +1 @@
const r=r=>(s,o)=>{if(s.constructor._observers){if(!s.constructor.hasOwnProperty("_observers")){const r=s.constructor._observers;s.constructor._observers=new Map,r.forEach(((r,o)=>s.constructor._observers.set(o,r)))}}else{s.constructor._observers=new Map;const r=s.updated;s.updated=function(s){r.call(this,s),s.forEach(((r,s)=>{const o=this.constructor._observers.get(s);void 0!==o&&o.call(this,this[s],r)}))}}s.constructor._observers.set(o,r)};export{r as o};
@@ -0,0 +1,14 @@
import{_ as e,H as i,e as t,$ as s,n as o}from"./main-bd0f996b.js";import"./c.f6e28485.js";import"./c.1ccf0777.js";import"./c.8e28b461.js";let c=e([o("hacs-progress-dialog")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t()],key:"title",value:void 0},{kind:"field",decorators:[t()],key:"content",value:void 0},{kind:"field",decorators:[t()],key:"confirmText",value:void 0},{kind:"field",decorators:[t()],key:"confirm",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"_inProgress",value:()=>!1},{kind:"method",key:"shouldUpdate",value:function(e){return e.has("active")||e.has("title")||e.has("content")||e.has("confirmText")||e.has("confirm")||e.has("_inProgress")}},{kind:"method",key:"render",value:function(){return this.active?s`
<hacs-dialog .active=${this.active} .hass=${this.hass} title=${this.title||""}>
<div class="content">
${this.content||""}
</div>
<mwc-button slot="secondaryaction" ?disabled=${this._inProgress} @click=${this._close}>
${this.hacs.localize("common.cancel")}
</mwc-button>
<mwc-button slot="primaryaction" @click=${this._confirmed}>
${this._inProgress?s`<ha-circular-progress active size="small"></ha-circular-progress>`:this.confirmText||this.hacs.localize("common.yes")}</mwc-button
>
</mwc-button>
</hacs-dialog>
`:s``}},{kind:"method",key:"_confirmed",value:async function(){this._inProgress=!0,await this.confirm(),this._inProgress=!1,this._close()}},{kind:"method",key:"_close",value:function(){this.active=!1,this.dispatchEvent(new Event("hacs-dialog-closed",{bubbles:!0,composed:!0}))}}]}}),i);export{c as HacsProgressDialog};
@@ -0,0 +1,540 @@
import{P as e,Q as t,b7 as a,a4 as i,$ as r,d as o,eG as n,f as s,e as l,i as d,a3 as c,j as h,k as u,_ as p,t as y,J as m,aa as f,n as b}from"./main-bd0f996b.js";import{v as _,a as v,s as w,u as g,p as k}from"./c.b764d104.js";import{c as D}from"./c.35e839f3.js";import"./c.1ccf0777.js";import"./c.8e28b461.js";import"./c.09c1108b.js";const x=Intl&&Intl.DateTimeFormat,T=[38,33,36],C=[40,34,35],S=new Set([37,...T]),$=new Set([39,...C]),F=new Set([39,...T]),U=new Set([37,...C]),N=new Set([37,39,...T,...C]),M=e(class extends t{constructor(e){super(e),this.tt=new WeakMap}render(e){return[e]}update(e,[t]){if(_(this.it)&&(!_(t)||this.it.strings!==t.strings)){const t=v(e).pop();let r=this.tt.get(this.it.strings);if(void 0===r){const e=document.createDocumentFragment();r=a(i,e),r.setConnected(!1),this.tt.set(this.it.strings,r)}w(r,[t]),g(r,void 0,t)}if(_(t)){if(!_(this.it)||this.it.strings!==t.strings){const a=this.tt.get(t.strings);if(void 0!==a){const t=v(a).pop();k(e),g(e,void 0,t),w(e,[t])}}this.it=t}else this.it=void 0;return this.render(t)}});function E(e,t,a){return new Date(Date.UTC(e,t,a))}const L=r`<svg height="24" viewBox="0 0 24 24" width="24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></svg>`,W=r`<svg height="24" viewBox="0 0 24 24" width="24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></svg>`,Y=o`
button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
position: relative;
display: block;
margin: 0;
padding: 0;
background: none; /** NOTE: IE11 fix */
color: inherit;
border: none;
font: inherit;
text-align: left;
text-transform: inherit;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
`;o`
a {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
position: relative;
display: inline-block;
background: initial;
color: inherit;
font: inherit;
text-transform: inherit;
text-decoration: none;
outline: none;
}
a:focus,
a:focus.page-selected {
text-decoration: underline;
}
`,o`
svg {
display: block;
min-width: var(--svg-icon-min-width, 24px);
min-height: var(--svg-icon-min-height, 24px);
fill: var(--svg-icon-fill, currentColor);
pointer-events: none;
}
`,o`[hidden] { display: none !important; }`;const V=o`
:host {
display: block;
/* --app-datepicker-width: 300px; */
/* --app-datepicker-primary-color: #4285f4; */
/* --app-datepicker-header-height: 80px; */
}
* {
box-sizing: border-box;
}
`;function O(e,t){return+t-+e}function A({hasAltKey:e,keyCode:t,focusedDate:a,selectedDate:i,disabledDaysSet:r,disabledDatesSet:o,minTime:n,maxTime:s}){const l=a.getUTCFullYear(),d=a.getUTCMonth(),c=a.getUTCDate(),h=+a,u=i.getUTCFullYear(),p=i.getUTCMonth();let y=l,m=d,f=c,b=!0;switch((p!==d||u!==l)&&(y=u,m=p,f=1,b=34===t||33===t||35===t),b){case h===n&&S.has(t):case h===s&&$.has(t):break;case 38===t:f-=7;break;case 40===t:f+=7;break;case 37===t:f-=1;break;case 39===t:f+=1;break;case 34===t:e?y+=1:m+=1;break;case 33===t:e?y-=1:m-=1;break;case 35===t:m+=1,f=0;break;default:f=1}if(34===t||33===t){const e=E(y,m+1,0).getUTCDate();f>e&&(f=e)}const _=function({keyCode:e,disabledDaysSet:t,disabledDatesSet:a,focusedDate:i,maxTime:r,minTime:o}){const n=+i;let s=n<o,l=n>r;if(O(o,r)<864e5)return i;let d=s||l||t.has(i.getUTCDay())||a.has(n);if(!d)return i;let c=0,h=s===l?i:new Date(s?o-864e5:864e5+r);const u=h.getUTCFullYear(),p=h.getUTCMonth();let y=h.getUTCDate();for(;d;)(s||!l&&F.has(e))&&(y+=1),(l||!s&&U.has(e))&&(y-=1),h=E(u,p,y),c=+h,s||(s=c<o,s&&(h=new Date(o),c=+h,y=h.getUTCDate())),l||(l=c>r,l&&(h=new Date(r),c=+h,y=h.getUTCDate())),d=t.has(h.getUTCDay())||a.has(c);return h}({keyCode:t,maxTime:s,minTime:n,disabledDaysSet:r,disabledDatesSet:o,focusedDate:E(y,m,f)});return _}function P(e,t,a){return e.dispatchEvent(new CustomEvent(t,{detail:a,bubbles:!0,composed:!0}))}function j(e,t){return e.composedPath().find((e=>e instanceof HTMLElement&&t(e)))}function I(e){return t=>e.format(t).replace(/\u200e/gi,"")}function z(e){const t=x(e,{timeZone:"UTC",weekday:"short",month:"short",day:"numeric"}),a=x(e,{timeZone:"UTC",day:"numeric"}),i=x(e,{timeZone:"UTC",year:"numeric",month:"short",day:"numeric"}),r=x(e,{timeZone:"UTC",year:"numeric",month:"long"}),o=x(e,{timeZone:"UTC",weekday:"long"}),n=x(e,{timeZone:"UTC",weekday:"narrow"}),s=x(e,{timeZone:"UTC",year:"numeric"});return{locale:e,dateFormat:I(t),dayFormat:I(a),fullDateFormat:I(i),longMonthYearFormat:I(r),longWeekdayFormat:I(o),narrowWeekdayFormat:I(n),yearFormat:I(s)}}function K(e,t){const a=function(e,t){const a=t.getUTCFullYear(),i=t.getUTCMonth(),r=t.getUTCDate(),o=t.getUTCDay();let n=o;return"first-4-day-week"===e&&(n=3),"first-day-of-year"===e&&(n=6),"first-full-week"===e&&(n=0),E(a,i,r-o+n)}(e,t),i=E(a.getUTCFullYear(),0,1),r=1+(+a-+i)/864e5;return Math.ceil(r/7)}function B(e){if(e>=0&&e<7)return Math.abs(e);return((e<0?7*Math.ceil(Math.abs(e)):0)+e)%7}function R(e,t,a){const i=B(e-t);return a?1+i:i}function Z(e){const{dayFormat:t,fullDateFormat:a,locale:i,longWeekdayFormat:r,narrowWeekdayFormat:o,selectedDate:n,disabledDates:s,disabledDays:l,firstDayOfWeek:d,max:c,min:h,showWeekNumber:u,weekLabel:p,weekNumberType:y}=e,m=null==h?Number.MIN_SAFE_INTEGER:+h,f=null==c?Number.MAX_SAFE_INTEGER:+c,b=function(e){const{firstDayOfWeek:t=0,showWeekNumber:a=!1,weekLabel:i,longWeekdayFormat:r,narrowWeekdayFormat:o}=e||{},n=1+(t+(t<0?7:0))%7,s=i||"Wk",l=a?[{label:"Wk"===s?"Week":s,value:s}]:[],d=Array.from(Array(7)).reduce(((e,t,a)=>{const i=E(2017,0,n+a);return e.push({label:r(i),value:o(i)}),e}),l);return d}({longWeekdayFormat:r,narrowWeekdayFormat:o,firstDayOfWeek:d,showWeekNumber:u,weekLabel:p}),_=e=>[i,e.toJSON(),null==s?void 0:s.join("_"),null==l?void 0:l.join("_"),d,null==c?void 0:c.toJSON(),null==h?void 0:h.toJSON(),u,p,y].filter(Boolean).join(":"),v=n.getUTCFullYear(),w=n.getUTCMonth(),g=[-1,0,1].map((e=>{const r=E(v,w+e,1),o=+E(v,w+e+1,0),n=_(r);if(o<m||+r>f)return{key:n,calendar:[],disabledDatesSet:new Set,disabledDaysSet:new Set};const b=function(e){const{date:t,dayFormat:a,disabledDates:i=[],disabledDays:r=[],firstDayOfWeek:o=0,fullDateFormat:n,locale:s="en-US",max:l,min:d,showWeekNumber:c=!1,weekLabel:h="Week",weekNumberType:u="first-4-day-week"}=e||{},p=B(o),y=t.getUTCFullYear(),m=t.getUTCMonth(),f=E(y,m,1),b=new Set(r.map((e=>R(e,p,c)))),_=new Set(i.map((e=>+e))),v=[f.toJSON(),p,s,null==l?"":l.toJSON(),null==d?"":d.toJSON(),Array.from(b).join(","),Array.from(_).join(","),u].filter(Boolean).join(":"),w=R(f.getUTCDay(),p,c),g=null==d?+new Date("2000-01-01"):+d,k=null==l?+new Date("2100-12-31"):+l,D=c?8:7,x=E(y,1+m,0).getUTCDate(),T=[];let C=[],S=!1,$=1;for(const e of[0,1,2,3,4,5]){for(const t of[0,1,2,3,4,5,6].concat(7===D?[]:[7])){const i=t+e*D;if(!S&&c&&0===t){const t=K(u,E(y,m,$-(e<1?p:0))),a=`${h} ${t}`;C.push({fullDate:null,label:a,value:`${t}`,key:`${v}:${a}`,disabled:!0});continue}if(S||i<w){C.push({fullDate:null,label:"",value:"",key:`${v}:${i}`,disabled:!0});continue}const r=E(y,m,$),o=+r,s=b.has(t)||_.has(o)||o<g||o>k;s&&_.add(o),C.push({fullDate:r,label:n(r),value:a(r),key:`${v}:${r.toJSON()}`,disabled:s}),$+=1,$>x&&(S=!0)}T.push(C),C=[]}return{disabledDatesSet:_,calendar:T,disabledDaysSet:new Set(r.map((e=>B(e)))),key:v}}({dayFormat:t,fullDateFormat:a,locale:i,disabledDates:s,disabledDays:l,firstDayOfWeek:d,max:c,min:h,showWeekNumber:u,weekLabel:p,weekNumberType:y,date:r});return{...b,key:n}})),k=[],D=new Set,x=new Set;for(const e of g){const{ Line truncated
${t}
<div class="datepicker-body" part="body">${M(e)}</div>
`}firstUpdated(){let e;e="calendar"===this._startView?this.inline?this.shadowRoot.querySelector(".btn__month-selector"):this._buttonSelectorYear:this._yearViewListItem,P(this,"datepicker-first-updated",{firstFocusableElement:e,value:this.value})}async updated(e){const t=this._startView;if(e.has("min")||e.has("max")){this._yearList=te(this._min,this._max),"yearList"===t&&this.requestUpdate();const e=+this._min,a=+this._max;if(O(e,a)>864e5){const t=+this._focusedDate;let i=t;t<e&&(i=e),t>a&&(i=a),this.value=ee(new Date(i))}}if(e.has("_startView")||e.has("startView")){if("yearList"===t){const e=48*(this._selectedDate.getUTCFullYear()-this._min.getUTCFullYear()-2);!function(e,t){if(null==e.scrollTo){const{top:a,left:i}=t||{};e.scrollTop=a||0,e.scrollLeft=i||0}else e.scrollTo(t)}(this._yearViewFullList,{top:e,left:0})}if("calendar"===t&&null==this._tracker){const e=this.calendarsContainer;let t=!1,a=!1,i=!1;if(e){const r={down:()=>{i||(t=!0,this._dx=0)},move:(r,o)=>{if(i||!t)return;const n=this._dx,s=n<0&&J(e,"has-max-date")||n>0&&J(e,"has-min-date");!s&&Math.abs(n)>0&&t&&(a=!0,e.style.transform=`translateX(${G(n)}px)`),this._dx=s?0:n+(r.x-o.x)},up:async(r,o,n)=>{if(t&&a){const r=this._dx,o=e.getBoundingClientRect().width/3,n=Math.abs(r)>Number(this.dragRatio)*o,s=350,l="cubic-bezier(0, 0, .4, 1)",d=n?G(o*(r<0?-1:1)):0;i=!0,await async function(e,t){const{hasNativeWebAnimation:a=!1,keyframes:i=[],options:r={duration:100}}=t||{};if(Array.isArray(i)&&i.length)return new Promise((t=>{if(a)e.animate(i,r).onfinish=()=>t();else{const[,a]=i||[],o=()=>{e.removeEventListener("transitionend",o),t()};e.addEventListener("transitionend",o),e.style.transitionDuration=`${r.duration}ms`,r.easing&&(e.style.transitionTimingFunction=r.easing),Object.keys(a).forEach((t=>{t&&(e.style[t]=a[t])}))}}))}(e,{hasNativeWebAnimation:this._hasNativeWebAnimation,keyframes:[{transform:`translateX(${r}px)`},{transform:`translateX(${d}px)`}],options:{duration:s,easing:l}}),n&&this._updateMonth(r<0?"next":"previous").handleEvent(),t=a=i=!1,this._dx=-1/0,e.removeAttribute("style"),P(this,"datepicker-animation-finished")}else t&&(this._updateFocusedDate(n),t=a=!1,this._dx=-1/0)}};this._tracker=new ne(e,r)}}e.get("_startView")&&"calendar"===t&&this._focusElement('[part="year-selector"]')}this._updatingDateWithKey&&(this._focusElement('[part="calendars"]:nth-of-type(2) .day--focused'),this._updatingDateWithKey=!1)}_focusElement(e){const t=this.shadowRoot.querySelector(e);t&&t.focus()}_renderHeaderSelectorButton(){const{yearFormat:e,dateFormat:t}=this._formatters,a="calendar"===this.startView,i=this._focusedDate,o=t(i),n=e(i);return r`
<button
class="${u({"btn__year-selector":!0,selected:!a})}"
type="button"
part="year-selector"
data-view="${"yearList"}"
@click="${this._updateView("yearList")}">${n}</button>
<div class="datepicker-toolbar" part="toolbar">
<button
class="${u({"btn__calendar-selector":!0,selected:a})}"
type="button"
part="calendar-selector"
data-view="${"calendar"}"
@click="${this._updateView("calendar")}">${o}</button>
</div>
`}_renderDatepickerYearList(){const{yearFormat:e}=this._formatters,t=this._focusedDate.getUTCFullYear();return r`
<div class="datepicker-body__year-list-view" part="year-list-view">
<div class="year-list-view__full-list" part="year-list" @click="${this._updateYear}">
${this._yearList.map((a=>r`<button
class="${u({"year-list-view__list-item":!0,"year--selected":t===a})}"
type="button"
part="year"
.year="${a}">${e(E(a,0,1))}</button>`))}</div>
</div>
`}_renderDatepickerCalendar(){const{longMonthYearFormat:e,dayFormat:t,fullDateFormat:a,longWeekdayFormat:i,narrowWeekdayFormat:o}=this._formatters,n=Q(this.disabledDays,Number),s=Q(this.disabledDates,q),l=this.showWeekNumber,d=this._focusedDate,c=this.firstDayOfWeek,h=q(),p=this._selectedDate,y=this._max,m=this._min,{calendars:f,disabledDaysSet:b,disabledDatesSet:_,weekdays:v}=Z({dayFormat:t,fullDateFormat:a,longWeekdayFormat:i,narrowWeekdayFormat:o,firstDayOfWeek:c,disabledDays:n,disabledDates:s,locale:this.locale,selectedDate:p,showWeekNumber:this.showWeekNumber,weekNumberType:this.weekNumberType,max:y,min:m,weekLabel:this.weekLabel}),w=!f[0].calendar.length,g=!f[2].calendar.length,k=v.map((e=>r`<th
class="calendar-weekday"
part="calendar-weekday"
role="columnheader"
aria-label="${e.label}"
>
<div class="weekday" part="weekday">${e.value}</div>
</th>`)),x=D(f,(e=>e.key),(({calendar:t},a)=>{if(!t.length)return r`<div class="calendar-container" part="calendar"></div>`;const i=`calendarcaption${a}`,o=t[1][1].fullDate,n=1===a,s=n&&!this._isInVisibleMonth(d,p)?A({disabledDaysSet:b,disabledDatesSet:_,hasAltKey:!1,keyCode:36,focusedDate:d,selectedDate:p,minTime:+m,maxTime:+y}):d;return r`
<div class="calendar-container" part="calendar">
<table class="calendar-table" part="table" role="grid" aria-labelledby="${i}">
<caption id="${i}">
<div class="calendar-label" part="label">${o?e(o):""}</div>
</caption>
<thead role="rowgroup">
<tr class="calendar-weekdays" part="weekdays" role="row">${k}</tr>
</thead>
<tbody role="rowgroup">${t.map((e=>r`<tr role="row">${e.map(((e,t)=>{const{disabled:a,fullDate:i,label:o,value:c}=e;if(!i&&c&&l&&t<1)return r`<th
class="full-calendar__day weekday-label"
part="calendar-day"
scope="row"
role="rowheader"
abbr="${o}"
aria-label="${o}"
>${c}</th>`;if(!c||!i)return r`<td class="full-calendar__day day--empty" part="calendar-day"></td>`;const p=+new Date(i),y=+d===p,m=n&&s.getUTCDate()===Number(c);return r`
<td
tabindex="${m?"0":"-1"}"
class="${u({"full-calendar__day":!0,"day--disabled":a,"day--today":+h===p,"day--focused":!a&&y})}"
part="calendar-day"
role="gridcell"
aria-disabled="${a?"true":"false"}"
aria-label="${o}"
aria-selected="${y?"true":"false"}"
.fullDate="${i}"
.day="${c}"
>
<div class="calendar-day" part="day">${c}</div>
</td>
`}))}</tr>`))}</tbody>
</table>
</div>
`}));return this._disabledDatesSet=_,this._disabledDaysSet=b,r`
<div class="datepicker-body__calendar-view" part="calendar-view">
<div class="calendar-view__month-selector" part="month-selectors">
<div class="month-selector-container">${w?null:r`
<button
class="btn__month-selector"
type="button"
part="month-selector"
aria-label="Previous month"
@click="${this._updateMonth("previous")}"
>${L}</button>
`}</div>
<div class="month-selector-container">${g?null:r`
<button
class="btn__month-selector"
type="button"
part="month-selector"
aria-label="Next month"
@click="${this._updateMonth("next")}"
>${W}</button>
`}</div>
</div>
<div
class="${u({"calendars-container":!0,"has-min-date":w,"has-max-date":g})}"
part="calendars"
@keyup="${this._updateFocusedDateWithKeyboard}"
>${x}</div>
</div>
`}_updateView(e){return H((()=>{"calendar"===e&&(this._selectedDate=this._lastSelectedDate=new Date(ae(this._focusedDate,this._min,this._max))),this._startView=e}))}_updateMonth(e){return H((()=>{if(null==this.calendarsContainer)return this.updateComplete;const t=this._lastSelectedDate||this._selectedDate,a=this._min,i=this._max,r="previous"===e,o=E(t.getUTCFullYear(),t.getUTCMonth()+(r?-1:1),1),n=o.getUTCFullYear(),s=o.getUTCMonth(),l=a.getUTCFullYear(),d=a.getUTCMonth(),c=i.getUTCFullYear(),h=i.getUTCMonth();return n<l||n<=l&&s<d||(n>c||n>=c&&s>h)||(this._lastSelectedDate=o,this._selectedDate=this._lastSelectedDate),this.updateComplete}))}_updateYear(e){const t=j(e,(e=>J(e,"year-list-view__list-item")));if(null==t)return;const a=ae(new Date(this._focusedDate).setUTCFullYear(+t.year),this._min,this._max);this._selectedDate=this._lastSelectedDate=new Date(a),this._focusedDate=new Date(a),this._startView="calendar"}_updateFocusedDate(e){const t=j(e,(e=>J(e,"full-calendar__day")));null==t||["day--empty","day--disabled","day--focused","weekday-label"].some((e=>J(t,e)))||(this._focusedDate=new Date(t.fullDate),P(this,"datepicker-value-updated",{isKeypress:!1,value:this.value}))}_updateFocusedDateWithKeyboard(e){const t=e.keyCode;if(13===t||32===t)return P(this,"datepicker-value-updated",{keyCode:t,isKeypress:!0,value:this.value}),void(this._focusedDate=new Date(this._selectedDate));if(9===t||!N.has(t))return;const a=this._selectedDate,i=A({keyCode:t,selectedDate:a,disabledDatesSet:this._disabledDatesSet,disabledDaysSet:this._disabledDaysSet,focusedDate:this._focusedDate,hasAltKey:e.altKey,maxTime:+this._max,minTime:+this._min});this._isInVisibleMonth(i,a)||(this._selectedDate=this._lastSelectedDate=i),this._focusedDate=i,this._updatingDateWithKey=!0,P(this,"datepicker-value-updated",{keyCode:t,isKeypress:!0,value:this.value})}_isInVisibleMonth(e,t){const a=e.getUTCFullYear(),i=e.getUTCMonth(),r=t.getUTCFullYear(),o=t.getUTCMonth();return a===r&&i===o}get calendarsContainer(){return this.shadowRoot.querySelector(".calendars-container")}}var le,de;se.styles=[V,Y,o`
:host {
width: 312px;
/** NOTE: Magic number as 16:9 aspect ratio does not look good */
/* height: calc((var(--app-datepicker-width) / .66) - var(--app-datepicker-footer-height, 56px)); */
background-color: var(--app-datepicker-bg-color, #fff);
color: var(--app-datepicker-color, #000);
border-radius:
var(--app-datepicker-border-top-left-radius, 0)
var(--app-datepicker-border-top-right-radius, 0)
var(--app-datepicker-border-bottom-right-radius, 0)
var(--app-datepicker-border-bottom-left-radius, 0);
contain: content;
overflow: hidden;
}
:host([landscape]) {
display: flex;
/** <iphone-5-landscape-width> - <standard-side-margin-width> */
min-width: calc(568px - 16px * 2);
width: calc(568px - 16px * 2);
}
.datepicker-header + .datepicker-body {
border-top: 1px solid var(--app-datepicker-separator-color, #ddd);
}
:host([landscape]) > .datepicker-header + .datepicker-body {
border-top: none;
border-left: 1px solid var(--app-datepicker-separator-color, #ddd);
}
.datepicker-header {
display: flex;
flex-direction: column;
align-items: flex-start;
position: relative;
padding: 16px 24px;
}
:host([landscape]) > .datepicker-header {
/** :this.<one-liner-month-day-width> + :this.<side-padding-width> */
min-width: calc(14ch + 24px * 2);
}
.btn__year-selector,
.btn__calendar-selector {
color: var(--app-datepicker-selector-color, rgba(0, 0, 0, .55));
cursor: pointer;
/* outline: none; */
}
.btn__year-selector.selected,
.btn__calendar-selector.selected {
color: currentColor;
}
/**
* NOTE: IE11-only fix. This prevents formatted focused date from overflowing the container.
*/
.datepicker-toolbar {
width: 100%;
}
.btn__year-selector {
font-size: 16px;
font-weight: 700;
}
.btn__calendar-selector {
font-size: 36px;
font-weight: 700;
line-height: 1;
}
.datepicker-body {
position: relative;
width: 100%;
overflow: hidden;
}
.datepicker-body__calendar-view {
min-height: 56px;
}
.calendar-view__month-selector {
display: flex;
align-items: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
padding: 0 8px;
z-index: 1;
}
.month-selector-container {
max-height: 56px;
height: 100%;
}
.month-selector-container + .month-selector-container {
margin: 0 0 0 auto;
}
.btn__month-selector {
padding: calc((56px - 24px) / 2);
/**
* NOTE: button element contains no text, only SVG.
* No extra height will incur with such setting.
*/
line-height: 0;
}
.btn__month-selector > svg {
fill: currentColor;
}
.calendars-container {
display: flex;
justify-content: center;
position: relative;
top: 0;
left: calc(-100%);
width: calc(100% * 3);
transform: translateZ(0);
will-change: transform;
/**
* NOTE: Required for Pointer Events API to work on touch devices.
* Native \`pan-y\` action will be fired by the browsers since we only care about the
* horizontal direction. This is great as vertical scrolling still works even when touch
* event happens on a datepicker's calendar.
*/
touch-action: pan-y;
/* outline: none; */
}
.year-list-view__full-list {
max-height: calc(48px * 7);
overflow-y: auto;
scrollbar-color: var(--app-datepicker-scrollbar-thumb-bg-color, rgba(0, 0, 0, .35)) rgba(0, 0, 0, 0);
scrollbar-width: thin;
}
.year-list-view__full-list::-webkit-scrollbar {
width: 8px;
background-color: rgba(0, 0, 0, 0);
}
.year-list-view__full-list::-webkit-scrollbar-thumb {
background-color: var(--app-datepicker-scrollbar-thumb-bg-color, rgba(0, 0, 0, .35));
border-radius: 50px;
}
.year-list-view__full-list::-webkit-scrollbar-thumb:hover {
background-color: var(--app-datepicker-scrollbar-thumb-hover-bg-color, rgba(0, 0, 0, .5));
}
.calendar-weekdays > th,
.weekday-label {
color: var(--app-datepicker-weekday-color, rgba(0, 0, 0, .55));
font-weight: 400;
transform: translateZ(0);
will-change: transform;
}
.calendar-container,
.calendar-label,
.calendar-table {
width: 100%;
}
.calendar-container {
position: relative;
padding: 0 16px 16px;
}
.calendar-table {
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
border-collapse: collapse;
border-spacing: 0;
text-align: center;
}
.calendar-label {
display: flex;
align-items: center;
justify-content: center;
height: 56px;
font-weight: 500;
text-align: center;
}
.calendar-weekday,
.full-calendar__day {
position: relative;
width: calc(100% / 7);
height: 0;
padding: calc(100% / 7 / 2) 0;
outline: none;
text-align: center;
}
.full-calendar__day:not(.day--disabled):focus {
outline: #000 dotted 1px;
outline: -webkit-focus-ring-color auto 1px;
}
:host([showweeknumber]) .calendar-weekday,
:host([showweeknumber]) .full-calendar__day {
width: calc(100% / 8);
padding-top: calc(100% / 8);
padding-bottom: 0;
}
:host([showweeknumber]) th.weekday-label {
padding: 0;
}
/**
* NOTE: Interesting fact! That is ::after will trigger paint when dragging. This will trigger
* layout and paint on **ONLY** affected nodes. This is much cheaper as compared to rendering
* all :::after of all calendar day elements. When dragging the entire calendar container,
* because of all layout and paint trigger on each and every ::after, this becomes a expensive
* task for the browsers especially on low-end devices. Even though animating opacity is much
* cheaper, the technique does not work here. Adding 'will-change' will further reduce overall
* painting at the expense of memory consumption as many cells in a table has been promoted
* a its own layer.
*/
.full-calendar__day:not(.day--empty):not(.day--disabled):not(.weekday-label) {
transform: translateZ(0);
will-change: transform;
}
.full-calendar__day:not(.day--empty):not(.day--disabled):not(.weekday-label).day--focused::after,
.full-calendar__day:not(.day--empty):not(.day--disabled):not(.day--focused):not(.weekday-label):hover::after {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--app-datepicker-accent-color, #1a73e8);
border-radius: 50%;
opacity: 0;
pointer-events: none;
}
.full-calendar__day:not(.day--empty):not(.day--disabled):not(.weekday-label) {
cursor: pointer;
pointer-events: auto;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.full-calendar__day.day--focused:not(.day--empty):not(.day--disabled):not(.weekday-label)::after,
.full-calendar__day.day--today.day--focused:not(.day--empty):not(.day--disabled):not(.weekday-label)::after {
opacity: 1;
}
.calendar-weekday > .weekday,
.full-calendar__day > .calendar-day {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 5%;
left: 5%;
width: 90%;
height: 90%;
color: currentColor;
font-size: 14px;
pointer-events: none;
z-index: 1;
}
.full-calendar__day.day--today {
color: var(--app-datepicker-accent-color, #1a73e8);
}
.full-calendar__day.day--focused,
.full-calendar__day.day--today.day--focused {
color: var(--app-datepicker-focused-day-color, #fff);
}
.full-calendar__day.day--empty,
.full-calendar__day.weekday-label,
.full-calendar__day.day--disabled > .calendar-day {
pointer-events: none;
}
.full-calendar__day.day--disabled:not(.day--today) {
color: var(--app-datepicker-disabled-day-color, rgba(0, 0, 0, .55));
}
.year-list-view__list-item {
position: relative;
width: 100%;
padding: 12px 16px;
text-align: center;
/** NOTE: Reduce paint when hovering and scrolling, but this increases memory usage */
/* will-change: opacity; */
/* outline: none; */
}
.year-list-view__list-item::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--app-datepicker-focused-year-bg-color, #000);
opacity: 0;
pointer-events: none;
}
.year-list-view__list-item:focus::after {
opacity: .05;
}
.year-list-view__list-item.year--selected {
color: var(--app-datepicker-accent-color, #1a73e8);
font-size: 24px;
font-weight: 500;
}
@media (any-hover: hover) {
.btn__month-selector:hover,
.year-list-view__list-item:hover {
cursor: pointer;
}
.full-calendar__day:not(.day--empty):not(.day--disabled):not(.day--focused):not(.weekday-label):hover::after {
opacity: .15;
}
.year-list-view__list-item:hover::after {
opacity: .05;
}
}
@supports (background: -webkit-canvas(squares)) {
.calendar-container {
padding: 56px 16px 16px;
}
table > caption {
position: absolute;
top: 0;
left: 50%;
transform: translate3d(-50%, 0, 0);
will-change: transform;
}
}
`],s([l({type:Number,reflect:!0})],se.prototype,"firstDayOfWeek",void 0),s([l({type:Boolean,reflect:!0})],se.prototype,"showWeekNumber",void 0),s([l({type:String,reflect:!0})],se.prototype,"weekNumberType",void 0),s([l({type:Boolean,reflect:!0})],se.prototype,"landscape",void 0),s([l({type:String,reflect:!0})],se.prototype,"startView",null),s([l({type:String,reflect:!0})],se.prototype,"min",null),s([l({type:String,reflect:!0})],se.prototype,"max",null),s([l({type:String})],se.prototype,"value",null),s([l({type:String})],se.prototype,"locale",void 0),s([l({type:String})],se.prototype,"disabledDays",void 0),s([l({type:String})],se.prototype,"disabledDates",void 0),s([l({type:String})],se.prototype,"weekLabel",void 0),s([l({type:Boolean})],se.prototype,"inline",void 0),s([l({type:Number})],se.prototype,"dragRatio",void 0),s([l({type:Date,attribute:!1})],se.prototype,"_selectedDate",void 0),s([l({type:Date,attribute:!1})],se.prototype,"_focusedDate",void 0),s([l({type:String,attribute:!1})],se.prototype,"_startView",void 0),s([d(".year-list-view__full-list")],se.prototype,"_yearViewFullList",void 0),s([d(".btn__year-selector")],se.prototype,"_buttonSelectorYear",void 0),s([d(".year-list-view__list-item")],se.prototype,"_yearViewListItem",void 0),s([c({passive:!0})],se.prototype,"_updateYear",null),s([c({passive:!0})],se.prototype,"_updateFocusedDateWithKeyboard",null),le="app-datepicker",de=se,window.customElements&&!window.customElements.get(le)&&window.customElements.define(le,de);let ce=p([b("ha-dialog-date-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[l()],key:"value",value:void 0},{kind:"field",decorators:[l({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[l()],key:"label",value:void 0},{kind:"field",decorators:[y()],key:"_params",value:void 0},{kind:"field",decorators:[y()],key:"_value",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._params=e,this._value=e.value}},{kind:"method",key:"closeDialog",value:function(){this._params=void 0,m(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){return this._params?r`<ha-dialog open @closed=${this.closeDialog}>
<app-datepicker
.value=${this._value}
.min=${this._params.min}
.max=${this._params.max}
.locale=${this._params.locale}
@datepicker-value-updated=${this._valueChanged}
></app-datepicker>
<mwc-button slot="secondaryAction" @click=${this._setToday}
>today</mwc-button
>
<mwc-button slot="primaryAction" dialogaction="cancel" class="cancel-btn">
cancel
</mwc-button>
<mwc-button slot="primaryAction" @click=${this._setValue}>ok</mwc-button>
</ha-dialog>`:r``}},{kind:"method",key:"_valueChanged",value:function(e){this._value=e.detail.value}},{kind:"method",key:"_setToday",value:function(){this._value=(new Date).toISOString().split("T")[0]}},{kind:"method",key:"_setValue",value:function(){var e;null===(e=this._params)||void 0===e||e.onChange(this._value),this.closeDialog()}},{kind:"field",static:!0,key:"styles",value:()=>[f,o`
ha-dialog {
--dialog-content-padding: 0;
--justify-action-buttons: space-between;
}
app-datepicker {
--app-datepicker-accent-color: var(--primary-color);
--app-datepicker-bg-color: transparent;
--app-datepicker-color: var(--primary-text-color);
--app-datepicker-disabled-day-color: var(--disabled-text-color);
--app-datepicker-focused-day-color: var(--text-primary-color);
--app-datepicker-focused-year-bg-color: var(--primary-color);
--app-datepicker-selector-color: var(--secondary-text-color);
--app-datepicker-separator-color: var(--divider-color);
--app-datepicker-weekday-color: var(--secondary-text-color);
}
app-datepicker::part(calendar-day):focus {
outline: none;
}
@media all and (min-width: 450px) {
ha-dialog {
--mdc-dialog-min-width: 300px;
}
}
@media all and (max-width: 450px), all and (max-height: 500px) {
app-datepicker {
width: 100%;
}
}
`]}]}}),h);export{ce as HaDialogDatePicker};
@@ -0,0 +1 @@
import{c as t,a as i}from"./c.743a15a1.js";var e=t((function(t,i){!function(t){var i="1.9.2";function e(t){var i,e,n,o;for(e=1,n=arguments.length;e<n;e++)for(i in o=arguments[e])t[i]=o[i];return t}var n=Object.create||function(){function t(){}return function(i){return t.prototype=i,new t}}();function o(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}var s=0;function r(t){return"_leaflet_id"in t||(t._leaflet_id=++s),t._leaflet_id}function a(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)},s}function h(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function l(){return!1}function u(t,i){if(!1===i)return t;var e=Math.pow(10,void 0===i?6:i);return Math.round(t*e)/e}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return c(t).split(/\s+/)}function _(t,i){for(var e in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?n(t.options):{}),i)t.options[e]=i[e];return t.options}function p(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function f(t,i){return t.replace(m,(function(t,e){var n=i[e];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(i)),n}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}var y="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function b(t){var i=+new Date,e=Math.max(0,16-(i-w));return w=i+e,window.setTimeout(t,e)}var P=window.requestAnimationFrame||x("RequestAnimationFrame")||b,T=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function M(t,i,e){if(!e||P!==b)return P.call(window,o(t,i));t.call(i)}function z(t){t&&T.call(window,t)}var C={__proto__:null,extend:e,create:n,bind:o,get lastId(){return s},stamp:r,throttle:a,wrapNum:h,falseFn:l,formatNum:u,trim:c,splitWords:d,setOptions:_,getParamString:p,template:f,isArray:g,indexOf:v,emptyImageUrl:y,requestFn:P,cancelFn:T,requestAnimFrame:M,cancelAnimFrame:z};function Z(){}function S(t){if("undefined"!=typeof L&&L&&L.Mixin){t=g(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}Z.extend=function(t){var i=function(){_(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=i.__super__=this.prototype,s=n(o);for(var r in s.constructor=i,i.prototype=s,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(i[r]=this[r]);return t.statics&&e(i,t.statics),t.includes&&(S(t.includes),e.apply(null,[s].concat(t.includes))),e(s,t),delete s.statics,delete s.includes,s.options&&(s.options=o.options?n(o.options):{},e(s.options,t.options)),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,i=s._initHooks.length;t<i;t++)s._initHooks[t].call(this)}},i},Z.include=function(t){var i=this.prototype.options;return e(this.prototype,t),t.options&&(this.prototype.options=i,this.mergeOptions(t.options)),this},Z.mergeOptions=function(t){return e(this.prototype.options,t),this},Z.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),e="function"==typeof t?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(e),this};var E={on:function(t,i,e){if("object"==typeof t)for(var n in t)this._on(n,t[n],i);else for(var o=0,s=(t=d(t)).length;o<s;o++)this._on(t[o],i,e);return this},off:function(t,i,e){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],i);else{t=d(t);for(var o=1===arguments.length,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],i,e)}else delete this._events;return this},_on:function(t,i,e,n){if("function"==typeof i){if(!1===this._listens(t,i,e)){e===this&&(e=void 0);var o={fn:i,ctx:e};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}}else console.warn("wrong listener type: "+typeof i)},_off:function(t,i,e){var n,o,s;if(this._events&&(n=this._events[t]))if(1!==arguments.length)if("function"==typeof i){var r=this._listens(t,i,e);if(!1!==r){var a=n[r];this._firingCount&&(a.fn=l,this._events[t]=n=n.slice()),n.splice(r,1)}}else console.warn("wrong listener type: "+typeof i);else{if(this._firingCount)for(o=0,sLine truncated
@@ -0,0 +1 @@
import{c as e,u as t}from"./c.743a15a1.js";import{eL as a}from"./main-bd0f996b.js";import{l}from"./c.b2e63d8e.js";import{l as r}from"./c.d1feaea4.js";import"./c.eef9df6a.js";import"./c.b764d104.js";import"./c.8e28b461.js";import"./c.09c1108b.js";import"./c.35e839f3.js";import"./c.7692ecb7.js";import"./c.edefd651.js";import"./c.f2bb3724.js";import"./c.23be34f7.js";import"./c.9e27c745.js";var i=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.InitializePluralRules=void 0,t.InitializePluralRules=function(e,t,a,i){var o=i.availableLocales,n=i.relevantExtensionKeys,s=i.localeData,u=i.getDefaultLocale,c=i.getInternalSlots,f=(0,l.CanonicalizeLocaleList)(t),d=Object.create(null),p=(0,l.CoerceOptionsToObject)(a),b=c(e);b.initializedPluralRules=!0;var m=(0,l.GetOption)(p,"localeMatcher","string",["best fit","lookup"],"best fit");d.localeMatcher=m,b.type=(0,l.GetOption)(p,"type","string",["cardinal","ordinal"],"cardinal"),(0,l.SetNumberFormatDigitOptions)(b,p,0,3,"standard");var v=(0,r.ResolveLocale)(o,f,d,n,s,u);return b.locale=v.locale,e}}));t(i),i.InitializePluralRules;var o=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GetOperands=void 0,t.GetOperands=function(e){(0,l.invariant)("string"==typeof e,"GetOperands should have been called with a string");var t=(0,l.ToNumber)(e);(0,l.invariant)(isFinite(t),"n should be finite");var a,r,i,o=e.indexOf("."),n="";-1===o?(a=t,r=0,i=0):(a=e.slice(0,o),n=e.slice(o,e.length),r=(0,l.ToNumber)(n),i=n.length);var s,u,c=Math.abs((0,l.ToNumber)(a));if(0!==r){var f=n.replace(/0+$/,"");s=f.length,u=(0,l.ToNumber)(f)}else s=0,u=0;return{Number:t,IntegerDigits:c,NumberOfFractionDigits:i,NumberOfFractionDigitsWithoutTrailing:s,FractionDigits:r,FractionDigitsWithoutTrailing:u}}}));t(o),o.GetOperands;var n=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ResolvePlural=void 0,t.ResolvePlural=function(e,t,a){var r=a.getInternalSlots,i=a.PluralRuleSelect,n=r(e);if((0,l.invariant)("Object"===(0,l.Type)(n),"pl has to be an object"),(0,l.invariant)("initializedPluralRules"in n,"pluralrules must be initialized"),(0,l.invariant)("Number"===(0,l.Type)(t),"n must be a number"),!isFinite(t))return"other";var s=n.locale,u=n.type,c=(0,l.FormatNumericToString)(n,t).formattedString;return i(s,u,t,(0,o.GetOperands)(c))}}));t(n),n.ResolvePlural;var s=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var a=new WeakMap;t.default=function(e){var t=a.get(e);return t||(t=Object.create(null),a.set(e,t)),t}}));t(s);var u=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PluralRules=void 0;var r=(0,a.__importDefault)(s);function o(e,t){if(!(e instanceof c))throw new TypeError("Method Intl.PluralRules.prototype.".concat(t," called on incompatible receiver ").concat(String(e)))}function u(e,t,a,l){var r=l.IntegerDigits,i=l.NumberOfFractionDigits,o=l.FractionDigits;return c.localeData[e].fn(i?"".concat(r,".").concat(o):r,"ordinal"===t)}var c=function(){function e(t,a){if(!(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Intl.PluralRules must be called with 'new'");return(0,i.InitializePluralRules)(this,t,a,{availableLocales:e.availableLocales,relevantExtensionKeys:e.relevantExtensionKeys,localeData:e.localeData,getDefaultLocale:e.getDefaultLocale,getInternalSlots:r.default})}return e.prototype.resolvedOptions=function(){o(this,"resolvedOptions");var t=Object.create(null),l=(0,r.default)(this);return t.locale=l.locale,t.type=l.type,["minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"].forEach((function(e){var a=l[e];void 0!==a&&(t[e]=a)})),t.pluralCategories=(0,a.__spreadArray)([],e.localeData[t.locale].categories[t.type],!0),t},e.prototype.select=function(e){o(this,"select");var t=(0,l.ToNumber)(e);return(0,n.ResolvePlural)(this,t,{getInternalSlots:r.default,PluralRuleSelect:u})},e.prototype.toString=function(){return"[object Intl.PluralRules]"},e.supportedLocalesOf=function(t,a){return(0,l.SupportedLocales)(e.availableLocales,(0,l.CanonicalizeLocaleList)(t),a)},e.__addLocaleData=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];for(var l=0,r=t;l<r.length;l++){var i=r[l],o=i.data,n=i.locale;e.localeData[n]=o,e.availableLocales.add(n),e.__defaultLocale||(e.__defaultLocale=n)}},e.getDefaultLocale=function(){return e.__defaultLocale},e.localeData={},e.availableLocales=new Set,e.__defaultLocale="",e.relevantExtensionKeys=[],e.polyfilled=!0,e}();t.PluralRules=c;try{"undefined"!=typeof Symbol&&Object.defineProperty(c.prototype,Symbol.toStringTag,{value:"Intl.PluralRules",writable:!1,enumerable:!1,configurable:!0});try{Object.defineProperty(c,"length",{value:0,writable:!1,enumerable:!1,configurable:!0})}catch(e){}Object.defineProperty(c.prototype.constructor,"length",{value:0,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(c.supportedLocalesOf,"length",{value:1,writable:!1,enumerable:!1,configurable:!Line truncated
@@ -0,0 +1,94 @@
import{V as e,W as t,_ as o,j as i,e as n,$ as r,d as a,n as l}from"./main-bd0f996b.js";e({_template:t`
<style>
:host {
overflow: hidden; /* needed for text-overflow: ellipsis to work on ff */
@apply --layout-vertical;
@apply --layout-center-justified;
@apply --layout-flex;
}
:host([two-line]) {
min-height: var(--paper-item-body-two-line-min-height, 72px);
}
:host([three-line]) {
min-height: var(--paper-item-body-three-line-min-height, 88px);
}
:host > ::slotted(*) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
:host > ::slotted([secondary]) {
@apply --paper-font-body1;
color: var(--paper-item-body-secondary-color, var(--secondary-text-color));
@apply --paper-item-body-secondary;
}
</style>
<slot></slot>
`,is:"paper-item-body"}),o([l("ha-settings-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[n({type:Boolean,reflect:!0})],key:"narrow",value:void 0},{kind:"field",decorators:[n({type:Boolean,attribute:"three-line"})],key:"threeLine",value:()=>!1},{kind:"method",key:"render",value:function(){return r`
<div class="prefix-wrap">
<slot name="prefix"></slot>
<paper-item-body
?two-line=${!this.threeLine}
?three-line=${this.threeLine}
>
<slot name="heading"></slot>
<div secondary><slot name="description"></slot></div>
</paper-item-body>
</div>
<div class="content"><slot></slot></div>
`}},{kind:"get",static:!0,key:"styles",value:function(){return a`
:host {
display: flex;
padding: 0 16px;
align-content: normal;
align-self: auto;
align-items: center;
}
paper-item-body {
padding: 8px 16px 8px 0;
}
paper-item-body[two-line] {
min-height: calc(
var(--paper-item-body-two-line-min-height, 72px) - 16px
);
flex: 1;
}
.content {
display: contents;
}
:host(:not([narrow])) .content {
display: var(--settings-row-content-display, flex);
justify-content: flex-end;
flex: 1;
padding: 16px 0;
}
.content ::slotted(*) {
width: var(--settings-row-content-width);
}
:host([narrow]) {
align-items: normal;
flex-direction: column;
border-top: 1px solid var(--divider-color);
padding-bottom: 8px;
}
::slotted(ha-switch) {
padding: 16px 0;
}
div[secondary] {
white-space: normal;
}
.prefix-wrap {
display: var(--settings-row-prefix-display);
}
:host([narrow]) .prefix-wrap {
display: flex;
align-items: center;
}
`}}]}}),i);
@@ -0,0 +1,850 @@
import{_ as t,j as e,$ as i,G as a,d as o,n as r,e as s,t as n,D as d,E as c,a7 as l,J as p,eH as h,i as m,k as u,aS as g,aA as _,eI as b,A as f,a3 as v,aB as y,eJ as x,eK as w,I as k,aa as $}from"./main-bd0f996b.js";import{d as z}from"./c.09c1108b.js";import"./c.1ccf0777.js";import{L as I}from"./c.2a9c4717.js";import{B as S,d as O,a as C}from"./c.10b44dbb.js";import"./c.23be34f7.js";import{t as j,c as D,U as M,M as T,a as E,i as H,g as R,b as P,e as A,B as L,d as W,f as U,h as B}from"./c.d1feaea4.js";import{d as G}from"./c.b764d104.js";import{a as F}from"./c.7692ecb7.js";import{s as N}from"./c.eef9df6a.js";import"./c.f10ce4af.js";function q(t){return"horizontal"===t?"row":"column"}t([r("ha-header-bar")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"method",key:"render",value:function(){return i`<header class="mdc-top-app-bar">
<div class="mdc-top-app-bar__row">
<section
class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start"
id="navigation"
>
<slot name="navigationIcon"></slot>
<span class="mdc-top-app-bar__title">
<slot name="title"></slot>
</span>
</section>
<section
class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end"
id="actions"
role="toolbar"
>
<slot name="actionItems"></slot>
</section>
</div>
</header>`}},{kind:"get",static:!0,key:"styles",value:function(){return[a("/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE\n */\n.mdc-top-app-bar{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);color:white;display:flex;position:fixed;flex-direction:column;justify-content:space-between;box-sizing:border-box;width:100%;z-index:4}.mdc-top-app-bar .mdc-top-app-bar__action-item,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon{color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-top-app-bar .mdc-top-app-bar__action-item::before,.mdc-top-app-bar .mdc-top-app-bar__action-item::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon::after{background-color:#fff;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-primary, #fff))}.mdc-top-app-bar .mdc-top-app-bar__action-item:hover::before,.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-surface--hover::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:hover::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-surface--hover::before{opacity:0.08;opacity:var(--mdc-ripple-hover-opacity, 0.08)}.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-upgraded--background-focused::before,.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded):focus::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-upgraded--background-focused::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded)::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded):active::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-upgraded,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-top-app-bar__row{display:flex;position:relative;box-sizing:border-box;width:100%;height:64px}.mdc-top-app-bar__section{display:inline-flex;flex:1 1 auto;align-items:center;min-width:0;padding:8px 12px;z-index:1}.mdc-top-app-bar__section--align-start{justify-content:flex-start;order:-1}.mdc-top-app-bar__section--align-end{justify-content:flex-end;order:1}.mdc-top-app-bar__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit);padding-left:20px;padding-right:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:1}[dir=rtl] .mdc-top-app-bar__title,.mdc-top-app-bar__title[dir=rtl]{padding-left:0;padding-right:20px}.mdc-top-app-bar--short-collapsed{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:24px;border-bottom-left-radius:0}[dir=rtl] .mdc-top-app-bar--short-collapsed,.mdc-top-app-bar--short-collapsed[dir=rtl]{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:24px}.mdc-top-app-bar--short{top:0;right:auto;left:0;width:100%;transition:width 250ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-top-app-bar--short,.mdc-top-app-bar--short[dir=rtl]{right:0;left:auto}.mdc-top-app-bar--short .mdc-top-app-bar__row{height:56px}.mdc-top-app-bar--short .mdc-top-app-bar__section{padding:4px}.mdc-top-app-bar--short .mdc-top-app-bar__title{transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.mdc-top-app-bar--short-collapsed{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12);width:56px;transition:width 300ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__title{display:none}.mdc-top-app-bar--short-collapseLine truncated
.mdc-top-app-bar {
position: static;
color: var(--mdc-theme-on-primary, #fff);
}
`]}}]}}),e);class J extends S{constructor(){super(...arguments),this._itemSize={},this._gaps={},this._padding={}}get _defaultConfig(){return Object.assign({},super._defaultConfig,{itemSize:{width:"300px",height:"300px"},gap:"8px",padding:"match-gap"})}get _gap(){return this._gaps.row}get _idealSize(){return this._itemSize[O(this.direction)]}get _idealSize1(){return this._itemSize[O(this.direction)]}get _idealSize2(){return this._itemSize[C(this.direction)]}get _gap1(){return this._gaps[(t=this.direction,"horizontal"===t?"column":"row")];var t}get _gap2(){return this._gaps[q(this.direction)]}get _padding1(){const t=this._padding,[e,i]="horizontal"===this.direction?["left","right"]:["top","bottom"];return[t[e],t[i]]}get _padding2(){const t=this._padding,[e,i]="horizontal"===this.direction?["top","bottom"]:["left","right"];return[t[e],t[i]]}set itemSize(t){const e=this._itemSize,i=parseInt(t.width),a=parseInt(t.height);i!==e.width&&(e.width=i,this._triggerReflow()),a!==e.height&&(e.height=a,this._triggerReflow())}_setGap(t){const e=t.split(" ").map((t=>function(t){return"auto"===t?1/0:parseInt(t)}(t))),i=this._gaps;e[0]!==i.row&&(i.row=e[0],this._triggerReflow()),void 0===e[1]?e[0]!==i.column&&(i.column=e[0],this._triggerReflow()):e[1]!==i.column&&(i.column=e[1],this._triggerReflow())}set padding(t){const e=this._padding,i=t.split(" ").map((t=>function(t){return"match-gap"===t?1/0:parseInt(t)}(t)));1===i.length?e.top=e.right=e.bottom=e.left=i[0]:2===i.length?(e.top=e.bottom=i[0],e.right=e.left=i[1]):3===i.length?(e.top=i[0],e.right=e.left=i[1],e.bottom=i[2]):4===i.length&&["top","right","bottom","left"].forEach(((t,a)=>e[t]=i[a]))}}class K extends J{constructor(){super(...arguments),this._metrics=null,this.flex=null,this.justify=null}get _defaultConfig(){return Object.assign({},super._defaultConfig,{flex:!1,justify:"start"})}set gap(t){this._setGap(t)}_updateLayout(){const t=this.justify,[e,i]=this._padding1,[a,o]=this._padding2;["_gap1","_gap2"].forEach((e=>{const i=this[e];if(i===1/0&&!["space-between","space-around","space-evenly"].includes(t))throw new Error("grid layout: gap can only be set to 'auto' when justify is set to 'space-between', 'space-around' or 'space-evenly'");if(i===1/0&&"_gap2"===e)throw new Error(`grid layout: ${q(this.direction)}-gap cannot be set to 'auto' when direction is set to ${this.direction}`)}));const r={rolumns:-1,itemSize1:-1,itemSize2:-1,gap1:this._gap1===1/0?-1:this._gap1,gap2:this._gap2,padding1:{start:e===1/0?this._gap1:e,end:i===1/0?this._gap1:i},padding2:{start:a===1/0?this._gap2:a,end:o===1/0?this._gap2:o},positions:[]};let s=this._viewDim2;this.flex||["start","center","end"].includes(t)?(s-=r.padding2.start,s-=r.padding2.end):"space-between"===t?s+=r.gap2:"space-evenly"===t&&(s-=r.gap2);const n=s/(this._idealSize2+r.gap2);if(this.flex){r.rolumns=Math.round(n),r.itemSize2=Math.round((s-r.gap2*(r.rolumns-1))/r.rolumns);switch(!0===this.flex?"area":this.flex.preserve){case"aspect-ratio":r.itemSize1=Math.round(this._idealSize1/this._idealSize2*r.itemSize2);break;case O(this.direction):r.itemSize1=Math.round(this._idealSize1);break;default:r.itemSize1=Math.round(this._idealSize1*this._idealSize2/r.itemSize2)}}else r.itemSize1=this._idealSize1,r.itemSize2=this._idealSize2,r.rolumns=Math.floor(n);let d,c;if(this.flex||["start","center","end"].includes(t)){const e=r.rolumns*r.itemSize2+(r.rolumns-1)*r.gap2;d=this.flex||"start"===t?r.padding2.start:"end"===t?this._viewDim2-r.padding2.end-e:Math.round(this._viewDim2/2-e/2),c=r.gap2}else{const a=s-r.rolumns*r.itemSize2;"space-between"===t?(c=Math.round(a/(r.rolumns-1)),d=0):"space-around"===t?(c=Math.round(a/r.rolumns),d=Math.round(c/2)):(c=Math.round(a/(r.rolumns+1)),d=c),this._gap1===1/0&&(r.gap1=c,e===1/0&&(r.padding1.start=d),i===1/0&&(r.padding1.end=d))}for(let t=0;t<r.rolumns;t++)r.positions.push(d),d+=r.itemSize2+c;this._metrics=r}get _delta(){return this._metrics.itemSize1+this._metrics.gap1}_getItemSize(t){return{[this._sizeDim]:this._metrics.itemSize1,[this._secondarySizeDim]:this._metrics.itemSize2}}_getActiveItems(){const{padding1:t}=this._metrics,e=Math.max(0,this._scrollPosition-this._overhang),i=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang),a=Math.max(0,Math.floor((e-t.start)/this._delta)),o=Math.max(0,Math.ceil((i-t.start)/this._delta));this._first=a*this._metrics.rolumns,this._last=Math.min(o*this._metrics.rolumns-1,this._totalItems-1),this._physicalMin=t.start+this._delta*a,this._physicalMax=t.start+this._delta*o}_getItemPosition(t){const{rolumns:e,padding1:i,positions:a,itemSize1:o,itemSize2:r}=this._metrics;return{[this._positionDim]:i.start+Math.floor(t/e)*this._delta,[this._secondaryPositionDim]:a[t%e],[O(this.direction)]:o,[C(this.direction)]:r}}_updateScrollSize(){this._scrollSize=Math.max(1,Math.ceil(this._totalItems/this._metrics.rolumns)*this._delta+this._gap)}}const V=(t,e)=>t.callWS({type:"media_source/browse_media",media_content_id:e}),Q=t=>t.startsWith("media-s Line truncated
<div class="card-content">
<ha-textarea
autogrow
.label=${this.hass.localize("ui.components.media-browser.tts.message")}
.value=${this._message||this.hass.localize("ui.components.media-browser.tts.example_message",{name:(null===(t=this.hass.user)||void 0===t?void 0:t.name)||""})}
>
</ha-textarea>
${this._cloudDefaultOptions?this._renderCloudOptions():""}
</div>
<div class="card-actions">
${!this._cloudDefaultOptions||this._cloudDefaultOptions[0]===this._cloudOptions[0]&&this._cloudDefaultOptions[1]===this._cloudOptions[1]?i`<span></span>`:i`
<button class="link" @click=${this._storeDefaults}>
${this.hass.localize("ui.components.media-browser.tts.set_as_default")}
</button>
`}
<mwc-button @click=${this._ttsClicked}>
${this.hass.localize(`ui.components.media-browser.tts.action_${this.action}`)}
</mwc-button>
</div>
</ha-card> `}},{kind:"method",key:"_renderCloudOptions",value:function(){if(!this._cloudTTSInfo||!this._cloudOptions)return"";const t=this.getLanguages(this._cloudTTSInfo),e=this._cloudOptions,a=this.getSupportedGenders(e[0],this._cloudTTSInfo,this.hass.localize);return i`
<div class="cloud-options">
<ha-select
fixedMenuPosition
naturalMenuWidth
.label=${this.hass.localize("ui.components.media-browser.tts.language")}
.value=${e[0]}
@selected=${this._handleLanguageChange}
@closed=${N}
>
${t.map((([t,e])=>i`<mwc-list-item .value=${t}>${e}</mwc-list-item>`))}
</ha-select>
<ha-select
fixedMenuPosition
naturalMenuWidth
.label=${this.hass.localize("ui.components.media-browser.tts.gender")}
.value=${e[1]}
@selected=${this._handleGenderChange}
@closed=${N}
>
${a.map((([t,e])=>i`<mwc-list-item .value=${t}>${e}</mwc-list-item>`))}
</ha-select>
</div>
`}},{kind:"method",key:"willUpdate",value:function(t){var e,i;if(d(c(a.prototype),"willUpdate",this).call(this,t),t.has("item")){if(this.item.media_content_id){const t=new URLSearchParams(this.item.media_content_id.split("?")[1]),e=t.get("message"),i=t.get("language"),a=t.get("gender");e&&(this._message=e),i&&a&&(this._cloudOptions=[i,a])}this.isCloudItem&&!this._cloudTTSInfo&&((i=this.hass,i.callWS({type:"cloud/tts/info"})).then((t=>{this._cloudTTSInfo=t})),(t=>t.callWS({type:"cloud/status"}))(this.hass).then((t=>{t.logged_in&&(this._cloudDefaultOptions=t.prefs.tts_default_voice,this._cloudOptions||(this._cloudOptions={...this._cloudDefaultOptions}))})))}if(t.has("message"))return;const o=null===(e=this.shadowRoot.querySelector("ha-textarea"))||void 0===e?void 0:e.value;void 0!==o&&o!==this._message&&(this._message=o)}},{kind:"method",key:"_handleLanguageChange",value:async function(t){t.target.value!==this._cloudOptions[0]&&(this._cloudOptions=[t.target.value,this._cloudOptions[1]])}},{kind:"method",key:"_handleGenderChange",value:async function(t){t.target.value!==this._cloudOptions[1]&&(this._cloudOptions=[this._cloudOptions[0],t.target.value])}},{kind:"field",key:"getLanguages",value:()=>l(Z)},{kind:"field",key:"getSupportedGenders",value:()=>l(tt)},{kind:"get",key:"isCloudItem",value:function(){return this.item.media_content_id.startsWith("media-source://tts/cloud")}},{kind:"method",key:"_ttsClicked",value:async function(){const t=this.shadowRoot.querySelector("ha-textarea").value;this._message=t;const e={...this.item},i=new URLSearchParams;i.append("message",t),this._cloudOptions&&(i.append("language",this._cloudOptions[0]),i.append("gender",this._cloudOptions[1])),e.media_content_id=`${e.media_content_id.split("?")[0]}?${i.toString()}`,e.can_play=!0,e.title=t,p(this,"tts-picked",{item:e})}},{kind:"method",key:"_storeDefaults",value:async function(){const t=this._cloudDefaultOptions;this._cloudDefaultOptions=[...this._cloudOptions];try{await(e=this.hass,i={tts_default_voice:this._cloudDefaultOptions},e.callWS({type:"cloud/update_prefs",...i}))}catch(e){this._cloudDefaultOptions=t,F(this,{text:this.hass.localize("ui.components.media-browser.tts.faild_to_store_defaults",{error:e.message||e})})}var e,i}},{kind:"field",static:!0,key:"styles",value:()=>[h,o`
:host {
margin: 16px auto;
padding: 0 8px;
display: flex;
flex-direction: column;
max-width: 400px;
}
.cloud-options {
margin-top: 16px;
display: flex;
justify-content: space-between;
}
.cloud-options ha-select {
width: 48%;
}
ha-textarea {
width: 100%;
}
button.link {
color: var(--primary-color);
}
.card-actions {
display: flex;
justify-content: space-between;
}
`]}]}}),e),t([r("ha-media-player-browse")],(function(t,e){class a extends e{constructor(...e){super(...e),t(this)}}return{F:a,d:[{kind:"field",decorators:[s({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[s()],key:"entityId",value:void 0},{kind:"field",decorators:[s()],key:"action",value:()=>"play"},{kind:"field",decorators:[s({type:Boolean})],key:"dialog",value:()=>!1},{kind:"field",decorators:[s()],key:"navigateIds",value:void 0},{kind:"field",decorators:[s({type:Boolean,attribute:"narrow",reflect:!0})],key:"_narrow",value:()=>!1},{kind:"field",decorators:[s({type:Boolean,attribute:"scroll",reflect:!0})],key:"_scrolled",value:()=>!1},{kind:"field",decorators:[n()],key:"_error",value:void 0},{kind:"field",decorators:[n()],key:"_parentItem",value:void 0},{kind:"field",decorators:[n()],key:"_currentItem",value:void 0},{kind:"field",decorators:[m(".header")],key:"_header",value:void 0},{kind:"field",decorators:[m(".content")],key:"_content",value:void 0},{kind:"field",decorators:[m("lit-virtualizer")],key:"_virtualizer",value:void 0},{kind:"field",key:"_observed",value:()=>!1},{kind:"field",key:"_headerOffsetHeight",value:()=>0},{kind:"field",key:"_resizeObserver",value:void 0},{kind:"method",key:"connectedCallback",value:function(){d(c(a.prototype),"connectedCallback",this).call(this),this.updateComplete.then((()=>this._attachResizeObserver()))}},{kind:"method",key:"disconnectedCallback",value:function(){this._resizeObserver&&this._resizeObserver.disconnect()}},{kind:"method",key:"refresh",value:async function(){const t=this.navigateIds[this.navigateIds.length-1];try{this._currentItem=await this._fetchData(this.entityId,t.media_content_id,t.media_content_type),p(this,"media-browsed",{ids:this.navigateIds,current:this._currentItem})}catch(t){this._setError(t)}}},{kind:"method",key:"play",value:function(){var t;null!==(t=this._currentItem)&&void 0!==t&&t.can_play&&this._runAction(this._currentItem)}},{kind:"method",key:"willUpdate",value:function(t){var e;if(d(c(a.prototype),"willUpdate",this).call(this,t),t.has("entityId"))this._setError(void 0);else if(!t.has("navigateIds"))return;this._setError(void 0);const i=t.get("navigateIds"),o=this.navigateIds;null===(e=this._content)||void 0===e||e.scrollTo(0,0),this._scrolled=!1;const r=this._currentItem,s=this._parentItem;this._currentItem=void 0,this._parentItem=void 0;const n=o[o.length-1],l=o.length>1?o[o.length-2]:void 0;let h,m;t.has("entityId")||(i&&o.length===i.length+1&&i.every(((t,e)=>{const i=o[e];return i.media_content_id===t.media_content_id&&i.media_content_type===t.media_content_type}))?m=Promise.resolve(r):i&&o.length===i.length-1&&o.every(((t,e)=>{const a=i[e];return t.media_content_id===a.media_content_id&&t.media_content_type===a.media_content_type}))&&(h=Promise.resolve(s))),h||(h=this._fetchData(this.entityId,n.media_content_id,n.media_content_type)),h.then((t=>{this._currentItem=t,p(this,"media-browsed",{ids:o,current:t})}),(e=>{var a;i&&t.has("entityId")&&o.length===i.length&&i.every(((t,e)=>o[e].media_content_id===t.media_content_id&&o[e].media_content_type===t.media_content_type))?p(this,"media-browsed",{ids:[{media_content_id:void 0,media_content_type:void 0}],replace:!0}):"entity_not_found"===e.code&&M.includes(null===(a=this.hass.states[this.entityId])||void 0===a?void 0:a.state)?this._setError({message:this.hass.localize("ui.components.media-browser.media_player_unavailable"),code:"entity_not_found"}):this._setError(e)})),m||void 0===l||(m=this._fetchData(this.entityId,l.media_content_id,l.media_content_type)),m&&m.then((t=>{this._parentItem=t}))}},{kind:"method",key:"shouldUpdate",value:function(t){if(t.size>1||!t.has("hass"))return!0;const e=t.get("hass");return void 0===e||e.localize!==this.hass.localize}},{kind:"method",key:"firstUpdated",value:function(){this._measureCard(),this._attachResizeObserver()}},{kind:"method",key:"updated",value:function(t){if(d(c(a.prototype),"updated",this).call(this,t),t.has("_scrolled"))this._animateHeaderHeight();else if(t.has("_currentItem")){var e;if(this._setHeaderHeight(),this._observed)return;const t=null===(e=this._virtualizer)||void 0===e?void 0:e._virtualizer;t&&(this._observed=!0,setTimeout((()=>t._observeMutations()),0))}}},{kind:"method",key:"render",value:function(){if(this._error)return i`
<div class="container">
<ha-alert alert-type="error">
${this._renderError(this._error)}
</ha-alert>
</div>
`;if(!this._currentItem)return i`<ha-circular-progress active></ha-circular-progress>`;const t=this._currentItem,e=this.hass.localize(`ui.components.media-browser.class.${t.media_class}`),a=t.children||[],o=T[t.media_class],r=t.children_media_class?T[t.children_media_class]:T.directory,s=t.thumbnail?this._getSignedThumbnail(t.thumbnail).then((t=>`url(${t})`)):"none";return i`
${t.can_play?i`
<div
class="header ${u({"no-img":!t.thumbnail,"no-dialog":!this.dialog})}"
@transitionend=${this._setHeaderHeight}
>
<div class="header-content">
${t.thumbnail?i`
<div
class="img"
style="background-image: ${E(s,"")}"
>
${this._narrow&&null!=t&&t.can_play?i`
<ha-fab
mini
.item=${t}
@click=${this._actionClicked}
>
<ha-svg-icon
slot="icon"
.label=${this.hass.localize(`ui.components.media-browser.${this.action}-media`)}
.path=${"play"===this.action?g:_}
></ha-svg-icon>
${this.hass.localize(`ui.components.media-browser.${this.action}`)}
</ha-fab>
`:""}
</div>
`:i``}
<div class="header-info">
<div class="breadcrumb">
<h1 class="title">${t.title}</h1>
${e?i` <h2 class="subtitle">${e}</h2> `:""}
</div>
${!t.can_play||t.thumbnail&&this._narrow?"":i`
<mwc-button
raised
.item=${t}
@click=${this._actionClicked}
>
<ha-svg-icon
.label=${this.hass.localize(`ui.components.media-browser.${this.action}-media`)}
.path=${"play"===this.action?g:_}
></ha-svg-icon>
${this.hass.localize(`ui.components.media-browser.${this.action}`)}
</mwc-button>
`}
</div>
</div>
</div>
`:""}
<div
class="content"
@scroll=${this._scroll}
@touchmove=${this._scroll}
>
${this._error?i`
<div class="container">
<ha-alert alert-type="error">
${this._renderError(this._error)}
</ha-alert>
</div>
`:(d=t.media_content_id,d.startsWith("media-source://tts/")?i`
<ha-browse-media-tts
.item=${t}
.hass=${this.hass}
.action=${this.action}
@tts-picked=${this._ttsPicked}
></ha-browse-media-tts>
`:a.length||t.not_shown?"grid"===r.layout?i`
<lit-virtualizer
scroller
.layout=${n={itemSize:{width:"175px",height:"portrait"===r.thumbnail_ratio?"312px":"225px"},gap:"16px",flex:{preserve:"aspect-ratio"},justify:"space-evenly",direction:"vertical"},Object.assign({type:K},n)}
.items=${a}
.renderItem=${this._renderGridItem}
class="children ${u({portrait:"portrait"===r.thumbnail_ratio,not_shown:!!t.not_shown})}"
></lit-virtualizer>
${t.not_shown?i`
<div class="grid not-shown">
<div class="title">
${this.hass.localize("ui.components.media-browser.not_shown",{count:t.not_shown})}
</div>
</div>
`:""}
`:i`
<mwc-list>
<lit-virtualizer
scroller
.items=${a}
style=${f({height:72*a.length+26+"px"})}
.renderItem=${this._renderListItem}
></lit-virtualizer>
${t.not_shown?i`
<mwc-list-item
noninteractive
class="not-shown"
.graphic=${o.show_list_images?"medium":"avatar"}
dir=${z(this.hass)}
>
<span class="title">
${this.hass.localize("ui.components.media-browser.not_shown",{count:t.not_shown})}
</span>
</mwc-list-item>
`:""}
</mwc-list>
`:i`
<div class="container no-items">
${"media-source://media_source/local/."===t.media_content_id?i`
<div class="highlight-add-button">
<span>
<ha-svg-icon
.path=${b}
></ha-svg-icon>
</span>
<span>
${this.hass.localize("ui.components.media-browser.file_management.highlight_button")}
</span>
</div>
`:this.hass.localize("ui.components.media-browser.no_items")}
</div>
`)}
</div>
</div>
</div>
`;var n,d}},{kind:"field",key:"_renderGridItem",value(){return t=>{const e=t.thumbnail?this._getSignedThumbnail(t.thumbnail).then((t=>`url(${t})`)):"none";return i`
<div class="child" .item=${t} @click=${this._childClicked}>
<ha-card outlined>
<div class="thumbnail">
${t.thumbnail?i`
<div
class="${["app","directory"].includes(t.media_class)?"centered-image":""} ${H(t.thumbnail)?"brand-image":""} image"
style="background-image: ${E(e,"")}"
></div>
`:i`
<div class="icon-holder image">
<ha-svg-icon
class="folder"
.path=${T["directory"===t.media_class&&t.children_media_class||t.media_class].icon}
></ha-svg-icon>
</div>
`}
${t.can_play?i`
<ha-icon-button
class="play ${u({can_expand:t.can_expand})}"
.item=${t}
.label=${this.hass.localize(`ui.components.media-browser.${this.action}-media`)}
.path=${"play"===this.action?g:_}
@click=${this._actionClicked}
></ha-icon-button>
`:""}
</div>
<div class="title">
${t.title}
<paper-tooltip fitToVisibleBounds position="top" offset="4"
>${t.title}</paper-tooltip
>
</div>
</ha-card>
</div>
`}}},{kind:"field",key:"_renderListItem",value(){return t=>{const e=this._currentItem,a=T[e.media_class],o=a.show_list_images&&t.thumbnail?this._getSignedThumbnail(t.thumbnail).then((t=>`url(${t})`)):"none";return i`
<mwc-list-item
@click=${this._childClicked}
.item=${t}
.graphic=${a.show_list_images?"medium":"avatar"}
dir=${z(this.hass)}
>
<div
class=${u({graphic:!0,thumbnail:!0===a.show_list_images})}
style="background-image: ${E(o,"")}"
slot="graphic"
>
<ha-icon-button
class="play ${u({show:!a.show_list_images||!t.thumbnail})}"
.item=${t}
.label=${this.hass.localize(`ui.components.media-browser.${this.action}-media`)}
.path=${"play"===this.action?g:_}
@click=${this._actionClicked}
></ha-icon-button>
</div>
<span class="title">${t.title}</span>
</mwc-list-item>
`}}},{kind:"method",key:"_getSignedThumbnail",value:async function(t){if(!t)return"";if(t.startsWith("/"))return(await R(this.hass,t)).path;var e;H(t)&&(t=P({domain:A(t),type:"icon",useFallback:!0,darkOptimized:null===(e=this.hass.themes)||void 0===e?void 0:e.darkMode}));return t}},{kind:"field",key:"_actionClicked",value(){return t=>{t.stopPropagation();const e=t.currentTarget.item;this._runAction(e)}}},{kind:"method",key:"_runAction",value:function(t){p(this,"media-picked",{item:t,navigateIds:this.navigateIds})}},{kind:"method",key:"_ttsPicked",value:function(t){t.stopPropagation();const e=this.navigateIds.slice(0,-1);e.push(t.detail.item),p(this,"media-picked",{...t.detail,navigateIds:e})}},{kind:"field",key:"_childClicked",value(){return async t=>{const e=t.currentTarget.item;e&&(e.can_expand?p(this,"media-browsed",{ids:[...this.navigateIds,e]}):this._runAction(e))}}},{kind:"method",key:"_fetchData",value:async function(t,e,i){return t!==L?W(this.hass,t,e,i):V(this.hass,e)}},{kind:"method",key:"_measureCard",value:function(){this._narrow=(this.dialog?window.innerWidth:this.offsetWidth)<450}},{kind:"method",key:"_attachResizeObserver",value:async function(){this._resizeObserver||(await U(),this._resizeObserver=new ResizeObserver(G((()=>this._measureCard()),250,!1))),this._resizeObserver.observe(this)}},{kind:"method",key:"_closeDialogAction",value:function(){p(this,"close-dialog")}},{kind:"method",key:"_setError",value:function(t){this.dialog?t&&(this._closeDialogAction(),F(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:this._renderError(t)})):this._error=t}},{kind:"method",key:"_renderError",value:function(t){return"Media directory does not exist."===t.message?i`
<h2>
${this.hass.localize("ui.components.media-browser.no_local_media_found")}
</h2>
<p>
${this.hass.localize("ui.components.media-browser.no_media_folder")}
<br />
${this.hass.localize("ui.components.media-browser.setup_local_help","documentation",i`<a
href=${B(this.hass,"/more-info/local-media/setup-media")}
target="_blank"
rel="noreferrer"
>${this.hass.localize("ui.components.media-browser.documentation")}</a
>`)}
<br />
${this.hass.localize("ui.components.media-browser.local_media_files")}
</p>
`:i`<span class="error">${t.message}</span>`}},{kind:"method",key:"_setHeaderHeight",value:async function(){await this.updateComplete;const t=this._header,e=this._content;t&&e&&(this._headerOffsetHeight=t.offsetHeight,e.style.marginTop=`${this._headerOffsetHeight}px`,e.style.maxHeight=`calc(var(--media-browser-max-height, 100%) - ${this._headerOffsetHeight}px)`)}},{kind:"method",key:"_animateHeaderHeight",value:function(){let t;const e=i=>{void 0===t&&(t=i);const a=i-t;this._setHeaderHeight(),a<400&&requestAnimationFrame(e)};requestAnimationFrame(e)}},{kind:"method",decorators:[v({passive:!0})],key:"_scroll",value:function(t){const e=t.currentTarget;!this._scrolled&&e.scrollTop>this._headerOffsetHeight?this._scrolled=!0:this._scrolled&&e.scrollTop<this._headerOffsetHeight&&(this._scrolled=!1)}},{kind:"get",static:!0,key:"styles",value:function(){return[y,o`
:host {
display: flex;
flex-direction: column;
position: relative;
}
ha-circular-progress {
--mdc-theme-primary: var(--primary-color);
display: flex;
justify-content: center;
margin: 40px;
}
.container {
padding: 16px;
}
.no-items {
padding-left: 32px;
}
.highlight-add-button {
display: flex;
flex-direction: row-reverse;
margin-right: 48px;
}
.highlight-add-button ha-svg-icon {
position: relative;
top: -0.5em;
margin-left: 8px;
}
.content {
overflow-y: auto;
box-sizing: border-box;
height: 100%;
}
/* HEADER */
.header {
display: flex;
justify-content: space-between;
border-bottom: 1px solid var(--divider-color);
background-color: var(--card-background-color);
position: absolute;
top: 0;
right: 0;
left: 0;
z-index: 5;
padding: 16px;
}
.header_button {
position: relative;
right: -8px;
}
.header-content {
display: flex;
flex-wrap: wrap;
flex-grow: 1;
align-items: flex-start;
}
.header-content .img {
height: 175px;
width: 175px;
margin-right: 16px;
background-size: cover;
border-radius: 2px;
transition: width 0.4s, height 0.4s;
}
.header-info {
display: flex;
flex-direction: column;
justify-content: space-between;
align-self: stretch;
min-width: 0;
flex: 1;
}
.header-info mwc-button {
display: block;
--mdc-theme-primary: var(--primary-color);
padding-bottom: 16px;
}
.breadcrumb {
display: flex;
flex-direction: column;
overflow: hidden;
flex-grow: 1;
padding-top: 16px;
}
.breadcrumb .title {
font-size: 32px;
line-height: 1.2;
font-weight: bold;
margin: 0;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
padding-right: 8px;
}
.breadcrumb .previous-title {
font-size: 14px;
padding-bottom: 8px;
color: var(--secondary-text-color);
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
--mdc-icon-size: 14px;
}
.breadcrumb .subtitle {
font-size: 16px;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 0;
transition: height 0.5s, margin 0.5s;
}
.not-shown {
font-style: italic;
color: var(--secondary-text-color);
padding: 8px 16px 8px;
}
.grid.not-shown {
display: flex;
align-items: center;
text-align: center;
}
/* ============= CHILDREN ============= */
mwc-list {
--mdc-list-vertical-padding: 0;
--mdc-list-item-graphic-margin: 0;
--mdc-theme-text-icon-on-background: var(--secondary-text-color);
margin-top: 10px;
}
mwc-list li:last-child {
display: none;
}
mwc-list li[divider] {
border-bottom-color: var(--divider-color);
}
mwc-list-item {
width: 100%;
}
div.children {
display: grid;
grid-template-columns: repeat(
auto-fit,
minmax(var(--media-browse-item-size, 175px), 0.1fr)
);
grid-gap: 16px;
padding: 16px;
}
:host([dialog]) .children {
grid-template-columns: repeat(
auto-fit,
minmax(var(--media-browse-item-size, 175px), 0.33fr)
);
}
.child {
display: flex;
flex-direction: column;
cursor: pointer;
}
ha-card {
position: relative;
width: 100%;
box-sizing: border-box;
}
.children ha-card .thumbnail {
width: 100%;
position: relative;
box-sizing: border-box;
transition: padding-bottom 0.1s ease-out;
padding-bottom: 100%;
}
.portrait ha-card .thumbnail {
padding-bottom: 150%;
}
ha-card .image {
border-radius: 3px 3px 0 0;
}
.image {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.centered-image {
margin: 0 8px;
background-size: contain;
}
.brand-image {
background-size: 40%;
}
.children ha-card .icon-holder {
display: flex;
justify-content: center;
align-items: center;
}
.child .folder {
color: var(--secondary-text-color);
--mdc-icon-size: calc(var(--media-browse-item-size, 175px) * 0.4);
}
.child .play {
position: absolute;
transition: color 0.5s;
border-radius: 50%;
top: calc(50% - 50px);
right: calc(50% - 35px);
opacity: 0;
transition: opacity 0.1s ease-out;
}
.child .play:not(.can_expand) {
--mdc-icon-button-size: 70px;
--mdc-icon-size: 48px;
}
ha-card:hover .play {
opacity: 1;
}
ha-card:hover .play:not(.can_expand) {
color: var(--primary-color);
}
ha-card:hover .play.can_expand {
bottom: 8px;
}
.child .play.can_expand {
background-color: rgba(var(--rgb-card-background-color), 0.5);
top: auto;
bottom: 0px;
right: 8px;
transition: bottom 0.1s ease-out, opacity 0.1s ease-out;
}
.child .play:hover {
color: var(--primary-color);
}
.child .title {
font-size: 16px;
padding-top: 16px;
padding-left: 2px;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
text-overflow: ellipsis;
}
.child ha-card .title {
margin-bottom: 16px;
padding-left: 16px;
}
mwc-list-item .graphic {
background-size: contain;
border-radius: 2px;
display: flex;
align-content: center;
align-items: center;
line-height: initial;
}
mwc-list-item .graphic .play {
opacity: 0;
transition: all 0.5s;
background-color: rgba(var(--rgb-card-background-color), 0.5);
border-radius: 50%;
--mdc-icon-button-size: 40px;
}
mwc-list-item:hover .graphic .play {
opacity: 1;
color: var(--primary-text-color);
}
mwc-list-item .graphic .play.show {
opacity: 1;
background-color: transparent;
}
mwc-list-item .title {
margin-left: 16px;
}
mwc-list-item[dir="rtl"] .title {
margin-right: 16px;
margin-left: 0;
}
/* ============= Narrow ============= */
:host([narrow]) {
padding: 0;
}
:host([narrow]) .media-source {
padding: 0 24px;
}
:host([narrow]) div.children {
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
}
:host([narrow]) .breadcrumb .title {
font-size: 24px;
}
:host([narrow]) .header {
padding: 0;
}
:host([narrow]) .header.no-dialog {
display: block;
}
:host([narrow]) .header_button {
position: absolute;
top: 14px;
right: 8px;
}
:host([narrow]) .header-content {
flex-direction: column;
flex-wrap: nowrap;
}
:host([narrow]) .header-content .img {
height: auto;
width: 100%;
margin-right: 0;
padding-bottom: 50%;
margin-bottom: 8px;
position: relative;
background-position: center;
border-radius: 0;
transition: width 0.4s, height 0.4s, padding-bottom 0.4s;
}
ha-fab {
position: absolute;
--mdc-theme-secondary: var(--primary-color);
bottom: -20px;
right: 20px;
}
:host([narrow]) .header-info mwc-button {
margin-top: 16px;
margin-bottom: 8px;
}
:host([narrow]) .header-info {
padding: 0 16px 8px;
}
/* ============= Scroll ============= */
:host([scroll]) .breadcrumb .subtitle {
height: 0;
margin: 0;
}
:host([scroll]) .breadcrumb .title {
-webkit-line-clamp: 1;
}
:host(:not([narrow])[scroll]) .header:not(.no-img) ha-icon-button {
align-self: center;
}
:host([scroll]) .header-info mwc-button,
.no-img .header-info mwc-button {
padding-right: 4px;
}
:host([scroll][narrow]) .no-img .header-info mwc-button {
padding-right: 16px;
}
:host([scroll]) .header-info {
flex-direction: row;
}
:host([scroll]) .header-info mwc-button {
align-self: center;
margin-top: 0;
margin-bottom: 0;
padding-bottom: 0;
}
:host([scroll][narrow]) .no-img .header-info {
flex-direction: row-reverse;
}
:host([scroll][narrow]) .header-info {
padding: 20px 24px 10px 24px;
align-items: center;
}
:host([scroll]) .header-content {
align-items: flex-end;
flex-direction: row;
}
:host([scroll]) .header-content .img {
height: 75px;
width: 75px;
}
:host([scroll]) .breadcrumb {
padding-top: 0;
align-self: center;
}
:host([scroll][narrow]) .header-content .img {
height: 100px;
width: 100px;
padding-bottom: initial;
margin-bottom: 0;
}
:host([scroll]) ha-fab {
bottom: 0px;
right: -24px;
--mdc-fab-box-shadow: none;
--mdc-theme-secondary: rgba(var(--rgb-primary-color), 0.5);
}
lit-virtualizer {
height: 100%;
overflow: overlay !important;
contain: size layout !important;
}
lit-virtualizer.not_shown {
height: calc(100% - 36px);
}
`]}}]}}),e);t([r("ha-media-manage-button")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[s({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[s()],key:"currentItem",value:void 0},{kind:"field",decorators:[n()],key:"_uploading",value:()=>0},{kind:"method",key:"render",value:function(){return this.currentItem&&Q(this.currentItem.media_content_id||"")?i`
<mwc-button
.label=${this.hass.localize("ui.components.media-browser.file_management.manage")}
@click=${this._manage}
>
<ha-svg-icon .path=${x} slot="icon"></ha-svg-icon>
</mwc-button>
`:i``}},{kind:"method",key:"_manage",value:function(){var t,e;t=this,e={currentItem:this.currentItem,onClose:()=>p(this,"media-refresh")},p(t,"show-dialog",{dialogTag:"dialog-media-manage",dialogImport:()=>import("./c.32af6a3e.js"),dialogParams:e})}},{kind:"field",static:!0,key:"styles",value:()=>o`
mwc-button {
/* We use icon + text to show disabled state */
--mdc-button-disabled-ink-color: --mdc-theme-primary;
}
ha-svg-icon[slot="icon"],
ha-circular-progress[slot="icon"] {
vertical-align: middle;
}
ha-svg-icon[slot="icon"] {
margin-inline-start: 0px;
margin-inline-end: 8px;
direction: var(--direction);
}
`}]}}),e),t([r("dialog-media-player-browse")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[s({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[n()],key:"_currentItem",value:void 0},{kind:"field",decorators:[n()],key:"_navigateIds",value:void 0},{kind:"field",decorators:[n()],key:"_params",value:void 0},{kind:"field",decorators:[m("ha-media-player-browse")],key:"_browser",value:void 0},{kind:"method",key:"showDialog",value:function(t){this._params=t,this._navigateIds=t.navigateIds||[{media_content_id:void 0,media_content_type:void 0}]}},{kind:"method",key:"closeDialog",value:function(){this._params=void 0,this._navigateIds=void 0,this._currentItem=void 0,p(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){return this._params&&this._navigateIds?i`
<ha-dialog
open
scrimClickAction
escapeKeyAction
hideActions
flexContent
.heading=${this._currentItem?this._currentItem.title:this.hass.localize("ui.components.media-browser.media-player-browser")}
@closed=${this.closeDialog}
>
<ha-header-bar slot="heading">
${this._navigateIds.length>1?i`
<ha-icon-button
slot="navigationIcon"
.path=${w}
@click=${this._goBack}
></ha-icon-button>
`:""}
<span slot="title">
${this._currentItem?this._currentItem.title:this.hass.localize("ui.components.media-browser.media-player-browser")}
</span>
<ha-media-manage-button
slot="actionItems"
.hass=${this.hass}
.currentItem=${this._currentItem}
@media-refresh=${this._refreshMedia}
></ha-media-manage-button>
<ha-icon-button
.label=${this.hass.localize("ui.dialogs.generic.close")}
.path=${k}
dialogAction="close"
slot="actionItems"
class="header_button"
dir=${z(this.hass)}
></ha-icon-button>
</ha-header-bar>
<ha-media-player-browse
dialog
.hass=${this.hass}
.entityId=${this._params.entityId}
.navigateIds=${this._navigateIds}
.action=${this._action}
@close-dialog=${this.closeDialog}
@media-picked=${this._mediaPicked}
@media-browsed=${this._mediaBrowsed}
></ha-media-player-browse>
</ha-dialog>
`:i``}},{kind:"method",key:"_goBack",value:function(){var t;this._navigateIds=null===(t=this._navigateIds)||void 0===t?void 0:t.slice(0,-1),this._currentItem=void 0}},{kind:"method",key:"_mediaBrowsed",value:function(t){this._navigateIds=t.detail.ids,this._currentItem=t.detail.current}},{kind:"method",key:"_mediaPicked",value:function(t){this._params.mediaPickedCallback(t.detail),"play"!==this._action&&this.closeDialog()}},{kind:"get",key:"_action",value:function(){return this._params.action||"play"}},{kind:"method",key:"_refreshMedia",value:function(){this._browser.refresh()}},{kind:"get",static:!0,key:"styles",value:function(){return[$,o`
ha-dialog {
--dialog-z-index: 8;
--dialog-content-padding: 0;
}
ha-media-player-browse {
--media-browser-max-height: calc(100vh - 65px);
height: calc(100vh - 65px);
direction: ltr;
}
@media (min-width: 800px) {
ha-dialog {
--mdc-dialog-max-width: 800px;
--dialog-surface-position: fixed;
--dialog-surface-top: 40px;
--mdc-dialog-max-height: calc(100vh - 72px);
}
ha-media-player-browse {
position: initial;
--media-browser-max-height: 100vh - 137px;
height: 100vh - 137px;
width: 700px;
}
}
ha-header-bar {
--mdc-theme-on-primary: var(--primary-text-color);
--mdc-theme-primary: var(--mdc-theme-surface);
flex-shrink: 0;
border-bottom: 1px solid var(--divider-color, rgba(0, 0, 0, 0.12));
}
ha-media-manage-button {
--mdc-theme-primary: var(--mdc-theme-on-primary);
}
`]}}]}}),e);var et=Object.freeze({__proto__:null});export{V as b,et as d,Q as i,Y as r,X as u};
@@ -0,0 +1 @@
"DateTimeFormat"in Intl&&Intl.DateTimeFormat.__addTZData&&Intl.DateTimeFormat.__addTZData({zones:["Africa/Accra|,0,0,0|-u9rgl5,0,0,0|-u9rgl4,1,1,0|NaN,1,1,0","Africa/Addis_Ababa|,0,2,0|-w6p5hh,0,2,0|-w6p5hg,2,3,0|-lnsey1,2,3,0|-lnsey0,3,4,0|-kvcdo1,3,4,0|-kvcdo0,2,3,0|-h80ka1,2,3,0|-h80ka0,4,5,0|-eb6ib1,4,5,0|-eb6ib0,3,4,0|NaN,3,4,0","Africa/Algiers|,0,6,0|-154gb8d,0,6,0|-154gb8c,5,7,0|-uozn3m,5,7,0|-uozn3l,6,1,0|-ry2lg1,6,1,0|-ry2lg0,7,8,1|-rsgqs1,7,8,1|-rsgqs0,6,1,0|-rjiis1,6,1,0|-rjiis0,7,8,1|-r9dpg1,7,8,1|-r9dpg0,6,1,0|-r1idg1,6,1,0|-r1idg0,7,8,1|-qqnms1,7,8,1|-qqnms0,6,1,0|-qj59g1,6,1,0|-qj59g0,7,8,1|-q7xk41,7,8,1|-q7xk40,6,1,0|-q15441,6,1,0|-q15440,7,8,1|-po6g41,7,8,1|-po6g40,6,1,0|-pgvhg1,6,1,0|-pgvhg0,7,8,1|-pbs5g1,7,8,1|-pbs5g0,6,1,0|-fte841,6,1,0|-fte840,7,8,1|-fpw801,7,8,1|-fpw800,6,1,0|-fkul41,6,1,0|-fkul40,8,8,0|-dfqqk1,8,8,0|-dfqqk0,9,9,1|-d62o01,9,9,1|-d62o00,8,8,0|-cx0nw1,8,8,0|-cx0nw0,9,9,1|-cofk41,9,9,1|-cofk40,8,8,0|-c4kqs1,8,8,0|-c4kqs0,6,1,0|-79mio1,6,1,0|-79mio0,8,8,0|-3i8is1,8,8,0|-3i8is0,6,1,0|oot7z,6,1,0|oot80,7,8,1|wlzvz,7,8,1|wlzw0,6,1,0|3tynzz,6,1,0|3tyo00,7,8,1|42lp7z,7,8,1|42lp80,8,8,0|4aiynz,8,8,0|4aiyo0,9,9,1|4jw2rz,9,9,1|4jw2s0,8,8,0|54et7z,8,8,0|54et80,6,1,0|5drxbz,6,1,0|5drxc0,7,8,1|5ni03z,7,8,1|5ni040,6,1,0|5wuynz,6,1,0|5wuyo0,8,8,0|NaN,8,8,0","Africa/Asmara|,0,2,0|-w6p5hh,0,2,0|-w6p5hg,2,3,0|-lnsey1,2,3,0|-lnsey0,3,4,0|-kvcdo1,3,4,0|-kvcdo0,2,3,0|-h80ka1,2,3,0|-h80ka0,4,5,0|-eb6ib1,4,5,0|-eb6ib0,3,4,0|NaN,3,4,0","Africa/Bamako|,0,0,0|-u9rgl5,0,0,0|-u9rgl4,1,1,0|NaN,1,1,0","Africa/Bangui|,0,10,0|-xnxnao,0,10,0|-xnxnan,1,1,0|-w3k001,1,1,0|-w3k000,0,10,0|-t85smo,0,10,0|-t85smn,10,11,0|-q9qc21,10,11,0|-q9qc20,11,8,0|NaN,11,8,0","Africa/Banjul|,0,0,0|-u9rgl5,0,0,0|-u9rgl4,1,1,0|NaN,1,1,0","Africa/Bissau|,0,12,0|-u9rek1,0,12,0|-u9rek0,12,13,0|2lxk3z,12,13,0|2lxk40,1,1,0|NaN,1,1,0","Africa/Blantyre|,0,14,0|-yvtfd9,0,14,0|-yvtfd8,13,9,0|NaN,13,9,0","Africa/Brazzaville|,0,10,0|-xnxnao,0,10,0|-xnxnan,1,1,0|-w3k001,1,1,0|-w3k000,0,10,0|-t85smo,0,10,0|-t85smn,10,11,0|-q9qc21,10,11,0|-q9qc20,11,8,0|NaN,11,8,0","Africa/Bujumbura|,0,14,0|-yvtfd9,0,14,0|-yvtfd8,13,9,0|NaN,13,9,0","Africa/Cairo|,0,15,0|-1054wgm,0,15,0|-1054wgl,14,9,0|-fdls81,14,9,0|-fdls80,15,4,1|-f9lf01,15,4,1|-f9lf00,14,9,0|-ezidk1,14,9,0|-ezidk0,15,4,1|-erl9o1,15,4,1|-erl9o0,14,9,0|-ehgdk1,14,9,0|-ehgdk0,15,4,1|-e6pf01,15,4,1|-e6pf00,14,9,0|-dyog81,14,9,0|-dyog80,15,4,1|-dno8c1,15,4,1|-dno8c0,14,9,0|-dfuo81,14,9,0|-dfuo80,15,4,1|-d4ugc1,15,4,1|-d4ugc0,14,9,0|-cwayw1,14,9,0|-cwayw0,15,4,1|-cm2j01,15,4,1|-cm2j00,14,9,0|-6lluw1,14,9,0|-6lluw0,15,4,1|-6e79o1,15,4,1|-6e79o0,14,9,0|-63alk1,14,9,0|-63alk0,15,4,1|-5vfcc1,15,4,1|-5vfcc0,14,9,0|-5kilg1,14,9,0|-5kilg0,15,4,1|-5cp1c1,15,4,1|-5cp1c0,14,9,0|-51otg1,14,9,0|-51otg0,15,4,1|-4tv9c1,15,4,1|-4tv9c0,14,9,0|-4iww41,14,9,0|-4iww40,15,4,1|-4b3c01,15,4,1|-4b3c00,14,9,0|-404ys1,14,9,0|-404ys0,15,4,1|-3sbeo1,15,4,1|-3sbeo0,14,9,0|-3hd1g1,14,9,0|-3hd1g0,15,4,1|-39jhc1,15,4,1|-39jhc0,14,9,0|-2yj9g1,14,9,0|-2yj9g0,15,4,1|-2qppc1,15,4,1|-2qppc0,14,9,0|-2frc41,14,9,0|-2frc40,15,4,1|-27xs01,15,4,1|-27xs00,14,9,0|-1wzes1,14,9,0|-1wzes0,15,4,1|-1p4001,15,4,1|-1p4000,14,9,0|-1e7hg1,14,9,0|-1e7hg0,15,4,1|-16c2o1,15,4,1|-16c2o0,14,9,0|-vdpg1,14,9,0|-vdpg0,15,4,1|-niao1,15,4,1|-niao0,14,9,0|-cls41,14,9,0|-cls40,15,4,1|-4qdc1,15,4,1|-4qdc0,14,9,0|6657z,14,9,0|66580,15,4,1|e1jzz,15,4,1|e1k00,14,9,0|oy2jz,14,9,0|oy2k0,15,4,1|wthbz,15,4,1|wthc0,14,9,0|17rujz,14,9,0|17ruk0,15,4,1|1fn9bz,15,4,1|1fn9c0,14,9,0|1qjrvz,14,9,0|1qjrw0,15,4,1|1yf6nz,15,4,1|1yf6o0,14,9,0|29bp7z,14,9,0|29bp80,15,4,1|2h73zz,15,4,1|2h7400,14,9,0|2s3mjz,14,9,0|2s3mk0,15,4,1|2zz1bz,15,4,1|2zz1c0,14,9,0|3axejz,14,9,0|3axek0,15,4,1|3istbz,15,4,1|3istc0,14,9,0|3tpbvz,14,9,0|3tpbw0,15,4,1|41kqnz,15,4,1|41kqo0,14,9,0|4ch97z,14,9,0|4ch980,15,4,1|4kcnzz,15,4,1|4kco00,14,9,0|4v96jz,14,9,0|4v96k0,15,4,1|534lbz,15,4,1|534lc0,14,9,0|5e2yjz,14,9,0|5e2yk0,15,4,1|5lydbz,15,4,1|5lydc0,14,9,0|5wuvvz,14,9,0|5wuvw0,15,4,1|64qanz,15,4,1|64qao0,14,9,0|6k07vz,14,9,0|6k07w0,15,4,1|6ni7zz,15,4,1|6ni800,14,9,0|7242jz,14,9,0|7242k0,15,4,1|76a5bz,15,4,1|76a5c0,14,9,0|7h8ijz,14,9,0|7h8ik0,15,4,1|7p3xbz,15,4,1|7p3xc0,14,9,0|800fvz,14,9,0|800fw0,15,4,1|87vunz,15,4,1|87vuo0,14,9,0|8isd7z,14,9,0|8isd80,15,4,1|8qnrzz,15,4,1|8qns00,14,9,0|91kajz,14,9,0|91kak0,15,4,1|99fpbz,15,4,1|99fpc0,14,9,0|9ke2jz,14,9,0|9ke2k0,15,4,1|9s9hbz,15,4,1|9s9hc0,14,9,0|a3f97z,14,9,0|a3f980,15,4,1|ab1enz,15,4,1|ab1eo0,14,9,0|alxx7z,14,9,0|alxx80,15,4,1|attbzz,15,4,1|attc00,14,9,0|b4pujz,14,9,0|b4puk0,15,4,1|bcl9bz,15,4,1|bcl9c0,14,9,0|bnjmjz,14,9,0|bnjmk0,15,4,1|bvf1bz,15,4,1|bvf1c0,14,9,0|c6bjvz,14,9,0|c6bjw0,15,4,1|ce6ynz,15,4,1|ce6yo0,14,9,0|cp3h7z,14,9,0|cp3h80,15,4,1|cwyvzz,15,4,1|cwyw00,14,9,0|d7prrz,14,9,0|d7prs0,15,4,1|dfmvnz,15,4,1|dfmvo0,14,9,0|dqfufz,14,9,0|dqfug0,15,4,1|dycybz,15,4,1|dycyc0,14,9,0|e95x3z,14,9,0|e95x40,15,4,1|eh30zz,15,4,1|eh3100,14,9,0|ervzrz,14,9,0|ervzs0,15,4,1|ezt3nz,15,4,1|ezt3o0,14,9,0|faz13z,14,9,0|faz140,15,4,1|fiw4zz,15,4,1|fiw500,14,9,0|ftpLine truncated
@@ -0,0 +1 @@
import{x as e}from"./main-bd0f996b.js";function n(e){return Intl.getCanonicalLocales(e)}function t(e){if("symbol"==typeof e)throw TypeError("Cannot convert a Symbol value to a string");return String(e)}function r(e){if(void 0===e)return NaN;if(null===e)return 0;if("boolean"==typeof e)return e?1:0;if("number"==typeof e)return e;if("symbol"==typeof e||"bigint"==typeof e)throw new TypeError("Cannot convert symbol/bigint to number");return Number(e)}function u(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function i(e,n){return Object.is?Object.is(e,n):e===n?0!==e||1/e==1/n:e!=e&&n!=n}function a(e){return new Array(e)}function o(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function c(e,n){return e-Math.floor(e/n)*n}function l(e){return Math.floor(e/864e5)}function s(e){return Date.UTC(e,0)/864e5}function f(e){return new Date(e).getUTCFullYear()}function D(e){return e%4!=0?365:e%100!=0?366:e%400!=0?365:366}function m(e){return l(e)-s(f(e))}function g(e){return 365===D(f(e))?0:1}function p(e){var n=m(e),t=g(e);if(n>=0&&n<31)return 0;if(n<59+t)return 1;if(n<90+t)return 2;if(n<120+t)return 3;if(n<151+t)return 4;if(n<181+t)return 5;if(n<212+t)return 6;if(n<243+t)return 7;if(n<273+t)return 8;if(n<304+t)return 9;if(n<334+t)return 10;if(n<365+t)return 11;throw new Error("Invalid time")}function d(e){return void 0===e?Object.create(null):u(e)}function y(e,n,t,r){if(void 0!==e){if(e=Number(e),isNaN(e)||e<n||e>t)throw new RangeError("".concat(e," is outside of range [").concat(n,", ").concat(t,"]"));return Math.floor(e)}return r}function F(e,n,t,r,u){return y(e[n],t,r,u)}function v(e,n,r,u,i){if("object"!=typeof e)throw new TypeError("Options must be an object");var a=e[n];if(void 0!==a){if("boolean"!==r&&"string"!==r)throw new TypeError("invalid type");if("boolean"===r&&(a=Boolean(a)),"string"===r&&(a=t(a)),void 0!==u&&!u.filter((function(e){return e==a})).length)throw new RangeError("".concat(a," is not within ").concat(u.join(", ")));return a}return i}var h=["angle-degree","area-acre","area-hectare","concentr-percent","digital-bit","digital-byte","digital-gigabit","digital-gigabyte","digital-kilobit","digital-kilobyte","digital-megabit","digital-megabyte","digital-petabyte","digital-terabit","digital-terabyte","duration-day","duration-hour","duration-millisecond","duration-minute","duration-month","duration-second","duration-week","duration-year","length-centimeter","length-foot","length-inch","length-kilometer","length-meter","length-mile-scandinavian","length-mile","length-millimeter","length-yard","mass-gram","mass-kilogram","mass-ounce","mass-pound","mass-stone","temperature-celsius","temperature-fahrenheit","volume-fluid-ounce","volume-gallon","volume-liter","volume-milliliter"];function b(e){return e.slice(e.indexOf("-")+1)}var E=h.map(b);function C(e){return E.indexOf(e)>-1}var S=/[^A-Z]/;function w(e){return 3===(e=e.replace(/([a-z])/g,(function(e,n){return n.toUpperCase()}))).length&&!S.test(e)}function A(e){if(C(e=e.replace(/([A-Z])/g,(function(e,n){return n.toLowerCase()}))))return!0;var n=e.split("-per-");if(2!==n.length)return!1;var t=n[0],r=n[1];return!(!C(t)||!C(r))}function x(e){return Math.floor(Math.log(e)*Math.LOG10E)}function B(e,n){if("function"==typeof e.repeat)return e.repeat(n);for(var t=new Array(n),r=0;r<t.length;r++)t[r]=e;return t.join("")}function O(e,n,t,r){e.get(n)||e.set(n,Object.create(null)),e.get(n)[t]=r}function N(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var u=e.get(n);if(!u)throw new TypeError("".concat(n," InternalSlot has not been initialized"));return t.reduce((function(e,n){return e[n]=u[n],e}),Object.create(null))}function I(e,n,t){if(void 0===t&&(t=Error),!e)throw new t(n)}function M(e,n,t){var r=(0,t.getInternalSlots)(e),u=r.notation,i=r.dataLocaleData,a=r.numberingSystem;switch(u){case"standard":return 0;case"scientific":return n;case"engineering":return 3*Math.floor(n/3);default:var o=r.compactDisplay,c=r.style,l=r.currencyDisplay,s=void 0;if("currency"===c&&"name"!==l){s=(i.numbers.currency[a]||i.numbers.currency[i.numbers.nu[0]]).short}else{var f=i.numbers.decimal[a]||i.numbers.decimal[i.numbers.nu[0]];s="long"===o?f.long:f.short}if(!s)return 0;var D=String(Math.pow(10,n)),m=Object.keys(s);if(D<m[0])return 0;if(D>m[m.length-1])return m[m.length-1].length-1;var g=m.indexOf(D);if(-1===g)return 0;var p=m[g];return"0"===s[p].other?0:p.length-s[p].other.match(/0+/)[0].length}}function T(e,n,t){var r,u,i,a,o=t;if(0===e)r=B("0",o),u=0,i=0;else{var c=e.toString(),l=c.indexOf("e"),s=c.split("e"),f=s[0],D=s[1],m=f.replace(".","");if(l>=0&&m.length<=o)u=+D,r=m+B("0",o-m.length),i=e;else{var g=(u=x(e))-o+1,p=Math.round(y(e,g));y(p,o-1)>=10&&(u+=1,p=Math.floor(p/10)),r=p.toString(),i=y(p,o-1-u)}}if(u>=o-1?(r+=B("0",u-o+1),a=u+1):u>=0?(r="".concat(r.slice(0,u+1),".").concat(r.slice(u+1)),a=u+1):(r="0.".concat(B("0",-u-1)).concat(r),a=1),r.indexOf(".")>=0&&t>n){for(var d=t-n;d>0&&"0"===r[r.length-1];)Line truncated
@@ -0,0 +1,231 @@
import{f as e,e as t,B as i,i as d,a6 as o,t as a,h as n,a3 as l,R as c,$ as r,k as s,p as m,d as h,_ as p,n as f,x,y as u,M as b,P as g,Q as _,T as v,z as k,ad as y,U as w,a4 as E,C as I,D as L,E as C}from"./main-bd0f996b.js";import{o as A}from"./c.8e28b461.js";import{L as T,s as R}from"./c.09c1108b.js";var z,O;const F=null!==(O=null===(z=window.ShadyDOM)||void 0===z?void 0:z.inUse)&&void 0!==O&&O;class $ extends i{constructor(){super(...arguments),this.disabled=!1,this.containingForm=null,this.formDataListener=e=>{this.disabled||this.setFormData(e.formData)}}findFormElement(){if(!this.shadowRoot||F)return null;const e=this.getRootNode().querySelectorAll("form");for(const t of Array.from(e))if(t.contains(this))return t;return null}connectedCallback(){var e;super.connectedCallback(),this.containingForm=this.findFormElement(),null===(e=this.containingForm)||void 0===e||e.addEventListener("formdata",this.formDataListener)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.containingForm)||void 0===e||e.removeEventListener("formdata",this.formDataListener),this.containingForm=null}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}}$.shadowRootOptions={mode:"open",delegatesFocus:!0},e([t({type:Boolean})],$.prototype,"disabled",void 0);class N extends ${constructor(){super(...arguments),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.name="",this.value="on",this.reducedTouchTarget=!1,this.animationClass="",this.shouldRenderRipple=!1,this.focused=!1,this.mdcFoundationClass=void 0,this.mdcFoundation=void 0,this.rippleElement=null,this.rippleHandlers=new c((()=>(this.shouldRenderRipple=!0,this.ripple.then((e=>this.rippleElement=e)),this.ripple)))}createAdapter(){return{}}update(e){const t=e.get("indeterminate"),i=e.get("checked"),d=e.get("disabled");if(void 0!==t||void 0!==i||void 0!==d){const e=this.calculateAnimationStateName(!!i,!!t,!!d),o=this.calculateAnimationStateName(this.checked,this.indeterminate,this.disabled);this.animationClass=`${e}-${o}`}super.update(e)}calculateAnimationStateName(e,t,i){return i?"disabled":t?"indeterminate":e?"checked":"unchecked"}renderRipple(){return this.shouldRenderRipple?this.renderRippleTemplate():""}renderRippleTemplate(){return r`<mwc-ripple
.disabled="${this.disabled}"
unbounded></mwc-ripple>`}render(){const e=this.indeterminate||this.checked,t={"mdc-checkbox--disabled":this.disabled,"mdc-checkbox--selected":e,"mdc-checkbox--touch":!this.reducedTouchTarget,"mdc-ripple-upgraded--background-focused":this.focused,"mdc-checkbox--anim-checked-indeterminate":"checked-indeterminate"==this.animationClass,"mdc-checkbox--anim-checked-unchecked":"checked-unchecked"==this.animationClass,"mdc-checkbox--anim-indeterminate-checked":"indeterminate-checked"==this.animationClass,"mdc-checkbox--anim-indeterminate-unchecked":"indeterminate-unchecked"==this.animationClass,"mdc-checkbox--anim-unchecked-checked":"unchecked-checked"==this.animationClass,"mdc-checkbox--anim-unchecked-indeterminate":"unchecked-indeterminate"==this.animationClass},i=this.indeterminate?"mixed":void 0;return r`
<div class="mdc-checkbox mdc-checkbox--upgraded ${s(t)}">
<input type="checkbox"
class="mdc-checkbox__native-control"
name="${m(this.name)}"
aria-checked="${m(i)}"
aria-label="${m(this.ariaLabel)}"
aria-labelledby="${m(this.ariaLabelledBy)}"
aria-describedby="${m(this.ariaDescribedBy)}"
data-indeterminate="${this.indeterminate?"true":"false"}"
?disabled="${this.disabled}"
.indeterminate="${this.indeterminate}"
.checked="${this.checked}"
.value="${this.value}"
@change="${this.handleChange}"
@focus="${this.handleFocus}"
@blur="${this.handleBlur}"
@mousedown="${this.handleRippleMouseDown}"
@mouseenter="${this.handleRippleMouseEnter}"
@mouseleave="${this.handleRippleMouseLeave}"
@touchstart="${this.handleRippleTouchStart}"
@touchend="${this.handleRippleDeactivate}"
@touchcancel="${this.handleRippleDeactivate}">
<div class="mdc-checkbox__background"
@animationend="${this.resetAnimationClass}">
<svg class="mdc-checkbox__checkmark"
viewBox="0 0 24 24">
<path class="mdc-checkbox__checkmark-path"
fill="none"
d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
</svg>
<div class="mdc-checkbox__mixedmark"></div>
</div>
${this.renderRipple()}
</div>`}setFormData(e){this.name&&this.checked&&e.append(this.name,this.value)}handleFocus(){this.focused=!0,this.handleRippleFocus()}handleBlur(){this.focused=!1,this.handleRippleBlur()}handleRippleMouseDown(e){const t=()=>{window.removeEventListener("mouseup",t),this.handleRippleDeactivate()};window.addEventListener("mouseup",t),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}handleChange(){this.checked=this.formElement.checked,this.indeterminate=this.formElement.indeterminate}resetAnimationClass(){this.animationClass=""}get isRippleActive(){var e;return(null===(e=this.rippleElement)||void 0===e?void 0:e.isActive)||!1}}e([d(".mdc-checkbox")],N.prototype,"mdcRoot",void 0),e([d("input")],N.prototype,"formElement",void 0),e([t({type:Boolean,reflect:!0})],N.prototype,"checked",void 0),e([t({type:Boolean})],N.prototype,"indeterminate",void 0),e([t({type:Boolean,reflect:!0})],N.prototype,"disabled",void 0),e([t({type:String,reflect:!0})],N.prototype,"name",void 0),e([t({type:String})],N.prototype,"value",void 0),e([o,t({type:String,attribute:"aria-label"})],N.prototype,"ariaLabel",void 0),e([o,t({type:String,attribute:"aria-labelledby"})],N.prototype,"ariaLabelledBy",void 0),e([o,t({type:String,attribute:"aria-describedby"})],N.prototype,"ariaDescribedBy",void 0),e([t({type:Boolean})],N.prototype,"reducedTouchTarget",void 0),e([a()],N.prototype,"animationClass",void 0),e([a()],N.prototype,"shouldRenderRipple",void 0),e([a()],N.prototype,"focused",void 0),e([n("mwc-ripple")],N.prototype,"ripple",void 0),e([l({passive:!0})],N.prototype,"handleRippleTouchStart",null);const V=h`.mdc-checkbox{padding:calc((40px - 18px) / 2);padding:calc((var(--mdc-checkbox-ripple-size, 40px) - 18px) / 2);margin:calc((40px - 40px) / 2);margin:calc((var(--mdc-checkbox-touch-target-size, 40px) - 40px) / 2)}.mdc-checkbox .mdc-checkbox__ripple::before,.mdc-checkbox .mdc-checkbox__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-checkbox:hover .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-ripple-surface--hover .mdc-checkbox__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-checkbox.mdc-ripple-upgraded--background-focused .mdc-checkbox__ripple::before,.mdc-checkbox:not(.mdc-ripple-upgraded):focus .mdc-checkbox__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-checkbox:not(.mdc-ripple-upgraded) .mdc-checkbox__ripple::after{transition:opacity 150ms linear}.mdc-checkbox:not(.mdc-ripple-upgraded):active .mdc-checkbox__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-checkbox.mdc-checkbox--selected:hover .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-checkbox--selected.mdc-ripple-surface--hover .mdc-checkbox__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-checkbox.mdc-checkbox--selected.mdc-ripple-upgraded--background-focused .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-checkbox--selected:not(.mdc-ripple-upgraded):focus .mdc-checkbox__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-checkbox.mdc-checkbox--selected:not(.mdc-ripple-upgraded) .mdc-checkbox__ripple::after{transition:opacity 150ms linear}.mdc-checkbox.mdc-checkbox--selected:not(.mdc-ripple-upgraded):active .mdc-checkbox__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-checkbox--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected .mdc-checkbox__ripple::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-checkbox .mdc-checkbox__background{top:calc((40px - 18px) / 2);top:calc((var(--mdc-checkbox-ripple-size, 40px) - 18px) / 2);left:calc((40px - 18px) / 2);left:calc((var(--mdc-checkbox-ripple-size, 40px) - 18px) / 2)}.mdc-checkbox .mdc-checkbox__native-control{top:calc((40px - 40px) / 2);top:calc((40px - var(--mdc-checkbox-touch-target-size, 40px)) / 2);right:calc((40px - 40px) / 2);right:calc((40px - var(--mdc-checkbox-touch-tarLine truncated
:host {
--mdc-theme-secondary: var(--primary-color);
}
`]}]}}),N);var H={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},P={NOTCH_ELEMENT_PADDING:8},B={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},S=function(e){function t(i){return e.call(this,u(u({},t.defaultAdapter),i))||this}return x(t,e),Object.defineProperty(t,"strings",{get:function(){return H},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return B},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return P},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!1,configurable:!0}),t.prototype.notch=function(e){var i=t.cssClasses.OUTLINE_NOTCHED;e>0&&(e+=P.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(e),this.adapter.addClass(i)},t.prototype.closeNotch=function(){var e=t.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(e),this.adapter.removeNotchWidthProperty()},t}(b);class D extends i{constructor(){super(...arguments),this.mdcFoundationClass=S,this.width=0,this.open=!1,this.lastOpen=this.open}createAdapter(){return{addClass:e=>this.mdcRoot.classList.add(e),removeClass:e=>this.mdcRoot.classList.remove(e),setNotchWidthProperty:e=>this.notchElement.style.setProperty("width",`${e}px`),removeNotchWidthProperty:()=>this.notchElement.style.removeProperty("width")}}openOrClose(e,t){this.mdcFoundation&&(e&&void 0!==t?this.mdcFoundation.notch(t):this.mdcFoundation.closeNotch())}render(){this.openOrClose(this.open,this.width);const e=s({"mdc-notched-outline--notched":this.open});return r`
<span class="mdc-notched-outline ${e}">
<span class="mdc-notched-outline__leading"></span>
<span class="mdc-notched-outline__notch">
<slot></slot>
</span>
<span class="mdc-notched-outline__trailing"></span>
</span>`}}e([d(".mdc-notched-outline")],D.prototype,"mdcRoot",void 0),e([t({type:Number})],D.prototype,"width",void 0),e([t({type:Boolean,reflect:!0})],D.prototype,"open",void 0),e([d(".mdc-notched-outline__notch")],D.prototype,"notchElement",void 0);const Y=h`.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}:host{display:block;position:absolute;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] :host,:host([dir=rtl]){text-align:right}::slotted(.mdc-floating-label){display:inline-block;position:relative;top:17px;bottom:auto;max-width:100%}::slotted(.mdc-floating-label--float-above){text-overflow:clip}.mdc-notched-outline--upgraded ::slotted(.mdc-floating-label--float-above){max-width:calc(100% / 0.75)}.mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__leading,.mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{border-color:var(--mdc-notched-outline-border-color, var(--mdc-theme-primary, #6200ee));border-width:1px;border-width:var(--mdc-notched-outline-stroke-width, 1px)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0;padding-top:var(--mdc-notched-outline-notch-offset, 0)}`;let X=class extends D{};X.styles=[Y],X=e([f("mwc-notched-outline")],X);var M={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},U=function(e){function t(i){var d=e.call(this,u(u({},t.defaultAdapter),i))||this;return d.shakeAnimationEndHandler=function(){d.handleShakeAnimationEnd()},d}return x(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return M},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationELine truncated
<label class="mdc-text-field ${s(i)}">
${this.renderRipple()}
${this.outlined?this.renderOutline():this.renderLabel()}
${this.renderLeadingIcon()}
${this.renderPrefix()}
${this.renderInput(t)}
${this.renderSuffix()}
${this.renderTrailingIcon()}
${this.renderLineRipple()}
</label>
${this.renderHelperText(t,e)}
`}updated(e){e.has("value")&&void 0!==e.get("value")&&(this.mdcFoundation.setValue(this.value),this.autoValidate&&this.reportValidity())}renderRipple(){return this.outlined?"":r`
<span class="mdc-text-field__ripple"></span>
`}renderOutline(){return this.outlined?r`
<mwc-notched-outline
.width=${this.outlineWidth}
.open=${this.outlineOpen}
class="mdc-notched-outline">
${this.renderLabel()}
</mwc-notched-outline>`:""}renderLabel(){return this.label?r`
<span
.floatingLabelFoundation=${G(this.label)}
id="label">${this.label}</span>
`:""}renderLeadingIcon(){return this.icon?this.renderIcon(this.icon):""}renderTrailingIcon(){return this.iconTrailing?this.renderIcon(this.iconTrailing,!0):""}renderIcon(e,t=!1){return r`<i class="material-icons mdc-text-field__icon ${s({"mdc-text-field__icon--leading":!t,"mdc-text-field__icon--trailing":t})}">${e}</i>`}renderPrefix(){return this.prefix?this.renderAffix(this.prefix):""}renderSuffix(){return this.suffix?this.renderAffix(this.suffix,!0):""}renderAffix(e,t=!1){return r`<span class="mdc-text-field__affix ${s({"mdc-text-field__affix--prefix":!t,"mdc-text-field__affix--suffix":t})}">
${e}</span>`}renderInput(e){const t=-1===this.minLength?void 0:this.minLength,i=-1===this.maxLength?void 0:this.maxLength,d=this.autocapitalize?this.autocapitalize:void 0,o=this.validationMessage&&!this.isUiValid,a=this.label?"label":void 0,n=e?"helper-text":void 0,l=this.focused||this.helperPersistent||o?"helper-text":void 0;return r`
<input
aria-labelledby=${m(a)}
aria-controls="${m(n)}"
aria-describedby="${m(l)}"
class="mdc-text-field__input"
type="${this.type}"
.value="${be(this.value)}"
?disabled="${this.disabled}"
placeholder="${this.placeholder}"
?required="${this.required}"
?readonly="${this.readOnly}"
minlength="${m(t)}"
maxlength="${m(i)}"
pattern="${m(this.pattern?this.pattern:void 0)}"
min="${m(""===this.min?void 0:this.min)}"
max="${m(""===this.max?void 0:this.max)}"
step="${m(null===this.step?void 0:this.step)}"
size="${m(null===this.size?void 0:this.size)}"
name="${m(""===this.name?void 0:this.name)}"
inputmode="${m(this.inputMode)}"
autocapitalize="${m(d)}"
@input="${this.handleInputChange}"
@focus="${this.onInputFocus}"
@blur="${this.onInputBlur}">`}renderLineRipple(){return this.outlined?"":r`
<span .lineRippleFoundation=${q()}></span>
`}renderHelperText(e,t){const i=this.validationMessage&&!this.isUiValid,d={"mdc-text-field-helper-text--persistent":this.helperPersistent,"mdc-text-field-helper-text--validation-msg":i},o=this.focused||this.helperPersistent||i?void 0:"true",a=i?this.validationMessage:this.helper;return e?r`
<div class="mdc-text-field-helper-line">
<div id="helper-text"
aria-hidden="${m(o)}"
class="mdc-text-field-helper-text ${s(d)}"
>${a}</div>
${this.renderCharCounter(t)}
</div>`:""}renderCharCounter(e){const t=Math.min(this.value.length,this.maxLength);return e?r`
<span class="mdc-text-field-character-counter"
>${t} / ${this.maxLength}</span>`:""}onInputFocus(){this.focused=!0}onInputBlur(){this.focused=!1,this.reportValidity()}checkValidity(){const e=this._checkValidity(this.value);if(!e){const e=new Event("invalid",{bubbles:!1,cancelable:!0});this.dispatchEvent(e)}return e}reportValidity(){const e=this.checkValidity();return this.mdcFoundation.setValid(e),this.isUiValid=e,e}_checkValidity(e){const t=this.formElement.validity;let i=_e(t);if(this.validityTransform){const t=this.validityTransform(e,i);i=Object.assign(Object.assign({},i),t),this.mdcFoundation.setUseNativeValidation(!1)}else this.mdcFoundation.setUseNativeValidation(!0);return this._validity=i,this._validity.valid}setCustomValidity(e){this.validationMessage=e,this.formElement.setCustomValidity(e)}handleInputChange(){this.value=this.formElement.value}createAdapter(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.getRootAdapterMethods()),this.getInputAdapterMethods()),this.getLabelAdapterMethods()),this.getLineRippleAdapterMethods()),this.getOutlineAdapterMethods())}getRootAdapterMethods(){return Object.assign({registerTextFieldInteractionHandler:(e,t)=>this.addEventListener(e,t),deregisterTextFieldInteractionHandler:(e,t)=>this.removeEventListener(e,t),registerValidationAttributeChangeHandler:e=>{const t=new MutationObserver((t=>{e((e=>e.map((e=>e.attributeName)).filter((e=>e)))(t))}));return t.observe(this.formElement,{attributes:!0}),t},deregisterValidationAttributeChangeHandler:e=>e.disconnect()},I(this.mdcRoot))}getInputAdapterMethods(){return{getNativeInput:()=>this.formElement,setInputAttr:()=>{},removeInputAttr:()=>{},isFocused:()=>!!this.shadowRoot&&this.shadowRoot.activeElement===this.formElement,registerInputInteractionHandler:(e,t)=>this.formElement.addEventListener(e,t,{passive:e in ge}),deregisterInputInteractionHandler:(e,t)=>this.formElement.removeEventListener(e,t)}}getLabelAdapterMethods(){return{floatLabel:e=>this.labelElement&&this.labelElement.floatingLabelFoundation.float(e),getLabelWidth:()=>this.labelElement?this.labelElement.floatingLabelFoundation.getWidth():0,hasLabel:()=>Boolean(this.labelElement),shakeLabel:e=>this.labelElement&&this.labelElement.floatingLabelFoundation.shake(e),setLabelRequired:e=>{this.labelElement&&this.labelElement.floatingLabelFoundation.setRequired(e)}}}getLineRippleAdapterMethods(){return{activateLineRipple:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.activate()},deactivateLineRipple:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.deactivate()},setLineRippleTransformOrigin:e=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.setRippleCenter(e)}}}async getUpdateComplete(){var e;const t=await super.getUpdateComplete();return await(null===(e=this.outlineElement)||void 0===e?void 0:e.updateComplete),t}firstUpdated(){var e;super.firstUpdated(),this.mdcFoundation.setValidateOnValueChange(this.autoValidate),this.validateOnInitialRender&&this.reportValidity(),null===(e=this.outlineElement)||void 0===e||e.updateComplete.then((()=>{var e;this.outlineWidth=(null===(e=this.labelElement)||void 0===e?void 0:e.floatingLabelFoundation.getWidth())||0}))}getOutlineAdapterMethods(){return{closeOutline:()=>this.outlineElement&&(this.outlineOpen=!1),hasOutline:()=>Boolean(this.outlineElement),notchOutline:e=>{this.outlineElement&&!this.outlineOpen&&(this.outlineWidth=e,this.outlineOpen=!0)}}}async layout(){await this.updateComplete;const e=this.labelElement;if(!e)return void(this.outlineOpen=!1);const t=!!this.label&&!!this.value;if(e.floatingLabelFoundation.float(t),!this.outlined)return;this.outlineOpen=t,await this.updateComplete;const i=e.floatingLabelFoundation.getWidth();this.outlineOpen&&(this.outlineWidth=i,await this.updateComplete)}}e([d(".mdc-text-field")],ve.prototype,"mdcRoot",void 0),e([d("input")],ve.prototype,"formElement",void 0),e([d(".mdc-floating-label")],ve.prototype,"labelElement",void 0),e([d(".mdc-line-ripple")],ve.prototype,"lineRippleElement",void 0),e([d("mwc-notched-outline")],ve.prototype,"outlineElement",void 0),e([d(".mdc-notched-outline__notch")],ve.prototype,"notchElement",void 0),e([t({type:String})],ve.prototype,"value",void 0),e([t({type:String})],ve.prototype,"type",void 0),e([t({type:String})],ve.prototype,"placeholder",void 0),e([t({type:String}),A((function(e,t){void 0!==t&&this.label!==t&&this.layout()}))],ve.prototype,"label",void 0),e([t({type:String})],ve.prototype,"icon",void 0),e([t({type:String})],ve.prototype,"iconTrailing",void 0),e([t({type:Boolean,reflect:!0})],ve.prototype,"disabled",void 0),e([t({type:Boolean})],ve.prototype,"required",void 0),e([t({type:Number})],ve.prototype,"minLength",void 0),e([t({type:Number})],ve.prototype,"maxLength",void 0),e([t({type:Boolean,reflect:!0}),A((function(e,t){void 0!==t&&this.outlined!==t&&this.layout()}))],ve.prototype,"outlined",void 0),e([t({type:String})],ve.prototype,"helper",void 0),e([t({type:Boolean})Line truncated
<span
class="mdc-text-field__icon mdc-text-field__icon--${i}"
tabindex=${t?1:-1}
>
<slot name="${i}Icon"></slot>
</span>
`}},{kind:"field",static:!0,key:"styles",value:()=>[ke,h`
.mdc-text-field__input {
width: var(--ha-textfield-input-width, 100%);
}
.mdc-text-field:not(.mdc-text-field--with-leading-icon) {
padding: var(--text-field-padding, 0px 16px);
}
.mdc-text-field__affix--suffix {
padding-left: var(--text-field-suffix-padding-left, 12px);
padding-right: var(--text-field-suffix-padding-right, 0px);
padding-inline-start: var(--text-field-suffix-padding-left, 12px);
padding-inline-end: var(--text-field-suffix-padding-right, 0px);
direction: var(--direction);
}
.mdc-text-field--with-leading-icon {
padding-inline-start: var(--text-field-suffix-padding-left, 0px);
padding-inline-end: var(--text-field-suffix-padding-right, 16px);
direction: var(--direction);
}
.mdc-text-field:not(.mdc-text-field--disabled)
.mdc-text-field__affix--suffix {
color: var(--secondary-text-color);
}
.mdc-text-field__icon {
color: var(--secondary-text-color);
}
.mdc-text-field__icon--leading {
margin-inline-start: 16px;
margin-inline-end: 8px;
direction: var(--direction);
}
.mdc-floating-label:not(.mdc-floating-label--float-above) {
text-overflow: ellipsis;
width: inherit;
padding-right: 30px;
padding-inline-end: 30px;
padding-inline-start: initial;
box-sizing: border-box;
direction: var(--direction);
}
input {
text-align: var(--text-field-text-align, start);
}
/* Chrome, Safari, Edge, Opera */
:host([no-spinner]) input::-webkit-outer-spin-button,
:host([no-spinner]) input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
:host([no-spinner]) input[type="number"] {
-moz-appearance: textfield;
}
.mdc-text-field__ripple {
overflow: hidden;
}
.mdc-text-field {
overflow: var(--text-field-overflow);
}
.mdc-floating-label {
inset-inline-start: 16px !important;
inset-inline-end: initial !important;
transform-origin: var(--float-start);
direction: var(--direction);
text-align: var(--float-start);
}
.mdc-text-field--with-leading-icon.mdc-text-field--filled
.mdc-floating-label {
max-width: calc(100% - 48px);
inset-inline-start: 48px !important;
inset-inline-end: initial !important;
direction: var(--direction);
}
.mdc-text-field__input[type="number"] {
direction: var(--direction);
}
`,"rtl"===document.dir?h`
.mdc-text-field__affix--suffix,
.mdc-text-field--with-leading-icon,
.mdc-text-field__icon--leading,
.mdc-floating-label,
.mdc-text-field--with-leading-icon.mdc-text-field--filled
.mdc-floating-label,
.mdc-text-field__input[type="number"] {
direction: rtl;
}
`:h``]}]}}),ve);let ye=class extends N{};ye.styles=[V],ye=e([f("mwc-checkbox")],ye);class we extends T{constructor(){super(...arguments),this.left=!1,this.graphic="control"}render(){const e={"mdc-deprecated-list-item__graphic":this.left,"mdc-deprecated-list-item__meta":!this.left},t=this.renderText(),i=this.graphic&&"control"!==this.graphic&&!this.left?this.renderGraphic():r``,d=this.hasMeta&&this.left?this.renderMeta():r``,o=this.renderRipple();return r`
${o}
${i}
${this.left?"":t}
<span class=${s(e)}>
<mwc-checkbox
reducedTouchTarget
tabindex=${this.tabindex}
.checked=${this.selected}
?disabled=${this.disabled}
@change=${this.onChange}>
</mwc-checkbox>
</span>
${this.left?t:""}
${d}`}async onChange(e){const t=e.target;this.selected===t.checked||(this._skipPropRequest=!0,this.selected=t.checked,await this.updateComplete,this._skipPropRequest=!1)}}e([d("slot")],we.prototype,"slotElement",void 0),e([d("mwc-checkbox")],we.prototype,"checkboxElement",void 0),e([t({type:Boolean})],we.prototype,"left",void 0),e([t({type:String,reflect:!0})],we.prototype,"graphic",void 0);const Ee=h`:host(:not([twoline])){height:56px}:host(:not([left])) .mdc-deprecated-list-item__meta{height:40px;width:40px}`;p([f("ha-check-list-item")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[R,Ee,h`
:host {
--mdc-theme-secondary: var(--primary-color);
}
`]}]}}),we);const Ie=(e,t,i=!1)=>{let d;const o=(...o)=>{const a=i&&!d;clearTimeout(d),d=window.setTimeout((()=>{d=void 0,i||e(...o)}),t),a&&e(...o)};return o.cancel=()=>{clearTimeout(d)},o};export{$ as F,ve as T,fe as a,be as b,me as c,Ie as d,ke as e,G as f,q as l,xe as m,ue as p,ce as r,pe as s,ne as t,se as u,le as v};
@@ -0,0 +1 @@
var t,e;t=window,e=document,L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e);var i=L.version.split(".");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaLine truncated
@@ -0,0 +1 @@
function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(){return i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},i.apply(this,arguments)}function r(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var l=a(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=a(/Edge/i),c=a(/firefox/i),u=a(/safari/i)&&!a(/chrome/i)&&!a(/android/i),d=a(/iP(ad|od|hone)/i),h=a(/chrome/i)&&a(/android/i),f={capture:!1,passive:!1};function p(t,e,n){t.addEventListener(e,n,!l&&f)}function g(t,e,n){t.removeEventListener(e,n,!l&&f)}function v(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function m(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function b(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&v(t,e):v(t,e))||o&&t===n)return t;if(t===n)break}while(t=m(t))}return null}var y,w=/\s+/g;function E(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(w," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(w," ")}}function S(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function D(t,e){var n="";if("string"==typeof t)n=t;else do{var o=S(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function _(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function T(){var t=document.scrollingElement;return t||document.documentElement}function C(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,s,c,u,d,h;if(t!==window&&t.parentNode&&t!==T()?(a=(r=t.getBoundingClientRect()).top,s=r.left,c=r.bottom,u=r.right,d=r.height,h=r.width):(a=0,s=0,c=window.innerHeight,u=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!l))do{if(i&&i.getBoundingClientRect&&("none"!==S(i,"transform")||n&&"static"!==S(i,"position"))){var f=i.getBoundingClientRect();a-=f.top+parseInt(S(i,"border-top-width")),s-=f.left+parseInt(S(i,"border-left-width")),c=a+r.height,u=s+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=D(i||t),g=p&&p.a,v=p&&p.d;p&&(c=(a/=v)+(d/=v),u=(s/=g)+(h/=g))}return{top:a,left:s,bottom:c,right:u,width:h,height:d}}}function O(t,e,n){for(var o=I(t,!0),i=C(t)[e];o;){var r=C(o)[n];if(!("top"===n||"left"===n?i>=r:i<=r))return o;if(o===T())break;o=I(o,!1)}return!1}function x(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==Xt.ghost&&(o||a[r]!==Xt.dragged)&&b(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function N(t,e){for(var n=t.lastElementChild;n&&(n===Xt.ghost||"none"===S(n,"display")||e&&!v(n,e));)n=n.previousElementSibling;return n||null}function M(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Xt.clone||e&&!v(t,e)||n++;return n}function A(t){var e=0,n=0,o=T();if(t)do{var i=D(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function I(t,e){if(!t||!t.getBoundingClientRect)return T();var n=t,o=!1;do{if(n.clientWidth<n.scrolLine truncated
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,7 @@
import{_ as t,j as e,e as r,$ as n,ae as i,af as a,d as o,n as s}from"./main-bd0f996b.js";t([s("hacs-link")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[r({type:Boolean})],key:"newtab",value:()=>!1},{kind:"field",decorators:[r({type:Boolean})],key:"parent",value:()=>!1},{kind:"field",decorators:[r()],key:"title",value:()=>""},{kind:"field",decorators:[r()],key:"url",value:void 0},{kind:"method",key:"render",value:function(){return n`<span title=${this.title||this.url} @click=${this._open}><slot></slot></span>`}},{kind:"method",key:"_open",value:function(){var t;if(this.url.startsWith("/")&&!this.newtab)return void i(this.url,{replace:!0});const e=null===(t=this.url)||void 0===t?void 0:t.startsWith("http");let r="",n="_blank";e&&(r="noreferrer=true"),e||this.newtab||(n="_blank"),e||this.parent||(n="_parent"),a.open(this.url,n,r)}},{kind:"get",static:!0,key:"styles",value:function(){return o`
span {
cursor: pointer;
color: var(--hcv-text-color-link);
text-decoration: var(--hcv-text-decoration-link);
}
`}}]}}),e);
@@ -0,0 +1 @@
Intl.PluralRules&&"function"==typeof Intl.PluralRules.__addLocaleData&&Intl.PluralRules.__addLocaleData({data:{categories:{cardinal:["one","other"],ordinal:["one","two","few","other"]},fn:function(e,l){var a=String(e).split("."),t=!a[1],o=Number(a[0])==e,n=o&&a[0].slice(-1),r=o&&a[0].slice(-2);return l?1==n&&11!=r?"one":2==n&&12!=r?"two":3==n&&13!=r?"few":"other":1==e&&t?"one":"other"}},locale:"en"});
@@ -0,0 +1,59 @@
import{ag as o,ah as e,ai as s,aj as t,ak as i,_ as a,H as r,e as l,t as n,a7 as h,w as c,a as d,$ as p,al as _,g as y,af as u,c as m,d as v,n as g}from"./main-bd0f996b.js";import{c as f}from"./c.09c1108b.js";import"./c.eef9df6a.js";import{s as w}from"./c.7692ecb7.js";import{f as b,r as k,a as $}from"./c.fe747ba2.js";import"./c.d2f07ffa.js";import"./c.f6e28485.js";import"./c.8e28b461.js";import"./c.b764d104.js";import"./c.1ccf0777.js";let R=a([g("hacs-download-dialog")],(function(a,r){return{F:class extends r{constructor(...o){super(...o),a(this)}},d:[{kind:"field",decorators:[l()],key:"repository",value:void 0},{kind:"field",decorators:[n()],key:"_toggle",value:()=>!0},{kind:"field",decorators:[n()],key:"_installing",value:()=>!1},{kind:"field",decorators:[n()],key:"_error",value:void 0},{kind:"field",decorators:[n()],key:"_repository",value:void 0},{kind:"field",decorators:[n()],key:"_downloadRepositoryData",value:()=>({beta:!1,version:""})},{kind:"method",key:"shouldUpdate",value:function(o){return o.forEach(((o,e)=>{"hass"===e&&(this.sidebarDocked='"docked"'===window.localStorage.getItem("dockedSidebar")),"repositories"===e&&this._fetchRepository()})),o.has("sidebarDocked")||o.has("narrow")||o.has("active")||o.has("_toggle")||o.has("_error")||o.has("_repository")||o.has("_downloadRepositoryData")||o.has("_installing")}},{kind:"field",key:"_getInstallPath",value:()=>h((o=>{let e=o.local_path;return"theme"===o.category&&(e=`${e}/${o.file_name}`),e}))},{kind:"method",key:"firstUpdated",value:async function(){var o;await this._fetchRepository(),this._toggle=!1,c(this.hass,(o=>this._error=o),d.ERROR),this._downloadRepositoryData.beta=this._repository.beta,this._downloadRepositoryData.version="version"===(null===(o=this._repository)||void 0===o?void 0:o.version_or_commit)?this._repository.releases[0]:""}},{kind:"method",key:"_fetchRepository",value:async function(){this._repository=await b(this.hass,this.repository)}},{kind:"method",key:"render",value:function(){var o;if(!this.active||!this._repository)return p``;const e=this._getInstallPath(this._repository),t=[{name:"beta",selector:{boolean:{}}},{name:"version",selector:{select:{options:"version"===this._repository.version_or_commit?this._repository.releases.concat("hacs/integration"===this._repository.full_name||this._repository.hide_default_branch?[]:[this._repository.default_branch]):[],mode:"dropdown"}}}];return p`
<hacs-dialog
.active=${this.active}
.narrow=${this.narrow}
.hass=${this.hass}
.secondary=${this.secondary}
.title=${this._repository.name}
>
<div class="content">
${"version"===this._repository.version_or_commit?p`
<ha-form
.disabled=${this._toggle}
?narrow=${this.narrow}
.data=${this._downloadRepositoryData}
.schema=${t}
.computeLabel=${o=>"beta"===o.name?this.hacs.localize("dialog_download.show_beta"):this.hacs.localize("dialog_download.select_version")}
@value-changed=${this._valueChanged}
>
</ha-form>
`:""}
${this._repository.can_download?"":p`<ha-alert alert-type="error" .rtl=${f(this.hass)}>
${this.hacs.localize("confirm.home_assistant_version_not_correct",{haversion:this.hass.config.version,minversion:this._repository.homeassistant})}
</ha-alert>`}
<div class="note">
${this.hacs.localize("dialog_download.note_downloaded",{location:p`<code>'${e}'</code>`})}
${"plugin"===this._repository.category&&"storage"!==this.hacs.info.lovelace_mode?p`
<p>${this.hacs.localize("dialog_download.lovelace_instruction")}</p>
<pre>
url: ${s({repository:this._repository,skipTag:!0})}
type: module
</pre
>
`:""}
${"integration"===this._repository.category?p`<p>${this.hacs.localize("dialog_download.restart")}</p>`:""}
</div>
${null!==(o=this._error)&&void 0!==o&&o.message?p`<ha-alert alert-type="error" .rtl=${f(this.hass)}>
${this._error.message}
</ha-alert>`:""}
</div>
<mwc-button
slot="primaryaction"
?disabled=${!(this._repository.can_download&&!this._toggle&&"version"!==this._repository.version_or_commit)&&!this._downloadRepositoryData.version}
@click=${this._installRepository}
>
${this._installing?p`<ha-circular-progress active size="small"></ha-circular-progress>`:this.hacs.localize("common.download")}
</mwc-button>
</hacs-dialog>
`}},{kind:"method",key:"_valueChanged",value:async function(o){let e=!1;if(this._downloadRepositoryData.beta!==o.detail.value.beta&&(e=!0,this._toggle=!0,await _(this.hass,this.repository,o.detail.value.beta)),o.detail.value.version&&(e=!0,this._toggle=!0,await k(this.hass,this.repository,o.detail.value.version)),e){const o=await y(this.hass);await this._fetchRepository(),this.dispatchEvent(new CustomEvent("update-hacs",{detail:{repositories:o},bubbles:!0,composed:!0})),this._toggle=!1}this._downloadRepositoryData=o.detail.value}},{kind:"method",key:"_installRepository",value:async function(){var a;if(this._installing=!0,!this._repository)return;const r=this._downloadRepositoryData.version||this._repository.available_version||this._repository.default_branch;"commit"!==(null===(a=this._repository)||void 0===a?void 0:a.version_or_commit)?await $(this.hass,String(this._repository.id),r):await $(this.hass,String(this._repository.id)),this.hacs.log.debug(this._repository.category,"_installRepository"),this.hacs.log.debug(this.hacs.info.lovelace_mode,"_installRepository"),"plugin"===this._repository.category&&"storage"===this.hacs.info.lovelace_mode&&await async function(a,r,l){const n=new o("updateLovelaceResources"),h=await e(a),c=`/hacsfiles/${r.full_name.split("/")[1]}`,d=s({repository:r,version:l}),p=h.find((o=>o.url.includes(c)));n.debug({namespace:c,url:d,exsisting:p}),p&&p.url!==d?(n.debug(`Updating exsusting resource for ${c}`),await t(a,{url:d,resource_id:p.id,res_type:p.type})):h.map((o=>o.url)).includes(d)||(n.debug(`Adding ${d} to Lovelace resources`),await i(a,{url:d,res_type:"module"}))}(this.hass,this._repository,r),this._installing=!1,this.dispatchEvent(new Event("hacs-secondary-dialog-closed",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("hacs-dialog-closed",{bubbles:!0,composed:!0})),"plugin"===this._repository.category&&w(this,{title:this.hacs.localize("common.reload"),text:p`${this.hacs.localize("dialog.reload.description")}<br />${this.hacs.localize("dialog.reload.confirm")}`,dismissText:this.hacs.localize("common.cancel"),confirmText:this.hacs.localize("common.reload"),confirm:()=>{u.location.href=u.location.href}})}},{kind:"get",static:!0,key:"styles",value:function(){return[m,v`
.note {
margin-top: 12px;
}
.lovelace {
margin-top: 8px;
}
pre {
white-space: pre-line;
user-select: all;
}
`]}}]}}),r);export{R as HacsDonwloadDialog};
@@ -0,0 +1 @@
const e=e=>t=>({kind:"method",placement:"prototype",key:t.key,descriptor:{set(e){this[`__${String(t.key)}`]=e},get(){return this[`__${String(t.key)}`]},enumerable:!0,configurable:!0},finisher(o){const r=o.prototype.connectedCallback;o.prototype.connectedCallback=function(){if(r.call(this),this[t.key]){const o=this.renderRoot.querySelector(e);if(!o)return;o.scrollTop=this[t.key]}}}});export{e as r};
@@ -0,0 +1 @@
import{c as e,a as n,u as t,g as r}from"./c.743a15a1.js";import{$ as o}from"./main-bd0f996b.js";import"./c.d2f07ffa.js";var a=e((function(e,n){e.exports=function(){function e(n){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(n)}function n(e,t){return n=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},n(e,t)}function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,o,a){return r=t()?Reflect.construct:function(e,t,r){var o=[null];o.push.apply(o,t);var a=new(Function.bind.apply(e,o));return r&&n(a,r.prototype),a},r.apply(null,arguments)}function o(e){return a(e)||i(e)||s(e)||u()}function a(e){if(Array.isArray(e))return l(e)}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,n){if(e){if("string"==typeof e)return l(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,n):void 0}}function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=Object.hasOwnProperty,d=Object.setPrototypeOf,h=Object.isFrozen,p=Object.getPrototypeOf,m=Object.getOwnPropertyDescriptor,g=Object.freeze,_=Object.seal,f=Object.create,b="undefined"!=typeof Reflect&&Reflect,w=b.apply,k=b.construct;w||(w=function(e,n,t){return e.apply(n,t)}),g||(g=function(e){return e}),_||(_=function(e){return e}),k||(k=function(e,n){return r(e,o(n))});var y=S(Array.prototype.forEach),D=S(Array.prototype.pop),A=S(Array.prototype.push),x=S(String.prototype.toLowerCase),v=S(String.prototype.match),E=S(String.prototype.replace),C=S(String.prototype.indexOf),F=S(String.prototype.trim),B=S(RegExp.prototype.test),z=T(TypeError);function S(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return w(e,n,r)}}function T(e){return function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return k(e,t)}}function N(e,n,t){t=t||x,d&&d(e,null);for(var r=n.length;r--;){var o=n[r];if("string"==typeof o){var a=t(o);a!==o&&(h(n)||(n[r]=a),o=a)}e[o]=!0}return e}function O(e){var n,t=f(null);for(n in e)w(c,e,[n])&&(t[n]=e[n]);return t}function j(e,n){for(;null!==e;){var t=m(e,n);if(t){if(t.get)return S(t.get);if("function"==typeof t.value)return S(t.value)}e=p(e)}function r(e){return console.warn("fallback value for",e),null}return r}var R=g(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=g(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),I=g(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),L=g(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),$=g(["math","menclose","merror","mfenced","mfLine truncated
@@ -0,0 +1,50 @@
import{x as e,y as t,M as c,f as i,e as r,a6 as s,i as o,h as d,t as a,a3 as n,B as h,R as l,C as p,$ as u,p as m,d as b,J as w,_ as f,D as k,E as v,n as _}from"./main-bd0f996b.js";import{o as y}from"./c.8e28b461.js";var g={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},C={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},x=function(c){function i(e){return c.call(this,t(t({},i.defaultAdapter),e))||this}return e(i,c),Object.defineProperty(i,"strings",{get:function(){return C},enumerable:!1,configurable:!0}),Object.defineProperty(i,"cssClasses",{get:function(){return g},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!1,configurable:!0}),i.prototype.setChecked=function(e){this.adapter.setNativeControlChecked(e),this.updateAriaChecked(e),this.updateCheckedStyling(e)},i.prototype.setDisabled=function(e){this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(g.DISABLED):this.adapter.removeClass(g.DISABLED)},i.prototype.handleChange=function(e){var t=e.target;this.updateAriaChecked(t.checked),this.updateCheckedStyling(t.checked)},i.prototype.updateCheckedStyling=function(e){e?this.adapter.addClass(g.CHECKED):this.adapter.removeClass(g.CHECKED)},i.prototype.updateAriaChecked=function(e){this.adapter.setNativeControlAttr(C.ARIA_CHECKED_ATTR,""+!!e)},i}(c);class R extends h{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.shouldRenderRipple=!1,this.mdcFoundationClass=x,this.rippleHandlers=new l((()=>(this.shouldRenderRipple=!0,this.ripple)))}changeHandler(e){this.mdcFoundation.handleChange(e),this.checked=this.formElement.checked}createAdapter(){return Object.assign(Object.assign({},p(this.mdcRoot)),{setNativeControlChecked:e=>{this.formElement.checked=e},setNativeControlDisabled:e=>{this.formElement.disabled=e},setNativeControlAttr:(e,t)=>{this.formElement.setAttribute(e,t)}})}renderRipple(){return this.shouldRenderRipple?u`
<mwc-ripple
.accent="${this.checked}"
.disabled="${this.disabled}"
unbounded>
</mwc-ripple>`:""}focus(){const e=this.formElement;e&&(this.rippleHandlers.startFocus(),e.focus())}blur(){const e=this.formElement;e&&(this.rippleHandlers.endFocus(),e.blur())}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}render(){return u`
<div class="mdc-switch">
<div class="mdc-switch__track"></div>
<div class="mdc-switch__thumb-underlay">
${this.renderRipple()}
<div class="mdc-switch__thumb">
<input
type="checkbox"
id="basic-switch"
class="mdc-switch__native-control"
role="switch"
aria-label="${m(this.ariaLabel)}"
aria-labelledby="${m(this.ariaLabelledBy)}"
@change="${this.changeHandler}"
@focus="${this.handleRippleFocus}"
@blur="${this.handleRippleBlur}"
@mousedown="${this.handleRippleMouseDown}"
@mouseenter="${this.handleRippleMouseEnter}"
@mouseleave="${this.handleRippleMouseLeave}"
@touchstart="${this.handleRippleTouchStart}"
@touchend="${this.handleRippleDeactivate}"
@touchcancel="${this.handleRippleDeactivate}">
</div>
</div>
</div>`}handleRippleMouseDown(e){const t=()=>{window.removeEventListener("mouseup",t),this.handleRippleDeactivate()};window.addEventListener("mouseup",t),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}i([r({type:Boolean}),y((function(e){this.mdcFoundation.setChecked(e)}))],R.prototype,"checked",void 0),i([r({type:Boolean}),y((function(e){this.mdcFoundation.setDisabled(e)}))],R.prototype,"disabled",void 0),i([s,r({attribute:"aria-label"})],R.prototype,"ariaLabel",void 0),i([s,r({attribute:"aria-labelledby"})],R.prototype,"ariaLabelledBy",void 0),i([o(".mdc-switch")],R.prototype,"mdcRoot",void 0),i([o("input")],R.prototype,"formElement",void 0),i([d("mwc-ripple")],R.prototype,"ripple",void 0),i([a()],R.prototype,"shouldRenderRipple",void 0),i([n({passive:!0})],R.prototype,"handleRippleMouseDown",null),i([n({passive:!0})],R.prototype,"handleRippleTouchStart",null);const E=b`.mdc-switch__thumb-underlay{left:-14px;right:initial;top:-17px;width:48px;height:48px}[dir=rtl] .mdc-switch__thumb-underlay,.mdc-switch__thumb-underlay[dir=rtl]{left:initial;right:-14px}.mdc-switch__native-control{width:64px;height:48px}.mdc-switch{display:inline-block;position:relative;outline:none;user-select:none}.mdc-switch.mdc-switch--checked .mdc-switch__track{background-color:#018786;background-color:var(--mdc-theme-secondary, #018786)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb{background-color:#018786;background-color:var(--mdc-theme-secondary, #018786);border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track{background-color:#000;background-color:var(--mdc-theme-on-surface, #000)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb{background-color:#fff;background-color:var(--mdc-theme-surface, #fff);border-color:#fff;border-color:var(--mdc-theme-surface, #fff)}.mdc-switch__native-control{left:0;right:initial;position:absolute;top:0;margin:0;opacity:0;cursor:pointer;pointer-events:auto;transition:transform 90ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-switch__native-control,.mdc-switch__native-control[dir=rtl]{left:initial;right:0}.mdc-switch__track{box-sizing:border-box;width:36px;height:14px;border:1px solid transparent;border-radius:7px;opacity:.38;transition:opacity 90ms cubic-bezier(0.4, 0, 0.2, 1),background-color 90ms cubic-bezier(0.4, 0, 0.2, 1),border-color 90ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-switch__thumb-underlay{display:flex;position:absolute;align-items:center;justify-content:center;transform:translateX(0);transition:transform 90ms cubic-bezier(0.4, 0, 0.2, 1),background-color 90ms cubic-bezier(0.4, 0, 0.2, 1),border-color 90ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-switch__thumb{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2),0px 2px 2px 0px rgba(0, 0, 0, 0.14),0px 1px 5px 0px rgba(0,0,0,.12);box-sizing:border-box;width:20px;height:20px;border:10px solid;border-radius:50%;pointer-events:none;z-index:1}.mdc-switch--checked .mdc-switch__track{opacity:.54}.mdc-switch--checked .mdc-switch__thumb-underlay{transform:translateX(16px)}[dir=rtl] .mdc-switch--checked .mdc-switch__thumb-underlay,.mdc-switch--checked .mdc-switch__thumb-underlay[dir=rtl]{transform:translateX(-16px)}.mdc-switch--checked .mdc-switch__native-control{transform:translateX(-16px)}[dir=rtl] .mdc-switch--checked .mdc-switch__native-control,.mdc-switch--checked .mdc-switch__native-control[dir=rtl]{transform:translateX(16px)}.mdc-switch--disabled{opacity:.38;pointer-events:none}.mdc-switch--disabled .mdc-switch__thumb{border-width:1px}.mdc-switch--disabled .mdc-switch__native-control{cursor:default;pointer-events:none}:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:transparent}`;f([_("ha-switch")],(function(e,t){class c extends t{constructor(...t){super(...t),e(this)}}return{F:c,d:[{kind:"field",decorators:[r({type:Boolean})],key:"haptic",value:()=>!1},{kind:"method",key:"firstUpdated",value:function(){k(v(c.prototype),"firstUpdated",this).call(this),this.addEventListener("change",(()=>{this.haptic&&w(window,"haptic","light")}))}},{kind:"field",static:!0,key:"styles",value:()=>[E,b`
:host {
--mdc-theme-secondary: var(--switch-checked-color);
}
.mdc-switch.mdc-switch--checked .mdc-switch__thumb {
background-color: var(--switch-checked-button-color);
border-color: var(--switch-checked-button-color);
}
.mdc-switch.mdc-switch--checked .mdc-switch__track {
background-color: var(--switch-checked-track-color);
border-color: var(--switch-checked-track-color);
}
.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb {
background-color: var(--switch-unchecked-button-color);
border-color: var(--switch-unchecked-button-color);
}
.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track {
background-color: var(--switch-unchecked-track-color);
border-color: var(--switch-unchecked-track-color);
}
`]}]}}),R);
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,33 @@
import{f as e,h as t,e as a,t as o,a3 as i,j as d,R as r,$ as n,k as p,d as c,_ as s,D as l,E as m,n as x}from"./main-bd0f996b.js";class b extends d{constructor(){super(...arguments),this.mini=!1,this.exited=!1,this.disabled=!1,this.extended=!1,this.showIconAtEnd=!1,this.reducedTouchTarget=!1,this.icon="",this.label="",this.shouldRenderRipple=!1,this.useStateLayerCustomProperties=!1,this.rippleHandlers=new r((()=>(this.shouldRenderRipple=!0,this.ripple)))}render(){const e=this.mini&&!this.reducedTouchTarget,t={"mdc-fab--mini":this.mini,"mdc-fab--touch":e,"mdc-fab--exited":this.exited,"mdc-fab--extended":this.extended,"icon-end":this.showIconAtEnd},a=this.label?this.label:this.icon;return n`<button
class="mdc-fab ${p(t)}"
?disabled="${this.disabled}"
aria-label="${a}"
@mouseenter=${this.handleRippleMouseEnter}
@mouseleave=${this.handleRippleMouseLeave}
@focus=${this.handleRippleFocus}
@blur=${this.handleRippleBlur}
@mousedown=${this.handleRippleActivate}
@touchstart=${this.handleRippleStartPress}
@touchend=${this.handleRippleDeactivate}
@touchcancel=${this.handleRippleDeactivate}><!--
-->${this.renderBeforeRipple()}<!--
-->${this.renderRipple()}<!--
-->${this.showIconAtEnd?this.renderLabel():""}<!--
--><span class="material-icons mdc-fab__icon"><!--
--><slot name="icon">${this.icon}</slot><!--
--></span><!--
-->${this.showIconAtEnd?"":this.renderLabel()}<!--
-->${this.renderTouchTarget()}<!--
--></button>`}renderIcon(){return n``}renderTouchTarget(){const e=this.mini&&!this.reducedTouchTarget;return n`${e?n`<div class="mdc-fab__touch"></div>`:""}`}renderLabel(){const e=""!==this.label&&this.extended;return n`${e?n`<span class="mdc-fab__label">${this.label}</span>`:""}`}renderBeforeRipple(){return n``}renderRipple(){return this.shouldRenderRipple?n`<mwc-ripple class="ripple"
.internalUseStateLayerCustomProperties="${this.useStateLayerCustomProperties}"
></mwc-ripple>`:""}handleRippleActivate(e){const t=()=>{window.removeEventListener("mouseup",t),this.handleRippleDeactivate()};window.addEventListener("mouseup",t),this.handleRippleStartPress(e)}handleRippleStartPress(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}b.shadowRootOptions={mode:"open",delegatesFocus:!0},e([t("mwc-ripple")],b.prototype,"ripple",void 0),e([a({type:Boolean})],b.prototype,"mini",void 0),e([a({type:Boolean})],b.prototype,"exited",void 0),e([a({type:Boolean})],b.prototype,"disabled",void 0),e([a({type:Boolean})],b.prototype,"extended",void 0),e([a({type:Boolean})],b.prototype,"showIconAtEnd",void 0),e([a({type:Boolean})],b.prototype,"reducedTouchTarget",void 0),e([a()],b.prototype,"icon",void 0),e([a()],b.prototype,"label",void 0),e([o()],b.prototype,"shouldRenderRipple",void 0),e([o()],b.prototype,"useStateLayerCustomProperties",void 0),e([i({passive:!0})],b.prototype,"handleRippleStartPress",null);const f=c`:host .mdc-fab .material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}:host{outline:none;--mdc-ripple-color: currentcolor;user-select:none;-webkit-tap-highlight-color:transparent;display:inline-flex;-webkit-tap-highlight-color:transparent;display:inline-flex;outline:none;user-select:none}:host .mdc-touch-target-wrapper{display:inline}:host .mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}:host .mdc-fab{position:relative;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;user-select:none;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1)}:host .mdc-fab .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}:host .mdc-fab::-moz-focus-inner{padding:0;border:0}:host .mdc-fab:hover{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12)}:host .mdc-fab.mdc-ripple-upgraded--background-focused,:host .mdc-fab:not(.mdc-ripple-upgraded):focus{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12)}:host .mdc-fab:active,:host .mdc-fab:focus:active{box-shadow:0px 7px 8px -4px rgba(0, 0, 0, 0.2),0px 12px 17px 2px rgba(0, 0, 0, 0.14),0px 5px 22px 4px rgba(0,0,0,.12)}:host .mdc-fab:active,:host .mdc-fab:focus{outline:none}:host .mdc-fab:hover{cursor:pointer}:host .mdc-fab>svg{width:100%}:host .mdc-fab--mini{width:40px;height:40px}:host .mdc-fab--extended{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase);border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;height:48px;line-height:normal}:host .mdc-fab--extended .mdc-fab__ripple{border-radius:24px}:host .mdc-fab--extended .mdc-fab__icon{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] :host .mdc-fab--extended .mdc-fab__icon,:host .mdc-fab--extended .mdc-fab__icon[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}:host .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] :host .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon,:host .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}:host .mdc-fab--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}:host .mdc-fab--touch .mLine truncated
:host .mdc-fab--extended .mdc-fab__icon {
margin-inline-start: -8px;
margin-inline-end: 12px;
direction: var(--direction);
}
`,"rtl"===document.dir?c`
:host .mdc-fab--extended .mdc-fab__icon {
direction: rtl;
}
`:c``]}]}}),b);
@@ -0,0 +1 @@
const t=(t,e)=>{const n={};return e&&(e.type&&(n.type_filter=e.type),e.domain&&(n.domain=e.domain)),t.callWS({type:"config_entries/get",...n})};export{t as g};
@@ -0,0 +1 @@
import{B as t,d as i}from"./c.10b44dbb.js";class s{constructor(t){this._map=new Map,this._roundAverageSize=!0,this.totalSize=0,!1===(null==t?void 0:t.roundAverageSize)&&(this._roundAverageSize=!1)}set(t,i){const s=this._map.get(t)||0;this._map.set(t,i),this.totalSize+=i-s}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}const e=t=>Object.assign({type:c},t);function h(t){return"horizontal"===t?"marginLeft":"marginTop"}function a(t){return"horizontal"===t?"marginRight":"marginBottom"}function r(t,i){const s=[t,i].sort();return s[1]<=0?Math.min(...s):s[0]>=0?Math.max(...s):s[0]+s[1]}class _{constructor(){this._childSizeCache=new s,this._marginSizeCache=new s,this._metricsCache=new Map}update(t,s){var e,_;const c=new Set;Object.keys(t).forEach((e=>{const h=Number(e);this._metricsCache.set(h,t[h]),this._childSizeCache.set(h,t[h][i(s)]),c.add(h),c.add(h+1)}));for(const t of c){const i=(null===(e=this._metricsCache.get(t))||void 0===e?void 0:e[h(s)])||0,c=(null===(_=this._metricsCache.get(t-1))||void 0===_?void 0:_[a(s)])||0;this._marginSizeCache.set(t,r(i,c))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,i){var s;return(null===(s=this._metricsCache.get(t))||void 0===s?void 0:s[h(i)])||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}class c extends t{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new _,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){var i;return null!==(i=this._newPhysicalItems.get(t))&&void 0!==i?i:this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_getPosition(t){var i;const s=this._getPhysicalItem(t),{averageMarginSize:e}=this._metricsCache;return 0===t?null!==(i=this._metricsCache.getMarginSize(0))&&void 0!==i?i:e:s?s.pos:e+t*(e+this._getAverageSize())}_calculateAnchor(t,i){return t<=0?0:i>this._scrollSize-this._viewDim1?this._totalItems-1:Math.max(0,Math.min(this._totalItems-1,Math.floor((t+i)/2/this._delta)))}_getAnchor(t,i){if(0===this._physicalItems.size)return this._calculateAnchor(t,i);if(this._first<0)return console.error("_getAnchor: negative _first"),this._calculateAnchor(t,i);if(this._last<0)return console.error("_getAnchor: negative _last"),this._calculateAnchor(t,i);const s=this._getPhysicalItem(this._first),e=this._getPhysicalItem(this._last),h=s.pos;if(e.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,i);if(h>i)return this._calculateAnchor(t,i);let a=this._firstVisible-1,r=-1/0;for(;r<t;){r=this._getPhysicalItem(++a).pos+this._metricsCache.getChildSize(a)}return a}_getActiveItems(){0===this._viewDim1||0===this._totalItems?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){var t,i;const s=this._newPhysicalItems;let e,h;if(this._stable=!0,this._scrollToIndex>=0&&(this._anchorIdx=Math.min(this._scrollToIndex,this._totalItems-1),this._anchorPos=this._getPosition(this._anchorIdx),this._scrollIfNeeded()),e=this._scrollPosition-this._overhang,h=this._scrollPosition+this._viewDim1+this._overhang,h<0||e>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(e,h),this._anchorPos=this._getPosition(this._anchorIdx));let a=this._getSize(this._anchorIdx);void 0===a&&(this._stable=!1,a=this._getAverageSize());const r=null!==(t=this._metricsCache.getMarginSize(this._anchorIdx))&&void 0!==t?t:this._metricsCache.averageMarginSize,_=null!==(i=this._metricsCache.getMarginSize(this._anchorIdx+1))&&void 0!==i?i:this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=r),this._anchorIdx===this._totalItems-1&&(this._anchorPos=this._scrollSize-_-a);let c=0;for(this._anchorPos+a+_<e&&(c=e-(this._anchorPos+a+_)),this._anchorPos-r>h&&(c=h-(this._anchorPos-r)),c&&(this._scrollPosition-=c,e-=c,h-=c,this._scrollError+=c),s.set(this._anchorIdx,{pos:this._anchorPos,size:a}),thisLine truncated
@@ -0,0 +1,90 @@
import{_ as s,H as o,e as t,t as e,$ as i,m as a,w as r,a as c,r as d,g as h,b as n,s as l,c as p,d as m,n as u}from"./main-bd0f996b.js";import{c as v}from"./c.09c1108b.js";import"./c.eef9df6a.js";import"./c.9e27c745.js";import"./c.f6e28485.js";import"./c.8e28b461.js";import"./c.b764d104.js";import"./c.1ccf0777.js";let g=s([u("hacs-custom-repositories-dialog")],(function(s,o){return{F:class extends o{constructor(...o){super(...o),s(this)}},d:[{kind:"field",decorators:[t()],key:"_error",value:void 0},{kind:"field",decorators:[e()],key:"_progress",value:()=>!1},{kind:"field",decorators:[e()],key:"_addRepositoryData",value:()=>({category:void 0,repository:void 0})},{kind:"field",decorators:[e()],key:"_customRepositories",value:void 0},{kind:"method",key:"shouldUpdate",value:function(s){return s.has("narrow")||s.has("active")||s.has("_error")||s.has("_addRepositoryData")||s.has("_customRepositories")||s.has("_progress")}},{kind:"method",key:"render",value:function(){var s,o;if(!this.active)return i``;const t=[{name:"repository",selector:{text:{}}},{name:"category",selector:{select:{mode:"dropdown",options:this.hacs.info.categories.map((s=>({value:s,label:this.hacs.localize(`common.${s}`)})))}}}];return i`
<hacs-dialog
.active=${this.active}
.hass=${this.hass}
.title=${this.hacs.localize("dialog_custom_repositories.title")}
scrimClickAction
escapeKeyAction
maxWidth
>
<div class="content">
<div class="list" ?narrow=${this.narrow}>
${null!==(s=this._error)&&void 0!==s&&s.message?i`<ha-alert alert-type="error" .rtl=${v(this.hass)}>
${this._error.message}
</ha-alert>`:""}
${null===(o=this._customRepositories)||void 0===o?void 0:o.filter((s=>this.hacs.info.categories.includes(s.category))).map((s=>i`<a
href="/hacs/repository/${s.id}"
@click=${()=>this.active=!1}
>
<ha-settings-row>
<span slot="heading">${s.name}</span>
<span slot="description">${s.full_name} (${s.category})</span>
<mwc-icon-button
@click=${o=>{o.preventDefault(),this._removeRepository(String(s.id))}}
>
<ha-svg-icon class="delete" .path=${a}></ha-svg-icon>
</mwc-icon-button>
</ha-settings-row>
</a>`))}
</div>
<ha-form
?narrow=${this.narrow}
.data=${this._addRepositoryData}
.schema=${t}
.computeLabel=${s=>"category"===s.name?this.hacs.localize("dialog_custom_repositories.category"):this.hacs.localize("common.repository")}
@value-changed=${this._valueChanged}
>
</ha-form>
</div>
<mwc-button
slot="primaryaction"
raised
.disabled=${void 0===this._addRepositoryData.category||void 0===this._addRepositoryData.repository}
@click=${this._addRepository}
>
${this._progress?i`<ha-circular-progress active size="small"></ha-circular-progress>`:this.hacs.localize("common.add")}
</mwc-button>
</hacs-dialog>
`}},{kind:"method",key:"firstUpdated",value:function(){var s;r(this.hass,(s=>this._error=s),c.ERROR),this._customRepositories=null===(s=this.hacs.repositories)||void 0===s?void 0:s.filter((s=>s.custom))}},{kind:"method",key:"_valueChanged",value:function(s){this._addRepositoryData=s.detail.value}},{kind:"method",key:"_addRepository",value:async function(){if(this._error=void 0,this._progress=!0,!this._addRepositoryData.category)return void(this._error={message:this.hacs.localize("dialog_custom_repositories.no_category")});if(!this._addRepositoryData.repository)return void(this._error={message:this.hacs.localize("dialog_custom_repositories.no_repository")});await d(this.hass,this._addRepositoryData.repository,this._addRepositoryData.category);const s=await h(this.hass);this.dispatchEvent(new CustomEvent("update-hacs",{detail:{repositories:s},bubbles:!0,composed:!0})),this._customRepositories=s.filter((s=>s.custom)),this._progress=!1}},{kind:"method",key:"_removeRepository",value:async function(s){this._error=void 0,await n(this.hass,s);const o=await h(this.hass);this.dispatchEvent(new CustomEvent("update-hacs",{detail:{repositories:o},bubbles:!0,composed:!0})),this._customRepositories=o.filter((s=>s.custom))}},{kind:"get",static:!0,key:"styles",value:function(){return[l,p,m`
.list {
position: relative;
max-height: calc(100vh - 500px);
overflow: auto;
}
a {
all: unset;
}
ha-form {
display: block;
padding: 25px 0;
}
ha-form[narrow] {
background-color: var(--card-background-color);
bottom: 0;
position: absolute;
width: calc(100% - 48px);
}
ha-svg-icon {
--mdc-icon-size: 36px;
}
ha-svg-icon:not(.delete) {
margin-right: 4px;
}
ha-settings-row {
cursor: pointer;
padding: 0;
}
.list[narrow] > ha-settings-row:last-of-type {
margin-bottom: 162px;
}
.delete {
color: var(--hcv-color-error);
}
@media all and (max-width: 450px), all and (max-height: 500px) {
.list {
max-height: calc(100vh - 162px);
}
}
`]}}]}}),o);export{g as HacsCustomRepositoriesDialog};
@@ -0,0 +1,17 @@
import{_ as e,H as i,e as t,$ as o,aa as s,c as a,d as c,n}from"./main-bd0f996b.js";import{c as l}from"./c.1ccf0777.js";e([n("hacs-dialog")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t({type:Boolean})],key:"hideActions",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"scrimClickAction",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"escapeKeyAction",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"noClose",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"maxWidth",value:()=>!1},{kind:"field",decorators:[t()],key:"title",value:void 0},{kind:"method",key:"render",value:function(){return this.active?o`<ha-dialog
?maxWidth=${this.maxWidth}
?open=${this.active}
?scrimClickAction=${this.scrimClickAction}
?escapeKeyAction=${this.escapeKeyAction}
@closed=${this.closeDialog}
?hideActions=${this.hideActions}
.heading=${this.noClose?this.title:l(this.hass,this.title)}
>
<slot></slot>
<slot class="primary" name="primaryaction" slot="primaryAction"></slot>
<slot class="secondary" name="secondaryaction" slot="secondaryAction"></slot>
</ha-dialog>`:o``}},{kind:"method",key:"closeDialog",value:function(){this.active=!1,this.dispatchEvent(new CustomEvent("closed",{bubbles:!0,composed:!0}))}},{kind:"get",static:!0,key:"styles",value:function(){return[s,a,c`
ha-dialog[maxWidth] {
--mdc-dialog-max-width: calc(100vw - 32px);
}
`]}}]}}),i);
@@ -0,0 +1 @@
const s=async(s,o)=>s.connection.sendMessagePromise({type:"hacs/repository/info",repository_id:o}),o=async(s,o,e)=>s.connection.sendMessagePromise({type:"hacs/repository/download",repository:o,version:e}),e=async(s,o,e)=>s.connection.sendMessagePromise({type:"hacs/repository/version",repository:o,version:e});export{o as a,s as f,e as r};
Loaded 100 of 602 files, more files were not shown because too many files have changed in this diff. Show more