@cas-smartdesign/tree 4.1.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/docs/doc.mjs
CHANGED
|
@@ -515,7 +515,7 @@ export class Server {
|
|
|
515
515
|
</li>
|
|
516
516
|
`}},xe.ID="sd-tree-loading-indicator",xe.ensureDefined=()=>{customElements.get(xe.ID)||customElements.define(xe.ID,xe)},xe);ls([z({type:Boolean,reflect:!0,attribute:!0})],zn.prototype,"readonly");ls([z({type:Number})],zn.prototype,"depth");let mo=zn;const It=(s,e=1,n=0)=>e>0?s.reduce((i,t)=>i.concat(t.childCount>0&&t.expanded?[t,...It(t.nodes,e-1,n+1)]:t),[]):s.slice(),bo=(s,e,n=0)=>{if(!e)return null;const i=e[n],t=s.find(o=>o.id===i);return e.length-1===n?t:t?.nodes.length>0?bo(t.nodes,e,n+1):null},yo=(s,e,n,i,t,o)=>{const r=Math.max(0,o*i),u=Math.min(r,s*i),m=Math.max(0,s*i-t+i);switch(e){case"start":return u;case"end":return m;case"center":{const h=Math.round(m+(u-m)/2);return h<Math.ceil(t/2)?0:h>r+Math.floor(t/2)?r:h}case"auto":default:return n>=m&&n<=u?n:n<m?m:u}},at=(s,e)=>s.findIndex(n=>typeof n=="string"&&n===JSON.stringify(e)),Se=s=>typeof s=="string",xo=":host{display:block;position:relative;contain:layout;overflow:auto}:host(:focus){outline:none}ul{list-style-type:none;margin:0;padding:0}.root{width:100%}";var wo=Object.defineProperty,vo=Object.getOwnPropertyDescriptor,yt=(s,e,n,i)=>{for(var t=i>1?void 0:i?vo(e,n):e,o=s.length-1,r;o>=0;o--)(r=s[o])&&(t=(i?r(e,n,t):r(t))||t);return i&&t&&wo(e,n,t),t},we;const tt=(we=class extends ue{constructor(){super(),this.pageSize=50,this.loadingText="Loading...",this.parentSelectionAllowed=!1,this.readonly=!1,this._lastKnownHeight=0,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._visibleItemsNum=0,this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0,this._focusIndex=-1,this._flattenedNodes=[],this._rootItemsLoading=!1,this._rootNodeCount=0,this._loadedRootNodeCount=0,this._allNodeCount=0,this._nodeStates=new Map,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;const e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=Xe&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleNodeExpansion=e=>{const{path:n,expanded:i}=e.detail;this.updateAfterExpansion(n,i)},this.handleKeyDown=e=>{let n=!0;switch(e.key){case"ArrowDown":{this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowUp":{this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"ArrowRight":{const i=this.focusedNode;if(i)if(i.childCount>0&&!i.expanded){const t=this.querySelector(`[node-id='${i.id}']`);t&&t.expand()}else this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowLeft":{const i=this.focusedNode;if(i)if(i.childCount>0&&i.expanded){const t=this.querySelector(`[node-id='${i.id}']`);t&&t.collapse()}else this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"Enter":{const i=this.focusedNode;i&&(this.toggleSelection(i.path),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:i.path,checked:i.selectionState==="checked",indeterminate:i.selectionState==="indeterminate"},bubbles:!0,composed:!0}))}));break}default:{n=!1;break}}n&&(e.preventDefault(),e.stopPropagation())},this.handleNodeSelection=e=>{if(e.target==this)return;this._reusePreviousRenderData=!0;const{path:n}=e.detail;this.focusIndex=at(this._flattenedNodes,n),this.focus(),this.toggleSelection(n),this.updateComplete.then(()=>{this._reusePreviousRenderData=!1})},this.getFlattenedNodeId=e=>JSON.stringify(e.path),this.nodeGetter=e=>e?this._nodeStates.get(JSON.stringify(e)):null,this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get rootNodeCount(){return this._rootNodeCount}set rootNodeCount(e){e===0?this._allNodeCount=0:e>0&&(this._allNodeCount+=e-this.rootNodeCount),this._rootNodeCount=e,this.requestUpdate()}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this._allNodeCount){const n=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToNode(e),n!=e&&this.requestUpdate("focusIndex",n)}}setNodes(e){this.stopLoadingIndicator(),this.setLastLoadingChildren(e,this.rootNodeCount,e.length),e.forEach((n,i)=>{const t=[...e];t.splice(i,1),this.updateNodeMap(n,t)}),this.updateCount(e),this._loadedRootNodeCount=e.length,this._flattenedNodes=It(e,1/0).map(this.getFlattenedNodeId),this.requestUpdate()}addNodes(e,n){this.stopLoadingIndicator(n),e.forEach((t,o)=>{const r=[...e];r.splice(o,1),this.updateNodeMap(t,r)});const i=this.nodeGetter(n);i?i.expanded&&(this._allNodeCount+=e.length+this.getNodeCount(e)):this._loadedRootNodeCount+=e.length,this.updateFlattenedNodes(e,n),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}static get styles(){return[Fe`
|
|
517
517
|
${Re(xo)}
|
|
518
|
-
`]}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("expansion",this.handleNodeExpansion),this.addEventListener("selection",this.handleNodeSelection),this.addEventListener("focus",()=>{this.focusIndex==-1&&(this.focusIndex=this.normalizeIndex(0))}),this._nodeStates.size===0&&(this.children.length>0?this.syncState():this.requestData())}updated(e){super.updated(e),this.updateNodes(),e.has("parentSelectionAllowed")&&this.updateParentSelectionAllowed()}render(){return this.updateRenderData(),te`
|
|
518
|
+
`]}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("expansion",this.handleNodeExpansion),this.addEventListener("selection",this.handleNodeSelection),this.addEventListener("focus",()=>{this.focusIndex==-1&&this.matches(":focus-visible")&&(this.focusIndex=this.normalizeIndex(0))}),this._nodeStates.size===0&&(this.children.length>0?this.syncState():this.requestData())}updated(e){super.updated(e),this.updateNodes(),e.has("parentSelectionAllowed")&&this.updateParentSelectionAllowed()}render(){return this.updateRenderData(),te`
|
|
519
519
|
<div class="root" style="height: ${this._allNodeCount*Xe}px">
|
|
520
520
|
<ul>
|
|
521
521
|
<slot></slot>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var mt=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ne=Object.prototype.hasOwnProperty;var re=(e,t)=>{for(var s in t)mt(e,s,{get:t[s],enumerable:!0})},ae=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oe(t))!ne.call(e,o)&&o!==s&&mt(e,o,{get:()=>t[o],enumerable:!(i=ie(t,o))||i.enumerable});return e};var de=e=>ae(mt({},"__esModule",{value:!0}),e);var Ge={};re(Ge,{CheckboxNode:()=>ft,Node:()=>it,RadioButtonNode:()=>gt,Tree:()=>se,findNode:()=>je,findNodeByPath:()=>te,findNodeIndex:()=>q,flattenNodes:()=>st,getOffsetForIndexAndAlignment:()=>ee,isCheckboxNode:()=>Zt,isFlattenedNode:()=>
|
|
1
|
+
var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var mt=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ne=Object.prototype.hasOwnProperty;var re=(e,t)=>{for(var s in t)mt(e,s,{get:t[s],enumerable:!0})},ae=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oe(t))!ne.call(e,o)&&o!==s&&mt(e,o,{get:()=>t[o],enumerable:!(i=ie(t,o))||i.enumerable});return e};var de=e=>ae(mt({},"__esModule",{value:!0}),e);var Ge={};re(Ge,{CheckboxNode:()=>ft,Node:()=>it,RadioButtonNode:()=>gt,Tree:()=>se,findNode:()=>je,findNodeByPath:()=>te,findNodeIndex:()=>q,flattenNodes:()=>st,getOffsetForIndexAndAlignment:()=>ee,isCheckboxNode:()=>Zt,isFlattenedNode:()=>_,isNode:()=>Bt,isRadioButtonNode:()=>Qt});var rt=globalThis,at=rt.ShadowRoot&&(rt.ShadyCSS===void 0||rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,bt=Symbol(),Ot=new WeakMap,K=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==bt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o,s=this.t;if(at&&t===void 0){let i=s!==void 0&&s.length===1;i&&(t=Ot.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ot.set(s,t))}return t}toString(){return this.cssText}},m=e=>new K(typeof e=="string"?e:e+"",void 0,bt),x=(e,...t)=>{let s=e.length===1?e[0]:t.reduce(((i,o,n)=>i+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[n+1]),e[0]);return new K(s,e,bt)},Ut=(e,t)=>{if(at)e.adoptedStyleSheets=t.map((s=>s instanceof CSSStyleSheet?s:s.styleSheet));else for(let s of t){let i=document.createElement("style"),o=rt.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=s.cssText,e.appendChild(i)}},xt=at?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(let i of t.cssRules)s+=i.cssText;return m(s)})(e):e;var{is:he,defineProperty:le,getOwnPropertyDescriptor:ce,getOwnPropertyNames:ue,getOwnPropertySymbols:pe,getPrototypeOf:fe}=Object,dt=globalThis,Mt=dt.trustedTypes,ge=Mt?Mt.emptyScript:"",me=dt.reactiveElementPolyfillSupport,J=(e,t)=>e,W={toAttribute(e,t){switch(t){case Boolean:e=e?ge:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},ht=(e,t)=>!he(e,t),Tt={attribute:!0,type:String,converter:W,reflect:!1,useDefault:!1,hasChanged:ht};Symbol.metadata??=Symbol("metadata"),dt.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=Tt){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){let i=Symbol(),o=this.getPropertyDescriptor(t,i,s);o!==void 0&&le(this.prototype,t,o)}}static getPropertyDescriptor(t,s,i){let{get:o,set:n}=ce(this.prototype,t)??{get(){return this[s]},set(r){this[s]=r}};return{get:o,set(r){let h=o?.call(this);n?.call(this,r),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Tt}static _$Ei(){if(this.hasOwnProperty(J("elementProperties")))return;let t=fe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(J("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J("properties"))){let s=this.properties,i=[...ue(s),...pe(s)];for(let o of i)this.createProperty(o,s[o])}let t=this[Symbol.metadata];if(t!==null){let s=litPropertyMetadata.get(t);if(s!==void 0)for(let[i,o]of s)this.elementProperties.set(i,o)}this._$Eh=new Map;for(let[s,i]of this.elementProperties){let o=this._$Eu(s,i);o!==void 0&&this._$Eh.set(o,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let s=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let o of i)s.unshift(xt(o))}else t!==void 0&&s.push(xt(t));return s}static _$Eu(t,s){let i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.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((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,s=this.constructor.elementProperties;for(let i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ut(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){let i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(o!==void 0&&i.reflect===!0){let n=(i.converter?.toAttribute!==void 0?i.converter:W).toAttribute(s,i.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,s){let i=this.constructor,o=i._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let n=i.getPropertyOptions(o),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:W;this._$Em=o;let h=r.fromAttribute(s,n.type);this[o]=h??this._$Ej?.get(o)??h,this._$Em=null}}requestUpdate(t,s,i){if(t!==void 0){let o=this.constructor,n=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??ht)(n,s)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:o,wrapped:n},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[o,n]of i){let{wrapped:r}=n,h=this[o];r!==!0||this._$AL.has(o)||h===void 0||this.C(o,void 0,n,h)}}let t=!1,s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((i=>i.hostUpdate?.())),this.update(s)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((s=>s.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((s=>this._$ET(s,this[s]))),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[J("elementProperties")]=new Map,$[J("finalized")]=new Map,me?.({ReactiveElement:$}),(dt.reactiveElementVersions??=[]).push("2.1.1");var wt=globalThis,lt=wt.trustedTypes,zt=lt?lt.createPolicy("lit-html",{createHTML:e=>e}):void 0,Kt="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,Jt="?"+C,be=`<${Jt}>`,P=document,Y=()=>P.createComment(""),Z=e=>e===null||typeof e!="object"&&typeof e!="function",Ct=Array.isArray,xe=e=>Ct(e)||typeof e?.[Symbol.iterator]=="function",yt=`[
|
|
2
2
|
\f\r]`,G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ht=/-->/g,Ft=/>/g,N=RegExp(`>|${yt}(?:([^\\s"'>=/]+)(${yt}*=${yt}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vt=/'/g,qt=/"/g,Wt=/^(?:script|style|textarea|title)$/i,At=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),c=At(1),es=At(2),ss=At(3),L=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),jt=new WeakMap,D=P.createTreeWalker(P,129);function Gt(e,t){if(!Ct(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return zt!==void 0?zt.createHTML(t):t}var ye=(e,t)=>{let s=e.length-1,i=[],o,n=t===2?"<svg>":t===3?"<math>":"",r=G;for(let h=0;h<s;h++){let d=e[h],u,g,l=-1,S=0;for(;S<d.length&&(r.lastIndex=S,g=r.exec(d),g!==null);)S=r.lastIndex,r===G?g[1]==="!--"?r=Ht:g[1]!==void 0?r=Ft:g[2]!==void 0?(Wt.test(g[2])&&(o=RegExp("</"+g[2],"g")),r=N):g[3]!==void 0&&(r=N):r===N?g[0]===">"?(r=o??G,l=-1):g[1]===void 0?l=-2:(l=r.lastIndex-g[2].length,u=g[1],r=g[3]===void 0?N:g[3]==='"'?qt:Vt):r===qt||r===Vt?r=N:r===Ht||r===Ft?r=G:(r=N,o=void 0);let w=r===N&&e[h+1].startsWith("/>")?" ":"";n+=r===G?d+be:l>=0?(i.push(u),d.slice(0,l)+Kt+d.slice(l)+C+w):d+C+(l===-2?h:w)}return[Gt(e,n+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},Q=class e{constructor({strings:t,_$litType$:s},i){let o;this.parts=[];let n=0,r=0,h=t.length-1,d=this.parts,[u,g]=ye(t,s);if(this.el=e.createElement(u,i),D.currentNode=this.el.content,s===2||s===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(o=D.nextNode())!==null&&d.length<h;){if(o.nodeType===1){if(o.hasAttributes())for(let l of o.getAttributeNames())if(l.endsWith(Kt)){let S=g[r++],w=o.getAttribute(l).split(C),nt=/([.?@])?(.*)/.exec(S);d.push({type:1,index:n,name:nt[2],strings:w,ctor:nt[1]==="."?vt:nt[1]==="?"?St:nt[1]==="@"?$t:H}),o.removeAttribute(l)}else l.startsWith(C)&&(d.push({type:6,index:n}),o.removeAttribute(l));if(Wt.test(o.tagName)){let l=o.textContent.split(C),S=l.length-1;if(S>0){o.textContent=lt?lt.emptyScript:"";for(let w=0;w<S;w++)o.append(l[w],Y()),D.nextNode(),d.push({type:2,index:++n});o.append(l[S],Y())}}}else if(o.nodeType===8)if(o.data===Jt)d.push({type:2,index:n});else{let l=-1;for(;(l=o.data.indexOf(C,l+1))!==-1;)d.push({type:7,index:n}),l+=C.length-1}n++}}static createElement(t,s){let i=P.createElement("template");return i.innerHTML=t,i}};function z(e,t,s=e,i){if(t===L)return t;let o=i!==void 0?s._$Co?.[i]:s._$Cl,n=Z(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(e),o._$AT(e,s,i)),i!==void 0?(s._$Co??=[])[i]=o:s._$Cl=o),o!==void 0&&(t=z(e,o._$AS(e,t.values),o,i)),t}var _t=class{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:s},parts:i}=this._$AD,o=(t?.creationScope??P).importNode(s,!0);D.currentNode=o;let n=D.nextNode(),r=0,h=0,d=i[0];for(;d!==void 0;){if(r===d.index){let u;d.type===2?u=new X(n,n.nextSibling,this,t):d.type===1?u=new d.ctor(n,d.name,d.strings,this,t):d.type===6&&(u=new kt(n,this,t)),this._$AV.push(u),d=i[++h]}r!==d?.index&&(n=D.nextNode(),r++)}return D.currentNode=P,o}p(t){let s=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}},X=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,i,o){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=z(this,t,s),Z(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xe(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){let{values:s,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Q.createElement(Gt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(s);else{let n=new _t(o,this),r=n.u(this.options);n.p(s),this.T(r),this._$AH=n}}_$AC(t){let s=jt.get(t.strings);return s===void 0&&jt.set(t.strings,s=new Q(t)),s}k(t){Ct(this._$AH)||(this._$AH=[],this._$AR());let s=this._$AH,i,o=0;for(let n of t)o===s.length?s.push(i=new e(this.O(Y()),this.O(Y()),this,this.options)):i=s[o],i._$AI(n),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,i,o,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=s,this._$AM=o,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}_$AI(t,s=this,i,o){let n=this.strings,r=!1;if(n===void 0)t=z(this,t,s,0),r=!Z(t)||t!==this._$AH&&t!==L,r&&(this._$AH=t);else{let h=t,d,u;for(t=n[0],d=0;d<n.length-1;d++)u=z(this,h[i+d],s,d),u===L&&(u=this._$AH[d]),r||=!Z(u)||u!==this._$AH[d],u===p?t=p:t!==p&&(t+=(u??"")+n[d+1]),this._$AH[d]=u}r&&!o&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},vt=class extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},St=class extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},$t=class extends H{constructor(t,s,i,o,n){super(t,s,i,o,n),this.type=5}_$AI(t,s=this){if((t=z(this,t,s,0)??p)===L)return;let i=this._$AH,o=t===p&&i!==p||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==p&&(i===p||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},kt=class{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}};var _e=wt.litHtmlPolyfillSupport;_e?.(Q,X),(wt.litHtmlVersions??=[]).push("3.3.1");var ct=(e,t,s)=>{let i=s?.renderBefore??t,o=i._$litPart$;if(o===void 0){let n=s?.renderBefore??null;i._$litPart$=o=new X(t.insertBefore(Y(),n),n,void 0,s??{})}return o._$AI(e),o};var It=globalThis,f=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ct(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};f._$litElement$=!0,f.finalized=!0,It.litElementHydrateSupport?.({LitElement:f});var ve=It.litElementPolyfillSupport;ve?.({LitElement:f});(It.litElementVersions??=[]).push("4.2.1");var Se={attribute:!0,type:String,converter:W,reflect:!1,hasChanged:ht},$e=(e=Se,t,s)=>{let{kind:i,metadata:o}=s,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),n.set(s.name,e),i==="accessor"){let{name:r}=s;return{set(h){let d=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,d,e)},init(h){return h!==void 0&&this.C(r,void 0,e,h),h}}}if(i==="setter"){let{name:r}=s;return function(h){let d=this[r];t.call(this,h),this.requestUpdate(r,d,e)}}throw Error("Unsupported decorator location: "+i)};function a(e){return(t,s)=>typeof s=="object"?$e(e,t,s):((i,o,n)=>{let r=o.hasOwnProperty(n);return o.constructor.createProperty(n,i),r?Object.getOwnPropertyDescriptor(o,n):void 0})(e,t,s)}var ut=e=>e??p;var ke=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",we="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",Ce="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",Ae="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",Ie=Object.defineProperty,Nt=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&Ie(t,s,o),o},F,tt=(F=class extends f{static parseLevel(e){if(e){let t=Object.keys(B).find(s=>s.toLowerCase()===e.toLowerCase());return t&&B[t]}}static get styles(){return[x`
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vt=/'/g,qt=/"/g,Wt=/^(?:script|style|textarea|title)$/i,At=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),c=At(1),es=At(2),ss=At(3),L=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),jt=new WeakMap,D=P.createTreeWalker(P,129);function Gt(e,t){if(!Ct(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return zt!==void 0?zt.createHTML(t):t}var ye=(e,t)=>{let s=e.length-1,i=[],o,n=t===2?"<svg>":t===3?"<math>":"",r=G;for(let h=0;h<s;h++){let d=e[h],u,g,l=-1,S=0;for(;S<d.length&&(r.lastIndex=S,g=r.exec(d),g!==null);)S=r.lastIndex,r===G?g[1]==="!--"?r=Ht:g[1]!==void 0?r=Ft:g[2]!==void 0?(Wt.test(g[2])&&(o=RegExp("</"+g[2],"g")),r=N):g[3]!==void 0&&(r=N):r===N?g[0]===">"?(r=o??G,l=-1):g[1]===void 0?l=-2:(l=r.lastIndex-g[2].length,u=g[1],r=g[3]===void 0?N:g[3]==='"'?qt:Vt):r===qt||r===Vt?r=N:r===Ht||r===Ft?r=G:(r=N,o=void 0);let w=r===N&&e[h+1].startsWith("/>")?" ":"";n+=r===G?d+be:l>=0?(i.push(u),d.slice(0,l)+Kt+d.slice(l)+C+w):d+C+(l===-2?h:w)}return[Gt(e,n+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},Q=class e{constructor({strings:t,_$litType$:s},i){let o;this.parts=[];let n=0,r=0,h=t.length-1,d=this.parts,[u,g]=ye(t,s);if(this.el=e.createElement(u,i),D.currentNode=this.el.content,s===2||s===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(o=D.nextNode())!==null&&d.length<h;){if(o.nodeType===1){if(o.hasAttributes())for(let l of o.getAttributeNames())if(l.endsWith(Kt)){let S=g[r++],w=o.getAttribute(l).split(C),nt=/([.?@])?(.*)/.exec(S);d.push({type:1,index:n,name:nt[2],strings:w,ctor:nt[1]==="."?_t:nt[1]==="?"?St:nt[1]==="@"?$t:H}),o.removeAttribute(l)}else l.startsWith(C)&&(d.push({type:6,index:n}),o.removeAttribute(l));if(Wt.test(o.tagName)){let l=o.textContent.split(C),S=l.length-1;if(S>0){o.textContent=lt?lt.emptyScript:"";for(let w=0;w<S;w++)o.append(l[w],Y()),D.nextNode(),d.push({type:2,index:++n});o.append(l[S],Y())}}}else if(o.nodeType===8)if(o.data===Jt)d.push({type:2,index:n});else{let l=-1;for(;(l=o.data.indexOf(C,l+1))!==-1;)d.push({type:7,index:n}),l+=C.length-1}n++}}static createElement(t,s){let i=P.createElement("template");return i.innerHTML=t,i}};function z(e,t,s=e,i){if(t===L)return t;let o=i!==void 0?s._$Co?.[i]:s._$Cl,n=Z(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(e),o._$AT(e,s,i)),i!==void 0?(s._$Co??=[])[i]=o:s._$Cl=o),o!==void 0&&(t=z(e,o._$AS(e,t.values),o,i)),t}var vt=class{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:s},parts:i}=this._$AD,o=(t?.creationScope??P).importNode(s,!0);D.currentNode=o;let n=D.nextNode(),r=0,h=0,d=i[0];for(;d!==void 0;){if(r===d.index){let u;d.type===2?u=new X(n,n.nextSibling,this,t):d.type===1?u=new d.ctor(n,d.name,d.strings,this,t):d.type===6&&(u=new kt(n,this,t)),this._$AV.push(u),d=i[++h]}r!==d?.index&&(n=D.nextNode(),r++)}return D.currentNode=P,o}p(t){let s=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}},X=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,i,o){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=z(this,t,s),Z(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xe(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){let{values:s,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Q.createElement(Gt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(s);else{let n=new vt(o,this),r=n.u(this.options);n.p(s),this.T(r),this._$AH=n}}_$AC(t){let s=jt.get(t.strings);return s===void 0&&jt.set(t.strings,s=new Q(t)),s}k(t){Ct(this._$AH)||(this._$AH=[],this._$AR());let s=this._$AH,i,o=0;for(let n of t)o===s.length?s.push(i=new e(this.O(Y()),this.O(Y()),this,this.options)):i=s[o],i._$AI(n),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,i,o,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=s,this._$AM=o,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}_$AI(t,s=this,i,o){let n=this.strings,r=!1;if(n===void 0)t=z(this,t,s,0),r=!Z(t)||t!==this._$AH&&t!==L,r&&(this._$AH=t);else{let h=t,d,u;for(t=n[0],d=0;d<n.length-1;d++)u=z(this,h[i+d],s,d),u===L&&(u=this._$AH[d]),r||=!Z(u)||u!==this._$AH[d],u===p?t=p:t!==p&&(t+=(u??"")+n[d+1]),this._$AH[d]=u}r&&!o&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},_t=class extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},St=class extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},$t=class extends H{constructor(t,s,i,o,n){super(t,s,i,o,n),this.type=5}_$AI(t,s=this){if((t=z(this,t,s,0)??p)===L)return;let i=this._$AH,o=t===p&&i!==p||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==p&&(i===p||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},kt=class{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}};var ve=wt.litHtmlPolyfillSupport;ve?.(Q,X),(wt.litHtmlVersions??=[]).push("3.3.1");var ct=(e,t,s)=>{let i=s?.renderBefore??t,o=i._$litPart$;if(o===void 0){let n=s?.renderBefore??null;i._$litPart$=o=new X(t.insertBefore(Y(),n),n,void 0,s??{})}return o._$AI(e),o};var It=globalThis,f=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ct(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};f._$litElement$=!0,f.finalized=!0,It.litElementHydrateSupport?.({LitElement:f});var _e=It.litElementPolyfillSupport;_e?.({LitElement:f});(It.litElementVersions??=[]).push("4.2.1");var Se={attribute:!0,type:String,converter:W,reflect:!1,hasChanged:ht},$e=(e=Se,t,s)=>{let{kind:i,metadata:o}=s,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),n.set(s.name,e),i==="accessor"){let{name:r}=s;return{set(h){let d=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,d,e)},init(h){return h!==void 0&&this.C(r,void 0,e,h),h}}}if(i==="setter"){let{name:r}=s;return function(h){let d=this[r];t.call(this,h),this.requestUpdate(r,d,e)}}throw Error("Unsupported decorator location: "+i)};function a(e){return(t,s)=>typeof s=="object"?$e(e,t,s):((i,o,n)=>{let r=o.hasOwnProperty(n);return o.constructor.createProperty(n,i),r?Object.getOwnPropertyDescriptor(o,n):void 0})(e,t,s)}var ut=e=>e??p;var ke=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",we="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",Ce="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",Ae="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",Ie=Object.defineProperty,Nt=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&Ie(t,s,o),o},F,tt=(F=class extends f{static parseLevel(e){if(e){let t=Object.keys(B).find(s=>s.toLowerCase()===e.toLowerCase());return t&&B[t]}}static get styles(){return[x`
|
|
4
4
|
${m(ke)}
|
|
5
|
-
`]}render(){return c`${this.iconToUse&&c`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(e){return e.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(e)}get iconForLevel(){switch(F.parseLevel(this.level)){case"warn":return Ae;case"suggest":return Ce;case"error":return we;default:return null}}},F.ID="sd-field-validation-message",F.levelConverter={fromAttribute(e){return F.parseLevel(e)},toAttribute(e){return e&&e.toLowerCase()}},F);Nt([a({type:String,attribute:!0})],tt.prototype,"message");Nt([a({type:String,attribute:!0})],tt.prototype,"icon");Nt([a({converter:tt.levelConverter,reflect:!0})],tt.prototype,"level");var Et=tt,B=(e=>(e.Warn="warn",e.Suggest="suggest",e.Error="error",e))(B||{});customElements.get(Et.ID)||customElements.define(Et.ID,Et);var Ee=`:host{display:block}:host,.label,.checkbox{outline:none}.checkbox-container{display:flex;flex-direction:row;align-items:flex-start}.checkbox{appearance:none;-moz-appearance:none;-webkit-appearance:none;display:block;margin:0;width:20px;height:20px;border:2px solid #767676;cursor:pointer;background-color:#fff}:host(:not([disabled]):focus) .highlight,:host(:not([disabled])[focused]) .highlight{background-color:#1467ba4d;border-radius:4px}:host(:not([disabled]):focus) .highlight .checkbox,:host(:not([disabled])[focused]) .highlight .checkbox{border-color:#1467ba}:host([checked]) .checkbox{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2020%2020'%3e%3cpath%20d='M15.9%204.6L17.4%206l-9.5%209.5-5.2-5.2%201.4-1.4%203.8%203.8%208-8.1z'%20fill='%23fff'/%3e%3c/svg%3e") no-repeat center center;border-color:#1467ba}.checkbox.indeterminate{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20fill='%23fff'%20d='M8%2014h16v4H8z'/%3e%3c/svg%3e") no-repeat center center;background-size:20px;border-color:#1467ba}.highlight{border:4px solid transparent;margin-right:6px}:host([disabled]) .checkbox-container{opacity:.6;cursor:default;filter:grayscale(100%);pointer-events:none}.validation-message{margin-left:4px}.label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin-top:4px;line-height:20px}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`,Ne=Object.defineProperty,De=Object.getOwnPropertyDescriptor,k=(e,t,s,i)=>{for(var o=i>1?void 0:i?De(t,s):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&Ne(t,s,o),o},Pe="indeterminate",Dt="delegatesFocus"in window.ShadowRoot.prototype,A,
|
|
5
|
+
`]}render(){return c`${this.iconToUse&&c`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(e){return e.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(e)}get iconForLevel(){switch(F.parseLevel(this.level)){case"warn":return Ae;case"suggest":return Ce;case"error":return we;default:return null}}},F.ID="sd-field-validation-message",F.levelConverter={fromAttribute(e){return F.parseLevel(e)},toAttribute(e){return e&&e.toLowerCase()}},F);Nt([a({type:String,attribute:!0})],tt.prototype,"message");Nt([a({type:String,attribute:!0})],tt.prototype,"icon");Nt([a({converter:tt.levelConverter,reflect:!0})],tt.prototype,"level");var Et=tt,B=(e=>(e.Warn="warn",e.Suggest="suggest",e.Error="error",e))(B||{});customElements.get(Et.ID)||customElements.define(Et.ID,Et);var Ee=`:host{display:block}:host,.label,.checkbox{outline:none}.checkbox-container{display:flex;flex-direction:row;align-items:flex-start}.checkbox{appearance:none;-moz-appearance:none;-webkit-appearance:none;display:block;margin:0;width:20px;height:20px;border:2px solid #767676;cursor:pointer;background-color:#fff}:host(:not([disabled]):focus) .highlight,:host(:not([disabled])[focused]) .highlight{background-color:#1467ba4d;border-radius:4px}:host(:not([disabled]):focus) .highlight .checkbox,:host(:not([disabled])[focused]) .highlight .checkbox{border-color:#1467ba}:host([checked]) .checkbox{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2020%2020'%3e%3cpath%20d='M15.9%204.6L17.4%206l-9.5%209.5-5.2-5.2%201.4-1.4%203.8%203.8%208-8.1z'%20fill='%23fff'/%3e%3c/svg%3e") no-repeat center center;border-color:#1467ba}.checkbox.indeterminate{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20fill='%23fff'%20d='M8%2014h16v4H8z'/%3e%3c/svg%3e") no-repeat center center;background-size:20px;border-color:#1467ba}.highlight{border:4px solid transparent;margin-right:6px}:host([disabled]) .checkbox-container{opacity:.6;cursor:default;filter:grayscale(100%);pointer-events:none}.validation-message{margin-left:4px}.label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin-top:4px;line-height:20px}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`,Ne=Object.defineProperty,De=Object.getOwnPropertyDescriptor,k=(e,t,s,i)=>{for(var o=i>1?void 0:i?De(t,s):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&Ne(t,s,o),o},Pe="indeterminate",Dt="delegatesFocus"in window.ShadowRoot.prototype,A,v=(A=class extends f{constructor(){super(...arguments),this._checked=!1,this._indeterminate=!1}get checked(){return this._checked}set checked(e){let t=this._checked;this._checked=e,this._checked&&(this.indeterminate=!1),this.requestUpdate("checked",t)}get indeterminate(){return this._indeterminate}set indeterminate(e){let t=this._indeterminate;this._indeterminate=e,this._indeterminate&&(this.checked=!1),this.requestUpdate("indeterminate",t)}firstUpdated(e){super.firstUpdated(e),Dt||(this.checkboxElement.onfocus=()=>this.setAttribute("focused",""),this.checkboxElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",t=>{t.target===this&&this.checkboxElement.focus()}))}focus(){this.checkboxElement?this.checkboxElement.focus():super.focus()}attributeChangedCallback(e,t,s){super.attributeChangedCallback(e,t,s),!Dt&&e==="tabindex"&&t!==s&&s==="0"&&this.removeAttribute("tabindex")}render(){return c`
|
|
6
6
|
<div class="checkbox-container">
|
|
7
7
|
<div class="highlight">
|
|
8
8
|
<input
|
|
@@ -29,7 +29,7 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var mt=Object.defineProp
|
|
|
29
29
|
`}
|
|
30
30
|
`}onInputValueChange(e){e.preventDefault(),e.stopPropagation(),this.checked=e.target.checked,this.fireValueChange()}fireValueChange(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.checked}}))}get checkboxElement(){return this.shadowRoot.querySelector(".checkbox")}static get styles(){return[x`
|
|
31
31
|
${m(Ee)}
|
|
32
|
-
`]}},A.ID="sd-checkbox",A.ensureDefined=()=>{customElements.get(A.ID)||customElements.define(A.ID,A)},A.shadowRootOptions={...f.shadowRootOptions,delegatesFocus:Dt},A);k([a({type:Boolean,reflect:!0})],
|
|
32
|
+
`]}},A.ID="sd-checkbox",A.ensureDefined=()=>{customElements.get(A.ID)||customElements.define(A.ID,A)},A.shadowRootOptions={...f.shadowRootOptions,delegatesFocus:Dt},A);k([a({type:Boolean,reflect:!0})],v.prototype,"disabled",2);k([a({type:String,reflect:!0})],v.prototype,"label",2);k([a({type:String})],v.prototype,"validationMessage",2);k([a({type:String})],v.prototype,"validationIconSrc",2);k([a({type:B,reflect:!0})],v.prototype,"validationLevel",2);k([a({type:Number})],v.prototype,"tabIndex",2);k([a({type:Boolean,reflect:!0})],v.prototype,"oneLine",2);k([a({type:Boolean,reflect:!0})],v.prototype,"checked",1);k([a({type:Boolean,reflect:!1,attribute:!1})],v.prototype,"indeterminate",1);var Pt=v;Pt.ensureDefined();var Le=":host{display:block}:host,.label,.checkbox{outline:none}:host([disabled]){pointer-events:none}:host([disabled]) .root{opacity:.6;cursor:default;filter:grayscale(100%)}:host(:not([disabled])[focused]) .highlight{display:block!important}:host([checked]) circle.inner{display:block!important}:host([checked]) circle.outer{stroke:var(--sd-radio-button-checked-color, #1467ba)!important}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.root{display:inline-flex;align-items:center;vertical-align:middle;width:100%;padding-top:6px;padding-bottom:6px}.root .radio-button-container{position:relative;display:inline-block;width:28px;height:28px;box-sizing:border-box;cursor:pointer;margin-right:5px;flex-shrink:0}.root .radio-button-container input{position:absolute;top:0;left:0;opacity:0}.root .radio-button-container circle.highlight{stroke:var(--sd-radio-button-highlight-color, rgba(20, 103, 186, .3))}.root .radio-button-container circle.inner{fill:var(--sd-radio-button-checked-color, #1467ba)}.root .radio-button-container circle.outer{stroke:var(--sd-radio-button-unchecked-color, #767676)}.root .label{font-family:Segoe UI,Lucida Sans,Arial,sans-serif;text-overflow:ellipsis;overflow-x:hidden;-webkit-user-select:none;user-select:none;cursor:pointer;padding-top:2px;padding-bottom:2px}",Be=Object.defineProperty,pt=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&Be(t,s,o),o},Re=0,I,et=(I=class extends f{constructor(){super(),this.checked=!1,this.value="",this.disabled=!1,this.label="",this.handleClick=e=>{e.preventDefault()},this.a11yID=I.ID+"_"+Re++}static get styles(){return[x`
|
|
33
33
|
${m(Le)}
|
|
34
34
|
`]}render(){return c`
|
|
35
35
|
<div class="root">
|
|
@@ -119,16 +119,16 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var mt=Object.defineProp
|
|
|
119
119
|
<slot>Loading...</slot>
|
|
120
120
|
</div>
|
|
121
121
|
</li>
|
|
122
|
-
`}},M.ID="sd-tree-loading-indicator",M.ensureDefined=()=>{customElements.get(M.ID)||customElements.define(M.ID,M)},M);Xt([a({type:Boolean,reflect:!0,attribute:!0})],Rt.prototype,"readonly");Xt([a({type:Number})],Rt.prototype,"depth");var qe=Rt,st=(e,t=1,s=0)=>t>0?e.reduce((i,o)=>i.concat(o.childCount>0&&o.expanded?[o,...st(o.nodes,t-1,s+1)]:o),[]):e.slice(),te=(e,t,s=0)=>{if(!t)return null;let i=t[s],o=e.find(n=>n.id===i);return t.length-1===s?o:o?.nodes.length>0?te(o.nodes,t,s+1):null},ee=(e,t,s,i,o,n)=>{let r=Math.max(0,n*i),h=Math.min(r,e*i),d=Math.max(0,e*i-o+i);switch(t){case"start":return h;case"end":return d;case"center":{let u=Math.round(d+(h-d)/2);return u<Math.ceil(o/2)?0:u>r+Math.floor(o/2)?r:u}case"auto":default:return s>=d&&s<=h?s:s<d?d:h}},Bt=e=>e&&typeof e!="string",je=(e,t)=>{let s=e.find(i=>Bt(i)&&JSON.stringify(i.path)===JSON.stringify(t));return Bt(s)?s:null},q=(e,t)=>e.findIndex(s=>typeof s=="string"&&s===JSON.stringify(t)),
|
|
122
|
+
`}},M.ID="sd-tree-loading-indicator",M.ensureDefined=()=>{customElements.get(M.ID)||customElements.define(M.ID,M)},M);Xt([a({type:Boolean,reflect:!0,attribute:!0})],Rt.prototype,"readonly");Xt([a({type:Number})],Rt.prototype,"depth");var qe=Rt,st=(e,t=1,s=0)=>t>0?e.reduce((i,o)=>i.concat(o.childCount>0&&o.expanded?[o,...st(o.nodes,t-1,s+1)]:o),[]):e.slice(),te=(e,t,s=0)=>{if(!t)return null;let i=t[s],o=e.find(n=>n.id===i);return t.length-1===s?o:o?.nodes.length>0?te(o.nodes,t,s+1):null},ee=(e,t,s,i,o,n)=>{let r=Math.max(0,n*i),h=Math.min(r,e*i),d=Math.max(0,e*i-o+i);switch(t){case"start":return h;case"end":return d;case"center":{let u=Math.round(d+(h-d)/2);return u<Math.ceil(o/2)?0:u>r+Math.floor(o/2)?r:u}case"auto":default:return s>=d&&s<=h?s:s<d?d:h}},Bt=e=>e&&typeof e!="string",je=(e,t)=>{let s=e.find(i=>Bt(i)&&JSON.stringify(i.path)===JSON.stringify(t));return Bt(s)?s:null},q=(e,t)=>e.findIndex(s=>typeof s=="string"&&s===JSON.stringify(t)),_=e=>typeof e=="string",Ke=":host{display:block;position:relative;contain:layout;overflow:auto}:host(:focus){outline:none}ul{list-style-type:none;margin:0;padding:0}.root{width:100%}",Je=Object.defineProperty,We=Object.getOwnPropertyDescriptor,ot=(e,t,s,i)=>{for(var o=i>1?void 0:i?We(t,s):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&Je(t,s,o),o},T,j=(T=class extends f{constructor(){super(),this.pageSize=50,this.loadingText="Loading...",this.parentSelectionAllowed=!1,this.readonly=!1,this._lastKnownHeight=0,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._visibleItemsNum=0,this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0,this._focusIndex=-1,this._flattenedNodes=[],this._rootItemsLoading=!1,this._rootNodeCount=0,this._loadedRootNodeCount=0,this._allNodeCount=0,this._nodeStates=new Map,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=V&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleNodeExpansion=e=>{let{path:t,expanded:s}=e.detail;this.updateAfterExpansion(t,s)},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"ArrowDown":{this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowUp":{this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"ArrowRight":{let s=this.focusedNode;if(s)if(s.childCount>0&&!s.expanded){let i=this.querySelector(`[node-id='${s.id}']`);i&&i.expand()}else this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowLeft":{let s=this.focusedNode;if(s)if(s.childCount>0&&s.expanded){let i=this.querySelector(`[node-id='${s.id}']`);i&&i.collapse()}else this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"Enter":{let s=this.focusedNode;s&&(this.toggleSelection(s.path),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:s.path,checked:s.selectionState==="checked",indeterminate:s.selectionState==="indeterminate"},bubbles:!0,composed:!0}))}));break}default:{t=!1;break}}t&&(e.preventDefault(),e.stopPropagation())},this.handleNodeSelection=e=>{if(e.target==this)return;this._reusePreviousRenderData=!0;let{path:t}=e.detail;this.focusIndex=q(this._flattenedNodes,t),this.focus(),this.toggleSelection(t),this.updateComplete.then(()=>{this._reusePreviousRenderData=!1})},this.getFlattenedNodeId=e=>JSON.stringify(e.path),this.nodeGetter=e=>e?this._nodeStates.get(JSON.stringify(e)):null,this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get rootNodeCount(){return this._rootNodeCount}set rootNodeCount(e){e===0?this._allNodeCount=0:e>0&&(this._allNodeCount+=e-this.rootNodeCount),this._rootNodeCount=e,this.requestUpdate()}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this._allNodeCount){let t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToNode(e),t!=e&&this.requestUpdate("focusIndex",t)}}setNodes(e){this.stopLoadingIndicator(),this.setLastLoadingChildren(e,this.rootNodeCount,e.length),e.forEach((t,s)=>{let i=[...e];i.splice(s,1),this.updateNodeMap(t,i)}),this.updateCount(e),this._loadedRootNodeCount=e.length,this._flattenedNodes=st(e,1/0).map(this.getFlattenedNodeId),this.requestUpdate()}addNodes(e,t){this.stopLoadingIndicator(t),e.forEach((i,o)=>{let n=[...e];n.splice(o,1),this.updateNodeMap(i,n)});let s=this.nodeGetter(t);s?s.expanded&&(this._allNodeCount+=e.length+this.getNodeCount(e)):this._loadedRootNodeCount+=e.length,this.updateFlattenedNodes(e,t),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}static get styles(){return[x`
|
|
123
123
|
${m(Ke)}
|
|
124
|
-
`]}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("expansion",this.handleNodeExpansion),this.addEventListener("selection",this.handleNodeSelection),this.addEventListener("focus",()=>{this.focusIndex==-1&&(this.focusIndex=this.normalizeIndex(0))}),this._nodeStates.size===0&&(this.children.length>0?this.syncState():this.requestData())}updated(e){super.updated(e),this.updateNodes(),e.has("parentSelectionAllowed")&&this.updateParentSelectionAllowed()}render(){return this.updateRenderData(),c`
|
|
124
|
+
`]}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("expansion",this.handleNodeExpansion),this.addEventListener("selection",this.handleNodeSelection),this.addEventListener("focus",()=>{this.focusIndex==-1&&this.matches(":focus-visible")&&(this.focusIndex=this.normalizeIndex(0))}),this._nodeStates.size===0&&(this.children.length>0?this.syncState():this.requestData())}updated(e){super.updated(e),this.updateNodes(),e.has("parentSelectionAllowed")&&this.updateParentSelectionAllowed()}render(){return this.updateRenderData(),c`
|
|
125
125
|
<div class="root" style="height: ${this._allNodeCount*V}px">
|
|
126
126
|
<ul>
|
|
127
127
|
<slot></slot>
|
|
128
128
|
</ul>
|
|
129
129
|
</div>
|
|
130
130
|
`}scrollToNode(e,t="auto"){this.scrollTop=ee(this.normalizeIndex(e),t,this.scrollTop,V,this.height,this._allNodeCount)}updateNodeMap(e,t){e&&(e.nodeGetter=this.nodeGetter,e.getSiblings=()=>t,this._nodeStates.set(JSON.stringify(e.path),e),e.nodes.forEach((s,i)=>{let o=[...e.nodes];o.splice(i,1),this.updateNodeMap(s,o)}))}updateParentSelectionAllowed(){this._nodeStates.forEach(e=>{e.parentSelectionAllowed=this.parentSelectionAllowed})}updateNodes(){let e=this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1);ct(c`
|
|
131
|
-
${e.map((t,s)=>{let i=s+this._firstRenderedIndex,o=this.getTopPosition(i);if(!
|
|
131
|
+
${e.map((t,s)=>{let i=s+this._firstRenderedIndex,o=this.getTopPosition(i);if(!_(t))return c`
|
|
132
132
|
<sd-tree-loading-indicator .depth="${t.depth}" style="transform: translateY(${o}px)"
|
|
133
133
|
>${this.loadingText}</sd-tree-loading-indicator
|
|
134
134
|
>
|
|
@@ -149,7 +149,7 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var mt=Object.defineProp
|
|
|
149
149
|
.loading="${n.loading}"
|
|
150
150
|
></sd-tree-node>
|
|
151
151
|
`})}
|
|
152
|
-
`,this)}getTopPosition(e){return e*V}updateRenderData(){if(!this._reusePreviousRenderData)if(this._lastRenderedScrollTop=this.scrollTop,this._visibleItemsNum=Math.min(Math.ceil(this.height/V),this._allNodeCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastRenderedScrollTop/V)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum),this._firstRenderedIndex=this.normalizeIndex(this._firstVisibleIndex-2),this._lastRenderedIndex=this.normalizeIndex(this._lastVisibleIndex+2);for(let e of this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1)){let t=
|
|
152
|
+
`,this)}getTopPosition(e){return e*V}updateRenderData(){if(!this._reusePreviousRenderData)if(this._lastRenderedScrollTop=this.scrollTop,this._visibleItemsNum=Math.min(Math.ceil(this.height/V),this._allNodeCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastRenderedScrollTop/V)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum),this._firstRenderedIndex=this.normalizeIndex(this._firstVisibleIndex-2),this._lastRenderedIndex=this.normalizeIndex(this._lastVisibleIndex+2);for(let e of this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1)){let t=_(e)&&this._nodeStates.get(e);if(t){if(t.lastLoadingChild){let s=t.parentNode;if(s){if(this.needsFurtherData(s)){this.requestData(s);break}}else if(this._loadedRootNodeCount<this.rootNodeCount&&!this._rootItemsLoading){this.requestData();break}}else if(this.needsFurtherData(t)){this.requestData(t);break}}}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0}needsFurtherData(e){return e.expanded&&e.childCount>e.nodes.length&&this.nodeIndex(e.id)+e.nodes.length<this._lastRenderedIndex}nodeIndex(e){return this._flattenedNodes.findIndex(t=>t===e)}normalizeIndex(e){return Math.max(0,Math.min(e,this._allNodeCount-1))}get height(){return this.offsetHeight}requestData(e){if(!e?.loading){let t=e?.path;this.startLoadingIndicator(t),this.dispatchEvent(new CustomEvent("data-request",{detail:{path:t}}))}}updateAfterExpansion(e,t){let s=this._nodeStates.get(JSON.stringify(e));if(s){s.expanded=t;let i=q(this._flattenedNodes,e),o=this._flattenedNodes[this.focusIndex];if(t){let n=this.addSubtree(s,i+1),r=s.childCount>s.nodes.length,h=i+s.nodes.length<this._lastRenderedIndex;r&&h&&this.requestData(s),this._allNodeCount+=n}else{let n=this.removeSubtree(i);this._allNodeCount-=n}if(o){let n=this._flattenedNodes.findIndex(r=>r==o);n!==this.focusIndex&&(this._focusIndex=n)}}this.requestUpdate()}addSubtree(e,t){let s=this.getFlattenedSubtree(e.nodes);return this._flattenedNodes.splice(t,0,...s),s.length}getFlattenedSubtree(e){return e.reduce((t,s)=>t.concat(s&&s.childCount>0&&s.expanded?[JSON.stringify(s.path),...this.getFlattenedSubtree(s.nodes)]:JSON.stringify(s.path)),[])}removeSubtree(e){let t=this.getNextNonDescendantIndex(e),s=0;return t!==-1?(s=t-e-1,this._flattenedNodes.splice(e+1,s)):(s=this._flattenedNodes.length-e-1,this._flattenedNodes.splice(e+1)),s}getNextNonDescendantIndex(e){let t=this._flattenedNodes[e],s=_(t)&&this._nodeStates.get(t);if(s)for(let i=e+1;i<this._flattenedNodes.length;i++){let o=this._flattenedNodes[i],n=_(o)&&this._nodeStates.get(o);if(n&&n.path.length<=s.path.length)return i}return-1}get focusedNode(){let e=this._flattenedNodes[this.focusIndex];return _(e)&&this._nodeStates.get(e)}toggleSelection(e){this.nodeGetter(e).toggle(),this.requestUpdate()}updateFlattenedNodes(e,t){if(t){let s=q(this._flattenedNodes,t),i=this._flattenedNodes[s];if(_(i)){let o=this._nodeStates.get(i);if(o){let n=s+o.nodes.length+1,r=o.depth,h=st(e,1/0,r+1).map(this.getFlattenedNodeId);o.expanded&&this._flattenedNodes.splice(n,0,...h),o.nodes=[...o.nodes,...e],o.loading=!1,this.updateLastLoadingChild(o.nodes,h)}}}else{let s=st(e,1/0).map(this.getFlattenedNodeId);this.updateLastLoadingChild(this._flattenedNodes,s),this._flattenedNodes=[...this._flattenedNodes,...s]}}updateLastLoadingChild(e,t){let s=e[e.length-1],i=_(s)&&this._nodeStates.get(s),o=t[t.length-1],n=_(o)&&this._nodeStates.get(o);if(i&&(i.lastLoadingChild=!1),n){let r=n.parentNode;(r&&r.childCount>r.nodes.length||!r&&this.rootNodeCount>this._loadedRootNodeCount)&&(n.lastLoadingChild=!0)}}setLastLoadingChildren(e,t,s){if(s<t){let i=e[e.length-1];i&&(i.lastLoadingChild=!0)}e.forEach(i=>{this.setLastLoadingChildren(i.nodes,i.childCount,i.nodes.length)})}startLoadingIndicator(e){if(e){let t=this._nodeStates.get(JSON.stringify(e));if(t){let s=q(this._flattenedNodes,e);t.loading=!0,this.addPlaceholders(s,t)}}else this._rootItemsLoading=!0,this._flattenedNodes=[...this._flattenedNodes,...new Array(this.rootNodeCount-this._loadedRootNodeCount).fill({depth:0})];this.updateNodes()}addPlaceholders(e,t){let s=e+t.nodes.length+1,i=t.childCount-t.nodes.length;this._flattenedNodes.splice(s,0,...new Array(i).fill({depth:t.depth+1}))}stopLoadingIndicator(e){if(e){let t=this._nodeStates.get(JSON.stringify(e));if(t&&(t.loading=!1,t.expanded)){let s=q(this._flattenedNodes,e);this.removePlaceHolders(s,t)}}else{this._rootItemsLoading=!1;let t=this._flattenedNodes.findIndex(s=>!_(s));this._flattenedNodes.splice(t)}}removePlaceHolders(e,t){let s=e+t.nodes.length+1,i=t.childCount-t.nodes.length;this._flattenedNodes.splice(s,i)}syncState(){let e=[...this.children].map(t=>t.getState());this.addNodes(e),this.rootNodeCount=e.length,this.innerHTML=""}updateCount(e){this._allNodeCount=e.length+this.getNodeCount(e)}getNodeCount(e){let t=0;return e.forEach(s=>{s.expanded&&(t+=s.childCount+this.getNodeCount(s.nodes))}),t}},T.ID="sd-tree",T.ensureDefined=()=>{He.ensureDefined(),qe.ensureDefined(),customElements.get(T.ID)||customElements.define(T.ID,T)},T);ot([a({type:String})],j.prototype,"loadingText",2);ot([a({type:Boolean,reflect:!0,attribute:"parent-selection-allowed"})],j.prototype,"parentSelectionAllowed",2);ot([a({type:Boolean,reflect:!0,attribute:!0})],j.prototype,"readonly",2);ot([a({type:Number})],j.prototype,"rootNodeCount",1);ot([a({type:Number,attribute:"focus-index",reflect:!0})],j.prototype,"focusIndex",1);var se=j;se.ensureDefined();return de(Ge);})();
|
|
153
153
|
/*! Bundled license information:
|
|
154
154
|
|
|
155
155
|
@lit/reactive-element/css-tag.js:
|