iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 7.39 kB
JavaScript
/*! For license information please see 703.8d967597c7dadd94.js.LICENSE.txt */
export const __rspack_esm_id=703;export const __rspack_esm_ids=[703];export const __webpack_modules__={12451(t,e,n){n.d(e,{O:()=>i,i:()=>o.is});var s=n(5124),o=n(12130);class i extends s.WF{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}},12130(t,e,n){n.d(e,{SE:()=>l,U9:()=>d,hP:()=>s,is:()=>o});n(44114);const s=t=>t.nodeType===Node.ELEMENT_NODE;function o(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}let i=!1;const c=()=>{},r={get passive(){return i=!0,!1}};document.addEventListener("x",c,r),document.removeEventListener("x",c);const d=(t=window.document)=>{let e=t.activeElement;const n=[];if(!e)return n;for(;e&&(n.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return n},l=t=>{const e=d();if(!e.length)return!1;const n=e[e.length-1],s=new Event("check-if-focused",{bubbles:!0,composed:!0});let o=[];const i=t=>{o=t.composedPath()};return document.body.addEventListener("check-if-focused",i),n.dispatchEvent(s),document.body.removeEventListener("check-if-focused",i),-1!==o.indexOf(t)}},31886(t,e,n){n.a(t,async function(t,s){try{n.d(e,{BB:()=>o.B});n(38744);var o=n(88775),i=n(49232),c=n(78713),r=n(53834),d=n(35204),l=n(5806),u=t([o,i,c,r,d,l]);[o,i,c,r,d,l]=u.then?(await u)():u,s()}catch(t){s(t)}})},31247(t,e,n){n.d(e,{v:()=>s});n(18111),n(22489),n(61701);function s(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},4444(t,e,n){n.d(e,{JG:()=>o,Rt:()=>c,I7:()=>i});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);const s=new Set;function o(t){if(s.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",e),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function i(t){s.delete(t),0===s.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function c(t,e,n="vertical",s="smooth"){const o=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),i=o.top+e.scrollTop,c=o.left+e.scrollLeft,r=e.scrollLeft,d=e.scrollLeft+e.offsetWidth,l=e.scrollTop,u=e.scrollTop+e.offsetHeight;"horizontal"!==n&&"both"!==n||(c<r?e.scrollTo({left:c,behavior:s}):c+t.clientWidth>d&&e.scrollTo({left:c-e.offsetWidth+t.clientWidth,behavior:s})),"vertical"!==n&&"both"!==n||(i<l?e.scrollTo({top:i,behavior:s}):i+t.clientHeight>u&&e.scrollTo({top:i-e.offsetHeight+t.clientHeight,behavior:s}))}},99731(t,e,n){n.d(e,{Y:()=>l});var s=n(62826),o=n(22441),i=(n(18111),n(22489),n(20116),n(5124)),c=n(99591);class r extends i.WF{get chips(){return this.childElements.filter(t=>t instanceof c.v)}render(){return i.qy`<slot ="${this.updateTabIndices}"></slot>`}handleKeyDown(t){const e="ArrowLeft"===t.key,n="ArrowRight"===t.key,s="Home"===t.key,o="End"===t.key;if(!(e||n||s||o))return;const{chips:i}=this;if(i.length<2)return;if(t.preventDefault(),s||o){return i[s?0:i.length-1].focus({trailing:o}),void this.updateTabIndices()}const c="rtl"===getComputedStyle(this).direction?e:n,r=i.find(t=>t.matches(":focus-within"));if(!r){return(c?i[0]:i[i.length-1]).focus({trailing:!c}),void this.updateTabIndices()}const d=i.indexOf(r);let l=c?d+1:d-1;for(;l!==d;){l>=i.length?l=0:l<0&&(l=i.length-1);const t=i[l];if(!t.disabled||t.alwaysFocusable){t.focus({trailing:!c}),this.updateTabIndices();break}c?l++:l--}}updateTabIndices(){const{chips:t}=this;let e;for(const n of t){const t=n.alwaysFocusable||!n.disabled;n.matches(":focus-within")&&t?e=n:(t&&!e&&(e=n),n.tabIndex=-1)}e&&(e.tabIndex=0)}constructor(){super(),this.internals=this.attachInternals(),i.S$||(this.addEventListener("focusin",this.updateTabIndices.bind(this)),this.addEventListener("update-focus",this.updateTabIndices.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.internals.role="toolbar")}}(0,s.Cg)([(0,o.KN)()],r.prototype,"childElements",void 0);const d=i.AH`:host{display:flex;flex-wrap:wrap;gap:8px}`;let l=class extends r{};l.styles=[d],l=(0,s.Cg)([(0,o.EM)("md-chip-set")],l)},27525(t,e,n){function s(t,e=f){const n=r(t,e);return n&&(n.tabIndex=0,n.focus()),n}function o(t,e=f){const n=d(t,e);return n&&(n.tabIndex=0,n.focus()),n}function i(t,e=f){const n=c(t,e);return n&&(n.item.tabIndex=-1),n}function c(t,e=f){for(let n=0;n<t.length;n++){const s=t[n];if(0===s.tabIndex&&e(s))return{item:s,index:n}}return null}function r(t,e=f){for(const n of t)if(e(n))return n;return null}function d(t,e=f){for(let n=t.length-1;n>=0;n--){const s=t[n];if(e(s))return s}return null}function l(t,e,n=f,o=!0){if(e){const s=function(t,e,n=f,s=!0){for(let o=1;o<t.length;o++){const i=(o+e)%t.length;if(i<e&&!s)return null;const c=t[i];if(n(c))return c}return t[e]?t[e]:null}(t,e.index,n,o);return s&&(s.tabIndex=0,s.focus()),s}return s(t,n)}function u(t,e,n=f,s=!0){if(e){const o=function(t,e,n=f,s=!0){for(let o=1;o<t.length;o++){const i=(e-o+t.length)%t.length;if(i>e&&!s)return null;const c=t[i];if(n(c))return c}return t[e]?t[e]:null}(t,e.index,n,s);return o&&(o.tabIndex=0,o.focus()),o}return o(t,n)}function a(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function h(){return new Event("request-activation",{bubbles:!0,composed:!0})}function f(t){return!t.disabled}n.d(e,{A6:()=>c,Ex:()=>d,RN:()=>a,RZ:()=>o,c7:()=>r,cG:()=>h,u9:()=>u,ub:()=>i,wm:()=>l,zT:()=>s})},91450(t,e,n){n.d(e,{T:()=>h});n(18111),n(20116);var s=n(5055),o=n(63937),i=n(37540);class c{disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}constructor(t){this.G=t}}class r{get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}constructor(){this.Y=void 0,this.Z=void 0}}var d=n(42017);const l=t=>!(0,o.sO)(t)&&"function"==typeof t.then,u=1073741823;class a extends i.Kq{render(...t){return t.find(t=>!l(t))??s.c0}update(t,e){const n=this._$Cbt;let o=n.length;this._$Cbt=e;const i=this._$CK,c=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const s=e[t];if(!l(s))return this._$Cwt=t,s;t<o&&s===n[t]||(this._$Cwt=u,o=0,Promise.resolve(s).then(async t=>{for(;c.get();)await c.get();const e=i.deref();if(void 0!==e){const n=e._$Cbt.indexOf(s);n>-1&&n<e._$Cwt&&(e._$Cwt=n,e.setValue(t))}}))}return s.c0}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}constructor(){super(...arguments),this._$Cwt=u,this._$Cbt=[],this._$CK=new c(this),this._$CX=new r}}const h=(0,d.u$)(a)}};