diff --git a/custom_components/browser_mod/browser_mod.js b/custom_components/browser_mod/browser_mod.js index 438b17c..e5e4937 100644 --- a/custom_components/browser_mod/browser_mod.js +++ b/custom_components/browser_mod/browser_mod.js @@ -1,4 +1,4 @@ -!function(e){var t={};function o(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,s){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(o.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(s,i,function(t){return e[t]}.bind(null,i));return s},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);let s=function(){if(window.fully&&"function"==typeof fully.getDeviceId)return fully.getDeviceId();if(!localStorage["lovelace-player-device-id"]){const e=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage["lovelace-player-device-id"]=`${e()}${e()}-${e()}${e()}`}return localStorage["lovelace-player-device-id"]}();function i(e){return document.querySelector("home-assistant").provideHass(e)}function n(){if(customElements.get("hui-view"))return!0;const e=document.createElement("partial-panel-resolver");e.hass=document.querySelector("home-assistant").hass,e.route={path:"/lovelace/"},e._updateRoutes();try{document.querySelector("home-assistant").appendChild(e)}catch(e){}finally{document.querySelector("home-assistant").removeChild(e)}return!!customElements.get("hui-view")}function r(e,t,o=null){if((e=new Event(e,{bubbles:!0,cancelable:!1,composed:!0})).detail=t||{},o)o.dispatchEvent(e);else{var s=document.querySelector("home-assistant");(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=s&&s.shadowRoot)&&s.querySelector("home-assistant-main"))&&s.shadowRoot)&&s.querySelector("app-drawer-layout partial-panel-resolver"))&&s.shadowRoot||s)&&s.querySelector("ha-panel-lovelace"))&&s.shadowRoot)&&s.querySelector("hui-root"))&&s.shadowRoot)&&s.querySelector("ha-app-layout #view"))&&s.firstElementChild)&&s.dispatchEvent(e)}}const a="custom:";function l(e,t){const o=document.createElement("hui-error-card");return o.setConfig({type:"error",error:e,origConfig:t}),o}function c(e,t){if(!t||"object"!=typeof t||!t.type)return l(`No ${e} type configured`,t);let o=t.type;if(o=o.startsWith(a)?o.substr(a.length):`hui-${o}-${e}`,customElements.get(o))return function(e,t){const o=document.createElement(e);try{o.setConfig(t)}catch(e){return l(e,t)}return o}(o,t);const s=l(`Custom element doesn't exist: ${o}.`,t);s.style.display="None";const i=setTimeout(()=>{s.style.display=""},2e3);return customElements.whenDefined(o).then(()=>{clearTimeout(i),r("ll-rebuild",{},s)}),s}function d(e,t=!1){r("hass-more-info",{entityId:e},document.querySelector("home-assistant"));const o=document.querySelector("home-assistant")._moreInfoEl;return o.large=t,o}const u=customElements.get("home-assistant-main")?Object.getPrototypeOf(customElements.get("home-assistant-main")):Object.getPrototypeOf(customElements.get("hui-view")),h=u.prototype.html,p=u.prototype.css,m=2;class y extends u{static get version(){return m}static get properties(){return{noHass:{type:Boolean}}}setConfig(e){this._config=e,this.el?this.el.setConfig(e):(this.el=this.create(e),this._hass&&(this.el.hass=this._hass),this.noHass&&i(this))}set config(e){this.setConfig(e)}set hass(e){this._hass=e,this.el&&(this.el.hass=e)}createRenderRoot(){return this}render(){return h`${this.el}`}}const v=function(e,t){const o=Object.getOwnPropertyDescriptors(t.prototype);for(const[t,s]of Object.entries(o))"constructor"!==t&&Object.defineProperty(e.prototype,t,s);const s=Object.getOwnPropertyDescriptors(t);for(const[t,o]of Object.entries(s))"prototype"!==t&&Object.defineProperty(e,t,o);const i=Object.getPrototypeOf(t),n=Object.getOwnPropertyDescriptors(i.prototype);for(const[t,o]of Object.entries(n))"constructor"!==t&&Object.defineProperty(Object.getPrototypeOf(e).prototype,t,o);const r=Object.getOwnPropertyDescriptors(i);for(const[t,o]of Object.entries(r))"prototype"!==t&&Object.defineProperty(Object.getPrototypeOf(e),t,o)},f=customElements.get("card-maker");if(!f||!f.version||f.version\n app-toolbar {\n color: var(--more-info-header-color);\n background-color: var(--more-info-header-background);\n }\n .scrollable {\n overflow: auto;\n max-width: 100% !important;\n }\n \n ${i?"":`\n \n \n
\n ${e}\n
\n
\n `}\n
\n \n \n
\n `;const l=a.querySelector(".scrollable");l.querySelector("card-maker").config=t,n.sizingTarget=l,n.large=o,n._page="none",n.shadowRoot.appendChild(a);let c={};if(s)for(var d in n.resetFit(),s)c[d]=n.style[d],n.style.setProperty(d,s[d]);return n._dialogOpenChanged=function(e){if(!e&&(this.stateObj&&this.fire("hass-more-info",{entityId:null}),this.shadowRoot==a.parentNode&&(this._page=null,this.shadowRoot.removeChild(a),s)))for(var t in n.resetFit(),c)c[t]?n.style.setProperty(t,c[t]):n.style.removeProperty(t)},n}customElements.define("browser-player",class extends u{static get properties(){return{hass:{}}}setConfig(e){this._config=e}handleMute(e){window.browser_mod.mute({})}handleVolumeChange(e){const t=parseFloat(e.target.value);window.browser_mod.set_volume({volume_level:t})}handleMoreInfo(e){d(window.browser_mod.entity_id)}handlePlayPause(e){window.browser_mod.player.paused?window.browser_mod.play({}):window.browser_mod.pause({})}render(){const e=window.browser_mod.player;return h` +!function(e){var t={};function o(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,s){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(o.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(s,i,function(t){return e[t]}.bind(null,i));return s},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);let s=function(){if(window.fully&&"function"==typeof fully.getDeviceId)return fully.getDeviceId();if(!localStorage["lovelace-player-device-id"]){const e=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage["lovelace-player-device-id"]=`${e()}${e()}-${e()}${e()}`}return localStorage["lovelace-player-device-id"]}();function i(e){return document.querySelector("home-assistant").provideHass(e)}function n(){if(customElements.get("hui-view"))return!0;const e=document.createElement("partial-panel-resolver");for(e.hass=void 0;!e.hass||!e.hass.panels;)e.hass=document.querySelector("home-assistant").hass;e.route={path:"/lovelace/"},e._updateRoutes();try{document.querySelector("home-assistant").appendChild(e)}catch(e){}finally{document.querySelector("home-assistant").removeChild(e)}return!!customElements.get("hui-view")}function r(e,t,o=null){if((e=new Event(e,{bubbles:!0,cancelable:!1,composed:!0})).detail=t||{},o)o.dispatchEvent(e);else{var s=document.querySelector("home-assistant");(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=s&&s.shadowRoot)&&s.querySelector("home-assistant-main"))&&s.shadowRoot)&&s.querySelector("app-drawer-layout partial-panel-resolver"))&&s.shadowRoot||s)&&s.querySelector("ha-panel-lovelace"))&&s.shadowRoot)&&s.querySelector("hui-root"))&&s.shadowRoot)&&s.querySelector("ha-app-layout #view"))&&s.firstElementChild)&&s.dispatchEvent(e)}}const a="custom:";function l(e,t){const o=document.createElement("hui-error-card");return o.setConfig({type:"error",error:e,origConfig:t}),o}function c(e,t){if(!t||"object"!=typeof t||!t.type)return l(`No ${e} type configured`,t);let o=t.type;if(o=o.startsWith(a)?o.substr(a.length):`hui-${o}-${e}`,customElements.get(o))return function(e,t){const o=document.createElement(e);try{o.setConfig(t)}catch(e){return l(e,t)}return o}(o,t);const s=l(`Custom element doesn't exist: ${o}.`,t);s.style.display="None";const i=setTimeout(()=>{s.style.display=""},2e3);return customElements.whenDefined(o).then(()=>{clearTimeout(i),r("ll-rebuild",{},s)}),s}function d(e,t=!1){r("hass-more-info",{entityId:e},document.querySelector("home-assistant"));const o=document.querySelector("home-assistant")._moreInfoEl;return o.large=t,o}const u=customElements.get("home-assistant-main")?Object.getPrototypeOf(customElements.get("home-assistant-main")):Object.getPrototypeOf(customElements.get("hui-view")),h=u.prototype.html,p=u.prototype.css,m=2;class y extends u{static get version(){return m}static get properties(){return{noHass:{type:Boolean}}}setConfig(e){this._config=e,this.el?this.el.setConfig(e):(this.el=this.create(e),this._hass&&(this.el.hass=this._hass),this.noHass&&i(this))}set config(e){this.setConfig(e)}set hass(e){this._hass=e,this.el&&(this.el.hass=e)}createRenderRoot(){return this}render(){return h`${this.el}`}}const v=function(e,t){const o=Object.getOwnPropertyDescriptors(t.prototype);for(const[t,s]of Object.entries(o))"constructor"!==t&&Object.defineProperty(e.prototype,t,s);const s=Object.getOwnPropertyDescriptors(t);for(const[t,o]of Object.entries(s))"prototype"!==t&&Object.defineProperty(e,t,o);const i=Object.getPrototypeOf(t),n=Object.getOwnPropertyDescriptors(i.prototype);for(const[t,o]of Object.entries(n))"constructor"!==t&&Object.defineProperty(Object.getPrototypeOf(e).prototype,t,o);const r=Object.getOwnPropertyDescriptors(i);for(const[t,o]of Object.entries(r))"prototype"!==t&&Object.defineProperty(Object.getPrototypeOf(e),t,o)},f=customElements.get("card-maker");if(!f||!f.version||f.version\n app-toolbar {\n color: var(--more-info-header-color);\n background-color: var(--more-info-header-background);\n }\n .scrollable {\n overflow: auto;\n max-width: 100% !important;\n }\n \n ${i?"":`\n \n \n
\n ${e}\n
\n
\n `}\n
\n \n \n
\n `;const l=a.querySelector(".scrollable");l.querySelector("card-maker").config=t,n.sizingTarget=l,n.large=o,n._page="none",n.shadowRoot.appendChild(a);let c={};if(s)for(var d in n.resetFit(),s)c[d]=n.style[d],n.style.setProperty(d,s[d]);return n._dialogOpenChanged=function(e){if(!e&&(this.stateObj&&this.fire("hass-more-info",{entityId:null}),this.shadowRoot==a.parentNode&&(this._page=null,this.shadowRoot.removeChild(a),s)))for(var t in n.resetFit(),c)c[t]?n.style.setProperty(t,c[t]):n.style.removeProperty(t)},n}customElements.define("browser-player",class extends u{static get properties(){return{hass:{}}}setConfig(e){this._config=e}handleMute(e){window.browser_mod.mute({})}handleVolumeChange(e){const t=parseFloat(e.target.value);window.browser_mod.set_volume({volume_level:t})}handleMoreInfo(e){d(window.browser_mod.entity_id)}handlePlayPause(e){window.browser_mod.player.paused?window.browser_mod.play({}):window.browser_mod.pause({})}render(){const e=window.browser_mod.player;return h`