Files
supervisor/hassio/api/panel/chunk.352e12b12df29c09b455.js
2019-04-10 22:17:11 +02:00

1 line
53 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{131:function(e,n,t){"use strict";t.r(n);t(94),t(108),t(41),t(25);var o=t(4),a=t(9),i=(t(116),t(15),t(14),t(127),t(128),t(117),t(26),t(30));function r(e){return(r="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)}function s(){var e=function(e,n){n||(n=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(['\n <style include="ha-style">\n :host,\n paper-card,\n paper-dropdown-menu {\n display: block;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n paper-item {\n width: 450px;\n }\n .card-actions {\n text-align: right;\n }\n </style>\n <paper-card heading="Audio">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n\n <paper-dropdown-menu label="Input">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedInput}}"\n >\n <template is="dom-repeat" items="[[inputDevices]]">\n <paper-item device$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n <paper-dropdown-menu label="Output">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedOutput}}"\n >\n <template is="dom-repeat" items="[[outputDevices]]">\n <paper-item device$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n </div>\n <div class="card-actions">\n <mwc-button on-click="_saveSettings">Save</mwc-button>\n </div>\n </paper-card>\n '],['\n <style include="ha-style">\n :host,\n paper-card,\n paper-dropdown-menu {\n display: block;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n paper-item {\n width: 450px;\n }\n .card-actions {\n text-align: right;\n }\n </style>\n <paper-card heading="Audio">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n\n <paper-dropdown-menu label="Input">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedInput}}"\n >\n <template is="dom-repeat" items="[[inputDevices]]">\n <paper-item device\\$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n <paper-dropdown-menu label="Output">\n <paper-listbox\n slot="dropdown-content"\n attr-for-selected="device"\n selected="{{selectedOutput}}"\n >\n <template is="dom-repeat" items="[[outputDevices]]">\n <paper-item device\\$="[[item.device]]"\n >[[item.name]]</paper-item\n >\n </template>\n </paper-listbox>\n </paper-dropdown-menu>\n </div>\n <div class="card-actions">\n <mwc-button on-click="_saveSettings">Save</mwc-button>\n </div>\n </paper-card>\n ']);return s=function(){return e},e}function c(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,n){return!n||"object"!==r(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,n){return(u=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var p=function(e){function n(){return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),l(this,d(n).apply(this,arguments))}var t,r,p;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&u(e,n)}(n,Object(i["a"])(a["a"])),t=n,p=[{key:"template",get:function(){return Object(o.a)(s())}},{key:"properties",get:function(){return{hass:Object,addon:{type:Object,observer:"addonChanged"},inputDevices:Array,outputDevices:Array,selectedInput:String,selectedOutput:String,error:String}}}],(r=[{key:"addonChanged",value:function(e){var n=this;if(this.setProperties({selectedInput:e.audio_input||"null",selectedOutput:e.audio_output||"null"}),!this.outputDevices){var t=[{device:"null",name:"-"}];this.hass.callApi("get","hassio/hardware/audio").then(function(e){var o=e.data.audio,a=Object.keys(o.input).map(function(e){return{device:e,name:o.input[e]}}),i=Object.keys(o.output).map(function(e){return{device:e,name:o.output[e]}});n.setProperties({inputDevices:t.concat(a),outputDevices:t.concat(i)})},function(){n.setProperties({inputDevices:t,outputDevices:t})})}}},{key:"_saveSettings",value:function(){var e=this;this.error=null;var n="hassio/addons/".concat(this.addon.slug,"/options");this.hass.callApi("post",n,{audio_input:"null"===this.selectedInput?null:this.selectedInput,audio_output:"null"===this.selectedOutput?null:this.selectedOutput}).then(function(){e.fire("hass-api-called",{success:!0,path:n})},function(n){e.error=n.body.message})}}])&&c(t.prototype,r),p&&c(t,p),n}();customElements.define("hassio-addon-audio",p);t(118),t(32);function f(e){return(f="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)}function h(){var e=function(e,n){n||(n=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(['\n <style include="ha-style">\n :host {\n display: block;\n }\n paper-card {\n display: block;\n }\n .card-actions {\n @apply --layout;\n @apply --layout-justified;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n iron-autogrow-textarea {\n width: 100%;\n font-family: monospace;\n }\n .syntaxerror {\n color: var(--google-red-500);\n }\n </style>\n <paper-card heading="Config">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n <iron-autogrow-textarea\n id="config"\n value="{{config}}"\n ></iron-autogrow-textarea>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/options"\n data="[[resetData]]"\n >Reset to defaults</ha-call-api-button\n >\n <mwc-button on-click="saveTapped" disabled="[[!configParsed]]"\n >Save</mwc-button\n >\n </div>\n </paper-card>\n ']);return h=function(){return e},e}function b(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function m(e,n){return!n||"object"!==f(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,n){return(y=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var v=function(e){function n(){return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),m(this,g(n).apply(this,arguments))}var t,i,r;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&y(e,n)}(n,a["a"]),t=n,r=[{key:"template",get:function(){return Object(o.a)(h())}},{key:"properties",get:function(){return{hass:Object,addon:{type:Object,observer:"addonChanged"},addonSlug:String,config:{type:String,observer:"configChanged"},configParsed:Object,error:String,resetData:{type:Object,value:{options:null}}}}}],(i=[{key:"addonChanged",value:function(e){this.config=e?JSON.stringify(e.options,null,2):""}},{key:"configChanged",value:function(e){try{this.$.config.classList.remove("syntaxerror"),this.configParsed=JSON.parse(e)}catch(e){this.$.config.classList.add("syntaxerror"),this.configParsed=null}}},{key:"saveTapped",value:function(){var e=this;this.error=null,this.hass.callApi("post","hassio/addons/".concat(this.addonSlug,"/options"),{options:this.configParsed}).catch(function(n){e.error=n.body.message})}}])&&b(t.prototype,i),r&&b(t,r),n}();customElements.define("hassio-addon-config",v);t(28),t(119);var w=t(8),O=t(65);function k(e){return(k="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)}function _(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function j(e,n){return!n||"object"!==k(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function S(e,n,t){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,n,t){var o=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=P(e)););return e}(e,n);if(o){var a=Object.getOwnPropertyDescriptor(o,n);return a.get?a.get.call(t):a.value}})(e,n,t||e)}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,n){return(x=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var A=customElements.get("iron-icon"),T=!1,I=function(e){function n(){var e,t;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(t=j(this,(e=P(n)).call.apply(e,[this].concat(a))))._iconsetName=void 0,t}var o,a,i;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&x(e,n)}(n,A),o=n,(a=[{key:"listen",value:function(e,o,a){S(P(n.prototype),"listen",this).call(this,e,o,a),T||"mdi"!==this._iconsetName||(T=!0,t.e(8).then(t.bind(null,132)))}}])&&_(o.prototype,a),i&&_(o,i),n}();function C(e){return(C="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)}function E(){var e=M(["\n .badge-container {\n display: inline-block;\n text-align: center;\n vertical-align: top;\n }\n .label-badge {\n position: relative;\n display: block;\n margin: 0 auto;\n width: var(--ha-label-badge-size, 2.5em);\n text-align: center;\n height: var(--ha-label-badge-size, 2.5em);\n line-height: var(--ha-label-badge-size, 2.5em);\n font-size: var(--ha-label-badge-font-size, 1.5em);\n border-radius: 50%;\n border: 0.1em solid var(--ha-label-badge-color, var(--primary-color));\n color: var(--label-badge-text-color, rgb(76, 76, 76));\n\n white-space: nowrap;\n background-color: var(--label-badge-background-color, white);\n background-size: cover;\n transition: border 0.3s ease-in-out;\n }\n .label-badge .value {\n font-size: 90%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .label-badge .value.big {\n font-size: 70%;\n }\n .label-badge .label {\n position: absolute;\n bottom: -1em;\n /* Make the label as wide as container+border. (parent_borderwidth / font-size) */\n left: -0.2em;\n right: -0.2em;\n line-height: 1em;\n font-size: 0.5em;\n }\n .label-badge .label span {\n box-sizing: border-box;\n max-width: 100%;\n display: inline-block;\n background-color: var(--ha-label-badge-color, var(--primary-color));\n color: var(--ha-label-badge-label-color, white);\n border-radius: 1em;\n padding: 9% 16% 8% 16%; /* mostly apitalized text, not much descenders => bit more top margin */\n font-weight: 500;\n overflow: hidden;\n text-transform: uppercase;\n text-overflow: ellipsis;\n transition: background-color 0.3s ease-in-out;\n text-transform: var(--ha-label-badge-label-text-transform, uppercase);\n }\n .label-badge .label.big span {\n font-size: 90%;\n padding: 10% 12% 7% 12%; /* push smaller text a bit down to center vertically */\n }\n .badge-container .title {\n margin-top: 1em;\n font-size: var(--ha-label-badge-title-font-size, 0.9em);\n width: var(--ha-label-badge-title-width, 5em);\n font-weight: var(--ha-label-badge-title-font-weight, 400);\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n }\n "]);return E=function(){return e},e}function R(){var e=M(['\n <div class="title">',"</div>\n "]);return R=function(){return e},e}function z(){var e=M(['\n <div\n class="','"\n >\n <span>',"</span>\n </div>\n "]);return z=function(){return e},e}function D(){var e=M(["\n <span>","</span>\n "]);return D=function(){return e},e}function H(){var e=M(['\n <ha-icon .icon="','"></ha-icon>\n ']);return H=function(){return e},e}function N(){var e=M(['\n <div class="badge-container">\n <div class="label-badge" id="badge">\n <div\n class="','"\n >\n ',"\n ","\n </div>\n ","\n </div>\n ","\n </div>\n "]);return N=function(){return e},e}function M(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function U(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function L(e,n){return!n||"object"!==C(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function $(e,n,t){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,n,t){var o=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=q(e)););return e}(e,n);if(o){var a=Object.getOwnPropertyDescriptor(o,n);return a.get?a.get.call(t):a.value}})(e,n,t||e)}function q(e){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,n){return(B=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}customElements.define("ha-icon",I);var W=function(e){function n(){var e,t;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(t=L(this,(e=q(n)).call.apply(e,[this].concat(a)))).value=void 0,t.icon=void 0,t.label=void 0,t.description=void 0,t.image=void 0,t}var t,o,a;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&B(e,n)}(n,w["a"]),t=n,a=[{key:"properties",get:function(){return{value:{},icon:{},label:{},description:{},image:{}}}},{key:"styles",get:function(){return[Object(w.c)(E())]}}],(o=[{key:"render",value:function(){return Object(w.e)(N(),Object(O.a)({value:!0,big:Boolean(this.value&&this.value.length>4)}),!this.icon||this.value||this.image?"":Object(w.e)(H(),this.icon),this.value&&!this.image?Object(w.e)(D(),this.value):"",this.label?Object(w.e)(z(),Object(O.a)({label:!0,big:this.label.length>5}),this.label):"",this.description?Object(w.e)(R(),this.description):"")}},{key:"updated",value:function(e){$(q(n.prototype),"updated",this).call(this,e),e.has("image")&&(this.shadowRoot.getElementById("badge").style.backgroundImage=this.image?"url(".concat(this.image,")"):"")}}])&&U(t.prototype,o),a&&U(t,a),n}();customElements.define("ha-label-badge",W);t(70);var J=t(42),X=t(100);t(35);function F(e){return(F="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)}function G(){var e=function(e,n){n||(n=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(['\n <style include="ha-style">\n :host {\n display: block;\n }\n paper-card {\n display: block;\n margin-bottom: 16px;\n }\n paper-card.warning {\n background-color: var(--google-red-500);\n color: white;\n --paper-card-header-color: white;\n }\n paper-card.warning mwc-button {\n color: white !important;\n }\n .warning {\n color: var(--google-red-500);\n }\n .addon-header {\n @apply --paper-font-headline;\n }\n .light-color {\n color: var(--secondary-text-color);\n }\n .addon-version {\n float: right;\n font-size: 15px;\n vertical-align: middle;\n }\n .description {\n margin-bottom: 16px;\n }\n .logo img {\n max-height: 60px;\n margin: 16px 0;\n display: block;\n }\n .state div {\n width: 150px;\n display: inline-block;\n }\n paper-toggle-button {\n display: inline;\n }\n iron-icon.running {\n color: var(--paper-green-400);\n }\n iron-icon.stopped {\n color: var(--google-red-300);\n }\n ha-call-api-button {\n font-weight: 500;\n color: var(--primary-color);\n }\n .right {\n float: right;\n }\n ha-markdown img {\n max-width: 100%;\n }\n .red {\n --ha-label-badge-color: var(--label-badge-red, #df4c1e);\n }\n .blue {\n --ha-label-badge-color: var(--label-badge-blue, #039be5);\n }\n .green {\n --ha-label-badge-color: var(--label-badge-green, #0da035);\n }\n .yellow {\n --ha-label-badge-color: var(--label-badge-yellow, #f4b400);\n }\n .security {\n margin-bottom: 16px;\n }\n .security h3 {\n margin-bottom: 8px;\n font-weight: normal;\n }\n .security ha-label-badge {\n cursor: pointer;\n margin-right: 4px;\n --iron-icon-height: 45px;\n }\n </style>\n\n <template is="dom-if" if="[[computeUpdateAvailable(addon)]]">\n <paper-card heading="Update available! 🎉">\n <div class="card-content">\n <hassio-card-content\n hass="[[hass]]"\n title="[[addon.name]] [[addon.last_version]] is available"\n description="You are currently running version [[addon.version]]"\n icon="hassio:arrow-up-bold-circle"\n icon-class="update"\n ></hassio-card-content>\n <template is="dom-if" if="[[!addon.available]]">\n <p>This update is no longer compatible with your system.</p>\n </template>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/update"\n disabled="[[!addon.available]]"\n >\n Update\n </ha-call-api-button\n >\n <template is="dom-if" if="[[addon.changelog]]">\n <mwc-button on-click="openChangelog">Changelog</mwc-button>\n </template>\n </div>\n </paper-card>\n </template>\n\n <paper-card>\n <div class="card-content">\n <div class="addon-header">\n [[addon.name]]\n <div class="addon-version light-color">\n <template is="dom-if" if="[[addon.version]]">\n [[addon.version]]\n <template is="dom-if" if="[[isRunning]]">\n <iron-icon\n title="Add-on is running"\n class="running"\n icon="hassio:circle"\n ></iron-icon>\n </template>\n <template is="dom-if" if="[[!isRunning]]">\n <iron-icon\n title="Add-on is stopped"\n class="stopped"\n icon="hassio:circle"\n ></iron-icon>\n </template>\n </template>\n <template is="dom-if" if="[[!addon.version]]">\n [[addon.last_version]]\n </template>\n </div>\n </div>\n <div class="description light-color">\n [[addon.description]].<br />\n Visit\n <a href="[[addon.url]]" target="_blank">[[addon.name]] page</a> for\n details.\n </div>\n <template is="dom-if" if="[[addon.logo]]">\n <a href="[[addon.url]]" target="_blank" class="logo">\n <img src="/api/hassio/addons/[[addonSlug]]/logo" />\n </a>\n </template>\n <template is="dom-if" if="[[!addon.protected]]">\n <paper-card heading="Warning: Protection mode is disabled!" class="warning">\n <div class="card-content">\n Protection mode on this addon is disabled! This gives the add-on full access to the entire system, which adds security risks, and could damage your system when used incorrectly. Only disable the protection mode if you know, need AND trust the source of this addon.\n </div>\n <div class="card-actions">\n <mwc-button on-click="protectionToggled">Enable Protection mode</mwc-button>\n </div>\n </div>\n </paper-card>\n </template>\n <div class="security">\n <h3>Addon Security Rating</h3>\n <div class="description light-color">\n Hass.io provides a security rating to each of the add-ons, which indicates the risks involved when using this add-on. The more access an addon requires on your system, the lower the score, thus raising the possible security risks.\n </div>\n <ha-label-badge\n class$="[[computeSecurityClassName(addon.rating)]]"\n on-click="showMoreInfo"\n id="rating"\n value="[[addon.rating]]"\n label="rating"\n description=""\n ></ha-label-badge>\n <template is="dom-if" if="[[addon.host_network]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="host_network"\n icon="hassio:network"\n label="host"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.full_access]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="full_access"\n icon="hassio:chip"\n label="hardware"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.homeassistant_api]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="homeassistant_api"\n icon="hassio:home-assistant"\n label="hass"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[computeHassioApi(addon)]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="hassio_api"\n icon="hassio:home-assistant"\n label="hassio"\n description="[[addon.hassio_role]]"\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.docker_api]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="docker_api"\n icon="hassio:docker"\n label="docker"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.host_pid]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="host_pid"\n icon="hassio:pound"\n label="host pid"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.apparmor]]">\n <ha-label-badge\n on-click="showMoreInfo"\n class$="[[computeApparmorClassName(addon.apparmor)]]"\n id="apparmor"\n icon="hassio:shield"\n label="apparmor"\n description="[[addon.apparmor]]"\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.auth_api]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="auth_api"\n icon="hassio:key"\n label="auth"\n description=""\n ></ha-label-badge>\n </template>\n <template is="dom-if" if="[[addon.ingress]]">\n <ha-label-badge\n on-click="showMoreInfo"\n id="ingress"\n icon="hassio:cursor-default-click-outline"\n label="ingress"\n description=""\n ></ha-label-badge>\n </template>\n </div>\n <template is="dom-if" if="[[addon.version]]">\n <div class="state">\n <div>Start on boot</div>\n <paper-toggle-button\n on-change="startOnBootToggled"\n checked="[[computeStartOnBoot(addon.boot)]]"\n ></paper-toggle-button>\n </div>\n <div class="state">\n <div>Auto update</div>\n <paper-toggle-button\n on-change="autoUpdateToggled"\n checked="[[addon.auto_update]]"\n ></paper-toggle-button>\n </div>\n <div class="state">\n <div>Protection mode</div>\n <paper-toggle-button\n on-change="protectionToggled"\n checked="[[addon.protected]]"\n ></paper-toggle-button>\n </div>\n </template>\n </div>\n <div class="card-actions">\n <template is="dom-if" if="[[addon.version]]">\n <mwc-button class="warning" on-click="_unistallClicked"\n >Uninstall</mwc-button\n >\n <template is="dom-if" if="[[addon.build]]">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/rebuild"\n >Rebuild</ha-call-api-button\n >\n </template>\n <template is="dom-if" if="[[isRunning]]">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/restart"\n >Restart</ha-call-api-button\n >\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/stop"\n >Stop</ha-call-api-button\n >\n </template>\n <template is="dom-if" if="[[!isRunning]]">\n <ha-call-api-button\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/start"\n >Start</ha-call-api-button\n >\n </template>\n <template\n is="dom-if"\n if="[[computeShowWebUI(addon.ingress, addon.webui, isRunning)]]"\n >\n <a\n href="[[pathWebui(addon.webui)]]"\n tabindex="-1"\n target="_blank"\n class="right"\n ><mwc-button>Open web UI</mwc-button></a\n >\n </template>\n <template\n is="dom-if"\n if="[[computeShowIngressUI(addon.ingress, isRunning)]]"\n >\n <mwc-button\n tabindex="-1"\n class="right"\n on-click="openIngress"\n >Open web UI</mwc-button>\n </template>\n </template>\n <template is="dom-if" if="[[!addon.version]]">\n <template is="dom-if" if="[[!addon.available]]">\n <p class="warning">This addon is not available on your system.</p>\n </template>\n <ha-call-api-button\n disabled="[[!addon.available]]"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/install"\n >Install</ha-call-api-button\n >\n </template>\n </div>\n </paper-card>\n <template is="dom-if" if="[[addon.long_description]]">\n <paper-card>\n <div class="card-content">\n <ha-markdown content="[[addon.long_description]]"></ha-markdown>\n </div>\n </paper-card>\n </template>\n ']);return G=function(){return e},e}function V(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Y(e,n){return!n||"object"!==F(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Q(e,n){return(Q=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var Z={rating:{title:"Addon Security Rating",description:"Hass.io provides a security rating to each of the add-ons, which indicates the risks involved when using this add-on. The more access an addon requires on your system, the lower the score, thus raising the possible security risks.\n\nA score is on a scale from 1 to 6. Where 1 is the lowest score (considered the most insecure and highest risk) and a score of 6 is the highest score (considered the most secure and lowest risk)."},host_network:{title:"Host Network",description:"Add-ons usually run in their own isolated network layer, which prevents them from accessing the network of the host operating system. In some cases, this network isolation can limit add-ons in providing their services and therefore, the isolation can be lifted by the add-on author, giving the addon full access to the network capabilities of the host machine. This gives the addon more networking capabilities but lowers the security, hence, the security rating of the add-on will be lowered when this option is used by the addon."},homeassistant_api:{title:"Home Assistant API Access",description:"This add-on is allowed to access your running Home Assistant instance directly via the Home Assistant API. This mode handles authentication for the addon as well, which enables an addon to interact with Home Assistant without the need for additional authentication tokens."},full_access:{title:"Full Hardware Access",description:"This addon is given full access to the hardware of your system, by request of the addon author. Access is comparable to the privileged mode in Docker. Since this opens up possible security risks, this feature impacts the addon security score negatively.\n\nThis level of access is not granted automatically and needs to be confirmed by you. To do this, you need to disable the protection mode on the addon manually. Only disable the protection mode if you know, need AND trust the source of this addon."},hassio_api:{title:"Hass.io API Access",description:"The addon was given access to the Hass.io API, by request of the addon author. By default, the addon can access general version information of your system. When the addon requests 'manager' or 'admin' level access to the API, it will gain access to control multiple parts of your Hass.io system. This permission is indicated by this badge and will impact the security score of the addon negatively."},docker_api:{title:"Full Docker Access",description:"The addon author has requested the addon to have management access to the Docker instance running on your system. This mode gives the addon full access and control to your entire Hass.io system, which adds security risks, and could damage your system when misused. Therefore, this feature impacts the addon security score negatively.\n\nThis level of access is not granted automatically and needs to be confirmed by you. To do this, you need to disable the protection mode on the addon manually. Only disable the protection mode if you know, need AND trust the source of this addon."},host_pid:{title:"Host Processes Namespace",description:"Usually, the processes the addon runs, are isolated from all other system processes. The addon author has requested the addon to have access to the system processes running on the host system instance, and allow the addon to spawn processes on the host system as well. This mode gives the addon full access and control to your entire Hass.io system, which adds security risks, and could damage your system when misused. Therefore, this feature impacts the addon security score negatively.\n\nThis level of access is not granted automatically and needs to be confirmed by you. To do this, you need to disable the protection mode on the addon manually. Only disable the protection mode if you know, need AND trust the source of this addon."},apparmor:{title:"AppArmor",description:"AppArmor ('Application Armor') is a Linux kernel security module that restricts addons capabilities like network access, raw socket access, and permission to read, write, or execute specific files.\n\nAddon authors can provide their security profiles, optimized for the addon, or request it to be disabled. If AppArmor is disabled, it will raise security risks and therefore, has a negative impact on the security score of the addon."},auth_api:{title:"Home Assistant Authentication",description:"An addon can authenticate users against Home Assistant, allowing add-ons to give users the possibility to log into applications running inside add-ons, using their Home Assistant username/password. This badge indicates if the add-on author requests this capability."},ingress:{title:"Ingress",description:"This add-on is using Ingress to embed its interface securely into Home Assistant."}},ee=function(e){function n(){return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),Y(this,K(n).apply(this,arguments))}var t,r,s;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&Q(e,n)}(n,Object(i["a"])(a["a"])),t=n,s=[{key:"template",get:function(){return Object(o.a)(G())}},{key:"properties",get:function(){return{hass:Object,addon:Object,addonSlug:String,isRunning:{type:Boolean,computed:"computeIsRunning(addon)"}}}}],(r=[{key:"computeIsRunning",value:function(e){return e&&"started"===e.state}},{key:"computeUpdateAvailable",value:function(e){return e&&!e.detached&&e.version&&e.version!==e.last_version}},{key:"computeHassioApi",value:function(e){return e.hassio_api&&("manager"===e.hassio_role||"admin"===e.hassio_role)}},{key:"computeApparmorClassName",value:function(e){return"profile"===e?"green":"disable"===e?"red":""}},{key:"pathWebui",value:function(e){return e&&e.replace("[HOST]",document.location.hostname)}},{key:"computeShowWebUI",value:function(e,n,t){return!e&&n&&t}},{key:"openIngress",value:function(){Object(J.a)(this,"/hassio/ingress/".concat(this.addon.slug))}},{key:"computeShowIngressUI",value:function(e,n){return e&&n}},{key:"computeStartOnBoot",value:function(e){return"auto"===e}},{key:"computeSecurityClassName",value:function(e){return e>4?"green":e>2?"yellow":"red"}},{key:"startOnBootToggled",value:function(){var e={boot:"auto"===this.addon.boot?"manual":"auto"};this.hass.callApi("POST","hassio/addons/".concat(this.addonSlug,"/options"),e)}},{key:"autoUpdateToggled",value:function(){var e={auto_update:!this.addon.auto_update};this.hass.callApi("POST","hassio/addons/".concat(this.addonSlug,"/options"),e)}},{key:"protectionToggled",value:function(){var e={protected:!this.addon.protected};this.hass.callApi("POST","hassio/addons/".concat(this.addonSlug,"/security"),e),this.set("addon.protected",!this.addon.protected)}},{key:"showMoreInfo",value:function(e){var n=e.target.getAttribute("id");Object(X.a)(this,{title:Z[n].title,content:Z[n].description})}},{key:"openChangelog",value:function(){var e=this;this.hass.callApi("get","hassio/addons/".concat(this.addonSlug,"/changelog")).then(function(e){return e},function(){return"Error getting changelog"}).then(function(n){Object(X.a)(e,{title:"Changelog",content:n})})}},{key:"_unistallClicked",value:function(){var e=this;if(confirm("Are you sure you want to uninstall this add-on?")){var n="hassio/addons/".concat(this.addonSlug,"/uninstall"),t={path:n};this.hass.callApi("post",n).then(function(e){t.success=!0,t.response=e},function(e){t.success=!1,t.response=e}).then(function(){e.fire("hass-api-called",t)})}}}])&&V(t.prototype,r),s&&V(t,s),n}();customElements.define("hassio-addon-info",ee);var ne=t(101);function te(e){return(te="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)}function oe(){var e=function(e,n){n||(n=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(['\n <style include="ha-style">\n :host,\n paper-card {\n display: block;\n }\n pre {\n overflow-x: auto;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n }\n </style>\n ','\n <paper-card heading="Log">\n <div class="card-content" id="content"></div>\n <div class="card-actions">\n <mwc-button on-click="refresh">Refresh</mwc-button>\n </div>\n </paper-card>\n ']);return oe=function(){return e},e}function ae(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ie(e,n){return!n||"object"!==te(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function se(e,n){return(se=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var ce=function(e){function n(){return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),ie(this,re(n).apply(this,arguments))}var t,i,r;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&se(e,n)}(n,a["a"]),t=n,r=[{key:"template",get:function(){return Object(o.a)(oe(),ne.a)}},{key:"properties",get:function(){return{hass:Object,addonSlug:{type:String,observer:"addonSlugChanged"}}}}],(i=[{key:"addonSlugChanged",value:function(e){var n=this;this.hass?this.refresh():setTimeout(function(){n.addonChanged(e)},0)}},{key:"refresh",value:function(){var e=this;this.hass.callApi("get","hassio/addons/".concat(this.addonSlug,"/logs")).then(function(n){for(;e.$.content.lastChild;)e.$.content.removeChild(e.$.content.lastChild);e.$.content.appendChild(Object(ne.b)(n))})}}])&&ae(t.prototype,i),r&&ae(t,r),n}();customElements.define("hassio-addon-logs",ce);t(45);function le(e){return(le="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)}function de(){var e=function(e,n){n||(n=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(['\n <style include="ha-style">\n :host {\n display: block;\n }\n paper-card {\n display: block;\n }\n .errors {\n color: var(--google-red-500);\n margin-bottom: 16px;\n }\n .card-actions {\n @apply --layout;\n @apply --layout-justified;\n }\n </style>\n <paper-card heading="Network">\n <div class="card-content">\n <template is="dom-if" if="[[error]]">\n <div class="errors">[[error]]</div>\n </template>\n\n <table>\n <tbody>\n <tr>\n <th>Container</th>\n <th>Host</th>\n <th>Description</th>\n </tr>\n <template is="dom-repeat" items="[[config]]">\n <tr>\n <td>[[item.container]]</td>\n <td>\n <paper-input\n value="{{item.host}}"\n no-label-float=""\n ></paper-input>\n </td>\n <td>[[item.description]]</td>\n </tr>\n </template>\n </tbody>\n </table>\n </div>\n <div class="card-actions">\n <ha-call-api-button\n class="warning"\n hass="[[hass]]"\n path="hassio/addons/[[addonSlug]]/options"\n data="[[resetData]]"\n >Reset to defaults</ha-call-api-button\n >\n <mwc-button on-click="saveTapped">Save</mwc-button>\n </div>\n </paper-card>\n ']);return de=function(){return e},e}function ue(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function pe(e,n){return!n||"object"!==le(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function fe(e){return(fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function he(e,n){return(he=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var be=function(e){function n(){return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),pe(this,fe(n).apply(this,arguments))}var t,r,s;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&he(e,n)}(n,Object(i["a"])(a["a"])),t=n,s=[{key:"template",get:function(){return Object(o.a)(de())}},{key:"properties",get:function(){return{hass:Object,addonSlug:String,config:Object,addon:{type:Object,observer:"addonChanged"},error:String,resetData:{type:Object,value:{network:null}}}}}],(r=[{key:"addonChanged",value:function(e){if(e){var n=e.network||{},t=e.network_description||{},o=Object.keys(n).map(function(e){return{container:e,host:n[e],description:t[e]}});this.config=o.sort(function(e,n){return e.host-n.host})}}},{key:"saveTapped",value:function(){var e=this;this.error=null;var n={};this.config.forEach(function(e){n[e.container]=parseInt(e.host)});var t="hassio/addons/".concat(this.addonSlug,"/options");this.hass.callApi("post",t,{network:n}).then(function(){e.fire("hass-api-called",{success:!0,path:t})},function(n){e.error=n.body.message})}}])&&ue(t.prototype,r),s&&ue(t,s),n}();function me(e){return(me="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)}function ge(){var e=function(e,n){n||(n=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}(['\n <style>\n :host {\n color: var(--primary-text-color);\n --paper-card-header-color: var(--primary-text-color);\n }\n .content {\n padding: 24px 0 32px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n hassio-addon-info,\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config {\n margin-bottom: 24px;\n width: 600px;\n }\n hassio-addon-logs {\n max-width: calc(100% - 8px);\n min-width: 600px;\n }\n @media only screen and (max-width: 600px) {\n hassio-addon-info,\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config,\n hassio-addon-logs {\n max-width: 100%;\n min-width: 100%;\n }\n }\n </style>\n <hass-subpage header="Hass.io: add-on details" hassio>\n <div class="content">\n <hassio-addon-info\n hass="[[hass]]"\n addon="[[addon]]"\n addon-slug="[[addonSlug]]"\n ></hassio-addon-info>\n\n <template is="dom-if" if="[[addon.version]]">\n <hassio-addon-config\n hass="[[hass]]"\n addon="[[addon]]"\n addon-slug="[[addonSlug]]"\n ></hassio-addon-config>\n\n <template is="dom-if" if="[[addon.audio]]">\n <hassio-addon-audio\n hass="[[hass]]"\n addon="[[addon]]"\n ></hassio-addon-audio>\n </template>\n\n <template is="dom-if" if="[[addon.network]]">\n <hassio-addon-network\n hass="[[hass]]"\n addon="[[addon]]"\n addon-slug="[[addonSlug]]"\n ></hassio-addon-network>\n </template>\n\n <hassio-addon-logs\n hass="[[hass]]"\n addon-slug="[[addonSlug]]"\n ></hassio-addon-logs>\n </template>\n </div>\n </hass-subpage>\n ']);return ge=function(){return e},e}function ye(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ve(e,n){return!n||"object"!==me(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function we(e,n,t){return(we="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,n,t){var o=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=Oe(e)););return e}(e,n);if(o){var a=Object.getOwnPropertyDescriptor(o,n);return a.get?a.get.call(t):a.value}})(e,n,t||e)}function Oe(e){return(Oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ke(e,n){return(ke=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}customElements.define("hassio-addon-network",be);var _e=function(e){function n(){return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),ve(this,Oe(n).apply(this,arguments))}var t,i,r;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&ke(e,n)}(n,a["a"]),t=n,r=[{key:"template",get:function(){return Object(o.a)(ge())}},{key:"properties",get:function(){return{hass:Object,route:{type:Object,observer:"routeDataChanged"},addonSlug:{type:String,computed:"_computeSlug(route)"},addon:Object}}}],(i=[{key:"ready",value:function(){var e=this;we(Oe(n.prototype),"ready",this).call(this),this.addEventListener("hass-api-called",function(n){return e.apiCalled(n)})}},{key:"apiCalled",value:function(e){var n=e.detail.path;n&&("uninstall"===n.substr(n.lastIndexOf("/")+1)?history.back():this.routeDataChanged(this.route))}},{key:"routeDataChanged",value:function(e){var n=this,t=e.path.substr(1);this.hass.callApi("get","hassio/addons/".concat(t,"/info")).then(function(e){n.addon=e.data},function(){n.addon=null})}},{key:"_computeSlug",value:function(e){return e.path.substr(1)}}])&&ye(t.prototype,i),r&&ye(t,r),n}();customElements.define("hassio-addon-view",_e)},70:function(e,n,t){"use strict";var o=t(9),a=t(30);function i(e){return(i="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)}function r(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,n){return!n||"object"!==i(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function c(e,n,t){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,n,t){var o=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=l(e)););return e}(e,n);if(o){var a=Object.getOwnPropertyDescriptor(o,n);return a.get?a.get.call(t):a.value}})(e,n,t||e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,n){return(d=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var u=null,p=["svg","path"],f=function(e){function n(){return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),s(this,l(n).apply(this,arguments))}var i,f,h;return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&d(e,n)}(n,Object(a["a"])(o["a"])),i=n,h=[{key:"properties",get:function(){return{content:{type:String,observer:"_render"},allowSvg:{type:Boolean,value:!1}}}}],(f=[{key:"connectedCallback",value:function(){var e=this;c(l(n.prototype),"connectedCallback",this).call(this),this._scriptLoaded=0,this._renderScheduled=!1,this._resize=function(){return e.fire("iron-resize")},u||(u=Promise.all([t.e(10),t.e(7)]).then(t.bind(null,102))),u.then(function(n){var t=n.marked,o=n.filterXSS;e.marked=t,e.filterXSS=o,e._scriptLoaded=1},function(){e._scriptLoaded=2}).then(function(){return e._render()})}},{key:"_render",value:function(){var e=this;0===this._scriptLoaded||this._renderScheduled||(this._renderScheduled=!0,Promise.resolve().then(function(){if(e._renderScheduled=!1,1===e._scriptLoaded){e.innerHTML=e.filterXSS(e.marked(e.content,{gfm:!0,tables:!0,breaks:!0}),{onIgnoreTag:e.allowSvg?function(e,n){return p.indexOf(e)>=0?n:null}:null}),e._resize();for(var n=document.createTreeWalker(e,1,null,!1);n.nextNode();){var t=n.currentNode;"A"===t.tagName&&t.host!==document.location.host?t.target="_blank":"IMG"===t.tagName&&t.addEventListener("load",e._resize)}}else 2===e._scriptLoaded&&(e.innerText=e.content)}))}}])&&r(i.prototype,f),h&&r(i,h),n}();customElements.define("ha-markdown",f)}}]);