feat: configure outdoor texture scale and rotation per area
This commit is contained in:
1 parent
d8cf076019
commit
c56f1a5ba9
26 files changed
+1958
-1778
No files matched your search
@@ -6,6 +6,8 @@ All notable changes to NextFloor, newest first. Every release lists what is **Ad
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- **Per-area texture controls (Symcon 0.2.30):** Set outdoor pattern size (5–2000%, 100% preserves the original metre scale) and rotation independently for every area. Persist and duplicate the settings, wrap rotation and bound scale, and apply inverse sampling transforms to solid/transparent and sloped geometry without altering outlines or neighbors. Legacy plans retain the original appearance; an info popup explains the controls.
|
||||||
|
|
||||||
- **Outdoor snapping and surface textures (Symcon 0.2.29):** Snap outdoor outlines to nearby corners and edges when drawing, moving or resizing, preserving whole-area geometry and Alt bypass. Add street, sidewalk, gravel, river and stream surfaces with schema persistence; river/stream areas default to cutting through surrounding surfaces. All outdoor materials use local metre-scaled procedural textures with distance filtering, including paving joints, asphalt grain, pebbles, vegetation, earth, wood and water ripples. Textures compose with floor fading, slopes, transparency and scene themes without external assets.
|
- **Outdoor snapping and surface textures (Symcon 0.2.29):** Snap outdoor outlines to nearby corners and edges when drawing, moving or resizing, preserving whole-area geometry and Alt bypass. Add street, sidewalk, gravel, river and stream surfaces with schema persistence; river/stream areas default to cutting through surrounding surfaces. All outdoor materials use local metre-scaled procedural textures with distance filtering, including paving joints, asphalt grain, pebbles, vegetation, earth, wood and water ripples. Textures compose with floor fading, slopes, transparency and scene themes without external assets.
|
||||||
|
|
||||||
- **Fresh-water cascades with storage links (Symcon 0.2.28):** Rebuild the 3D station around separate primary and potable-water paths and a plate exchanger. Add up to 16 named parallel units with independent native temperature, power, pump and isolation-valve links; preserve legacy single-station bindings on edit. Share the supply/return, hot/cold-water and optional circulation headers, keep one compact cascade overlay, and open per-station readouts/commands with archive trends and existing read-only guards. Link a placed same-floor buffer through two primary-only pipes that follow placement and floor transforms; removal releases connections and subscriptions. Buffer colour layers interpolate measured probes only. Adding/removing units adjusts width and never sends device commands or invents parent utility totals.
|
- **Fresh-water cascades with storage links (Symcon 0.2.28):** Rebuild the 3D station around separate primary and potable-water paths and a plate exchanger. Add up to 16 named parallel units with independent native temperature, power, pump and isolation-valve links; preserve legacy single-station bindings on edit. Share the supply/return, hot/cold-water and optional circulation headers, keep one compact cascade overlay, and open per-station readouts/commands with archive trends and existing read-only guards. Link a placed same-floor buffer through two primary-only pipes that follow placement and floor transforms; removal releases connections and subscriptions. Buffer colour layers interpolate measured probes only. Adding/removing units adjusts width and never sends device commands or invents parent utility totals.
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,7 @@
|
|||||||
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
||||||
var m={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};var M=globalThis,N=M.ShadowRoot&&(M.ShadyCSS===void 0||M.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U=Symbol(),pe=new WeakMap,R=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==U)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(N&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=pe.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pe.set(t,e))}return e}toString(){return this.cssText}},fe=i=>new R(typeof i=="string"?i:i+"",void 0,U),j=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,r,o)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1],i[0]);return new R(t,i,U)},ge=(i,e)=>{if(N)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),r=M.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=t.cssText,i.appendChild(n)}},q=N?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return fe(t)})(i):i;var{is:Ge,defineProperty:Oe,getOwnPropertyDescriptor:Ie,getOwnPropertyNames:Ze,getOwnPropertySymbols:Ve,getPrototypeOf:Ue}=Object,C=globalThis,be=C.trustedTypes,je=be?be.emptyScript:"",qe=C.reactiveElementPolyfillSupport,F=(i,e)=>i,J={toAttribute(i,e){switch(e){case Boolean:i=i?je:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ke=(i,e)=>!Ge(i,e),we={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ke};Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;var b=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=we){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){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Oe(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:o}=Ie(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:r,set(a){let s=r?.call(this);o?.call(this,a),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??we}static _$Ei(){if(this.hasOwnProperty(F("elementProperties")))return;let e=Ue(this);e.finalize(),e.l!==void 0&&(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"))){let t=this.properties,n=[...Ze(t),...Ve(t)];for(let r of n)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,r]of t)this.elementProperties.set(n,r)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let r=this._$Eu(t,n);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let r of n)t.unshift(q(r))}else e!==void 0&&t.push(q(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ge(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.Line truncated
|
var m={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};var M=globalThis,N=M.ShadowRoot&&(M.ShadyCSS===void 0||M.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U=Symbol(),pe=new WeakMap,R=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==U)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(N&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=pe.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pe.set(t,e))}return e}toString(){return this.cssText}},fe=i=>new R(typeof i=="string"?i:i+"",void 0,U),j=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,r,o)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1],i[0]);return new R(t,i,U)},ge=(i,e)=>{if(N)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),r=M.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=t.cssText,i.appendChild(n)}},q=N?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return fe(t)})(i):i;var{is:Ge,defineProperty:Oe,getOwnPropertyDescriptor:Ie,getOwnPropertyNames:Ze,getOwnPropertySymbols:Ve,getPrototypeOf:Ue}=Object,C=globalThis,be=C.trustedTypes,je=be?be.emptyScript:"",qe=C.reactiveElementPolyfillSupport,x=(i,e)=>i,J={toAttribute(i,e){switch(e){case Boolean:i=i?je:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ke=(i,e)=>!Ge(i,e),we={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ke};Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;var b=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=we){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){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Oe(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:o}=Ie(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:r,set(a){let s=r?.call(this);o?.call(this,a),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??we}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;let e=Ue(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){let t=this.properties,n=[...Ze(t),...Ve(t)];for(let r of n)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,r]of t)this.elementProperties.set(n,r)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let r=this._$Eu(t,n);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let r of n)t.unshift(q(r))}else e!==void 0&&t.push(q(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ge(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.Line truncated
|
||||||
\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Se=/-->/g,Ae=/>/g,S=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
\f\r]`,F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Se=/-->/g,Ae=/>/g,S=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,ze=/"/g,Fe=/^(?:script|style|textarea|title)$/i,oe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),l=oe(1),ut=oe(2),mt=oe(3),z=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ee=new WeakMap,A=D.createTreeWalker(D,129);function xe(i,e){if(!ie(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ye!==void 0?ye.createHTML(e):e}var Ye=(i,e)=>{let t=i.length-1,n=[],r,o=e===2?"<svg>":e===3?"<math>":"",a=x;for(let s=0;s<t;s++){let h=i[s],u,p,_=-1,g=0;for(;g<h.length&&(a.lastIndex=g,p=a.exec(h),p!==null);)g=a.lastIndex,a===x?p[1]==="!--"?a=Se:p[1]!==void 0?a=Ae:p[2]!==void 0?(Fe.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=S):p[3]!==void 0&&(a=S):a===S?p[0]===">"?(a=r??x,_=-1):p[1]===void 0?_=-2:(_=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?S:p[3]==='"'?ze:De):a===ze||a===De?a=S:a===Se||a===Ae?a=x:(a=S,r=void 0);let k=a===S&&i[s+1].startsWith("/>")?" ":"";o+=a===x?h+Je:_>=0?(n.push(u),h.slice(0,_)+Te+h.slice(_)+v+k):h+v+(_===-2?s:k)}return[xe(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},B=class i{constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let o=0,a=0,s=e.length-1,h=this.parts,[u,p]=Ye(e,t);if(this.el=i.createElement(u,n),A.currentNode=this.el.content,t===2||t===3){let _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(r=A.nextNode())!==null&&h.length<s;){if(r.nodeType===1){if(r.hasAttributes())for(let _ of r.getAttributeNames())if(_.endsWith(Te)){let g=p[a++],k=r.getAttribute(_).split(v),$=/([.?@])?(.*)/.exec(g);h.push({type:1,index:o,name:$[2],strings:k,ctor:$[1]==="."?Q:$[1]==="?"?ee:$[1]==="@"?te:T}),r.removeAttribute(_)}else _.startsWith(v)&&(h.push({type:6,index:o}),r.removeAttribute(_));if(Fe.test(r.tagName)){let _=r.textContent.split(v),g=_.length-1;if(g>0){r.textContent=K?K.emptyScript:"";for(let k=0;k<g;k++)r.append(_[k],H()),A.nextNode(),h.push({type:2,index:++o});r.append(_[g],H())}}}else if(r.nodeType===8)if(r.data===Re)h.push({type:2,index:o});else{let _=-1;for(;(_=r.data.indexOf(v,_+1))!==-1;)h.push({type:7,index:o}),_+=v.length-1}o++}}static createElement(e,t){let n=D.createElement("template");return n.innerHTML=e,n}};function E(i,e,t=i,n){if(e===z)return e;let r=n!==void 0?t._$Co?.[n]:t._$Cl,o=W(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(i),r._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=r:t._$Cl=r),r!==void 0&&(e=E(i,r._$AS(i,e.values),r,n)),e}var Y=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??D).importNode(t,!0);A.currentNode=r;let o=A.nextNode(),a=0,s=0,h=n[0];for(;h!==void 0;){if(a===h.index){let u;h.type===2?u=new P(o,o.nextSibling,this,e):h.type===1?u=new h.ctor(o,h.name,h.strings,this,e):h.type===6&&(u=new ne(o,this,e)),this._$AV.push(u),h=n[++s]}a!==h?.index&&(o=A.nextNode(),a++)}return A.currentNode=D,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},P=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=E(this,e,t),W(e)?e===d||e==null||e===""?(this._$AH!==d&&this._$AR(),this._$AH=d):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xe(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==d&&W(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=B.createElement(xe(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let o=new Y(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Ee.get(e.strings);return t===void 0&&Ee.set(e.strings,t=new B(e)),t}k(e){ie(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,r=0;for(let o of e)r===t.length?t.push(n=new i(this.O(H()),this.O(H()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=ve(e).nextSibling;ve(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):thLine truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,ze=/"/g,xe=/^(?:script|style|textarea|title)$/i,oe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),l=oe(1),ut=oe(2),mt=oe(3),z=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ee=new WeakMap,A=D.createTreeWalker(D,129);function Fe(i,e){if(!ie(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ye!==void 0?ye.createHTML(e):e}var Ye=(i,e)=>{let t=i.length-1,n=[],r,o=e===2?"<svg>":e===3?"<math>":"",a=F;for(let s=0;s<t;s++){let h=i[s],u,p,_=-1,g=0;for(;g<h.length&&(a.lastIndex=g,p=a.exec(h),p!==null);)g=a.lastIndex,a===F?p[1]==="!--"?a=Se:p[1]!==void 0?a=Ae:p[2]!==void 0?(xe.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=S):p[3]!==void 0&&(a=S):a===S?p[0]===">"?(a=r??F,_=-1):p[1]===void 0?_=-2:(_=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?S:p[3]==='"'?ze:De):a===ze||a===De?a=S:a===Se||a===Ae?a=F:(a=S,r=void 0);let k=a===S&&i[s+1].startsWith("/>")?" ":"";o+=a===F?h+Je:_>=0?(n.push(u),h.slice(0,_)+Te+h.slice(_)+v+k):h+v+(_===-2?s:k)}return[Fe(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},B=class i{constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let o=0,a=0,s=e.length-1,h=this.parts,[u,p]=Ye(e,t);if(this.el=i.createElement(u,n),A.currentNode=this.el.content,t===2||t===3){let _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(r=A.nextNode())!==null&&h.length<s;){if(r.nodeType===1){if(r.hasAttributes())for(let _ of r.getAttributeNames())if(_.endsWith(Te)){let g=p[a++],k=r.getAttribute(_).split(v),$=/([.?@])?(.*)/.exec(g);h.push({type:1,index:o,name:$[2],strings:k,ctor:$[1]==="."?Q:$[1]==="?"?ee:$[1]==="@"?te:T}),r.removeAttribute(_)}else _.startsWith(v)&&(h.push({type:6,index:o}),r.removeAttribute(_));if(xe.test(r.tagName)){let _=r.textContent.split(v),g=_.length-1;if(g>0){r.textContent=K?K.emptyScript:"";for(let k=0;k<g;k++)r.append(_[k],H()),A.nextNode(),h.push({type:2,index:++o});r.append(_[g],H())}}}else if(r.nodeType===8)if(r.data===Re)h.push({type:2,index:o});else{let _=-1;for(;(_=r.data.indexOf(v,_+1))!==-1;)h.push({type:7,index:o}),_+=v.length-1}o++}}static createElement(e,t){let n=D.createElement("template");return n.innerHTML=e,n}};function E(i,e,t=i,n){if(e===z)return e;let r=n!==void 0?t._$Co?.[n]:t._$Cl,o=W(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(i),r._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=r:t._$Cl=r),r!==void 0&&(e=E(i,r._$AS(i,e.values),r,n)),e}var Y=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??D).importNode(t,!0);A.currentNode=r;let o=A.nextNode(),a=0,s=0,h=n[0];for(;h!==void 0;){if(a===h.index){let u;h.type===2?u=new P(o,o.nextSibling,this,e):h.type===1?u=new h.ctor(o,h.name,h.strings,this,e):h.type===6&&(u=new ne(o,this,e)),this._$AV.push(u),h=n[++s]}a!==h?.index&&(o=A.nextNode(),a++)}return A.currentNode=D,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},P=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=E(this,e,t),W(e)?e===d||e==null||e===""?(this._$AH!==d&&this._$AR(),this._$AH=d):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xe(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==d&&W(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=B.createElement(Fe(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let o=new Y(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Ee.get(e.strings);return t===void 0&&Ee.set(e.strings,t=new B(e)),t}k(e){ie(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,r=0;for(let o of e)r===t.length?t.push(n=new i(this.O(H()),this.O(H()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=ve(e).nextSibling;ve(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):thLine truncated
|
||||||
<input type="checkbox" .checked=${e} @change=${o=>r(rt(o))} />
|
<input type="checkbox" .checked=${e} @change=${o=>r(rt(o))} />
|
||||||
<span>${i.t(t)}${n?l`<small>${i.t(n)}</small>`:d}</span>
|
<span>${i.t(t)}${n?l`<small>${i.t(n)}</small>`:d}</span>
|
||||||
</label>`}var c=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r)),le=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r||void 0));function w(i,e,t,n,r){return l`<label class="field"
|
</label>`}var c=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r)),le=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r||void 0));function w(i,e,t,n,r){return l`<label class="field"
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -1,13 +1,13 @@
|
|||||||
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
||||||
var w={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=n=>n===void 0?n:JSON.parse(JSON.stringify(n)));var Un=globalThis,jn=Un.ShadowRoot&&(Un.ShadyCSS===void 0||Un.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fi=Symbol(),hs=new WeakMap,nn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==fi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(jn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=hs.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&hs.set(t,e))}return e}toString(){return this.cssText}},ms=n=>new nn(typeof n=="string"?n:n+"",void 0,fi),J=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((r,i,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new nn(t,n,fi)},ps=(n,e)=>{if(jn)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=Un.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},gi=jn?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ms(t)})(n):n;var{is:fd,defineProperty:gd,getOwnPropertyDescriptor:_d,getOwnPropertyNames:bd,getOwnPropertySymbols:vd,getPrototypeOf:yd}=Object,qn=globalThis,fs=qn.trustedTypes,wd=fs?fs.emptyScript:"",xd=qn.reactiveElementPolyfillSupport,rn=(n,e)=>n,_i={toAttribute(n,e){switch(e){case Boolean:n=n?wd:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},_s=(n,e)=>!fd(n,e),gs={attribute:!0,type:String,converter:_i,reflect:!1,useDefault:!1,hasChanged:_s};Symbol.metadata??=Symbol("metadata"),qn.litPropertyMetadata??=new WeakMap;var Le=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=gs){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){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&gd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=_d(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:i,set(s){let a=i?.call(this);o?.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??gs}static _$Ei(){if(this.hasOwnProperty(rn("elementProperties")))return;let e=yd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(rn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rn("properties"))){let t=this.properties,r=[...bd(t),...vd(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(gi(i))}else e!==void 0&&t.push(gi(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadLine truncated
|
var w={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=n=>n===void 0?n:JSON.parse(JSON.stringify(n)));var Un=globalThis,jn=Un.ShadowRoot&&(Un.ShadyCSS===void 0||Un.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fi=Symbol(),hs=new WeakMap,nn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==fi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(jn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=hs.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&hs.set(t,e))}return e}toString(){return this.cssText}},ms=n=>new nn(typeof n=="string"?n:n+"",void 0,fi),J=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((r,i,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new nn(t,n,fi)},ps=(n,e)=>{if(jn)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=Un.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},gi=jn?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ms(t)})(n):n;var{is:fd,defineProperty:gd,getOwnPropertyDescriptor:_d,getOwnPropertyNames:bd,getOwnPropertySymbols:vd,getPrototypeOf:yd}=Object,qn=globalThis,fs=qn.trustedTypes,wd=fs?fs.emptyScript:"",xd=qn.reactiveElementPolyfillSupport,rn=(n,e)=>n,_i={toAttribute(n,e){switch(e){case Boolean:n=n?wd:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},_s=(n,e)=>!fd(n,e),gs={attribute:!0,type:String,converter:_i,reflect:!1,useDefault:!1,hasChanged:_s};Symbol.metadata??=Symbol("metadata"),qn.litPropertyMetadata??=new WeakMap;var Le=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=gs){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){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&gd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=_d(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:i,set(s){let a=i?.call(this);o?.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??gs}static _$Ei(){if(this.hasOwnProperty(rn("elementProperties")))return;let e=yd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(rn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rn("properties"))){let t=this.properties,r=[...bd(t),...vd(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(gi(i))}else e!==void 0&&t.push(gi(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadLine truncated
|
||||||
\f\r]`,on=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ys=/-->/g,ws=/>/g,ct=RegExp(`>|${bi}(?:([^\\s"'>=/]+)(${bi}*=${bi}*(?:[^
|
\f\r]`,on=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ys=/-->/g,ws=/>/g,ct=RegExp(`>|${bi}(?:([^\\s"'>=/]+)(${bi}*=${bi}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),xs=/'/g,ks=/"/g,As=/^(?:script|style|textarea|title)$/i,Mi=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Mi(1),ne=Mi(2),fg=Mi(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ss=new WeakMap,dt=ht.createTreeWalker(ht,129);function Es(n,e){if(!$i(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return vs!==void 0?vs.createHTML(e):e}var $d=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=on;for(let a=0;a<t;a++){let l=n[a],u,c,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,c=s.exec(l),c!==null);)m=s.lastIndex,s===on?c[1]==="!--"?s=ys:c[1]!==void 0?s=ws:c[2]!==void 0?(As.test(c[2])&&(i=RegExp("</"+c[2],"g")),s=ct):c[3]!==void 0&&(s=ct):s===ct?c[0]===">"?(s=i??on,h=-1):c[1]===void 0?h=-2:(h=s.lastIndex-c[2].length,u=c[1],s=c[3]===void 0?ct:c[3]==='"'?ks:xs):s===ks||s===xs?s=ct:s===ys||s===ws?s=on:(s=ct,i=void 0);let d=s===ct&&n[a+1].startsWith("/>")?" ":"";o+=s===on?l+kd:h>=0?(r.push(u),l.slice(0,h)+$s+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Es(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ln=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[u,c]=$d(e,t);if(this.el=n.createElement(u,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith($s)){let m=c[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?yi:g[1]==="?"?wi:g[1]==="@"?xi:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(As.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Zn?Zn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],sn()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],sn())}}}else if(i.nodeType===8)if(i.data===Ms)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=an(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var vi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let u;l.type===2?u=new un(o,o.nextSibling,this,e):l.type===1?u=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(u=new ki(o,this,e)),this._$AV.push(u),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),an(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Sd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&an(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ln.createElement(Es(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new vi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Ss.get(e.strings);return t===void 0&&Ss.set(e.strings,t=new ln(e)),t}k(e){$i(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(sn()),this.O(sn()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=bs(e).nextSibling;bs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),xs=/'/g,ks=/"/g,As=/^(?:script|style|textarea|title)$/i,Mi=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Mi(1),ne=Mi(2),fg=Mi(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ss=new WeakMap,dt=ht.createTreeWalker(ht,129);function Es(n,e){if(!$i(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return vs!==void 0?vs.createHTML(e):e}var $d=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=on;for(let a=0;a<t;a++){let l=n[a],u,c,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,c=s.exec(l),c!==null);)m=s.lastIndex,s===on?c[1]==="!--"?s=ys:c[1]!==void 0?s=ws:c[2]!==void 0?(As.test(c[2])&&(i=RegExp("</"+c[2],"g")),s=ct):c[3]!==void 0&&(s=ct):s===ct?c[0]===">"?(s=i??on,h=-1):c[1]===void 0?h=-2:(h=s.lastIndex-c[2].length,u=c[1],s=c[3]===void 0?ct:c[3]==='"'?ks:xs):s===ks||s===xs?s=ct:s===ys||s===ws?s=on:(s=ct,i=void 0);let d=s===ct&&n[a+1].startsWith("/>")?" ":"";o+=s===on?l+kd:h>=0?(r.push(u),l.slice(0,h)+$s+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Es(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ln=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[u,c]=$d(e,t);if(this.el=n.createElement(u,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith($s)){let m=c[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?yi:g[1]==="?"?wi:g[1]==="@"?xi:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(As.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Zn?Zn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],sn()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],sn())}}}else if(i.nodeType===8)if(i.data===Ms)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=an(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var vi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let u;l.type===2?u=new un(o,o.nextSibling,this,e):l.type===1?u=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(u=new ki(o,this,e)),this._$AV.push(u),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),an(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Sd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&an(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ln.createElement(Es(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new vi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Ss.get(e.strings);return t===void 0&&Ss.set(e.strings,t=new ln(e)),t}k(e){$i(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(sn()),this.O(sn()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=bs(e).nextSibling;bs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
|
||||||
|
|
||||||
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
|
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
|
||||||
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p
Line truncated
|
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p
Line truncated
|
||||||
|
|
||||||
A plugin runs with the same rights as NextFloor in your browser. The file has been reviewed and its content is fixed:
|
A plugin runs with the same rights as NextFloor in your browser. The file has been reviewed and its content is fixed:
|
||||||
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side"
Line truncated
|
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side"
Line truncated
|
||||||
:host {
|
:host {
|
||||||
--nf-text: var(--primary-text-color, #e1e1e1);
|
--nf-text: var(--primary-text-color, #e1e1e1);
|
||||||
--nf-muted: var(--secondary-text-color, #9b9b9b);
|
--nf-muted: var(--secondary-text-color, #9b9b9b);
|
||||||
@@ -1616,7 +1616,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
.qm-note {
|
.qm-note {
|
||||||
color: var(--nf-muted);
|
color: var(--nf-muted);
|
||||||
}
|
}
|
||||||
`]};function jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",Jo);var qf=new URL(import.meta.url),Zf=new URL("./nextfloor-3d.js?v=0f70d07bff6e",qf).href,Dc;function Hc(){return Dc??=import(Zf),Dc}function Pc(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ic="weather.nextfloor_symcon",Nc={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Cc=new WeakMap;function Yf(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Cc.get(n)??new WeakMap;Cc.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ei(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=Yf(De(s("condition"))),u=e.rain_sensor?n.states[e.rain_sensor]:void 0,c=le(u);c!==null&&e.rain_sensor_inverted&&(c=!c),c===null&&typeof o.precipitation=="number"&&(c=o.precipitation>0),le(s("lightning"))?l=c?"lightning-rainy":"lightning":le(s("snow"))?l=c?"snowy-rainy":"snowy":le(s("fog"))?l="fog":c===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":c===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&c===!1&&(l="sunny");let h={entity_id:Ic,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ic]:h}};return r.set(e,m),m}var es=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${Mn[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Il(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(u=>u.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${Mn[a]} ${Ie[a]}</span><div class="values">${l.map(u=>this.value(u))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
|
`]};function jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",Jo);var qf=new URL(import.meta.url),Zf=new URL("./nextfloor-3d.js?v=3c3ea11cac21",qf).href,Dc;function Hc(){return Dc??=import(Zf),Dc}function Pc(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ic="weather.nextfloor_symcon",Nc={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Cc=new WeakMap;function Yf(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Cc.get(n)??new WeakMap;Cc.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ei(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=Yf(De(s("condition"))),u=e.rain_sensor?n.states[e.rain_sensor]:void 0,c=le(u);c!==null&&e.rain_sensor_inverted&&(c=!c),c===null&&typeof o.precipitation=="number"&&(c=o.precipitation>0),le(s("lightning"))?l=c?"lightning-rainy":"lightning":le(s("snow"))?l=c?"snowy-rainy":"snowy":le(s("fog"))?l="fog":c===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":c===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&c===!1&&(l="sunny");let h={entity_id:Ic,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ic]:h}};return r.set(e,m),m}var es=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${Mn[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Il(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(u=>u.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${Mn[a]} ${Ie[a]}</span><div class="values">${l.map(u=>this.value(u))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
|
||||||
<button class="heading" aria-expanded=${!o} @click=${()=>{this.folded=!o}}><span>${t?"Bereiche":"Stockwerke"}<small>${t?.name||"Gesamtgeb\xE4ude"}</small></span><span aria-hidden="true">${o?"+":"\u2212"}</span></button>
|
<button class="heading" aria-expanded=${!o} @click=${()=>{this.folded=!o}}><span>${t?"Bereiche":"Stockwerke"}<small>${t?.name||"Gesamtgeb\xE4ude"}</small></span><span aria-hidden="true">${o?"+":"\u2212"}</span></button>
|
||||||
${o?f:p`<div class="entries"><div class="columns"><span></span><span title="Leistung bzw. Durchfluss">Leistung</span><span>Energie / Verbrauch</span></div>
|
${o?f:p`<div class="entries"><div class="columns"><span></span><span title="Leistung bzw. Durchfluss">Leistung</span><span>Energie / Verbrauch</span></div>
|
||||||
${i.map(s=>p`<section class="entry" data-area=${t?s.id:f}>
|
${i.map(s=>p`<section class="entry" data-area=${t?s.id:f}>
|
||||||
@@ -3449,7 +3449,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
inset: auto 16px 16px;
|
inset: auto 16px 16px;
|
||||||
color: var(--nf-danger);
|
color: var(--nf-danger);
|
||||||
}
|
}
|
||||||
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",rs);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function ns(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function tg(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Gc;function Uc(){let n=new URL("./nextfloor-editor.js?v=68203eb051b7",new URL(import.meta.url)).href;return Gc??=import(n),Gc}var ng=.25,jc=n=>Math.round(n*1e3)/1e3,qc=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function os(n,e,t,r,i){let o=qc(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function rg(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ce(ee(o,t),r))<.02&&Math.abs(ce(ee(a,t),r))<.02}))}var is=(n,e)=>Math.abs((n-e+540)%360-180);function Zc(n,e,t,r=ng){let i=qc(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,u)=>{let c=o[(u+1)%o.length],h=qe(ee(c,l));if(h<.3)return;let m=[(c[0]-l[0])/h,(c[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ce(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=rg(n,i,l,d)?t/2:0,b=ce(ee([e.x,e.z],l),d)-_,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,R)=>is(e.rotation,R.rotation)<is(e.rotation,z.rotation)?R:z);if(is(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:jc(e.x-d[0]*M),z:jc(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function ci(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function Yc(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function Jc(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function Qc(n,e,t,r){return di(n,e,(i,o)=>{[i.x,i.z]=os(o,i.x,i.z,t,r)})}function Xc(n,e,t,r){let i=n.settings.wall_interior??.12;return ci(n,e,(o,s)=>{[o.x,o.z]=os(s,o.x,o.z,t,r);let a=Zc(s,o,i);a&&Object.assign(o,a)})}var ss=(n,e)=>((n+e)%360+360)%360,ed=n=>Number.parseFloat(n.replace(",",".")),Kn=(n,e)=>Math.round(n*10**e)/10**e;function as(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=ed(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
|
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",rs);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function ns(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function tg(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Gc;function Uc(){let n=new URL("./nextfloor-editor.js?v=1a84ce4ff399",new URL(import.meta.url)).href;return Gc??=import(n),Gc}var ng=.25,jc=n=>Math.round(n*1e3)/1e3,qc=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function os(n,e,t,r,i){let o=qc(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function rg(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ce(ee(o,t),r))<.02&&Math.abs(ce(ee(a,t),r))<.02}))}var is=(n,e)=>Math.abs((n-e+540)%360-180);function Zc(n,e,t,r=ng){let i=qc(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,u)=>{let c=o[(u+1)%o.length],h=qe(ee(c,l));if(h<.3)return;let m=[(c[0]-l[0])/h,(c[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ce(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=rg(n,i,l,d)?t/2:0,b=ce(ee([e.x,e.z],l),d)-_,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,R)=>is(e.rotation,R.rotation)<is(e.rotation,z.rotation)?R:z);if(is(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:jc(e.x-d[0]*M),z:jc(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function ci(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function Yc(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function Jc(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function Qc(n,e,t,r){return di(n,e,(i,o)=>{[i.x,i.z]=os(o,i.x,i.z,t,r)})}function Xc(n,e,t,r){let i=n.settings.wall_interior??.12;return ci(n,e,(o,s)=>{[o.x,o.z]=os(s,o.x,o.z,t,r);let a=Zc(s,o,i);a&&Object.assign(o,a)})}var ss=(n,e)=>((n+e)%360+360)%360,ed=n=>Number.parseFloat(n.replace(",",".")),Kn=(n,e)=>Math.round(n*10**e)/10**e;function as(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=ed(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
|
||||||
>${n.label}
|
>${n.label}
|
||||||
<input type="number" inputmode="decimal" step=${n.step} min=${e} max=${t??f} .value=${String(Kn(n.value,2))} @change=${i} />
|
<input type="number" inputmode="decimal" step=${n.step} min=${e} max=${t??f} .value=${String(Kn(n.value,2))} @change=${i} />
|
||||||
</label>`}var nd=(n,e)=>p`<button class="nf-chip" @click=${e}>${n.t("height_auto")}</button>`,td=(n,e)=>p`<button class="nf-chip" @click=${()=>e(-n)}>↺ ${n}°</button><button class="nf-chip" @click=${()=>e(n)}>↻ ${n}°</button>`;function ig(n,e){let t=n.building.floors.find(s=>s.furniture.some(a=>a.id===e)),r=t?.furniture.find(s=>s.id===e);if(!t||!r)return f;let i=(s,a)=>as({label:n.t(a),title:n.t(`size_${s}`),value:r[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>n.editFurniture(e,u=>u[s]=Kn(l,3))}),o=aa(r)?p`${as({label:"\u2195",title:n.t("mount_height"),value:r.mount_y??oe(t,r),step:.05,min:0,accepts:s=>s>=0,apply:s=>n.editFurniture(e,a=>a.mount_y=Kn(s,3))})}
|
</label>`}var nd=(n,e)=>p`<button class="nf-chip" @click=${e}>${n.t("height_auto")}</button>`,td=(n,e)=>p`<button class="nf-chip" @click=${()=>e(-n)}>↺ ${n}°</button><button class="nf-chip" @click=${()=>e(n)}>↻ ${n}°</button>`;function ig(n,e){let t=n.building.floors.find(s=>s.furniture.some(a=>a.id===e)),r=t?.furniture.find(s=>s.id===e);if(!t||!r)return f;let i=(s,a)=>as({label:n.t(a),title:n.t(`size_${s}`),value:r[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>n.editFurniture(e,u=>u[s]=Kn(l,3))}),o=aa(r)?p`${as({label:"\u2195",title:n.t("mount_height"),value:r.mount_y??oe(t,r),step:.05,min:0,accepts:s=>s>=0,apply:s=>n.editFurniture(e,a=>a.mount_y=Kn(s,3))})}
|
||||||
|
|||||||
@@ -666,6 +666,13 @@ OUTDOOR_SCHEMA = vol.Schema(
|
|||||||
vol.Optional("slope_dir", default="x"): vol.In(["x", "-x", "z", "-z"]),
|
vol.Optional("slope_dir", default="x"): vol.In(["x", "-x", "z", "-z"]),
|
||||||
# how opaque the area is drawn (None = fully)
|
# how opaque the area is drawn (None = fully)
|
||||||
vol.Optional("opacity", default=None): vol.Any(None, vol.All(vol.Coerce(float), vol.Range(min=0.1, max=1))),
|
vol.Optional("opacity", default=None): vol.Any(None, vol.All(vol.Coerce(float), vol.Range(min=0.1, max=1))),
|
||||||
|
# per-area pattern size and rotation; None keeps legacy appearance
|
||||||
|
vol.Optional("texture_scale", default=None): vol.Any(
|
||||||
|
None, vol.All(vol.Coerce(float), vol.Range(min=0.05, max=20))
|
||||||
|
),
|
||||||
|
vol.Optional("texture_rotation", default=None): vol.Any(
|
||||||
|
None, vol.All(vol.Coerce(float), vol.Range(min=-360, max=360))
|
||||||
|
),
|
||||||
# fences and pergolas: the closing edge is left out; pergola: X-bracing on the sides
|
# fences and pergolas: the closing edge is left out; pergola: X-bracing on the sides
|
||||||
vol.Optional("open", default=False): bool,
|
vol.Optional("open", default=False): bool,
|
||||||
vol.Optional("bracing", default=False): bool,
|
vol.Optional("bracing", default=False): bool,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { html, nothing, type TemplateResult } from "lit";
|
import { html, nothing, type TemplateResult } from "lit";
|
||||||
import { formatNumber, type I18nKey } from "../../../i18n.ts";
|
import { formatNumber, type I18nKey } from "../../../i18n.ts";
|
||||||
import { bounds, cutsOut, isAxisRect, uid, type FenceGate, type FreeWall, OUTDOOR_TOP, OUTDOOR_TYPES, outdoorStanding, SLOPE_DIRS, type Direction, type OutdoorArea, type OutdoorType, type SlopeDir, type Vec2 } from "../../../model.ts";
|
import { bounds, cutsOut, isAxisRect, uid, type FenceGate, type FreeWall, OUTDOOR_TOP, OUTDOOR_TYPES, outdoorStanding, outdoorTextureSettings, SLOPE_DIRS, type Direction, type OutdoorArea, type OutdoorType, type SlopeDir, type Vec2 } from "../../../model.ts";
|
||||||
import { checkField, entityField, hint, numberField, selectField, toThousandths } from "../fields.ts";
|
import { checkField, entityField, hint, numberField, selectField, toThousandths } from "../fields.ts";
|
||||||
import { entityOptions } from "../entities.ts";
|
import { entityOptions } from "../entities.ts";
|
||||||
import type { EditorHost } from "../host.ts";
|
import type { EditorHost } from "../host.ts";
|
||||||
@@ -24,12 +24,22 @@ export function renderOutdoorForm(host: EditorHost, area: OutdoorArea, actions:
|
|||||||
const t = host.t;
|
const t = host.t;
|
||||||
const set = (patch: Partial<OutdoorArea>) => actions.update(patch);
|
const set = (patch: Partial<OutdoorArea>) => actions.update(patch);
|
||||||
const box = bounds(area.points);
|
const box = bounds(area.points);
|
||||||
|
const texture = outdoorTextureSettings(area);
|
||||||
const types = OUTDOOR_TYPES.map((type): [OutdoorType, string] => [type, t(`out_${type}` as I18nKey)]);
|
const types = OUTDOOR_TYPES.map((type): [OutdoorType, string] => [type, t(`out_${type}` as I18nKey)]);
|
||||||
const slopeDirs = SLOPE_DIRS.map((d): [SlopeDir, string] => [d, t(`slope_${d.replace("-", "n")}` as I18nKey)]);
|
const slopeDirs = SLOPE_DIRS.map((d): [SlopeDir, string] => [d, t(`slope_${d.replace("-", "n")}` as I18nKey)]);
|
||||||
return html`<section>
|
return html`<section>
|
||||||
<div class="nf-h3row"><h3>${t("outdoor")}</h3>${actions.lockButton}</div>
|
<div class="nf-h3row"><h3>${t("outdoor")}</h3>${actions.lockButton}</div>
|
||||||
<div class="nf-form">
|
<div class="nf-form">
|
||||||
${selectField(host, t("outdoor_type"), area.type, types, (type) => set({ type }), { wide: true })}
|
${selectField(host, t("outdoor_type"), area.type, types, (type) => set({ type }), { wide: true })}
|
||||||
|
${numberField(host, t("outdoor_texture_scale"), texture.scale * 100, (v) => {
|
||||||
|
const { scale } = outdoorTextureSettings({ texture_scale: v / 100 });
|
||||||
|
set({ texture_scale: scale === 1 ? null : scale });
|
||||||
|
}, 5, 5)}
|
||||||
|
${numberField(host, t("outdoor_texture_rotation"), texture.rotation, (v) => {
|
||||||
|
const { rotation } = outdoorTextureSettings({ texture_rotation: v });
|
||||||
|
set({ texture_rotation: rotation || null });
|
||||||
|
}, 5)}
|
||||||
|
${hint(t("outdoor_texture_hint"))}
|
||||||
${selectField(host, t("area"), area.area_id ?? "", [["", t("no_area")], ...Object.values(host.hass?.areas ?? {}).sort((a, b) => a.name.localeCompare(b.name)).map((a): [string, string] => [a.area_id, a.name])], (id) => set({ area_id: id || null }), { wide: true, title: t("outdoor_area_hint") })}
|
${selectField(host, t("area"), area.area_id ?? "", [["", t("no_area")], ...Object.values(host.hass?.areas ?? {}).sort((a, b) => a.name.localeCompare(b.name)).map((a): [string, string] => [a.area_id, a.name])], (id) => set({ area_id: id || null }), { wide: true, title: t("outdoor_area_hint") })}
|
||||||
${area.type === "pool" || area.type === "wild" || area.type === "bed"
|
${area.type === "pool" || area.type === "wild" || area.type === "bed"
|
||||||
? html`${entityField(host, t("pool_temp"), area.temp_entity ?? null, undefined, entityOptions(host.hass, (id) => id.startsWith("sensor.") && host.hass?.states[id]?.attributes.device_class === "temperature"), (v) => set({ temp_entity: v && v !== "none" ? v : null }))}
|
? html`${entityField(host, t("pool_temp"), area.temp_entity ?? null, undefined, entityOptions(host.hass, (id) => id.startsWith("sensor.") && host.hass?.states[id]?.attributes.device_class === "temperature"), (v) => set({ temp_entity: v && v !== "none" ? v : null }))}
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ test("a floor opening is the drawn rectangle, and an outdoor area its outline; c
|
|||||||
assert.equal(area.type, "lawn");
|
assert.equal(area.type, "lawn");
|
||||||
assert.equal(area.points[2][1], 1.235);
|
assert.equal(area.points[2][1], 1.235);
|
||||||
assert.deepEqual(copyOfOutdoorArea(area).points[0], [0.5, 0.5]);
|
assert.deepEqual(copyOfOutdoorArea(area).points[0], [0.5, 0.5]);
|
||||||
|
const textured = { ...area, texture_scale: 2.5, texture_rotation: 45 };
|
||||||
|
const copy = copyOfOutdoorArea(textured);
|
||||||
|
assert.equal(copy.texture_scale, 2.5);
|
||||||
|
assert.equal(copy.texture_rotation, 45);
|
||||||
|
assert.notEqual(copy.id, textured.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("new furniture has its type's size, and stairs reach to the floor above", () => {
|
test("new furniture has its type's size, and stairs reach to the floor above", () => {
|
||||||
|
|||||||
@@ -1134,6 +1134,9 @@ const DE = {
|
|||||||
out_path: "Weg",
|
out_path: "Weg",
|
||||||
out_driveway: "Einfahrt",
|
out_driveway: "Einfahrt",
|
||||||
out_street: "Straße",
|
out_street: "Straße",
|
||||||
|
outdoor_texture_scale: "Texturmaßstab (%)",
|
||||||
|
outdoor_texture_rotation: "Texturdrehung (°)",
|
||||||
|
outdoor_texture_hint: "100 % ist die Originalgröße. 200 % macht das Muster doppelt so groß, 50 % halb so groß (5–2000 %). Die Drehung verändert nur die Textur dieser Fläche. Standard: 100 % und 0°.",
|
||||||
out_sidewalk: "Gehweg",
|
out_sidewalk: "Gehweg",
|
||||||
out_gravel: "Schotterfläche",
|
out_gravel: "Schotterfläche",
|
||||||
out_river: "Fluss",
|
out_river: "Fluss",
|
||||||
@@ -3204,6 +3207,9 @@ const EN: Record<Key, string> = {
|
|||||||
out_path: "Path",
|
out_path: "Path",
|
||||||
out_driveway: "Driveway",
|
out_driveway: "Driveway",
|
||||||
out_street: "Street",
|
out_street: "Street",
|
||||||
|
outdoor_texture_scale: "Texture scale (%)",
|
||||||
|
outdoor_texture_rotation: "Texture rotation (°)",
|
||||||
|
outdoor_texture_hint: "100% is the original size. 200% doubles the pattern size, 50% halves it (5–2000%). Rotation changes only this area's texture. Defaults: 100% and 0°.",
|
||||||
out_sidewalk: "Sidewalk",
|
out_sidewalk: "Sidewalk",
|
||||||
out_gravel: "Gravel",
|
out_gravel: "Gravel",
|
||||||
out_river: "River",
|
out_river: "River",
|
||||||
|
|||||||
@@ -1024,6 +1024,10 @@ export interface OutdoorArea {
|
|||||||
gates?: FenceGate[];
|
gates?: FenceGate[];
|
||||||
/** How opaque the area is drawn, 0.1 … 1 (null = fully): a driveway above a cellar can be seen through. The outline stays. */
|
/** How opaque the area is drawn, 0.1 … 1 (null = fully): a driveway above a cellar can be seen through. The outline stays. */
|
||||||
opacity?: number | null;
|
opacity?: number | null;
|
||||||
|
/** Size of the outdoor texture pattern (1 = original, 2 = twice as large). */
|
||||||
|
texture_scale?: number | null;
|
||||||
|
/** Clockwise texture rotation in degrees; independent of the outline. */
|
||||||
|
texture_rotation?: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A gate in a fence: a gap in one edge of its outline with a garden gate (one leaf), a double gate or a sliding gate. */
|
/** A gate in a fence: a gap in one edge of its outline with a garden gate (one leaf), a double gate or a sliding gate. */
|
||||||
@@ -1044,6 +1048,13 @@ export interface FenceGate {
|
|||||||
/** Whether an area leaves a hole in the areas around it: water areas default to on. */
|
/** Whether an area leaves a hole in the areas around it: water areas default to on. */
|
||||||
export const cutsOut = (a: OutdoorArea): boolean => a.cut ?? (a.type === "pool" || a.type === "river" || a.type === "stream");
|
export const cutsOut = (a: OutdoorArea): boolean => a.cut ?? (a.type === "pool" || a.type === "river" || a.type === "stream");
|
||||||
|
|
||||||
|
/** Valid texture settings for old plans and imported data as well as editor inputs. */
|
||||||
|
export function outdoorTextureSettings(a: Pick<OutdoorArea, "texture_scale" | "texture_rotation">): { scale: number; rotation: number } {
|
||||||
|
const scale = Number.isFinite(a.texture_scale) ? Math.max(0.05, Math.min(20, a.texture_scale!)) : 1;
|
||||||
|
const rotation = Number.isFinite(a.texture_rotation) ? ((a.texture_rotation! % 360) + 360) % 360 : 0;
|
||||||
|
return { scale, rotation };
|
||||||
|
}
|
||||||
|
|
||||||
/** Energy flow: meter position and power sensors (W). Grid positive = import, battery positive = discharging. */
|
/** Energy flow: meter position and power sensors (W). Grid positive = import, battery positive = discharging. */
|
||||||
export interface EnergySettings {
|
export interface EnergySettings {
|
||||||
meter: { floor_id: string; x: number; z: number } | null;
|
meter: { floor_id: string; x: number; z: number } | null;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export function flipWinding(buf: GeoBuffer, from: number): void {
|
|||||||
swapped(buf.uv, tri * 6, 2);
|
swapped(buf.uv, tri * 6, 2);
|
||||||
swapped(buf.tile, tri * 6, 2);
|
swapped(buf.tile, tri * 6, 2);
|
||||||
swapped(buf.surface, tri * 3, 1);
|
swapped(buf.surface, tri * 3, 1);
|
||||||
|
swapped(buf.surfaceTransform, tri * 6, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ export class GeoBuffer {
|
|||||||
tile: number[] | null;
|
tile: number[] | null;
|
||||||
/** Outdoor material IDs, allocated only for buffers that contain outdoor geometry. */
|
/** Outdoor material IDs, allocated only for buffers that contain outdoor geometry. */
|
||||||
surface: number[] | null = null;
|
surface: number[] | null = null;
|
||||||
|
/** Outdoor texture scale and rotation (radians), two numbers per vertex. */
|
||||||
|
surfaceTransform: number[] | null = null;
|
||||||
|
|
||||||
constructor(uvs = false, tiles = false) {
|
constructor(uvs = false, tiles = false) {
|
||||||
this.uv = uvs ? [] : null;
|
this.uv = uvs ? [] : null;
|
||||||
@@ -42,6 +44,7 @@ export class GeoBuffer {
|
|||||||
this.uv?.push(...(uv ?? [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]));
|
this.uv?.push(...(uv ?? [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]));
|
||||||
this.tile?.push(...tile, ...tile, ...tile);
|
this.tile?.push(...tile, ...tile, ...tile);
|
||||||
this.surface?.push(0, 0, 0);
|
this.surface?.push(0, 0, 0);
|
||||||
|
this.surfaceTransform?.push(1, 0, 1, 0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The number of triangles. */
|
/** The number of triangles. */
|
||||||
@@ -57,6 +60,7 @@ export class GeoBuffer {
|
|||||||
if (this.uv) geometry.setAttribute("uv", attribute(this.uv, 2));
|
if (this.uv) geometry.setAttribute("uv", attribute(this.uv, 2));
|
||||||
if (this.tile) geometry.setAttribute("tile", attribute(this.tile, 2));
|
if (this.tile) geometry.setAttribute("tile", attribute(this.tile, 2));
|
||||||
if (this.surface) geometry.setAttribute("surface", attribute(this.surface, 1));
|
if (this.surface) geometry.setAttribute("surface", attribute(this.surface, 1));
|
||||||
|
if (this.surfaceTransform) geometry.setAttribute("surfaceTransform", attribute(this.surfaceTransform, 2));
|
||||||
geometry.computeBoundingSphere();
|
geometry.computeBoundingSphere();
|
||||||
return geometry;
|
return geometry;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ interface Vertex {
|
|||||||
uv: number[] | null;
|
uv: number[] | null;
|
||||||
tile: number[] | null;
|
tile: number[] | null;
|
||||||
surface: number;
|
surface: number;
|
||||||
|
surfaceTransform: number[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const blend = (a: number[], b: number[], t: number) => a.map((x, i) => x + (b[i] - x) * t);
|
const blend = (a: number[], b: number[], t: number) => a.map((x, i) => x + (b[i] - x) * t);
|
||||||
@@ -18,7 +19,7 @@ const blend = (a: number[], b: number[], t: number) => a.map((x, i) => x + (b[i]
|
|||||||
/** The point where an edge crosses the height `cut`; colours and uvs are interpolated. */
|
/** The point where an edge crosses the height `cut`; colours and uvs are interpolated. */
|
||||||
function crossing(a: Vertex, b: Vertex, cut: number): Vertex {
|
function crossing(a: Vertex, b: Vertex, cut: number): Vertex {
|
||||||
const t = (cut - a.p[1]) / (b.p[1] - a.p[1]);
|
const t = (cut - a.p[1]) / (b.p[1] - a.p[1]);
|
||||||
return { p: blend(a.p, b.p, t), c: blend(a.c, b.c, t), uv: a.uv && b.uv ? blend(a.uv, b.uv, t) : null, tile: a.tile, surface: a.surface };
|
return { p: blend(a.p, b.p, t), c: blend(a.c, b.c, t), uv: a.uv && b.uv ? blend(a.uv, b.uv, t) : null, tile: a.tile, surface: a.surface, surfaceTransform: a.surfaceTransform };
|
||||||
}
|
}
|
||||||
|
|
||||||
function readVertex(buf: GeoBuffer, v: number): Vertex {
|
function readVertex(buf: GeoBuffer, v: number): Vertex {
|
||||||
@@ -28,6 +29,7 @@ function readVertex(buf: GeoBuffer, v: number): Vertex {
|
|||||||
uv: buf.uv ? buf.uv.slice(v * 2, v * 2 + 2) : null,
|
uv: buf.uv ? buf.uv.slice(v * 2, v * 2 + 2) : null,
|
||||||
tile: buf.tile ? buf.tile.slice(v * 2, v * 2 + 2) : null,
|
tile: buf.tile ? buf.tile.slice(v * 2, v * 2 + 2) : null,
|
||||||
surface: buf.surface?.[v] ?? 0,
|
surface: buf.surface?.[v] ?? 0,
|
||||||
|
surfaceTransform: buf.surfaceTransform?.slice(v * 2, v * 2 + 2) ?? null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +42,7 @@ function overwriteTriangle(buf: GeoBuffer, tri: number, corners: Vertex[], fold:
|
|||||||
if (buf.tile && corner.tile) corner.tile.forEach((x, i) => (buf.tile![v * 2 + i] = x));
|
if (buf.tile && corner.tile) corner.tile.forEach((x, i) => (buf.tile![v * 2 + i] = x));
|
||||||
buf.f[v] = fold;
|
buf.f[v] = fold;
|
||||||
if (buf.surface) buf.surface[v] = corner.surface;
|
if (buf.surface) buf.surface[v] = corner.surface;
|
||||||
|
if (buf.surfaceTransform && corner.surfaceTransform) corner.surfaceTransform.forEach((x, i) => (buf.surfaceTransform![v * 2 + i] = x));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,6 +54,7 @@ function appendTriangle(buf: GeoBuffer, corners: Vertex[], fold: number): void {
|
|||||||
buf.uv?.push(...(corner.uv ?? [0.5, 0.5]));
|
buf.uv?.push(...(corner.uv ?? [0.5, 0.5]));
|
||||||
buf.tile?.push(...(corner.tile ?? [0, 1]));
|
buf.tile?.push(...(corner.tile ?? [0, 1]));
|
||||||
buf.surface?.push(corner.surface);
|
buf.surface?.push(corner.surface);
|
||||||
|
buf.surfaceTransform?.push(...(corner.surfaceTransform ?? [1, 0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,16 +82,23 @@ test("cutAbove keeps colours and uvs along the new edge", () => {
|
|||||||
test("cutting geometry retains outdoor surface IDs and appending furniture uses a neutral material", () => {
|
test("cutting geometry retains outdoor surface IDs and appending furniture uses a neutral material", () => {
|
||||||
const buf = new GeoBuffer();
|
const buf = new GeoBuffer();
|
||||||
buf.surface = [];
|
buf.surface = [];
|
||||||
|
buf.surfaceTransform = [];
|
||||||
buf.tri([0, 0, 0], [1, 2, 0], [0, 0, 1], grey);
|
buf.tri([0, 0, 0], [1, 2, 0], [0, 0, 1], grey);
|
||||||
buf.surface.fill(12);
|
buf.surface.fill(12);
|
||||||
|
buf.surfaceTransform = [2, 0.5, 2, 0.5, 2, 0.5];
|
||||||
cutAbove(buf, 0, 1, FURN_OFFSET);
|
cutAbove(buf, 0, 1, FURN_OFFSET);
|
||||||
assert.equal(buf.surface.length, buf.p.length / 3);
|
assert.equal(buf.surface.length, buf.p.length / 3);
|
||||||
assert.ok(buf.surface.every((id) => id === 12));
|
assert.ok(buf.surface.every((id) => id === 12));
|
||||||
|
assert.equal(buf.surfaceTransform.length, buf.p.length / 3 * 2);
|
||||||
|
assert.ok(buf.surfaceTransform.every((value, i) => value === (i % 2 === 0 ? 2 : 0.5)));
|
||||||
buf.tri([4, 0, 0], [5, 2, 0], [4, 0, 1], grey);
|
buf.tri([4, 0, 0], [5, 2, 0], [4, 0, 1], grey);
|
||||||
assert.deepEqual(buf.surface.slice(-3), [0, 0, 0]);
|
assert.deepEqual(buf.surface.slice(-3), [0, 0, 0]);
|
||||||
|
assert.deepEqual(buf.surfaceTransform.slice(-6), [1, 0, 1, 0, 1, 0]);
|
||||||
cutAbove(buf, buf.count - 1, 1, FURN_OFFSET);
|
cutAbove(buf, buf.count - 1, 1, FURN_OFFSET);
|
||||||
assert.equal(buf.surface.length, buf.p.length / 3);
|
assert.equal(buf.surface.length, buf.p.length / 3);
|
||||||
assert.deepEqual(buf.surface.slice(-6), [0, 0, 0, 0, 0, 0]);
|
assert.deepEqual(buf.surface.slice(-6), [0, 0, 0, 0, 0, 0]);
|
||||||
|
assert.equal(buf.surfaceTransform.length, buf.p.length / 3 * 2);
|
||||||
|
assert.deepEqual(buf.surfaceTransform.slice(-12), [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("cutAbove only touches triangles from the given one on", () => {
|
test("cutAbove only touches triangles from the given one on", () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { test } from "node:test";
|
import { test } from "node:test";
|
||||||
import { newFloor, OUTDOOR_TOP, OUTDOOR_TYPES, type Floor, type OutdoorArea, type Vec2 } from "../../model.ts";
|
import { newFloor, OUTDOOR_TOP, OUTDOOR_TYPES, outdoorTextureSettings, type Floor, type OutdoorArea, type Vec2 } from "../../model.ts";
|
||||||
import { GeoBuffer, LineBuffer } from "../geo.ts";
|
import { GeoBuffer, LineBuffer } from "../geo.ts";
|
||||||
import { counterClockwise, pushBeam, pushPost } from "./beams.ts";
|
import { counterClockwise, pushBeam, pushPost } from "./beams.ts";
|
||||||
import { outdoorHoles, outdoorOpacity, outdoorSurface, pushOutdoor } from "./outdoor.ts";
|
import { outdoorHoles, outdoorOpacity, outdoorSurface, pushOutdoor } from "./outdoor.ts";
|
||||||
@@ -54,10 +54,35 @@ test("every outdoor type has a texture ID; later furniture stays untextured and
|
|||||||
assert.ok(buf.surface!.slice(-30).every((id) => id === 0), "later geometry never inherits the outdoor texture");
|
assert.ok(buf.surface!.slice(-30).every((id) => id === 0), "later geometry never inherits the outdoor texture");
|
||||||
const g = buf.geometry();
|
const g = buf.geometry();
|
||||||
assert.equal(g.getAttribute("surface").count, g.getAttribute("position").count);
|
assert.equal(g.getAttribute("surface").count, g.getAttribute("position").count);
|
||||||
|
assert.equal(g.getAttribute("surfaceTransform").count, g.getAttribute("position").count);
|
||||||
g.dispose();
|
g.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("texture settings default old plans, bound pattern size and wrap rotations", () => {
|
||||||
|
assert.deepEqual(outdoorTextureSettings({}), { scale: 1, rotation: 0 });
|
||||||
|
assert.deepEqual(outdoorTextureSettings({ texture_scale: null, texture_rotation: null }), { scale: 1, rotation: 0 });
|
||||||
|
assert.deepEqual(outdoorTextureSettings({ texture_scale: 2.5, texture_rotation: -90 }), { scale: 2.5, rotation: 270 });
|
||||||
|
assert.deepEqual(outdoorTextureSettings({ texture_scale: 0, texture_rotation: 720 }), { scale: 0.05, rotation: 0 });
|
||||||
|
assert.equal(outdoorTextureSettings({ texture_scale: 100 }).scale, 20);
|
||||||
|
assert.deepEqual(outdoorTextureSettings({ texture_scale: NaN, texture_rotation: Infinity }), { scale: 1, rotation: 0 });
|
||||||
|
});
|
||||||
|
|
||||||
|
test("scale and rotation stay per area, preserve geometry and reach transparent sloped surfaces", () => {
|
||||||
|
const plain = area("terrace", square(0, 0, 4, 3));
|
||||||
|
const changed = { ...plain, texture_scale: 2.5, texture_rotation: 45 };
|
||||||
|
assert.deepEqual(build(plain).buf.p, build(changed).buf.p, "the outline and all mesh coordinates stay unchanged");
|
||||||
|
const solid = new GeoBuffer(), ghosts = new Map<number, GeoBuffer>();
|
||||||
|
pushOutdoor(solid, new LineBuffer(), floorWith(plain, area("sidewalk", square(5, 0, 9, 3), { texture_scale: 0.5, texture_rotation: 90 }), { ...changed, opacity: 0.4, slope: 0.3 }), ghosts, () => new GeoBuffer());
|
||||||
|
for (let v = 0; v < solid.surface!.length; v++) {
|
||||||
|
const id = solid.surface![v];
|
||||||
|
assert.deepEqual(solid.surfaceTransform!.slice(v * 2, v * 2 + 2), id === OUTDOOR_MATERIAL.terrace ? [1, 0] : [0.5, Math.PI / 2]);
|
||||||
|
}
|
||||||
|
const ghost = ghosts.get(0.4)!;
|
||||||
|
assert.equal(ghost.surfaceTransform!.length, ghost.p.length / 3 * 2);
|
||||||
|
for (let v = 0; v < ghost.p.length / 3; v++) assert.deepEqual(ghost.surfaceTransform!.slice(v * 2, v * 2 + 2), [2.5, Math.PI / 4]);
|
||||||
|
});
|
||||||
|
|
||||||
test("river and stream cut through a surrounding lawn, can be sloped, and preserve transparency", () => {
|
test("river and stream cut through a surrounding lawn, can be sloped, and preserve transparency", () => {
|
||||||
for (const type of ["river", "stream"] as const) {
|
for (const type of ["river", "stream"] as const) {
|
||||||
const water = area(type, square(1, 1, 3, 2), { slope: 0.3, offset: 0.2, opacity: 0.4 });
|
const water = area(type, square(1, 1, 3, 2), { slope: 0.3, offset: 0.2, opacity: 0.4 });
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// patches cut out of it.
|
// patches cut out of it.
|
||||||
|
|
||||||
import { Color } from "three";
|
import { Color } from "three";
|
||||||
import { bounds, cutsOut, groundLevel, isAxisRect, OUTDOOR_TOP, outdoorDrop, outdoorStanding, pointInPolygon, type Floor, type OutdoorArea, type Vec2 } from "../../model.ts";
|
import { bounds, cutsOut, groundLevel, isAxisRect, OUTDOOR_TOP, outdoorDrop, outdoorStanding, outdoorTextureSettings, pointInPolygon, type Floor, type OutdoorArea, type Vec2 } from "../../model.ts";
|
||||||
import { ALWAYS, pushPrism, shade, triangulate, type GeoBuffer, type LineBuffer } from "../geo.ts";
|
import { ALWAYS, pushPrism, shade, triangulate, type GeoBuffer, type LineBuffer } from "../geo.ts";
|
||||||
import { counterClockwise, pushBeam, pushPost } from "./beams.ts";
|
import { counterClockwise, pushBeam, pushPost } from "./beams.ts";
|
||||||
import { gateLayout, gatesOnEdge } from "./gates.ts";
|
import { gateLayout, gatesOnEdge } from "./gates.ts";
|
||||||
@@ -194,6 +194,7 @@ export function outdoorOpacity(area: OutdoorArea): number {
|
|||||||
export function pushOutdoor(buf: GeoBuffer, lines: LineBuffer, floor: Floor, ghosts?: Map<number, GeoBuffer>, makeBuffer?: () => GeoBuffer): void {
|
export function pushOutdoor(buf: GeoBuffer, lines: LineBuffer, floor: Floor, ghosts?: Map<number, GeoBuffer>, makeBuffer?: () => GeoBuffer): void {
|
||||||
// The shared wall shader also serves floors without outdoor areas: supply a neutral ID there.
|
// The shared wall shader also serves floors without outdoor areas: supply a neutral ID there.
|
||||||
buf.surface ??= Array(buf.p.length / 3).fill(0);
|
buf.surface ??= Array(buf.p.length / 3).fill(0);
|
||||||
|
buf.surfaceTransform ??= Array.from({ length: (buf.p.length / 3) * 2 }, (_, i) => i % 2 === 0 ? 1 : 0);
|
||||||
const ground = groundLevel(floor);
|
const ground = groundLevel(floor);
|
||||||
const areas = floor.outdoor ?? [];
|
const areas = floor.outdoor ?? [];
|
||||||
areas.forEach((area, index) => {
|
areas.forEach((area, index) => {
|
||||||
@@ -209,6 +210,7 @@ export function pushOutdoor(buf: GeoBuffer, lines: LineBuffer, floor: Floor, gho
|
|||||||
target = ghosts.get(opacity)!;
|
target = ghosts.get(opacity)!;
|
||||||
}
|
}
|
||||||
target.surface ??= Array(target.p.length / 3).fill(0);
|
target.surface ??= Array(target.p.length / 3).fill(0);
|
||||||
|
target.surfaceTransform ??= Array.from({ length: (target.p.length / 3) * 2 }, (_, i) => i % 2 === 0 ? 1 : 0);
|
||||||
const firstVertex = target.p.length / 3;
|
const firstVertex = target.p.length / 3;
|
||||||
const context: Context = {
|
const context: Context = {
|
||||||
buf: target,
|
buf: target,
|
||||||
@@ -229,5 +231,10 @@ export function pushOutdoor(buf: GeoBuffer, lines: LineBuffer, floor: Floor, gho
|
|||||||
else if (area.type === "pergola") buildPergola(context);
|
else if (area.type === "pergola") buildPergola(context);
|
||||||
else buildBlock(context, areas, index);
|
else buildBlock(context, areas, index);
|
||||||
target.surface.fill(OUTDOOR_MATERIAL[area.type], firstVertex);
|
target.surface.fill(OUTDOOR_MATERIAL[area.type], firstVertex);
|
||||||
|
const texture = outdoorTextureSettings(area);
|
||||||
|
for (let v = firstVertex; v < target.p.length / 3; v++) {
|
||||||
|
target.surfaceTransform[v * 2] = texture.scale;
|
||||||
|
target.surfaceTransform[v * 2 + 1] = texture.rotation * Math.PI / 180;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ export const OUTDOOR_MATERIAL: Record<OutdoorType, number> = {
|
|||||||
const TEXTURE = /* glsl */ `
|
const TEXTURE = /* glsl */ `
|
||||||
varying vec3 vNfGround;
|
varying vec3 vNfGround;
|
||||||
varying float vNfSurface;
|
varying float vNfSurface;
|
||||||
|
varying vec2 vNfSurfaceTransform;
|
||||||
float nfGrain(vec2 p) {
|
float nfGrain(vec2 p) {
|
||||||
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
||||||
}
|
}
|
||||||
@@ -59,6 +60,10 @@ vec3 nfOutdoorTexture(vec3 position, float kind) {
|
|||||||
// Project onto the dominant face, so raised beds, hedge sides and timber have texture too.
|
// Project onto the dominant face, so raised beds, hedge sides and timber have texture too.
|
||||||
vec3 n = abs(cross(dFdx(position), dFdy(position)));
|
vec3 n = abs(cross(dFdx(position), dFdy(position)));
|
||||||
vec2 p = n.y >= max(n.x, n.z) ? position.xz : (n.x > n.z ? position.zy : position.xy);
|
vec2 p = n.y >= max(n.x, n.z) ? position.xz : (n.x > n.z ? position.zy : position.xy);
|
||||||
|
// Sample with the inverse transform: increasing scale enlarges the visible pattern.
|
||||||
|
float angle = vNfSurfaceTransform.y;
|
||||||
|
float c = cos(angle), s = sin(angle);
|
||||||
|
p = vec2(c * p.x + s * p.y, -s * p.x + c * p.y) / max(vNfSurfaceTransform.x, 0.05);
|
||||||
float broad = nfNoise(p * 1.7);
|
float broad = nfNoise(p * 1.7);
|
||||||
if (kind < 1.5 || (kind > 6.5 && kind < 8.5)) {
|
if (kind < 1.5 || (kind > 6.5 && kind < 8.5)) {
|
||||||
if (kind > 7.5) return nfPebbles(p * 14.0, true);
|
if (kind > 7.5) return nfPebbles(p * 14.0, true);
|
||||||
@@ -107,8 +112,8 @@ export function outdoorTextured<T extends Material>(material: T): T {
|
|||||||
material.onBeforeCompile = (shader, renderer) => {
|
material.onBeforeCompile = (shader, renderer) => {
|
||||||
previous(shader, renderer);
|
previous(shader, renderer);
|
||||||
shader.vertexShader = shader.vertexShader
|
shader.vertexShader = shader.vertexShader
|
||||||
.replace("#include <common>", "#include <common>\nattribute float surface;\nvarying vec3 vNfGround;\nvarying float vNfSurface;")
|
.replace("#include <common>", "#include <common>\nattribute float surface;\nattribute vec2 surfaceTransform;\nvarying vec3 vNfGround;\nvarying float vNfSurface;\nvarying vec2 vNfSurfaceTransform;")
|
||||||
.replace("#include <begin_vertex>", "#include <begin_vertex>\nvNfGround = position;\nvNfSurface = surface;");
|
.replace("#include <begin_vertex>", "#include <begin_vertex>\nvNfGround = position;\nvNfSurface = surface;\nvNfSurfaceTransform = surfaceTransform;");
|
||||||
shader.fragmentShader = shader.fragmentShader.replace("#include <common>", `#include <common>\n${TEXTURE}`)
|
shader.fragmentShader = shader.fragmentShader.replace("#include <common>", `#include <common>\n${TEXTURE}`)
|
||||||
.replace("#include <opaque_fragment>", `if (vNfSurface > 0.5) {
|
.replace("#include <opaque_fragment>", `if (vNfSurface > 0.5) {
|
||||||
if (uTheme == 2) outgoingLight = nfOutdoorDay(vNfSurface) * (0.7 + dot(outgoingLight, vec3(0.299, 0.587, 0.114)) * 0.4);
|
if (uTheme == 2) outgoingLight = nfOutdoorDay(vNfSurface) * (0.7 + dot(outgoingLight, vec3(0.299, 0.587, 0.114)) * 0.4);
|
||||||
@@ -116,6 +121,6 @@ export function outdoorTextured<T extends Material>(material: T): T {
|
|||||||
}
|
}
|
||||||
#include <opaque_fragment>`);
|
#include <opaque_fragment>`);
|
||||||
};
|
};
|
||||||
material.customProgramCacheKey = () => `${previousKey()}-outdoor-textures-1`;
|
material.customProgramCacheKey = () => `${previousKey()}-outdoor-textures-2`;
|
||||||
return material;
|
return material;
|
||||||
}
|
}
|
||||||
@@ -76,13 +76,33 @@ try {
|
|||||||
}, { type, label, id: drawn.id });
|
}, { type, label, id: drawn.id });
|
||||||
assert.equal(stored, type);
|
assert.equal(stored, type);
|
||||||
}
|
}
|
||||||
|
const textureEdit = await page.evaluate(async (id) => {
|
||||||
|
const e = window.outdoorEditor;
|
||||||
|
const setNumber = async (label, value) => {
|
||||||
|
const field = [...e.shadowRoot.querySelectorAll("label.nf-field")].find((l) => l.textContent.trim().startsWith(label));
|
||||||
|
const input = field?.querySelector("input"); if (!input) throw new Error(`Missing ${label}`);
|
||||||
|
input.value = String(value); input.dispatchEvent(new Event("change", { bubbles: true })); await e.updateComplete;
|
||||||
|
};
|
||||||
|
await setNumber("Texturmaßstab", 250); await setNumber("Texturdrehung", -90);
|
||||||
|
let a = e._doc.floors[0].outdoor.find((a) => a.id === id);
|
||||||
|
const custom = [a.texture_scale, a.texture_rotation];
|
||||||
|
await setNumber("Texturmaßstab", 0); const minimum = e._doc.floors[0].outdoor.find((a) => a.id === id).texture_scale;
|
||||||
|
await setNumber("Texturmaßstab", 100); await setNumber("Texturdrehung", 360);
|
||||||
|
a = e._doc.floors[0].outdoor.find((a) => a.id === id);
|
||||||
|
const reset = [a.texture_scale, a.texture_rotation];
|
||||||
|
await setNumber("Texturmaßstab", 250); await setNumber("Texturdrehung", 45);
|
||||||
|
const doc = JSON.parse(JSON.stringify(e._doc)); e.setDoc(doc); await e.updateComplete;
|
||||||
|
const saved = doc.floors[0].outdoor.find((a) => a.id === id);
|
||||||
|
return { custom, minimum, reset, saved: [saved.texture_scale, saved.texture_rotation], neighbor: doc.floors[0].outdoor.find((a) => a.id === "neighbor").texture_scale ?? null };
|
||||||
|
}, drawn.id);
|
||||||
|
assert.deepEqual(textureEdit, { custom: [2.5, 270], minimum: 0.05, reset: [null, null], saved: [2.5, 45], neighbor: null });
|
||||||
await page.screenshot({ path: join(out, "symcon-outdoor-editor.png") });
|
await page.screenshot({ path: join(out, "symcon-outdoor-editor.png") });
|
||||||
await page.evaluate(async () => {
|
await page.evaluate(async () => {
|
||||||
const p = window.nfPanel, b = structuredClone(window.outdoorEditor._doc), f = b.floors[0];
|
const p = window.nfPanel, b = structuredClone(window.outdoorEditor._doc), f = b.floors[0];
|
||||||
const types = ["lawn", "terrace", "path", "driveway", "street", "sidewalk", "gravel", "river", "stream", "pool", "bed", "wild", "hedge", "fence", "pergola"];
|
const types = ["lawn", "terrace", "path", "driveway", "street", "sidewalk", "gravel", "river", "stream", "pool", "bed", "wild", "hedge", "fence", "pergola"];
|
||||||
f.outdoor = types.map((type, i) => {
|
f.outdoor = types.map((type, i) => {
|
||||||
const x = (i % 5) * 5, z = Math.floor(i / 5) * 4;
|
const x = (i % 5) * 5, z = Math.floor(i / 5) * 4;
|
||||||
return { id: type, type, points: [[x, z], [x + 4, z], [x + 4, z + 3], [x, z + 3]], ...(type === "sidewalk" ? { slope: 0.25 } : {}), ...(type === "stream" ? { opacity: 0.6 } : {}) };
|
return { id: type, type, points: [[x, z], [x + 4, z], [x + 4, z + 3], [x, z + 3]], ...(type === "terrace" ? { texture_scale: 2.5, texture_rotation: 45 } : {}), ...(type === "sidewalk" ? { slope: 0.25, texture_scale: 0.5, texture_rotation: 90 } : {}), ...(type === "stream" ? { opacity: 0.6, texture_scale: 1.5, texture_rotation: 330 } : {}) };
|
||||||
});
|
});
|
||||||
f.rooms = [{ id: "reference", name: "Referenz", points: [[-2, -2], [-1, -2], [-1, -1], [-2, -1]], area_id: null, floor_material: "plain" }];
|
f.rooms = [{ id: "reference", name: "Referenz", points: [[-2, -2], [-1, -2], [-1, -1], [-2, -1]], area_id: null, floor_material: "plain" }];
|
||||||
f.furniture = []; p.data.edit(b); await p.updateComplete;
|
f.furniture = []; p.data.edit(b); await p.updateComplete;
|
||||||
@@ -101,7 +121,7 @@ try {
|
|||||||
await page.evaluate(() => new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done))));
|
await page.evaluate(() => new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done))));
|
||||||
await page.screenshot({ path: join(out, `symcon-outdoor-${theme}.png`) });
|
await page.screenshot({ path: join(out, `symcon-outdoor-${theme}.png`) });
|
||||||
}
|
}
|
||||||
for (const [name, x, z] of [["street", 22, 1.5], ["gravel", 7, 5.5], ["lawn", 2, 1.5]]) {
|
for (const [name, x, z] of [["street", 22, 1.5], ["gravel", 7, 5.5], ["lawn", 2, 1.5], ["terrace", 7, 1.5]]) {
|
||||||
await page.evaluate(({ x, z }) => {
|
await page.evaluate(({ x, z }) => {
|
||||||
const v = window.outdoorView.viewer; v.setTheme("day"); v.showView({ target: { x, y: 0, z }, radius: 5, phi: 0.65, theta: 0.1 }, 0);
|
const v = window.outdoorView.viewer; v.setTheme("day"); v.showView({ target: { x, y: 0, z }, radius: 5, phi: 0.65, theta: 0.1 }, 0);
|
||||||
}, { x, z });
|
}, { x, z });
|
||||||
@@ -111,14 +131,27 @@ try {
|
|||||||
const gpu = await page.evaluate(() => {
|
const gpu = await page.evaluate(() => {
|
||||||
const v = window.outdoorView.viewer;
|
const v = window.outdoorView.viewer;
|
||||||
let textured = 0, neutral = 0;
|
let textured = 0, neutral = 0;
|
||||||
|
const transforms = {};
|
||||||
v.scene.traverse((o) => {
|
v.scene.traverse((o) => {
|
||||||
const ids = o.geometry?.getAttribute("surface");
|
const ids = o.geometry?.getAttribute("surface");
|
||||||
if (ids) { for (const kind of ids.array) kind > 0 ? textured++ : neutral++; }
|
if (ids) {
|
||||||
|
const settings = o.geometry.getAttribute("surfaceTransform");
|
||||||
|
if (!settings || settings.count !== ids.count) throw new Error("Outdoor texture transform buffer mismatch");
|
||||||
|
for (let i = 0; i < ids.count; i++) {
|
||||||
|
const kind = ids.getX(i); kind > 0 ? textured++ : neutral++;
|
||||||
|
if (kind > 0) (transforms[kind] ??= []).push([settings.getX(i), settings.getY(i)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return { textured, neutral, programs: v.renderer.info.programs.map((p) => p.diagnostics?.runnable !== false) };
|
return { textured, neutral, transforms, programs: v.renderer.info.programs.map((p) => p.diagnostics?.runnable !== false) };
|
||||||
});
|
});
|
||||||
|
for (const [id, scale, rotation] of [[2, 2.5, Math.PI / 4], [11, 0.5, Math.PI / 2], [14, 1.5, 330 * Math.PI / 180]]) {
|
||||||
|
assert.ok(gpu.transforms[id]?.length > 0);
|
||||||
|
assert.ok(gpu.transforms[id].every(([s, r]) => s === scale && Math.abs(r - rotation) < 1e-6));
|
||||||
|
}
|
||||||
assert.ok(gpu.textured > 0); assert.ok(gpu.programs.every(Boolean)); assert.deepEqual(errors, []);
|
assert.ok(gpu.textured > 0); assert.ok(gpu.programs.every(Boolean)); assert.deepEqual(errors, []);
|
||||||
console.log("OK: pointer drawing/moving/corner snapping, Alt bypass, five persisted surface types, metre-scaled textures compiled in all three themes, sloped and transparent surfaces", gpu);
|
delete gpu.transforms;
|
||||||
|
console.log("OK: outdoor snapping, surface types, per-area texture size/rotation/reset/persistence, independent GPU transforms in all three themes including sloped and transparent surfaces", gpu);
|
||||||
} finally {
|
} finally {
|
||||||
await browser?.close(); await new Promise((done) => server.close(done));
|
await browser?.close(); await new Promise((done) => server.close(done));
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
||||||
var pr=globalThis,mr=pr.ShadowRoot&&(pr.ShadyCSS===void 0||pr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ma=Symbol(),Lc=new WeakMap,hs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ma)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(mr&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Lc.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Lc.set(t,e))}return e}toString(){return this.cssText}},Nc=i=>new hs(typeof i=="string"?i:i+"",void 0,Ma),wa=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,s,r)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[r+1],i[0]);return new hs(t,i,Ma)},Dc=(i,e)=>{if(mr)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),s=pr.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},Ea=mr?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Nc(t)})(i):i;var{is:wd,defineProperty:Ed,getOwnPropertyDescriptor:Td,getOwnPropertyNames:Ad,getOwnPropertySymbols:Rd,getPrototypeOf:Cd}=Object,gr=globalThis,Uc=gr.trustedTypes,Pd=Uc?Uc.emptyScript:"",Id=gr.reactiveElementPolyfillSupport,us=(i,e)=>i,Ta={toAttribute(i,e){switch(e){case Boolean:i=i?Pd:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Oc=(i,e)=>!wd(i,e),Fc={attribute:!0,type:String,converter:Ta,reflect:!1,useDefault:!1,hasChanged:Oc};Symbol.metadata??=Symbol("metadata"),gr.litPropertyMetadata??=new WeakMap;var En=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=Fc){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){let n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&Ed(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=Td(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let a=s?.call(this);r?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Fc}static _$Ei(){if(this.hasOwnProperty(us("elementProperties")))return;let e=Cd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(us("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(us("properties"))){let t=this.properties,n=[...Ad(t),...Rd(t)];for(let s of n)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let s of n)t.unshift(Ea(s))}else e!==void 0&&t.push(Ea(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Dc(e,this.constructor.elementStyles),e}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){let n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:Ta).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttrLine truncated
|
var pr=globalThis,mr=pr.ShadowRoot&&(pr.ShadyCSS===void 0||pr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ma=Symbol(),Lc=new WeakMap,hs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ma)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(mr&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Lc.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Lc.set(t,e))}return e}toString(){return this.cssText}},Nc=i=>new hs(typeof i=="string"?i:i+"",void 0,Ma),wa=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,s,r)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[r+1],i[0]);return new hs(t,i,Ma)},Dc=(i,e)=>{if(mr)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),s=pr.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},Ea=mr?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Nc(t)})(i):i;var{is:wd,defineProperty:Ed,getOwnPropertyDescriptor:Td,getOwnPropertyNames:Ad,getOwnPropertySymbols:Rd,getPrototypeOf:Cd}=Object,gr=globalThis,Uc=gr.trustedTypes,Pd=Uc?Uc.emptyScript:"",Id=gr.reactiveElementPolyfillSupport,us=(i,e)=>i,Ta={toAttribute(i,e){switch(e){case Boolean:i=i?Pd:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Oc=(i,e)=>!wd(i,e),Fc={attribute:!0,type:String,converter:Ta,reflect:!1,useDefault:!1,hasChanged:Oc};Symbol.metadata??=Symbol("metadata"),gr.litPropertyMetadata??=new WeakMap;var Tn=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=Fc){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){let n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&Ed(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=Td(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let a=s?.call(this);r?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Fc}static _$Ei(){if(this.hasOwnProperty(us("elementProperties")))return;let e=Cd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(us("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(us("properties"))){let t=this.properties,n=[...Ad(t),...Rd(t)];for(let s of n)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let s of n)t.unshift(Ea(s))}else e!==void 0&&t.push(Ea(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Dc(e,this.constructor.elementStyles),e}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){let n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:Ta).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttrLine truncated
|
||||||
\f\r]`,ds=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zc=/-->/g,Vc=/>/g,oi=RegExp(`>|${Aa}(?:([^\\s"'>=/]+)(${Aa}*=${Aa}*(?:[^
|
\f\r]`,ds=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zc=/-->/g,Vc=/>/g,oi=RegExp(`>|${Aa}(?:([^\\s"'>=/]+)(${Aa}*=${Aa}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),Gc=/'/g,Hc=/"/g,qc=/^(?:script|style|textarea|title)$/i,Ua=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),qe=Ua(1),X_=Ua(2),q_=Ua(3),ci=Symbol.for("lit-noChange"),Qe=Symbol.for("lit-nothing"),Wc=new WeakMap,ai=li.createTreeWalker(li,129);function Yc(i,e){if(!Da(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return kc!==void 0?kc.createHTML(e):e}var Dd=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=ds;for(let a=0;a<t;a++){let l=i[a],c,u,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,u=o.exec(l),u!==null);)f=o.lastIndex,o===ds?u[1]==="!--"?o=zc:u[1]!==void 0?o=Vc:u[2]!==void 0?(qc.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=oi):u[3]!==void 0&&(o=oi):o===oi?u[0]===">"?(o=s??ds,d=-1):u[1]===void 0?d=-2:(d=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?oi:u[3]==='"'?Hc:Gc):o===Hc||o===Gc?o=oi:o===zc||o===Vc?o=ds:(o=oi,s=void 0);let h=o===oi&&i[a+1].startsWith("/>")?" ":"";r+=o===ds?l+Ld:d>=0?(n.push(c),l.slice(0,d)+$c+l.slice(d)+zn+h):l+zn+(d===-2?a:h)}return[Yc(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ms=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,a=e.length-1,l=this.parts,[c,u]=Dd(e,t);if(this.el=i.createElement(c,n),ai.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=ai.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith($c)){let f=u[o++],h=s.getAttribute(d).split(zn),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:g[2],strings:h,ctor:g[1]==="."?Ca:g[1]==="?"?Pa:g[1]==="@"?Ia:Ri}),s.removeAttribute(d)}else d.startsWith(zn)&&(l.push({type:6,index:r}),s.removeAttribute(d));if(qc.test(s.tagName)){let d=s.textContent.split(zn),f=d.length-1;if(f>0){s.textContent=_r?_r.emptyScript:"";for(let h=0;h<f;h++)s.append(d[h],fs()),ai.nextNode(),l.push({type:2,index:++r});s.append(d[f],fs())}}}else if(s.nodeType===8)if(s.data===Xc)l.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf(zn,d+1))!==-1;)l.push({type:7,index:r}),d+=zn.length-1}r++}}static createElement(e,t){let n=li.createElement("template");return n.innerHTML=e,n}};function Ai(i,e,t=i,n){if(e===ci)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=ps(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=s:t._$Cl=s),s!==void 0&&(e=Ai(i,s._$AS(i,e.values),s,n)),e}var Ra=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??li).importNode(t,!0);ai.currentNode=s;let r=ai.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new gs(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new La(r,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(r=ai.nextNode(),o++)}return ai.currentNode=li,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},gs=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=Qe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ai(this,e,t),ps(e)?e===Qe||e==null||e===""?(this._$AH!==Qe&&this._$AR(),this._$AH=Qe):e!==this._$AH&&e!==ci&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Nd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Qe&&ps(this._$AH)?this._$AA.nextSibling.data=e:this.T(li.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ms.createElement(Yc(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Ra(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=Wc.get(e.strings);return t===void 0&&Wc.set(e.strings,t=new ms(e)),t}k(e){Da(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(fs()),this.O(fs()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Bc(e).nextSibling;Bc(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ri=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=Qe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!=="Line truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),Gc=/'/g,Hc=/"/g,qc=/^(?:script|style|textarea|title)$/i,Ua=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),qe=Ua(1),X_=Ua(2),q_=Ua(3),ci=Symbol.for("lit-noChange"),Qe=Symbol.for("lit-nothing"),Wc=new WeakMap,ai=li.createTreeWalker(li,129);function Yc(i,e){if(!Da(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return kc!==void 0?kc.createHTML(e):e}var Dd=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=ds;for(let a=0;a<t;a++){let l=i[a],c,u,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,u=o.exec(l),u!==null);)f=o.lastIndex,o===ds?u[1]==="!--"?o=zc:u[1]!==void 0?o=Vc:u[2]!==void 0?(qc.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=oi):u[3]!==void 0&&(o=oi):o===oi?u[0]===">"?(o=s??ds,d=-1):u[1]===void 0?d=-2:(d=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?oi:u[3]==='"'?Hc:Gc):o===Hc||o===Gc?o=oi:o===zc||o===Vc?o=ds:(o=oi,s=void 0);let h=o===oi&&i[a+1].startsWith("/>")?" ":"";r+=o===ds?l+Ld:d>=0?(n.push(c),l.slice(0,d)+$c+l.slice(d)+zn+h):l+zn+(d===-2?a:h)}return[Yc(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ms=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,a=e.length-1,l=this.parts,[c,u]=Dd(e,t);if(this.el=i.createElement(c,n),ai.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=ai.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith($c)){let f=u[o++],h=s.getAttribute(d).split(zn),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:g[2],strings:h,ctor:g[1]==="."?Ca:g[1]==="?"?Pa:g[1]==="@"?Ia:Ri}),s.removeAttribute(d)}else d.startsWith(zn)&&(l.push({type:6,index:r}),s.removeAttribute(d));if(qc.test(s.tagName)){let d=s.textContent.split(zn),f=d.length-1;if(f>0){s.textContent=_r?_r.emptyScript:"";for(let h=0;h<f;h++)s.append(d[h],fs()),ai.nextNode(),l.push({type:2,index:++r});s.append(d[f],fs())}}}else if(s.nodeType===8)if(s.data===Xc)l.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf(zn,d+1))!==-1;)l.push({type:7,index:r}),d+=zn.length-1}r++}}static createElement(e,t){let n=li.createElement("template");return n.innerHTML=e,n}};function Ai(i,e,t=i,n){if(e===ci)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=ps(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=s:t._$Cl=s),s!==void 0&&(e=Ai(i,s._$AS(i,e.values),s,n)),e}var Ra=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??li).importNode(t,!0);ai.currentNode=s;let r=ai.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new gs(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new La(r,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(r=ai.nextNode(),o++)}return ai.currentNode=li,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},gs=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=Qe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ai(this,e,t),ps(e)?e===Qe||e==null||e===""?(this._$AH!==Qe&&this._$AR(),this._$AH=Qe):e!==this._$AH&&e!==ci&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Nd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Qe&&ps(this._$AH)?this._$AA.nextSibling.data=e:this.T(li.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ms.createElement(Yc(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Ra(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=Wc.get(e.strings);return t===void 0&&Wc.set(e.strings,t=new ms(e)),t}k(e){Da(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(fs()),this.O(fs()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Bc(e).nextSibling;Bc(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ri=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=Qe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!=="Line truncated
|
||||||
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
||||||
}`,Af=`void main() {
|
}`,Af=`void main() {
|
||||||
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
||||||
@@ -3858,7 +3858,7 @@ void main() {
|
|||||||
gl_FragColor = texture2D( tEquirect, sampleUV );
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
||||||
|
|
||||||
}
|
}
|
||||||
`},s=new Ji(5,5,5),r=new xn({name:"CubemapFromEquirect",uniforms:wi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ot,blending:yi});r.uniforms.tEquirect.value=t;let o=new Xt(s,r),a=t.minFilter;return t.minFilter===Dn&&(t.minFilter=Ft),new Qi(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){let r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,s);e.setRenderTarget(r)}},Au=256,Tg=3,Ag=20,Ju=256,Ku=16,Rg=3,Cg=new B,Pg=new Ie,ma=class i{constructor(e){this._renderer=e,this._cubeSize=0,this._sourceTarget=null,this._cubeCamera=new Qi(1,10,null),this._boxMesh=new Xt(new Ji(5,5,5),null),this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null,this._integrationMaterial=null}fromScene(e,t=0,n=.1,s=100,r={}){let{size:o=256,position:a=Cg}=r,l=this._renderer;this._setSize(o);let c=this._allocateTarget(),u=this._getSourceTarget(!0);t>0&&(u.texture.mipmapsAutoUpdate=!1);let d=l.autoClear,f=l.autoClearColor,h=l.autoClearDepth,g=l.autoClearStencil,v=e.background;l.autoClear=!0,l.autoClearColor=!0,l.autoClearDepth=!0,l.autoClearStencil=!0,v===null&&(e.background=l.getClearColor(Pg));let p=new Qi(n,s,u);return p.position.copy(a),p.update(l,e),l.autoClear=d,l.autoClearColor=f,l.autoClearDepth=h,l.autoClearStencil=g,e.background=v,t>0&&(u.texture.mipmapsAutoUpdate=!0,this._blur(c,t)),this._applyPMREM(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Pu(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Cu(),this._compileMaterial(this._equirectMaterial))}dispose(){this._sourceTarget!==null&&this._sourceTarget.dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._integrationMaterial!==null&&this._integrationMaterial.dispose(),this._boxMesh.geometry.dispose()}static lodToRoughness(e,t){return t>0?1-Math.sqrt(1-e/t):0}_setSize(e){this._cubeSize=Math.max(Au,xu(e))}_fromTexture(e,t){e.mapping===Si||e.mapping===ts?this._setSize(e.image.length===0?Au:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4);let n=t||this._allocateTarget();return this._textureToCubemap(e),this._applyPMREM(n),n}_allocateTarget(){let e=this._cubeSize,t=Ru(e,!1,!1),n=Math.log2(e)-Tg;for(let s=0;s<=n;s++)t.texture.mipmaps.push({width:e>>s,height:e>>s});return t.texture.name="PMREM",t.texture.isPMREMTexture=!0,t}_getSourceTarget(e=!1){let t=this._cubeSize,n=this._sourceTarget;return(n===null||n.width!==t||e&&n.depthBuffer===!1)&&(n!==null&&n.dispose(),this._sourceTarget=Ru(t,!0,e)),this._sourceTarget}_compileMaterial(e){this._boxMesh.material=e,this._renderer.compile(this._boxMesh,this._cubeCamera.children[0])}_renderCube(e,t,n){let s=this._boxMesh,r=this._cubeCamera;s.material=n,r.renderTarget=e,r.activeMipmapLevel=t;let o=e.width>>t;e.viewport.set(0,0,o,o),r.update(this._renderer,s),e.viewport.set(0,0,e.width,e.height)}_textureToCubemap(e){let t;e.mapping===Si||e.mapping===ts?(this._cubemapMaterial===null&&(this._cubemapMaterial=Pu()),t=this._cubemapMaterial,t.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):(this._equirectMaterial===null&&(this._equirectMaterial=Cu()),t=this._equirectMaterial),t.uniforms.envMap.value=e,this._renderCube(this._getSourceTarget(),0,t)}_applyPMREM(e){this._ggxMaterial===null&&(this._ggxMaterial=Ig(),this._integrationMaterial=Lg());let t=this._cubeSize,n=e.texture.mipmaps.length-1,s=this._ggxMaterial.uniforms;s.envMap.value=this._sourceTarget.texture;let r=this._integrationMaterial.uniforms;r.envMap.value=this._sourceTarget.texture,r.sourceLod.value=Math.log2(t/Ku);for(let o=0;o<=n;o++){let a=i.lodToRoughness(o,n);if(o>n-Rg)r.roughness.value=a,this._renderCube(e,o,this._integrationMaterial);else{let l=a>0?Math.log2(t)+.5*Math.log2(6/(Ju*Math.pow(a,4)))+.5:0;s.roughness.value=a,s.lodBias.value=l,this._renderCube(e,o,this._ggxMaterial)}}}_blur(e,t){this._blurMaterial===null&&(this._blurMaterial=Ng());let n=this._blurMaterial,s=n.uniforms,r=this._sourceTarget;s.sigma.value=Math.min(t,Math.PI)/Math.SQRT2,s.envMap.value=r.texture,this._renderCube(e,0,n),s.envMap.value=e.texture,this._renderCube(r,0,n)}};function Ru(i,e,t){return new nr(i,{minFilter:Dn,generateMipmaps:e,type:hn,colorSpace:Es,depthBuffer:t})}function ir(i,e,t){return new xn({name:i,uniforms:e,vertexShader:ke.cube_vert,fragmentShader:t,side:Ot,blending:yi,depthTest:!1,depthWrite:!1})}function Ig(){return ir("PMREMGGXConvolution",{envMap:{value:null},roughness:{value:0},lodBias:{value:0}},`
|
`},s=new Ji(5,5,5),r=new xn({name:"CubemapFromEquirect",uniforms:wi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ot,blending:yi});r.uniforms.tEquirect.value=t;let o=new Xt(s,r),a=t.minFilter;return t.minFilter===Un&&(t.minFilter=Ft),new Qi(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){let r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,s);e.setRenderTarget(r)}},Au=256,Tg=3,Ag=20,Ju=256,Ku=16,Rg=3,Cg=new B,Pg=new Ie,ma=class i{constructor(e){this._renderer=e,this._cubeSize=0,this._sourceTarget=null,this._cubeCamera=new Qi(1,10,null),this._boxMesh=new Xt(new Ji(5,5,5),null),this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null,this._integrationMaterial=null}fromScene(e,t=0,n=.1,s=100,r={}){let{size:o=256,position:a=Cg}=r,l=this._renderer;this._setSize(o);let c=this._allocateTarget(),u=this._getSourceTarget(!0);t>0&&(u.texture.mipmapsAutoUpdate=!1);let d=l.autoClear,f=l.autoClearColor,h=l.autoClearDepth,g=l.autoClearStencil,v=e.background;l.autoClear=!0,l.autoClearColor=!0,l.autoClearDepth=!0,l.autoClearStencil=!0,v===null&&(e.background=l.getClearColor(Pg));let p=new Qi(n,s,u);return p.position.copy(a),p.update(l,e),l.autoClear=d,l.autoClearColor=f,l.autoClearDepth=h,l.autoClearStencil=g,e.background=v,t>0&&(u.texture.mipmapsAutoUpdate=!0,this._blur(c,t)),this._applyPMREM(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Pu(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Cu(),this._compileMaterial(this._equirectMaterial))}dispose(){this._sourceTarget!==null&&this._sourceTarget.dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._integrationMaterial!==null&&this._integrationMaterial.dispose(),this._boxMesh.geometry.dispose()}static lodToRoughness(e,t){return t>0?1-Math.sqrt(1-e/t):0}_setSize(e){this._cubeSize=Math.max(Au,xu(e))}_fromTexture(e,t){e.mapping===Si||e.mapping===ts?this._setSize(e.image.length===0?Au:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4);let n=t||this._allocateTarget();return this._textureToCubemap(e),this._applyPMREM(n),n}_allocateTarget(){let e=this._cubeSize,t=Ru(e,!1,!1),n=Math.log2(e)-Tg;for(let s=0;s<=n;s++)t.texture.mipmaps.push({width:e>>s,height:e>>s});return t.texture.name="PMREM",t.texture.isPMREMTexture=!0,t}_getSourceTarget(e=!1){let t=this._cubeSize,n=this._sourceTarget;return(n===null||n.width!==t||e&&n.depthBuffer===!1)&&(n!==null&&n.dispose(),this._sourceTarget=Ru(t,!0,e)),this._sourceTarget}_compileMaterial(e){this._boxMesh.material=e,this._renderer.compile(this._boxMesh,this._cubeCamera.children[0])}_renderCube(e,t,n){let s=this._boxMesh,r=this._cubeCamera;s.material=n,r.renderTarget=e,r.activeMipmapLevel=t;let o=e.width>>t;e.viewport.set(0,0,o,o),r.update(this._renderer,s),e.viewport.set(0,0,e.width,e.height)}_textureToCubemap(e){let t;e.mapping===Si||e.mapping===ts?(this._cubemapMaterial===null&&(this._cubemapMaterial=Pu()),t=this._cubemapMaterial,t.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):(this._equirectMaterial===null&&(this._equirectMaterial=Cu()),t=this._equirectMaterial),t.uniforms.envMap.value=e,this._renderCube(this._getSourceTarget(),0,t)}_applyPMREM(e){this._ggxMaterial===null&&(this._ggxMaterial=Ig(),this._integrationMaterial=Lg());let t=this._cubeSize,n=e.texture.mipmaps.length-1,s=this._ggxMaterial.uniforms;s.envMap.value=this._sourceTarget.texture;let r=this._integrationMaterial.uniforms;r.envMap.value=this._sourceTarget.texture,r.sourceLod.value=Math.log2(t/Ku);for(let o=0;o<=n;o++){let a=i.lodToRoughness(o,n);if(o>n-Rg)r.roughness.value=a,this._renderCube(e,o,this._integrationMaterial);else{let l=a>0?Math.log2(t)+.5*Math.log2(6/(Ju*Math.pow(a,4)))+.5:0;s.roughness.value=a,s.lodBias.value=l,this._renderCube(e,o,this._ggxMaterial)}}}_blur(e,t){this._blurMaterial===null&&(this._blurMaterial=Ng());let n=this._blurMaterial,s=n.uniforms,r=this._sourceTarget;s.sigma.value=Math.min(t,Math.PI)/Math.SQRT2,s.envMap.value=r.texture,this._renderCube(e,0,n),s.envMap.value=e.texture,this._renderCube(r,0,n)}};function Ru(i,e,t){return new nr(i,{minFilter:Un,generateMipmaps:e,type:hn,colorSpace:Es,depthBuffer:t})}function ir(i,e,t){return new xn({name:i,uniforms:e,vertexShader:ke.cube_vert,fragmentShader:t,side:Ot,blending:yi,depthTest:!1,depthWrite:!1})}function Ig(){return ir("PMREMGGXConvolution",{envMap:{value:null},roughness:{value:0},lodBias:{value:0}},`
|
||||||
|
|
||||||
#define GGX_SAMPLES ${Ju}u
|
#define GGX_SAMPLES ${Ju}u
|
||||||
|
|
||||||
@@ -4123,7 +4123,7 @@ void main() {
|
|||||||
#ifdef SRGB_TRANSFER
|
#ifdef SRGB_TRANSFER
|
||||||
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
||||||
#endif
|
#endif
|
||||||
}`,depthTest:!1,depthWrite:!1}),f=new Xt(u,d),h=new Eo(-1,1,1,-1,0,1),g=null,v=null,p=!1,m,b=null,w=[],S=!1;this.setSize=function(A,T){o.setSize(A,T),a!==null&&a.setSize(A,T),l!==null&&l.setSize(A,T);for(let _=0;_<w.length;_++){let M=w[_];M.setSize&&M.setSize(A,T)}},this.setEffects=function(A){w=A,S=w.length>0&&w[0].isRenderPass===!0;let T=o.width,_=o.height;w.length>0&&a===null&&(a=new Ht(T,_,{type:hn,depthBuffer:!1,stencilBuffer:!1}),l=new Ht(T,_,{type:hn,depthBuffer:!1,stencilBuffer:!1}));let M=s===!0&&w.some(U=>U.needsDepthTexture===!0);M!==(o.depthTexture!==null)&&(M===!0&&c===null&&(c=new Nn(T,_),r===!0&&(c.format=Un,c.type=Mi)),o.dispose(),o.depthTexture=M?c:null,o.resolveDepthBuffer=M,o.storeMultisampledDepthBuffer=M);for(let U=0;U<w.length;U++){let I=w[U];I.setSize&&I.setSize(T,_),M&&I.needsDepthTexture===!0&&I.setDepthTexture&&I.setDepthTexture(c)}},this.begin=function(A,T){if(p||A.toneMapping===yn&&w.length===0)return!1;if(b=T,T!==null){let _=T.width,M=T.height;(o.width!==_||o.height!==M)&&this.setSize(_,M)}return S===!1&&A.setRenderTarget(o),m=A.toneMapping,A.toneMapping=yn,!0},this.hasRenderPass=function(){return S},this.end=function(A,T){A.toneMapping=m,p=!0;let _=o,M=a;for(let U=0;U<w.length;U++){let I=w[U];I.enabled!==!1&&(I.render(A,M,_,T),I.needsSwap!==!1&&(_=M,M=M===a?l:a))}if(g!==A.outputColorSpace||v!==A.toneMapping){g=A.outputColorSpace,v=A.toneMapping,d.defines={},We.getTransfer(g)===Ze&&(d.defines.SRGB_TRANSFER="");let U=Vg[v];U&&(d.defines[U]=""),d.needsUpdate=!0}d.uniforms.tDiffuse.value=_.texture,A.setRenderTarget(b),A.render(f,h),b=null,p=!1},this.isCompositing=function(){return p},this.dispose=function(){o.dispose(),a!==null&&a.dispose(),l!==null&&l.dispose(),u.dispose(),d.dispose()}}var Qu=new kt,ju=new Nn(1,1),ed=new Ds(1),td=new Cs,nd=new ro,id=new Ns,Iu=[],Lu=[],Nu=new Float32Array(16),Du=new Float32Array(9),Uu=new Float32Array(4);function ss(i,e,t){let n=i[0];if(n<=0||n>0)return i;let s=e*t,r=Iu[s];if(r===void 0&&(r=new Float32Array(s),Iu[s]=r),e!==0){n.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,i[o].toArray(r,a)}return r}function _t(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function xt(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function _a(i,e){let t=Lu[e];t===void 0&&(t=new Int32Array(e),Lu[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function Hg(i,e){let t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function Wg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(_t(t,e))return;i.uniform2fv(this.addr,e),xt(t,e)}}function $g(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(_t(t,e))return;i.uniform3fv(this.addr,e),xt(t,e)}}function Xg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(_t(t,e))return;i.uniform4fv(this.addr,e),xt(t,e)}}function qg(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(_t(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),xt(t,e)}else{if(_t(t,n))return;Uu.set(n),i.uniformMatrix2fv(this.addr,!1,Uu),xt(t,n)}}function Yg(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(_t(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),xt(t,e)}else{if(_t(t,n))return;Du.set(n),i.uniformMatrix3fv(this.addr,!1,Du),xt(t,n)}}function Zg(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(_t(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),xt(t,e)}else{if(_t(t,n))return;Nu.set(n),i.uniformMatrix4fv(this.addr,!1,Nu),xt(t,n)}}function Jg(i,e){let t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function Kg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(_t(t,e))return;i.uniform2iv(this.addr,e),xt(t,e)}}function Qg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(_t(t,e))return;i.uniform3iv(this.addr,e),xt(t,e)}}function jg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(_t(t,e))return;i.uniform4iv(this.addr,e),xt(t,e)}}function e0(i,e){let t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function t0(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(_t(t,e))return;i.uniform2uiv(this.addr,e),xt(t,e)}}function n0(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(_t(t,e))return;i.uniform3uiv(thi
Line truncated
|
}`,depthTest:!1,depthWrite:!1}),f=new Xt(u,d),h=new Eo(-1,1,1,-1,0,1),g=null,v=null,p=!1,m,b=null,w=[],S=!1;this.setSize=function(A,T){o.setSize(A,T),a!==null&&a.setSize(A,T),l!==null&&l.setSize(A,T);for(let _=0;_<w.length;_++){let M=w[_];M.setSize&&M.setSize(A,T)}},this.setEffects=function(A){w=A,S=w.length>0&&w[0].isRenderPass===!0;let T=o.width,_=o.height;w.length>0&&a===null&&(a=new Ht(T,_,{type:hn,depthBuffer:!1,stencilBuffer:!1}),l=new Ht(T,_,{type:hn,depthBuffer:!1,stencilBuffer:!1}));let M=s===!0&&w.some(U=>U.needsDepthTexture===!0);M!==(o.depthTexture!==null)&&(M===!0&&c===null&&(c=new Dn(T,_),r===!0&&(c.format=Fn,c.type=Mi)),o.dispose(),o.depthTexture=M?c:null,o.resolveDepthBuffer=M,o.storeMultisampledDepthBuffer=M);for(let U=0;U<w.length;U++){let I=w[U];I.setSize&&I.setSize(T,_),M&&I.needsDepthTexture===!0&&I.setDepthTexture&&I.setDepthTexture(c)}},this.begin=function(A,T){if(p||A.toneMapping===yn&&w.length===0)return!1;if(b=T,T!==null){let _=T.width,M=T.height;(o.width!==_||o.height!==M)&&this.setSize(_,M)}return S===!1&&A.setRenderTarget(o),m=A.toneMapping,A.toneMapping=yn,!0},this.hasRenderPass=function(){return S},this.end=function(A,T){A.toneMapping=m,p=!0;let _=o,M=a;for(let U=0;U<w.length;U++){let I=w[U];I.enabled!==!1&&(I.render(A,M,_,T),I.needsSwap!==!1&&(_=M,M=M===a?l:a))}if(g!==A.outputColorSpace||v!==A.toneMapping){g=A.outputColorSpace,v=A.toneMapping,d.defines={},We.getTransfer(g)===Ze&&(d.defines.SRGB_TRANSFER="");let U=Vg[v];U&&(d.defines[U]=""),d.needsUpdate=!0}d.uniforms.tDiffuse.value=_.texture,A.setRenderTarget(b),A.render(f,h),b=null,p=!1},this.isCompositing=function(){return p},this.dispose=function(){o.dispose(),a!==null&&a.dispose(),l!==null&&l.dispose(),u.dispose(),d.dispose()}}var Qu=new kt,ju=new Dn(1,1),ed=new Ds(1),td=new Cs,nd=new ro,id=new Ns,Iu=[],Lu=[],Nu=new Float32Array(16),Du=new Float32Array(9),Uu=new Float32Array(4);function ss(i,e,t){let n=i[0];if(n<=0||n>0)return i;let s=e*t,r=Iu[s];if(r===void 0&&(r=new Float32Array(s),Iu[s]=r),e!==0){n.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,i[o].toArray(r,a)}return r}function _t(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function xt(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function _a(i,e){let t=Lu[e];t===void 0&&(t=new Int32Array(e),Lu[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function Hg(i,e){let t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function Wg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(_t(t,e))return;i.uniform2fv(this.addr,e),xt(t,e)}}function $g(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(_t(t,e))return;i.uniform3fv(this.addr,e),xt(t,e)}}function Xg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(_t(t,e))return;i.uniform4fv(this.addr,e),xt(t,e)}}function qg(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(_t(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),xt(t,e)}else{if(_t(t,n))return;Uu.set(n),i.uniformMatrix2fv(this.addr,!1,Uu),xt(t,n)}}function Yg(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(_t(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),xt(t,e)}else{if(_t(t,n))return;Du.set(n),i.uniformMatrix3fv(this.addr,!1,Du),xt(t,n)}}function Zg(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(_t(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),xt(t,e)}else{if(_t(t,n))return;Nu.set(n),i.uniformMatrix4fv(this.addr,!1,Nu),xt(t,n)}}function Jg(i,e){let t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function Kg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(_t(t,e))return;i.uniform2iv(this.addr,e),xt(t,e)}}function Qg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(_t(t,e))return;i.uniform3iv(this.addr,e),xt(t,e)}}function jg(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(_t(t,e))return;i.uniform4iv(this.addr,e),xt(t,e)}}function e0(i,e){let t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function t0(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(_t(t,e))return;i.uniform2uiv(this.addr,e),xt(t,e)}}function n0(i,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(_t(t,e))return;i.uniform3uiv(thi
Line truncated
|
||||||
`),n=[],s=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let o=s;o<r;o++){let a=o+1;n.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return n.join(`
|
`),n=[],s=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let o=s;o<r;o++){let a=o+1;n.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return n.join(`
|
||||||
`)}var Bu=new Le;function N0(i){We._getMatrix(Bu,We.workingColorSpace,i);let e=`mat3( ${Bu.elements.map(t=>t.toFixed(4))} )`;switch(We.getTransfer(i)){case Ts:return[e,"LinearTransferOETF"];case Ze:return[e,"sRGBTransferOETF"];default:return Re("WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function ku(i,e,t){let n=i.getShaderParameter(e,i.COMPILE_STATUS),r=(i.getShaderInfoLog(e)||"").trim();if(n&&r==="")return"";let o=/ERROR: 0:(\d+)/.exec(r);if(o){let a=parseInt(o[1]);return t.toUpperCase()+`
|
`)}var Bu=new Le;function N0(i){We._getMatrix(Bu,We.workingColorSpace,i);let e=`mat3( ${Bu.elements.map(t=>t.toFixed(4))} )`;switch(We.getTransfer(i)){case Ts:return[e,"LinearTransferOETF"];case Ze:return[e,"sRGBTransferOETF"];default:return Re("WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function ku(i,e,t){let n=i.getShaderParameter(e,i.COMPILE_STATUS),r=(i.getShaderInfoLog(e)||"").trim();if(n&&r==="")return"";let o=/ERROR: 0:(\d+)/.exec(r);if(o){let a=parseInt(o[1]);return t.toUpperCase()+`
|
||||||
|
|
||||||
@@ -4201,7 +4201,7 @@ void main() {
|
|||||||
squared_mean = squared_mean / samples;
|
squared_mean = squared_mean / samples;
|
||||||
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
|
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
|
||||||
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
|
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
|
||||||
}`,d_=[new B(1,0,0),new B(-1,0,0),new B(0,1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1)],f_=[new B(0,-1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1),new B(0,-1,0),new B(0,-1,0)],qu=new ot,er=new B,rc=new B;function p_(i,e,t){let n=new _i,s=new ze,r=new ze,o=new ht,a=new fo,l=new po,c={},u=t.maxTextureSize,d={[ti]:Ot,[Ot]:ti,[vn]:vn},f=new xn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:h_,fragmentShader:u_}),h=f.clone();h.defines.HORIZONTAL_PASS=1;let g=new $t;g.setAttribute("position",new mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let v=new Xt(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=$s;let m=this.type;this.render=function(T,_,M){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;this.type===Oh&&(Re("WebGLShadowMap: PCFSoftShadowMap has been removed. Using PCFShadowMap instead."),this.type=$s);let U=i.getRenderTarget(),I=i.getActiveCubeFace(),N=i.getActiveMipmapLevel(),k=i.state;k.setBlending(yi),k.buffers.depth.getReversed()===!0?k.buffers.color.setClear(0,0,0,0):k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);let $=m!==this.type;$&&_.traverse(function(P){P.material&&(Array.isArray(P.material)?P.material.forEach(W=>W.needsUpdate=!0):P.material.needsUpdate=!0)});for(let P=0,W=T.length;P<W;P++){let J=T[P],V=J.shadow;if(V===void 0){Re("WebGLShadowMap:",J,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;s.copy(V.mapSize);let te=V.getFrameExtents();s.multiply(te),r.copy(V.mapSize),(s.x>u||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/te.x),s.x=r.x*te.x,V.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/te.y),s.y=r.y*te.y,V.mapSize.y=r.y));let H=i.state.buffers.depth.getReversed();if(V.camera._reversedDepth=H,V.map===null||$===!0){if(V.map!==null&&(V.map.depthTexture!==null&&(V.map.depthTexture.dispose(),V.map.depthTexture=null),V.map.dispose()),this.type===ji){if(J.isPointLight){Re("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}V.map=new Ht(s.x,s.y,{format:ni,type:hn,minFilter:Ft,magFilter:Ft,generateMipmaps:!1}),V.map.texture.name=J.name+".shadowMap",V.map.depthTexture=new Nn(s.x,s.y,cn),V.map.depthTexture.name=J.name+".shadowMapDepth",V.map.depthTexture.format=Ln,V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt}else J.isPointLight?(V.map=new nr(s.x),V.map.depthTexture=new Ds(s.x,ln)):(V.map=new Ht(s.x,s.y),V.map.depthTexture=new Nn(s.x,s.y,ln)),V.map.depthTexture.name=J.name+".shadowMap",V.map.depthTexture.format=Ln,this.type===$s?(V.map.depthTexture.compareFunction=H?Wl:Hl,V.map.depthTexture.minFilter=Ft,V.map.depthTexture.magFilter=Ft):(V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt);V.camera.updateProjectionMatrix()}V.map.isWebGLCubeRenderTarget!==!0&&(V.map.width!==s.x||V.map.height!==s.y)&&V.map.setSize(s.x,s.y);let Q=V.map.isWebGLCubeRenderTarget?6:V.getViewportCount();J.isPointLight!==!0&&V.updateMatrices(J,M);let j=(V.camera.layers.mask&4294967294)!==0?V.camera.layers:M.layers;for(let Se=0;Se<Q;Se++){let De=V.getCamera(Se);if(J.isPointLight){let Y=V.camera,me=V.matrix,ve=J.distance||Y.far;ve!==Y.far&&(Y.far=ve,Y.updateProjectionMatrix()),er.setFromMatrixPosition(J.matrixWorld),Y.position.copy(er),rc.copy(Y.position),rc.add(d_[Se]),Y.up.copy(f_[Se]),Y.lookAt(rc),Y.updateMatrixWorld(),me.makeTranslation(-er.x,-er.y,-er.z),qu.multiplyMatrices(Y.projectionMatrix,Y.matrixWorldInverse),V._frustum.setFromProjectionMatrix(qu,Y.coordinateSystem,Y.reversedDepth)}if(V.map.isWebGLCubeRenderTarget)i.setRenderTarget(V.map,Se),i.clear();else{Se===0&&(i.setRenderTarget(V.map),i.clear());let Y=V.getViewport(Se);o.set(r.x*Y.x,r.y*Y.y,r.x*Y.z,r.y*Y.w),k.viewport(o)}n=V.getFrustum(Se),S(_,M,De,J,j,this.type)}V.isPointLightShadow!==!0&&this.type===ji&&b(V,M),V.needsUpdate=!1}m=this.type,p.needsUpdate=!1,i.setRenderTarget(U,I,N)};function b(T,_){let M=e.update(v);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,h.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,h.needsUpdate=!0),T.mapPass===null?T.mapPass=new Ht(s.x,s.y,{format:ni,type:hn}):(T.mapPass.width!==T.map.width||T.mapPass.height!==T.map.height)&&T.mapPass.setSize(T.map.width,T.map.height),f.uniforms.shadow_pass.value=T.map.depthTexture,f.uniforms.resolution.value.set(T.map.width,T.map.height),f.uniforms.radius.value=T.radius,i.setRenderTarget(T.mapPass),i.clear(),i.renderBufferDirect(_,null,M,f,v,null),h.uniforms.shadow_pass.value=T.mapPass.texture,h.uniforms.resolution.value.set(T.map.width,T.map.height),h.uniforms.radius.value=T.radius,i.setRenderTarget(T.map),i.clear(),i.renderBufferDirect(_,null,M,h,v,null)}function w(T,_,M,U){let I=null,N=M.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(N!==void 0)I=N;else if(I=M.isPointLight===!0?l:a,i.localClipping
Line truncated
|
}`,d_=[new B(1,0,0),new B(-1,0,0),new B(0,1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1)],f_=[new B(0,-1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1),new B(0,-1,0),new B(0,-1,0)],qu=new ot,er=new B,rc=new B;function p_(i,e,t){let n=new _i,s=new ze,r=new ze,o=new ht,a=new fo,l=new po,c={},u=t.maxTextureSize,d={[ti]:Ot,[Ot]:ti,[vn]:vn},f=new xn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:h_,fragmentShader:u_}),h=f.clone();h.defines.HORIZONTAL_PASS=1;let g=new $t;g.setAttribute("position",new mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let v=new Xt(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=$s;let m=this.type;this.render=function(T,_,M){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;this.type===Oh&&(Re("WebGLShadowMap: PCFSoftShadowMap has been removed. Using PCFShadowMap instead."),this.type=$s);let U=i.getRenderTarget(),I=i.getActiveCubeFace(),N=i.getActiveMipmapLevel(),k=i.state;k.setBlending(yi),k.buffers.depth.getReversed()===!0?k.buffers.color.setClear(0,0,0,0):k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);let $=m!==this.type;$&&_.traverse(function(P){P.material&&(Array.isArray(P.material)?P.material.forEach(W=>W.needsUpdate=!0):P.material.needsUpdate=!0)});for(let P=0,W=T.length;P<W;P++){let J=T[P],V=J.shadow;if(V===void 0){Re("WebGLShadowMap:",J,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;s.copy(V.mapSize);let te=V.getFrameExtents();s.multiply(te),r.copy(V.mapSize),(s.x>u||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/te.x),s.x=r.x*te.x,V.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/te.y),s.y=r.y*te.y,V.mapSize.y=r.y));let H=i.state.buffers.depth.getReversed();if(V.camera._reversedDepth=H,V.map===null||$===!0){if(V.map!==null&&(V.map.depthTexture!==null&&(V.map.depthTexture.dispose(),V.map.depthTexture=null),V.map.dispose()),this.type===ji){if(J.isPointLight){Re("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}V.map=new Ht(s.x,s.y,{format:ni,type:hn,minFilter:Ft,magFilter:Ft,generateMipmaps:!1}),V.map.texture.name=J.name+".shadowMap",V.map.depthTexture=new Dn(s.x,s.y,cn),V.map.depthTexture.name=J.name+".shadowMapDepth",V.map.depthTexture.format=Nn,V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt}else J.isPointLight?(V.map=new nr(s.x),V.map.depthTexture=new Ds(s.x,ln)):(V.map=new Ht(s.x,s.y),V.map.depthTexture=new Dn(s.x,s.y,ln)),V.map.depthTexture.name=J.name+".shadowMap",V.map.depthTexture.format=Nn,this.type===$s?(V.map.depthTexture.compareFunction=H?Wl:Hl,V.map.depthTexture.minFilter=Ft,V.map.depthTexture.magFilter=Ft):(V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt);V.camera.updateProjectionMatrix()}V.map.isWebGLCubeRenderTarget!==!0&&(V.map.width!==s.x||V.map.height!==s.y)&&V.map.setSize(s.x,s.y);let Q=V.map.isWebGLCubeRenderTarget?6:V.getViewportCount();J.isPointLight!==!0&&V.updateMatrices(J,M);let j=(V.camera.layers.mask&4294967294)!==0?V.camera.layers:M.layers;for(let Se=0;Se<Q;Se++){let De=V.getCamera(Se);if(J.isPointLight){let Y=V.camera,me=V.matrix,ve=J.distance||Y.far;ve!==Y.far&&(Y.far=ve,Y.updateProjectionMatrix()),er.setFromMatrixPosition(J.matrixWorld),Y.position.copy(er),rc.copy(Y.position),rc.add(d_[Se]),Y.up.copy(f_[Se]),Y.lookAt(rc),Y.updateMatrixWorld(),me.makeTranslation(-er.x,-er.y,-er.z),qu.multiplyMatrices(Y.projectionMatrix,Y.matrixWorldInverse),V._frustum.setFromProjectionMatrix(qu,Y.coordinateSystem,Y.reversedDepth)}if(V.map.isWebGLCubeRenderTarget)i.setRenderTarget(V.map,Se),i.clear();else{Se===0&&(i.setRenderTarget(V.map),i.clear());let Y=V.getViewport(Se);o.set(r.x*Y.x,r.y*Y.y,r.x*Y.z,r.y*Y.w),k.viewport(o)}n=V.getFrustum(Se),S(_,M,De,J,j,this.type)}V.isPointLightShadow!==!0&&this.type===ji&&b(V,M),V.needsUpdate=!1}m=this.type,p.needsUpdate=!1,i.setRenderTarget(U,I,N)};function b(T,_){let M=e.update(v);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,h.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,h.needsUpdate=!0),T.mapPass===null?T.mapPass=new Ht(s.x,s.y,{format:ni,type:hn}):(T.mapPass.width!==T.map.width||T.mapPass.height!==T.map.height)&&T.mapPass.setSize(T.map.width,T.map.height),f.uniforms.shadow_pass.value=T.map.depthTexture,f.uniforms.resolution.value.set(T.map.width,T.map.height),f.uniforms.radius.value=T.radius,i.setRenderTarget(T.mapPass),i.clear(),i.renderBufferDirect(_,null,M,f,v,null),h.uniforms.shadow_pass.value=T.mapPass.texture,h.uniforms.resolution.value.set(T.map.width,T.map.height),h.uniforms.radius.value=T.radius,i.setRenderTarget(T.map),i.clear(),i.renderBufferDirect(_,null,M,h,v,null)}function w(T,_,M,U){let I=null,N=M.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(N!==void 0)I=N;else if(I=M.isPointLight===!0?l:a,i.localClipping
Line truncated
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
gl_Position = vec4( position, 1.0 );
|
gl_Position = vec4( position, 1.0 );
|
||||||
@@ -4225,7 +4225,7 @@ void main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}`,dc=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Us(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new xn({vertexShader:x_,fragmentShader:v_,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Xt(new zs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},fc=class extends gn{constructor(e,t){super();let n=this,s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null,v=typeof XRWebGLBinding<"u",p=new dc,m={},b=t.getContextAttributes(),w=null,S=null,A=[],T=[],_=new ze,M=null,U=null,I=new Ut;I.viewport=new ht;let N=new Ut;N.viewport=new ht;let k=[I,N],$=new To,P=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getTargetRaySpace()},this.getControllerGrip=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getGripSpace()},this.getHand=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getHandSpace()};function J(Y){let me=T.indexOf(Y.inputSource);if(me===-1)return;let ve=A[me];ve!==void 0&&(ve.update(Y.inputSource,Y.frame,c||o),ve.dispatchEvent({type:Y.type,data:Y.inputSource}))}function V(){s.removeEventListener("select",J),s.removeEventListener("selectstart",J),s.removeEventListener("selectend",J),s.removeEventListener("squeeze",J),s.removeEventListener("squeezestart",J),s.removeEventListener("squeezeend",J),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",te);for(let Y=0;Y<A.length;Y++){let me=T[Y];me!==null&&(T[Y]=null,A[Y].disconnect(me))}P=null,W=null,p.reset();for(let Y in m)delete m[Y];if(e.setRenderTarget(w),h=null,f=null,d=null,s=null,S=null,De.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(_.width,_.height,!1),U!==null){let Y=U.camera;Y.fov=U.fov,Y.zoom=U.zoom,Y.updateProjectionMatrix(),U=null}n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){r=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return f!==null?f:h},this.getBinding=function(){return d===null&&v&&(d=new XRWebGLBinding(s,t)),d},this.getFrame=function(){return g},this.getSession=function(){return s},this.setSession=async function(Y){if(s=Y,s!==null){if(w=e.getRenderTarget(),s.addEventListener("select",J),s.addEventListener("selectstart",J),s.addEventListener("selectend",J),s.addEventListener("squeeze",J),s.addEventListener("squeezestart",J),s.addEventListener("squeezeend",J),s.addEventListener("end",V),s.addEventListener("inputsourceschange",te),b.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(_),v&&"createProjectionLayer"in XRWebGLBinding.prototype){let ve=null,Te=null,ge=null;b.depth&&(ge=b.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ve=b.stencil?Un:Ln,Te=b.stencil?Mi:ln);let Fe={colorFormat:t.RGBA8,depthFormat:ge,scaleFactor:r};d=this.getBinding(),f=d.createProjectionLayer(Fe),s.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),S=new Ht(f.textureWidth,f.textureHeight,{format:un,type:Yt,depthTexture:new Nn(f.textureWidth,f.textureHeight,Te,void 0,void 0,void 0,void 0,void 0,void 0,ve),stencilBuffer:b.stencil,colorSpace:e.outputColorSpace,samples:b.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1,storeMultisampledDepthBuffer:f.ignoreDepthValues===!1,storeMultisampledStencilBuffer:f.ignoreDepthValues===!1})}else{let ve={antialias:b.antialias,alpha:!0,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(s,t,ve),s.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),S=new Ht(h.framebufferWidth,h.framebufferHeight,{format:un,type:Yt,colorSpace:e.outputColorSpace,stencilBuffer:b.stencil,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1,storeMultisampledDepthBuffer:h.ignoreDepthValues===!1,storeMultisampledStencilBuffer:h.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await s.requestReferenceSpace(a),De.setContext(s),De.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};function te(Y){for(let me=0;me<Y.removed.length;me++){let ve=Y.removed[
Line truncated
|
}`,dc=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Us(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new xn({vertexShader:x_,fragmentShader:v_,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Xt(new zs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},fc=class extends gn{constructor(e,t){super();let n=this,s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null,v=typeof XRWebGLBinding<"u",p=new dc,m={},b=t.getContextAttributes(),w=null,S=null,A=[],T=[],_=new ze,M=null,U=null,I=new Ut;I.viewport=new ht;let N=new Ut;N.viewport=new ht;let k=[I,N],$=new To,P=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getTargetRaySpace()},this.getControllerGrip=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getGripSpace()},this.getHand=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getHandSpace()};function J(Y){let me=T.indexOf(Y.inputSource);if(me===-1)return;let ve=A[me];ve!==void 0&&(ve.update(Y.inputSource,Y.frame,c||o),ve.dispatchEvent({type:Y.type,data:Y.inputSource}))}function V(){s.removeEventListener("select",J),s.removeEventListener("selectstart",J),s.removeEventListener("selectend",J),s.removeEventListener("squeeze",J),s.removeEventListener("squeezestart",J),s.removeEventListener("squeezeend",J),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",te);for(let Y=0;Y<A.length;Y++){let me=T[Y];me!==null&&(T[Y]=null,A[Y].disconnect(me))}P=null,W=null,p.reset();for(let Y in m)delete m[Y];if(e.setRenderTarget(w),h=null,f=null,d=null,s=null,S=null,De.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(_.width,_.height,!1),U!==null){let Y=U.camera;Y.fov=U.fov,Y.zoom=U.zoom,Y.updateProjectionMatrix(),U=null}n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){r=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return f!==null?f:h},this.getBinding=function(){return d===null&&v&&(d=new XRWebGLBinding(s,t)),d},this.getFrame=function(){return g},this.getSession=function(){return s},this.setSession=async function(Y){if(s=Y,s!==null){if(w=e.getRenderTarget(),s.addEventListener("select",J),s.addEventListener("selectstart",J),s.addEventListener("selectend",J),s.addEventListener("squeeze",J),s.addEventListener("squeezestart",J),s.addEventListener("squeezeend",J),s.addEventListener("end",V),s.addEventListener("inputsourceschange",te),b.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(_),v&&"createProjectionLayer"in XRWebGLBinding.prototype){let ve=null,Te=null,ge=null;b.depth&&(ge=b.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ve=b.stencil?Fn:Nn,Te=b.stencil?Mi:ln);let Fe={colorFormat:t.RGBA8,depthFormat:ge,scaleFactor:r};d=this.getBinding(),f=d.createProjectionLayer(Fe),s.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),S=new Ht(f.textureWidth,f.textureHeight,{format:un,type:Yt,depthTexture:new Dn(f.textureWidth,f.textureHeight,Te,void 0,void 0,void 0,void 0,void 0,void 0,ve),stencilBuffer:b.stencil,colorSpace:e.outputColorSpace,samples:b.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1,storeMultisampledDepthBuffer:f.ignoreDepthValues===!1,storeMultisampledStencilBuffer:f.ignoreDepthValues===!1})}else{let ve={antialias:b.antialias,alpha:!0,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(s,t,ve),s.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),S=new Ht(h.framebufferWidth,h.framebufferHeight,{format:un,type:Yt,colorSpace:e.outputColorSpace,stencilBuffer:b.stencil,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1,storeMultisampledDepthBuffer:h.ignoreDepthValues===!1,storeMultisampledStencilBuffer:h.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await s.requestReferenceSpace(a),De.setContext(s),De.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};function te(Y){for(let me=0;me<Y.removed.length;me++){let ve=Y.removed[
Line truncated
|
||||||
>${e}
|
>${e}
|
||||||
<input type="number" .value=${String(t)} step=${s.step??.5} min=${s.min??Qe} max=${s.max??Qe} @change=${r=>{let o=Number(r.target.value);Number.isFinite(o)&&n(o)}} />
|
<input type="number" .value=${String(t)} step=${s.step??.5} min=${s.min??Qe} max=${s.max??Qe} @change=${r=>{let o=Number(r.target.value);Number.isFinite(o)&&n(o)}} />
|
||||||
</label>`}text(e,t,n,s={}){return qe`<label class="field wide" title=${s.hint??Qe}
|
</label>`}text(e,t,n,s={}){return qe`<label class="field wide" title=${s.hint??Qe}
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,7 @@
|
|||||||
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
||||||
var m={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};var M=globalThis,N=M.ShadowRoot&&(M.ShadyCSS===void 0||M.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U=Symbol(),pe=new WeakMap,R=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==U)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(N&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=pe.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pe.set(t,e))}return e}toString(){return this.cssText}},fe=i=>new R(typeof i=="string"?i:i+"",void 0,U),j=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,r,o)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1],i[0]);return new R(t,i,U)},ge=(i,e)=>{if(N)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),r=M.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=t.cssText,i.appendChild(n)}},q=N?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return fe(t)})(i):i;var{is:Ge,defineProperty:Oe,getOwnPropertyDescriptor:Ie,getOwnPropertyNames:Ze,getOwnPropertySymbols:Ve,getPrototypeOf:Ue}=Object,C=globalThis,be=C.trustedTypes,je=be?be.emptyScript:"",qe=C.reactiveElementPolyfillSupport,F=(i,e)=>i,J={toAttribute(i,e){switch(e){case Boolean:i=i?je:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ke=(i,e)=>!Ge(i,e),we={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ke};Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;var b=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=we){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){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Oe(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:o}=Ie(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:r,set(a){let s=r?.call(this);o?.call(this,a),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??we}static _$Ei(){if(this.hasOwnProperty(F("elementProperties")))return;let e=Ue(this);e.finalize(),e.l!==void 0&&(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"))){let t=this.properties,n=[...Ze(t),...Ve(t)];for(let r of n)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,r]of t)this.elementProperties.set(n,r)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let r=this._$Eu(t,n);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let r of n)t.unshift(q(r))}else e!==void 0&&t.push(q(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ge(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.Line truncated
|
var m={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};var M=globalThis,N=M.ShadowRoot&&(M.ShadyCSS===void 0||M.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U=Symbol(),pe=new WeakMap,R=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==U)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(N&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=pe.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&pe.set(t,e))}return e}toString(){return this.cssText}},fe=i=>new R(typeof i=="string"?i:i+"",void 0,U),j=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,r,o)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1],i[0]);return new R(t,i,U)},ge=(i,e)=>{if(N)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),r=M.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=t.cssText,i.appendChild(n)}},q=N?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return fe(t)})(i):i;var{is:Ge,defineProperty:Oe,getOwnPropertyDescriptor:Ie,getOwnPropertyNames:Ze,getOwnPropertySymbols:Ve,getPrototypeOf:Ue}=Object,C=globalThis,be=C.trustedTypes,je=be?be.emptyScript:"",qe=C.reactiveElementPolyfillSupport,x=(i,e)=>i,J={toAttribute(i,e){switch(e){case Boolean:i=i?je:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},ke=(i,e)=>!Ge(i,e),we={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ke};Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;var b=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=we){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){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Oe(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:o}=Ie(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:r,set(a){let s=r?.call(this);o?.call(this,a),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??we}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;let e=Ue(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){let t=this.properties,n=[...Ze(t),...Ve(t)];for(let r of n)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,r]of t)this.elementProperties.set(n,r)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let r=this._$Eu(t,n);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let r of n)t.unshift(q(r))}else e!==void 0&&t.push(q(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ge(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.Line truncated
|
||||||
\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Se=/-->/g,Ae=/>/g,S=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
\f\r]`,F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Se=/-->/g,Ae=/>/g,S=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,ze=/"/g,Fe=/^(?:script|style|textarea|title)$/i,oe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),l=oe(1),ut=oe(2),mt=oe(3),z=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ee=new WeakMap,A=D.createTreeWalker(D,129);function xe(i,e){if(!ie(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ye!==void 0?ye.createHTML(e):e}var Ye=(i,e)=>{let t=i.length-1,n=[],r,o=e===2?"<svg>":e===3?"<math>":"",a=x;for(let s=0;s<t;s++){let h=i[s],u,p,_=-1,g=0;for(;g<h.length&&(a.lastIndex=g,p=a.exec(h),p!==null);)g=a.lastIndex,a===x?p[1]==="!--"?a=Se:p[1]!==void 0?a=Ae:p[2]!==void 0?(Fe.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=S):p[3]!==void 0&&(a=S):a===S?p[0]===">"?(a=r??x,_=-1):p[1]===void 0?_=-2:(_=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?S:p[3]==='"'?ze:De):a===ze||a===De?a=S:a===Se||a===Ae?a=x:(a=S,r=void 0);let k=a===S&&i[s+1].startsWith("/>")?" ":"";o+=a===x?h+Je:_>=0?(n.push(u),h.slice(0,_)+Te+h.slice(_)+v+k):h+v+(_===-2?s:k)}return[xe(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},B=class i{constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let o=0,a=0,s=e.length-1,h=this.parts,[u,p]=Ye(e,t);if(this.el=i.createElement(u,n),A.currentNode=this.el.content,t===2||t===3){let _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(r=A.nextNode())!==null&&h.length<s;){if(r.nodeType===1){if(r.hasAttributes())for(let _ of r.getAttributeNames())if(_.endsWith(Te)){let g=p[a++],k=r.getAttribute(_).split(v),$=/([.?@])?(.*)/.exec(g);h.push({type:1,index:o,name:$[2],strings:k,ctor:$[1]==="."?Q:$[1]==="?"?ee:$[1]==="@"?te:T}),r.removeAttribute(_)}else _.startsWith(v)&&(h.push({type:6,index:o}),r.removeAttribute(_));if(Fe.test(r.tagName)){let _=r.textContent.split(v),g=_.length-1;if(g>0){r.textContent=K?K.emptyScript:"";for(let k=0;k<g;k++)r.append(_[k],H()),A.nextNode(),h.push({type:2,index:++o});r.append(_[g],H())}}}else if(r.nodeType===8)if(r.data===Re)h.push({type:2,index:o});else{let _=-1;for(;(_=r.data.indexOf(v,_+1))!==-1;)h.push({type:7,index:o}),_+=v.length-1}o++}}static createElement(e,t){let n=D.createElement("template");return n.innerHTML=e,n}};function E(i,e,t=i,n){if(e===z)return e;let r=n!==void 0?t._$Co?.[n]:t._$Cl,o=W(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(i),r._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=r:t._$Cl=r),r!==void 0&&(e=E(i,r._$AS(i,e.values),r,n)),e}var Y=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??D).importNode(t,!0);A.currentNode=r;let o=A.nextNode(),a=0,s=0,h=n[0];for(;h!==void 0;){if(a===h.index){let u;h.type===2?u=new P(o,o.nextSibling,this,e):h.type===1?u=new h.ctor(o,h.name,h.strings,this,e):h.type===6&&(u=new ne(o,this,e)),this._$AV.push(u),h=n[++s]}a!==h?.index&&(o=A.nextNode(),a++)}return A.currentNode=D,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},P=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=E(this,e,t),W(e)?e===d||e==null||e===""?(this._$AH!==d&&this._$AR(),this._$AH=d):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xe(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==d&&W(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=B.createElement(xe(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let o=new Y(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Ee.get(e.strings);return t===void 0&&Ee.set(e.strings,t=new B(e)),t}k(e){ie(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,r=0;for(let o of e)r===t.length?t.push(n=new i(this.O(H()),this.O(H()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=ve(e).nextSibling;ve(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):thLine truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,ze=/"/g,xe=/^(?:script|style|textarea|title)$/i,oe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),l=oe(1),ut=oe(2),mt=oe(3),z=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ee=new WeakMap,A=D.createTreeWalker(D,129);function Fe(i,e){if(!ie(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ye!==void 0?ye.createHTML(e):e}var Ye=(i,e)=>{let t=i.length-1,n=[],r,o=e===2?"<svg>":e===3?"<math>":"",a=F;for(let s=0;s<t;s++){let h=i[s],u,p,_=-1,g=0;for(;g<h.length&&(a.lastIndex=g,p=a.exec(h),p!==null);)g=a.lastIndex,a===F?p[1]==="!--"?a=Se:p[1]!==void 0?a=Ae:p[2]!==void 0?(xe.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=S):p[3]!==void 0&&(a=S):a===S?p[0]===">"?(a=r??F,_=-1):p[1]===void 0?_=-2:(_=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?S:p[3]==='"'?ze:De):a===ze||a===De?a=S:a===Se||a===Ae?a=F:(a=S,r=void 0);let k=a===S&&i[s+1].startsWith("/>")?" ":"";o+=a===F?h+Je:_>=0?(n.push(u),h.slice(0,_)+Te+h.slice(_)+v+k):h+v+(_===-2?s:k)}return[Fe(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},B=class i{constructor({strings:e,_$litType$:t},n){let r;this.parts=[];let o=0,a=0,s=e.length-1,h=this.parts,[u,p]=Ye(e,t);if(this.el=i.createElement(u,n),A.currentNode=this.el.content,t===2||t===3){let _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(r=A.nextNode())!==null&&h.length<s;){if(r.nodeType===1){if(r.hasAttributes())for(let _ of r.getAttributeNames())if(_.endsWith(Te)){let g=p[a++],k=r.getAttribute(_).split(v),$=/([.?@])?(.*)/.exec(g);h.push({type:1,index:o,name:$[2],strings:k,ctor:$[1]==="."?Q:$[1]==="?"?ee:$[1]==="@"?te:T}),r.removeAttribute(_)}else _.startsWith(v)&&(h.push({type:6,index:o}),r.removeAttribute(_));if(xe.test(r.tagName)){let _=r.textContent.split(v),g=_.length-1;if(g>0){r.textContent=K?K.emptyScript:"";for(let k=0;k<g;k++)r.append(_[k],H()),A.nextNode(),h.push({type:2,index:++o});r.append(_[g],H())}}}else if(r.nodeType===8)if(r.data===Re)h.push({type:2,index:o});else{let _=-1;for(;(_=r.data.indexOf(v,_+1))!==-1;)h.push({type:7,index:o}),_+=v.length-1}o++}}static createElement(e,t){let n=D.createElement("template");return n.innerHTML=e,n}};function E(i,e,t=i,n){if(e===z)return e;let r=n!==void 0?t._$Co?.[n]:t._$Cl,o=W(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(i),r._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=r:t._$Cl=r),r!==void 0&&(e=E(i,r._$AS(i,e.values),r,n)),e}var Y=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??D).importNode(t,!0);A.currentNode=r;let o=A.nextNode(),a=0,s=0,h=n[0];for(;h!==void 0;){if(a===h.index){let u;h.type===2?u=new P(o,o.nextSibling,this,e):h.type===1?u=new h.ctor(o,h.name,h.strings,this,e):h.type===6&&(u=new ne(o,this,e)),this._$AV.push(u),h=n[++s]}a!==h?.index&&(o=A.nextNode(),a++)}return A.currentNode=D,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},P=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=E(this,e,t),W(e)?e===d||e==null||e===""?(this._$AH!==d&&this._$AR(),this._$AH=d):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xe(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==d&&W(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=B.createElement(Fe(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let o=new Y(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Ee.get(e.strings);return t===void 0&&Ee.set(e.strings,t=new B(e)),t}k(e){ie(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,r=0;for(let o of e)r===t.length?t.push(n=new i(this.O(H()),this.O(H()),this,this.options)):n=t[r],n._$AI(o),r++;r<t.length&&(this._$AR(n&&n._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=ve(e).nextSibling;ve(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):thLine truncated
|
||||||
<input type="checkbox" .checked=${e} @change=${o=>r(rt(o))} />
|
<input type="checkbox" .checked=${e} @change=${o=>r(rt(o))} />
|
||||||
<span>${i.t(t)}${n?l`<small>${i.t(n)}</small>`:d}</span>
|
<span>${i.t(t)}${n?l`<small>${i.t(n)}</small>`:d}</span>
|
||||||
</label>`}var c=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r)),le=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r||void 0));function w(i,e,t,n,r){return l`<label class="field"
|
</label>`}var c=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r)),le=(i,e,t,n)=>f(i,i.value[e],t,n,r=>i.set(e,r||void 0));function w(i,e,t,n,r){return l`<label class="field"
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
|
||||||
var w={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=n=>n===void 0?n:JSON.parse(JSON.stringify(n)));var jn=globalThis,qn=jn.ShadowRoot&&(jn.ShadyCSS===void 0||jn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_i=Symbol(),gs=new WeakMap,rn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==_i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(qn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=gs.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&gs.set(t,e))}return e}toString(){return this.cssText}},_s=n=>new rn(typeof n=="string"?n:n+"",void 0,_i),J=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((r,i,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new rn(t,n,_i)},bs=(n,e)=>{if(qn)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=jn.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},bi=qn?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return _s(t)})(n):n;var{is:yd,defineProperty:vd,getOwnPropertyDescriptor:wd,getOwnPropertyNames:xd,getOwnPropertySymbols:kd,getPrototypeOf:Sd}=Object,Zn=globalThis,ys=Zn.trustedTypes,$d=ys?ys.emptyScript:"",Md=Zn.reactiveElementPolyfillSupport,on=(n,e)=>n,yi={toAttribute(n,e){switch(e){case Boolean:n=n?$d:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ws=(n,e)=>!yd(n,e),vs={attribute:!0,type:String,converter:yi,reflect:!1,useDefault:!1,hasChanged:ws};Symbol.metadata??=Symbol("metadata"),Zn.litPropertyMetadata??=new WeakMap;var Le=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=vs){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){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&vd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=wd(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:i,set(s){let a=i?.call(this);o?.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vs}static _$Ei(){if(this.hasOwnProperty(on("elementProperties")))return;let e=Sd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(on("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(on("properties"))){let t=this.properties,r=[...xd(t),...kd(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(bi(i))}else e!==void 0&&t.push(bi(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadLine truncated
|
var w={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=n=>n===void 0?n:JSON.parse(JSON.stringify(n)));var jn=globalThis,qn=jn.ShadowRoot&&(jn.ShadyCSS===void 0||jn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_i=Symbol(),gs=new WeakMap,rn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==_i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(qn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=gs.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&gs.set(t,e))}return e}toString(){return this.cssText}},_s=n=>new rn(typeof n=="string"?n:n+"",void 0,_i),J=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((r,i,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new rn(t,n,_i)},bs=(n,e)=>{if(qn)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=jn.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},bi=qn?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return _s(t)})(n):n;var{is:yd,defineProperty:vd,getOwnPropertyDescriptor:wd,getOwnPropertyNames:xd,getOwnPropertySymbols:kd,getPrototypeOf:Sd}=Object,Zn=globalThis,ys=Zn.trustedTypes,$d=ys?ys.emptyScript:"",Md=Zn.reactiveElementPolyfillSupport,on=(n,e)=>n,yi={toAttribute(n,e){switch(e){case Boolean:n=n?$d:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ws=(n,e)=>!yd(n,e),vs={attribute:!0,type:String,converter:yi,reflect:!1,useDefault:!1,hasChanged:ws};Symbol.metadata??=Symbol("metadata"),Zn.litPropertyMetadata??=new WeakMap;var Le=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=vs){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){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&vd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=wd(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:i,set(s){let a=i?.call(this);o?.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vs}static _$Ei(){if(this.hasOwnProperty(on("elementProperties")))return;let e=Sd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(on("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(on("properties"))){let t=this.properties,r=[...xd(t),...kd(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(bi(i))}else e!==void 0&&t.push(bi(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?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),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadLine truncated
|
||||||
\f\r]`,sn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ss=/-->/g,$s=/>/g,ut=RegExp(`>|${vi}(?:([^\\s"'>=/]+)(${vi}*=${vi}*(?:[^
|
\f\r]`,sn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ss=/-->/g,$s=/>/g,ut=RegExp(`>|${vi}(?:([^\\s"'>=/]+)(${vi}*=${vi}*(?:[^
|
||||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,As=/"/g,Ts=/^(?:script|style|textarea|title)$/i,Ei=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Ei(1),ne=Ei(2),kg=Ei(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Es=new WeakMap,dt=ht.createTreeWalker(ht,129);function Fs(n,e){if(!Ai(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ks!==void 0?ks.createHTML(e):e}var Rd=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=sn;for(let a=0;a<t;a++){let l=n[a],c,u,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,u=s.exec(l),u!==null);)m=s.lastIndex,s===sn?u[1]==="!--"?s=Ss:u[1]!==void 0?s=$s:u[2]!==void 0?(Ts.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=ut):u[3]!==void 0&&(s=ut):s===ut?u[0]===">"?(s=i??sn,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ut:u[3]==='"'?As:Ms):s===As||s===Ms?s=ut:s===Ss||s===$s?s=sn:(s=ut,i=void 0);let d=s===ut&&n[a+1].startsWith("/>")?" ":"";o+=s===sn?l+Ad:h>=0?(r.push(c),l.slice(0,h)+Rs+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Fs(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},cn=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[c,u]=Rd(e,t);if(this.el=n.createElement(c,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(Rs)){let m=u[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?xi:g[1]==="?"?ki:g[1]==="@"?Si:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(Ts.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Yn?Yn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],an()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],an())}}}else if(i.nodeType===8)if(i.data===zs)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=ln(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var wi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new un(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new $i(o,this,e)),this._$AV.push(c),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),ln(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ed(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&ln(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=cn.createElement(Fs(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new wi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Es.get(e.strings);return t===void 0&&Es.set(e.strings,t=new cn(e)),t}k(e){Ai(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(an()),this.O(an()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=xs(e).nextSibling;xs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,As=/"/g,Ts=/^(?:script|style|textarea|title)$/i,Ri=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Ri(1),ne=Ri(2),kg=Ri(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Rs=new WeakMap,dt=ht.createTreeWalker(ht,129);function Fs(n,e){if(!Ai(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ks!==void 0?ks.createHTML(e):e}var Ed=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=sn;for(let a=0;a<t;a++){let l=n[a],c,u,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,u=s.exec(l),u!==null);)m=s.lastIndex,s===sn?u[1]==="!--"?s=Ss:u[1]!==void 0?s=$s:u[2]!==void 0?(Ts.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=ut):u[3]!==void 0&&(s=ut):s===ut?u[0]===">"?(s=i??sn,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ut:u[3]==='"'?As:Ms):s===As||s===Ms?s=ut:s===Ss||s===$s?s=sn:(s=ut,i=void 0);let d=s===ut&&n[a+1].startsWith("/>")?" ":"";o+=s===sn?l+Ad:h>=0?(r.push(c),l.slice(0,h)+Es+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Fs(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},cn=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[c,u]=Ed(e,t);if(this.el=n.createElement(c,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(Es)){let m=u[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?xi:g[1]==="?"?ki:g[1]==="@"?Si:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(Ts.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Yn?Yn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],an()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],an())}}}else if(i.nodeType===8)if(i.data===zs)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=ln(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var wi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new un(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new $i(o,this,e)),this._$AV.push(c),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),ln(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Rd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&ln(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=cn.createElement(Fs(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new wi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Rs.get(e.strings);return t===void 0&&Rs.set(e.strings,t=new cn(e)),t}k(e){Ai(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(an()),this.O(an()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=xs(e).nextSibling;xs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
|
||||||
|
|
||||||
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
|
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
|
||||||
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p
Line truncated
|
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p
Line truncated
|
||||||
|
|
||||||
A plugin runs with the same rights as NextFloor in your browser. The file has been reviewed and its content is fixed:
|
A plugin runs with the same rights as NextFloor in your browser. The file has been reviewed and its content is fixed:
|
||||||
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side"
Line truncated
|
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side"
Line truncated
|
||||||
:host {
|
:host {
|
||||||
--nf-text: var(--primary-text-color, #e1e1e1);
|
--nf-text: var(--primary-text-color, #e1e1e1);
|
||||||
--nf-muted: var(--secondary-text-color, #9b9b9b);
|
--nf-muted: var(--secondary-text-color, #9b9b9b);
|
||||||
@@ -240,7 +240,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
|
|||||||
.point time { font-variant-numeric:tabular-nums; }
|
.point time { font-variant-numeric:tabular-nums; }
|
||||||
.dot { width:8px; height:8px; border-radius:50%; }
|
.dot { width:8px; height:8px; border-radius:50%; }
|
||||||
.error { color:var(--nf-danger,#ff6b7a); font-size:12px; }
|
.error { color:var(--nf-danger,#ff6b7a); font-size:12px; }
|
||||||
`]};customElements.get("nf-room-hvac")||customElements.define("nf-room-hvac",co);var dm=new Set(["on","home","open","true","active","playing","heat","heating"]);function Ue(n,e){let t=e.show_when;if(!t?.entity||!n)return!0;let r=n.states[t.entity];if(!r||C(r))return!0;let i=String(r.state).toLowerCase(),o=(t.state??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean),s=o.length?o.includes(i):dm.has(i)||Number.isFinite(Number(i))&&Number(i)>0;return t.invert?!s:s}function uo(n,e){let t=[];for(let r of e.floors)for(let i of r.furniture)Ue(n,i)||t.push(i.id);return t.sort()}function bl(n,e){if(!e.length)return n;let t=new Set(e);return{...n,floors:n.floors.map(r=>r.furniture.some(i=>t.has(i.id))?{...r,furniture:r.furniture.filter(i=>!t.has(i.id))}:r)}}function ae(n,e){if(!Ci(e))return $(n,`furn_${e}`);let t=X(e);return t?hm(t,e,n?.language??navigator.language):$(n,"pack_missing_item")}function hm(n,e,t){return n.name[t.split("-")[0]]??Xa(t,e)??ia(n,t)}var ee=(n,e)=>[n[0]-e[0],n[1]-e[1]],Pe=(n,e)=>[n[0]+e[0],n[1]+e[1]],Se=(n,e)=>[n[0]*e,n[1]*e],ue=(n,e)=>n[0]*e[0]+n[1]*e[1],je=(n,e)=>n[0]*e[1]-n[1]*e[0],qe=n=>Math.hypot(n[0],n[1]),$e=n=>{let e=qe(n)||1;return[n[0]/e,n[1]/e]},ho=n=>[-n[1],n[0]],mo=n=>[n[1],-n[0]];function yl(n){let e=n.heightEnd!==void 0;return{...n,a:n.b,b:n.a,left:n.right,right:n.left,roomLeft:n.roomRight,roomRight:n.roomLeft,height:e?n.heightEnd:n.height,heightEnd:e?n.height:void 0}}function mm(n,e){let t=n.map(r=>({...r}));for(let r of e){let i=t.find(o=>o.room_id===r.room_id&&o.edge===r.edge&&(Math.abs(o.t1-r.t0)<1e-6||Math.abs(r.t1-o.t0)<1e-6));i?(i.t0=Math.min(i.t0,r.t0),i.t1=Math.max(i.t1,r.t1)):t.push({...r})}return t}function pm(n,e,t){if(n.a===e.b)return!1;let r=$e(ee(t[n.b],t[n.a])),i=$e(ee(t[e.b],t[e.a]));return Math.abs(je(r,i))>1e-6||ue(r,i)<=0||n.free||e.free||n.heightEnd!==void 0||e.heightEnd!==void 0?!1:n.height===e.height&&n.exterior===e.exterior&&n.roomLeft===e.roomLeft&&n.roomRight===e.roomRight&&Math.abs(n.left-e.left)<=1e-9&&Math.abs(n.right-e.right)<=1e-9}function vl(n,e,t=new Set){let r=n.slice();for(;;){let i=new Map;r.forEach((s,a)=>{for(let l of[s.a,s.b])i.set(l,[...i.get(l)??[],a])});let o=null;for(let[s,a]of i){if(a.length!==2||t.has(s))continue;let l=r[a[0]].b===s?r[a[0]]:yl(r[a[0]]),c=r[a[1]].a===s?r[a[1]]:yl(r[a[1]]);if(!pm(l,c,e))continue;let u={...l,b:c.b,sources:mm(l.sources,c.sources)};o=[...r.filter((h,m)=>m!==a[0]&&m!==a[1]),u];break}if(!o)return r;r=o}}function wl(n,e){let t=new Map;n.forEach((i,o)=>{let s=$e(ee(e[i.b],e[i.a])),a=[[i.a,{key:`${o}:a`,d:s,left:i.left,right:i.right,angle:Math.atan2(s[1],s[0])}],[i.b,{key:`${o}:b`,d:Se(s,-1),left:i.right,right:i.left,angle:Math.atan2(-s[1],-s[0])}]];for(let[l,c]of a)t.set(l,[...t.get(l)??[],c])});let r=new Map;for(let[i,o]of t){let s=e[i];o.sort((l,c)=>l.angle-c.angle);for(let l of o)r.set(l.key,{left:Pe(s,Se(ho(l.d),l.left)),right:Pe(s,Se(mo(l.d),l.right))});if(o.length<2)continue;let a=4*Math.max(...o.map(l=>Math.max(l.left,l.right)))+1e-9;o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=Pe(s,Se(ho(l.d),l.left)),m=Pe(s,Se(mo(u.d),u.right)),d=je(l.d,u.d);if(Math.abs(d)<1e-4)return;let g=Pe(h,Se(l.d,je(ee(m,h),u.d)/d));qe(ee(g,s))>a||(r.get(l.key).left=g,r.get(u.key).right=g)})}return r}function xl(n,e){let t=n.filter((r,i)=>qe(ee(r,n[(i+1)%n.length]))>e);for(;;){if(t.length<=3)return t;let r=t.findIndex((i,o)=>{let s=t[(o+t.length-1)%t.length],a=t[(o+1)%t.length],[l,c]=[ee(i,s),ee(a,i)];return Math.abs(je($e(l),$e(c)))<1e-7&&ue(l,c)>0});if(r===-1)return t;t=t.filter((i,o)=>o!==r)}}function fm(n){let e=[];return{points:e,idOf(t){let r=e.findIndex(i=>Math.abs(i[0]-t[0])<=n&&Math.abs(i[1]-t[1])<=n);return r>=0?r:(e.push([t[0],t[1]]),e.length-1)}}}function gm(n,e){let t=[];for(let r of n){let i=r.points;if(i.length<3||Math.abs(gt(i))<1e-6)continue;let o=gt(i)>0,s=i.map(a=>e.idOf(a));s.forEach((a,l)=>{let c=s[(l+1)%s.length];a!==c&&t.push(o?{u:a,v:c,room:r.id,edge:l,forward:!0}:{u:c,v:a,room:r.id,edge:l,forward:!1})})}return t}function _m(n,e,t){let r=[];for(let i of n){let[o,s]=[e[i.u],e[i.v]],a=ee(s,o),l=qe(a),c=Se(a,1/l),u=e.map((m,d)=>({id:d,rel:ee(m,o)})).filter(({id:m,rel:d})=>m!==i.u&&m!==i.v&&ue(d,c)>t&&ue(d,c)<l-t&&Math.abs(je(c,d))<=t).map(({id:m,rel:d})=>({t:ue(d,c),id:m})).sort((m,d)=>m.t-d.t),h=[{t:0,id:i.u},...u,{t:l,id:i.v}];for(let m=0;m+1<h.length;m++){let[d,g]=[h[m],h[m+1]];r.push({u:d.id,v:g.id,room:i.room,edge:i.edge,t0:i.forward?d.t:l-g.t,t1:i.forward?g.t:l-d.t,forward:i.forward})}}return r}var kl=n=>({room_id:n.room,edge:n.edge,t0:n.t0,t1:n.t1});function bm(n,e){let t=new Map(n.map(a=>[a.id,a])),r=new Map;for(let a of e){let l=`${a.room}:${a.edge}`;r.set(l,[...r.get(l)??[],a.t0].sort((c,u)=>c-u))}let i=a=>{let l=t.get(a.room)?.wall_heights?.[a.edge];return Array.isArray(l)?l[(r.get(`${a.room}:${a.edge}`)??[]).indexOf(a.t0)]??null:l},o=a=>{let l=t.get(a.room),[c,u]=[l?.wall_heights?.[a.edge],l?.wall_slopes?.[a.edge]];if(!l||typeof c!="number"||typeof u!="number"||c<=0||u<=0)return null;
Line truncated
|
`]};customElements.get("nf-room-hvac")||customElements.define("nf-room-hvac",co);var dm=new Set(["on","home","open","true","active","playing","heat","heating"]);function Ue(n,e){let t=e.show_when;if(!t?.entity||!n)return!0;let r=n.states[t.entity];if(!r||C(r))return!0;let i=String(r.state).toLowerCase(),o=(t.state??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean),s=o.length?o.includes(i):dm.has(i)||Number.isFinite(Number(i))&&Number(i)>0;return t.invert?!s:s}function uo(n,e){let t=[];for(let r of e.floors)for(let i of r.furniture)Ue(n,i)||t.push(i.id);return t.sort()}function bl(n,e){if(!e.length)return n;let t=new Set(e);return{...n,floors:n.floors.map(r=>r.furniture.some(i=>t.has(i.id))?{...r,furniture:r.furniture.filter(i=>!t.has(i.id))}:r)}}function ae(n,e){if(!Ci(e))return $(n,`furn_${e}`);let t=X(e);return t?hm(t,e,n?.language??navigator.language):$(n,"pack_missing_item")}function hm(n,e,t){return n.name[t.split("-")[0]]??Xa(t,e)??ia(n,t)}var ee=(n,e)=>[n[0]-e[0],n[1]-e[1]],Pe=(n,e)=>[n[0]+e[0],n[1]+e[1]],Se=(n,e)=>[n[0]*e,n[1]*e],ue=(n,e)=>n[0]*e[0]+n[1]*e[1],je=(n,e)=>n[0]*e[1]-n[1]*e[0],qe=n=>Math.hypot(n[0],n[1]),$e=n=>{let e=qe(n)||1;return[n[0]/e,n[1]/e]},ho=n=>[-n[1],n[0]],mo=n=>[n[1],-n[0]];function yl(n){let e=n.heightEnd!==void 0;return{...n,a:n.b,b:n.a,left:n.right,right:n.left,roomLeft:n.roomRight,roomRight:n.roomLeft,height:e?n.heightEnd:n.height,heightEnd:e?n.height:void 0}}function mm(n,e){let t=n.map(r=>({...r}));for(let r of e){let i=t.find(o=>o.room_id===r.room_id&&o.edge===r.edge&&(Math.abs(o.t1-r.t0)<1e-6||Math.abs(r.t1-o.t0)<1e-6));i?(i.t0=Math.min(i.t0,r.t0),i.t1=Math.max(i.t1,r.t1)):t.push({...r})}return t}function pm(n,e,t){if(n.a===e.b)return!1;let r=$e(ee(t[n.b],t[n.a])),i=$e(ee(t[e.b],t[e.a]));return Math.abs(je(r,i))>1e-6||ue(r,i)<=0||n.free||e.free||n.heightEnd!==void 0||e.heightEnd!==void 0?!1:n.height===e.height&&n.exterior===e.exterior&&n.roomLeft===e.roomLeft&&n.roomRight===e.roomRight&&Math.abs(n.left-e.left)<=1e-9&&Math.abs(n.right-e.right)<=1e-9}function vl(n,e,t=new Set){let r=n.slice();for(;;){let i=new Map;r.forEach((s,a)=>{for(let l of[s.a,s.b])i.set(l,[...i.get(l)??[],a])});let o=null;for(let[s,a]of i){if(a.length!==2||t.has(s))continue;let l=r[a[0]].b===s?r[a[0]]:yl(r[a[0]]),c=r[a[1]].a===s?r[a[1]]:yl(r[a[1]]);if(!pm(l,c,e))continue;let u={...l,b:c.b,sources:mm(l.sources,c.sources)};o=[...r.filter((h,m)=>m!==a[0]&&m!==a[1]),u];break}if(!o)return r;r=o}}function wl(n,e){let t=new Map;n.forEach((i,o)=>{let s=$e(ee(e[i.b],e[i.a])),a=[[i.a,{key:`${o}:a`,d:s,left:i.left,right:i.right,angle:Math.atan2(s[1],s[0])}],[i.b,{key:`${o}:b`,d:Se(s,-1),left:i.right,right:i.left,angle:Math.atan2(-s[1],-s[0])}]];for(let[l,c]of a)t.set(l,[...t.get(l)??[],c])});let r=new Map;for(let[i,o]of t){let s=e[i];o.sort((l,c)=>l.angle-c.angle);for(let l of o)r.set(l.key,{left:Pe(s,Se(ho(l.d),l.left)),right:Pe(s,Se(mo(l.d),l.right))});if(o.length<2)continue;let a=4*Math.max(...o.map(l=>Math.max(l.left,l.right)))+1e-9;o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=Pe(s,Se(ho(l.d),l.left)),m=Pe(s,Se(mo(u.d),u.right)),d=je(l.d,u.d);if(Math.abs(d)<1e-4)return;let g=Pe(h,Se(l.d,je(ee(m,h),u.d)/d));qe(ee(g,s))>a||(r.get(l.key).left=g,r.get(u.key).right=g)})}return r}function xl(n,e){let t=n.filter((r,i)=>qe(ee(r,n[(i+1)%n.length]))>e);for(;;){if(t.length<=3)return t;let r=t.findIndex((i,o)=>{let s=t[(o+t.length-1)%t.length],a=t[(o+1)%t.length],[l,c]=[ee(i,s),ee(a,i)];return Math.abs(je($e(l),$e(c)))<1e-7&&ue(l,c)>0});if(r===-1)return t;t=t.filter((i,o)=>o!==r)}}function fm(n){let e=[];return{points:e,idOf(t){let r=e.findIndex(i=>Math.abs(i[0]-t[0])<=n&&Math.abs(i[1]-t[1])<=n);return r>=0?r:(e.push([t[0],t[1]]),e.length-1)}}}function gm(n,e){let t=[];for(let r of n){let i=r.points;if(i.length<3||Math.abs(gt(i))<1e-6)continue;let o=gt(i)>0,s=i.map(a=>e.idOf(a));s.forEach((a,l)=>{let c=s[(l+1)%s.length];a!==c&&t.push(o?{u:a,v:c,room:r.id,edge:l,forward:!0}:{u:c,v:a,room:r.id,edge:l,forward:!1})})}return t}function _m(n,e,t){let r=[];for(let i of n){let[o,s]=[e[i.u],e[i.v]],a=ee(s,o),l=qe(a),c=Se(a,1/l),u=e.map((m,d)=>({id:d,rel:ee(m,o)})).filter(({id:m,rel:d})=>m!==i.u&&m!==i.v&&ue(d,c)>t&&ue(d,c)<l-t&&Math.abs(je(c,d))<=t).map(({id:m,rel:d})=>({t:ue(d,c),id:m})).sort((m,d)=>m.t-d.t),h=[{t:0,id:i.u},...u,{t:l,id:i.v}];for(let m=0;m+1<h.length;m++){let[d,g]=[h[m],h[m+1]];r.push({u:d.id,v:g.id,room:i.room,edge:i.edge,t0:i.forward?d.t:l-g.t,t1:i.forward?g.t:l-d.t,forward:i.forward})}}return r}var kl=n=>({room_id:n.room,edge:n.edge,t0:n.t0,t1:n.t1});function bm(n,e){let t=new Map(n.map(a=>[a.id,a])),r=new Map;for(let a of e){let l=`${a.room}:${a.edge}`;r.set(l,[...r.get(l)??[],a.t0].sort((c,u)=>c-u))}let i=a=>{let l=t.get(a.room)?.wall_heights?.[a.edge];return Array.isArray(l)?l[(r.get(`${a.room}:${a.edge}`)??[]).indexOf(a.t0)]??null:l},o=a=>{let l=t.get(a.room),[c,u]=[l?.wall_heights?.[a.edge],l?.wall_slopes?.[a.edge]];if(!l||typeof c!="number"||typeof u!="number"||c<=0||u<=0)return null;
Line truncated
|
||||||
<h4>${An[e]} ${Ie[e]}</h4>
|
<h4>${An[e]} ${Ie[e]}</h4>
|
||||||
${this.readings.filter(t=>t.kind===e).map(t=>p`<div class="reading" title=${`${t.manual?"Eigener Z\xE4hler":"Bereichsz\xE4hler"}${t.incomplete?" \xB7 Err: Mindestens ein Wert fehlt; angezeigt wird die Summe der verf\xFCgbaren Werte.":""}
|
${this.readings.filter(t=>t.kind===e).map(t=>p`<div class="reading" title=${`${t.manual?"Eigener Z\xE4hler":"Bereichsz\xE4hler"}${t.incomplete?" \xB7 Err: Mindestens ein Wert fehlt; angezeigt wird die Summe der verf\xFCgbaren Werte.":""}
|
||||||
${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states[r]?.attributes.friendly_name||r).join(`
|
${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states[r]?.attributes.friendly_name||r).join(`
|
||||||
@@ -256,9 +256,9 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
.reading span { color:var(--nf-muted,#aaa); }
|
.reading span { color:var(--nf-muted,#aaa); }
|
||||||
b { white-space:nowrap; font-variant-numeric:tabular-nums; }
|
b { white-space:nowrap; font-variant-numeric:tabular-nums; }
|
||||||
small { font-size:.85em; }
|
small { font-size:.85em; }
|
||||||
`};customElements.get("nf-utility-report")||customElements.define("nf-utility-report",vo);var xo=Math.PI/180,Kl=3,Gl=.1,wo=1/6,Ul=(n,e)=>[Math.sin((e+n)*xo),-Math.cos((e+n)*xo)],Im=["N","NE","E","SE","S","SW","W","NW"];function Cm(n,e,t){return jl(n,e,t).map(r=>r.normal)}function jl(n,e,t){let r=[];for(let i of n.openings){if(i.room_id!==e.id||i.type==="garage")continue;let o=Ml(i,n.rooms,n.walls??[]),s=o?El(t,i,o):null;if(!s||!s.wall.exterior)continue;let{wall:a}=s,l=Math.hypot(a.b[0]-a.a[0],a.b[1]-a.a[1]);if(l<1e-6)continue;let c=[-(a.b[1]-a.a[1])/l,(a.b[0]-a.a[0])/l],u=a.roomLeft===e.id?c:[-c[0],-c[1]];r.push({opening:i,normal:[-u[0],-u[1]]})}return r}function Nm(n,e){let t=((Math.atan2(n[0],-n[1])/xo-e)%360+360)%360;return Im[Math.round(t/45)%8]}var Bl=new WeakMap;function ql(n,e){let t=Bl.get(e);return t||(t=Lt(e.rooms,{exterior:n.settings.wall_exterior,interior:n.settings.wall_interior},e.walls??[]).walls,Bl.set(e,t)),t}var Vl=new WeakMap;function Kt(n,e,t,r,i=new Date){let o=`${t.id}|${i.toISOString().slice(0,10)}|${n.settings.north??0}|${r.latitude},${r.longitude},${r.zone??""}`,s=Vl.get(e);s||Vl.set(e,s=new Map);let a=s.get(o);if(a)return a;let l=Lm(n,e,t,r,i);return s.set(o,l),l}function Lm(n,e,t,r,i){let o=n.settings.north??0,s=Cm(e,t,ql(n,e)),a=[...new Set(s.map(c=>Nm(c,o)))];if(!s.length)return{hours:0,facing:a};let l=0;for(let c=wo/2;c<24;c+=wo){let u=ft(Et(c,r.zone,i),r.latitude,r.longitude);if(u.elevation<Kl)continue;let h=Ul(u.azimuth,o);s.some(m=>m[0]*h[0]+m[1]*h[1]>Gl)&&l++}return{hours:Math.round(l*wo*10)/10,facing:a}}function Zl(n,e,t,r,i=new Date().getFullYear()){return Array.from({length:12},(o,s)=>Kt(n,e,t,r,new Date(Date.UTC(i,s,15,12))).hours)}function Yl(n,e,t,r,i=new Date){let o=ft(i,r.latitude,r.longitude);if(o.elevation<Kl)return[];let s=Ul(o.azimuth,n.settings.north??0);return jl(e,t,ql(n,e)).filter(a=>a.normal[0]*s[0]+a.normal[1]*s[1]>Gl).map(a=>a.opening)}var Jl=n=>6.112*Math.exp(17.62*n/(243.12+n));function Gt(n,e,t=4){if(n===null||e===null)return null;let r=Math.min(100,e*Jl(n)/Jl(n-t));return Math.round(Math.min(100,Math.max(0,(r-65)/20*100)))}function Br(n,e,t){return t!==null&&t>=70?"mould":n!==null&&n>=1e3?"co2":e!==null&&e>=65?"humidity":null}function vt(n=new Date,e=50){let t=n.getMonth(),r=t>=4&&t<=8;return e<0?!r:r}function Vr(n,e,t,r=!1){let i=[];if(n!==null){let[s,a]=r?[22,26]:[20,23],l=n<s?s-n:n>a?n-a:0;i.push(Math.max(0,100-l*15))}if(e!==null){let s=e<40?40-e:e>60?e-60:0;i.push(Math.max(0,100-s*4))}if(t!==null&&i.push(Math.max(0,Math.min(100,100-(t-800)/600*100))),!i.length)return null;let o=i.reduce((s,a)=>s+a,0)/i.length;return Math.round(Math.min(o,Math.min(...i)+30))}var Om={temperature:{deviceClass:"temperature",unit:"\xB0C",stops:[[16,[.2,.45,1]],[20,[.15,.85,.75]],[22.5,[.95,.8,.3]],[26,[1,.28,.18]]]},humidity:{deviceClass:"humidity",unit:"%",stops:[[30,[.95,.6,.2]],[45,[.3,.88,.5]],[60,[.2,.78,1]],[75,[.32,.4,.98]]]},co2:{deviceClass:"carbon_dioxide",unit:"ppm",stops:[[450,[.3,.88,.5]],[800,[.98,.84,.3]],[1200,[1,.5,.2]],[1600,[.98,.25,.25]]]},mould:{deviceClass:"",unit:"%",stops:[[0,[.3,.88,.5]],[40,[.98,.84,.3]],[70,[1,.5,.2]],[100,[.75,.2,.55]]]},comfort:{deviceClass:"",unit:"",stops:[[0,[.98,.25,.25]],[40,[1,.5,.2]],[65,[.98,.84,.3]],[85,[.3,.88,.5]],[100,[.2,.8,.7]]]},power:{deviceClass:"power",unit:"W",stops:[[0,[.25,.4,.6]],[100,[.3,.88,.5]],[500,[.98,.84,.3]],[1500,[1,.5,.2]],[3e3,[.98,.25,.25]]]},sun:{deviceClass:"",unit:"h",stops:[[0,[.22,.3,.55]],[2,[.35,.6,.85]],[4,[.98,.84,.3]],[7,[1,.62,.2]],[10,[1,.42,.25]]]}},Wm={deviceClass:"temperature",unit:"\xB0C",stops:[[19,[.2,.45,1]],[22.5,[.15,.85,.75]],[25.5,[.95,.8,.3]],[29,[1,.28,.18]]]};function Kr(n,e=!1){return n==="temperature"&&e?Wm:Om[n]}var Bm=(n,e,t)=>[n[0]+(e[0]-n[0])*t,n[1]+(e[1]-n[1])*t,n[2]+(e[2]-n[2])*t];function Ql(n,e,t=!1){let{stops:r}=Kr(n,t),i=r.findIndex(([c])=>e<=c);if(i===-1)return r[r.length-1][1];if(i===0)return r[0][1];let[o,s]=r[i-1],[a,l]=r[i];return Bm(s,l,(e-o)/(a-o))}function ko(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(s=>s.rooms)??t.rooms).filter(s=>s.kind==="electricity"&&s.metric==="power");if(i.length)return i.find(s=>s.unit==="W")?.value??null;let o=null;for(let s of So(n,e,t,r)){let a=q(n.states[s]);a!==null&&(o=(o??0)+Math.max(0,a))}return o}function So(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(h=>h.rooms)??t.rooms).filter(h=>h.kind==="electricity"&&h.metric==="power");if(i.length)return i.filter(h=>h.unit==="W").flatMap(h=>h.sources);let{grid:o,solar:s,battery:a}=e.energy,l=new Set([o,s,a].filter(Boolean)),c=new Set,u=(h,m)=>r.points.length>=3&&H([h,m],r.points);for(let h of t.placements){let m=u(h.x,h.z)?ve(n,h.entity_id):null;m&&c.add(m)}for(let h of t.furniture){if(!u(h.x,h.z))continue;let m=h.power&&h.power!=="none"?h.power:h.entity&&h.entity!=="none"?ve(n,h.entity):null;m&&c.add(m);for(let d of h.gang_entities??[]){let g=d&&d!=="none"?ve(n,d):null;g&&c.add(g)}}return[...c].filter(h=>!l.has(h))}function Xl(n,e,t){let r=new Map;for(let i of e.floors)for(
Line truncated
|
`};customElements.get("nf-utility-report")||customElements.define("nf-utility-report",vo);var xo=Math.PI/180,Kl=3,Gl=.1,wo=1/6,Ul=(n,e)=>[Math.sin((e+n)*xo),-Math.cos((e+n)*xo)],Im=["N","NE","E","SE","S","SW","W","NW"];function Cm(n,e,t){return jl(n,e,t).map(r=>r.normal)}function jl(n,e,t){let r=[];for(let i of n.openings){if(i.room_id!==e.id||i.type==="garage")continue;let o=Ml(i,n.rooms,n.walls??[]),s=o?Rl(t,i,o):null;if(!s||!s.wall.exterior)continue;let{wall:a}=s,l=Math.hypot(a.b[0]-a.a[0],a.b[1]-a.a[1]);if(l<1e-6)continue;let c=[-(a.b[1]-a.a[1])/l,(a.b[0]-a.a[0])/l],u=a.roomLeft===e.id?c:[-c[0],-c[1]];r.push({opening:i,normal:[-u[0],-u[1]]})}return r}function Nm(n,e){let t=((Math.atan2(n[0],-n[1])/xo-e)%360+360)%360;return Im[Math.round(t/45)%8]}var Bl=new WeakMap;function ql(n,e){let t=Bl.get(e);return t||(t=Lt(e.rooms,{exterior:n.settings.wall_exterior,interior:n.settings.wall_interior},e.walls??[]).walls,Bl.set(e,t)),t}var Vl=new WeakMap;function Kt(n,e,t,r,i=new Date){let o=`${t.id}|${i.toISOString().slice(0,10)}|${n.settings.north??0}|${r.latitude},${r.longitude},${r.zone??""}`,s=Vl.get(e);s||Vl.set(e,s=new Map);let a=s.get(o);if(a)return a;let l=Lm(n,e,t,r,i);return s.set(o,l),l}function Lm(n,e,t,r,i){let o=n.settings.north??0,s=Cm(e,t,ql(n,e)),a=[...new Set(s.map(c=>Nm(c,o)))];if(!s.length)return{hours:0,facing:a};let l=0;for(let c=wo/2;c<24;c+=wo){let u=ft(Rt(c,r.zone,i),r.latitude,r.longitude);if(u.elevation<Kl)continue;let h=Ul(u.azimuth,o);s.some(m=>m[0]*h[0]+m[1]*h[1]>Gl)&&l++}return{hours:Math.round(l*wo*10)/10,facing:a}}function Zl(n,e,t,r,i=new Date().getFullYear()){return Array.from({length:12},(o,s)=>Kt(n,e,t,r,new Date(Date.UTC(i,s,15,12))).hours)}function Yl(n,e,t,r,i=new Date){let o=ft(i,r.latitude,r.longitude);if(o.elevation<Kl)return[];let s=Ul(o.azimuth,n.settings.north??0);return jl(e,t,ql(n,e)).filter(a=>a.normal[0]*s[0]+a.normal[1]*s[1]>Gl).map(a=>a.opening)}var Jl=n=>6.112*Math.exp(17.62*n/(243.12+n));function Gt(n,e,t=4){if(n===null||e===null)return null;let r=Math.min(100,e*Jl(n)/Jl(n-t));return Math.round(Math.min(100,Math.max(0,(r-65)/20*100)))}function Br(n,e,t){return t!==null&&t>=70?"mould":n!==null&&n>=1e3?"co2":e!==null&&e>=65?"humidity":null}function vt(n=new Date,e=50){let t=n.getMonth(),r=t>=4&&t<=8;return e<0?!r:r}function Vr(n,e,t,r=!1){let i=[];if(n!==null){let[s,a]=r?[22,26]:[20,23],l=n<s?s-n:n>a?n-a:0;i.push(Math.max(0,100-l*15))}if(e!==null){let s=e<40?40-e:e>60?e-60:0;i.push(Math.max(0,100-s*4))}if(t!==null&&i.push(Math.max(0,Math.min(100,100-(t-800)/600*100))),!i.length)return null;let o=i.reduce((s,a)=>s+a,0)/i.length;return Math.round(Math.min(o,Math.min(...i)+30))}var Om={temperature:{deviceClass:"temperature",unit:"\xB0C",stops:[[16,[.2,.45,1]],[20,[.15,.85,.75]],[22.5,[.95,.8,.3]],[26,[1,.28,.18]]]},humidity:{deviceClass:"humidity",unit:"%",stops:[[30,[.95,.6,.2]],[45,[.3,.88,.5]],[60,[.2,.78,1]],[75,[.32,.4,.98]]]},co2:{deviceClass:"carbon_dioxide",unit:"ppm",stops:[[450,[.3,.88,.5]],[800,[.98,.84,.3]],[1200,[1,.5,.2]],[1600,[.98,.25,.25]]]},mould:{deviceClass:"",unit:"%",stops:[[0,[.3,.88,.5]],[40,[.98,.84,.3]],[70,[1,.5,.2]],[100,[.75,.2,.55]]]},comfort:{deviceClass:"",unit:"",stops:[[0,[.98,.25,.25]],[40,[1,.5,.2]],[65,[.98,.84,.3]],[85,[.3,.88,.5]],[100,[.2,.8,.7]]]},power:{deviceClass:"power",unit:"W",stops:[[0,[.25,.4,.6]],[100,[.3,.88,.5]],[500,[.98,.84,.3]],[1500,[1,.5,.2]],[3e3,[.98,.25,.25]]]},sun:{deviceClass:"",unit:"h",stops:[[0,[.22,.3,.55]],[2,[.35,.6,.85]],[4,[.98,.84,.3]],[7,[1,.62,.2]],[10,[1,.42,.25]]]}},Wm={deviceClass:"temperature",unit:"\xB0C",stops:[[19,[.2,.45,1]],[22.5,[.15,.85,.75]],[25.5,[.95,.8,.3]],[29,[1,.28,.18]]]};function Kr(n,e=!1){return n==="temperature"&&e?Wm:Om[n]}var Bm=(n,e,t)=>[n[0]+(e[0]-n[0])*t,n[1]+(e[1]-n[1])*t,n[2]+(e[2]-n[2])*t];function Ql(n,e,t=!1){let{stops:r}=Kr(n,t),i=r.findIndex(([c])=>e<=c);if(i===-1)return r[r.length-1][1];if(i===0)return r[0][1];let[o,s]=r[i-1],[a,l]=r[i];return Bm(s,l,(e-o)/(a-o))}function ko(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(s=>s.rooms)??t.rooms).filter(s=>s.kind==="electricity"&&s.metric==="power");if(i.length)return i.find(s=>s.unit==="W")?.value??null;let o=null;for(let s of So(n,e,t,r)){let a=q(n.states[s]);a!==null&&(o=(o??0)+Math.max(0,a))}return o}function So(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(h=>h.rooms)??t.rooms).filter(h=>h.kind==="electricity"&&h.metric==="power");if(i.length)return i.filter(h=>h.unit==="W").flatMap(h=>h.sources);let{grid:o,solar:s,battery:a}=e.energy,l=new Set([o,s,a].filter(Boolean)),c=new Set,u=(h,m)=>r.points.length>=3&&H([h,m],r.points);for(let h of t.placements){let m=u(h.x,h.z)?ve(n,h.entity_id):null;m&&c.add(m)}for(let h of t.furniture){if(!u(h.x,h.z))continue;let m=h.power&&h.power!=="none"?h.power:h.entity&&h.entity!=="none"?ve(n,h.entity):null;m&&c.add(m);for(let d of h.gang_entities??[]){let g=d&&d!=="none"?ve(n,d):null;g&&c.add(g)}}return[...c].filter(h=>!l.has(h))}function Xl(n,e,t){let r=new Map;for(let i of e.floors)for(
Line truncated
|
||||||
<path d=${Ar(n)} />
|
<path d=${Ar(n)} />
|
||||||
</svg>`,qr={previous:"M6 6h2v12H6zM20 6v12l-10-6z",play:"M8 5v14l11-7z",pause:"M7 5h4v14H7zM13 5h4v14h-4z",next:"M16 6h2v12h-2zM4 6v12l10-6z"},Ao=n=>p`<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d=${n} /></svg>`,gp=24,_p=10,Eo=class extends Q{static properties={hass:{attribute:!1},room:{attribute:!1},floor:{attribute:!1},confirmEntities:{attribute:!1},phrases:{attribute:!1},outside:{attribute:!1},_showAll:{state:!0},_said:{state:!0},_folded:{state:!0},_curve:{state:!0},_moodName:{state:!0},_undo:{state:!0},_energy:{state:!0},_sunYear:{state:!0},rooms:{attribute:!1},building:{attribute:!1}};saidTimer;memo=null;curveFor="";undoTimer;constructor(){super(),this.room=null,this.floor=null,this.phrases=null,this.outside=null,this._said=null,this._showAll=!1,this._folded=!1,this._curve=null,this._moodName=null,this._undo=null,this._energy=null,this._sunYear=!1,this.rooms=null,this.building=null}fireMoods(e,t){this.dispatchEvent(new CustomEvent("mood-change",{detail:{roomId:e.id,moods:t},bubbles:!0,composed:!0}))}runMood(e){for(let t of Ur(e))this.call("light",t.service,t.data)}renderMoods(e,t){let r=e.moods??[],i=!!this.rooms&&!!this.hass.user?.is_admin;if(!r.length&&!i)return f;let o=(this.rooms??[]).filter(l=>l.id!==e.id&&l.area_id),s=l=>U(this.hass,l).filter(c=>c.startsWith("light.")),a=()=>{let l=(this._moodName??"").trim()||this.t("mood_new");this.fireMoods(e,[...r,{id:`mood_${Date.now().toString(36)}`,name:l,lights:t.map(Gr)}]),this._moodName=null};return p`<div class="nf-rp-moods">
|
</svg>`,qr={previous:"M6 6h2v12H6zM20 6v12l-10-6z",play:"M8 5v14l11-7z",pause:"M7 5h4v14H7zM13 5h4v14h-4z",next:"M16 6h2v12h-2zM4 6v12l10-6z"},Ao=n=>p`<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d=${n} /></svg>`,gp=24,_p=10,Ro=class extends Q{static properties={hass:{attribute:!1},room:{attribute:!1},floor:{attribute:!1},confirmEntities:{attribute:!1},phrases:{attribute:!1},outside:{attribute:!1},_showAll:{state:!0},_said:{state:!0},_folded:{state:!0},_curve:{state:!0},_moodName:{state:!0},_undo:{state:!0},_energy:{state:!0},_sunYear:{state:!0},rooms:{attribute:!1},building:{attribute:!1}};saidTimer;memo=null;curveFor="";undoTimer;constructor(){super(),this.room=null,this.floor=null,this.phrases=null,this.outside=null,this._said=null,this._showAll=!1,this._folded=!1,this._curve=null,this._moodName=null,this._undo=null,this._energy=null,this._sunYear=!1,this.rooms=null,this.building=null}fireMoods(e,t){this.dispatchEvent(new CustomEvent("mood-change",{detail:{roomId:e.id,moods:t},bubbles:!0,composed:!0}))}runMood(e){for(let t of Ur(e))this.call("light",t.service,t.data)}renderMoods(e,t){let r=e.moods??[],i=!!this.rooms&&!!this.hass.user?.is_admin;if(!r.length&&!i)return f;let o=(this.rooms??[]).filter(l=>l.id!==e.id&&l.area_id),s=l=>U(this.hass,l).filter(c=>c.startsWith("light.")),a=()=>{let l=(this._moodName??"").trim()||this.t("mood_new");this.fireMoods(e,[...r,{id:`mood_${Date.now().toString(36)}`,name:l,lights:t.map(Gr)}]),this._moodName=null};return p`<div class="nf-rp-moods">
|
||||||
${r.map(l=>p`<span class="nf-rp-mood">
|
${r.map(l=>p`<span class="nf-rp-mood">
|
||||||
<button class="nf-btn" title=${this.t("mood_set")} @click=${()=>this.runMood(l.lights)}>✨ ${l.name}</button>
|
<button class="nf-btn" title=${this.t("mood_set")} @click=${()=>this.runMood(l.lights)}>✨ ${l.name}</button>
|
||||||
${o.length?p`<select class="nf-rp-mood-to" aria-label=${this.t("mood_carry")} title=${this.t("mood_carry")} @change=${c=>{let u=c.target,h=o.find(m=>m.id===u.value);u.value="",h&&this.runMood(hc(l,s(h)))}}>
|
${o.length?p`<select class="nf-rp-mood-to" aria-label=${this.t("mood_carry")} title=${this.t("mood_carry")} @change=${c=>{let u=c.target,h=o.find(m=>m.id===u.value);u.value="",h&&this.runMood(hc(l,s(h)))}}>
|
||||||
@@ -290,18 +290,18 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
</p>`}renderCurve(){let e=this._curve;if(!e)return f;let t=e.filter(c=>c!==null),r=Math.min(...t),i=Math.max(...t),o=Math.max(1,i-r),s=e.map(c=>c===null?null:c-r+o*.1),a=Tn(s,220,36,o*1.2),l=c=>`${L(this.hass,ce(this.hass,c),1)}\xB0`;return p`<div class="nf-rp-curve" title=${this.t("room_curve_hint")}>
|
</p>`}renderCurve(){let e=this._curve;if(!e)return f;let t=e.filter(c=>c!==null),r=Math.min(...t),i=Math.max(...t),o=Math.max(1,i-r),s=e.map(c=>c===null?null:c-r+o*.1),a=Tn(s,220,36,o*1.2),l=c=>`${L(this.hass,ce(this.hass,c),1)}\xB0`;return p`<div class="nf-rp-curve" title=${this.t("room_curve_hint")}>
|
||||||
<svg viewBox="0 0 220 36" preserveAspectRatio="none" aria-hidden="true">${ne`<path d=${a}></path>`}</svg>
|
<svg viewBox="0 0 220 36" preserveAspectRatio="none" aria-hidden="true">${ne`<path d=${a}></path>`}</svg>
|
||||||
<span>24 h · ${l(r)} – ${l(i)}</span>
|
<span>24 h · ${l(r)} – ${l(i)}</span>
|
||||||
</div>`}willUpdate(e){let t=e.get("room");e.has("room")&&t?.id!==this.room?.id&&(this._folded=!1,this._undo=null),this.room&&this.hass&&this.curveFor!==this.room.id&&(this.curveFor=this.room.id,this._curve=null,this._energy=null,this.loadCurve(this.room),this.loadEnergy(this.room))}updated(e){e.has("_folded")&&this.toggleAttribute("folded",this._folded)}t(e,t){return $(this.hass,e,t)}call(e,t,r){this.hass.callService(e,t,r)}renderClean(e){let t=e.clean_entity,r=t?this.hass.states[t]:void 0;if(!t||!r)return f;let i=t.slice(0,t.indexOf(".")),o=()=>i==="script"?this.call("script","turn_on",{entity_id:t}):this.call(i,"press",{entity_id:t});return p`<div class="nf-rp-alloff"><button class="nf-btn nf-rp-small" ?disabled=${C(r)} title=${this.t("room_clean_run_hint")} @click=${o}>🧹 ${this.t("room_clean_run")}</button></div>`}allOff(e){let t=Rn(e);for(let r of t.off)this.call(r.domain,r.service,r.data);this._undo=t.undo,clearTimeout(this.undoTimer),this.undoTimer=setTimeout(()=>this._undo=null,1e4)}undoAllOff(){for(let e of this._undo??[])this.call(e.domain,e.service,e.data);this._undo=null,clearTimeout(this.undoTimer)}renderAllOff(e){if(this._undo)return p`<div class="nf-rp-alloff"><span>${this.t("all_off_done")}</span><button class="nf-btn nf-rp-small" @click=${()=>this.undoAllOff()}>↶ ${this.t("all_off_undo")}</button></div>`;let{count:t}=Rn(e);return t<2?f:p`<div class="nf-rp-alloff"><button class="nf-btn nf-rp-small" title=${this.t("all_off_hint")} @click=${()=>this.allOff(e)}>⏻ ${this.t("all_off_n",{n:t})}</button></div>`}get areaName(){return this.room?.area_id?this.hass.areas?.[this.room.area_id]?.name:void 0}placedAs(e){for(let t of this.building?.floors??[])for(let r of t.placements)if(r.entity_id===e)return r}name(e){return this.placedAs(e)?.name?.trim()||O(this.hass,e,this.areaName)}nameButton(e){return p`<button class="nf-rp-name" title=${this.t("details")} @click=${()=>ke(this,e)}>${this.name(e)}</button>`}askFor(e){return!this.confirmEntities?.has(e)||confirm(this.t("confirm_switch",{name:this.name(e)}))}toggle(e,t,r){let i=()=>{this.confirmEntities?.has(e.entity_id)&&!confirm(this.t("confirm_switch",{name:this.name(e.entity_id)}))||r()};return p`<button
|
</div>`}willUpdate(e){let t=e.get("room");e.has("room")&&t?.id!==this.room?.id&&(this._folded=!1,this._undo=null),this.room&&this.hass&&this.curveFor!==this.room.id&&(this.curveFor=this.room.id,this._curve=null,this._energy=null,this.loadCurve(this.room),this.loadEnergy(this.room))}updated(e){e.has("_folded")&&this.toggleAttribute("folded",this._folded)}t(e,t){return $(this.hass,e,t)}call(e,t,r){this.hass.callService(e,t,r)}renderClean(e){let t=e.clean_entity,r=t?this.hass.states[t]:void 0;if(!t||!r)return f;let i=t.slice(0,t.indexOf(".")),o=()=>i==="script"?this.call("script","turn_on",{entity_id:t}):this.call(i,"press",{entity_id:t});return p`<div class="nf-rp-alloff"><button class="nf-btn nf-rp-small" ?disabled=${C(r)} title=${this.t("room_clean_run_hint")} @click=${o}>🧹 ${this.t("room_clean_run")}</button></div>`}allOff(e){let t=En(e);for(let r of t.off)this.call(r.domain,r.service,r.data);this._undo=t.undo,clearTimeout(this.undoTimer),this.undoTimer=setTimeout(()=>this._undo=null,1e4)}undoAllOff(){for(let e of this._undo??[])this.call(e.domain,e.service,e.data);this._undo=null,clearTimeout(this.undoTimer)}renderAllOff(e){if(this._undo)return p`<div class="nf-rp-alloff"><span>${this.t("all_off_done")}</span><button class="nf-btn nf-rp-small" @click=${()=>this.undoAllOff()}>↶ ${this.t("all_off_undo")}</button></div>`;let{count:t}=En(e);return t<2?f:p`<div class="nf-rp-alloff"><button class="nf-btn nf-rp-small" title=${this.t("all_off_hint")} @click=${()=>this.allOff(e)}>⏻ ${this.t("all_off_n",{n:t})}</button></div>`}get areaName(){return this.room?.area_id?this.hass.areas?.[this.room.area_id]?.name:void 0}placedAs(e){for(let t of this.building?.floors??[])for(let r of t.placements)if(r.entity_id===e)return r}name(e){return this.placedAs(e)?.name?.trim()||O(this.hass,e,this.areaName)}nameButton(e){return p`<button class="nf-rp-name" title=${this.t("details")} @click=${()=>ke(this,e)}>${this.name(e)}</button>`}askFor(e){return!this.confirmEntities?.has(e)||confirm(this.t("confirm_switch",{name:this.name(e)}))}toggle(e,t,r){let i=()=>{this.confirmEntities?.has(e.entity_id)&&!confirm(this.t("confirm_switch",{name:this.name(e.entity_id)}))||r()};return p`<button
|
||||||
class="nf-switch"
|
class="nf-switch"
|
||||||
role="switch"
|
role="switch"
|
||||||
aria-checked=${t?"true":"false"}
|
aria-checked=${t?"true":"false"}
|
||||||
aria-label=${this.name(e.entity_id)}
|
aria-label=${this.name(e.entity_id)}
|
||||||
?disabled=${C(e)}
|
?disabled=${C(e)}
|
||||||
@click=${i}
|
@click=${i}
|
||||||
></button>`}outsideRoom=null;render(){let e=!this.room&&this.outside?this.outside:null;e&&!this.outsideRoom&&(this.outsideRoom={id:"nf-outside",name:this.t("outside_area"),area_id:null,points:[],floor_material:"grass"});let t=this.room??(e?this.outsideRoom:null);if(!t||!this.hass)return f;let r=e??U(this.hass,t),i=this.memo,{shown:o,more:s}=e?{shown:e,more:[]}:i&&i.entities===this.hass.entities&&i.floor===this.floor&&i.room===t?i:this.memo={entities:this.hass.entities,floor:this.floor,room:t,...this.floor?La(this.hass,this.floor,t):{shown:r,more:[]}},a=ji(this.hass,s).map(R=>R.primary),l=a.length,c=[t.floor_heating,...Object.values(t.hvac??{}).flat()].filter(R=>!!R&&R!=="none"),u=new Set(c.map(R=>this.hass.states[R]?.attributes.symcon_id).filter(Boolean)),h=(this._showAll?[...o,...a]:o).filter(R=>!V(this.hass)||!u.has(this.hass.states[R]?.attributes.symcon_id)),m=R=>h.filter(D=>R.includes(P(D))).map(D=>this.hass.states[D]),d=m(["light"]),g=m(["cover"]),_=m(["climate"]),b=m(["media"]),y=m(["switch","fan","lock"]),S=m(["sensor","binary"]),k=m(["scene","script"]),M=this.facts(_),z=d.filter(R=>R.state==="on");return p`<section class="nf-rp" aria-label=${t.name}>
|
></button>`}outsideRoom=null;render(){let e=!this.room&&this.outside?this.outside:null;e&&!this.outsideRoom&&(this.outsideRoom={id:"nf-outside",name:this.t("outside_area"),area_id:null,points:[],floor_material:"grass"});let t=this.room??(e?this.outsideRoom:null);if(!t||!this.hass)return f;let r=e??U(this.hass,t),i=this.memo,{shown:o,more:s}=e?{shown:e,more:[]}:i&&i.entities===this.hass.entities&&i.floor===this.floor&&i.room===t?i:this.memo={entities:this.hass.entities,floor:this.floor,room:t,...this.floor?La(this.hass,this.floor,t):{shown:r,more:[]}},a=ji(this.hass,s).map(E=>E.primary),l=a.length,c=[t.floor_heating,...Object.values(t.hvac??{}).flat()].filter(E=>!!E&&E!=="none"),u=new Set(c.map(E=>this.hass.states[E]?.attributes.symcon_id).filter(Boolean)),h=(this._showAll?[...o,...a]:o).filter(E=>!V(this.hass)||!u.has(this.hass.states[E]?.attributes.symcon_id)),m=E=>h.filter(D=>E.includes(P(D))).map(D=>this.hass.states[D]),d=m(["light"]),g=m(["cover"]),_=m(["climate"]),b=m(["media"]),y=m(["switch","fan","lock"]),S=m(["sensor","binary"]),k=m(["scene","script"]),M=this.facts(_),z=d.filter(E=>E.state==="on");return p`<section class="nf-rp" aria-label=${t.name}>
|
||||||
<header class="nf-rp-head">
|
<header class="nf-rp-head">
|
||||||
<div>
|
<div>
|
||||||
<h2>${t.name}</h2>
|
<h2>${t.name}</h2>
|
||||||
${M.length?p`<p class="nf-rp-facts">${M.map((R,D)=>p`${D?" \xB7 ":f}${R}`)}</p>`:f} ${this.renderEnergy()} ${this.renderSunYear()} ${this.renderShade()}
|
${M.length?p`<p class="nf-rp-facts">${M.map((E,D)=>p`${D?" \xB7 ":f}${E}`)}</p>`:f} ${this.renderEnergy()} ${this.renderSunYear()} ${this.renderShade()}
|
||||||
${this.renderOpenWhileHeating(_)} ${this.renderEmptyLights(t,z)}
|
${this.renderOpenWhileHeating(_)} ${this.renderEmptyLights(t,z)}
|
||||||
${this.renderCurve()}
|
${this.renderCurve()}
|
||||||
</div>
|
</div>
|
||||||
@@ -313,34 +313,34 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<div class="nf-rp-body" ?hidden=${this._folded}>
|
<div class="nf-rp-body" ?hidden=${this._folded}>
|
||||||
<nf-utility-report .hass=${this.hass} .readings=${Wt(this.hass,t,this.building?.floors.flatMap(R=>R.rooms))}></nf-utility-report>
|
<nf-utility-report .hass=${this.hass} .readings=${Wt(this.hass,t,this.building?.floors.flatMap(E=>E.rooms))}></nf-utility-report>
|
||||||
${this.renderAllOff([...d,...b,...y])}
|
${this.renderAllOff([...d,...b,...y])}
|
||||||
${this.renderClean(t)}
|
${this.renderClean(t)}
|
||||||
${!t.area_id&&!e&&!(V(this.hass)&&c.length)?p`<p class="nf-rp-note">${this.t("panel_no_area")}</p>`:!h.length&&!(V(this.hass)&&c.length)?p`<p class="nf-rp-note">${this.t("panel_empty")}</p>`:f}
|
${!t.area_id&&!e&&!(V(this.hass)&&c.length)?p`<p class="nf-rp-note">${this.t("panel_no_area")}</p>`:!h.length&&!(V(this.hass)&&c.length)?p`<p class="nf-rp-note">${this.t("panel_empty")}</p>`:f}
|
||||||
${k.length?this.section("panel_scenes",[p`<div class="nf-rp-scenes">
|
${k.length?this.section("panel_scenes",[p`<div class="nf-rp-scenes">
|
||||||
${k.map(R=>p`<button
|
${k.map(E=>p`<button
|
||||||
class="nf-btn"
|
class="nf-btn"
|
||||||
?disabled=${C(R)}
|
?disabled=${C(E)}
|
||||||
@click=${()=>this.call(P(R.entity_id)==="scene"?"scene":"script","turn_on",{entity_id:R.entity_id})}
|
@click=${()=>this.call(P(E.entity_id)==="scene"?"scene":"script","turn_on",{entity_id:E.entity_id})}
|
||||||
>
|
>
|
||||||
${this.name(R.entity_id)}
|
${this.name(E.entity_id)}
|
||||||
</button>`)}
|
</button>`)}
|
||||||
</div>`]):f}
|
</div>`]):f}
|
||||||
${d.length?this.section("panel_lights",[...d.map(R=>this.lightRow(R)),...t?[this.renderMoods(t,d)]:[]],p`${z.length<d.length?p`<button class="nf-btn nf-rp-small" @click=${()=>this.call("light","turn_on",{entity_id:d.filter(R=>!C(R)).map(R=>R.entity_id)})}>
|
${d.length?this.section("panel_lights",[...d.map(E=>this.lightRow(E)),...t?[this.renderMoods(t,d)]:[]],p`${z.length<d.length?p`<button class="nf-btn nf-rp-small" @click=${()=>this.call("light","turn_on",{entity_id:d.filter(E=>!C(E)).map(E=>E.entity_id)})}>
|
||||||
${this.t("panel_all_on")}
|
${this.t("panel_all_on")}
|
||||||
</button>`:f}${z.length?p`<button class="nf-btn nf-rp-small" @click=${()=>this.call("light","turn_off",{entity_id:z.map(R=>R.entity_id)})}>
|
</button>`:f}${z.length?p`<button class="nf-btn nf-rp-small" @click=${()=>this.call("light","turn_off",{entity_id:z.map(E=>E.entity_id)})}>
|
||||||
${this.t("panel_all_off")}
|
${this.t("panel_all_off")}
|
||||||
</button>`:f}`):f}
|
</button>`:f}`):f}
|
||||||
${g.length?this.section("panel_covers",g.map(R=>this.coverRow(R)),g.length>1&&mr(g,this.confirmEntities).length?p`<button class="nf-btn nf-rp-small" @click=${()=>this.call("cover","open_cover",{entity_id:mr(g,this.confirmEntities)})}>
|
${g.length?this.section("panel_covers",g.map(E=>this.coverRow(E)),g.length>1&&mr(g,this.confirmEntities).length?p`<button class="nf-btn nf-rp-small" @click=${()=>this.call("cover","open_cover",{entity_id:mr(g,this.confirmEntities)})}>
|
||||||
${this.t("panel_all_open")}</button
|
${this.t("panel_all_open")}</button
|
||||||
><button class="nf-btn nf-rp-small" @click=${()=>this.call("cover","close_cover",{entity_id:mr(g,this.confirmEntities)})}>
|
><button class="nf-btn nf-rp-small" @click=${()=>this.call("cover","close_cover",{entity_id:mr(g,this.confirmEntities)})}>
|
||||||
${this.t("panel_all_close")}
|
${this.t("panel_all_close")}
|
||||||
</button>`:f):f}
|
</button>`:f):f}
|
||||||
${V(this.hass)?p`<nf-room-hvac .hass=${this.hass} .room=${t}></nf-room-hvac>`:f}
|
${V(this.hass)?p`<nf-room-hvac .hass=${this.hass} .room=${t}></nf-room-hvac>`:f}
|
||||||
${_.length?this.section("panel_climate",_.map(R=>this.climateRow(R))):f}
|
${_.length?this.section("panel_climate",_.map(E=>this.climateRow(E))):f}
|
||||||
${b.length?this.section("panel_media",b.map(R=>this.mediaRow(R))):f}
|
${b.length?this.section("panel_media",b.map(E=>this.mediaRow(E))):f}
|
||||||
${y.length?this.section("panel_switches",y.map(R=>this.switchRow(R))):f}
|
${y.length?this.section("panel_switches",y.map(E=>this.switchRow(E))):f}
|
||||||
${S.length?this.section("panel_sensors",S.map(R=>this.sensorRow(R))):f}
|
${S.length?this.section("panel_sensors",S.map(E=>this.sensorRow(E))):f}
|
||||||
${this.extraValues(t)}
|
${this.extraValues(t)}
|
||||||
${!V(this.hass)&&pl(this.hass)&&ml(this.hass,this.floor,t)?this.announceSection(t):f}
|
${!V(this.hass)&&pl(this.hass)&&ml(this.hass,this.floor,t)?this.announceSection(t):f}
|
||||||
${this.pluginSections(t,h)}
|
${this.pluginSections(t,h)}
|
||||||
@@ -348,7 +348,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
${this._showAll?this.t("panel_less"):this.t("panel_more",{n:l})}
|
${this._showAll?this.t("panel_less"):this.t("panel_more",{n:l})}
|
||||||
</button>`:f}
|
</button>`:f}
|
||||||
</div>
|
</div>
|
||||||
</section>`}extraValues(e){if(!this.floor)return f;let t=[...this.floor.placements.filter(r=>!r.outside&&H([r.x,r.z],e.points)).map(r=>({name:r.name||O(this.hass,r.entity_id),rows:Er(this.hass,r.values)})),...this.floor.furniture.filter(r=>H([r.x,r.z],e.points)).map(r=>({name:r.name||(r.entity&&r.entity!=="none"?O(this.hass,r.entity):ae(this.hass,r.type)),rows:[...jr(this.hass,r),...Er(this.hass,r.values)]}))].filter(r=>r.rows.length);return t.length?this.section("device_values",t.map(r=>p`<div class="nf-extra-values"><b>${r.name}</b>${r.rows.map(i=>p`<div class="nf-rp-row"><span class="nf-rp-icon">${i.icon}</span><span class="nf-rp-name">${i.label}</span><b class="nf-rp-state">${i.text}${G(this.hass,[i.entity],i.label)}</b></div>`)}</div>`)):f}facts(e){let t=[],r=this.room;if(!r)return t;let i=(T,E)=>{let A=Z(this.hass,this.floor,r,T);if(A===null)return null;if(T==="temperature")return`${L(this.hass,ce(this.hass,A),1)} ${re(this.hass)}`;let I=be(this.hass,this.floor,r,T)[0],N=this.hass.states[I]?.attributes.unit_of_measurement??E;return`${L(this.hass,A,1)} ${N}`},o=e.find(T=>typeof T.attributes.current_temperature=="number"),s=i("temperature","\xB0C");s?t.push(p`${s}${G(this.hass,be(this.hass,this.floor,r,"temperature"),"Temperatur")}`):o&&r.climate?.temperature!=="none"&&t.push(p`${L(this.hass,o.attributes.current_temperature,1)} ${re(this.hass)}${G(this.hass,[o.entity_id],"Temperatur")}`);let a=i("humidity","%");a&&t.push(p`${a}${G(this.hass,be(this.hass,this.floor,r,"humidity"),"Luftfeuchte")}`);let l=Z(this.hass,this.floor??null,r,"illuminance");l!==null&&t.push(p`☀ ${L(this.hass,l,0)} lx${G(this.hass,be(this.hass,this.floor,r,"illuminance"),"Helligkeit")}`);let c=Wt(this.hass,r,this.building?.floors.flatMap(T=>T.rooms)).find(T=>T.kind==="electricity"&&T.metric==="power"&&T.unit==="W"),u=!c&&this.floor&&this.building?ko(this.hass,this.building,this.floor,r):null;c?t.push(p`⚡ ${Ne(this.hass,c)}${G(this.hass,c.sources,"Leistung")}`):u!==null&&t.push(`\u26A1 ${wt(this.hass,u)}`);let h=this.floor?this.floor.openings.filter(T=>T.room_id===r.id).flatMap(T=>[T.contact,T.contact2,T.tilt,T.tilt2]).map(T=>T&&T!=="none"?this.hass.states[T]:void 0).filter(T=>T?.state==="on").map(T=>Date.parse(String(T.last_changed??""))).filter(Number.isFinite):[];h.length&&t.push(`\u{1FA9F} ${this.t("open_since",{time:$o(Date.now()-Math.min(...h))})}`);let m=U(this.hass,r).map(T=>this.hass.states[T]).filter(T=>!!T&&T.entity_id.startsWith("binary_sensor.")&&["motion","occupancy","presence"].includes(String(T.attributes.device_class)));if(m.length)if(m.some(T=>T.state==="on"))t.push(`\u{1F6B6} ${this.t("presence_now")}`);else{let T=Math.max(...m.map(E=>Date.parse(String(E.last_changed??""))||0));T>0&&t.push(`\u{1F6B6} ${this.t("presence_last",{time:$o(Date.now()-T)})}`)}let d=this.building?ac(this.hass,this.building).filter(T=>T.roomId===r.id&&T.level<sc):[];d.length&&t.push(`\u{1FAAB} ${this.t("battery_low_n",{n:d.length,names:d.map(T=>`${this.name(T.entity)} ${Math.round(T.level)} %`).join(", ")})}`);let g=(this.building?.settings.circuits??[]).filter(T=>T.rooms.includes(r.id)).map(T=>T.name),_=this.building?.settings.room_facts_off??[];g.length&&!_.includes("circuits")&&t.push(`\u{1F50C} ${g.join(", ")}`);let{latitude:b,longitude:y,time_zone:S}=this.hass.config??{};if(this.floor&&b!==void 0&&y!==void 0&&this.building&&!_.includes("sun")){let T=Kt(this.building,this.floor,r,{latitude:b,longitude:y,zone:S});T.facing.length&&t.push(`\u2600 ${this.t("room_sun_hours",{h:L(this.hass,T.hours,1),facing:T.facing.join(", ")})}`)}let k=Z(this.hass,this.floor,r,"temperature"),M=Z(this.hass,this.floor,r,"humidity"),z=Br(Z(this.hass,this.floor,r,"co2"),M,Gt(k,M));z&&!_.includes("air")&&t.push(`\u{1F4A8} ${this.t(`air_${z}`)}`);let R=Vr(k,M,Z(this.hass,this.floor,r,"co2"),vt(new Date,this.hass.config?.latitude)),D=r.hvac?.status;return D&&D!=="none"?t.push(p`${De(this.hass.states[D])}${G(this.hass,[D],"Raumstatus")}`):R!==null&&(k!==null||M!==null)&&!_.includes("comfort")&&t.push(`\u{1F60A} ${this.t("comfort_n",{n:R})}`),t}announceSection(e){let t=this.phrases?.length?this.phrases:[1,2,3,4,5].map(o=>this.t(`announce_phrase_${o}`)),r=o=>{let s=o.trim();s&&(clearTimeout(this.saidTimer),this.hass.callService("nextfloor","announce",{message:s,rooms:[e.id],on_screens:!1}).then(()=>this._said={text:this.t("announce_sent",{message:s}),failed:!1},a=>this._said={text:this.t("announce_failed",{error:a?.message??String(a)}),failed:!0}),this.saidTimer=setTimeout(()=>this._said=null,6e3))},i=o=>{o.preventDefault();let s=o.currentTarget.querySelector("input");r(s.value),s.value=""};return this.section("panel_announce",[p`<div class="nf-rp-scenes">${t.map(o=>p`<button class="nf-btn" @click=${()=>r(o)}>${o}</button>`)}</div>
|
</section>`}extraValues(e){if(!this.floor)return f;let t=[...this.floor.placements.filter(r=>!r.outside&&H([r.x,r.z],e.points)).map(r=>({name:r.name||O(this.hass,r.entity_id),rows:Rr(this.hass,r.values)})),...this.floor.furniture.filter(r=>H([r.x,r.z],e.points)).map(r=>({name:r.name||(r.entity&&r.entity!=="none"?O(this.hass,r.entity):ae(this.hass,r.type)),rows:[...jr(this.hass,r),...Rr(this.hass,r.values)]}))].filter(r=>r.rows.length);return t.length?this.section("device_values",t.map(r=>p`<div class="nf-extra-values"><b>${r.name}</b>${r.rows.map(i=>p`<div class="nf-rp-row"><span class="nf-rp-icon">${i.icon}</span><span class="nf-rp-name">${i.label}</span><b class="nf-rp-state">${i.text}${G(this.hass,[i.entity],i.label)}</b></div>`)}</div>`)):f}facts(e){let t=[],r=this.room;if(!r)return t;let i=(T,R)=>{let A=Z(this.hass,this.floor,r,T);if(A===null)return null;if(T==="temperature")return`${L(this.hass,ce(this.hass,A),1)} ${re(this.hass)}`;let I=be(this.hass,this.floor,r,T)[0],N=this.hass.states[I]?.attributes.unit_of_measurement??R;return`${L(this.hass,A,1)} ${N}`},o=e.find(T=>typeof T.attributes.current_temperature=="number"),s=i("temperature","\xB0C");s?t.push(p`${s}${G(this.hass,be(this.hass,this.floor,r,"temperature"),"Temperatur")}`):o&&r.climate?.temperature!=="none"&&t.push(p`${L(this.hass,o.attributes.current_temperature,1)} ${re(this.hass)}${G(this.hass,[o.entity_id],"Temperatur")}`);let a=i("humidity","%");a&&t.push(p`${a}${G(this.hass,be(this.hass,this.floor,r,"humidity"),"Luftfeuchte")}`);let l=Z(this.hass,this.floor??null,r,"illuminance");l!==null&&t.push(p`☀ ${L(this.hass,l,0)} lx${G(this.hass,be(this.hass,this.floor,r,"illuminance"),"Helligkeit")}`);let c=Wt(this.hass,r,this.building?.floors.flatMap(T=>T.rooms)).find(T=>T.kind==="electricity"&&T.metric==="power"&&T.unit==="W"),u=!c&&this.floor&&this.building?ko(this.hass,this.building,this.floor,r):null;c?t.push(p`⚡ ${Ne(this.hass,c)}${G(this.hass,c.sources,"Leistung")}`):u!==null&&t.push(`\u26A1 ${wt(this.hass,u)}`);let h=this.floor?this.floor.openings.filter(T=>T.room_id===r.id).flatMap(T=>[T.contact,T.contact2,T.tilt,T.tilt2]).map(T=>T&&T!=="none"?this.hass.states[T]:void 0).filter(T=>T?.state==="on").map(T=>Date.parse(String(T.last_changed??""))).filter(Number.isFinite):[];h.length&&t.push(`\u{1FA9F} ${this.t("open_since",{time:$o(Date.now()-Math.min(...h))})}`);let m=U(this.hass,r).map(T=>this.hass.states[T]).filter(T=>!!T&&T.entity_id.startsWith("binary_sensor.")&&["motion","occupancy","presence"].includes(String(T.attributes.device_class)));if(m.length)if(m.some(T=>T.state==="on"))t.push(`\u{1F6B6} ${this.t("presence_now")}`);else{let T=Math.max(...m.map(R=>Date.parse(String(R.last_changed??""))||0));T>0&&t.push(`\u{1F6B6} ${this.t("presence_last",{time:$o(Date.now()-T)})}`)}let d=this.building?ac(this.hass,this.building).filter(T=>T.roomId===r.id&&T.level<sc):[];d.length&&t.push(`\u{1FAAB} ${this.t("battery_low_n",{n:d.length,names:d.map(T=>`${this.name(T.entity)} ${Math.round(T.level)} %`).join(", ")})}`);let g=(this.building?.settings.circuits??[]).filter(T=>T.rooms.includes(r.id)).map(T=>T.name),_=this.building?.settings.room_facts_off??[];g.length&&!_.includes("circuits")&&t.push(`\u{1F50C} ${g.join(", ")}`);let{latitude:b,longitude:y,time_zone:S}=this.hass.config??{};if(this.floor&&b!==void 0&&y!==void 0&&this.building&&!_.includes("sun")){let T=Kt(this.building,this.floor,r,{latitude:b,longitude:y,zone:S});T.facing.length&&t.push(`\u2600 ${this.t("room_sun_hours",{h:L(this.hass,T.hours,1),facing:T.facing.join(", ")})}`)}let k=Z(this.hass,this.floor,r,"temperature"),M=Z(this.hass,this.floor,r,"humidity"),z=Br(Z(this.hass,this.floor,r,"co2"),M,Gt(k,M));z&&!_.includes("air")&&t.push(`\u{1F4A8} ${this.t(`air_${z}`)}`);let E=Vr(k,M,Z(this.hass,this.floor,r,"co2"),vt(new Date,this.hass.config?.latitude)),D=r.hvac?.status;return D&&D!=="none"?t.push(p`${De(this.hass.states[D])}${G(this.hass,[D],"Raumstatus")}`):E!==null&&(k!==null||M!==null)&&!_.includes("comfort")&&t.push(`\u{1F60A} ${this.t("comfort_n",{n:E})}`),t}announceSection(e){let t=this.phrases?.length?this.phrases:[1,2,3,4,5].map(o=>this.t(`announce_phrase_${o}`)),r=o=>{let s=o.trim();s&&(clearTimeout(this.saidTimer),this.hass.callService("nextfloor","announce",{message:s,rooms:[e.id],on_screens:!1}).then(()=>this._said={text:this.t("announce_sent",{message:s}),failed:!1},a=>this._said={text:this.t("announce_failed",{error:a?.message??String(a)}),failed:!0}),this.saidTimer=setTimeout(()=>this._said=null,6e3))},i=o=>{o.preventDefault();let s=o.currentTarget.querySelector("input");r(s.value),s.value=""};return this.section("panel_announce",[p`<div class="nf-rp-scenes">${t.map(o=>p`<button class="nf-btn" @click=${()=>r(o)}>${o}</button>`)}</div>
|
||||||
<form class="nf-rp-say" @submit=${i}>
|
<form class="nf-rp-say" @submit=${i}>
|
||||||
<input type="text" maxlength="500" placeholder=${this.t("announce_placeholder")} aria-label=${this.t("announce_placeholder")} />
|
<input type="text" maxlength="500" placeholder=${this.t("announce_placeholder")} aria-label=${this.t("announce_placeholder")} />
|
||||||
<button class="nf-btn nf-primary" type="submit">${this.t("announce_send")}</button>
|
<button class="nf-btn nf-primary" type="submit">${this.t("announce_send")}</button>
|
||||||
@@ -856,7 +856,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
outline: 2px solid var(--nf-accent);
|
outline: 2px solid var(--nf-accent);
|
||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
`]};customElements.get("nf-room-panel")||customElements.define("nf-room-panel",Eo);function xc(n){if(!n)return"";let e=Math.min(.8,Math.max(0,n.dim??.35)),t=n.image&&/^(https:\/\/|\/local\/|\/api\/)[^"'()\\\s]+$/.test(n.image)?n.image:null,r=n.color&&/^#[0-9a-f]{6}$/i.test(n.color)?n.color:null;return t?`;background:linear-gradient(rgba(0,0,0,${e}),rgba(0,0,0,${e})),center / cover no-repeat url("${t}")${r?` ${r}`:""}`:r?`;background:${r}`:""}var bp=[[/spotify/i,[30,215,96]],[/netflix/i,[229,9,20]],[/youtube/i,[255,0,51]],[/prime|amazon/i,[0,168,225]],[/disney/i,[17,60,207]],[/apple ?music|itunes/i,[250,45,72]],[/apple ?tv/i,[200,200,210]],[/plex/i,[229,160,13]],[/tidal/i,[0,255,255]],[/deezer/i,[162,56,255]],[/radio|tunein/i,[255,140,60]]],kc=[34,211,238];function Ro(n){return n?bp.find(([e])=>e.test(n))?.[1]??kc:kc}function zo(n){if(n.state==="playing"||n.state==="paused")return!0;let e=t=>typeof n.attributes[t]=="string"&&n.attributes[t]!=="";return n.state==="on"&&(e("media_title")||e("media_channel")||e("source")||e("app_name"))}var To=n=>n.state==="playing"||n.state==="on"&&zo(n);function Sc(n,e){let t=[],r=new Set;for(let i of e){if(!i.entity.startsWith("media_player.")||r.has(i.entity))continue;r.add(i.entity);let o=n.states[i.entity];if(!o)continue;let s=o.attributes,a=u=>typeof s[u]=="string"?s[u]:"",l=a("app_name")||a("source")||a("app_id")||null,c=typeof s.volume_level=="number"?s.volume_level:null;t.push({entity:i.entity,name:i.name,at:i.at,playing:To(o),title:a("media_title")||a("media_channel")||l||"",artist:a("media_artist")||a("media_album_name")||a("media_series_title"),picture:a("entity_picture")||null,volume:c,color:Ro(l),app:l,group:Array.isArray(s.group_members)?s.group_members.filter(u=>typeof u=="string"&&u!==i.entity):[],rings:i.rings??1})}return t}function $c(n){let e=new Map(n.filter(i=>i.playing).map(i=>[i.entity,i])),t=[],r=new Set;for(let i of e.values())for(let o of i.group){let s=e.get(o),a=[i.entity,o].sort().join("|");s&&!r.has(a)&&(r.add(a),t.push([i,s]))}return t}var yp=3;function Mc(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!o.type.endsWith(":sprinkler"))continue;let s=t?.get(o.id)?.entity??null;!s||!te(n.states[s])||r.push({id:o.id,at:{floorId:i.id,x:o.x,y:oe(i,o)+o.h,z:o.z},reach:Math.min(15,Math.max(.5,o.spray??yp))})}return r}var Zr=n=>n&&n!=="none"?n:null,Ac=n=>Math.min(1,Math.max(0,n));function Ec(n,e){let t=new Map;for(let r of e.settings.roof?.windows??[]){let i=Ve(n,{cover:Zr(r.cover),contact:Zr(r.contact),tilt:Zr(r.tilt)},"window"),o=Zr(r.window),s=o?n.states[o]:void 0,a=i.open;if(s&&!C(s)){let l=s.attributes.current_position;a=typeof l=="number"?Ac(l/100):s.state==="open"||s.state==="opening"?1:0}t.set(r.id,{open:a,tilt:i.tilt,cover:i.cover??0})}return t}function vp(n,e){let t=i=>Math.hypot(i.x-e.x,i.z-e.z);return n.placements.filter(i=>i.entity_id.startsWith("media_player.")&&t(i)<Math.max(2,e.w)).sort((i,o)=>t(i)-t(o))[0]?.entity_id??null}var st=(n,e)=>typeof n[e]=="string"?n[e]:"";function Rc(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!vr(o.type))continue;let s=t?.get(o.id)?.entity??null,a=s?.startsWith("media_player.")?s:vp(i,o),l=a?n.states[a]:void 0;if(!l||!zo(l))continue;let c=l.attributes,u=st(c,"app_name")||st(c,"source")||null;r.push({id:o.id,furnitureId:o.id,floorId:i.id,color:Ro(u),title:st(c,"media_title")||st(c,"media_channel")||u||"",subtitle:st(c,"media_artist")||st(c,"media_series_title")||st(c,"media_album_name"),app:u,picture:st(c,"entity_picture")||null,playing:To(l),ambilight:o.ambilight??1})}return r}function zc(n){let e=n.states["sun.sun"]?.attributes;return typeof e?.elevation=="number"&&typeof e.azimuth=="number"?{elevation:e.elevation,azimuth:e.azimuth}:null}function Tc(n,e){return(n===null?0:Ac((n+4)/16))*(1-.45*e)}function at(n,e){return n.states["weather.nextfloor_symcon"]?"weather.nextfloor_symcon":e&&n.states[e]?e:Object.keys(n.states).filter(t=>t.startsWith("weather.")).sort()[0]??null}var Yr=new Set(["contact_lost","unlocked_night","own"]);function wp(n,e){let t=n.states[e.entity];if(!t||["unavailable","unknown"].includes(t.state))return!1;let r=(e.state??"on").trim(),i=/^([<>])\s*(-?\d+(?:[.,]\d+)?)$/.exec(r);if(i){let o=Number(t.state),s=Number(i[2].replace(",","."));return Number.isFinite(o)&&(i[1]==="<"?o<s:o>s)}return r.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean).includes(String(t.state).toLowerCase())}var xp=600*1e3,kp=new Set(["rainy","pouring","lightning-rainy","hail","snowy-rainy"]),Sp=new Map([["smoke","smoke"],["gas","gas"],["carbon_monoxide","co"],["moisture","water"]]),Fc=(n,e)=>{if(e.startsWith("binary_sensor."))return Sp.get(String(n.states[e]?.attributes.device_class))};function $p(n,e){let t=new Set,r=[];for(let i of n.floors)for(let o of i.openings){let s=e.get(o.id);for(let a of s?[s.contact,s.contact2,s.tilt,s.tilt2]:[])!a||t.has(a)||(t.add(a),r.push({floorId:i.id,roomId:o.room_id,entity:a}))}return r}function Dc(n,e,t,r){let i=[];for(let a o
Line truncated
|
`]};customElements.get("nf-room-panel")||customElements.define("nf-room-panel",Ro);function xc(n){if(!n)return"";let e=Math.min(.8,Math.max(0,n.dim??.35)),t=n.image&&/^(https:\/\/|\/local\/|\/api\/)[^"'()\\\s]+$/.test(n.image)?n.image:null,r=n.color&&/^#[0-9a-f]{6}$/i.test(n.color)?n.color:null;return t?`;background:linear-gradient(rgba(0,0,0,${e}),rgba(0,0,0,${e})),center / cover no-repeat url("${t}")${r?` ${r}`:""}`:r?`;background:${r}`:""}var bp=[[/spotify/i,[30,215,96]],[/netflix/i,[229,9,20]],[/youtube/i,[255,0,51]],[/prime|amazon/i,[0,168,225]],[/disney/i,[17,60,207]],[/apple ?music|itunes/i,[250,45,72]],[/apple ?tv/i,[200,200,210]],[/plex/i,[229,160,13]],[/tidal/i,[0,255,255]],[/deezer/i,[162,56,255]],[/radio|tunein/i,[255,140,60]]],kc=[34,211,238];function Eo(n){return n?bp.find(([e])=>e.test(n))?.[1]??kc:kc}function zo(n){if(n.state==="playing"||n.state==="paused")return!0;let e=t=>typeof n.attributes[t]=="string"&&n.attributes[t]!=="";return n.state==="on"&&(e("media_title")||e("media_channel")||e("source")||e("app_name"))}var To=n=>n.state==="playing"||n.state==="on"&&zo(n);function Sc(n,e){let t=[],r=new Set;for(let i of e){if(!i.entity.startsWith("media_player.")||r.has(i.entity))continue;r.add(i.entity);let o=n.states[i.entity];if(!o)continue;let s=o.attributes,a=u=>typeof s[u]=="string"?s[u]:"",l=a("app_name")||a("source")||a("app_id")||null,c=typeof s.volume_level=="number"?s.volume_level:null;t.push({entity:i.entity,name:i.name,at:i.at,playing:To(o),title:a("media_title")||a("media_channel")||l||"",artist:a("media_artist")||a("media_album_name")||a("media_series_title"),picture:a("entity_picture")||null,volume:c,color:Eo(l),app:l,group:Array.isArray(s.group_members)?s.group_members.filter(u=>typeof u=="string"&&u!==i.entity):[],rings:i.rings??1})}return t}function $c(n){let e=new Map(n.filter(i=>i.playing).map(i=>[i.entity,i])),t=[],r=new Set;for(let i of e.values())for(let o of i.group){let s=e.get(o),a=[i.entity,o].sort().join("|");s&&!r.has(a)&&(r.add(a),t.push([i,s]))}return t}var yp=3;function Mc(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!o.type.endsWith(":sprinkler"))continue;let s=t?.get(o.id)?.entity??null;!s||!te(n.states[s])||r.push({id:o.id,at:{floorId:i.id,x:o.x,y:oe(i,o)+o.h,z:o.z},reach:Math.min(15,Math.max(.5,o.spray??yp))})}return r}var Zr=n=>n&&n!=="none"?n:null,Ac=n=>Math.min(1,Math.max(0,n));function Rc(n,e){let t=new Map;for(let r of e.settings.roof?.windows??[]){let i=Ve(n,{cover:Zr(r.cover),contact:Zr(r.contact),tilt:Zr(r.tilt)},"window"),o=Zr(r.window),s=o?n.states[o]:void 0,a=i.open;if(s&&!C(s)){let l=s.attributes.current_position;a=typeof l=="number"?Ac(l/100):s.state==="open"||s.state==="opening"?1:0}t.set(r.id,{open:a,tilt:i.tilt,cover:i.cover??0})}return t}function vp(n,e){let t=i=>Math.hypot(i.x-e.x,i.z-e.z);return n.placements.filter(i=>i.entity_id.startsWith("media_player.")&&t(i)<Math.max(2,e.w)).sort((i,o)=>t(i)-t(o))[0]?.entity_id??null}var st=(n,e)=>typeof n[e]=="string"?n[e]:"";function Ec(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!vr(o.type))continue;let s=t?.get(o.id)?.entity??null,a=s?.startsWith("media_player.")?s:vp(i,o),l=a?n.states[a]:void 0;if(!l||!zo(l))continue;let c=l.attributes,u=st(c,"app_name")||st(c,"source")||null;r.push({id:o.id,furnitureId:o.id,floorId:i.id,color:Eo(u),title:st(c,"media_title")||st(c,"media_channel")||u||"",subtitle:st(c,"media_artist")||st(c,"media_series_title")||st(c,"media_album_name"),app:u,picture:st(c,"entity_picture")||null,playing:To(l),ambilight:o.ambilight??1})}return r}function zc(n){let e=n.states["sun.sun"]?.attributes;return typeof e?.elevation=="number"&&typeof e.azimuth=="number"?{elevation:e.elevation,azimuth:e.azimuth}:null}function Tc(n,e){return(n===null?0:Ac((n+4)/16))*(1-.45*e)}function at(n,e){return n.states["weather.nextfloor_symcon"]?"weather.nextfloor_symcon":e&&n.states[e]?e:Object.keys(n.states).filter(t=>t.startsWith("weather.")).sort()[0]??null}var Yr=new Set(["contact_lost","unlocked_night","own"]);function wp(n,e){let t=n.states[e.entity];if(!t||["unavailable","unknown"].includes(t.state))return!1;let r=(e.state??"on").trim(),i=/^([<>])\s*(-?\d+(?:[.,]\d+)?)$/.exec(r);if(i){let o=Number(t.state),s=Number(i[2].replace(",","."));return Number.isFinite(o)&&(i[1]==="<"?o<s:o>s)}return r.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean).includes(String(t.state).toLowerCase())}var xp=600*1e3,kp=new Set(["rainy","pouring","lightning-rainy","hail","snowy-rainy"]),Sp=new Map([["smoke","smoke"],["gas","gas"],["carbon_monoxide","co"],["moisture","water"]]),Fc=(n,e)=>{if(e.startsWith("binary_sensor."))return Sp.get(String(n.states[e]?.attributes.device_class))};function $p(n,e){let t=new Set,r=[];for(let i of n.floors)for(let o of i.openings){let s=e.get(o.id);for(let a of s?[s.contact,s.contact2,s.tilt,s.tilt2]:[])!a||t.has(a)||(t.add(a),r.push({floorId:i.id,roomId:o.room_id,entity:a}))}return r}function Dc(n,e,t,r){let i=[];for(let a o
Line truncated
|
||||||
${ne`<circle cx="27" cy="27" r=${22} class="live-ring-bg"></circle>
|
${ne`<circle cx="27" cy="27" r=${22} class="live-ring-bg"></circle>
|
||||||
<circle cx="27" cy="27" r=${22} stroke=${e} stroke-dasharray=${`${(r*Math.max(0,Math.min(1,n))).toFixed(1)} ${r.toFixed(1)}`} transform="rotate(-90 27 27)" class="live-ring-fg"></circle>`}
|
<circle cx="27" cy="27" r=${22} stroke=${e} stroke-dasharray=${`${(r*Math.max(0,Math.min(1,n))).toFixed(1)} ${r.toFixed(1)}`} transform="rotate(-90 27 27)" class="live-ring-fg"></circle>`}
|
||||||
</svg>`}function Pf(n,e,t,r){let i=e.summary,o=c=>$(n,c),s=e.autarky,a=r?p`<button class="live-fold" title=${o(r.folded?"live_unfold":"live_fold")} aria-label=${o(r.folded?"live_unfold":"live_fold")} aria-expanded=${!r.folded} @click=${r.toggle}>${r.folded?"+":"\u2212"}</button>`:f;if(r?.folded){let c=i.solar!==null?`\u2600 ${ze(n,i.solar)}`:i.consumption!==null?`\u2302 ${ze(n,i.consumption)}`:null;return p`<div class="live-card live-card-house live-folded" data-i=${t}>
|
</svg>`}function Pf(n,e,t,r){let i=e.summary,o=c=>$(n,c),s=e.autarky,a=r?p`<button class="live-fold" title=${o(r.folded?"live_unfold":"live_fold")} aria-label=${o(r.folded?"live_unfold":"live_fold")} aria-expanded=${!r.folded} @click=${r.toggle}>${r.folded?"+":"\u2212"}</button>`:f;if(r?.folded){let c=i.solar!==null?`\u2600 ${ze(n,i.solar)}`:i.consumption!==null?`\u2302 ${ze(n,i.consumption)}`:null;return p`<div class="live-card live-card-house live-folded" data-i=${t}>
|
||||||
@@ -915,7 +915,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
/>`:f}
|
/>`:f}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`}function Eu(n){let e=[...n.querySelectorAll(".live-card")].filter(s=>s.style.visibility!=="hidden"&&s.offsetWidth>0),t=[],r=e[0]?.parentElement?.clientWidth??0,i=e[0]?.parentElement?.clientHeight??0,o=e.map(s=>{let[a,l]=[Number(s.dataset.x),s.offsetWidth],c=r?r>l+16?Math.min(Math.max(a,l/2+8),r-l/2-8):r/2:a;return s.style.setProperty("--live-dx",`${Math.round(a-c)}px`),{el:s,x:c,y:Number(s.dataset.y),w:l,h:s.offsetHeight}}).sort((s,a)=>Number(a.el.dataset.priority||0)-Number(s.el.dataset.priority||0)||a.y-s.y);for(let s of o){let a=s.y;if((s.el.classList.contains("live-card-hydronic")||s.el.classList.contains("live-card-charging"))&&r>s.w+16&&i>s.h+16){let h=[s.x,s.w/2+8,r-s.w/2-8,...t.flatMap(g=>[g.x0-s.w/2-8,g.x1+s.w/2+8])].filter(g=>g>=s.w/2+8&&g<=r-s.w/2-8).sort((g,_)=>Math.abs(g-s.x)-Math.abs(_-s.x)),m=[Math.max(s.h+8,Math.min(i-8,a)),...t.flatMap(g=>[g.y0-8,g.y1+s.h+8])].filter(g=>g>=s.h+8&&g<=i-8),d;for(let g of m){for(let _ of h)if(!t.some(b=>_-s.w/2<b.x1+6&&_+s.w/2>b.x0-6&&g-s.h<b.y1+6&&g>b.y0-6)){d={x:_,y:g};break}if(d)break}d&&(s.x=d.x,a=d.y)}for(let h=0;h<12;h++){let m={x0:s.x-s.w/2,x1:s.x+s.w/2,y0:a-s.h,y1:a},d=t.find(g=>m.x0<g.x1+6&&m.x1>g.x0-6&&m.y0<g.y1+6&&m.y1>g.y0-6);if(!d)break;a=d.y0-8}let l=s.y-a,c=!s.el.classList.contains("live-card-house")&&!s.el.classList.contains("live-card-roomclimate")&&s.el.dataset.focused!=="1",u=s.el.classList.contains("live-card-hydronic")||s.el.classList.contains("live-card-charging");if(c&&i>0&&(a-s.h<8||a>i-8||!u&&Math.abs(l)>Math.max(100,Math.min(180,i*.25)))){s.el.style.visibility="hidden";continue}t.push({x0:s.x-s.w/2,x1:s.x+s.w/2,y0:a-s.h,y1:a}),s.el.style.setProperty("--live-dx",`${Math.round(Number(s.el.dataset.x)-s.x)}px`),s.el.style.transform=`translate(${Math.round(s.x)}px, ${Math.round(a)}px) translate(-50%, -100%)`,s.el.style.setProperty("--live-thread",`${Math.round(18+l)}px`)}}function Of(n,e,t){let r=e.printer,i=(c,u)=>$(n,c,u),o=r.progress??0,s=c=>new Intl.DateTimeFormat(n?.language??navigator.language,{hour:"2-digit",minute:"2-digit"}).format(new Date(c)),a=r.remaining!==null?r.remaining>=60?`${Math.floor(r.remaining/60)} h ${Math.round(r.remaining%60)} min`:`${Math.round(r.remaining)} min`:null,l=[r.nozzle!==null?`${i("printer_nozzle")} ${Math.round(r.nozzle)}\xB0`:null,r.bed!==null?`${i("printer_bed")} ${Math.round(r.bed)}\xB0`:null].filter(Boolean).join(" \xB7 ");return p`<div class="live-card live-card-printer ${r.printing?"live-charging":""}" data-i=${t}>
|
</div>`}function Ru(n){let e=[...n.querySelectorAll(".live-card")].filter(s=>s.style.visibility!=="hidden"&&s.offsetWidth>0),t=[],r=e[0]?.parentElement?.clientWidth??0,i=e[0]?.parentElement?.clientHeight??0,o=e.map(s=>{let[a,l]=[Number(s.dataset.x),s.offsetWidth],c=r?r>l+16?Math.min(Math.max(a,l/2+8),r-l/2-8):r/2:a;return s.style.setProperty("--live-dx",`${Math.round(a-c)}px`),{el:s,x:c,y:Number(s.dataset.y),w:l,h:s.offsetHeight}}).sort((s,a)=>Number(a.el.dataset.priority||0)-Number(s.el.dataset.priority||0)||a.y-s.y);for(let s of o){let a=s.y;if((s.el.classList.contains("live-card-hydronic")||s.el.classList.contains("live-card-charging"))&&r>s.w+16&&i>s.h+16){let h=[s.x,s.w/2+8,r-s.w/2-8,...t.flatMap(g=>[g.x0-s.w/2-8,g.x1+s.w/2+8])].filter(g=>g>=s.w/2+8&&g<=r-s.w/2-8).sort((g,_)=>Math.abs(g-s.x)-Math.abs(_-s.x)),m=[Math.max(s.h+8,Math.min(i-8,a)),...t.flatMap(g=>[g.y0-8,g.y1+s.h+8])].filter(g=>g>=s.h+8&&g<=i-8),d;for(let g of m){for(let _ of h)if(!t.some(b=>_-s.w/2<b.x1+6&&_+s.w/2>b.x0-6&&g-s.h<b.y1+6&&g>b.y0-6)){d={x:_,y:g};break}if(d)break}d&&(s.x=d.x,a=d.y)}for(let h=0;h<12;h++){let m={x0:s.x-s.w/2,x1:s.x+s.w/2,y0:a-s.h,y1:a},d=t.find(g=>m.x0<g.x1+6&&m.x1>g.x0-6&&m.y0<g.y1+6&&m.y1>g.y0-6);if(!d)break;a=d.y0-8}let l=s.y-a,c=!s.el.classList.contains("live-card-house")&&!s.el.classList.contains("live-card-roomclimate")&&s.el.dataset.focused!=="1",u=s.el.classList.contains("live-card-hydronic")||s.el.classList.contains("live-card-charging");if(c&&i>0&&(a-s.h<8||a>i-8||!u&&Math.abs(l)>Math.max(100,Math.min(180,i*.25)))){s.el.style.visibility="hidden";continue}t.push({x0:s.x-s.w/2,x1:s.x+s.w/2,y0:a-s.h,y1:a}),s.el.style.setProperty("--live-dx",`${Math.round(Number(s.el.dataset.x)-s.x)}px`),s.el.style.transform=`translate(${Math.round(s.x)}px, ${Math.round(a)}px) translate(-50%, -100%)`,s.el.style.setProperty("--live-thread",`${Math.round(18+l)}px`)}}function Of(n,e,t){let r=e.printer,i=(c,u)=>$(n,c,u),o=r.progress??0,s=c=>new Intl.DateTimeFormat(n?.language??navigator.language,{hour:"2-digit",minute:"2-digit"}).format(new Date(c)),a=r.remaining!==null?r.remaining>=60?`${Math.floor(r.remaining/60)} h ${Math.round(r.remaining%60)} min`:`${Math.round(r.remaining)} min`:null,l=[r.nozzle!==null?`${i("printer_nozzle")} ${Math.round(r.nozzle)}\xB0`:null,r.bed!==null?`${i("printer_bed")} ${Math.round(r.bed)}\xB0`:null].filter(Boolean).join(" \xB7 ");return p`<div class="live-card live-card-printer ${r.printing?"live-charging":""}" data-i=${t}>
|
||||||
<div class="live-own">
|
<div class="live-own">
|
||||||
${r.picture?p`<img class="live-print-pic" src=${r.picture} alt="" />`:Wn(o/100,r.printing?"#38bdf8":"#8aa0c8")}
|
${r.picture?p`<img class="live-print-pic" src=${r.picture} alt="" />`:Wn(o/100,r.printing?"#38bdf8":"#8aa0c8")}
|
||||||
<div class="live-own-text"><b>${r.progress!==null?`${Math.round(o)} %`:"\u2013"}</b><span>${i(`printer_${r.printing?"printing":/finish|complete|fertig/.test(r.status)?"done":/pause/.test(r.status)?"paused":/error|fail/.test(r.status)?"error":"idle"}`)}</span></div>
|
<div class="live-own-text"><b>${r.progress!==null?`${Math.round(o)} %`:"\u2013"}</b><span>${i(`printer_${r.printing?"printing":/finish|complete|fertig/.test(r.status)?"done":/pause/.test(r.status)?"paused":/error|fail/.test(r.status)?"error":"idle"}`)}</span></div>
|
||||||
@@ -949,7 +949,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
</div>`}function Vf(n,e,t){let r=e.power===null?"\u2013":`${e.power<0?"\u2212":""}${ze(n,e.power)}`;return p`<div class="live-card live-card-power ${(e.readings??[]).length?"live-card-charging":""}" data-i=${t} data-furniture=${e.id} role="group" aria-label=${e.name}>
|
</div>`}function Vf(n,e,t){let r=e.power===null?"\u2013":`${e.power<0?"\u2212":""}${ze(n,e.power)}`;return p`<div class="live-card live-card-power ${(e.readings??[]).length?"live-card-charging":""}" data-i=${t} data-furniture=${e.id} role="group" aria-label=${e.name}>
|
||||||
<div class="live-power-name">${e.name}</div>${e.powerEntity?p`<div class="live-row"><span aria-hidden="true">⚡</span><b>${r}</b>${G(n,[e.powerEntity],e.name)}</div>`:f}
|
<div class="live-power-name">${e.name}</div>${e.powerEntity?p`<div class="live-row"><span aria-hidden="true">⚡</span><b>${r}</b>${G(n,[e.powerEntity],e.name)}</div>`:f}
|
||||||
${(e.readings??[]).map(i=>p`<div class="live-row live-charging-row" data-reading=${i.id}><span class="live-charging-label" title=${i.label}><span aria-hidden="true">${i.icon}</span> ${i.label}</span><b title=${i.text}>${i.text}</b>${G(n,[i.entity],i.label)}</div>`)}
|
${(e.readings??[]).map(i=>p`<div class="live-row live-charging-row" data-reading=${i.id}><span class="live-charging-label" title=${i.label}><span aria-hidden="true">${i.icon}</span> ${i.label}</span><b title=${i.text}>${i.text}</b>${G(n,[i.entity],i.label)}</div>`)}
|
||||||
</div>`}function Ru(n,e,t,r,i=!1){return e.length?p`<div class="live-cards">
|
</div>`}function Eu(n,e,t,r,i=!1){return e.length?p`<div class="live-cards">
|
||||||
${e.map((o,s)=>o.kind==="roomclimate"?Bf(n,o,s):o.kind==="power"?Vf(n,o,s):o.kind==="hydronic"?p`<div class="live-card live-card-hydronic" data-i=${s} data-furniture=${o.item.id}><nf-hydronic-card .hass=${n} .item=${o.item} .readOnly=${o.readOnly}></nf-hydronic-card></div>`:i?f:o.kind==="house"?Pf(n,o,s,r):o.kind==="car"?Nf(n,o,s,t):o.kind==="printer"?Of(n,o,s):o.kind==="heatpump"?Wf(n,o,s):Lf(n,o,s,t))}
|
${e.map((o,s)=>o.kind==="roomclimate"?Bf(n,o,s):o.kind==="power"?Vf(n,o,s):o.kind==="hydronic"?p`<div class="live-card live-card-hydronic" data-i=${s} data-furniture=${o.item.id}><nf-hydronic-card .hass=${n} .item=${o.item} .readOnly=${o.readOnly}></nf-hydronic-card></div>`:i?f:o.kind==="house"?Pf(n,o,s,r):o.kind==="car"?Nf(n,o,s,t):o.kind==="printer"?Of(n,o,s):o.kind==="heatpump"?Wf(n,o,s):Lf(n,o,s,t))}
|
||||||
</div>`:f}var zu=J`
|
</div>`:f}var zu=J`
|
||||||
.live-card.live-card-power { display:grid; gap:4px; min-width:90px; max-width:220px; box-sizing:border-box; }
|
.live-card.live-card-power { display:grid; gap:4px; min-width:90px; max-width:220px; box-sizing:border-box; }
|
||||||
@@ -1616,7 +1616,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
.qm-note {
|
.qm-note {
|
||||||
color: var(--nf-muted);
|
color: var(--nf-muted);
|
||||||
}
|
}
|
||||||
`]};function Jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",es);var Qf=new URL(import.meta.url),Xf=new URL("./nextfloor-3d.js?v=0f70d07bff6e",Qf).href,Cu;function Nu(){return Cu??=import(Xf),Cu}function Lu(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ou="weather.nextfloor_symcon",Bu={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Wu=new WeakMap;function eg(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Wu.get(n)??new WeakMap;Wu.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ti(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=eg(De(s("condition"))),c=e.rain_sensor?n.states[e.rain_sensor]:void 0,u=le(c);u!==null&&e.rain_sensor_inverted&&(u=!u),u===null&&typeof o.precipitation=="number"&&(u=o.precipitation>0),le(s("lightning"))?l=u?"lightning-rainy":"lightning":le(s("snow"))?l=u?"snowy-rainy":"snowy":le(s("fog"))?l="fog":u===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":u===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&u===!1&&(l="sunny");let h={entity_id:Ou,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ou]:h}};return r.set(e,m),m}var rs=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${An[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Ol(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(c=>c.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${An[a]} ${Ie[a]}</span><div class="values">${l.map(c=>this.value(c))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
|
`]};function Jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",es);var Qf=new URL(import.meta.url),Xf=new URL("./nextfloor-3d.js?v=3c3ea11cac21",Qf).href,Cu;function Nu(){return Cu??=import(Xf),Cu}function Lu(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ou="weather.nextfloor_symcon",Bu={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Wu=new WeakMap;function eg(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Wu.get(n)??new WeakMap;Wu.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ti(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=eg(De(s("condition"))),c=e.rain_sensor?n.states[e.rain_sensor]:void 0,u=le(c);u!==null&&e.rain_sensor_inverted&&(u=!u),u===null&&typeof o.precipitation=="number"&&(u=o.precipitation>0),le(s("lightning"))?l=u?"lightning-rainy":"lightning":le(s("snow"))?l=u?"snowy-rainy":"snowy":le(s("fog"))?l="fog":u===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":u===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&u===!1&&(l="sunny");let h={entity_id:Ou,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ou]:h}};return r.set(e,m),m}var rs=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${An[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Ol(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(c=>c.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${An[a]} ${Ie[a]}</span><div class="values">${l.map(c=>this.value(c))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
|
||||||
<button class="heading" aria-expanded=${!o} @click=${()=>{this.folded=!o}}><span>${t?"Bereiche":"Stockwerke"}<small>${t?.name||"Gesamtgeb\xE4ude"}</small></span><span aria-hidden="true">${o?"+":"\u2212"}</span></button>
|
<button class="heading" aria-expanded=${!o} @click=${()=>{this.folded=!o}}><span>${t?"Bereiche":"Stockwerke"}<small>${t?.name||"Gesamtgeb\xE4ude"}</small></span><span aria-hidden="true">${o?"+":"\u2212"}</span></button>
|
||||||
${o?f:p`<div class="entries"><div class="columns"><span></span><span title="Leistung bzw. Durchfluss">Leistung</span><span>Energie / Verbrauch</span></div>
|
${o?f:p`<div class="entries"><div class="columns"><span></span><span title="Leistung bzw. Durchfluss">Leistung</span><span>Energie / Verbrauch</span></div>
|
||||||
${i.map(s=>p`<section class="entry" data-area=${t?s.id:f}>
|
${i.map(s=>p`<section class="entry" data-area=${t?s.id:f}>
|
||||||
@@ -1660,9 +1660,9 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
.kind { color:var(--nf-muted); font-size:10px; white-space:nowrap; }
|
.kind { color:var(--nf-muted); font-size:10px; white-space:nowrap; }
|
||||||
.row .value b { font-size:11px; font-weight:normal; }
|
.row .value b { font-size:11px; font-weight:normal; }
|
||||||
@media(max-width:600px) { .entries { max-height:32vh; } }
|
@media(max-width:600px) { .entries { max-height:32vh; } }
|
||||||
`};customElements.get("nf-utility-overview")||customElements.define("nf-utility-overview",rs);var Vu="image:";function is(n,e,t){let r=(e??"").trim();if(!r)return null;if(r.startsWith(Vu))return t(r.slice(Vu.length));if(/^(https?:\/\/|\/)/.test(r))return r;if(/^[a-z_]+\.[a-z0-9_]+$/.test(r)){let i=n?.states[r]?.attributes.entity_picture;return typeof i=="string"&&i?i:null}return null}var Bn=n=>Number(n);function Kn(n){if(Array.isArray(n)){let[o,s]=[Bn(n[0]),Bn(n[1])];return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}if(!n||typeof n!="object")return null;let{x:e,y:t}=n,[r,i]=[Bn(e),Bn(t)];return Number.isFinite(r)&&Number.isFinite(i)?[r,i]:null}function Ku(n){return n?Kn(n.charger)??Kn(n.charger_position):null}function Gu(n){for(let[e,t]of Object.entries(n.states))if(e.startsWith("camera.")&&(Kn(t.attributes?.vacuum_position)??Ku(t.attributes)))return e;return null}var tg=n=>Array.isArray(n)?typeof n[0]=="number":!!n&&typeof n=="object",Vn=(n,e)=>e?[n[0],-n[1]]:n;function ng(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Vn(n.ga,e),[i,o]=Vn(n.gb,e),[s,a]=n.a,[l,c]=n.b,[u,h]=[i-t,o-r],[m,d]=[l-s,c-a],g=Math.hypot(u,h),_=Math.hypot(m,d);if(!(g>1e-6)||!(_>1e-6))return null;let b=_/g,y=Math.atan2(d,m)-Math.atan2(h,u),[S,k]=[Math.cos(y),Math.sin(y)];return M=>{let z=Vn(M,e),[R,D]=[z[0]-t,z[1]-r];return[s+b*(R*S-D*k),a+b*(R*k+D*S)]}}function rg(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Vn(n.ga,e),[i,o]=Vn(n.gb,e),s=Math.atan2(n.b[1]-n.a[1],n.b[0]-n.a[0])-Math.atan2(o-r,i-t);return Number.isFinite(s)?s:null}function Uu(n,e,t){if(!e)return null;let r=n.states[e]?.attributes;if(!r)return null;let i=ng(t)??(g=>g),o=rg(t)??0,s=t?.mirror===!0?-1:1,a=r.vacuum_position,l=Kn(a),c=l?(()=>{let[g,_]=i(l),b=Bn(a?.a)*s;if(!Number.isFinite(b))return{x:g,z:_,heading:0};let y=b*Math.PI/180+o;return{x:g,z:_,heading:Math.atan2(Math.cos(y),Math.sin(y))}})():null,u=Ku(r),h=Array.isArray(r.path)?r.path:[],m=h.length>0&&tg(h[0])?[h]:h,d=[];for(let g of m){let _=[];for(let b of Array.isArray(g)?g:[]){let y=Kn(b);y&&_.push(i(y))}_.length>1&&d.push(_)}return!c&&!u&&!d.length?null:{pose:c,charger:u?i(u):null,path:d}}var ju="nextfloor.lock3d",qu=520,ss=class extends Q{static properties={hass:{attribute:!1},building:{attribute:!1},floorId:{attribute:!1},roomId:{attribute:!1},wallMode:{attribute:!1},solidWalls:{attribute:!1},glassWalls:{attribute:!1},explode:{type:Boolean},keepRoof:{attribute:!1},markerMode:{attribute:!1},markerNames:{attribute:!1},markersOutside:{attribute:!1},tapInRoom:{type:Boolean},roomDoubleTap:{attribute:!1},heatMode:{attribute:!1},theme:{attribute:!1},accent:{attribute:!1},furnitureColors:{attribute:!1},packs:{attribute:!1},showEnergy:{attribute:!1},flows:{attribute:!1},holograms:{attribute:!1},furnish:{type:Boolean},surfaceGrab:{attribute:!1},furnishTypes:{attribute:!1},weather:{type:Boolean},weatherEntityId:{attribute:!1},weatherDensity:{attribute:!1},timeOfDay:{attribute:!1},selectedFurniture:{attribute:!1},selectedDevice:{attribute:!1},_sky:{state:!0},quality:{attribute:!1},showStats:{type:Boolean},_stats:{state:!0},_error:{state:!0},_energy:{state:!0},_flows:{state:!0},_liveEnergy:{state:!0},_liveCards:{state:!0},_liveCardOn:{state:!0},_houseFolded:{state:!0},_utilityOverviewVisible:{state:!0},_swipe:{state:!0},_menu:{state:!0},_pluginWindow:{state:!0},_plate:{state:!0},_blend:{state:!0},_wallBig:{state:!0},_find:{state:!0},_central:{state:!0},_thumbsCompact:{state:!0},_armed:{state:!0},central:{attribute:!1},centralOpen:{attribute:!1},keepCamera:{attribute:!1},plain:{attribute:!1},rightBack:{attribute:!1},templateName:{attribute:!1},readable:{type:Boolean,reflect:!0},today:{attribute:!1},_todayOpen:{state:!0},_todayItems:{state:!0},_forecast:{state:!0},zoom:{attribute:!1},buttons:{attribute:!1},_thumbs:{state:!0},floorThumbs:{attribute:!1},clean:{attribute:!1},cleanButton:{attribute:!1},clock:{attribute:!1},lockButton:{attribute:!1},walkButton:{attribute:!1},travelButton:{attribute:!1},_travel:{state:!0},_walking:{state:!0},_stick:{state:!0},_locked:{state:!0},_now:{state:!0},roomLabels:{attribute:!1},roomNamesButton:{attribute:!1},floorStack:{attribute:!1},panelOpen:{attribute:!1},alerts:{attribute:!1},alertJump:{attribute:!1},scenes:{attribute:!1},announcements:{attribute:!1},sensorBar:{attribute:!1},screenName:{attribute:!1},_announcement:{state:!0},dimmed:{attribute:!1},autoOrbit:{attribute:!1},startView:{attribute:!1},outsideOpen:{attribute:!1},_low:{state:!0},_narrowStage:{state:!0},_shortStage:{state:!0},_phoneStage:{state:!0},_alerts:{state:!0},_sceneFired:{state:!0}};stopAnnouncements=null;announceTimer;get liveCardsOn(){return this.holograms??this._liveCardOn}cloud=0;confirmSet=new Set;shownStartView;placementInfo=new Map;live=null;travelTimer;dayCurves=null;curvesAt=0;clockTimer;stopPlugins=null;pluginsDirty=!1;resizeObs=null;alertSrc=null;alertTimer;contactTimer;seenAlerts=new Set;roomFlash=null;findIndex=null;tintSig="";thumbTimer;thumbSig="";thumbsAt=0;armTimer;forecastAt=0;forecastKey
Line truncated
|
`};customElements.get("nf-utility-overview")||customElements.define("nf-utility-overview",rs);var Vu="image:";function is(n,e,t){let r=(e??"").trim();if(!r)return null;if(r.startsWith(Vu))return t(r.slice(Vu.length));if(/^(https?:\/\/|\/)/.test(r))return r;if(/^[a-z_]+\.[a-z0-9_]+$/.test(r)){let i=n?.states[r]?.attributes.entity_picture;return typeof i=="string"&&i?i:null}return null}var Bn=n=>Number(n);function Kn(n){if(Array.isArray(n)){let[o,s]=[Bn(n[0]),Bn(n[1])];return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}if(!n||typeof n!="object")return null;let{x:e,y:t}=n,[r,i]=[Bn(e),Bn(t)];return Number.isFinite(r)&&Number.isFinite(i)?[r,i]:null}function Ku(n){return n?Kn(n.charger)??Kn(n.charger_position):null}function Gu(n){for(let[e,t]of Object.entries(n.states))if(e.startsWith("camera.")&&(Kn(t.attributes?.vacuum_position)??Ku(t.attributes)))return e;return null}var tg=n=>Array.isArray(n)?typeof n[0]=="number":!!n&&typeof n=="object",Vn=(n,e)=>e?[n[0],-n[1]]:n;function ng(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Vn(n.ga,e),[i,o]=Vn(n.gb,e),[s,a]=n.a,[l,c]=n.b,[u,h]=[i-t,o-r],[m,d]=[l-s,c-a],g=Math.hypot(u,h),_=Math.hypot(m,d);if(!(g>1e-6)||!(_>1e-6))return null;let b=_/g,y=Math.atan2(d,m)-Math.atan2(h,u),[S,k]=[Math.cos(y),Math.sin(y)];return M=>{let z=Vn(M,e),[E,D]=[z[0]-t,z[1]-r];return[s+b*(E*S-D*k),a+b*(E*k+D*S)]}}function rg(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Vn(n.ga,e),[i,o]=Vn(n.gb,e),s=Math.atan2(n.b[1]-n.a[1],n.b[0]-n.a[0])-Math.atan2(o-r,i-t);return Number.isFinite(s)?s:null}function Uu(n,e,t){if(!e)return null;let r=n.states[e]?.attributes;if(!r)return null;let i=ng(t)??(g=>g),o=rg(t)??0,s=t?.mirror===!0?-1:1,a=r.vacuum_position,l=Kn(a),c=l?(()=>{let[g,_]=i(l),b=Bn(a?.a)*s;if(!Number.isFinite(b))return{x:g,z:_,heading:0};let y=b*Math.PI/180+o;return{x:g,z:_,heading:Math.atan2(Math.cos(y),Math.sin(y))}})():null,u=Ku(r),h=Array.isArray(r.path)?r.path:[],m=h.length>0&&tg(h[0])?[h]:h,d=[];for(let g of m){let _=[];for(let b of Array.isArray(g)?g:[]){let y=Kn(b);y&&_.push(i(y))}_.length>1&&d.push(_)}return!c&&!u&&!d.length?null:{pose:c,charger:u?i(u):null,path:d}}var ju="nextfloor.lock3d",qu=520,ss=class extends Q{static properties={hass:{attribute:!1},building:{attribute:!1},floorId:{attribute:!1},roomId:{attribute:!1},wallMode:{attribute:!1},solidWalls:{attribute:!1},glassWalls:{attribute:!1},explode:{type:Boolean},keepRoof:{attribute:!1},markerMode:{attribute:!1},markerNames:{attribute:!1},markersOutside:{attribute:!1},tapInRoom:{type:Boolean},roomDoubleTap:{attribute:!1},heatMode:{attribute:!1},theme:{attribute:!1},accent:{attribute:!1},furnitureColors:{attribute:!1},packs:{attribute:!1},showEnergy:{attribute:!1},flows:{attribute:!1},holograms:{attribute:!1},furnish:{type:Boolean},surfaceGrab:{attribute:!1},furnishTypes:{attribute:!1},weather:{type:Boolean},weatherEntityId:{attribute:!1},weatherDensity:{attribute:!1},timeOfDay:{attribute:!1},selectedFurniture:{attribute:!1},selectedDevice:{attribute:!1},_sky:{state:!0},quality:{attribute:!1},showStats:{type:Boolean},_stats:{state:!0},_error:{state:!0},_energy:{state:!0},_flows:{state:!0},_liveEnergy:{state:!0},_liveCards:{state:!0},_liveCardOn:{state:!0},_houseFolded:{state:!0},_utilityOverviewVisible:{state:!0},_swipe:{state:!0},_menu:{state:!0},_pluginWindow:{state:!0},_plate:{state:!0},_blend:{state:!0},_wallBig:{state:!0},_find:{state:!0},_central:{state:!0},_thumbsCompact:{state:!0},_armed:{state:!0},central:{attribute:!1},centralOpen:{attribute:!1},keepCamera:{attribute:!1},plain:{attribute:!1},rightBack:{attribute:!1},templateName:{attribute:!1},readable:{type:Boolean,reflect:!0},today:{attribute:!1},_todayOpen:{state:!0},_todayItems:{state:!0},_forecast:{state:!0},zoom:{attribute:!1},buttons:{attribute:!1},_thumbs:{state:!0},floorThumbs:{attribute:!1},clean:{attribute:!1},cleanButton:{attribute:!1},clock:{attribute:!1},lockButton:{attribute:!1},walkButton:{attribute:!1},travelButton:{attribute:!1},_travel:{state:!0},_walking:{state:!0},_stick:{state:!0},_locked:{state:!0},_now:{state:!0},roomLabels:{attribute:!1},roomNamesButton:{attribute:!1},floorStack:{attribute:!1},panelOpen:{attribute:!1},alerts:{attribute:!1},alertJump:{attribute:!1},scenes:{attribute:!1},announcements:{attribute:!1},sensorBar:{attribute:!1},screenName:{attribute:!1},_announcement:{state:!0},dimmed:{attribute:!1},autoOrbit:{attribute:!1},startView:{attribute:!1},outsideOpen:{attribute:!1},_low:{state:!0},_narrowStage:{state:!0},_shortStage:{state:!0},_phoneStage:{state:!0},_alerts:{state:!0},_sceneFired:{state:!0}};stopAnnouncements=null;announceTimer;get liveCardsOn(){return this.holograms??this._liveCardOn}cloud=0;confirmSet=new Set;shownStartView;placementInfo=new Map;live=null;travelTimer;dayCurves=null;curvesAt=0;clockTimer;stopPlugins=null;pluginsDirty=!1;resizeObs=null;alertSrc=null;alertTimer;contactTimer;seenAlerts=new Set;roomFlash=null;findIndex=null;tintSig="";thumbTimer;thumbSig="";thumbsAt=0;armTimer;forecastAt=0;forecastKey
Line truncated
|
||||||
${e.map(t=>p`<button class="nf-chip" aria-pressed=${!this.hiddenLayers.has(t.id)} @click=${()=>this.toggleLayer(t.id)}>${this.hiddenLayers.has(t.id)?"\u25CC":"\u{1F441}"} ${t.name}</button>`)}
|
${e.map(t=>p`<button class="nf-chip" aria-pressed=${!this.hiddenLayers.has(t.id)} @click=${()=>this.toggleLayer(t.id)}>${this.hiddenLayers.has(t.id)?"\u25CC":"\u{1F441}"} ${t.name}</button>`)}
|
||||||
</div>`}syncDevices(e){let t=this.viewer,r=this.building;if(!t||!r||!this.hass)return;let i=this._travel,o=i&&!i.loading?Ut(this.hass,i.history,i.t):this.hass;if((e||!this.openingLinks||this.linkedRegistry!==o.entities)&&(this.openingLinks=Be(o,r.floors),this.furnitureLinks=Ke(o,r.floors),this.linkedRegistry=o.entities,this.findIndex=null,this.alertSrc=this.alerts?Dc(o,r,this.weatherEntityId,this.openingLinks):null,this.watched=Oc({hass:o,building:r,openingLinks:this.openingLinks,furnitureLinks:this.furnitureLinks,needsRoomSensors:this.heatMode!=="none"||this.roomLabels,alertSources:this.alertSrc,weatherEntityId:this.weatherEntityId}),e=!0),!(e||this.watched.some(v=>this.shownStates.get(v)!==o.states[v])))return;uo(o,r).join(",")!==this.shownFor?.key&&t.setBuilding(this.shownBuilding(o)),this.shownStates=new Map(this.watched.map(v=>[v,o.states[v]])),this.syncHydronics(t,r,o),this.refreshToday(r),this.refreshForecast(r);let a=Sn(o,r),l=rl(o,r.floors.some(v=>v.layer&&this.hiddenLayers.has(v.id))?this.shownBuilding(o):r);this.placementInfo=new Map(l.map(v=>[v.id,{floorId:v.floorId,roomId:v.roomId,x:v.x,z:v.z,y:v.y,rotation:v.rotation??0}]));let c=this.furnitureMarkers(o,r,new Set(l.map(v=>v.id)),new Set(a.map(v=>v.powerEntity)));a.push(...c.consumers);let u=$n(o,r,a,Ze(r,v=>this.furnitureLinks?.get(v.id)?.power??null)),h=new Map(a.filter(v=>v.id!==v.powerEntity).map(v=>[v.id,v.power]));this.confirmSet=bt(o,r.floors);let m=new Set(this.liveCardsOn?this._liveCards.flatMap(v=>v.kind==="media"?[v.media.entity]:v.kind==="car"?[v.spot]:[]):[]);for(let v of r.floors)for(let x of v.outdoor??[]){if(!x.area_id&&!x.temp_entity&&!x.pump_entity)continue;let B=x.temp_entity?o.states[x.temp_entity]:void 0,F=x.pump_entity?o.states[x.pump_entity]:void 0,[W,_e]=Te(x.points),ct=B&&Number.isFinite(Number(B.state))?`${L(o,ce(o,fr(Number(B.state),B.attributes.unit_of_measurement)),1)} ${re(o)}`:"",$t=!!F&&te(F);l.push({id:x.area_id?`outdoor:${x.id}`:x.pump_entity??x.temp_entity,floorId:v.id,roomId:null,x:W,z:_e,y:cr(v,x,W,_e)+.7,icon:Fe(x.type==="pool"?"pool":x.type==="terrace"?"table-chair":"tree-outline"),name:x.area_id&&o.areas?.[x.area_id]?.name||$(o,`out_${x.type}`),text:[ct,$t?$(o,"pool_pump_on"):""].filter(Boolean).join(" \xB7 "),active:$t,unavailable:!1,glow:null,show:"always"})}let d=new Map;for(let v of r.floors){for(let x of v.placements)x.pin_offset&&d.set(`${v.id}:${x.entity_id}`,x.pin_offset);for(let x of v.furniture)x.pin_offset&&d.set(`f:${x.id}`,x.pin_offset)}let g=v=>{let x=v.lamp?void 0:(v.furnitureId?d.get(`f:${v.furnitureId}`):void 0)??d.get(`${v.floorId}:${v.id}`);return x?{...v,x:v.x+(x.x??0),z:v.z+(x.z??0),y:v.y+(x.y??0)}:v};t.setDevices([...[...l,...c.markers].map(g).map(v=>{let x=v.show==="no_power"||"energyDevice"in v&&v.energyDevice?null:h.get(v.id)??null,B={...v,power:x,powerText:x===null?void 0:he(o,x),effect:this.dimmed?void 0:v.effect,text:this.subMeterText(o,r,u,v.furnitureId)??v.text},F=v.ownName&&(v.showName||this.markerNames)?v.ownName:"",W=m.has(v.id)||!!v.furnitureId&&m.has(v.furnitureId);return{...B,pin:this.showPin(B)&&!W,full:v.show==="always",caption:F}})]),t.setPickTargets(c.targets,this.openingTargets(),this.secondBlinds()),t.setScreens(c.screens),t.setFridgeDoors(Na(o,r.floors)),t.setCovers(Za(o,r)),t.setRobots(this.robotInfos(o,r));let _=new Map;for(let v of r.floors)for(let x of v.furniture)!X(x.type)?.pet||!x.room_sensor||x.room_sensor==="none"||_.set(x.id,Ji(o,v.rooms.filter(B=>B.points.length>=3),null,x.room_sensor)?.id??null);_.size&&t.setPetRooms(_),t.setRoofWindows(Ec(o,r)),t.setParked(Po(o,r)),t.setGateStates(Uc(o,r));let b=new Map(r.floors.flatMap(v=>v.openings.map(x=>[x.id,x.type]))),y=new Map([...this.openingLinks].map(([v,x])=>[v,Ve(o,x,b.get(v))]));t.setOpeningStates(y),this.setAlerts(this.alertSrc?Fo(o,r,this.alertSrc,this.openingLinks):[]),this.watchLostContacts(o);let S=[...l,...c.markers].map(v=>`${v.id}:${v.glow?`${v.glow.level.toFixed(1)}/${v.glow.color.map(x=>x.toFixed(1)).join("/")}`:0}`).join(";")+"|"+[...y].map(([v,x])=>`${v}:${x.open}:${x.cover===null?"-":x.cover.toFixed(1)}`).join(";");if(S!==this.thumbSig){let v=this.thumbSig==="";this.thumbSig=S,v||this.scheduleThumbs(1500)}let k=su(o,r,a,r.energy.advanced?v=>this.furnitureLinks?.get(v.id)?.power??null:void 0),M=this.liveCars(o,r);for(let v of M){if(!v.car.home||!v.car.charging&&!v.car.plugged)continue;let x=r.floors.flatMap(W=>W.furniture.filter(_e=>_e.type==="wallbox").map(_e=>({floorId:W.id,x:_e.x,z:_e.z,y:1}))).sort((W,_e)=>Math.hypot(W.x-v.at.x,W.z-v.at.z)-Math.hypot(_e.x-v.at.x,_e.z-v.at.z))[0],B=x&&x.floorId===v.at.floorId&&Math.hypot(x.x-v.at.x,x.z-v.at.z)<9,F=x??Nn(r);!F||!v.car.charging&&!B||k.arcs.push({key:`car:${v.spot}`,from:F,to:{...v.at,y:.8},power:v.car.charging?v.car.chargingW??7e3:0,color:[80,175,255],...B?{via:[{...F,y:.35},{floorId:v.at.floorId,x:(F.x+v.at.x)/2,z:(F.z+v.at.z)/2,y:.08},{...v.at,y:.5}],cable:!0}:{}})}let z=Nn(r);for(let v of this.liveHeatPumps(r)){let x=v.pump.heat??(v.Line truncated
|
</div>`}syncDevices(e){let t=this.viewer,r=this.building;if(!t||!r||!this.hass)return;let i=this._travel,o=i&&!i.loading?Ut(this.hass,i.history,i.t):this.hass;if((e||!this.openingLinks||this.linkedRegistry!==o.entities)&&(this.openingLinks=Be(o,r.floors),this.furnitureLinks=Ke(o,r.floors),this.linkedRegistry=o.entities,this.findIndex=null,this.alertSrc=this.alerts?Dc(o,r,this.weatherEntityId,this.openingLinks):null,this.watched=Oc({hass:o,building:r,openingLinks:this.openingLinks,furnitureLinks:this.furnitureLinks,needsRoomSensors:this.heatMode!=="none"||this.roomLabels,alertSources:this.alertSrc,weatherEntityId:this.weatherEntityId}),e=!0),!(e||this.watched.some(v=>this.shownStates.get(v)!==o.states[v])))return;uo(o,r).join(",")!==this.shownFor?.key&&t.setBuilding(this.shownBuilding(o)),this.shownStates=new Map(this.watched.map(v=>[v,o.states[v]])),this.syncHydronics(t,r,o),this.refreshToday(r),this.refreshForecast(r);let a=Sn(o,r),l=rl(o,r.floors.some(v=>v.layer&&this.hiddenLayers.has(v.id))?this.shownBuilding(o):r);this.placementInfo=new Map(l.map(v=>[v.id,{floorId:v.floorId,roomId:v.roomId,x:v.x,z:v.z,y:v.y,rotation:v.rotation??0}]));let c=this.furnitureMarkers(o,r,new Set(l.map(v=>v.id)),new Set(a.map(v=>v.powerEntity)));a.push(...c.consumers);let u=$n(o,r,a,Ze(r,v=>this.furnitureLinks?.get(v.id)?.power??null)),h=new Map(a.filter(v=>v.id!==v.powerEntity).map(v=>[v.id,v.power]));this.confirmSet=bt(o,r.floors);let m=new Set(this.liveCardsOn?this._liveCards.flatMap(v=>v.kind==="media"?[v.media.entity]:v.kind==="car"?[v.spot]:[]):[]);for(let v of r.floors)for(let x of v.outdoor??[]){if(!x.area_id&&!x.temp_entity&&!x.pump_entity)continue;let B=x.temp_entity?o.states[x.temp_entity]:void 0,F=x.pump_entity?o.states[x.pump_entity]:void 0,[W,_e]=Te(x.points),ct=B&&Number.isFinite(Number(B.state))?`${L(o,ce(o,fr(Number(B.state),B.attributes.unit_of_measurement)),1)} ${re(o)}`:"",$t=!!F&&te(F);l.push({id:x.area_id?`outdoor:${x.id}`:x.pump_entity??x.temp_entity,floorId:v.id,roomId:null,x:W,z:_e,y:cr(v,x,W,_e)+.7,icon:Fe(x.type==="pool"?"pool":x.type==="terrace"?"table-chair":"tree-outline"),name:x.area_id&&o.areas?.[x.area_id]?.name||$(o,`out_${x.type}`),text:[ct,$t?$(o,"pool_pump_on"):""].filter(Boolean).join(" \xB7 "),active:$t,unavailable:!1,glow:null,show:"always"})}let d=new Map;for(let v of r.floors){for(let x of v.placements)x.pin_offset&&d.set(`${v.id}:${x.entity_id}`,x.pin_offset);for(let x of v.furniture)x.pin_offset&&d.set(`f:${x.id}`,x.pin_offset)}let g=v=>{let x=v.lamp?void 0:(v.furnitureId?d.get(`f:${v.furnitureId}`):void 0)??d.get(`${v.floorId}:${v.id}`);return x?{...v,x:v.x+(x.x??0),z:v.z+(x.z??0),y:v.y+(x.y??0)}:v};t.setDevices([...[...l,...c.markers].map(g).map(v=>{let x=v.show==="no_power"||"energyDevice"in v&&v.energyDevice?null:h.get(v.id)??null,B={...v,power:x,powerText:x===null?void 0:he(o,x),effect:this.dimmed?void 0:v.effect,text:this.subMeterText(o,r,u,v.furnitureId)??v.text},F=v.ownName&&(v.showName||this.markerNames)?v.ownName:"",W=m.has(v.id)||!!v.furnitureId&&m.has(v.furnitureId);return{...B,pin:this.showPin(B)&&!W,full:v.show==="always",caption:F}})]),t.setPickTargets(c.targets,this.openingTargets(),this.secondBlinds()),t.setScreens(c.screens),t.setFridgeDoors(Na(o,r.floors)),t.setCovers(Za(o,r)),t.setRobots(this.robotInfos(o,r));let _=new Map;for(let v of r.floors)for(let x of v.furniture)!X(x.type)?.pet||!x.room_sensor||x.room_sensor==="none"||_.set(x.id,Ji(o,v.rooms.filter(B=>B.points.length>=3),null,x.room_sensor)?.id??null);_.size&&t.setPetRooms(_),t.setRoofWindows(Rc(o,r)),t.setParked(Po(o,r)),t.setGateStates(Uc(o,r));let b=new Map(r.floors.flatMap(v=>v.openings.map(x=>[x.id,x.type]))),y=new Map([...this.openingLinks].map(([v,x])=>[v,Ve(o,x,b.get(v))]));t.setOpeningStates(y),this.setAlerts(this.alertSrc?Fo(o,r,this.alertSrc,this.openingLinks):[]),this.watchLostContacts(o);let S=[...l,...c.markers].map(v=>`${v.id}:${v.glow?`${v.glow.level.toFixed(1)}/${v.glow.color.map(x=>x.toFixed(1)).join("/")}`:0}`).join(";")+"|"+[...y].map(([v,x])=>`${v}:${x.open}:${x.cover===null?"-":x.cover.toFixed(1)}`).join(";");if(S!==this.thumbSig){let v=this.thumbSig==="";this.thumbSig=S,v||this.scheduleThumbs(1500)}let k=su(o,r,a,r.energy.advanced?v=>this.furnitureLinks?.get(v.id)?.power??null:void 0),M=this.liveCars(o,r);for(let v of M){if(!v.car.home||!v.car.charging&&!v.car.plugged)continue;let x=r.floors.flatMap(W=>W.furniture.filter(_e=>_e.type==="wallbox").map(_e=>({floorId:W.id,x:_e.x,z:_e.z,y:1}))).sort((W,_e)=>Math.hypot(W.x-v.at.x,W.z-v.at.z)-Math.hypot(_e.x-v.at.x,_e.z-v.at.z))[0],B=x&&x.floorId===v.at.floorId&&Math.hypot(x.x-v.at.x,x.z-v.at.z)<9,F=x??Nn(r);!F||!v.car.charging&&!B||k.arcs.push({key:`car:${v.spot}`,from:F,to:{...v.at,y:.8},power:v.car.charging?v.car.chargingW??7e3:0,color:[80,175,255],...B?{via:[{...F,y:.35},{floorId:v.at.floorId,x:(F.x+v.at.x)/2,z:(F.z+v.at.z)/2,y:.08},{...v.at,y:.5}],cable:!0}:{}})}let z=Nn(r);for(let v of this.liveHeatPumps(r)){let x=v.pump.heat??(v.Line truncated
|
||||||
<button class="nf-thumbs-fold" title=${$(this.hass,r?"thumbs_show":"thumbs_fold")} aria-label=${$(this.hass,r?"thumbs_show":"thumbs_fold")} @click=${i}>${r?"\u25B8":"\u25C2"}</button>
|
<button class="nf-thumbs-fold" title=${$(this.hass,r?"thumbs_show":"thumbs_fold")} aria-label=${$(this.hass,r?"thumbs_show":"thumbs_fold")} @click=${i}>${r?"\u25B8":"\u25C2"}</button>
|
||||||
<button class="nf-thumb nf-thumb-house" aria-pressed=${this.floorId===null} @click=${()=>this.fire("floor-tap",{floorId:null})}>
|
<button class="nf-thumb nf-thumb-house" aria-pressed=${this.floorId===null} @click=${()=>this.fire("floor-tap",{floorId:null})}>
|
||||||
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="M3 11l9-7 9 7M5 10v10h14V10" /></svg>
|
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="M3 11l9-7 9 7M5 10v10h14V10" /></svg>
|
||||||
@@ -1809,7 +1809,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
${o?i.length?p`<ul>
|
${o?i.length?p`<ul>
|
||||||
${c}
|
${c}
|
||||||
</ul>`:p`<p class="nf-today-none">${$(t,"today_none")}</p>`:f}
|
</ul>`:p`<p class="nf-today-none">${$(t,"today_none")}</p>`:f}
|
||||||
</section>`}week=null;weekAt=0;refreshWeek(e){let t=this.hass;if(!t||this._travel||Date.now()-this.weekAt<36e5)return;this.weekAt=Date.now();let r=Ze(e,s=>this.furnitureLinks?.get(s.id)?.power??null),i=e.energy,o={solar:i.solar?[i.solar]:r.solar,grid:i.grid??r.grid,gridInvert:!!i.grid_invert,battery:i.battery?[i.battery]:r.battery,batteryInvert:!!i.battery_invert,consumption:i.consumption};tc(t,o).then(s=>{this.week=s,this.syncDevices(!0)}).catch(()=>this.week=null)}meterRows(e,t=null){let r=this.hass,i=[],o=this.floorId?e.floors.find(l=>l.id===this.floorId):void 0,s=o&&V(r)?Ce(r,o,e.floors.flatMap(l=>l.rooms)).find(l=>l.kind==="electricity"&&l.metric==="power"&&l.unit==="W"):void 0,a=V(r)?s?.value??null:o?.power_entity?q(r?.states[o.power_entity]):null;if(o&&(s||a!==null)){let l=!s?.incomplete&&a!==null&&t&&t>0?` \xB7 ${$(r,"floor_power_share",{n:Math.round(Math.max(0,a)/t*100)})}`:"";i.push({icon:"\u26A1",label:o.name,value:`${s?Ne(r,s):wt(r,a)}${l}`})}for(let[l,c,u]of[["gas","\u{1F525}","energy_gas_short"],["water","\u{1F4A7}","energy_water_short"]]){let h=e.energy[l],m=h?r?.states[h]:void 0;m&&!C(m)&&i.push({icon:c,label:$(r,u),value:se(r,m)})}return i}refreshDayCurves(e){let t=this.hass;if(!t||this._travel||Date.now()-this.curvesAt<6e5)return;this.curvesAt=Date.now();let r=a=>$n(a,e,Sn(a,e),Ze(e,l=>this.furnitureLinks?.get(l.id)?.power??null)),i=gc(t,r),o=Date.now(),s=o-24*36e5;zn(t,i,s,o,!0).then(a=>{this.dayCurves=_c(t,a,s,o,r),this.syncDevices(!0)}).catch(()=>this.dayCurves=null)}syncHydronics(e,t,r){let i=++this.hydronicGeneration,o=this.shownBuilding(r).floors.filter(s=>!this.floorId||s.id===this.floorId).flatMap(s=>s.furniture.filter(a=>ot(a.type)).map(a=>({floor:s,item:a})));if(!o.length){e.setHydronics([]),this.hydronicModule?.refreshHydronic(r,t,!!this._travel);return}jo().then(s=>{i!==this.hydronicGeneration||this.viewer!==e||!this.isConnected||(this.hydronicModule=s,e.setHydronics(o.map(({floor:a,item:l})=>({...s.hydronicVisual(r,l,a.id,oe(a,l)),animate:!this.dimmed&&!this._travel}))),s.refreshHydronic(r,t,!!this._travel))}).catch(s=>{this._error=String(s)})}syncLhCards(e,t,r,i,o,s){let a=[],l=r.summary,c=l.solar!==null||l.grid!==null||l.battery!==null||l.consumption!==null,u=Nn(t),h=(this.floorId?t.floors.find(m=>m.id===this.floorId):void 0)??[...t.floors].sort((m,d)=>d.elevation-m.elevation)[0];if(this.liveCardsOn&&!this.dimmed&&!this.roomId&&c&&u&&h){let m=0,d=0,g=0;for(let _ of h.rooms)for(let[b,y]of _.points)m+=b,d+=y,g++;a.push({kind:"house",at:{floorId:h.id,x:g?m/g:u.x,z:g?d/g:u.z,y:h.height+(this.floorId?1.2:3.2)},summary:l,autarky:r.autarky,curves:this.dayCurves??void 0,week:this.week??void 0,meters:this.meterRows(t,l.consumption)}),this.refreshDayCurves(t),this.refreshWeek(t)}if(this.liveCardsOn&&!this.dimmed&&!this.roomId){for(let m of i)a.push({kind:"car",at:m.at,spot:m.spot,name:m.name,car:m.car});for(let m of this.livePrinters(t))a.push({kind:"printer",at:m.at,name:m.name,printer:m.printer});for(let m of this.liveHeatPumps(t))a.push({kind:"heatpump",at:m.at,name:m.name,pump:m.pump});for(let m of o)a.push({kind:"media",at:{...m.at,y:m.at.y+.5},media:m})}if(this.liveCardsOn&&!this.dimmed){a.push(...au(s,t,this.floorId,this.roomId)),a.push(...lu(s,t,this.furnitureLinks??new Map,this.floorId,this.roomId));for(let m of t.floors)for(let d of m.furniture){if(!ot(d.type)||d.hydronic?.card===!1||this.floorId&&m.id!==this.floorId||!Ue(s,d))continue;let g=this.roomId?m.rooms.find(_=>_.id===this.roomId):null;this.roomId&&(!g||!H([d.x,d.z],g.points))||a.push({kind:"hydronic",item:d,readOnly:!!this._travel,at:{floorId:m.id,x:d.x+(d.pin_offset?.x??0),z:d.z+(d.pin_offset?.z??0),y:oe(m,d)+d.h+.3+(d.pin_offset?.y??0)}})}}JSON.stringify(a)!==JSON.stringify(this._liveCards)&&(this._liveCards=a),e.setLiveAnchors(a.map(m=>m.at),a.length?(m,d,g,_,b)=>this.placeLhCard(m,d,g,_,b):null)}placeLhCard(e,t,r,i,o){let s=this.renderRoot.querySelector(`.live-card[data-i="${e}"]`);if(!s)return;let a=this._liveCards[e],l=`${a.kind}:${a.at.floorId}:${a.at.x}:${a.at.z}`,c=s.dataset.zoomKey===l&&s.dataset.zoomVisible==="1",u=this.shadowRoot?.activeElement,h=!!u&&s.contains(u),m=h||Tu(a,o,c);s.dataset.zoomKey=l,s.dataset.zoomVisible=m?"1":"0",s.dataset.density=String(Math.round(o)),s.dataset.priority=String(h?110:Qo(a).priority),s.dataset.focused=h?"1":"0",s.dataset.x=String(t),s.dataset.y=String(r),s.style.visibility=i&&m?"visible":"hidden",e===this._liveCards.length-1&&Eu(this.renderRoot)}toggleHouseFold(){this._houseFolded=!this._houseFolded;try{localStorage.setItem("nextfloor.house_card_folded",this._houseFolded?"1":"0")}catch{}}toggleLhCards(){this._liveCardOn=!this._liveCardOn;try{localStorage.setItem("nextfloor.cards",this._liveCardOn?"1":"0")}catch{}this.syncDevices(!0)}renderTopLeft(){let e=this.clean?f:this.renderLhEnergy(),t=this.renderForecast("top_left");return this.clock!=="top_left"&&t===f||!this.hass?e:p`<div class="nf-topleft">${this.clock==="top_left"?this.renderClock(!0):f}${e}${t}</div>`}renLine truncated
|
</section>`}week=null;weekAt=0;refreshWeek(e){let t=this.hass;if(!t||this._travel||Date.now()-this.weekAt<36e5)return;this.weekAt=Date.now();let r=Ze(e,s=>this.furnitureLinks?.get(s.id)?.power??null),i=e.energy,o={solar:i.solar?[i.solar]:r.solar,grid:i.grid??r.grid,gridInvert:!!i.grid_invert,battery:i.battery?[i.battery]:r.battery,batteryInvert:!!i.battery_invert,consumption:i.consumption};tc(t,o).then(s=>{this.week=s,this.syncDevices(!0)}).catch(()=>this.week=null)}meterRows(e,t=null){let r=this.hass,i=[],o=this.floorId?e.floors.find(l=>l.id===this.floorId):void 0,s=o&&V(r)?Ce(r,o,e.floors.flatMap(l=>l.rooms)).find(l=>l.kind==="electricity"&&l.metric==="power"&&l.unit==="W"):void 0,a=V(r)?s?.value??null:o?.power_entity?q(r?.states[o.power_entity]):null;if(o&&(s||a!==null)){let l=!s?.incomplete&&a!==null&&t&&t>0?` \xB7 ${$(r,"floor_power_share",{n:Math.round(Math.max(0,a)/t*100)})}`:"";i.push({icon:"\u26A1",label:o.name,value:`${s?Ne(r,s):wt(r,a)}${l}`})}for(let[l,c,u]of[["gas","\u{1F525}","energy_gas_short"],["water","\u{1F4A7}","energy_water_short"]]){let h=e.energy[l],m=h?r?.states[h]:void 0;m&&!C(m)&&i.push({icon:c,label:$(r,u),value:se(r,m)})}return i}refreshDayCurves(e){let t=this.hass;if(!t||this._travel||Date.now()-this.curvesAt<6e5)return;this.curvesAt=Date.now();let r=a=>$n(a,e,Sn(a,e),Ze(e,l=>this.furnitureLinks?.get(l.id)?.power??null)),i=gc(t,r),o=Date.now(),s=o-24*36e5;zn(t,i,s,o,!0).then(a=>{this.dayCurves=_c(t,a,s,o,r),this.syncDevices(!0)}).catch(()=>this.dayCurves=null)}syncHydronics(e,t,r){let i=++this.hydronicGeneration,o=this.shownBuilding(r).floors.filter(s=>!this.floorId||s.id===this.floorId).flatMap(s=>s.furniture.filter(a=>ot(a.type)).map(a=>({floor:s,item:a})));if(!o.length){e.setHydronics([]),this.hydronicModule?.refreshHydronic(r,t,!!this._travel);return}jo().then(s=>{i!==this.hydronicGeneration||this.viewer!==e||!this.isConnected||(this.hydronicModule=s,e.setHydronics(o.map(({floor:a,item:l})=>({...s.hydronicVisual(r,l,a.id,oe(a,l)),animate:!this.dimmed&&!this._travel}))),s.refreshHydronic(r,t,!!this._travel))}).catch(s=>{this._error=String(s)})}syncLhCards(e,t,r,i,o,s){let a=[],l=r.summary,c=l.solar!==null||l.grid!==null||l.battery!==null||l.consumption!==null,u=Nn(t),h=(this.floorId?t.floors.find(m=>m.id===this.floorId):void 0)??[...t.floors].sort((m,d)=>d.elevation-m.elevation)[0];if(this.liveCardsOn&&!this.dimmed&&!this.roomId&&c&&u&&h){let m=0,d=0,g=0;for(let _ of h.rooms)for(let[b,y]of _.points)m+=b,d+=y,g++;a.push({kind:"house",at:{floorId:h.id,x:g?m/g:u.x,z:g?d/g:u.z,y:h.height+(this.floorId?1.2:3.2)},summary:l,autarky:r.autarky,curves:this.dayCurves??void 0,week:this.week??void 0,meters:this.meterRows(t,l.consumption)}),this.refreshDayCurves(t),this.refreshWeek(t)}if(this.liveCardsOn&&!this.dimmed&&!this.roomId){for(let m of i)a.push({kind:"car",at:m.at,spot:m.spot,name:m.name,car:m.car});for(let m of this.livePrinters(t))a.push({kind:"printer",at:m.at,name:m.name,printer:m.printer});for(let m of this.liveHeatPumps(t))a.push({kind:"heatpump",at:m.at,name:m.name,pump:m.pump});for(let m of o)a.push({kind:"media",at:{...m.at,y:m.at.y+.5},media:m})}if(this.liveCardsOn&&!this.dimmed){a.push(...au(s,t,this.floorId,this.roomId)),a.push(...lu(s,t,this.furnitureLinks??new Map,this.floorId,this.roomId));for(let m of t.floors)for(let d of m.furniture){if(!ot(d.type)||d.hydronic?.card===!1||this.floorId&&m.id!==this.floorId||!Ue(s,d))continue;let g=this.roomId?m.rooms.find(_=>_.id===this.roomId):null;this.roomId&&(!g||!H([d.x,d.z],g.points))||a.push({kind:"hydronic",item:d,readOnly:!!this._travel,at:{floorId:m.id,x:d.x+(d.pin_offset?.x??0),z:d.z+(d.pin_offset?.z??0),y:oe(m,d)+d.h+.3+(d.pin_offset?.y??0)}})}}JSON.stringify(a)!==JSON.stringify(this._liveCards)&&(this._liveCards=a),e.setLiveAnchors(a.map(m=>m.at),a.length?(m,d,g,_,b)=>this.placeLhCard(m,d,g,_,b):null)}placeLhCard(e,t,r,i,o){let s=this.renderRoot.querySelector(`.live-card[data-i="${e}"]`);if(!s)return;let a=this._liveCards[e],l=`${a.kind}:${a.at.floorId}:${a.at.x}:${a.at.z}`,c=s.dataset.zoomKey===l&&s.dataset.zoomVisible==="1",u=this.shadowRoot?.activeElement,h=!!u&&s.contains(u),m=h||Tu(a,o,c);s.dataset.zoomKey=l,s.dataset.zoomVisible=m?"1":"0",s.dataset.density=String(Math.round(o)),s.dataset.priority=String(h?110:Qo(a).priority),s.dataset.focused=h?"1":"0",s.dataset.x=String(t),s.dataset.y=String(r),s.style.visibility=i&&m?"visible":"hidden",e===this._liveCards.length-1&&Ru(this.renderRoot)}toggleHouseFold(){this._houseFolded=!this._houseFolded;try{localStorage.setItem("nextfloor.house_card_folded",this._houseFolded?"1":"0")}catch{}}toggleLhCards(){this._liveCardOn=!this._liveCardOn;try{localStorage.setItem("nextfloor.cards",this._liveCardOn?"1":"0")}catch{}this.syncDevices(!0)}renderTopLeft(){let e=this.clean?f:this.renderLhEnergy(),t=this.renderForecast("top_left");return this.clock!=="top_left"&&t===f||!this.hass?e:p`<div class="nf-topleft">${this.clock==="top_left"?this.renderClock(!0):f}${e}${t}</div>`}renLine truncated
|
||||||
${s}
|
${s}
|
||||||
${this.liveCardsOn&&this._liveCards.some(c=>c.kind==="house")?f:l.map(c=>p`<div class="nf-energy-item nf-energy-${c.cls}"><span>${c.label}</span><b>${c.value}</b></div>`)}
|
${this.liveCardsOn&&this._liveCards.some(c=>c.kind==="house")?f:l.map(c=>p`<div class="nf-energy-item nf-energy-${c.cls}"><span>${c.label}</span><b>${c.value}</b></div>`)}
|
||||||
${this.flows!==null?f:p`<button class="nf-energy-item nf-flow-toggle" aria-pressed=${this._flows} title=${a("flows_hint")} aria-label=${a("flows")} @click=${()=>this.toggleFlows()}>
|
${this.flows!==null?f:p`<button class="nf-energy-item nf-flow-toggle" aria-pressed=${this._flows} title=${a("flows_hint")} aria-label=${a("flows")} @click=${()=>this.toggleFlows()}>
|
||||||
@@ -1839,7 +1839,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
class="nf-stage ${this.roomLabels?"":"nf-no-room-names"} ${this._low?"nf-low":""} ${this.panelOpen?"nf-panel-open":""} ${this._alerts.length?"nf-has-alerts":""} ${this._narrowStage?"nf-narrow":""} ${e!==f?"nf-has-utility-overview":""}"
|
class="nf-stage ${this.roomLabels?"":"nf-no-room-names"} ${this._low?"nf-low":""} ${this.panelOpen?"nf-panel-open":""} ${this._alerts.length?"nf-has-alerts":""} ${this._narrowStage?"nf-narrow":""} ${e!==f?"nf-has-utility-overview":""}"
|
||||||
style=${o}
|
style=${o}
|
||||||
>
|
>
|
||||||
${this._error?p`<p class="nf-error">${this._error}</p>`:f} ${this.renderTopLeft()} ${Ru(this.hass,this._liveCards,(s,a,l,c)=>this.hass?.callService(s,a,{entity_id:l,...c}),{folded:this._houseFolded,toggle:()=>this.toggleHouseFold()},!!this.roomId||this.panelOpen)} ${this.clean?f:this.renderLegend()} ${this.renderMapCredit()}
|
${this._error?p`<p class="nf-error">${this._error}</p>`:f} ${this.renderTopLeft()} ${Eu(this.hass,this._liveCards,(s,a,l,c)=>this.hass?.callService(s,a,{entity_id:l,...c}),{folded:this._houseFolded,toggle:()=>this.toggleHouseFold()},!!this.roomId||this.panelOpen)} ${this.clean?f:this.renderLegend()} ${this.renderMapCredit()}
|
||||||
${this.renderAlerts()} ${this.renderAnnouncement()} ${this.clean?f:p`${this.renderThumbs()} ${this.renderScenes()} ${this.renderFind()} ${this.renderCentral()}`} ${this.renderSwipe()}
|
${this.renderAlerts()} ${this.renderAnnouncement()} ${this.clean?f:p`${this.renderThumbs()} ${this.renderScenes()} ${this.renderFind()} ${this.renderCentral()}`} ${this.renderSwipe()}
|
||||||
${this.renderMenu()} ${this.renderPlate()} ${this.renderEye()} ${this.renderLock()} ${this.renderWalk()} ${this.renderTravel()} ${this.renderClock()} ${this.renderToday(e)} ${this.renderLayers()} ${this.renderPluginWindow()}
|
${this.renderMenu()} ${this.renderPlate()} ${this.renderEye()} ${this.renderLock()} ${this.renderWalk()} ${this.renderTravel()} ${this.renderClock()} ${this.renderToday(e)} ${this.renderLayers()} ${this.renderPluginWindow()}
|
||||||
${this.showStats&&this._stats?p`<span class="nf-stats"
|
${this.showStats&&this._stats?p`<span class="nf-stats"
|
||||||
@@ -3449,7 +3449,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
inset: auto 16px 16px;
|
inset: auto 16px 16px;
|
||||||
color: var(--nf-danger);
|
color: var(--nf-danger);
|
||||||
}
|
}
|
||||||
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",ss);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function os(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function og(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Zu;function Yu(){let n=new URL("./nextfloor-editor.js?v=68203eb051b7",new URL(import.meta.url)).href;return Zu??=import(n),Zu}var sg=.25,Ju=n=>Math.round(n*1e3)/1e3,Qu=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function ls(n,e,t,r,i){let o=Qu(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function ag(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ue(ee(o,t),r))<.02&&Math.abs(ue(ee(a,t),r))<.02}))}var as=(n,e)=>Math.abs((n-e+540)%360-180);function Xu(n,e,t,r=sg){let i=Qu(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=qe(ee(u,l));if(h<.3)return;let m=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ue(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=ag(n,i,l,d)?t/2:0,b=ue(ee([e.x,e.z],l),d)-_,y=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:y,extent:e.d/2},{rotation:y+90,extent:e.w/2},{rotation:y-90,extent:e.w/2}].reduce((z,R)=>as(e.rotation,R.rotation)<as(e.rotation,z.rotation)?R:z);if(as(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:Ju(e.x-d[0]*M),z:Ju(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function hi(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function ed(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function td(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function nd(n,e,t,r){return hi(n,e,(i,o)=>{[i.x,i.z]=ls(o,i.x,i.z,t,r)})}function rd(n,e,t,r){let i=n.settings.wall_interior??.12;return di(n,e,(o,s)=>{[o.x,o.z]=ls(s,o.x,o.z,t,r);let a=Xu(s,o,i);a&&Object.assign(o,a)})}var cs=(n,e)=>((n+e)%360+360)%360,id=n=>Number.parseFloat(n.replace(",",".")),Gn=(n,e)=>Math.round(n*10**e)/10**e;function us(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=id(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
|
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",ss);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function os(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function og(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Zu;function Yu(){let n=new URL("./nextfloor-editor.js?v=1a84ce4ff399",new URL(import.meta.url)).href;return Zu??=import(n),Zu}var sg=.25,Ju=n=>Math.round(n*1e3)/1e3,Qu=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function ls(n,e,t,r,i){let o=Qu(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function ag(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ue(ee(o,t),r))<.02&&Math.abs(ue(ee(a,t),r))<.02}))}var as=(n,e)=>Math.abs((n-e+540)%360-180);function Xu(n,e,t,r=sg){let i=Qu(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=qe(ee(u,l));if(h<.3)return;let m=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ue(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=ag(n,i,l,d)?t/2:0,b=ue(ee([e.x,e.z],l),d)-_,y=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:y,extent:e.d/2},{rotation:y+90,extent:e.w/2},{rotation:y-90,extent:e.w/2}].reduce((z,E)=>as(e.rotation,E.rotation)<as(e.rotation,z.rotation)?E:z);if(as(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:Ju(e.x-d[0]*M),z:Ju(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function hi(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function ed(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function td(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function nd(n,e,t,r){return hi(n,e,(i,o)=>{[i.x,i.z]=ls(o,i.x,i.z,t,r)})}function rd(n,e,t,r){let i=n.settings.wall_interior??.12;return di(n,e,(o,s)=>{[o.x,o.z]=ls(s,o.x,o.z,t,r);let a=Xu(s,o,i);a&&Object.assign(o,a)})}var cs=(n,e)=>((n+e)%360+360)%360,id=n=>Number.parseFloat(n.replace(",",".")),Gn=(n,e)=>Math.round(n*10**e)/10**e;function us(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=id(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
|
||||||
>${n.label}
|
>${n.label}
|
||||||
<input type="number" inputmode="decimal" step=${n.step} min=${e} max=${t??f} .value=${String(Gn(n.value,2))} @change=${i} />
|
<input type="number" inputmode="decimal" step=${n.step} min=${e} max=${t??f} .value=${String(Gn(n.value,2))} @change=${i} />
|
||||||
</label>`}var sd=(n,e)=>p`<button class="nf-chip" @click=${e}>${n.t("height_auto")}</button>`,od=(n,e)=>p`<button class="nf-chip" @click=${()=>e(-n)}>↺ ${n}°</button><button class="nf-chip" @click=${()=>e(n)}>↻ ${n}°</button>`;function lg(n,e){let t=n.building.floors.find(s=>s.furniture.some(a=>a.id===e)),r=t?.furniture.find(s=>s.id===e);if(!t||!r)return f;let i=(s,a)=>us({label:n.t(a),title:n.t(`size_${s}`),value:r[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>n.editFurniture(e,c=>c[s]=Gn(l,3))}),o=da(r)?p`${us({label:"\u2195",title:n.t("mount_height"),value:r.mount_y??oe(t,r),step:.05,min:0,accepts:s=>s>=0,apply:s=>n.editFurniture(e,a=>a.mount_y=Gn(s,3))})}
|
</label>`}var sd=(n,e)=>p`<button class="nf-chip" @click=${e}>${n.t("height_auto")}</button>`,od=(n,e)=>p`<button class="nf-chip" @click=${()=>e(-n)}>↺ ${n}°</button><button class="nf-chip" @click=${()=>e(n)}>↻ ${n}°</button>`;function lg(n,e){let t=n.building.floors.find(s=>s.furniture.some(a=>a.id===e)),r=t?.furniture.find(s=>s.id===e);if(!t||!r)return f;let i=(s,a)=>us({label:n.t(a),title:n.t(`size_${s}`),value:r[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>n.editFurniture(e,c=>c[s]=Gn(l,3))}),o=da(r)?p`${us({label:"\u2195",title:n.t("mount_height"),value:r.mount_y??oe(t,r),step:.05,min:0,accepts:s=>s>=0,apply:s=>n.editFurniture(e,a=>a.mount_y=Gn(s,3))})}
|
||||||
@@ -3960,7 +3960,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
`;var hd=new WeakMap,md=new WeakMap;function St(n,e){let t=md.get(n)??n,r=hd.get(t)??new WeakMap;hd.set(t,r);let i=r.get(e);if(i)return i;let o=new Map;for(let l of e)for(let c of l.placements)c.entity_id.startsWith("cover.")&&o.set(c.entity_id,{tilt:c.cover_tilt==="none"?null:c.cover_tilt,position:c.position});for(let l of Be(t,e).values())l.cover&&!o.has(l.cover)&&o.set(l.cover,{tilt:l.coverTilt,position:l.position}),l.cover2&&!o.has(l.cover2)&&o.set(l.cover2,{tilt:l.cover2Tilt});let s={...t.states};for(let[l,c]of o){let u=t.states[l];if(!u)continue;let h={...u.attributes,nf_cover_control:!0},m=Pt(t,c.position);m===null&&(m=typeof u.attributes.current_position=="number"?u.attributes.current_position:null),m!==null&&(h.current_position=m);let d=c.tilt?t.states[c.tilt]:u,g=typeof d?.attributes.current_tilt_position=="number"?d.attributes.current_tilt_position:c.tilt?Pt(t,c.tilt):null;g!==null&&(h.current_tilt_position=g,h.supported_features=Number(h.supported_features??0)|128);let _=u.state;typeof h.current_position=="number"&&_!=="unavailable"&&_!=="unknown"&&_!=="opening"&&_!=="closing"&&(_=h.current_position>0?"open":"closed"),s[l]={...u,state:_,attributes:h}}let a={...t,states:s,callService:async(l,c,u={})=>{if(l!=="cover")return t.callService(l,c,u);let h=Array.isArray(u.entity_id)?u.entity_id:[u.entity_id],m=async d=>{let g=typeof d=="string"?o.get(d):void 0;if(!g)return t.callService(l,c,{...u,entity_id:d});let _={...u,entity_id:d},b=c;(b==="toggle"||b==="toggle_cover")&&(b=s[String(d)]?.state==="closed"?"open_cover":"close_cover");let y=b.includes("tilt");y&&g.tilt&&(_.entity_id=g.tilt);let S=g.tilt?t.states[g.tilt]:void 0;return y&&g.tilt&&!S?.attributes.symcon_id&&typeof S?.attributes.current_tilt_position!="number"&&(b==="set_cover_tilt_position"?(b="set_cover_position",_.position=_.tilt_position,delete _.tilt_position):b==="open_cover_tilt"?b="open_cover":b==="close_cover_tilt"&&(b="close_cover")),t.callService(l,b,_)};return Array.isArray(u.entity_id)?Promise.all(h.map(m)):m(h[0])}};return md.set(a,t),r.set(e,a),a}var hs=class extends Q{static properties={hass:{attribute:!1},narrow:{type:Boolean},route:{attribute:!1},panel:{attribute:!1},_mode:{state:!0},_editorReady:{state:!0},_floorId:{state:!0},_roomId:{state:!0},_wallMode:{state:!0},_prefs:{state:!0},_furnish:{state:!0},_selFurniture:{state:!0},_selDevice:{state:!0},_optsOpen:{state:!0},_switchesOpen:{state:!0},_timeOfDay:{state:!0},_outside:{state:!0},_timeDrag:{state:!0},_floorUndo:{state:!0},_variablesLoading:{state:!0},_variablesNotice:{state:!0},_variablesError:{state:!0}};outsideMemo=null;floorUndoTimer;data=new Dt(this);store=new mi(pi());constructor(){super(),this.narrow=!1,this._mode="view",this._editorReady=!!customElements.get("nf-editor"),this._floorId=null,this._roomId=null,this._wallMode="auto",this._prefs=this.store.load(location.search),this._furnish=!1,this._selFurniture=null,this._selDevice=null,this._optsOpen=!1,this._switchesOpen=!1,this._timeOfDay=null,this._outside=!1,this._timeDrag=null,this._floorUndo=null,this._variablesLoading=!1,this._variablesNotice="",this._variablesError=!1}toggleTimeSlider(e){this.setPref("timeSlider",e),e||([this._timeOfDay,this._timeDrag]=[null,null])}sunState(){let e=this.hass?.config;return this._timeOfDay===null||e?.latitude===void 0||e.longitude===void 0?this.hass?.states["sun.sun"]?.state:ft(Et(this._timeOfDay,e.time_zone),e.latitude,e.longitude).elevation>0?"above_horizon":"below_horizon"}renderTimeOfDay(){let e=this.t;if(this.hass?.config?.latitude===void 0)return f;let t=this._timeDrag??this._timeOfDay,r=o=>`${String(Math.floor(o)).padStart(2,"0")}:${String(Math.round(o%1*60)).padStart(2,"0")}`,i=()=>{let o=new Date;return Math.round((o.getHours()+o.getMinutes()/60)*4)/4};return p`<button class="nf-chip" aria-pressed=${t!==null} title=${e("time_of_day_hint")} @click=${()=>(this._timeDrag=null,this._timeOfDay=t===null?i():null)}>☀ ${t===null?e("time_of_day"):r(t)}</button>
|
`;var hd=new WeakMap,md=new WeakMap;function St(n,e){let t=md.get(n)??n,r=hd.get(t)??new WeakMap;hd.set(t,r);let i=r.get(e);if(i)return i;let o=new Map;for(let l of e)for(let c of l.placements)c.entity_id.startsWith("cover.")&&o.set(c.entity_id,{tilt:c.cover_tilt==="none"?null:c.cover_tilt,position:c.position});for(let l of Be(t,e).values())l.cover&&!o.has(l.cover)&&o.set(l.cover,{tilt:l.coverTilt,position:l.position}),l.cover2&&!o.has(l.cover2)&&o.set(l.cover2,{tilt:l.cover2Tilt});let s={...t.states};for(let[l,c]of o){let u=t.states[l];if(!u)continue;let h={...u.attributes,nf_cover_control:!0},m=Pt(t,c.position);m===null&&(m=typeof u.attributes.current_position=="number"?u.attributes.current_position:null),m!==null&&(h.current_position=m);let d=c.tilt?t.states[c.tilt]:u,g=typeof d?.attributes.current_tilt_position=="number"?d.attributes.current_tilt_position:c.tilt?Pt(t,c.tilt):null;g!==null&&(h.current_tilt_position=g,h.supported_features=Number(h.supported_features??0)|128);let _=u.state;typeof h.current_position=="number"&&_!=="unavailable"&&_!=="unknown"&&_!=="opening"&&_!=="closing"&&(_=h.current_position>0?"open":"closed"),s[l]={...u,state:_,attributes:h}}let a={...t,states:s,callService:async(l,c,u={})=>{if(l!=="cover")return t.callService(l,c,u);let h=Array.isArray(u.entity_id)?u.entity_id:[u.entity_id],m=async d=>{let g=typeof d=="string"?o.get(d):void 0;if(!g)return t.callService(l,c,{...u,entity_id:d});let _={...u,entity_id:d},b=c;(b==="toggle"||b==="toggle_cover")&&(b=s[String(d)]?.state==="closed"?"open_cover":"close_cover");let y=b.includes("tilt");y&&g.tilt&&(_.entity_id=g.tilt);let S=g.tilt?t.states[g.tilt]:void 0;return y&&g.tilt&&!S?.attributes.symcon_id&&typeof S?.attributes.current_tilt_position!="number"&&(b==="set_cover_tilt_position"?(b="set_cover_position",_.position=_.tilt_position,delete _.tilt_position):b==="open_cover_tilt"?b="open_cover":b==="close_cover_tilt"&&(b="close_cover")),t.callService(l,b,_)};return Array.isArray(u.entity_id)?Promise.all(h.map(m)):m(h[0])}};return md.set(a,t),r.set(e,a),a}var hs=class extends Q{static properties={hass:{attribute:!1},narrow:{type:Boolean},route:{attribute:!1},panel:{attribute:!1},_mode:{state:!0},_editorReady:{state:!0},_floorId:{state:!0},_roomId:{state:!0},_wallMode:{state:!0},_prefs:{state:!0},_furnish:{state:!0},_selFurniture:{state:!0},_selDevice:{state:!0},_optsOpen:{state:!0},_switchesOpen:{state:!0},_timeOfDay:{state:!0},_outside:{state:!0},_timeDrag:{state:!0},_floorUndo:{state:!0},_variablesLoading:{state:!0},_variablesNotice:{state:!0},_variablesError:{state:!0}};outsideMemo=null;floorUndoTimer;data=new Dt(this);store=new mi(pi());constructor(){super(),this.narrow=!1,this._mode="view",this._editorReady=!!customElements.get("nf-editor"),this._floorId=null,this._roomId=null,this._wallMode="auto",this._prefs=this.store.load(location.search),this._furnish=!1,this._selFurniture=null,this._selDevice=null,this._optsOpen=!1,this._switchesOpen=!1,this._timeOfDay=null,this._outside=!1,this._timeDrag=null,this._floorUndo=null,this._variablesLoading=!1,this._variablesNotice="",this._variablesError=!1}toggleTimeSlider(e){this.setPref("timeSlider",e),e||([this._timeOfDay,this._timeDrag]=[null,null])}sunState(){let e=this.hass?.config;return this._timeOfDay===null||e?.latitude===void 0||e.longitude===void 0?this.hass?.states["sun.sun"]?.state:ft(Rt(this._timeOfDay,e.time_zone),e.latitude,e.longitude).elevation>0?"above_horizon":"below_horizon"}renderTimeOfDay(){let e=this.t;if(this.hass?.config?.latitude===void 0)return f;let t=this._timeDrag??this._timeOfDay,r=o=>`${String(Math.floor(o)).padStart(2,"0")}:${String(Math.round(o%1*60)).padStart(2,"0")}`,i=()=>{let o=new Date;return Math.round((o.getHours()+o.getMinutes()/60)*4)/4};return p`<button class="nf-chip" aria-pressed=${t!==null} title=${e("time_of_day_hint")} @click=${()=>(this._timeDrag=null,this._timeOfDay=t===null?i():null)}>☀ ${t===null?e("time_of_day"):r(t)}</button>
|
||||||
${t!==null?p`<label class="nf-chip nf-time-slider"
|
${t!==null?p`<label class="nf-chip nf-time-slider"
|
||||||
><input type="range" min="0" max="23.75" step="0.25" .value=${String(t)} aria-label=${e("time_of_day")} @input=${o=>this._timeDrag=Number(o.target.value)}
|
><input type="range" min="0" max="23.75" step="0.25" .value=${String(t)} aria-label=${e("time_of_day")} @input=${o=>this._timeDrag=Number(o.target.value)}
|
||||||
@change=${o=>(this._timeDrag=null,this._timeOfDay=Number(o.target.value))}
|
@change=${o=>(this._timeDrag=null,this._timeOfDay=Number(o.target.value))}
|
||||||
@@ -4044,7 +4044,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
|
|||||||
.loadCardEditor=${Jn}
|
.loadCardEditor=${Jn}
|
||||||
@packs-changed=${()=>{this.data.reloadPacks()}}
|
@packs-changed=${()=>{this.data.reloadPacks()}}
|
||||||
@building-changed=${t=>this.data.edit(t.detail.building)}
|
@building-changed=${t=>this.data.edit(t.detail.building)}
|
||||||
></nf-editor>`)}onNavWheel=e=>{if(this._prefs.navWrap||!e.deltaY||e.deltaX)return;let t=e.currentTarget;t.scrollWidth<=t.clientWidth||(t.scrollLeft+=e.deltaY,e.preventDefault())};allOffChip(e){let t=this._floorId?e.floors.find(i=>i.id===this._floorId):e.floors.length===1?e.floors[0]:void 0;if(!t||!this.hass)return f;if(this._floorUndo){let i=this._floorUndo;return p`<button class="nf-chip" aria-pressed="true" @click=${()=>{for(let o of i)this.hass.callService(o.domain,o.service,o.data);this._floorUndo=null,clearTimeout(this.floorUndoTimer)}}>↶ ${this.t("all_off_undo")}</button>`}let r=Rn(mc(t).map(i=>this.hass.states[i]));return r.count<2?f:p`<button class="nf-chip" title=${this.t("all_off_floor",{floor:t.name,n:r.count})} @click=${()=>{for(let i of r.off)this.hass.callService(i.domain,i.service,i.data);this._floorUndo=r.undo,clearTimeout(this.floorUndoTimer),this.floorUndoTimer=setTimeout(()=>this._floorUndo=null,1e4)}}>⏻ ${r.count}</button>`}renderNav(e){let t=e.floors.filter(c=>!this._floorId||c.id===this._floorId),r=e.floors.length>1,i=this._prefs.navWrap,o=this.outsideIds(e).length?p`<button class="nf-chip" aria-pressed=${this._outside} title=${this.t("outside_area_hint")} @click=${()=>this.openOutside()}>🌳 ${this.t("outside_area")}</button>`:f,s=r?p`<button class="nf-chip" aria-pressed=${this._floorId===null} @click=${()=>this.openFloor(null)}>${this.t("all_floors")}</button>
|
></nf-editor>`)}onNavWheel=e=>{if(this._prefs.navWrap||!e.deltaY||e.deltaX)return;let t=e.currentTarget;t.scrollWidth<=t.clientWidth||(t.scrollLeft+=e.deltaY,e.preventDefault())};allOffChip(e){let t=this._floorId?e.floors.find(i=>i.id===this._floorId):e.floors.length===1?e.floors[0]:void 0;if(!t||!this.hass)return f;if(this._floorUndo){let i=this._floorUndo;return p`<button class="nf-chip" aria-pressed="true" @click=${()=>{for(let o of i)this.hass.callService(o.domain,o.service,o.data);this._floorUndo=null,clearTimeout(this.floorUndoTimer)}}>↶ ${this.t("all_off_undo")}</button>`}let r=En(mc(t).map(i=>this.hass.states[i]));return r.count<2?f:p`<button class="nf-chip" title=${this.t("all_off_floor",{floor:t.name,n:r.count})} @click=${()=>{for(let i of r.off)this.hass.callService(i.domain,i.service,i.data);this._floorUndo=r.undo,clearTimeout(this.floorUndoTimer),this.floorUndoTimer=setTimeout(()=>this._floorUndo=null,1e4)}}>⏻ ${r.count}</button>`}renderNav(e){let t=e.floors.filter(c=>!this._floorId||c.id===this._floorId),r=e.floors.length>1,i=this._prefs.navWrap,o=this.outsideIds(e).length?p`<button class="nf-chip" aria-pressed=${this._outside} title=${this.t("outside_area_hint")} @click=${()=>this.openOutside()}>🌳 ${this.t("outside_area")}</button>`:f,s=r?p`<button class="nf-chip" aria-pressed=${this._floorId===null} @click=${()=>this.openFloor(null)}>${this.t("all_floors")}</button>
|
||||||
${[...e.floors].reverse().map(c=>p`<button class="nf-chip" aria-pressed=${c.id===this._floorId} @click=${()=>this.openFloor(c.id)}>${c.name}</button>`)}
|
${[...e.floors].reverse().map(c=>p`<button class="nf-chip" aria-pressed=${c.id===this._floorId} @click=${()=>this.openFloor(c.id)}>${c.name}</button>`)}
|
||||||
${o} ${this.allOffChip(e)}
|
${o} ${this.allOffChip(e)}
|
||||||
<span class="nf-sep"></span>`:p`${o} ${this.allOffChip(e)}`,a=t.flatMap(c=>[t.length>1&&c.rooms.length?p`<span class="nf-nav-floor">${c.name}</span>`:f,...c.rooms.map(u=>p`<button
|
<span class="nf-sep"></span>`:p`${o} ${this.allOffChip(e)}`,a=t.flatMap(c=>[t.length>1&&c.rooms.length?p`<span class="nf-nav-floor">${c.name}</span>`:f,...c.rooms.map(u=>p`<button
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
+13
-1
@@ -16,7 +16,7 @@ In **Kerninstanzen → Modules** wird dieses Repository verwendet:
|
|||||||
|
|
||||||
Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen.
|
Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen.
|
||||||
`main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek.
|
`main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek.
|
||||||
Nach der Aktualisierung auf **0.2.29 / Build 32** die Konsole neu laden. Unter
|
Nach der Aktualisierung auf **0.2.30 / Build 33** die Konsole neu laden. Unter
|
||||||
**Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**.
|
**Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**.
|
||||||
|
|
||||||
### Für die Entwicklung
|
### Für die Entwicklung
|
||||||
@@ -46,6 +46,18 @@ Die Dateien unter `NextFloor/assets/` und `NextFloor/packs/` werden durch
|
|||||||
Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur.
|
Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur.
|
||||||
Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen.
|
Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen.
|
||||||
|
|
||||||
|
## Änderungen in 0.2.30
|
||||||
|
|
||||||
|
- Jede Außenfläche erhält **Texturmaßstab (%)** und **Texturdrehung (°)** direkt
|
||||||
|
unter der Auswahl der Flächenart. 100 % ist die bisherige Größe, 200 % macht
|
||||||
|
das Muster doppelt so groß und 50 % halb so groß. Der Bereich ist 5–2000 %;
|
||||||
|
Drehungen werden auf eine volle Umdrehung normalisiert (auch negative Eingaben
|
||||||
|
sind möglich).
|
||||||
|
- Die Einstellungen betreffen ausschließlich das Muster der ausgewählten Fläche,
|
||||||
|
gelten auch bei Gefälle und Transparenz und bleiben beim Speichern, Laden und
|
||||||
|
Duplizieren erhalten. Bestehende Flächen behalten 100 % / 0°.
|
||||||
|
- Eine Erklärung zu Maßstab und Drehung steht hinter dem Infosymbol.
|
||||||
|
|
||||||
## Änderungen in 0.2.29
|
## Änderungen in 0.2.29
|
||||||
|
|
||||||
- **Außenflächen einrasten:** Beim Zeichnen, Verschieben und Bearbeiten der Ecken
|
- **Außenflächen einrasten:** Beim Zeichnen, Verschieben und Bearbeiten der Ecken
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@
|
|||||||
"compatibility": {
|
"compatibility": {
|
||||||
"version": "9.0"
|
"version": "9.0"
|
||||||
},
|
},
|
||||||
"version": "0.2.29",
|
"version": "0.2.30",
|
||||||
"build": 32,
|
"build": 33,
|
||||||
"date": 1794787200
|
"date": 1794787200
|
||||||
}
|
}
|
||||||
@@ -408,3 +408,22 @@ def test_new_outdoor_surfaces(kind: str) -> None:
|
|||||||
data = {"id": "outside", "type": kind, "points": [[0, 0], [4.03, 0], [4, 3]], "slope": 0.2, "opacity": 0.4}
|
data = {"id": "outside", "type": kind, "points": [[0, 0], [4.03, 0], [4, 3]], "slope": 0.2, "opacity": 0.4}
|
||||||
result = OUTDOOR_SCHEMA(data)
|
result = OUTDOOR_SCHEMA(data)
|
||||||
assert all(result[key] == value for key, value in data.items())
|
assert all(result[key] == value for key, value in data.items())
|
||||||
|
|
||||||
|
|
||||||
|
def test_outdoor_texture_settings() -> None:
|
||||||
|
from custom_components.nextfloor.schema import OUTDOOR_SCHEMA
|
||||||
|
|
||||||
|
base = {"id": "outside", "type": "terrace", "points": [[0, 0], [4, 0], [4, 3]]}
|
||||||
|
old = OUTDOOR_SCHEMA(base)
|
||||||
|
assert old["texture_scale"] is None and old["texture_rotation"] is None
|
||||||
|
for scale, rotation in [(0.05, -360), (1, 0), (2.5, 45), (20, 360)]:
|
||||||
|
result = OUTDOOR_SCHEMA({**base, "texture_scale": scale, "texture_rotation": rotation})
|
||||||
|
assert result["texture_scale"] == scale and result["texture_rotation"] == rotation
|
||||||
|
for key, invalid in [
|
||||||
|
("texture_scale", 0),
|
||||||
|
("texture_scale", 21),
|
||||||
|
("texture_rotation", -361),
|
||||||
|
("texture_rotation", 361),
|
||||||
|
]:
|
||||||
|
with pytest.raises(vol.Invalid):
|
||||||
|
OUTDOOR_SCHEMA({**base, key: invalid})
|
||||||
Reference in new issue
Block a user