UNPKG

iobroker.lovelace

Version:

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

2 lines 9.91 kB
/*! For license information please see 46601.0aef5076118a7bed.js.LICENSE.txt */ export const __rspack_esm_id=46601;export const __rspack_esm_ids=[46601];export const __webpack_modules__={68462(t,e,n){n.d(e,{M:()=>u});var r=n(62826),i=n(7658),o={ROOT:"mdc-form-field"},a={LABEL_SELECTOR:".mdc-form-field > label"};const l=function(t){function e(n){var i=t.call(this,(0,r.Cl)((0,r.Cl)({},e.defaultAdapter),n))||this;return i.click=function(){i.handleClick()},i}return(0,r.C6)(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return o},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},e.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){t.adapter.deactivateInputRipple()})},e}(i.I);var s=n(12451),d=n(51324),c=n(56161),f=n(5124),p=n(22441),m=n(6412);class u extends s.O{createAdapter(){return{registerInteractionHandler:(t,e)=>{this.labelEl.addEventListener(t,e)},deregisterInteractionHandler:(t,e)=>{this.labelEl.removeEventListener(t,e)},activateInputRipple:async()=>{const t=this.input;if(t instanceof d.ZS){const e=await t.ripple;e&&e.startPress()}},deactivateInputRipple:async()=>{const t=this.input;if(t instanceof d.ZS){const e=await t.ripple;e&&e.endPress()}}}}get input(){var t,e;return null!==(e=null===(t=this.slottedInputs)||void 0===t?void 0:t[0])&&void 0!==e?e:null}render(){const t={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return f.qy` <div class="mdc-form-field ${(0,m.H)(t)}"> <slot></slot> <label class="mdc-label" @click="${this._labelClick}">${this.label}</label> </div>`}click(){this._labelClick()}_labelClick(){const t=this.input;t&&(t.focus(),t.click())}constructor(){super(...arguments),this.alignEnd=!1,this.spaceBetween=!1,this.nowrap=!1,this.label="",this.mdcFoundationClass=l}}(0,r.Cg)([(0,p.MZ)({type:Boolean})],u.prototype,"alignEnd",void 0),(0,r.Cg)([(0,p.MZ)({type:Boolean})],u.prototype,"spaceBetween",void 0),(0,r.Cg)([(0,p.MZ)({type:Boolean})],u.prototype,"nowrap",void 0),(0,r.Cg)([(0,p.MZ)({type:String}),(0,c.P)(async function(t){var e;null===(e=this.input)||void 0===e||e.setAttribute("aria-label",t)})],u.prototype,"label",void 0),(0,r.Cg)([(0,p.P)(".mdc-form-field")],u.prototype,"mdcRoot",void 0),(0,r.Cg)([(0,p.KN)({slot:"",flatten:!0,selector:"*"})],u.prototype,"slottedInputs",void 0),(0,r.Cg)([(0,p.P)("label")],u.prototype,"labelEl",void 0)},38627(t,e,n){n.d(e,{R:()=>r});const r=n(5124).AH`.mdc-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{margin-left:auto;margin-right:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{margin-left:0;margin-right:auto}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}.mdc-form-field--space-between>label[dir=rtl],[dir=rtl] .mdc-form-field--space-between>label{margin:0}:host{display:inline-flex}.mdc-form-field{width:100%}::slotted(*){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}::slotted(mwc-switch){margin-right:10px}::slotted(mwc-switch[dir=rtl]),[dir=rtl] ::slotted(mwc-switch){margin-left:10px}`},25625(t,e,n){n.d(e,{H:()=>a});var r=n(9160),i=n(73420),o=n(83504);function a(t,e){const n=()=>(0,i.w)(e?.in,NaN),a=e?.additionalDigits??2,g=function(t){const e={},n=t.split(l.dateTimeDelimiter);let r;if(n.length>2)return e;/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],l.timeZoneDelimiter.test(e.date)&&(e.date=t.split(l.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length)));if(r){const t=l.timezone.exec(r);t?(e.time=r.replace(t[1],""),e.timezone=t[1]):e.time=r}return e}(t);let h;if(g.date){const t=function(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:null===o?i:100*o,restDateString:t.slice((r[1]||r[2]).length)}}(g.date,a);h=function(t,e){if(null===e)return new Date(NaN);const n=t.match(s);if(!n)return new Date(NaN);const r=!!n[4],i=f(n[1]),o=f(n[2])-1,a=f(n[3]),l=f(n[4]),d=f(n[5])-1;if(r)return function(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}(0,l,d)?function(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const i=r.getUTCDay()||7,o=7*(e-1)+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}(e,l,d):new Date(NaN);{const t=new Date(0);return function(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(m[e]||(u(t)?29:28))}(e,o,a)&&function(t,e){return e>=1&&e<=(u(t)?366:365)}(e,i)?(t.setUTCFullYear(e,o,Math.max(i,a)),t):new Date(NaN)}}(t.restDateString,t.year)}if(!h||isNaN(+h))return n();const y=+h;let b,v=0;if(g.time&&(v=function(t){const e=t.match(d);if(!e)return NaN;const n=p(e[1]),i=p(e[2]),o=p(e[3]);if(!function(t,e,n){if(24===t)return 0===e&&0===n;return n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}(n,i,o))return NaN;return n*r.s0+6e4*i+1e3*o}(g.time),isNaN(v)))return n();if(!g.timezone){const t=new Date(y+v),n=(0,o.a)(0,e?.in);return n.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),n.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),n}return b=function(t){if("Z"===t)return 0;const e=t.match(c);if(!e)return 0;const n="+"===e[1]?-1:1,i=parseInt(e[2]),o=e[3]&&parseInt(e[3])||0;if(!function(t,e){return e>=0&&e<=59}(0,o))return NaN;return n*(i*r.s0+6e4*o)}(g.timezone),isNaN(b)?n():(0,o.a)(y+v+b,e?.in)}const l={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},s=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,d=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,c=/^([+-])(\d{2})(?::?(\d{2}))?$/;function f(t){return t?parseInt(t):1}function p(t){return t&&parseFloat(t.replace(",","."))||0}const m=[31,null,31,30,31,30,31,31,30,31,30,31];function u(t){return t%400==0||t%4==0&&t%100!=0}},75751(t,e,n){n.d(e,{u:()=>l});n(45367),n(92731);var r=n(5055),i=n(42017),o=n(63937);const a=(t,e,n)=>{const r=new Map;for(let i=e;i<=n;i++)r.set(t[i],i);return r},l=(0,i.u$)(class extends i.WL{dt(t,e,n){let r;void 0===n?n=e:void 0!==e&&(r=e);const i=[],o=[];let a=0;for(const e of t)i[a]=r?r(e,a):a,o[a]=n(e,a),a++;return{values:o,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,i]){const l=(0,o.cN)(t),{values:s,keys:d}=this.dt(e,n,i);if(!Array.isArray(l))return this.ut=d,s;const c=this.ut??=[],f=[];let p,m,u=0,g=l.length-1,h=0,y=s.length-1;for(;u<=g&&h<=y;)if(null===l[u])u++;else if(null===l[g])g--;else if(c[u]===d[h])f[h]=(0,o.lx)(l[u],s[h]),u++,h++;else if(c[g]===d[y])f[y]=(0,o.lx)(l[g],s[y]),g--,y--;else if(c[u]===d[y])f[y]=(0,o.lx)(l[u],s[y]),(0,o.Dx)(t,f[y+1],l[u]),u++,y--;else if(c[g]===d[h])f[h]=(0,o.lx)(l[g],s[h]),(0,o.Dx)(t,l[u],l[g]),g--,h++;else if(void 0===p&&(p=a(d,h,y),m=a(c,u,g)),p.has(c[u]))if(p.has(c[g])){const e=m.get(d[h]),n=void 0!==e?l[e]:null;if(null===n){const e=(0,o.Dx)(t,l[u]);(0,o.lx)(e,s[h]),f[h]=e}else f[h]=(0,o.lx)(n,s[h]),(0,o.Dx)(t,l[u],n),l[e]=null;h++}else(0,o.KO)(l[g]),g--;else(0,o.KO)(l[u]),u++;for(;h<=y;){const e=(0,o.Dx)(t,f[y+1]);(0,o.lx)(e,s[h]),f[h++]=e}for(;u<=g;){const t=l[u++];null!==t&&(0,o.KO)(t)}return this.ut=d,(0,o.mY)(t,f),r.c0}constructor(t){if(super(t),t.type!==i.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})}};