187 files
This commit is contained in:
1 parent
16c9b4d7f4
commit
d6413e19b5
187 files changed
+15542
-2765
No files matched your search
@@ -1,160 +1,169 @@
|
||||
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let a=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=r.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const i=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:o,defineProperty:s,getOwnPropertyDescriptor:d,getOwnPropertyNames:l,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,_=globalThis,h=_.trustedTypes,m=h?h.emptyScript:"",p=_.reactiveElementPolyfillSupport,f=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?m:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},g=(e,t)=>!o(e,t),v={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),_.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&s(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:a}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);a?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const e=this.properties,t=[...l(e),...c(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(i(e))}else void 0!==e&&t.push(i(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,r)=>{if(t)n.adoptedStyleSheets=r.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of r){const r=document.createElement("style"),a=e.litNonce;void 0!==a&&r.setAttribute("nonce",a),r.textContent=t.cssText,n.appendChild(r)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const a=(void 0!==n.converter?.toAttribute?n.converter:y).toAttribute(t,n.type);this._$Em=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=r;const i=a.fromAttribute(t,e.type);this[r]=i??this.Line truncated
|
||||
<div class="weather">${l?N`<ha-icon .icon=${s.icon}></ha-icon>`:F}${c?N`<span class="weather-temp-high">${s.temperature}°</span>`:F}${_?N`<span class="weather-temp-low">/${s.templow}°</span>`:F}${u?N`<span class="weather-uv-index">UV${s.uv_index}</span>`:F}</div>
|
||||
`}function xi(e){const t=e.getDay();return 0===t||6===t}function Ti(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(e).toDateString(),a=new Date(n);return a.setDate(a.getDate()+1),{isToday:r===n.toDateString(),isTomorrow:r===a.toDateString()}}function ji(e,t,n,r,a=F){const i=xi(e);let o=t.weekday_color,s=t.day_color,d=t.month_color;i&&(o=t.weekend_weekday_color||o,s=t.weekend_day_color||s,d=t.weekend_month_color||d),r&&(o=t.today_weekday_color||o,s=t.today_day_color||s,d=t.today_month_color||d);const l=Fn(n),c=l.daysOfWeek[e.getDay()],u=e.getDate(),_=l.months[e.getMonth()];return N`
|
||||
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let a=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=r.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const i=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:o,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:d,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,_=globalThis,m=_.trustedTypes,h=m?m.emptyScript:"",p=_.reactiveElementPolyfillSupport,f=(e,t)=>e,g={toAttribute(e,t){switch(t){case Boolean:e=e?h:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},y=(e,t)=>!o(e,t),v={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),_.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&s(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:a}=l(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){const i=r?.call(this);a?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const e=this.properties,t=[...d(e),...c(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(i(e))}else void 0!==e&&t.push(i(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,r)=>{if(t)n.adoptedStyleSheets=r.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of r){const r=document.createElement("style"),a=e.litNonce;void 0!==a&&r.setAttribute("nonce",a),r.textContent=t.cssText,n.appendChild(r)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const a=(void 0!==n.converter?.toAttribute?n.converter:g).toAttribute(t,n.type);this._$Em=e,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:g;this._$Em=r;const i=a.fromAttribute(t,e.type);this[r]=i??this.Line truncated
|
||||
<div class="weather">${d?N`<ha-icon .icon=${s.icon}></ha-icon>`:F}${c?N`<span class="weather-temp-high">${s.temperature}°</span>`:F}${_?N`<span class="weather-temp-low">/${s.templow}°</span>`:F}${u?N`<span class="weather-uv-index">UV${s.uv_index}</span>`:F}</div>
|
||||
`}function ii(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(e).toDateString(),a=new Date(n);return a.setDate(a.getDate()+1),{isToday:r===n.toDateString(),isTomorrow:r===a.toDateString()}}function oi(e,t,n,r,a=F){const i=Ta(e);let o=t.weekday_color,s=t.day_color,l=t.month_color;i&&(o=t.weekend_weekday_color||o,s=t.weekend_day_color||s,l=t.weekend_month_color||l),r&&(o=t.today_weekday_color||o,s=t.today_day_color||s,l=t.today_month_color||l);const d=Gn(n),c=d.daysOfWeek[e.getDay()],u=e.getDate(),_=d.months[e.getMonth()];return N`
|
||||
<div
|
||||
class="weekday"
|
||||
style=${vn({"font-size":t.weekday_font_size,color:o})}
|
||||
style=${xn({"font-size":t.weekday_font_size,color:o})}
|
||||
>
|
||||
${c}
|
||||
</div>
|
||||
<div
|
||||
class="day"
|
||||
style=${vn({"font-size":t.day_font_size,color:s})}
|
||||
style=${xn({"font-size":t.day_font_size,color:s})}
|
||||
>
|
||||
${u}
|
||||
</div>
|
||||
${t.show_month?N`
|
||||
<div
|
||||
class="month"
|
||||
style=${vn({"font-size":t.month_font_size,color:d})}
|
||||
style=${xn({"font-size":t.month_font_size,color:l})}
|
||||
>
|
||||
${_}
|
||||
</div>
|
||||
`:F}
|
||||
${a}
|
||||
`}const Hi=/[\u2000-\u3300]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|\uD83E[\uDC00-\uDFFF]/,zi=/[\s\p{L}]/u;function Oi(e,t,n){if(!e)return F;const r=xe(e,n);if("none"===r)return F;if("icon"===r)return N`<ha-icon icon="${e}" class="label-icon" style=${t?`color: ${t};`:F}></ha-icon>`;if("image"===r)return N`<img src="${e}" class="label-image" />`;const a=function(e){return Hi.test(e)&&!zi.test(e)}(e)?" label-emoji":"";return N`<span class="calendar-label${a}">${e}</span>`}function Ai(e){var t;const n=bi(e.weather);return!(!(null==(t=e.weather)?void 0:t.entity)||"event"!==n&&"both"!==n)}function Ei(e,t,n,r="title",a){var i,o,s,d;if(!Ai(t)||!(null==n?void 0:n.hourly))return N``;if(null==(i=e.end)?void 0:i.dateTime){const t=new Date;if(new Date(e.end.dateTime)<t)return N``}const l=(null==(o=t.weather)?void 0:o.event)||{},c=function(e,t,n,r=!1){if(e.start.date&&!e.start.dateTime&&n)return n[wa(va(e.start.date))];if(!e.start.dateTime)return;const a=new Date(e.start.dateTime),i=wa(a),o=a.getHours();if(t){const e=t[`${i}_${o}`];if(e)return e;let n=-1,r=24;if(Object.keys(t).forEach((e=>{if(e.startsWith(i)){const t=e.split("_")[1],a=parseInt(t);if(!isNaN(a)){const e=Math.abs(a-o);e<r&&(r=e,n=a)}}})),n>=0)return t[`${i}_${n}`]}return r&&n?n[i]:void 0}(e,n.hourly,n.daily,!1!==l.daily_forecast_fallback);if(!c)return N``;const u=!1!==l.show_conditions,_=!1!==l.show_temp,h=!0===l.show_uv_index&&void 0!==c.uv_index&&c.uv_index>=(null!=(s=l.uv_index_threshold)?s:0),m="row"===r,p=m||u,f=m&&u?function(e,t,n,r){var a;if(!e||!t||!n)return;const i=mi(e,r);if(i){const e=gi(i,n);if(e)return e}const o=null==(a=e.states)?void 0:a[t];if(!o||"function"!=typeof e.formatEntityState)return;const s=e.formatEntityState(o,n);return s?(s!==n||$i.has(n)||($i.add(n),et(`Weather condition "${n}" came back untranslated from ${t}; Home Assistant returned the raw token, so the row will show it as-is`)),s):void 0}(a,null==(d=t.weather)?void 0:d.entity,c.condition,t.language):void 0;return N`
|
||||
<div class="event-weather">${p?N`<ha-icon .icon=${c.icon}></ha-icon>`:F}<span class="event-weather-text">${_?N`<span>${c.temperature}°</span>`:F}${h?N`<span class="weather-uv-index">UV${c.uv_index}</span>`:F}${f?N`<span class="weather-condition">${f}</span>`:F}</span></div>
|
||||
`}function Ci(e,t,n,r={}){const{weatherForecasts:a,weatherPlacement:i="title",progressPlacement:o="inline",countdownPlacement:s="trailing",hass:d}=r,{eventTime:l,eventLocation:c,eventDescription:u,shouldShowTime:_,countdownStr:h,progressPercentage:m}=n,p=null!==m&&t.show_progress_bar,f=p&&"inline"===o,y=p&&"row"===o?N`
|
||||
`}const si=/[\u2000-\u3300]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|\uD83E[\uDC00-\uDFFF]/,li=/[\s\p{L}]/u;function di(e,t,n){if(!e)return F;const r=He(e,n);if("none"===r)return F;if("icon"===r)return N`<ha-icon icon="${e}" class="label-icon" style=${t?`color: ${t};`:F}></ha-icon>`;if("image"===r)return N`<img src="${e}" class="label-image" />`;const a=function(e){return si.test(e)&&!li.test(e)}(e)?" label-emoji":"";return N`<span class="calendar-label${a}">${e}</span>`}function ci(e){var t;const n=Qa(e.weather);return!(!(null==(t=e.weather)?void 0:t.entity)||"event"!==n&&"both"!==n)}function ui(e,t,n,r="title",a){var i,o,s,l;if(!ci(t)||!(null==n?void 0:n.hourly))return N``;if(null==(i=e.end)?void 0:i.dateTime){const t=new Date;if(new Date(e.end.dateTime)<t)return N``}const d=(null==(o=t.weather)?void 0:o.event)||{},c=function(e,t,n,r=!1){if(e.start.date&&!e.start.dateTime&&n)return n[La(Sa(e.start.date))];if(!e.start.dateTime)return;const a=new Date(e.start.dateTime),i=La(a),o=a.getHours();if(t){const e=t[`${i}_${o}`];if(e)return e;let n=-1,r=24;if(Object.keys(t).forEach((e=>{if(e.startsWith(i)){const t=e.split("_")[1],a=parseInt(t);if(!isNaN(a)){const e=Math.abs(a-o);e<r&&(r=e,n=a)}}})),n>=0)return t[`${i}_${n}`]}return r&&n?n[i]:void 0}(e,n.hourly,n.daily,!1!==d.daily_forecast_fallback);if(!c)return N``;const u=!1!==d.show_conditions,_=!1!==d.show_temp,m=!0===d.show_uv_index&&void 0!==c.uv_index&&c.uv_index>=(null!=(s=d.uv_index_threshold)?s:0),h="row"===r,p=h||u,f=h&&u?function(e,t,n,r){var a;if(!e||!t||!n)return;const i=Ra(e,r);if(i){const e=Ka(i,n);if(e)return e}const o=null==(a=e.states)?void 0:a[t];if(!o||"function"!=typeof e.formatEntityState)return;const s=e.formatEntityState(o,n);return s?(s!==n||ni.has(n)||(ni.add(n),st(`Weather condition "${n}" came back untranslated from ${t}; Home Assistant returned the raw token, so the row will show it as-is`)),s):void 0}(a,null==(l=t.weather)?void 0:l.entity,c.condition,t.language):void 0;return N`
|
||||
<div class="event-weather">${p?N`<ha-icon .icon=${c.icon}></ha-icon>`:F}<span class="event-weather-text">${_?N`<span>${c.temperature}°</span>`:F}${m?N`<span class="weather-uv-index">UV${c.uv_index}</span>`:F}${f?N`<span class="weather-condition">${f}</span>`:F}</span></div>
|
||||
`}function _i(e,t,n,r={}){const{weatherForecasts:a,weatherPlacement:i="title",progressPlacement:o="inline",countdownPlacement:s="trailing",hass:l}=r,{eventTime:d,allDayBadge:c,titlePill:u,eventLocation:_,locationIcon:m,eventDescription:h,shouldShowTime:p,countdownStr:f,progressPercentage:g,entityLabel:y}=n,v=null!==g&&t.show_progress_bar,w=v&&"inline"===o,b=v&&"row"===o?N`
|
||||
<div class="progress-bar progress-bar-row">
|
||||
<div class="progress-bar-filled" style="width: ${m}%"></div>
|
||||
<div class="progress-bar-filled" style="width: ${g}%"></div>
|
||||
</div>
|
||||
`:F,g="title"===i?a:void 0,v="row"===i&&Ai(t)?Ei(e,t,a,"row",d):F,w="text"===s&&null!==h,M=w?null:h,b=w?N`<span class="time-text"><span>${l}</span><span class="time-countdown">${h}</span></span>`:N`<span>${l}</span>`;return N`
|
||||
`:F,M="title"===i?a:void 0,k="row"===i&&ci(t)?ui(e,t,a,"row",l):F,D="text"===s&&null!==f,Y=D?null:f,$=d?N`<span>${d}</span>`:F,x=c?N`<span
|
||||
class=${"allday-badge allday-pill-"+c.mode+(c.inheritsText?" allday-source-text":"")}
|
||||
lang=${c.lang}
|
||||
style=${`--calendar-card-event-accent: ${c.accent};`+(c.inheritsText?" --badge-source: var(--calendar-card-color-time);":"")}
|
||||
>${c.label}</span
|
||||
>`:F,S=D?N`<span class="time-text">${$}<span class="time-countdown">${f}</span></span>`:$;return N`
|
||||
<div class="event-content">
|
||||
${function(e,t,n){var r,a,i;const o=!!e._isEmptyDay,s=o&&!e._isCustomEmptyText,d=o?"var(--calendar-card-empty-day-color)":(null==(r=e._matchedConfig)?void 0:r.color)||t.event_color,l=ri(e._entityId,t,e),c=null==(a=e._matchedConfig)?void 0:a.label_icon_color,u=null==(i=e._matchedConfig)?void 0:i.label_type;return N`
|
||||
${function(e,t,n,r,a){var i,o,s;const l=!!e._isEmptyDay,d=l&&!e._isCustomEmptyText,c=l?"var(--calendar-card-empty-day-color)":(null==(i=e._matchedConfig)?void 0:i.color)||t.event_color,u=null==(o=e._matchedConfig)?void 0:o.label_icon_color,_=null==(s=e._matchedConfig)?void 0:s.label_type,m=d?`✓ ${e.summary}`:e.summary,h=a?`allday-title-pill allday-pill-${a.mode}`+(a.inheritsText?" allday-source-text":""):"",p=a?`--calendar-card-event-accent: ${a.accent};`+(a.inheritsText?` --badge-source: ${c};`:""):"",f=a?N`<span
|
||||
class=${h}
|
||||
style=${p}
|
||||
>${m}</span
|
||||
>`:m;return N`
|
||||
<div class="summary-row">
|
||||
<div class="summary">
|
||||
${l?Oi(l,c,u):F}
|
||||
${n?di(n,u,_):F}
|
||||
<span
|
||||
class="event-title ${o?"empty-day-title":""}"
|
||||
style="color: ${d}"
|
||||
class="event-title ${l?"empty-day-title":""}"
|
||||
style="color: ${c}"
|
||||
>
|
||||
${s?`✓ ${e.summary}`:e.summary}
|
||||
${f}
|
||||
</span>
|
||||
</div>
|
||||
${Ei(e,t,n)}
|
||||
${ui(e,t,r)}
|
||||
</div>
|
||||
`}(e,t,g)}
|
||||
`}(e,t,y,M,u)}
|
||||
<div class="time-location">
|
||||
${y}
|
||||
${_?N`
|
||||
${b}
|
||||
${p?N`
|
||||
<div class="time">
|
||||
<div class="time-actual">
|
||||
<ha-icon icon="mdi:clock-outline"></ha-icon>
|
||||
${b}
|
||||
${x}${S}
|
||||
</div>
|
||||
${M?N`<div class="time-countdown">${M}</div>`:f?N`
|
||||
${Y?N`<div class="time-countdown">${Y}</div>`:w?N`
|
||||
<div class="progress-bar">
|
||||
<div
|
||||
class="progress-bar-filled"
|
||||
style="width: ${m}%"
|
||||
style="width: ${g}%"
|
||||
></div>
|
||||
</div>
|
||||
`:F}
|
||||
</div>
|
||||
`:h?N`
|
||||
`:f?N`
|
||||
<div class="time">
|
||||
<div class="time-actual"></div>
|
||||
<div class="time-countdown">${h}</div>
|
||||
<div class="time-countdown">${f}</div>
|
||||
</div>
|
||||
`:f?N`
|
||||
`:w?N`
|
||||
<div class="time">
|
||||
<div class="time-actual"></div>
|
||||
<div class="progress-bar">
|
||||
<div class="progress-bar-filled" style="width: ${m}%"></div>
|
||||
<div class="progress-bar-filled" style="width: ${g}%"></div>
|
||||
</div>
|
||||
</div>
|
||||
`:F}
|
||||
${v}
|
||||
${c?N`
|
||||
${k}
|
||||
${_?N`
|
||||
<div class="location">
|
||||
<ha-icon icon="mdi:map-marker-outline"></ha-icon>
|
||||
<span>${c}</span>
|
||||
<ha-icon icon="${m}"></ha-icon>
|
||||
<span>${_}</span>
|
||||
</div>
|
||||
`:""}
|
||||
${u?N`
|
||||
${h?N`
|
||||
<div class="description">
|
||||
<ha-icon icon="mdi:information-outline"></ha-icon>
|
||||
<span>${u}</span>
|
||||
<span>${h}</span>
|
||||
</div>
|
||||
`:""}
|
||||
</div>
|
||||
</div>
|
||||
`}function Pi(e,t,n="absolute"){if(!e.today_indicator||!t)return F;const r=e.today_indicator,a=function(e){if(void 0===e||!1===e)return"none";if(!0===e)return"dot";if("string"==typeof e)return"pulse"===e||"glow"===e?e:Se(e)?"mdi":e.startsWith("/")||e.includes(".png")||e.includes(".jpg")||e.includes(".svg")||e.includes(".webp")||e.includes(".gif")?"image":/[\p{Emoji}]/u.test(e)?"emoji":"dot";return"none"}(r);if("none"===a)return F;const i="inline"===n?{}:function(e){const t={position:"absolute",transform:"translate(-50%, -50%)"},n=e.trim().split(/\s+/);return n.length>=1&&(t.left=n[0]),n.length>=2?t.top=n[1]:t.top="50%",t}(e.today_indicator_position);return N`
|
||||
`}function mi(e,t,n="absolute"){if(!e.today_indicator||!t)return F;const r=e.today_indicator,a=void 0===(i=r)||!1===i?"none":!0===i?"dot":"string"==typeof i?"dot"===i||"pulse"===i||"glow"===i?i:""===i.trim()?"dot":Te(i)?"mdi":i.startsWith("/")||/^https?:\/\//i.test(i)||/\.(apng|avif|bmp|gif|ico|jpe?g|png|svg|webp)(?:[?#]|$)/i.test(i)?"image":"emoji":"none";var i;if("none"===a)return F;const o="inline"===n?{}:function(e){const t={position:"absolute",transform:"translate(-50%, -50%)"},n=e.trim().split(/\s+/);return n.length>=1&&(t.left=n[0]),n.length>=2?t.top=n[1]:t.top="50%",t}(e.today_indicator_position);return N`
|
||||
<div class="today-indicator-container${"inline"===n?" inline":""}">
|
||||
${function(e,t,n){let r="";switch(e){case"dot":case"pulse":case"glow":r="mdi:circle";break;case"mdi":r="string"==typeof t?t:"mdi:circle";break;case"image":return"string"==typeof t?N` <img
|
||||
src="${t}"
|
||||
class="today-indicator image"
|
||||
style=${vn(n)}
|
||||
style=${xn(n)}
|
||||
alt="Today"
|
||||
/>`:F;case"emoji":return"string"==typeof t?N` <span class="today-indicator emoji" style=${vn(n)}>
|
||||
/>`:F;case"emoji":return"string"==typeof t?N` <span class="today-indicator emoji" style=${xn(n)}>
|
||||
${t}
|
||||
</span>`:F;default:return F}if(r)return N` <ha-icon
|
||||
icon="${r}"
|
||||
class="today-indicator ${e}"
|
||||
style=${vn(n)}
|
||||
style=${xn(n)}
|
||||
>
|
||||
</ha-icon>`;return F}(a,r,i)}
|
||||
</ha-icon>`;return F}(a,r,o)}
|
||||
</div>
|
||||
`}function Ii(e,t,n,r){var a;const i=Boolean(e._isEmptyDay),o=new Date,s=new Date(o.getFullYear(),o.getMonth(),o.getDate());let d=!1;if(!i){if(!e.start.dateTime){let t=e.end.date?va(e.end.date):null;if(t){const e=new Date(t);e.setDate(e.getDate()-1),t=e}d=null!==t&&s>t}else{const t=e.end.dateTime?new Date(e.end.dateTime):null;d=null!==t&&o>t}}const l=ni(e._entityId,t,void 0,e),c=t.event_background_opacity>0?t.event_background_opacity:0,u=c>0?ni(e._entityId,t,c,e):"",_=null!=(a=ai(e._entityId,"show_time",t,e))?a:t.show_time,h=!e.start.dateTime,m=function(e){if(e.start.dateTime)return!1;const t=va(e.start.date||""),n=va(e.end.date||"");return n.setDate(n.getDate()-1),t.toDateString()!==n.toDateString()}(e),p=_&&!(h&&!m&&!t.show_single_allday_time)&&!i;let f=null;!t.show_countdown||h&&!t.show_countdown_allday||i||d||(f=function(e,t="en"){if(e._isEmptyDay||!e.start)return null;const n=new Date,r=!e.start.dateTime,a=e.start.dateTime?new Date(e.start.dateTime):e.start.date?va(e.start.date):null;if(!a||a<=n)return null;const i=r||Boolean(e._isMultiDaySegment),o=new Date(n.getFullYear(),n.getMonth(),n.getDate()),s=new Date(a.getFullYear(),a.getMonth(),a.getDate());return i&&s>o?ha(s,t,o):ha(a,t)}(e,n));const y=ii(e)&&t.show_progress_bar?function(e){if(!ii(e))return null;const t=new Date,n=new Date(e.start.dateTime),r=new Date(e.end.dateTime).getTime()-n.getTime(),a=t.getTime()-n.getTime();return Math.min(100,Math.max(0,Math.floor(a/r*100)))}(e):null;return{isEmptyDay:i,isPastEvent:d,entityAccentColor:l,entityAccentBackgroundColor:u,contentParts:{eventTime:ma(e,t,n,r),eventLocation:e.location||"",eventDescription:e.description||"",shouldShowTime:p,countdownStr:f,progressPercentage:y}}}var Ni=Object.defineProperty,Wi=Object.getOwnPropertySymbols,Fi=Object.prototype.hasOwnProperty,Ui=Object.prototype.propertyIsEnumerable,Ji=(e,t,n)=>t in e?Ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Ri(e,t){return e.isNewMonth&&!It(t.month_separator_width)?{kind:"month",width:t.month_separator_width,color:t.month_separator_color}:e.isNewWeek&&!It(t.week_separator_width)?{kind:"week",width:t.week_separator_width,color:t.week_separator_color}:It(t.day_separator_width)?null:{kind:"day",width:t.day_separator_width,color:t.day_separator_color}}function Vi(e,t,n,r,a,i){const o=new Date(e.timestamp),{isToday:s,isTomorrow:d}=Ti(e.timestamp),l=xi(o),c=Li(o,t,a),u=Pt(t,"day_header_separator_width"),_=Pt(t,"day_header_separator_color"),h=It(u)?F:N`<div
|
||||
`}function hi(e){return"home-assistant"===e}const pi=new Set(["primary","accent","red","pink","purple","deep-purple","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","deep-orange","brown","light-grey","grey","dark-grey","blue-grey","black","white","primary-text","secondary-text","disabled"]);let fi,gi,yi=new Map,vi=!1,wi=0,bi=!1;const Mi=new Set;function ki(){for(const e of Mi)e()}function Di(e){const t=function(e,t){if("function"==typeof e.callWS)return e.callWS(t);const n=e.connection;return n&&"function"==typeof n.sendMessagePromise?n.sendMessagePromise(t):void 0}(e,{type:"config/entity_registry/list"});if(t)return t.then((e=>{yi=function(e){var t,n;const r=new Map;for(const i of null!=e?e:[]){const e=null==i?void 0:i.entity_id;if("string"!=typeof e||!e.startsWith("calendar."))continue;const o=null==(n=null==(t=i.options)?void 0:t.calendar)?void 0:n.color;"string"==typeof o&&""!==o&&r.set(e,(a=o,pi.has(a)?`var(--${a}-color)`:a))}var a;return r}(e),vi=!0,st(`Loaded ${yi.size} calendar colors from the entity registry`)})).catch((e=>{st("Could not read calendar colors from the entity registry",e)}));bi||(bi=!0,st("This instance exposes no WebSocket command API, so Home Assistant calendar colors are unavailable; configured colors are used instead"))}function Yi(e,t){if(!e)return;if(Mi.add(t),function(e){const t=e.connection;if(gi||!t||"function"!=typeof t.subscribeEvents)return;gi=()=>{};const n=++wi;t.subscribeEvents((()=>{const t=Di(e);t&&t.then(ki)}),"entity_registry_updated").then((e=>{n===wi?gi=e:e()})).catch((()=>{n===wi&&(gi=void 0)}))}(e),vi||fi)return;const n=Di(e);n&&(fi=n.then((()=>{fi=void 0,ki()})))}function $i(e){Mi.delete(e),0===Mi.size&&(wi++,gi&&(gi(),gi=void 0),vi=!1)}const xi=/(?:^|\s)year[:=](\d{4})(?!\w)/i,Si=new RegExp(xi.source,"gi");function Li(e){return e.replace(Si,"").replace(/[^\S\n]{2,}/g," ").replace(/[^\S\n]+\n/g,"\n").replace(/\n{3,}/g,"\n\n").trim()}function Ti(e,t){return e.trim().length>0?`${e} (${t})`:`(${t})`}const ji={sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},Hi="start_of_week";function zi(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Ei(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Oi(e,t){const n=(t-e.getDay()+7)%7;return Ei(e,n)}function Ai(e,t){const n=(e.getDay()-t+7)%7;return Ei(e,-n)}function Ci(e){const t=[];let n="";for(const r of e)"+"===r||"-"===r?(t.push(n),n=r):n+=r;return t.push(n),t}function Pi(e,t,n){const r=String(e).replace(/\s+/g,"").toLowerCase();if(""===r)return{kind:"nomatch"};const a=Ci(r),i=a[0],o=a.slice(1);let s;if("today"===i)s=zi(n);else if(i===Hi)s=function(e,t){return Ai(e,(t%7+7)%7)}(n,t);else if(i in ji)s=Oi(zi(n),ji[i]);else{if(""!==i)return{kind:"nomatch"};s=zi(n)}if(o.length>8)return{kind:"error",message:"too many operators (maximum 8)"};for(const e of o){const t="-"===e[0]?-1:1,n=e.slice(1);if(""===n)return{kind:"error",message:`dangling "${e[0]}" with no value`};if(n in ji){const e=ji[n];s=t>0?Oi(s,e):Ai(s,e);continue}const r=n.match(/^(\d+)w$/);if(r){s=Ei(s,t*parseInt(r[1],10)*7);continue}const a=n.match(/^(\d+)$/);if(!a)return{kind:"error",message:`unrecognized operand "${n}"`};s=Ei(s,t*parseInt(a[1],10))}return{kind:"ok",date:s}}const Ii=new Map;function Ni(e){return void 0===e||""===e?void 0:e}function Wi(e,t,n){var r,a;if(null===t||t.field!==n||""===e)return{text:e,replacedWholeField:!1};if(void 0===t.pattern)return{text:null!=(r=t.replacement)?r:"",replacedWholeField:!0};const i=function(e){var t;if(Ii.has(e))return null!=(t=Ii.get(e))?t:null;let n=null;try{n=new RegExp(e,"gi")}catch(t){at(`Ignoring "replace_pattern": ${JSON.stringify(e)} is not a valid regular expression. Event text is shown unchanged.`)}return Ii.set(e,n),n}(t.pattern);return null===i?{text:e,replacedWholeField:!1}:{text:e.replace(i,null!=(a=t.replacement)?a:""),replacedWholeField:!1}}var Fi=Object.defineProperty,Ui=Object.defineProperties,Ri=Object.getOwnPropertyDescriptors,Ji=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Bi=Object.prototype.propertyIsEnumerable,Ki=(e,t,n)=>t in e?Fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qi=(e,t)=>{for(var n in t||(t={}))Vi.call(t,n)&&Ki(e,n,t[n]);if(Ji)for(var n of Ji(t))Bi.call(t,n)&&Ki(e,n,t[n]);return e},Gi=(e,t)=>Ui(e,Ri(t));const Zi=new Map;async function Qi(e,t,n,r=!1){const a=Aa(t.first_day_of_week,e.locale),i=function(e,t,n,r,a){const i=t.map((e=>"string"==typeof e?e:e.entity)).sort().join("_");let o="";if(r)try{o=r.includes("T")?r.split("T")[0]:r}catch(e){o=r}const s=o?`_${o}`:"",l=function(e){const t=String(e).replace(/\s+/g,"").toLowerCase();return""!==t&&Ci(t)[0]===Hi}(o)&&void 0!==a?`_fdw${a}`:"";return`${me}${e}_${i}_${n}${s}${l}${de}`}(n,t.entities,t.days_to_show,t.start_date,a),o=function(){if(window.performance&&window.performance.navigation)return 1===window.performance.navigation.type;if(wi
Line truncated
|
||||
class="column-header-separator"
|
||||
style=${vn({borderTopWidth:u,borderTopColor:_,borderTopStyle:"solid"})}
|
||||
></div>`,m=Pi(t,s,"inline"),p=m!==F;return N`
|
||||
style=${xn({borderTopWidth:u,borderTopColor:_,borderTopStyle:"solid"})}
|
||||
></div>`,h=mi(t,s,"inline"),p=h!==F;return N`
|
||||
<div
|
||||
class=${sn({"day-column":!0,today:s,tomorrow:d,"future-day":!s,weekend:l})}
|
||||
style=${vn({gridColumn:String(r+1),gridRow:"2"})}
|
||||
class=${pn({"day-column":!0,today:s,tomorrow:l,"future-day":!s,weekend:d})}
|
||||
style=${xn({gridColumn:String(r+1),gridRow:"2"})}
|
||||
>
|
||||
<div class="column-day-header">
|
||||
<div
|
||||
class=${sn({"column-date-content":!0,"with-today-indicator":p})}
|
||||
class=${pn({"column-date-content":!0,"with-today-indicator":p})}
|
||||
>
|
||||
${m}
|
||||
${ji(o,t,n,s,c)}
|
||||
${h}
|
||||
${oi(o,t,n,s,c)}
|
||||
</div>
|
||||
</div>
|
||||
${h}
|
||||
${m}
|
||||
<div class="column-events">
|
||||
${fn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,o)=>function(e,t,n,r,a,i,o){const s=Ii(e,r,a,o),d=0===n,l=n===t.events.length-1,c={event:!0,"event-first":d,"event-middle":!d&&!l,"event-last":l,"past-event":s.isPastEvent};return N`
|
||||
${Dn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,o)=>function(e,t,n,r,a,i,o){const s=$o(e,r,a,o),l=0===n,d=n===t.events.length-1,c={event:!0,"event-first":l,"event-middle":!l&&!d,"event-last":d,"past-event":s.isPastEvent};return N`
|
||||
<div
|
||||
class=${sn(c)}
|
||||
class=${pn(c)}
|
||||
style="border-inline-start: var(--calendar-card-line-width-vertical) solid ${s.entityAccentColor}; background-color: ${s.entityAccentBackgroundColor};"
|
||||
>
|
||||
${Ci(e,r,s.contentParts,{weatherForecasts:i,weatherPlacement:"row",progressPlacement:"row",countdownPlacement:"text",hass:o})}
|
||||
${_i(e,r,s.contentParts,{weatherForecasts:i,weatherPlacement:"row",progressPlacement:"row",countdownPlacement:"text",hass:o})}
|
||||
</div>
|
||||
`}(r,e,o,t,n,a,i)))}
|
||||
</div>
|
||||
</div>
|
||||
`}function Bi(e,t,n){return N`
|
||||
`}function Eo(e,t,n){return N`
|
||||
<div
|
||||
class="column-week-number"
|
||||
style=${vn(((e,t)=>{for(var n in t||(t={}))Fi.call(t,n)&&Ji(e,n,t[n]);if(Wi)for(var n of Wi(t))Ui.call(t,n)&&Ji(e,n,t[n]);return e})({gridColumn:String(n+1),gridRow:"1"},t?{}:{visibility:"hidden"}))}
|
||||
style=${xn(((e,t)=>{for(var n in t||(t={}))Lo.call(t,n)&&jo(e,n,t[n]);if(So)for(var n of So(t))To.call(t,n)&&jo(e,n,t[n]);return e})({gridColumn:String(n+1),gridRow:"1"},t?{}:{visibility:"hidden"}))}
|
||||
>
|
||||
<div class="week-number">${null!=e?e:""}</div>
|
||||
</div>
|
||||
`}function Ki(e,t,n,r,a){const i=Pt(t,"day_header_gap"),o=Bt(t.day_spacing),s=function(e){return e.map(((t,n)=>{const r=n>0?e[n-1]:void 0;return{isNewWeek:!r||t.weekNumber!==r.weekNumber,isNewMonth:Boolean(r&&t.monthNumber!==r.monthNumber)}}))}(e),d=function(e,t,n){const r=t.map(((e,t)=>e.isNewWeek&&!(0===t&&!n.show_current_week_number)));return null!==n.show_week_numbers&&r.some(Boolean)?e.map(((e,t)=>Bi(e.weekNumber,r[t],t))):e.map((()=>F))}(e,s,t),l=s.map(((e,n)=>({separator:Ri(e,t),index:n}))).filter((({separator:e,index:t})=>null!==e&&t>0)).map((({separator:e,index:t})=>function(e,t,n){return N`
|
||||
`}function Oo(e,t,n,r,a){const i=Vt(t,"day_header_gap"),o=tn(t.day_spacing),s=function(e){return e.map(((t,n)=>{const r=n>0?e[n-1]:void 0;return{isNewWeek:!r||t.weekNumber!==r.weekNumber,isNewMonth:Boolean(r&&t.monthNumber!==r.monthNumber)}}))}(e),l=function(e,t,n){const r=t.map(((e,t)=>e.isNewWeek&&!(0===t&&!n.show_current_week_number)));return null!==n.show_week_numbers&&r.some(Boolean)?e.map(((e,t)=>Eo(e.weekNumber,r[t],t))):e.map((()=>F))}(e,s,t),d=s.map(((e,n)=>({separator:Ho(e,t),index:n}))).filter((({separator:e,index:t})=>null!==e&&t>0)).map((({separator:e,index:t})=>function(e,t,n){return N`
|
||||
<div
|
||||
class="column-separator column-separator-${e.kind}"
|
||||
style=${vn({gridColumn:String(t+1),gridRow:"day"===e.kind?"2":"1 / -1",width:e.width,backgroundColor:e.color,marginInlineStart:`calc(-0.5 * (${n} + ${e.width}))`})}
|
||||
style=${xn({gridColumn:String(t+1),gridRow:"day"===e.kind?"2":"1 / -1",width:e.width,backgroundColor:e.color,marginInlineStart:`calc(-0.5 * (${n} + ${e.width}))`})}
|
||||
></div>
|
||||
`}(e,t,o)));return N`
|
||||
<div
|
||||
class="column-grid"
|
||||
style=${vn({gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,columnGap:o,"--calendar-card-column-header-gap":i})}
|
||||
style=${xn({gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,columnGap:o,"--calendar-card-column-header-gap":i})}
|
||||
>
|
||||
${d}
|
||||
${e.map(((e,i)=>Vi(e,t,n,i,r,a)))}
|
||||
${l}
|
||||
${e.map(((e,i)=>zo(e,t,n,i,r,a)))}
|
||||
${d}
|
||||
</div>
|
||||
`}function qi(e,t){const n=Fn(t);return"loading"===e?N`
|
||||
`}function Ao(e,t){const n=Gn(t);return"loading"===e?N`
|
||||
<div class="calendar-card">
|
||||
<div class="loading">${n.loading}</div>
|
||||
</div>
|
||||
@@ -162,12 +171,12 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
<div class="calendar-card">
|
||||
<div class="error">${n.error}</div>
|
||||
</div>
|
||||
`}function Gi(e,t,n,r="day"){if("day"===r)return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:"0px",marginBottom:n.day_spacing};let a=Me.WEEK;"month"===r&&(a=Me.MONTH);const i=Nt(n.day_spacing,a);return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:i,marginBottom:i}}function Zi(e,t,n,r,a=!1,i="day"){if(It(e)||a)return F;const o=Gi(e,t,r,i);return N`<div class="${n}" style=${vn(o)}></div>`}function Qi(e){return Zi(e.month_separator_width,e.month_separator_color,"month-separator",e,!1,"month")}function Xi(e,t=!1){return Zi(e.week_separator_width,e.week_separator_color,"week-separator",e,t,"week")}function eo(e,t,n,r,a,i,o){const{isToday:s,isTomorrow:d}=Ti(e.timestamp),l=xi(new Date(e.timestamp));let c=F;const u=(null==a?void 0:a.isNewMonth)||!1,_=(null==a?void 0:a.isNewWeek)||!1,h=u&&!It(t.month_separator_width),m=_&&(null!==t.show_week_numbers||!It(t.week_separator_width)),p=t.day_separator_width,f=t.day_separator_color;if(r&&!It(p)&&!h&&!m){const e=Gi(p,f,t,"day");c=N`<div class="separator" style=${vn(e)}></div>`}return N`
|
||||
`}function Co(e,t,n,r="day"){if("day"===r)return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:"0px",marginBottom:n.day_spacing};let a=be.WEEK;"month"===r&&(a=be.MONTH);const i=Kt(n.day_spacing,a);return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:i,marginBottom:i}}function Po(e,t,n,r,a=!1,i="day"){if(Bt(e)||a)return F;const o=Co(e,t,r,i);return N`<div class="${n}" style=${xn(o)}></div>`}function Io(e){return Po(e.month_separator_width,e.month_separator_color,"month-separator",e,!1,"month")}function No(e,t=!1){return Po(e.week_separator_width,e.week_separator_color,"week-separator",e,t,"week")}function Wo(e,t,n,r,a,i,o){const{isToday:s,isTomorrow:l}=ii(e.timestamp),d=Ta(new Date(e.timestamp));let c=F;const u=(null==a?void 0:a.isNewMonth)||!1,_=(null==a?void 0:a.isNewWeek)||!1,m=u&&!Bt(t.month_separator_width),h=_&&(null!==t.show_week_numbers||!Bt(t.week_separator_width)),p=t.day_separator_width,f=t.day_separator_color;if(r&&!Bt(p)&&!m&&!h){const e=Co(p,f,t,"day");c=N`<div class="separator" style=${xn(e)}></div>`}return N`
|
||||
${c}
|
||||
<table
|
||||
class=${sn({"day-table":!0,today:s,tomorrow:d,"future-day":!s,weekend:l})}
|
||||
class=${pn({"day-table":!0,today:s,tomorrow:l,"future-day":!s,weekend:d})}
|
||||
>
|
||||
${fn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,a)=>function(e,t,n,r,a,i,o,s){const d=Ii(e,r,a,s),l=new Date(t.timestamp),c=xi(l),u=0===n,_=n===t.events.length-1,h={event:!0,"event-first":u,"event-middle":!u&&!_,"event-last":_,"past-event":d.isPastEvent};return N`
|
||||
${Dn(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((r,a)=>function(e,t,n,r,a,i,o,s){const l=$o(e,r,a,s),d=new Date(t.timestamp),c=Ta(d),u=0===n,_=n===t.events.length-1,m={event:!0,"event-first":u,"event-middle":!u&&!_,"event-last":_,"past-event":l.isPastEvent};return N`
|
||||
<tr>
|
||||
${0===n?N`
|
||||
<td
|
||||
@@ -175,36 +184,36 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
rowspan="${t.events.length}"
|
||||
style="position: relative;"
|
||||
>
|
||||
${function(e,t,n,r,a){return ji(e,t,n,r,Li(e,t,a))}(l,r,a,i,o)}
|
||||
${Pi(r,i)}
|
||||
${function(e,t,n,r,a){return oi(e,t,n,r,ai(e,t,a))}(d,r,a,i,o)}
|
||||
${mi(r,i)}
|
||||
</td>
|
||||
`:""}
|
||||
<td
|
||||
class=${sn(h)}
|
||||
style="border-inline-start: var(--calendar-card-line-width-vertical) solid ${d.entityAccentColor}; background-color: ${d.entityAccentBackgroundColor};"
|
||||
class=${pn(m)}
|
||||
style="border-inline-start: var(--calendar-card-line-width-vertical) solid ${l.entityAccentColor}; background-color: ${l.entityAccentBackgroundColor};"
|
||||
>
|
||||
${Ci(e,r,d.contentParts,{weatherForecasts:o})}
|
||||
${_i(e,r,l.contentParts,{weatherForecasts:o})}
|
||||
</td>
|
||||
</tr>
|
||||
`}(r,e,a,t,n,s,i,o)))}
|
||||
</table>
|
||||
`}function to(e,t,n,r,a){return N`
|
||||
${e.map(((i,o)=>{var s;const d=o>0?e[o-1]:void 0,l=null!=(s=i.weekNumber)?s:null;let c=!1;if(d){c=i.weekNumber!==d.weekNumber}else c=!0;const u=d&&i.monthNumber!==d.monthNumber,_=0===o,h={isNewWeek:c,isNewMonth:Boolean(u)};let m=F;return!u||It(t.month_separator_width)||c&&null!==t.show_week_numbers?c&&(m=_&&null!==t.show_week_numbers&&!t.show_current_week_number?u?Qi(t):Xi(t,_):null!==t.show_week_numbers?function(e,t,n,r=!1){if(null===e)return F;const a=t?Me.MONTH:Me.WEEK,i={marginTop:r?"0px":Nt(n.day_spacing,a/2-1),marginBottom:Nt(n.day_spacing,a/2)},o={};return r?o["--separator-display"]="none":t&&!It(n.month_separator_width)?(o["--separator-border-width"]=n.month_separator_width,o["--separator-border-color"]=n.month_separator_color,o["--separator-display"]="block"):It(n.week_separator_width)?o["--separator-display"]="none":(o["--separator-border-width"]=n.week_separator_width,o["--separator-border-color"]=n.week_separator_color,o["--separator-display"]="block"),N`
|
||||
<table class="week-row-table" style=${vn(i)}>
|
||||
`}function Fo(e,t,n,r,a){return N`
|
||||
${e.map(((i,o)=>{var s;const l=o>0?e[o-1]:void 0,d=null!=(s=i.weekNumber)?s:null;let c=!1;if(l){c=i.weekNumber!==l.weekNumber}else c=!0;const u=l&&i.monthNumber!==l.monthNumber,_=0===o,m={isNewWeek:c,isNewMonth:Boolean(u)};let h=F;return!u||Bt(t.month_separator_width)||c&&null!==t.show_week_numbers?c&&(h=_&&null!==t.show_week_numbers&&!t.show_current_week_number?u?Io(t):No(t,_):null!==t.show_week_numbers?function(e,t,n,r=!1){if(null===e)return F;const a=t?be.MONTH:be.WEEK,i={marginTop:r?"0px":Kt(n.day_spacing,a/2-1),marginBottom:Kt(n.day_spacing,a/2)},o={};return r?o["--separator-display"]="none":t&&!Bt(n.month_separator_width)?(o["--separator-border-width"]=n.month_separator_width,o["--separator-border-color"]=n.month_separator_color,o["--separator-display"]="block"):Bt(n.week_separator_width)?o["--separator-display"]="none":(o["--separator-border-width"]=n.week_separator_width,o["--separator-border-color"]=n.week_separator_color,o["--separator-display"]="block"),N`
|
||||
<table class="week-row-table" style=${xn(i)}>
|
||||
<tr>
|
||||
<td class="week-number-cell">
|
||||
<div class="week-number">${e}</div>
|
||||
</td>
|
||||
<td class="separator-cell" style=${vn(o)}>
|
||||
<td class="separator-cell" style=${xn(o)}>
|
||||
<div class="separator-line"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
`}(l,Boolean(u),t,_):Xi(t,_)):m=Qi(t),N`
|
||||
${m}
|
||||
${eo(i,t,n,d,h,r,a)}
|
||||
`}(d,Boolean(u),t,_):No(t,_)):h=Io(t),N`
|
||||
${h}
|
||||
${Wo(i,t,n,l,m,r,a)}
|
||||
`}))}
|
||||
`}const no=((e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new a(r,e,n)})`
|
||||
`}const Uo=((e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1]),e[0]);return new a(r,e,n)})`
|
||||
:host {
|
||||
display: block;
|
||||
height: 100%;
|
||||
@@ -583,6 +592,10 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
display: flex;
|
||||
align-items: var(--calendar-card-event-icon-vertical-alignment);
|
||||
}
|
||||
.time .time-actual:has(.allday-badge) {
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
}
|
||||
.time .time-actual .time-text {
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
@@ -606,6 +619,9 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
content: '\\2060·\\200B';
|
||||
margin-inline-end: 4px;
|
||||
}
|
||||
.time .time-actual .allday-badge + .time-text > .time-countdown {
|
||||
margin-inline-start: 0;
|
||||
}
|
||||
.time-countdown {
|
||||
text-align: right;
|
||||
color: var(--calendar-card-color-time);
|
||||
@@ -622,6 +638,123 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
font-size: var(--calendar-card-font-size-description);
|
||||
color: var(--calendar-card-color-description);
|
||||
}
|
||||
.allday-badge,
|
||||
.allday-title-pill {
|
||||
--badge-ink: color-mix(
|
||||
in srgb,
|
||||
var(--calendar-card-event-accent) 30%,
|
||||
var(--primary-text-color)
|
||||
);
|
||||
--badge-wash: color-mix(
|
||||
in srgb,
|
||||
var(--calendar-card-event-accent) 10%,
|
||||
var(--calendar-card-background-color, var(--card-background-color))
|
||||
);
|
||||
--badge-solid: var(--calendar-card-event-accent);
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
border-radius: 999px;
|
||||
}
|
||||
.allday-pill-tinted {
|
||||
color: var(--badge-ink);
|
||||
background-color: var(--badge-wash);
|
||||
box-shadow: inset 0 0 0 1px var(--badge-solid);
|
||||
}
|
||||
.allday-badge {
|
||||
font-size: 0.85em;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
line-height: 1.05;
|
||||
padding-block: 0.193em 0.127em;
|
||||
padding-inline: 0.5em;
|
||||
margin-inline-end: 5px;
|
||||
}
|
||||
.allday-title-pill {
|
||||
font-size: 0.95em;
|
||||
line-height: 1.16;
|
||||
padding-block: 0.21em;
|
||||
padding-inline: 0.55em;
|
||||
font-weight: 400;
|
||||
vertical-align: middle;
|
||||
margin-block: -0.17em;
|
||||
}
|
||||
@supports (text-box-trim: trim-both) and (text-box-edge: cap alphabetic) {
|
||||
.allday-badge {
|
||||
text-box-trim: trim-both;
|
||||
text-box-edge: cap alphabetic;
|
||||
padding-block: 0.3295em;
|
||||
}
|
||||
}
|
||||
.allday-pill-subtle {
|
||||
color: var(--badge-ink);
|
||||
background-color: var(--badge-wash);
|
||||
box-shadow: none;
|
||||
}
|
||||
.allday-pill-outline {
|
||||
color: var(--badge-solid);
|
||||
background-color: transparent;
|
||||
box-shadow: inset 0 0 0 1px currentColor;
|
||||
}
|
||||
.allday-pill-filled {
|
||||
color: var(--calendar-card-background-color, var(--card-background-color));
|
||||
background-color: color-mix(
|
||||
in srgb,
|
||||
var(--badge-solid) 85%,
|
||||
var(--calendar-card-background-color, var(--card-background-color))
|
||||
);
|
||||
box-shadow: none;
|
||||
}
|
||||
@supports (color: color-mix(in oklch, red, blue)) {
|
||||
.allday-badge,
|
||||
.allday-title-pill {
|
||||
--badge-ink: color-mix(
|
||||
in oklch,
|
||||
var(--calendar-card-event-accent) 45%,
|
||||
var(--primary-text-color)
|
||||
);
|
||||
--badge-wash: color-mix(
|
||||
in oklch,
|
||||
var(--calendar-card-event-accent) 14%,
|
||||
var(--calendar-card-background-color, var(--card-background-color))
|
||||
);
|
||||
}
|
||||
}
|
||||
@supports (color: oklch(from red l c h)) {
|
||||
.allday-badge,
|
||||
.allday-title-pill {
|
||||
--badge-ink: oklch(
|
||||
from color-mix(in oklch, var(--calendar-card-event-accent) 45%, var(--primary-text-color)) l
|
||||
calc(c * 2.2) h
|
||||
);
|
||||
--badge-wash: oklch(
|
||||
from
|
||||
color-mix(
|
||||
in oklch,
|
||||
var(--calendar-card-event-accent) 14%,
|
||||
var(--calendar-card-background-color, var(--card-background-color))
|
||||
)
|
||||
l calc(c * 1.8) h
|
||||
);
|
||||
}
|
||||
}
|
||||
@supports (color: oklch(from red l c h)) {
|
||||
.allday-pill-filled {
|
||||
color: oklch(from var(--badge-solid) clamp(0, calc((l - 0.55) * -1000), 1) 0 h);
|
||||
background-color: var(--badge-solid);
|
||||
}
|
||||
}
|
||||
.allday-badge.allday-source-text,
|
||||
.allday-title-pill.allday-source-text {
|
||||
--badge-ink: var(--badge-source);
|
||||
--badge-wash: color-mix(in srgb, var(--badge-source) 14%, transparent);
|
||||
--badge-solid: var(--badge-source);
|
||||
}
|
||||
.time-location .event-weather {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
@@ -668,7 +801,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
-webkit-line-clamp: var(--calendar-card-description-max-lines);
|
||||
overflow: hidden;
|
||||
}
|
||||
.time .time-actual > span:not(.time-text) {
|
||||
.time .time-actual > span:not(.time-text):not(.allday-badge) {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: var(--calendar-card-time-max-lines);
|
||||
@@ -852,10 +985,10 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
justify-self: start;
|
||||
pointer-events: none;
|
||||
}
|
||||
`;var ro=Object.defineProperty,ao=Object.getOwnPropertySymbols,io=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,so=(e,t,n)=>t in e?ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let lo=!0;function co(e){return"string"==typeof e&&(e.includes("{{")||e.includes("{%"))}async function uo(e,t,n){const r=null==e?void 0:e.connection;if(!r||!t)return;const a=e=>{if(e&&"error"in e)return"WARNING"===e.level?void et("Template warning",{template:t,error:e.error}):(Ge("Template render error",{template:t,error:e.error}),void n.onError(e.error));var r;e&&"result"in e&&n.onResult(null==(r=e.result)?"":"string"==typeof r?r:String(r))},i=e=>r.subscribeMessage(a,((e,t)=>{for(var n in t||(t={}))io.call(t,n)&&so(e,n,t[n]);if(ao)for(var n of ao(t))oo.call(t,n)&&so(e,n,t[n]);return e})({type:"render_template",template:t},e?{report_errors:!0}:{}));try{return await i(lo)}catch(e){if(lo&&function(e){return"invalid_format"===(null==e?void 0:e.code)}(e)){lo=!1,Ze("Home Assistant rejected the render_template `report_errors` option; falling back to basic template rendering (requires 2023.9+ for error reporting)");try{return await i(!1)}catch(e){return void Ge("Failed to subscribe to template",{template:t,error:e})}}const r=null==e?void 0:e.message;return Ge("Failed to subscribe to template",{template:t,error:e}),void n.onError(null!=r?r:String(e))}}class _o{constructor(e){this.callbacks=e,this._hasConnected=!1,this._version=0}update(e,t){const n=co(t)?t:void 0,r=null==e?void 0:e.connection,a=!this._hasConnected&&Boolean(r);r&&(this._hasConnected=!0),n===this._template&&r===this._connection||(this._template=n,this._connection=r,this._version++,this._clearPending(),this._teardown(),n&&e&&(a?this._subscribe(e,n,this._version):this._debounceId=setTimeout((()=>{this._debounceId=void 0,this._subscribe(e,n,this._version)}),300)))}destroy(){this._version++,this._template=void 0,this._connection=void 0,this._hasConnected=!1,this._clearPending(),this._teardown()}async _subscribe(e,t,n){const r=await uo(e,t,{onResult:e=>{n===this._version&&this.callbacks.onResult(e)},onError:e=>{n===this._version&&this.callbacks.onError(e)}});r&&(n===this._version?this._unsubscribe=r:r())}_clearPending(){this._debounceId&&(clearTimeout(this._debounceId),this._debounceId=void 0)}_teardown(){if(this._unsubscribe){try{this._unsubscribe()}catch(e){Ze("Failed to unsubscribe from template",e)}this._unsubscribe=void 0}}}var ho=Object.defineProperty,mo=Object.defineProperties,po=Object.getOwnPropertyDescriptor,fo=Object.getOwnPropertyDescriptors,yo=Object.getOwnPropertySymbols,go=Object.prototype.hasOwnProperty,vo=Object.prototype.propertyIsEnumerable,wo=(e,t,n)=>t in e?ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mo=(e,t)=>{for(var n in t||(t={}))go.call(t,n)&&wo(e,n,t[n]);if(yo)for(var n of yo(t))vo.call(t,n)&&wo(e,n,t[n]);return e},bo=(e,t)=>mo(e,fo(t)),ko=(e,t,n,r)=>{for(var a,i=r>1?void 0:r?po(t,n):t,o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&ho(t,n,i),i};function Do(e,t){const n=e,r=null==n?void 0:n.CalendarCardProEditor;if("function"!=typeof r)throw new Error("Calendar Card Pro: the editor file was found but is not the card’s editor. This usually means another file of the same name is installed alongside it — put the card’s files in a folder of their own, or reinstall through HACS, which does that for you. The card itself is unaffected.");const a=null==n?void 0:n.EDITOR_VERSION;a!==le&&Ze(`Editor file is v${null!=a?a:"unknown"} but the card is v${le}. Both files come from the same release, so one of them is stale — hard-refresh the browser, and if that does not help, reinstall so the card and editor files are replaced together.`),customElements.get(t)||customElements.define(t,r)}let Yo=class extends ae{constructor(){super(),this.config=Mo({},_t),this.events=[],this.isInitialLoad=!0,this.isLoading=!1,this.isExpanded=!1,this.weatherForecasts={daily:{},hourly:{}},this.preview=!1,this.editMode=!1,this.connectedWhileHidden=!0,this._instanceId=Te(),this._eventsInstanceId="",this._eventRequestGeneration=0,this._language="",this._lastUpdateTime=0,this._weatherUnsubscribers=[],this._weatherSetupVersion=0,this._weatherSetupPending=!1,this._hasFetchError=!1,this._activePointerId=null,this._holdTriggered=!1,this._holdTimer=null,this._holdIndicator=null,this._measuredWidthPx=null,this._effectiveView="list",this._columnCount=0,this._resizeObserver=null,this._widthSettleTimerId=null,this._handleVisibilityChange=()=>{if("visible"===document.visibilityState){Date.now()-this._lastUpdateTime>ve&&(et("Visibility changed to visible, updating events"),this.updateEvents())}},this._instanceId=Te(),qe(le)}static async getConfigElement(){if(!customElements.get("calendar-card-pro-editor"))try{Do(await import(function(e){const t=new URL("./editor.js",e);return t.search=new URL(e).search,t.href}(import.meta.url)),"calendar-card-pro-editor")}catch(e){const t=e instanceof Error?e.message:Strin
Line truncated
|
||||
`;var Ro=Object.defineProperty,Jo=Object.getOwnPropertySymbols,Vo=Object.prototype.hasOwnProperty,Bo=Object.prototype.propertyIsEnumerable,Ko=(e,t,n)=>t in e?Ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let qo=!0;function Go(e){return"string"==typeof e&&(e.includes("{{")||e.includes("{%"))}async function Zo(e,t,n){const r=null==e?void 0:e.connection;if(!r||!t)return;const a=e=>{if(e&&"error"in e)return"WARNING"===e.level?void st("Template warning",{template:t,error:e.error}):(rt("Template render error",{template:t,error:e.error}),void n.onError(e.error));var r;e&&"result"in e&&n.onResult(null==(r=e.result)?"":"string"==typeof r?r:String(r))},i=e=>r.subscribeMessage(a,((e,t)=>{for(var n in t||(t={}))Vo.call(t,n)&&Ko(e,n,t[n]);if(Jo)for(var n of Jo(t))Bo.call(t,n)&&Ko(e,n,t[n]);return e})({type:"render_template",template:t},e?{report_errors:!0}:{}));try{return await i(qo)}catch(e){if(qo&&function(e){return"invalid_format"===(null==e?void 0:e.code)}(e)){qo=!1,at("Home Assistant rejected the render_template `report_errors` option; falling back to basic template rendering (requires 2023.9+ for error reporting)");try{return await i(!1)}catch(e){return void rt("Failed to subscribe to template",{template:t,error:e})}}const r=null==e?void 0:e.message;return rt("Failed to subscribe to template",{template:t,error:e}),void n.onError(null!=r?r:String(e))}}class Qo{constructor(e){this.callbacks=e,this._hasConnected=!1,this._version=0}update(e,t){const n=Go(t)?t:void 0,r=null==e?void 0:e.connection,a=!this._hasConnected&&Boolean(r);r&&(this._hasConnected=!0),n===this._template&&r===this._connection||(this._template=n,this._connection=r,this._version++,this._clearPending(),this._teardown(),n&&e&&(a?this._subscribe(e,n,this._version):this._debounceId=setTimeout((()=>{this._debounceId=void 0,this._subscribe(e,n,this._version)}),300)))}destroy(){this._version++,this._template=void 0,this._connection=void 0,this._hasConnected=!1,this._clearPending(),this._teardown()}async _subscribe(e,t,n){const r=await Zo(e,t,{onResult:e=>{n===this._version&&this.callbacks.onResult(e)},onError:e=>{n===this._version&&this.callbacks.onError(e)}});r&&(n===this._version?this._unsubscribe=r:r())}_clearPending(){this._debounceId&&(clearTimeout(this._debounceId),this._debounceId=void 0)}_teardown(){if(this._unsubscribe){try{this._unsubscribe()}catch(e){at("Failed to unsubscribe from template",e)}this._unsubscribe=void 0}}}var Xo=Object.defineProperty,es=Object.defineProperties,ts=Object.getOwnPropertyDescriptor,ns=Object.getOwnPropertyDescriptors,rs=Object.getOwnPropertySymbols,as=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,os=(e,t,n)=>t in e?Xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ss=(e,t)=>{for(var n in t||(t={}))as.call(t,n)&&os(e,n,t[n]);if(rs)for(var n of rs(t))is.call(t,n)&&os(e,n,t[n]);return e},ls=(e,t)=>es(e,ns(t)),ds=(e,t,n,r)=>{for(var a,i=r>1?void 0:r?ts(t,n):t,o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Xo(t,n,i),i};function cs(e,t){const n=e,r=null==n?void 0:n.CalendarCardProEditor;if("function"!=typeof r)throw new Error("Calendar Card Pro: the editor file was found but is not the card’s editor. This usually means another file of the same name is installed alongside it — put the card’s files in a folder of their own, or reinstall through HACS, which does that for you. The card itself is unaffected.");const a=null==n?void 0:n.EDITOR_VERSION;a!==de&&at(`Editor file is v${null!=a?a:"unknown"} but the card is v${de}. Both files come from the same release, so one of them is stale — hard-refresh the browser, and if that does not help, reinstall so the card and editor files are replaced together.`),customElements.get(t)||customElements.define(t,r)}let us=class extends ae{constructor(){super(),this.config=ss({},vt),this.events=[],this.isInitialLoad=!0,this.isLoading=!1,this.isExpanded=!1,this.weatherForecasts={daily:{},hourly:{}},this.preview=!1,this.editMode=!1,this.connectedWhileHidden=!0,this._instanceId=ze(),this._eventsInstanceId="",this._eventRequestGeneration=0,this._language="",this._lastUpdateTime=0,this._weatherUnsubscribers=[],this._weatherSetupVersion=0,this._weatherSetupPending=!1,this._hasFetchError=!1,this._activePointerId=null,this._holdTriggered=!1,this._holdTimer=null,this._holdIndicator=null,this._measuredWidthPx=null,this._effectiveView="list",this._columnCount=0,this._resizeObserver=null,this._widthSettleTimerId=null,this._handleVisibilityChange=()=>{if("visible"===document.visibilityState){Date.now()-this._lastUpdateTime>ve&&(st("Visibility changed to visible, updating events"),this.updateEvents())}},this._onEntityColorsChanged=()=>{this.requestUpdate()},this._instanceId=ze(),nt(de)}static async getConfigElement(){if(!customElements.get("calendar-card-pro-editor"))try{cs(await import(function(e){const t=new URL("./editor.js",e);return t.search=new URL(e).search,t.href}(import.meta.url)),"calendar-card-pro-edito
Line truncated
|
||||
<ha-card
|
||||
class=${s}
|
||||
style=${vn(e)}
|
||||
style=${xn(e)}
|
||||
tabindex="0"
|
||||
aria-busy=${a?"true":"false"}
|
||||
@keydown=${r.keyDown}
|
||||
@@ -887,4 +1020,4 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
||||
<!-- Content container is always present -->
|
||||
<div class="content-container">${n}</div>
|
||||
</ha-card>
|
||||
`}(e,this.effectiveTitle,n,t,this.isLoading,this.isTitlePending,this.effectiveView)}};Yo.getStubConfig=$t,ko([de({attribute:!1})],Yo.prototype,"hass",2),ko([de({attribute:!1})],Yo.prototype,"config",2),ko([de({attribute:!1})],Yo.prototype,"events",2),ko([de({attribute:!1})],Yo.prototype,"isInitialLoad",2),ko([de({attribute:!1})],Yo.prototype,"isLoading",2),ko([de({attribute:!1})],Yo.prototype,"isExpanded",2),ko([de({attribute:!1})],Yo.prototype,"weatherForecasts",2),ko([de({attribute:!1})],Yo.prototype,"renderedTitle",2),ko([de({type:Boolean})],Yo.prototype,"preview",2),ko([de({type:Boolean})],Yo.prototype,"editMode",2),Yo=ko([(e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("calendar-card-pro")],Yo);const $o=customElements.get("calendar-card-pro");$o&&($o.getStubConfig=$t),window.customCards=window.customCards||[],window.customCards.push({type:"calendar-card-pro",name:"Calendar Card Pro",preview:!0,description:"A calendar card that supports multiple calendars with individual styling.",documentationURL:"https://github.com/alexpfau/calendar-card-pro",getEntitySuggestion:function(e,t){if("string"!=typeof t||"calendar"!==t.split(".")[0])return null;if(!e||"object"!=typeof e)return null;const n=e.states;return n&&"object"==typeof n&&n[t]?[{config:ut(ct({},Yt([t])),{grid_options:ct({},Dt)})},{label:"Columns",config:ut(ct({},Yt([t])),{view:"column",grid_options:ct({},Dt)})}]:null}});export{Do as adoptEditorComponent};
|
||||
`}(e,this.effectiveTitle,n,t,this.isLoading,this.isTitlePending,this.effectiveView)}};us.getStubConfig=Et,ds([le({attribute:!1})],us.prototype,"hass",2),ds([le({attribute:!1})],us.prototype,"config",2),ds([le({attribute:!1})],us.prototype,"events",2),ds([le({attribute:!1})],us.prototype,"isInitialLoad",2),ds([le({attribute:!1})],us.prototype,"isLoading",2),ds([le({attribute:!1})],us.prototype,"isExpanded",2),ds([le({attribute:!1})],us.prototype,"weatherForecasts",2),ds([le({attribute:!1})],us.prototype,"renderedTitle",2),ds([le({type:Boolean})],us.prototype,"preview",2),ds([le({type:Boolean})],us.prototype,"editMode",2),us=ds([(e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("calendar-card-pro")],us);const _s=customElements.get("calendar-card-pro");_s&&(_s.getStubConfig=Et),window.customCards=window.customCards||[],window.customCards.push({type:"calendar-card-pro",name:"Calendar Card Pro",preview:!0,description:"A calendar card that supports multiple calendars with individual styling.",documentationURL:"https://github.com/alexpfau/calendar-card-pro",getEntitySuggestion:function(e,t){if("string"!=typeof t||"calendar"!==t.split(".")[0])return null;if(!e||"object"!=typeof e)return null;const n=e.states;return n&&"object"==typeof n&&n[t]?[{config:yt(gt({},zt([t])),{grid_options:gt({},Ht)})},{label:"Columns",config:yt(gt({},zt([t])),{view:"column",grid_options:gt({},Ht)})}]:null}});export{cs as adoptEditorComponent};
|
||||
Reference in new issue
Block a user