homeassistant/custom_components/hacs/hacs_frontend_experimental/frontend_latest/4871.cf3WhCdvOYs.js

5 lines
20 KiB
JavaScript
Raw Permalink Normal View History

2025-01-10 21:08:35 -08:00
export const id=4871;export const ids=[4871];export const modules={74376:(e,t,i)=>{var a=i(309),s=i(58417),l=i(39274),d=i(5095),o=i(95260);(0,a.Z)([(0,o.Mo)("ha-checkbox")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[l.W,d.iv`:host{--mdc-theme-secondary:var(--primary-color)}`]}]}}),s.A)},84871:(e,t,i)=>{var a=i(309),s=i(5095),l=i(95260),d=i(14516),o=i(4771),n=i(18394),r=i(36655),v=i(44672),c=i(56311),h=i(64346),u=i(29934),p=i(84728),y=(i(74376),i(54371),i(86336),i(52910),i(3017),i(80392),i(32723)),f=i(77251);const _=e=>e.selector&&!e.required&&!("boolean"in e.selector&&e.default);(0,a.Z)([(0,l.Mo)("ha-service-control")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"showAdvanced",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"hidePicker",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_value",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_checkedKeys",value:()=>new Set},{kind:"field",decorators:[(0,l.SB)()],key:"_manifest",value:void 0},{kind:"field",decorators:[(0,l.IO)("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"method",key:"willUpdate",value:function(e){var t,i,a,s,l,d,o,v;if(this.hasUpdated||(this.hass.loadBackendTranslation("services"),this.hass.loadBackendTranslation("selector")),!e.has("value"))return;const c=e.get("value");(null==c?void 0:c.service)!==(null===(t=this.value)||void 0===t?void 0:t.service)&&(this._checkedKeys=new Set);const h=this._getServiceInfo(null===(i=this.value)||void 0===i?void 0:i.service,this.hass.services);var u;null!==(a=this.value)&&void 0!==a&&a.service?null!=c&&c.service&&(0,r.M)(this.value.service)===(0,r.M)(c.service)||this._fetchManifest((0,r.M)(null===(u=this.value)||void 0===u?void 0:u.service)):this._manifest=void 0;if(h&&"target"in h&&(null!==(s=this.value)&&void 0!==s&&null!==(s=s.data)&&void 0!==s&&s.entity_id||null!==(l=this.value)&&void 0!==l&&null!==(l=l.data)&&void 0!==l&&l.area_id||null!==(d=this.value)&&void 0!==d&&null!==(d=d.data)&&void 0!==d&&d.device_id)){var p,y,f;const e={...this.value.target};!this.value.data.entity_id||null!==(p=this.value.target)&&void 0!==p&&p.entity_id||(e.entity_id=this.value.data.entity_id),!this.value.data.area_id||null!==(y=this.value.target)&&void 0!==y&&y.area_id||(e.area_id=this.value.data.area_id),!this.value.data.device_id||null!==(f=this.value.target)&&void 0!==f&&f.device_id||(e.device_id=this.value.data.device_id),this._value={...this.value,target:e,data:{...this.value.data}},delete this._value.data.entity_id,delete this._value.data.device_id,delete this._value.data.area_id}else this._value=this.value;if((null==c?void 0:c.service)!==(null===(o=this.value)||void 0===o?void 0:o.service)){let e=!1;if(this._value&&h){const t=this.value&&!("data"in this.value);this._value.data||(this._value.data={}),h.fields.forEach((i=>{i.selector&&i.required&&void 0===i.default&&"boolean"in i.selector&&void 0===this._value.data[i.key]&&(e=!0,this._value.data[i.key]=!1),t&&i.selector&&void 0!==i.default&&void 0===this._value.data[i.key]&&(e=!0,this._value.data[i.key]=i.default)}))}e&&(0,n.B)(this,"value-changed",{value:{...this._value}})}if(null!==(v=this._value)&&void 0!==v&&v.data){const e=this._yamlEditor;e&&e.value!==this._value.data&&e.setValue(this._value.data)}}},{kind:"field",key:"_getServiceInfo",value:()=>(0,d.Z)(((e,t)=>{if(!e||!t)return;const i=(0,r.M)(e),a=(0,v.p)(e);if(!(i in t))return;if(!(a in t[i]))return;const s=Object.entries(t[i][a].fields).map((([e,t])=>({key:e,...t,selector:t.selector})));return{...t[i][a],fields:s,hasSelector:s.length?s.filter((e=>e.selector)).map(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, Roboto, sans-serif)
);-webkit-font-smoothing:antialiased;font-size:var(--mdc-typography-body2-font-size, .875rem);font-weight:var(--mdc-typography-body2-font-weight,400);line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(var(--paper-item-body-two-line-min-height,72px) - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;padding:16px 0}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:8px}::slotted(ha-switch){padding:16px 0}.secondary{white-space:normal}.prefix-wrap{display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}`}}]}}),s.oi)},64346:(e,t,i)=>{i.d(t,{F3:()=>s,Lh:()=>a,t4:()=>l});const a=(e,t,i)=>e(`component.${t}.title`)||(null==i?void 0:i.name)||t,s=(e,t)=>{const i={type:"manifest/list"};return t&&(i.integrations=t),e.callWS(i)},l=(e,t)=>e.callWS({type:"manifest/get",integration:t})},84728:(e,t,i)=>{i.d(t,{R:()=>a});const a=(e,t)=>`https://${e.config.version.includes("b")?"rc":e.config.version.includes("dev")?"next":"www"}.home-assistant.io${t}`}};
//# sourceMappingURL=4871.cf3WhCdvOYs.js.map