UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

10 lines 24.4 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["32654"],{82062:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(61701),s=i(72621),a=(i(71695),i(61893),i(9359),i(70104),i(47021),i(57243)),o=i(50778),r=i(69634),l=i(50602),d=i(45061),c=i(76320),u=i(10916),h=e([l]);l=(h.then?(await h)():h)[0];let f,g,v,m,p,_,y,b=e=>e;const k=(e,t,i)=>180*(0,u.Ff)((0,u.Fv)(e,t,i),t,i)/100;(0,n.Z)([(0,o.Mo)("ha-gauge")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"min",value(){return 0}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"max",value(){return 100}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"value",value(){return 0}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"formatOptions",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1,type:String})],key:"valueText",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"locale",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"needle",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Array})],key:"levels",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value(){return""}},{kind:"field",decorators:[(0,o.SB)()],key:"_angle",value(){return 0}},{kind:"field",decorators:[(0,o.SB)()],key:"_updated",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_segment_label",value(){return""}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),(0,c.T)((()=>{this._updated=!0,this._angle=k(this.value,this.min,this.max),this._segment_label=this._getSegmentLabel(),this._rescaleSvg()}))}},{kind:"method",key:"updated",value:function(e){(0,s.Z)(i,"updated",this,3)([e]),this._updated&&(e.has("value")||e.has("valueText")||e.has("label")||e.has("_segment_label"))&&(this._angle=k(this.value,this.min,this.max),this._segment_label=this._getSegmentLabel(),this._rescaleSvg())}},{kind:"method",key:"render",value:function(){return(0,a.YP)(f||(f=b` <svg viewBox="-50 -50 100 50" class="gauge"> ${0} ${0} ${0} </svg> <svg class="text"> <text class="value-text"> ${0}${0} </text> </svg>`),this.needle&&this.levels?"":(0,a.YP)(g||(g=b`<path class="dial" d="M -40 0 A 40 40 0 0 1 40 0"></path>`)),this.levels?this.levels.sort(((e,t)=>e.level-t.level)).map(((e,t)=>{let i;if(0===t&&e.level!==this.min){const e=k(this.min,this.min,this.max);i=(0,a.YP)(v||(v=b`<path stroke="var(--info-color)" class="level" d="M ${0} ${0} A 40 40 0 0 1 40 0 "></path>`),0-40*Math.cos(e*Math.PI/180),0-40*Math.sin(e*Math.PI/180))}const n=k(e.level,this.min,this.max);return(0,a.YP)(m||(m=b`${0}<path stroke="${0}" class="level" d="M ${0} ${0} A 40 40 0 0 1 40 0 "></path>`),i,e.stroke,0-40*Math.cos(n*Math.PI/180),0-40*Math.sin(n*Math.PI/180))})):"",this.needle?(0,a.YP)(p||(p=b`<path class="needle" d="M -25 -2.5 L -47.5 0 L -25 2.5 z" style="${0}"> </path>`),(0,r.V)({transform:`rotate(${this._angle}deg)`})):(0,a.YP)(_||(_=b`<path class="value" d="M -40 0 A 40 40 0 1 0 40 0" style="${0}"></path>`),(0,r.V)({transform:`rotate(${this._angle}deg)`})),this._segment_label?this._segment_label:this.valueText||(0,l.uf)(this.value,this.locale,this.formatOptions),this._segment_label?"":"%"===this.label?(0,d.K)(this.locale)+"%":` ${this.label}`)}},{kind:"method",key:"_rescaleSvg",value:function(){const e=this.shadowRoot.querySelector(".text"),t=e.querySelector("text").getBBox();e.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}},{kind:"method",key:"_getSegmentLabel",value:function(){if(this.levels){this.levels.sort(((e,t)=>e.level-t.level));for(let e=this.levels.length-1;e>=0;e--)if(this.value>=this.levels[e].level)return this.levels[e].label}return""}},{kind:"field",static:!0,key:"styles",value(){return(0,a.iv)(y||(y=b`:host{position:relative}.dial{fill:none;stroke:var(--primary-background-color);stroke-width:15}.value{fill:none;stroke-width:15;stroke:var(--gauge-color);transition:all 1s ease 0s}.needle{fill:var(--primary-text-color);transition:all 1s ease 0s}.level{fill:none;stroke-width:15}.gauge{display:block}.text{position:absolute;max-height:40%;max-width:55%;left:50%;bottom:-6%;transform:translate(-50%,0%)}.value-text{font-size:50px;fill:var(--primary-text-color);text-anchor:middle;direction:ltr}`))}}]}}),a.oi);t()}catch(f){t(f)}}))},56032:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(61701),s=(i(71695),i(47021),i(80519)),a=i(1261),o=i(57243),r=i(50778),l=i(85605),d=e([s]);s=(d.then?(await d)():d)[0];let c,u=e=>e;(0,l.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,l.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});(0,n.Z)([(0,r.Mo)("ha-tooltip")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[a.Z,(0,o.iv)(c||(c=u`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:Roboto,sans-serif;--sl-tooltip-font-size:12px;--sl-tooltip-font-weight:normal;--sl-tooltip-line-height:1;--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`))]}}]}}),s.Z);t()}catch(c){t(c)}}))},17705:function(e,t,i){i.d(t,{Cj:()=>h,F7:()=>s,Hs:()=>w,Kd:()=>k,Kj:()=>g,Nw:()=>m,PA:()=>a,Py:()=>l,Qm:()=>S,Z0:()=>y,_Y:()=>c,_m:()=>o,dL:()=>d,dO:()=>x,hN:()=>f,h_:()=>u,j2:()=>b,q6:()=>v,uR:()=>r});i(19083),i(71695),i(9359),i(52924),i(61006),i(47021);var n=i(47194);let s=function(e){return e[e.NONE=0]="NONE",e[e.ARITHMETIC=1]="ARITHMETIC",e[e.CIRCULAR=2]="CIRCULAR",e}({});const a=99387==i.j?["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"]:null,o=e=>e.sendMessagePromise({type:"recorder/info"}),r=(e,t)=>e.callWS({type:"recorder/list_statistic_ids",statistic_type:t}),l=(e,t)=>e.callWS({type:"recorder/get_statistics_metadata",statistic_ids:t}),d=(e,t,i,n,s="hour",a,o)=>e.callWS({type:"recorder/statistics_during_period",start_time:t.toISOString(),end_time:null==i?void 0:i.toISOString(),statistic_ids:n,period:s,units:a,types:o}),c=(e,t,i,n)=>e.callWS({type:"recorder/statistic_during_period",statistic_id:t,units:n,fixed_period:i.fixed_period?{start_time:i.fixed_period.start instanceof Date?i.fixed_period.start.toISOString():i.fixed_period.start,end_time:i.fixed_period.end instanceof Date?i.fixed_period.end.toISOString():i.fixed_period.end}:void 0,calendar:i.calendar,rolling_window:i.rolling_window}),u=e=>e.callWS({type:"recorder/validate_statistics"}),h=(e,t,i)=>e.callWS({type:"recorder/update_statistics_metadata",statistic_id:t,unit_of_measurement:i}),f=(e,t)=>e.callWS({type:"recorder/clear_statistics",statistic_ids:t}),g=e=>{let t=null;if(!e)return null;for(const i of e)null!==i.change&&void 0!==i.change&&(null===t?t=i.change:t+=i.change);return t},v=(e,t)=>{let i=null;for(const n of t){if(!(n in e))continue;const t=g(e[n]);null!==t&&(null===i?i=t:i+=t)}return i},m=(e,t)=>e.some((e=>void 0!==e[t]&&null!==e[t])),p=["mean","min","max"],_=["sum","state","change"],y=(e,t)=>!(!p.includes(t)||e.mean_type===s.NONE)||!(!_.includes(t)||!e.has_sum),b=(e,t,i,n,s)=>{const a=new Date(i).toISOString();return e.callWS({type:"recorder/adjust_sum_statistics",statistic_id:t,start_time:a,adjustment:n,adjustment_unit_of_measurement:s})},k=(e,t,i)=>{const s=e.states[t];return s?(0,n.C)(s):(null==i?void 0:i.name)||t},x=(e,t,i)=>{let n;var s;t&&(n=null===(s=e.states[t])||void 0===s?void 0:s.attributes.unit_of_measurement);return void 0===n?null==i?void 0:i.statistics_unit_of_measurement:n},w=e=>e.includes(":"),S=e=>e.callWS({type:"recorder/update_statistics_issues"})},6736:function(e,t,i){i.d(t,{f:()=>o});var n=i(61701),s=i(72621),a=(i(19083),i(71695),i(9359),i(52924),i(40251),i(61006),i(47021),i(50778));const o=e=>(0,n.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"hassSubscribeRequiredHostProps",value:void 0},{kind:"field",key:"__unsubs",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,s.Z)(i,"connectedCallback",this,3)([]),this._checkSubscribed()}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,s.Z)(i,"disconnectedCallback",this,3)([]),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then((e=>e())):e()}this.__unsubs=void 0}}},{kind:"method",key:"updated",value:function(e){if((0,s.Z)(i,"updated",this,3)([e]),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}},{kind:"method",key:"hassSubscribe",value:function(){return[]}},{kind:"method",key:"_checkSubscribed",value:function(){var e;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(e=this.hassSubscribeRequiredHostProps)&&void 0!==e&&e.some((e=>void 0===this[e]))||(this.__unsubs=this.hassSubscribe())}}]}}),e)},67790:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t);var s=i(61701),a=(i(71695),i(52805),i(9359),i(70104),i(48136),i(47021),i(57243)),o=i(50778),r=i(69634),l=i(34618),d=(i(54977),i(82062)),c=(i(37583),i(56032)),u=i(1118),h=i(17705),f=i(6736),g=i(62577),v=i(10188),m=i(93331),p=e([d,c,u,v]);[d,c,u,v]=p.then?(await p)():p;let _,y,b,k,x,w,S=e=>e;const $="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",C={maximumFractionDigits:0};(0,s.Z)([(0,o.Mo)("hui-energy-carbon-consumed-gauge-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_data",value:void 0},{kind:"field",key:"hassSubscribeRequiredHostProps",value(){return["_config"]}},{kind:"method",key:"getCardSize",value:function(){return 4}},{kind:"method",key:"setConfig",value:function(e){this._config=e}},{kind:"method",key:"hassSubscribe",value:function(){var e;return[(0,u.UB)(this.hass,{key:null===(e=this._config)||void 0===e?void 0:e.collection_key}).subscribe((e=>{this._data=e}))]}},{kind:"method",key:"shouldUpdate",value:function(e){var t;return(0,m.SN)(this,e)||e.size>1||!e.has("hass")||!(null===(t=this._data)||void 0===t||!t.co2SignalEntity)&&this.hass.states[this._data.co2SignalEntity]!==e.get("hass").states[this._data.co2SignalEntity]}},{kind:"method",key:"render",value:function(){if(!this._config||!this.hass)return a.Ld;if(!this._data)return(0,a.dy)(_||(_=S`${0}`),this.hass.localize("ui.panel.lovelace.cards.energy.loading"));if(!this._data.co2SignalEntity)return a.Ld;if(!this.hass.states[this._data.co2SignalEntity])return(0,a.dy)(y||(y=S`<hui-warning> ${0} </hui-warning>`),(0,g.i)(this.hass,this._data.co2SignalEntity));const e=this._data.prefs,t=(0,u.Jj)(e),i=(0,h.q6)(this._data.stats,t.grid[0].flow_from.map((e=>e.stat_energy_from)));let n;if(this._data.fossilEnergyConsumption&&i){const e=this._data.fossilEnergyConsumption?Object.values(this._data.fossilEnergyConsumption).reduce(((e,t)=>e+t),0):0,s=t.solar&&(0,h.q6)(this._data.stats,t.solar.map((e=>e.stat_energy_from)))||0,a=(0,h.q6)(this._data.stats,t.grid[0].flow_to.map((e=>e.stat_energy_to)))||0,o=i+Math.max(0,s-a);n=(0,l.N)(100*(1-e/o))}return(0,a.dy)(b||(b=S` <ha-card> ${0} </ha-card> `),void 0!==n?(0,a.dy)(k||(k=S` <ha-gauge min="0" max="100" .value="${0}" .formatOptions="${0}" .locale="${0}" label="%" style="${0}"></ha-gauge> <ha-tooltip .content="${0}" placement="left" hoist> <ha-svg-icon .path="${0}"></ha-svg-icon> </ha-tooltip> <div class="name"> ${0} </div> `),n,C,this.hass.locale,(0,r.V)({"--gauge-color":this._computeSeverity(n)}),this.hass.localize("ui.panel.lovelace.cards.energy.carbon_consumed_gauge.card_indicates_energy_used"),$,this.hass.localize("ui.panel.lovelace.cards.energy.carbon_consumed_gauge.low_carbon_energy_consumed")):(0,a.dy)(x||(x=S`${0}`),this.hass.localize("ui.panel.lovelace.cards.energy.carbon_consumed_gauge.low_carbon_energy_not_calculated")))}},{kind:"method",key:"_computeSeverity",value:function(e){return e<10?v.severityMap.red:e<30?v.severityMap.yellow:e>75?v.severityMap.green:v.severityMap.normal}},{kind:"field",static:!0,key:"styles",value(){return(0,a.iv)(w||(w=S`ha-card{height:100%;overflow:hidden;padding:16px;display:flex;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}ha-gauge{width:100%;max-width:250px}.name{text-align:center;line-height:initial;color:var(--primary-text-color);width:100%;font-size:15px;margin-top:8px}ha-svg-icon{position:absolute;right:4px;inset-inline-end:4px;inset-inline-start:initial;top:4px;color:var(--secondary-text-color)}ha-tooltip::part(base__popup){margin-top:4px}`))}}]}}),(0,f.f)(a.oi));n()}catch(_){n(_)}}))},10188:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t),i.d(t,{DEFAULT_MAX:()=>O,DEFAULT_MIN:()=>P,severityMap:()=>j});var s=i(61701),a=i(72621),o=(i(52247),i(71695),i(61893),i(9359),i(70104),i(19423),i(40251),i(47021),i(57243)),r=i(50778),l=i(20552),d=i(35359),c=i(69634),u=i(82393),h=i(47194),f=i(31064),g=i(50602),v=(i(54977),i(82062)),m=i(96194),p=i(3967),_=i(69223),y=i(1617),b=i(5684),k=i(93331),x=i(62577),w=e([v,g]);[v,g]=w.then?(await w)():w;let S,$,C,E,M,N=e=>e;const P=0,O=100,j={red:"var(--error-color)",green:"var(--success-color)",yellow:"var(--warning-color)",normal:"var(--info-color)"};(0,s.Z)([(0,r.Mo)("hui-gauge-card")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"method",static:!0,key:"getConfigElement",value:async function(){return await i.e("96212").then(i.bind(i,32137)),document.createElement("hui-gauge-card-editor")}},{kind:"method",static:!0,key:"getStubConfig",value:function(e,t,i){return{type:"gauge",entity:(0,_.j)(e,1,t,i,["counter","input_number","number","sensor"],(e=>!isNaN(Number(e.state))))[0]||""}}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_config",value:void 0},{kind:"method",key:"getCardSize",value:function(){return 4}},{kind:"method",key:"setConfig",value:function(e){if(!e.entity)throw new Error("Entity must be specified");if(!(0,f.T)(e.entity))throw new Error("Invalid entity");this._config=Object.assign({min:P,max:O},e)}},{kind:"method",key:"render",value:function(){var e,t;if(!this._config||!this.hass)return o.Ld;const i=this.hass.states[this._config.entity];if(!i)return(0,o.dy)(S||(S=N` <hui-warning> ${0} </hui-warning> `),(0,x.i)(this.hass,this._config.entity));const n=Number(i.state);if(i.state===m.nZ)return(0,o.dy)($||($=N` <hui-warning>${0}</hui-warning> `),this.hass.localize("ui.panel.lovelace.warning.entity_unavailable",{entity:this._config.entity}));if(isNaN(n))return(0,o.dy)(C||(C=N` <hui-warning>${0}</hui-warning> `),this.hass.localize("ui.panel.lovelace.warning.entity_non_numeric",{entity:this._config.entity}));const s=null!==(e=this._config.name)&&void 0!==e?e:(0,h.C)(i);return(0,o.dy)(E||(E=N` <ha-card class="${0}" @action="${0}" .actionHandler="${0}" tabindex="${0}"> <ha-gauge .min="${0}" .max="${0}" .value="${0}" .formatOptions="${0}" .locale="${0}" .label="${0}" style="${0}" .needle="${0}" .levels="${0}"></ha-gauge> <div class="name" .title="${0}">${0}</div> </ha-card> `),(0,d.$)({action:(0,b.q)(this._config)}),this._handleAction,(0,p.K)({hasHold:(0,b._)(this._config.hold_action),hasDoubleClick:(0,b._)(this._config.double_tap_action)}),(0,l.o)(!this._config.tap_action||(0,b._)(this._config.tap_action)?"0":void 0),this._config.min,this._config.max,i.state,(0,g.l4)(i,this.hass.entities[i.entity_id]),this.hass.locale,this._config.unit||(null===(t=this.hass)||void 0===t?void 0:t.states[this._config.entity].attributes.unit_of_measurement)||"",(0,c.V)({"--gauge-color":this._computeSeverity(n)}),this._config.needle,this._config.needle?this._severityLevels():void 0,s,s)}},{kind:"method",key:"shouldUpdate",value:function(e){return(0,k.G2)(this,e)}},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(n,"updated",this,3)([e]),!this._config||!this.hass)return;const t=e.get("hass"),i=e.get("_config");t&&i&&t.themes===this.hass.themes&&i.theme===this._config.theme||(0,u.R)(this,this.hass.themes,this._config.theme)}},{kind:"method",key:"_computeSeverity",value:function(e){if(this._config.needle)return;let t=this._config.segments;if(t){t=[...t].sort(((e,t)=>e.from-t.from));for(let n=0;n<t.length;n++){var i;const s=t[n];if(s&&e>=s.from&&(n+1===t.length||e<(null===(i=t[n+1])||void 0===i?void 0:i.from)))return s.color}return j.normal}const n=this._config.severity;if(!n)return j.normal;const s=Object.keys(n).map((e=>[e,n[e]]));for(const a of s)if(null==j[a[0]]||isNaN(a[1]))return j.normal;return s.sort(((e,t)=>e[1]-t[1])),e>=s[0][1]&&e<s[1][1]?j[s[0][0]]:e>=s[1][1]&&e<s[2][1]?j[s[1][0]]:e>=s[2][1]?j[s[2][0]]:j.normal}},{kind:"method",key:"_severityLevels",value:function(){const e=this._config.segments;if(e)return e.map((e=>({level:null==e?void 0:e.from,stroke:null==e?void 0:e.color,label:null==e?void 0:e.label})));const t=this._config.severity;if(!t)return[{level:0,stroke:j.normal}];return Object.keys(t).map((e=>({level:t[e],stroke:j[e]})))}},{kind:"method",key:"_handleAction",value:function(e){(0,y.G)(this,this.hass,this._config,e.detail.action)}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(M||(M=N`ha-card{height:100%;overflow:hidden;padding:16px;display:flex;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}ha-card.action{cursor:pointer}ha-card:focus{outline:0}ha-gauge{width:100%;max-width:250px}.name{text-align:center;line-height:initial;color:var(--primary-text-color);width:100%;font-size:15px;margin-top:8px}`))}}]}}),o.oi);n()}catch(S){n(S)}}))},10916:function(e,t,i){i.d(t,{Ff:()=>s,Fv:()=>n,IU:()=>a});const n=(e,t,i)=>isNaN(e)||isNaN(t)||isNaN(i)?0:e>i?i:e<t?t:e,s=(e,t,i)=>100*(e-t)/(i-t),a=e=>Math.round(10*e)/10},48734:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{P5:()=>f,Ve:()=>v});var s=i(16485),a=(i(71695),i(9359),i(70104),i(19423),i(19134),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(97003),i(47021),e([s]));s=(a.then?(await a)():a)[0];const r=new Set,l=new Map;let d,c="ltr",u="en";const h="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(h){const m=new MutationObserver(g);c=document.documentElement.dir||"ltr",u=document.documentElement.lang||navigator.language,m.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function f(...e){e.map((e=>{const t=e.$code.toLowerCase();l.has(t)?l.set(t,Object.assign(Object.assign({},l.get(t)),e)):l.set(t,e),d||(d=e)})),g()}function g(){h&&(c=document.documentElement.dir||"ltr",u=document.documentElement.lang||navigator.language),[...r.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}class v{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){r.add(this.host)}hostDisconnected(){r.delete(this.host)}dir(){return`${this.host.dir||c}`.toLowerCase()}lang(){return`${this.host.lang||u}`.toLowerCase()}getTranslationData(e){var t,i;const n=new Intl.Locale(e.replace(/_/g,"-")),s=null==n?void 0:n.language.toLowerCase(),a=null!==(i=null===(t=null==n?void 0:n.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==i?i:"";return{locale:n,language:s,region:a,primary:l.get(`${s}-${a}`),secondary:l.get(s)}}exists(e,t){var i;const{primary:n,secondary:s}=this.getTranslationData(null!==(i=t.lang)&&void 0!==i?i:this.lang());return t=Object.assign({includeFallback:!1},t),!!(n&&n[e]||s&&s[e]||t.includeFallback&&d&&d[e])}term(e,...t){const{primary:i,secondary:n}=this.getTranslationData(this.lang());let s;if(i&&i[e])s=i[e];else if(n&&n[e])s=n[e];else{if(!d||!d[e])return console.error(`No translation found for: ${String(e)}`),String(e);s=d[e]}return"function"==typeof s?s(...t):s}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)}}n()}catch(o){n(o)}}))},31027:function(e,t,i){i.d(t,{P:()=>r});i(71695),i(9359),i(31526),i(46692),i(47021);var n,s=i(52812),a=i(57243),o=i(50778),r=class extends a.oi{constructor(){super(),(0,s.Ko)(this,n,!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,s.ih)({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){const n=customElements.get(e);if(!n){try{customElements.define(e,t,i)}catch(o){customElements.define(e,class extends t{},i)}return}let s=" (unknown version)",a=s;"version"in t&&t.version&&(s=" v"+t.version),"version"in n&&n.version&&(a=" v"+n.version),s&&a&&s===a||console.warn(`Attempted to register <${e}>${s}, but <${e}>${a} has already been registered.`)}attributeChangedCallback(e,t,i){(0,s.ac)(this,n)||(this.constructor.elementProperties.forEach(((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])})),(0,s.qx)(this,n,!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)}))}};n=new WeakMap,r.version="2.20.1",r.dependencies={},(0,s.u2)([(0,o.Cb)()],r.prototype,"dir",2),(0,s.u2)([(0,o.Cb)()],r.prototype,"lang",2)},15073:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{V:()=>r});var s=i(21262),a=i(48734),o=e([a,s]);[a,s]=o.then?(await o)():o;var r=class extends a.Ve{};(0,a.P5)(s.K),n()}catch(l){n(l)}}))},21262:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{K:()=>r});var s=i(48734),a=e([s]);s=(a.then?(await a)():a)[0];var o={$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,s.P5)(o);var r=o;n()}catch(l){n(l)}}))},52812:function(e,t,i){i.d(t,{EZ:()=>f,Ko:()=>p,ac:()=>m,ih:()=>h,qx:()=>_,u2:()=>g});i(63721),i(52247),i(71695),i(40251),i(47021);var n=Object.defineProperty,s=Object.defineProperties,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,c=e=>{throw TypeError(e)},u=(e,t,i)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,h=(e,t)=>{for(var i in t||(t={}))l.call(t,i)&&u(e,i,t[i]);if(r)for(var i of r(t))d.call(t,i)&&u(e,i,t[i]);return e},f=(e,t)=>s(e,o(t)),g=(e,t,i,s)=>{for(var o,r=s>1?void 0:s?a(t,i):t,l=e.length-1;l>=0;l--)(o=e[l])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&n(t,i,r),r},v=(e,t,i)=>t.has(e)||c("Cannot "+i),m=(e,t,i)=>(v(e,t,"read from private field"),i?i.call(e):t.get(e)),p=(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),_=(e,t,i,n)=>(v(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i)},81048:function(e,t,i){i.d(t,{N:()=>s});let n;var s=(0,i(57243).iv)(n||(n=(e=>e)`:host{box-sizing:border-box}:host *,:host ::after,:host ::before{box-sizing:inherit}[hidden]{display:none!important}`))}}]); //# sourceMappingURL=32654.01a2ff8e017cfb10.js.map