iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
18 lines • 48 kB
JavaScript
/*! For license information please see 52874.3bb1397ff5ec790a.js.LICENSE.txt */
export const __webpack_ids__=["52874"];export const __webpack_modules__={30509:function(e,t,i){var o=i(44249),a=i(57243),n=i(15093);(0,o.Z)([(0,n.Mo)("ha-settings-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"slim",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"three-line"})],key:"threeLine",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"wrap-heading",reflect:!0})],key:"wrapHeading",value:()=>!1},{kind:"method",key:"render",value:function(){return a.dy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${!this.threeLine}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `}},{kind:"field",static:!0,key:"styles",value:()=>a.iv`:host{display:flex;padding:0 16px;align-content:normal;align-self:auto;align-items:center}.body{padding-top:8px;padding-bottom:8px;padding-left:0;padding-inline-start:0;padding-right:16px;padding-inline-end:16px;overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:var(--paper-item-body-three-line-min-height,88px)}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:4px;font-family:var(
--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}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`}]}}),a.oi)},17170:function(e,t,i){i.a(e,(async function(e,o){try{i.r(t),i.d(t,{HaSpinner:()=>h});var a=i(44249),n=i(72621),s=i(97677),r=i(43580),l=i(57243),d=i(15093),c=e([s]);s=(c.then?(await c)():c)[0];let h=(0,a.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value:()=>[r.Z,l.iv`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`]}]}}),s.Z);o()}catch(e){o(e)}}))},91728:function(e,t,i){i.a(e,(async function(e,t){try{var o=i(44249),a=i(72621),n=(i(92745),i(56820),i(99619),i(57243)),s=i(15093),r=i(62037),l=i(6973),d=(i(78999),i(52043),e([r,l]));[r,l]=d.then?(await d)():d;const c=["config","visibility","layout"];(0,o.Z)([(0,s.Mo)("hui-card-element-editor")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"show-visibility-tab"})],key:"showVisibilityTab",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"sectionConfig",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_currTab",value:()=>c[0]},{kind:"method",key:"getConfigElement",value:async function(){const e=await(0,r.Do)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}},{kind:"method",key:"getConfigForm",value:async function(){const e=await(0,r.Do)(this.configElementType);if(e&&e.getConfigForm)return e.getConfigForm()}},{kind:"method",key:"_configChanged",value:function(e){e.stopPropagation(),this.value=e.detail.value}},{kind:"get",key:"_showLayoutTab",value:function(){return!!this.sectionConfig&&(void 0===this.sectionConfig.type||"grid"===this.sectionConfig.type)}},{kind:"method",key:"renderConfigElement",value:function(){const e=["config"];if(this.showVisibilityTab&&e.push("visibility"),this._showLayoutTab&&e.push("layout"),1===e.length)return(0,a.Z)(i,"renderConfigElement",this,3)([]);let t=n.Ld;switch(this._currTab){case"config":t=n.dy`${(0,a.Z)(i,"renderConfigElement",this,3)([])}`;break;case"visibility":t=n.dy` <hui-card-visibility-editor .hass="${this.hass}" .config="${this.value}" -changed="${this._configChanged}"></hui-card-visibility-editor> `;break;case"layout":t=n.dy` <hui-card-layout-editor .hass="${this.hass}" .config="${this.value}" .sectionConfig="${this.sectionConfig}" -changed="${this._configChanged}"> </hui-card-layout-editor> `}return n.dy` <mwc-tab-bar .activeIndex="${c.indexOf(this._currTab)}" :activated="${this._handleTabChanged}"> ${e.map((e=>n.dy` <mwc-tab .label="${this.hass.localize(`ui.panel.lovelace.editor.edit_card.tab_${e}`)}"> </mwc-tab> `))} </mwc-tab-bar> ${t} `}},{kind:"method",key:"_handleTabChanged",value:function(e){const t=c[e.detail.index];t!==this._currTab&&(this._currTab=t)}},{kind:"field",static:!0,key:"styles",value:()=>[n.iv`mwc-tab-bar{text-transform:uppercase;margin-bottom:16px;border-bottom:1px solid var(--divider-color)}`]}]}}),l.k);t()}catch(e){t(e)}}))},78999:function(e,t,i){var o=i(44249),a=i(72621),n=i(57243),s=i(15093),r=i(69634),l=i(27486),d=i(36522),c=i(88128),h=i(49976),u=(i(59826),i(34273),i(9359),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(54380)),p=i(35359);const v=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","PageUp","PageDown","Home","End"]);(0,o.Z)([(0,s.Mo)("ha-grid-layout-slider")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"vertical",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:"touch-action"})],key:"touchAction",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"tooltip-mode"})],key:"tooltipMode",value:()=>"interaction"},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"step",value:()=>1},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"min",value:()=>1},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"max",value:()=>4},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"range",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"pressed",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"tooltipVisible",value:()=>!1},{kind:"field",key:"_mc",value:void 0},{kind:"get",key:"_range",value:function(){return this.range??this.max}},{kind:"method",key:"_valueToPercentage",value:function(e){return this._boundedValue(e)/this._range}},{kind:"method",key:"_percentageToValue",value:function(e){return this._range*e}},{kind:"method",key:"_steppedValue",value:function(e){return Math.round(e/this.step)*this.step}},{kind:"method",key:"_boundedValue",value:function(e){return Math.min(Math.max(e,this.min),this.max)}},{kind:"method",key:"firstUpdated",value:function(e){(0,a.Z)(i,"firstUpdated",this,3)([e]),this.setupListeners(),this.setAttribute("role","slider"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("value")){const e=this._steppedValue(this.value??0);this.setAttribute("aria-valuenow",e.toString()),this.setAttribute("aria-valuetext",e.toString())}if(e.has("min")&&this.setAttribute("aria-valuemin",this.min.toString()),e.has("max")&&this.setAttribute("aria-valuemax",this.max.toString()),e.has("vertical")){const e=this.vertical?"vertical":"horizontal";this.setAttribute("aria-orientation",e)}}},{kind:"method",key:"connectedCallback",value:function(){(0,a.Z)(i,"connectedCallback",this,3)([]),this.setupListeners()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),this.destroyListeners()}},{kind:"field",decorators:[(0,s.IO)("#slider")],key:"slider",value:void 0},{kind:"method",key:"setupListeners",value:function(){if(this.slider&&!this._mc){let e;this._mc=new u.dK(this.slider,{touchAction:this.touchAction??(this.vertical?"pan-x":"pan-y")}),this._mc.add(new u.Ce({threshold:10,direction:u.oM,enable:!0})),this._mc.add(new u.Uw({event:"singletap"})),this._mc.on("panstart",(()=>{this.disabled||(this.pressed=!0,this._showTooltip(),e=this.value)})),this._mc.on("pancancel",(()=>{this.disabled||(this.pressed=!1,this._hideTooltip(),this.value=e)})),this._mc.on("panmove",(e=>{if(this.disabled)return;const t=this._getPercentageFromEvent(e);this.value=this._percentageToValue(t);const i=this._steppedValue(this._boundedValue(this.value));(0,d.B)(this,"slider-moved",{value:i})})),this._mc.on("panend",(e=>{if(this.disabled)return;this.pressed=!1,this._hideTooltip();const t=this._getPercentageFromEvent(e),i=this._percentageToValue(t);this.value=this._steppedValue(this._boundedValue(i)),(0,d.B)(this,"slider-moved",{value:void 0}),(0,d.B)(this,"value-changed",{value:this.value})})),this._mc.on("singletap",(e=>{if(this.disabled)return;const t=this._getPercentageFromEvent(e),i=this._percentageToValue(t);this.value=this._steppedValue(this._boundedValue(i)),(0,d.B)(this,"value-changed",{value:this.value})})),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("keyup",this._handleKeyUp)}}},{kind:"method",key:"destroyListeners",value:function(){this._mc&&(this._mc.destroy(),this._mc=void 0),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("keyup",this._handleKeyUp)}},{kind:"get",key:"_tenPercentStep",value:function(){return Math.max(this.step,(this.max-this.min)/10)}},{kind:"method",key:"_handleKeyDown",value:function(e){if(v.has(e.code)){switch(e.preventDefault(),e.code){case"ArrowRight":case"ArrowUp":this.value=this._boundedValue((this.value??0)+this.step);break;case"ArrowLeft":case"ArrowDown":this.value=this._boundedValue((this.value??0)-this.step);break;case"PageUp":this.value=this._steppedValue(this._boundedValue((this.value??0)+this._tenPercentStep));break;case"PageDown":this.value=this._steppedValue(this._boundedValue((this.value??0)-this._tenPercentStep));break;case"Home":this.value=this.min;break;case"End":this.value=this.max}(0,d.B)(this,"slider-moved",{value:this.value})}}},{kind:"method",key:"_handleKeyUp",value:function(e){v.has(e.code)&&(e.preventDefault(),(0,d.B)(this,"value-changed",{value:this.value}))}},{kind:"field",key:"_tooltipTimeout",value:void 0},{kind:"method",key:"_showTooltip",value:function(){null!=this._tooltipTimeout&&window.clearTimeout(this._tooltipTimeout),this.tooltipVisible=!0}},{kind:"method",key:"_hideTooltip",value:function(e){e?this._tooltipTimeout=window.setTimeout((()=>{this.tooltipVisible=!1}),e):this.tooltipVisible=!1}},{kind:"field",key:"_getPercentageFromEvent",value(){return e=>{if(this.vertical){const t=e.center.y,i=e.target.getBoundingClientRect().top,o=e.target.clientHeight;return Math.max(Math.min(1,(t-i)/o),0)}const t=e.center.x,i=e.target.getBoundingClientRect().left,o=e.target.clientWidth;return Math.max(Math.min(1,(t-i)/o),0)}}},{kind:"method",key:"_renderTooltip",value:function(){if("never"===this.tooltipMode)return n.Ld;const e=this.vertical?"left":"top",t="always"===this.tooltipMode||this.tooltipVisible&&"interaction"===this.tooltipMode,i=this._boundedValue(this._steppedValue(this.value??0));return n.dy` <span aria-hidden="true" class="tooltip ${(0,p.$)({visible:t,[e]:!0})}"> ${i} </span> `}},{kind:"method",key:"render",value:function(){return n.dy` <div class="container${(0,p.$)({pressed:this.pressed})}" style="${(0,r.V)({"--value":`${this._valueToPercentage(this.value??0)}`})}"> <div id="slider" class="slider"> <div class="track"> <div class="background"></div> <div class="active" style="${(0,r.V)({"--min":""+this.min/this._range,"--max":""+(1-this.max/this._range)})}"></div> </div> ${Array(this._range/this.step).fill(0).map(((e,t)=>{const i=t/(this._range/this.step);return this.min>=t*this.step||t*this.step>this.max?n.Ld:n.dy` <div class="dot" style="${(0,r.V)({"--value":`${i}`})}"></div> `}))} ${void 0!==this.value?n.dy`<div class="handle"></div>`:n.Ld} ${this._renderTooltip()} </div> </div> `}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:block;--grid-layout-slider:36px;height:var(--grid-layout-slider);width:100%;outline:0;transition:box-shadow 180ms ease-in-out}:host(:focus-visible){box-shadow:0 0 0 2px var(--primary-color)}:host([vertical]){width:var(--grid-layout-slider);height:100%}.container{position:relative;height:100%;width:100%}.slider{position:relative;height:100%;width:100%;transform:translateZ(0);overflow:visible;cursor:pointer}.slider *{pointer-events:none;user-select:none}.track{position:absolute;inset:0;margin:auto;height:16px;width:100%;border-radius:8px;overflow:hidden}:host([vertical]) .track{width:16px;height:100%}.background{position:absolute;inset:0;background:var(--disabled-color);opacity:.4}.active{position:absolute;background:var(--primary-color);top:0;right:calc(var(--max) * 100%);bottom:0;left:calc(var(--min) * 100%)}:host([vertical]) .active{top:calc(var(--min) * 100%);right:0;bottom:calc(var(--max) * 100%);left:0}.handle{position:absolute;top:0;height:100%;width:16px;transform:translate(-50%,0);background:var(--card-background-color);left:calc(var(--value,0%) * 100%);transition:left 180ms ease-in-out,top 180ms ease-in-out}:host([vertical]) .handle{transform:translate(0,-50%);left:0;top:calc(var(--value,0%) * 100%);height:16px;width:100%}.dot{position:absolute;top:0;bottom:0;opacity:.6;margin:auto;width:4px;height:4px;flex-shrink:0;transform:translate(-50%,0);background:var(--card-background-color);left:calc(var(--value,0%) * 100%);border-radius:2px}:host([vertical]) .dot{transform:translate(0,-50%);left:0;right:0;bottom:inherit;top:calc(var(--value,0%) * 100%)}.handle::after{position:absolute;inset:0;width:4px;border-radius:2px;height:100%;margin:auto;background:var(--primary-color);content:""}:host([vertical]) .handle::after{height:4px;width:100%}:host(:disabled) .slider{cursor:not-allowed}:host(:disabled) .handle:after{background:var(--disabled-color)}:host(:disabled) .active{background:var(--disabled-color)}.tooltip{position:absolute;background-color:var(--clear-background-color);color:var(--primary-text-color);font-size:var(--control-slider-tooltip-font-size);border-radius:.8em;padding:.2em .4em;opacity:0;white-space:nowrap;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:opacity 180ms ease-in-out,left 180ms ease-in-out,bottom 180ms ease-in-out;--handle-spacing:calc(2 * var(--handle-margin) + var(--handle-size));--slider-tooltip-margin:0px;--slider-tooltip-range:100%;--slider-tooltip-offset:0px;--slider-tooltip-position:calc(
min(
max(
var(--value) * var(--slider-tooltip-range) +
var(--slider-tooltip-offset),
0%
),
100%
)
)}.tooltip.start{--slider-tooltip-offset:calc(-0.5 * (var(--handle-spacing)))}.tooltip.end{--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.cursor{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.show-handle{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.visible{opacity:1}.tooltip.top{transform:translate3d(-50%,-100%,0);top:var(--slider-tooltip-margin);left:50%}.tooltip.bottom{transform:translate3d(-50%,100%,0);bottom:var(--slider-tooltip-margin);left:50%}.tooltip.left{transform:translate3d(-100%,-50%,0);top:50%;left:var(--slider-tooltip-margin)}.tooltip.right{transform:translate3d(100%,-50%,0);top:50%;right:var(--slider-tooltip-margin)}:host(:not([vertical])) .tooltip.bottom,:host(:not([vertical])) .tooltip.top{left:var(--slider-tooltip-position)}:host([vertical]) .tooltip.left,:host([vertical]) .tooltip.right{top:var(--slider-tooltip-position)}.pressed .handle{transition:none}.pressed .tooltip{transition:opacity 180ms ease-in-out}`}]}}),n.oi);i(23334);var m=i(34593),g=i(14858);(0,o.Z)([(0,s.Mo)("ha-grid-size-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"rows",value:()=>8},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"columns",value:()=>12},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"rowMin",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"rowMax",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"columnMin",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"columnMax",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"isDefault",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"step",value:()=>1},{kind:"field",decorators:[(0,s.SB)()],key:"_localValue",value:()=>({rows:1,columns:1})},{kind:"method",key:"willUpdate",value:function(e){e.has("value")&&(this._localValue=this.value)}},{kind:"method",key:"render",value:function(){const e=void 0!==this.columnMin&&this.columnMin===this.columnMax,t=void 0!==this.rowMin&&this.rowMin===this.rowMax,i="auto"===this._localValue?.rows,o="full"===this._localValue?.columns,a=this.rowMin??1,s=this.rowMax??this.rows,l=Math.ceil((this.columnMin??1)/this.step)*this.step,d=Math.ceil((this.columnMax??this.columns)/this.step)*this.step,c=i?a:this._localValue?.rows,h=this._localValue?.columns;return n.dy` <div class="grid"> <ha-grid-layout-slider aria-label="${this.hass.localize("ui.components.grid-size-picker.columns")}" id="columns" .min="${l}" .max="${d}" .range="${this.columns}" .value="${o?this.columns:this.value?.columns}" .step="${this.step}" -changed="${this._valueChanged}" -moved="${this._sliderMoved}" .disabled="${e}" tooltip-mode="always"></ha-grid-layout-slider> <ha-grid-layout-slider aria-label="${this.hass.localize("ui.components.grid-size-picker.rows")}" id="rows" .min="${a}" .max="${s}" .range="${this.rows}" vertical .value="${i?a:this.value?.rows}" -changed="${this._valueChanged}" -moved="${this._sliderMoved}" .disabled="${t}" tooltip-mode="always"></ha-grid-layout-slider> ${this.isDefault?n.Ld:n.dy` <ha-icon-button ="${this._reset}" class="reset" .path="${"M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z"}" label="${this.hass.localize("ui.components.grid-size-picker.reset_default")}" title="${this.hass.localize("ui.components.grid-size-picker.reset_default")}"> </ha-icon-button> `} <div class="preview"> <table> ${Array(this.rows).fill(0).map(((e,t)=>{const i=t+1;return n.dy` <tr> ${Array(this.columns).fill(0).map(((e,t)=>{const o=t+1;return o%this.step!=0||this.columns>24&&o%3!=0?n.Ld:n.dy` <td data-row="${i}" data-column="${o}" ="${this._cellClick}"></td> `}))} </tr> `}))} </table> <div class="preview-card" style="${(0,r.V)({"--rows":c,"--columns":o?this.columns:h,"--total-columns":this.columns})}"></div> </div> </div> `}},{kind:"method",key:"_cellClick",value:function(e){const t=e.currentTarget,i=Number(t.getAttribute("data-row")),o=Number(t.getAttribute("data-column")),a=(0,m.Y)(i,this.rowMin,this.rowMax);let n=(0,m.Y)(o,this.columnMin,this.columnMax);"full"===(this.value??g.D9).columns&&n===this.columns&&(n="full"),(0,d.B)(this,"value-changed",{value:{rows:a,columns:n}})}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.currentTarget.id,i=this.value??g.D9;let o=e.detail.value;"columns"===t&&"full"===i.columns&&o===this.columns&&(o="full");const a={...i,[t]:o};(0,d.B)(this,"value-changed",{value:a})}},{kind:"method",key:"_reset",value:function(e){e.stopPropagation(),(0,d.B)(this,"value-changed",{value:{rows:void 0,columns:void 0}})}},{kind:"method",key:"_sliderMoved",value:function(e){e.stopPropagation();const t=e.currentTarget.id,i=this.value??g.D9;void 0!==e.detail.value&&(this._localValue={...i,[t]:e.detail.value})}},{kind:"field",static:!0,key:"styles",value:()=>[n.iv`.grid{display:grid;grid-template-areas:"reset column-slider" "row-slider preview";grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:8px}#columns{grid-area:column-slider}#rows{grid-area:row-slider}.reset{grid-area:reset;--mdc-icon-button-size:36px}.preview{position:relative;grid-area:preview}.preview table,.preview td,.preview tr{border:2px dotted var(--divider-color);border-collapse:collapse}.preview table{width:100%}.preview tr{height:30px}.preview td{cursor:pointer}.preview-card{position:absolute;top:0;left:0;background-color:var(--primary-color);opacity:.3;border-radius:8px;height:calc(var(--rows,1) * 30px);width:calc(var(--columns,1) * 100% / var(--total-columns,12));pointer-events:none;transition:width ease-in-out 180ms,height ease-in-out 180ms}`]}]}}),n.oi);i(7285),i(30509),i(74421),i(37583),i(1888),i(64889);var f=i(28008);(0,o.Z)([(0,s.Mo)("hui-card-layout-editor")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"sectionConfig",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_defaultGridOptions",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_yamlMode",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_uiAvailable",value:()=>!0},{kind:"field",decorators:[(0,s.SB)()],key:"_preciseMode",value:()=>!1},{kind:"field",key:"_cardElement",value:void 0},{kind:"field",key:"_mergedOptions",value:()=>(0,l.Z)(((e,t)=>({...t,...e})))},{kind:"field",key:"_computeCardGridSize",value:()=>(0,l.Z)(g.DM)},{kind:"field",key:"_isDefault",value:()=>(0,l.Z)((e=>void 0===e?.columns&&void 0===e?.rows))},{kind:"field",key:"_configGridOptions",value:()=>e=>e.grid_options?e.grid_options:e.layout_options?(0,g.v)(e.layout_options):{}},{kind:"method",key:"render",value:function(){const e=this._configGridOptions(this.config),t=this._mergedOptions(e,this._defaultGridOptions),i=t,o=this._computeCardGridSize(i),a=12*(this.sectionConfig.column_span??1);return n.dy` <div class="header"> <p class="intro"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.explanation")} </p> <ha-button-menu slot="icons" ="${this._handleAction}" ="${c.P}" ="${h.U}" fixed .corner="${"BOTTOM_END"}" menu-corner="END"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"}"> </ha-icon-button> <ha-list-item graphic="icon" .disabled="${!this._uiAvailable}"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml"))} <ha-svg-icon slot="graphic" .path="${"M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z"}"></ha-svg-icon> </ha-list-item> </ha-button-menu> </div> ${this._yamlMode?n.dy` <ha-yaml-editor .hass="${this.hass}" .defaultValue="${e}" -changed="${this._yamlChanged}"></ha-yaml-editor> `:n.dy` <ha-grid-size-picker style="${(0,r.V)({"max-width":250*(this.sectionConfig.column_span??1)+40+"px"})}" .columns="${a}" .hass="${this.hass}" .value="${o}" .isDefault="${this._isDefault(e)}" -changed="${this._gridSizeChanged}" .rowMin="${i.min_rows}" .rowMax="${i.max_rows}" .columnMin="${i.min_columns}" .columnMax="${i.max_columns}" .step="${this._preciseMode?1:g.sy}"></ha-grid-size-picker> <ha-settings-row> <span slot="heading" data-for="full-width"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.full_width")} </span> <span slot="description" data-for="full-width"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.full_width_helper")} </span> <ha-switch ="${this._fullWidthChanged}" .checked="${"full"===t.columns}" name="full-width"> </ha-switch> </ha-settings-row> <ha-settings-row> <span slot="heading" data-for="precise-mode"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.precise_mode")} </span> <span slot="description" data-for="precise-mode"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.precise_mode_helper")} </span> <ha-switch ="${this._preciseModeChanged}" .checked="${this._preciseMode}" name="precise-mode"> </ha-switch> </ha-settings-row> `} `}},{kind:"method",key:"firstUpdated",value:function(e){(0,a.Z)(i,"firstUpdated",this,3)([e]);try{this._cardElement=document.createElement("hui-card"),this._cardElement.hass=this.hass,this._cardElement.preview=!0,this._cardElement.config=this.config,this._cardElement.addEventListener("card-updated",(e=>{e.stopPropagation(),this._updateDefaultGridOptions()})),this._cardElement.load(),this._updateDefaultGridOptions()}catch(e){console.error(e)}}},{kind:"method",key:"_updateDefaultGridOptions",value:function(){this._cardElement?this._defaultGridOptions=this._cardElement.getElementGridOptions():this._defaultGridOptions=void 0}},{kind:"method",key:"updated",value:function(e){(0,a.Z)(i,"updated",this,3)([e]),this._cardElement&&(e.has("hass")&&(this._cardElement.hass=this.hass),e.has("config")&&(this._cardElement.config=this.config))}},{kind:"method",key:"willUpdate",value:function(e){if((0,a.Z)(i,"willUpdate",this,3)([e]),e.has("config")){const e=this.config.grid_options;if(!e)return void(this._preciseMode=!!this._defaultGridOptions&&(0,g.ui)(this._defaultGridOptions));const t=(0,g.ui)(e);!this._preciseMode&&t&&(this._preciseMode=t)}}},{kind:"method",key:"_handleAction",value:async function(e){if(0===e.detail.index)this._yamlMode=!this._yamlMode}},{kind:"method",key:"_gridSizeChanged",value:function(e){e.stopPropagation();const t=e.detail.value;this._updateGridOptions({...this.config.grid_options,columns:t.columns,rows:t.rows})}},{kind:"method",key:"_yamlChanged",value:function(e){e.stopPropagation();const t=e.detail.value;this._updateGridOptions(t)}},{kind:"method",key:"_fullWidthChanged",value:function(e){e.stopPropagation();const t=e.target.checked;this._updateGridOptions({...this.config.grid_options,columns:t?"full":void 0})}},{kind:"method",key:"_preciseModeChanged",value:function(e){if(e.stopPropagation(),this._preciseMode=e.target.checked,this._preciseMode)return;const t=this.config.grid_options?.columns;if("number"==typeof t&&t%g.sy!=0){const e=Math.ceil(t/g.sy)*g.sy;this._updateGridOptions({...this.config.grid_options,columns:e})}}},{kind:"method",key:"_updateGridOptions",value:function(e){const t={...this.config,grid_options:{...e}};if(t.grid_options){for(const[e,i]of Object.entries(t.grid_options))void 0===i&&delete t.grid_options[e];0===Object.keys(t.grid_options).length&&delete t.grid_options}t.layout_options&&delete t.layout_options,(0,d.B)(this,"value-changed",{value:t})}},{kind:"field",static:!0,key:"styles",value:()=>[f.Qx,n.iv`.header{display:flex;flex-direction:row;align-items:flex-start}.header .intro{flex:1;margin:0;color:var(--secondary-text-color)}.header ha-button-menu{--mdc-theme-text-primary-on-background:var(--primary-text-color);margin-top:-8px}.disabled{opacity:.5;pointer-events:none}ha-grid-size-picker{display:block;margin:16px auto;direction:ltr}ha-yaml-editor{display:block;margin:16px 0}`]}]}}),n.oi)},52043:function(e,t,i){var o=i(44249),a=i(57243),n=i(15093),s=i(36522);i(99426),i(32145);(0,o.Z)([(0,n.Mo)("hui-card-visibility-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"method",key:"render",value:function(){const e=this.config.visibility??[];return a.dy` <p class="intro"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.visibility.explanation")} </p> <ha-card-conditions-editor .hass="${this.hass}" .conditions="${e}" -changed="${this._valueChanged}"> </ha-card-conditions-editor> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value,i={...this.config,visibility:t};0===i.visibility?.length&&delete i.visibility,(0,s.B)(this,"value-changed",{value:i})}},{kind:"field",static:!0,key:"styles",value:()=>a.iv`.intro{margin:0;color:var(--secondary-text-color);margin-bottom:8px}`}]}}),a.oi)},32012:function(e,t,i){i.d(t,{e:()=>o});class o extends Error{constructor(e,t,i){super(e),this.warnings=void 0,this.errors=void 0,this.name="GUISupportError",this.warnings=t,this.errors=i}}},43299:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{O:()=>g});var a=i(44249),n=i(72621),s=(i(9359),i(31526),i(70104),i(57243)),r=i(15093),l=i(67064),d=i(36522),c=i(22381),h=i(41680),u=i(48045),p=(i(99426),i(17170)),v=(i(64889),i(32012)),m=e([p]);p=(m.then?(await m)():m)[0];let g=(0,a.Z)(null,(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"context",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_configElement",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_subElementEditorConfig",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_guiMode",value:()=>!0},{kind:"field",decorators:[(0,r.SB)()],key:"_errors",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_pendingYamlError",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_yamlError",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_warnings",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_guiSupported",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_loading",value:()=>!1},{kind:"field",decorators:[(0,r.IO)("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"get",key:"value",value:function(){return this._config}},{kind:"set",key:"value",value:function(e){this._config&&(0,u.v)(e,this._config)||(this._config=e,this._errors=void 0,this._setConfig())}},{kind:"method",key:"_setConfig",value:function(){if(!this._errors)try{this._updateConfigElement()}catch(e){this._errors=[e.message]}this.updateComplete.then((()=>{(0,d.B)(this,"config-changed",{config:this.value,error:this._errors?.join(", "),guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})}))}},{kind:"get",key:"hasWarning",value:function(){return void 0!==this._warnings&&this._warnings.length>0}},{kind:"get",key:"hasError",value:function(){return void 0!==this._errors&&this._errors.length>0}},{kind:"get",key:"GUImode",value:function(){return this._guiMode}},{kind:"set",key:"GUImode",value:function(e){this._guiMode=e,this.updateComplete.then((()=>{(0,d.B)(this,"GUImode-changed",{guiMode:e,guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})}))}},{kind:"method",key:"toggleMode",value:function(){this.GUImode=!this.GUImode}},{kind:"method",key:"focusYamlEditor",value:function(){this._configElement?.focusYamlEditor&&this._configElement.focusYamlEditor(),this._yamlEditor&&this._yamlEditor.focus()}},{kind:"method",key:"getConfigElement",value:async function(){}},{kind:"method",key:"getConfigForm",value:async function(){}},{kind:"method",key:"renderConfigElement",value:function(){return s.dy`${this._configElement}`}},{kind:"method",key:"_renderSubElement",value:function(){return s.dy` <hui-sub-element-editor .hass="${this.hass}" .config="${this._subElementEditorConfig}" -back="${this._goBack}" -changed="${this._subElementChanged}"> </hui-sub-element-editor> `}},{kind:"method",key:"_subElementChanged",value:function(e){e.stopPropagation();const t=e.detail.config;this._subElementEditorConfig={...this._subElementEditorConfig,elementConfig:t},this._subElementEditorConfig.saveElementConfig?.(t)}},{kind:"method",key:"_goBack",value:function(e){e.stopPropagation(),this._subElementEditorConfig=void 0}},{kind:"method",key:"_editSubElement",value:async function(e){e.stopPropagation(),await Promise.all([i.e("91552"),i.e("78456"),i.e("56898"),i.e("35671"),i.e("92139"),i.e("32146"),i.e("37602"),i.e("18865"),i.e("88975"),i.e("79931"),i.e("44251"),i.e("65005"),i.e("60487"),i.e("3371"),i.e("38326"),i.e("10745"),i.e("16912"),i.e("92368"),i.e("95444"),i.e("8754"),i.e("54291"),i.e("76986")]).then(i.bind(i,50357)),this._subElementEditorConfig={type:e.detail.type,elementConfig:e.detail.config,context:e.detail.context,saveElementConfig:e.detail.saveConfig}}},{kind:"method",key:"render",value:function(){return s.dy` <div class="wrapper"> ${this.GUImode?s.dy` <div class="gui-editor" -sub-element="${this._editSubElement}"> ${this._loading?s.dy` <ha-spinner class="center margin-bot"></ha-spinner> `:(0,l.F)(this._subElementEditorConfig?this._renderSubElement():this.renderConfigElement())} </div> `:s.dy` <div class="yaml-editor"> <ha-yaml-editor .defaultValue="${this._config}" autofocus .hass="${this.hass}" -changed="${this._handleYAMLChanged}" ="${this._onBlurYaml}" ="${this._ignoreKeydown}" dir="ltr"></ha-yaml-editor> </div> `} ${!1===this._guiSupported&&!1===this._loading?s.dy` <ha-alert alert-type="info" .title="${this.hass.localize("ui.errors.config.visual_editor_not_supported")}"> ${this.hass.localize("ui.errors.config.visual_editor_not_supported_reason_type")} <br> ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert> `:s.Ld} ${this.hasError?s.dy` <ha-alert alert-type="error" .title="${this.hass.localize("ui.errors.config.configuration_error")}"> <ul> ${this._errors.map((e=>s.dy`<li>${e}</li>`))} </ul> </ha-alert> `:s.Ld} ${this.hasWarning?s.dy` <ha-alert alert-type="warning" .title="${this.hass.localize("ui.errors.config.visual_editor_not_supported")}"> <ul> ${this._warnings.map((e=>s.dy`<li>${e}</li>`))} </ul> ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert> `:s.Ld} </div> `}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(o,"updated",this,3)([e]),this._configElement&&e.has("hass")&&(this._configElement.hass=this.hass),this._configElement&&"lovelace"in this._configElement&&e.has("lovelace")&&(this._configElement.lovelace=this.lovelace),this._configElement&&e.has("context")&&(this._configElement.context=this.context)}},{kind:"method",key:"_handleUIConfigChanged",value:function(e){if(e.stopPropagation(),!this.GUImode)return;const t=e.detail.config;Object.keys(t).forEach((e=>{void 0===t[e]&&delete t[e]})),this.value=t}},{kind:"method",key:"_handleYAMLChanged",value:function(e){e.stopPropagation();const t=e.detail.value;e.detail.isValid?(this._config=t,this._errors=void 0,this._pendingYamlError=void 0,this._yamlError=!1,this._debounceYamlError.cancel(),this._setConfig()):this._yamlError?this._errors=[e.detail.errorMsg]:(this._pendingYamlError=e.detail.errorMsg,this._debounceYamlError())}},{kind:"field",key:"_debounceYamlError",value(){return(0,c.D)((()=>{this._pendingYamlError&&(this._yamlError=!0,this._errors=[this._pendingYamlError],this._pendingYamlError=void 0,this._setConfig())}),2e3)}},{kind:"method",key:"_onBlurYaml",value:function(){this._debounceYamlError.cancel(),this._pendingYamlError&&(this._yamlError=!0,this._errors=[this._pendingYamlError],this._pendingYamlError=void 0,this._setConfig())}},{kind:"method",key:"unloadConfigElement",value:async function(){this._configElement=void 0,this._guiSupported=void 0}},{kind:"method",key:"loadConfigElement",value:async function(){if(this._configElement)return;let e=await this.getConfigElement();if(!e){const t=await this.getConfigForm();if(t){await i.e("10106").then(i.bind(i,66374)),e=document.createElement("hui-form-editor");const{schema:o,assertConfig:a,computeLabel:n,computeHelper:s}=t;e.schema=o,n&&(e.computeLabel=n),s&&(e.computeHelper=s),a&&(e.assertConfig=a)}}e?(e.hass=this.hass,"lovelace"in e&&(e.lovelace=this.lovelace),e.context=this.context,e.addEventListener("config-changed",(e=>this._handleUIConfigChanged(e))),this._guiSupported=!0):this._guiSupported=!1,this._configElement=e}},{kind:"method",key:"_updateConfigElement",value:async function(){if(this.value)try{if(this._errors=void 0,this._warnings=void 0,await this.loadConfigElement(),this._configElement)try{this._configElement.setConfig(this.value)}catch(e){const t=(0,h.p)(this.hass,e);throw new v.e("Config is not supported",t.warnings,t.errors)}else this._guiSupported=!1,this.GUImode=!1}catch(e){e instanceof v.e?(this._warnings=e.warnings??[e.message],this._errors=e.errors||void 0):this._errors=[e.message],this.GUImode=!1}finally{this._loading=!1}}},{kind:"method",key:"_ignoreKeydown",value:function(e){e.stopPropagation()}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:flex}.wrapper{width:100%}.gui-editor,.yaml-editor{padding:8px 0px}ha-code-editor{--code-mirror-max-height:calc(100vh - 245px)}ha-spinner{display:block;margin:auto}`}]}}),s.oi);o()}catch(e){o(e)}}))},6973:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{k:()=>d});var a=i(44249),n=i(72621),s=i(15093),r=i(43299),l=e([r]);r=(l.then?(await l)():l)[0];let d=(0,a.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.SB)()],key:"_configElementType",value:void 0},{kind:"get",key:"configElementType",value:function(){return this.value?this.value.type:void 0}},{kind:"method",key:"loadConfigElement",value:async function(){if(this._configElementType!==this.configElementType){if(this.unloadConfigElement(),!this.configElementType)throw new Error(this.hass.localize("ui.errors.config.no_type_provided"));this._configElementType=this.configElementType}return(0,n.Z)(i,"loadConfigElement",this,3)([])}}]}}),r.O);o()}catch(e){o(e)}}))},48734:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{P5:()=>u,Ve:()=>v});var a=i(16485),n=(i(9359),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),e([a]));a=(n.then?(await n)():n)[0];const s=new Set,r=new Map;let l,d="ltr",c="en";const h="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(h){const m=new MutationObserver(p);d=document.documentElement.dir||"ltr",c=document.documentElement.lang||navigator.language,m.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function u(...e){e.map((e=>{const t=e.$code.toLowerCase();r.has(t)?r.set(t,Object.assign(Object.assign({},r.get(t)),e)):r.set(t,e),l||(l=e)})),p()}function p(){h&&(d=document.documentElement.dir||"ltr",c=document.documentElement.lang||navigator.language),[...s.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}class v{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){s.add(this.host)}hostDisconnected(){s.delete(this.host)}dir(){return`${this.host.dir||d}`.toLowerCase()}lang(){return`${this.host.lang||c}`.toLowerCase()}getTranslationData(e){var t,i;const o=new Intl.Locale(e.replace(/_/g,"-")),a=null==o?void 0:o.language.toLowerCase(),n=null!==(i=null===(t=null==o?void 0:o.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==i?i:"";return{locale:o,language:a,region:n,primary:r.get(`${a}-${n}`),secondary:r.get(a)}}exists(e,t){var i;const{primary:o,secondary:a}=this.getTranslationData(null!==(i=t.lang)&&void 0!==i?i:this.lang());return t=Object.assign({includeFallback:!1},t),!!(o&&o[e]||a&&a[e]||t.includeFallback&&l&&l[e])}term(e,...t){const{primary:i,secondary:o}=this.getTranslationData(this.lang());let a;if(i&&i[e])a=i[e];else if(o&&o[e])a=o[e];else{if(!l||!l[e])return console.error(`No translation found for: ${String(e)}`),String(e);a=l[e]}return"function"==typeof a?a(...t):a}date(e,t){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),t).format(e)}number(e,t){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),t).format(e)}relativeTime(e,t,i){return new Intl.RelativeTimeFormat(this.lang(),i).format(e,t)}}o()}catch(g){o(g)}}))},68783:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{A:()=>c});var a=i(64699),n=i(15073),s=i(81048),r=i(31027),l=i(57243),d=e([n]);n=(d.then?(await d)():d)[0];var c=class extends r.P{constructor(){super(...arguments),this.localize=new n.V(this)}render(){return l.dy` <svg part="base" class="spinner" role="progressbar" aria-label="${this.localize.term("loading")}"> <circle class="spinner__track"></circle> <circle class="spinner__indicator"></circle> </svg> `}};c.styles=[s.N,a.D],o()}catch(e){o(e)}}))},31027:function(e,t,i){i.d(t,{P:()=>r});i(9359),i(31526);var o,a=i(52812),n=i(57243),s=i(15093),r=class extends n.oi{constructor(){super(),(0,a.Ko)(this,o,!1),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}emit(e,t){const i=new CustomEvent(e,(0,a.ih)({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){const o=customElements.get(e);if(!o){try{customElements.define(e,t,i)}catch(o){customElements.define(e,class extends t{},i)}return}let a=" (unknown version)",n=a;"version"in t&&t.version&&(a=" v"+t.version),"version"in o&&o.version&&(n=" v"+o.version),a&&n&&a===n||console.warn(`Attempted to register <${e}>${a}, but <${e}>${n} has already been registered.`)}attributeChangedCallback(e,t,i){(0,a.ac)(this,o)||(this.constructor.elementProperties.forEach(((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])})),(0,a.qx)(this,o,!0)),super.attributeChangedCallback(e,t,i)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach(((t,i)=>{e.has(i)&&null==this[i]&&(this[i]=t)}))}};o=new WeakMap,r.version="2.20.1",r.dependencies={},(0,a.u2)([(0,s.Cb)()],r.prototype,"dir",2),(0,a.u2)([(0,s.Cb)()],r.prototype,"lang",2)},15073:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{V:()=>r});var a=i(21262),n=i(48734),s=e([n,a]);[n,a]=s.then?(await s)():s;var r=class extends n.Ve{};(0,n.P5)(a.K),o()}catch(e){o(e)}}))},21262:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{K:()=>r});var a=i(48734),n=e([a]);a=(n.then?(await n)():n)[0];var s={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format"};(0,a.P5)(s);var r=s;o()}catch(e){o(e)}}))},64699:function(e,t,i){i.d(t,{D:()=>o});var o=i(57243).iv`:host{--track-width:2px;--track-color:rgb(128 128 128 / 25%);--indicator-color:var(--sl-color-primary-600);--speed:2s;display:inline-flex;width:1em;height:1em;flex:none}.spinner{flex:1 1 auto;height:100%;width:100%}.spinner__indicator,.spinner__track{fill:none;stroke-width:var(--track-width);r:calc(0.5em - var(--track-width)/ 2);cx:0.5em;cy:0.5em;transform-origin:50% 50%}.spinner__track{stroke:var(--track-color);transform-origin:0% 0%}.spinner__indicator{stroke:var(--indicator-color);stroke-linecap:round;stroke-dasharray:150% 75%;animation:spin var(--speed) linear infinite} spin{0%{transform:rotate(0deg);stroke-dasharray:0.05em,3em}50%{transform:rotate(450deg);stroke-dasharray:1.375em,1.375em}100%{transform:rotate(1080deg);stroke-dasharray:0.05em,3em}}`},52812:function(e,t,i){i.d(t,{EZ:()=>p,Ko:()=>f,ac:()=>g,ih:()=>u,qx:()=>y,u2:()=>v});var o=Object.defineProperty,a=Object.defineProperties,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,c=e=>{throw TypeError(e)},h=(e,t,i)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,u=(e,t)=>{for(var i in t||(t={}))l.call(t,i)&&h(e,i,t[i]);if(r)for(var i of r(t))d.call(t,i)&&h(e,i,t[i]);return e},p=(e,t)=>a(e,s(t)),v=(e,t,i,a)=>{for(var s,r=a>1?void 0:a?n(t,i):t,l=e.length-1;l>=0;l--)(s=e[l])&&(r=(a?s(t,i,r):s(r))||r);return a&&r&&o(t,i,r),r},m=(e,t,i)=>t.has(e)||c("Cannot "+i),g=(e,t,i)=>(m(e,t,"read from private field"),i?i.call(e):t.get(e)),f=(e,t,i)=>t.has(e)?c("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),y=(e,t,i,o)=>(m(e,t,"write to private field"),o?o.call(e,i):t.set(e,i),i)},81048:function(e,t,i){i.d(t,{N:()=>o});var o=i(57243).iv`:host{box-sizing:border-box}:host *,:host ::after,:host ::before{box-sizing:inherit}[hidden]{display:none!important}`},97677:function(e,t,i){i.a(e,(async function(e,o){try{i.d(t,{Z:()=>a.A});var a=i(68783),n=(i(64699),i(15073)),s=i(21262),r=(i(81048),i(31027),i(52812),e([n,s,a]));[n,s,a]=r.then?(await r)():r,o()}catch(e){o(e)}}))},43580:function(e,t,i){i.d(t,{Z:()=>o.D});var o=i(64699);i(52812)},67064:function(e,t,i){i.d(t,{F:()=>r});var o=i(2841),a=i(45779),n=i(53232);const s=e=>(0,n.dZ)(e)?e._$litType$.h:e.strings,r=(0,a.XM)(class extends a.Xe{constructor(e){super(e),this.tt=new WeakMap}render(e){return[e]}update(e,[t]){const i=(0,n.hN)(this.et)?s(this.et):null,a=(0,n.hN)(t)?s(t):null;if(null!==i&&(null===a||i!==a)){const t=(0,n.i9)(e).pop();let a=this.tt.get(i);if(void 0===a){const e=document.createDocumentFragment();a=(0,o.sY)(o.Ld,e),a.setConnected(!1),this.tt.set(i,a)}(0,n.hl)(a,[t]),(0,n._Y)(a,void 0,t)}if(null!==a){if(null===i||i!==a){const t=this.tt.get(a);if(void 0!==t){const i=(0,n.i9)(t).pop();(0,n.E_)(e),(0,n._Y)(e,void 0,i),(0,n.hl)(e,[i])}}this.et=t}else this.et=void 0;return this.render(t)}})}};
//# sourceMappingURL=52874.3bb1397ff5ec790a.js.map