2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
|
"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([[392],{26874:function(e,t,r){r.d(t,{v:function(){return a}});var o=r(99312),i=r(81043),a=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(t){var r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!navigator.clipboard){e.next=9;break}return e.prev=1,e.next=4,navigator.clipboard.writeText(t);case 4:return e.abrupt("return");case 7:e.prev=7,e.t0=e.catch(1);case 9:(r=document.createElement("textarea")).value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r);case 15:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()},25799:function(e,t,r){var o,i=r(88962),a=r(46097),n=r(99312),d=r(81043),s=r(33368),l=r(71650),u=r(68308),c=r(82390),h=r(69205),f=r(91808),p=r(34541),v=r(47838),m=(r(97393),r(46798),r(94570),r(51358),r(47084),r(5239),r(98490),r(36513),r(51467),r(46349),r(70320),r(65974),r(76843),r(22859),r(91989),r(5095)),y=r(95260),k=r(14516),_=r(18394),C=r(86089),b={key:"Mod-s",run:function(e){return(0,_.B)(e.dom,"editor-save"),!0}},g=function(e){var t=document.createElement("ha-icon");return t.icon=e.label,t};(0,f.Z)([(0,y.Mo)("ha-code-editor")],(function(e,t){var f,Z,M=function(t){function r(){var t;(0,l.Z)(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=(0,u.Z)(this,r,[].concat(i)),e((0,c.Z)(t)),t}return(0,h.Z)(r,t),(0,s.Z)(r)}(t);return{F:M,d:[{kind:"field",key:"codemirror",value:void 0},{kind:"field",decorators:[(0,y.Cb)()],key:"mode",value:function(){return"yaml"}},{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,y.Cb)({type:Boolean})],key:"autofocus",value:function(){return!1}},{kind:"field",decorators:[(0,y.Cb)({type:Boolean})],key:"readOnly",value:function(){return!1}},{kind:"field",decorators:[(0,y.Cb)({type:Boolean,attribute:"autocomplete-entities"})],key:"autocompleteEntities",value:function(){return!1}},{kind:"field",decorators:[(0,y.Cb)({type:Boolean,attribute:"autocomplete-icons"})],key:"autocompleteIcons",value:function(){return!1}},{kind:"field",decorators:[(0,y.Cb)({type:Boolean})],key:"error",value:function(){return!1}},{kind:"field",decorators:[(0,y.SB)()],key:"_value",value:function(){return""}},{kind:"field",key:"_loadedCodeMirror",value:void 0},{kind:"field",key:"_iconList",value:void 0},{kind:"set",key:"value",value:function(e){this._value=e}},{kind:"get",key:"value",value:function(){return this.codemirror?this.codemirror.state.doc.toString():this._value}},{kind:"get",key:"hasComments",value:function(){if(!this.codemirror||!this._loadedCodeMirror)return!1;var e=this._loadedCodeMirror.highlightingFor(this.codemirror.state,[this._loadedCodeMirror.tags.comment]);return!!this.renderRoot.querySelector("span.".concat(e))}},{kind:"method",key:"connectedCallback",value:function(){(0,p.Z)((0,v.Z)(M.prototype),"connectedCallback",this).call(this),this.hasUpdated&&this.requestUpdate(),this.addEventListener("keydown",C.U),this.codemirror&&!1!==this.autofocus&&this.codemirror.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){var e=this;(0,p.Z)((0,v.Z)(M.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keydown",C.U),this.updateComplete.then((function(){e.codemirror.destroy(),delete e.codemirror}))}},{kind:"method",key:"scheduleUpdate",value:(Z=(0,d.Z)((0,n.Z)().mark((function e(){var t;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this._loadedCodeMirror)||void 0===t){e.next=4;break}e.next=7;break;case 4:return e.next=6,Promise.all([r.e(2771),r.e(2562),r.e(9146)]).then(r.bind(r,59146));case 6:this._loadedCodeMirror=e.sent;case 7:(0,p.Z)((0,v.Z)(M.prototype),"scheduleUpdate",this).call(this);case 8:case"end":return e.stop()}}),e,this)}))),function(){return Z.apply(this,arguments)})},{kind:"method",key:"update",value:function(e){if((0,p.Z)((0,v.Z)(M.prototype),"update",this).call(this,e),this.codemirror){var t,r=[];if(e.has("mode")&&r.push({effects:this._loadedCodeMir
|
||
|
//# sourceMappingURL=392.-NQDQjjOY1M.js.map
|