UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

17 lines 19 kB
/*! For license information please see 59304.631c39b791786a40.js.LICENSE.txt */ export const __rspack_esm_id=59304;export const __rspack_esm_ids=[59304];export const __webpack_modules__={29344(e,t,i){i.a(e,async function(e,s){try{i.d(t,{A:()=>k});var r=i(5124),o=i(22441),a=i(6412),l=i(63672),n=i(34514),d=i(40991),c=i(92070),h=i(41268),p=i(9395),u=i(62676),m=i(15477),f=i(31896),g=i(17060),v=i(19978),y=e([g]);g=(y.then?(await y)():y)[0];var b=Object.defineProperty,x=Object.getOwnPropertyDescriptor,w=(e,t,i,s)=>{for(var r,o=s>1?void 0:s?x(t,i):t,a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s?r(t,i,o):r(o))||o);return s&&o&&b(t,i,o),o};let k=class extends u.q{static get validators(){return[...super.validators,(0,h.i)()]}get value(){return this._value??"on"}set value(e){this._value=e}handleSizeChange(){(0,d.b)(this.localName,this.size)}get checked(){return this.valueHasChanged?Boolean(this._checked):this._checked??this.defaultChecked}set checked(e){this._checked=Boolean(e),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleKeyDown(e){const t="rtl"===this.localize.dir();"ArrowLeft"===e.key&&(e.preventDefault(),this.checked=t,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})),"ArrowRight"===e.key&&(e.preventDefault(),this.checked=!t,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))}willUpdate(e){super.willUpdate(e),(e.has("value")||e.has("checked")||e.has("defaultChecked"))&&this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked),this.customStates.set("checked",this.checked),this.updateValidity()}handleDisabledChange(){this.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}setValue(e,t){this.checked?this.internals.setFormValue(e??"on",t):this.internals.setFormValue(null,null)}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}render(){const e=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,t=!!this.hint||!!e;return r.qy` <label part="base" class="${(0,a.H)({checked:this.checked,disabled:this.disabled})}"> <input class="input" type="checkbox" title="${this.title}" name="${(0,l.J)(this.name)}" value="${(0,l.J)(this.value)}" .checked="${(0,n.V)(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" role="switch" aria-checked="${this.checked?"true":"false"}" aria-describedby="hint" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"> <span part="control" class="switch"> <span part="thumb" class="thumb"></span> </span> <slot part="label" class="label"></slot> </label> <slot id="hint" name="hint" part="hint" class="${(0,a.H)({"has-slotted":t})}" aria-hidden="${t?"false":"true"}">${this.hint}</slot> `}constructor(){super(...arguments),this.hasSlotController=new c.X(this,"hint"),this.localize=new g.c(this),this.title="",this.name=null,this._value=this.getAttribute("value")??null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}};k.shadowRootOptions={...u.q.shadowRootOptions,delegatesFocus:!0},k.css=[m.A,f.A,v.A],w([(0,o.P)('input[type="checkbox"]')],k.prototype,"input",2),w([(0,o.MZ)()],k.prototype,"title",2),w([(0,o.MZ)({reflect:!0})],k.prototype,"name",2),w([(0,o.MZ)({reflect:!0})],k.prototype,"value",1),w([(0,o.MZ)({reflect:!0})],k.prototype,"size",2),w([(0,p.w)("size")],k.prototype,"handleSizeChange",1),w([(0,o.MZ)({type:Boolean})],k.prototype,"disabled",2),w([(0,o.MZ)({type:Boolean,attribute:!1})],k.prototype,"checked",1),w([(0,o.MZ)({type:Boolean,attribute:"checked",reflect:!0})],k.prototype,"defaultChecked",2),w([(0,o.MZ)({type:Boolean,reflect:!0})],k.prototype,"required",2),w([(0,o.MZ)({attribute:"hint"})],k.prototype,"hint",2),w([(0,o.MZ)({attribute:"with-hint",type:Boolean})],k.prototype,"withHint",2),w([(0,p.w)(["checked","defaultChecked"])],k.prototype,"handleStateChange",1),w([(0,p.w)("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"handleDisabledChange",1),k=w([(0,o.EM)("wa-switch")],k),k.disableWarning?.("change-in-update"),s()}catch(e){s(e)}})},19978(e,t,i){i.d(t,{A:()=>s});var s=i(5124).AH`:host{--height:var(--wa-form-control-toggle-size);--width:calc(var(--height) * 1.75);--thumb-size:0.75em;display:inline-flex;line-height:var(--wa-form-control-value-line-height)}label{position:relative;display:flex;align-items:center;font:inherit;color:var(--wa-form-control-value-color);vertical-align:middle;cursor:pointer}.switch{flex:0 0 auto;position:relative;display:flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--wa-form-control-background-color);border-color:var(--wa-form-control-border-color);border-radius:var(--height);border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);transition-property:translate,background,border-color,box-shadow;transition-duration:var(--wa-transition-normal);transition-timing-function:var(--wa-transition-easing)}.switch .thumb{aspect-ratio:1/1;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--wa-form-control-border-color);border-radius:50%;translate:calc((var(--width) - var(--height))/ -2);transition:inherit}.switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ 2)}.input{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.checked .switch{background-color:var(--wa-form-control-activated-color);border-color:var(--wa-form-control-activated-color)}.checked .switch .thumb{background-color:var(--wa-color-surface-default);translate:calc((var(--width) - var(--height))/ 2)}.checked .switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ -2)}label:has(> :disabled){opacity:.5;cursor:not-allowed}[part~=label]{display:inline-block;line-height:var(--height);margin-inline-start:.5em;user-select:none;-webkit-user-select:none}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)}@media (forced-colors:active){:checked+.switch .thumb,:checked:enabled+.switch:hover .thumb{background-color:ButtonText}}`},27525(e,t,i){function s(e,t=u){const i=l(e,t);return i&&(i.tabIndex=0,i.focus()),i}function r(e,t=u){const i=n(e,t);return i&&(i.tabIndex=0,i.focus()),i}function o(e,t=u){const i=a(e,t);return i&&(i.item.tabIndex=-1),i}function a(e,t=u){for(let i=0;i<e.length;i++){const s=e[i];if(0===s.tabIndex&&t(s))return{item:s,index:i}}return null}function l(e,t=u){for(const i of e)if(t(i))return i;return null}function n(e,t=u){for(let i=e.length-1;i>=0;i--){const s=e[i];if(t(s))return s}return null}function d(e,t,i=u,r=!0){if(t){const s=function(e,t,i=u,s=!0){for(let r=1;r<e.length;r++){const o=(r+t)%e.length;if(o<t&&!s)return null;const a=e[o];if(i(a))return a}return e[t]?e[t]:null}(e,t.index,i,r);return s&&(s.tabIndex=0,s.focus()),s}return s(e,i)}function c(e,t,i=u,s=!0){if(t){const r=function(e,t,i=u,s=!0){for(let r=1;r<e.length;r++){const o=(t-r+e.length)%e.length;if(o>t&&!s)return null;const a=e[o];if(i(a))return a}return e[t]?e[t]:null}(e,t.index,i,s);return r&&(r.tabIndex=0,r.focus()),r}return r(e,i)}function h(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function p(){return new Event("request-activation",{bubbles:!0,composed:!0})}function u(e){return!e.disabled}i.d(t,{A6:()=>a,Ex:()=>n,RN:()=>h,RZ:()=>r,c7:()=>l,cG:()=>p,u9:()=>c,ub:()=>o,wm:()=>d,zT:()=>s})},82553(e,t,i){i.d(t,{R:()=>s});const s=i(5124).AH`:host{display:flex;-webkit-tap-highlight-color:transparent;--md-ripple-hover-color:var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity:var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color:var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity:var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape:8px}a,button,li{background:0 0;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:0;-webkit-tap-highlight-color:transparent;width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, .3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color,var(--md-sys-color-on-surface,#1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight,var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400)));min-height:var(--md-list-item-one-line-container-height,56px);padding-top:var(--md-list-item-top-space,12px);padding-bottom:var(--md-list-item-bottom-space,12px);padding-inline-start:var(--md-list-item-leading-space,16px);padding-inline-end:var(--md-list-item-trailing-space,16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height,72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, .875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight,var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, .6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight,var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}@media(forced-colors:active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}`},58168(e,t,i){i.d(t,{n:()=>f});var s=i(62826),r=(i(75275),i(22441)),o=i(5124);class a extends o.WF{render(){return o.qy` <slot name="container"></slot> <slot class="non-text" name="start"></slot> <div class="text"> <slot name="overline" @slotchange="${this.handleTextSlotChange}"></slot> <slot class="default-slot" @slotchange="${this.handleTextSlotChange}"></slot> <slot name="headline" @slotchange="${this.handleTextSlotChange}"></slot> <slot name="supporting-text" @slotchange="${this.handleTextSlotChange}"></slot> </div> <slot class="non-text" name="trailing-supporting-text"></slot> <slot class="non-text" name="end"></slot> `}handleTextSlotChange(){let e=!1,t=0;for(const i of this.textSlots)if(l(i)&&(t+=1),t>1){e=!0;break}this.multiline=e}constructor(){super(...arguments),this.multiline=!1}}function l(e){for(const t of e.assignedNodes({flatten:!0})){const e=t.nodeType===Node.ELEMENT_NODE,i=t.nodeType===Node.TEXT_NODE&&t.textContent?.match(/\S/);if(e||i)return!0}return!1}(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],a.prototype,"multiline",void 0),(0,s.Cg)([(0,r.YG)(".text slot")],a.prototype,"textSlots",void 0);const n=o.AH`:host{color:var(--md-sys-color-on-surface,#1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, .875rem);font-weight:var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}`;let d=class extends a{};d.styles=[n],d=(0,s.Cg)([(0,r.EM)("md-item")],d);i(71970);var c=i(6412),h=i(7872),p=i(1024),u=i(27525);const m=(0,p.n)(o.WF);class f extends m{get isDisabled(){return this.disabled&&"link"!==this.type}willUpdate(e){this.href&&(this.type="link"),super.willUpdate(e)}render(){return this.renderListItem(o.qy` <md-item> <div slot="container"> ${this.renderRipple()} ${this.renderFocusRing()} </div> <slot name="start" slot="start"></slot> <slot name="end" slot="end"></slot> ${this.renderBody()} </md-item> `)}renderListItem(e){const t="link"===this.type;let i;switch(this.type){case"link":i=h.eu`a`;break;case"button":i=h.eu`button`;break;default:i=h.eu`li`}const s="text"!==this.type,r=t&&this.target?this.target:o.s6;return h.qy` <${i} id="item" tabindex="${this.isDisabled||!s?-1:0}" ?disabled=${this.isDisabled} role="listitem" aria-selected=${this.ariaSelected||o.s6} aria-checked=${this.ariaChecked||o.s6} aria-expanded=${this.ariaExpanded||o.s6} aria-haspopup=${this.ariaHasPopup||o.s6} class="list-item ${(0,c.H)(this.getRenderClasses())}" href=${this.href||o.s6} target=${r} @focus=${this.onFocus} >${e}</${i}> `}renderRipple(){return"text"===this.type?o.s6:o.qy` <md-ripple part="ripple" for="item" ?disabled="${this.isDisabled}"></md-ripple>`}renderFocusRing(){return"text"===this.type?o.s6:o.qy` <md-focus-ring @visibility-changed="${this.onFocusRingVisibilityChanged}" part="focus-ring" for="item" inward></md-focus-ring>`}onFocusRingVisibilityChanged(e){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return o.qy` <slot></slot> <slot name="overline" slot="overline"></slot> <slot name="headline" slot="headline"></slot> <slot name="supporting-text" slot="supporting-text"></slot> <slot name="trailing-supporting-text" slot="trailing-supporting-text"></slot> `}onFocus(){-1===this.tabIndex&&this.dispatchEvent((0,u.cG)())}focus(){this.listItemRoot?.focus()}click(){this.listItemRoot?this.listItemRoot.click():super.click()}constructor(){super(...arguments),this.disabled=!1,this.type="text",this.isListItem=!0,this.href="",this.target=""}}f.shadowRootOptions={...o.WF.shadowRootOptions,delegatesFocus:!0},(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)({reflect:!0})],f.prototype,"type",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,attribute:"md-list-item",reflect:!0})],f.prototype,"isListItem",void 0),(0,s.Cg)([(0,r.MZ)()],f.prototype,"href",void 0),(0,s.Cg)([(0,r.MZ)()],f.prototype,"target",void 0),(0,s.Cg)([(0,r.P)(".list-item")],f.prototype,"listItemRoot",void 0)},75751(e,t,i){i.d(t,{u:()=>l});i(45367),i(92731);var s=i(5055),r=i(42017),o=i(63937);const a=(e,t,i)=>{const s=new Map;for(let r=t;r<=i;r++)s.set(e[r],r);return s},l=(0,r.u$)(class extends r.WL{dt(e,t,i){let s;void 0===i?i=t:void 0!==t&&(s=t);const r=[],o=[];let a=0;for(const t of e)r[a]=s?s(t,a):a,o[a]=i(t,a),a++;return{values:o,keys:r}}render(e,t,i){return this.dt(e,t,i).values}update(e,[t,i,r]){const l=(0,o.cN)(e),{values:n,keys:d}=this.dt(t,i,r);if(!Array.isArray(l))return this.ut=d,n;const c=this.ut??=[],h=[];let p,u,m=0,f=l.length-1,g=0,v=n.length-1;for(;m<=f&&g<=v;)if(null===l[m])m++;else if(null===l[f])f--;else if(c[m]===d[g])h[g]=(0,o.lx)(l[m],n[g]),m++,g++;else if(c[f]===d[v])h[v]=(0,o.lx)(l[f],n[v]),f--,v--;else if(c[m]===d[v])h[v]=(0,o.lx)(l[m],n[v]),(0,o.Dx)(e,h[v+1],l[m]),m++,v--;else if(c[f]===d[g])h[g]=(0,o.lx)(l[f],n[g]),(0,o.Dx)(e,l[m],l[f]),f--,g++;else if(void 0===p&&(p=a(d,g,v),u=a(c,m,f)),p.has(c[m]))if(p.has(c[f])){const t=u.get(d[g]),i=void 0!==t?l[t]:null;if(null===i){const t=(0,o.Dx)(e,l[m]);(0,o.lx)(t,n[g]),h[g]=t}else h[g]=(0,o.lx)(i,n[g]),(0,o.Dx)(e,l[m],i),l[t]=null;g++}else(0,o.KO)(l[f]),f--;else(0,o.KO)(l[m]),m++;for(;g<=v;){const t=(0,o.Dx)(e,h[v+1]);(0,o.lx)(t,n[g]),h[g++]=t}for(;m<=f;){const e=l[m++];null!==e&&(0,o.KO)(e)}return this.ut=d,(0,o.mY)(e,h),s.c0}constructor(e){if(super(e),e.type!==r.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})}};