@livenetworks/ashlar 2.0.6 → 2.0.7
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/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-accordion/src/ln-accordion.js +1 -0
- package/components/ln-couchdb-connector/README.md +4 -0
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-couchdb-connector/src/ln-couchdb-connector.js +18 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +15 -6
- package/components/ln-data-store/README.md +3 -2
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-data-store/src/data-store-model.js +29 -0
- package/components/ln-data-store/src/ln-data-store.js +57 -10
- package/components/ln-date/README.md +4 -0
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +3 -3
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/src/ln-list.js +4 -4
- package/components/ln-modal/README.md +4 -6
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-modal/src/ln-modal.js +28 -8
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-options/src/ln-options.js +1 -0
- package/components/ln-popover/README.md +4 -0
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/src/ln-popover.js +9 -0
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/src/ln-table.js +2 -0
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-table-coordinator/src/ln-table-coordinator.js +3 -3
- package/components/ln-tabs/README.md +2 -2
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/src/ln-tabs.js +1 -0
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function z(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function H(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let r=null;for(let s=1;s<e.length;s++)if(e[s]&&e[s].nodeType===1){r=e[s];break}if(!H(r))return}t.apply(console,e)}}function T(t,e,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function rt(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const r={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};r[l]=t.name,T(t.dom,e,r)}function F(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){F(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function $(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}const j={};function ot(t,e){j[t]=e}function st(t){return j[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ot,window.lnCore.getDataMapper=st);function at(t){const e=t?t.closest("[lang]"):null,l=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function ct(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,F(function(){new MutationObserver(function(){T(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function dt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];U[l]=e}function ut(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return U[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=dt,window.lnCore.getLocaleFallback=ut,window.lnCore.ensureLocaleObserver=ct);const W={};function G(t,e){W[t]||(W[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=W[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function K(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return G(e,l)}function Q(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let h=0;h<l.length;h++){const f=l[h],b=f.getAttribute("data-ln-field");e[b]!=null&&(f.textContent=e[b])}const r=t.querySelectorAll("[data-ln-attr]");for(let h=0;h<r.length;h++){const f=r[h],b=f.getAttribute("data-ln-attr").split(",");for(let g=0;g<b.length;g++){const S=b[g].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();e[E]!=null&&f.setAttribute(A,e[E])}}const s=t.querySelectorAll("[data-ln-show]");for(let h=0;h<s.length;h++){const f=s[h],b=f.getAttribute("data-ln-show");b in e&&f.classList.toggle("hidden",!e[b])}const u=t.querySelectorAll("[data-ln-class]");for(let h=0;h<u.length;h++){const f=u[h],b=f.getAttribute("data-ln-class").split(",");for(let g=0;g<b.length;g++){const S=b[g].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();E in e&&f.classList.toggle(A,!!e[E])}}return t}function ht(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<l.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[r],e??null),l[r].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)Q(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function M(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(h,f){return e[f]!==void 0?e[f]:""}))}const r=function(u,h){return e[h]!==void 0?e[h]:""},s=Array.from(t.querySelectorAll("*"));t.nodeType===1&&s.push(t);for(let u=0;u<s.length;u++){const h=s[u],f=h.attributes;for(let b=0;b<f.length;b++){const g=f[b];g.value.indexOf("{{")!==-1&&h.setAttribute(g.name,g.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function ft(t,e,l,r,s,u){const h={};for(let b=0;b<t.children.length;b++){const g=t.children[b],S=g.getAttribute("data-ln-render-key");S&&(h[S]=g)}const f=document.createDocumentFragment();for(let b=0;b<e.length;b++){const g=e[b],S=String(r(g));let A=h[S];if(A)s(A,g,b);else{const E=G(l,u);if(!E||(M(E,g),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",S),s(A,g,b)}f.appendChild(A)}t.textContent="",t.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=Q,window.lnCore.lnFill=ht,window.lnCore.renderList=ft);function O(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function bt(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function Y(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function _t(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const N=new Map;function pt(t,e){const l=(t?t.join("|"):"")+"::"+e;if(N.has(l))return N.get(l);const r=new Set(t||[]),s=function(u,h){const f=u.getAttribute(h);return f!==null&&r.has(f)?f:e};return N.set(l,s),s}function gt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function wt(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function J(t,e,l,r,s){if(!t||e===null)return!0;const u=r||"ln-component",h=t.type;if(h==="trigger"||h==="marker"||h==="string"||h==="list"||!h||e===""&&t.fallback!==void 0)return!0;const f=b=>{s?console.warn(b,s):console.warn(b)};if(h==="boolean"){const b=e.trim().toLowerCase();return b!==""&&b!=="true"&&b!=="false"&&b!=="1"&&b!=="0"?(f(`[${u}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(h==="enum"){const b=t.values||[];return b.includes(e)?!0:(f(`[${u}] Invalid value "${e}" for attribute "${l}". Allowed: ${b.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(h==="integer"){if(!/^-?\d+$/.test(e))return f(`[${u}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const b=parseInt(e,10);return t.min!==void 0&&b<t.min?(f(`[${u}] Value ${b} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&b>t.max?(f(`[${u}] Value ${b} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(h==="float")return isNaN(Number(e))?(f(`[${u}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(h==="json")try{return JSON.parse(e),!0}catch(b){return f(`[${u}] Invalid JSON for attribute "${l}": ${b.message}. Fallback: ${t.fallback}.`),!1}return!0}function mt(t,e,l){for(const r in l){const[s,u,h]=l[r];Object.defineProperty(t,r,{get:function(){return s(e,u,h)},enumerable:!0,configurable:!0})}return t}function yt(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=pt(r.values,r.fallback);break;case"integer":s=bt;break;case"float":s=gt;break;case"boolean":s=Y;break;case"list":s=_t;break;case"json":s=wt;break;case"string":default:s=O;break}s||(s=O),e[r.prop]=[s,l,r.fallback]}return e}function Ct(t){const e={};for(const l in t){const r=t[l];r&&r.effect&&(e[l]=r.effect)}return Object.keys(e).length?e:null}function St(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}function P(t,e,l,r){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",h=Array.from(t.querySelectorAll(u));t.matches&&t.matches(u)&&h.push(t);for(const f of h)if(!f[l]){window.lnCore._persistSink&&f.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(f,e);try{f[l]=new r(f)}catch(b){console.error("["+l+"] init failed",f,b)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function vt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function At(t){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(t):setTimeout(t,0)):t()}function X(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function Et(t){const e=X(),l=t.observed||[];for(let r=0;r<l.length;r++){const s=l[r];e.byAttr.has(s)||e.byAttr.set(s,[]),e.byAttr.get(s).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const r in t.attributes){e.byDeclaredAttr.has(r)||e.byDeclaredAttr.set(r,[]);const s=e.byDeclaredAttr.get(r);s.some(u=>u.componentTag===t.componentTag)||s.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=St(t);if(r===null)e.reactiveWildcard.push(t);else for(const s of r)e.byReactive.has(s)||e.byReactive.set(s,[]),e.byReactive.get(s).push(t)}t.persist&&e.persist.push(t)}function Z(t,e,l,r){for(let s=0;s<t.length;s++){const u=t[s];if(!e[u.attribute])continue;const h=u.effects&&u.effects[l];h?h(e,l,r):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(e,l,r)}}function Dt(t){const e=t.target,l=t.attributeName;if(t.oldValue===e.getAttribute(l))return;const r=X(),s=r.byAttr.get(l);if(z()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(l)&&H(e)){const u=r.byDeclaredAttr.get(l),h=e.getAttribute(l);for(let f=0;f<u.length;f++)J(u[f].spec,h,l,u[f].componentTag,e)}if(window.lnCore._debugSink&&(l.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",l,e,{oldValue:t.oldValue,newValue:e.getAttribute(l)}),l.indexOf("data-ln-")===0){const u=r.byReactive.get(l);u&&Z(u,e,l,t.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,e,l,t.oldValue)}if(s)for(let u=0;u<s.length;u++){const h=s[u];if(h.handler){h.handler(e,l,t.oldValue);continue}h.onAttributeChange&&e[h.attribute]?h.onAttributeChange(e,l):(P(e,h.selector,h.attribute,h.ComponentFn),h.onInit&&h.onInit(e))}}function kt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,F(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Dt(e[l])}catch(r){console.error("[ln-core] mutation handler failed",e[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function tt(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Tt(t){const e=tt();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const r=e[l];if(r.onSubtreeChange){const s=r.query,u=t.target.nodeType===1?t.target.matches(s)?t.target:t.target.closest(s):t.target.parentElement?t.target.parentElement.closest(s):null;u&&r.onSubtreeChange(u,t)}}for(let l=0;l<t.addedNodes.length;l++){const r=t.addedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const u=e[s];P(r,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(r)}}for(let l=0;l<t.removedNodes.length;l++){const r=t.removedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const u=e[s],h=u.query,f=Array.from(r.querySelectorAll(h));r.matches&&r.matches(h)&&f.push(r);for(let b=0;b<f.length;b++){const g=f[b];if(!document.contains(g)){const S=g[u.attribute];if(S&&typeof S.destroy=="function")try{S.destroy()}catch(A){console.error("["+u.attribute+"] destroy failed",g,A)}delete g[u.attribute]}}}}}}function Lt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,F(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{Tt(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xt(t,e,l,r,s={}){const u=s.extraAttributes||[],h=s.onAttributeChange||null,f=s.onSubtreeChange||null,b=s.onInit||null,g=s.onAttrChange||null,S=s.effects||null,A=s.attributes||null,E=A?Ct(A):S,q=A?new Set(Object.keys(A)):null,R=s.persist||null;function I(o){const d=o||document.body;if(P(d,t,e,l),A&&z())for(const a in A){const p=A[a],_=Array.from(d.querySelectorAll("["+a+"]"));d.matches&&d.matches("["+a+"]")&&_.push(d);for(let w=0;w<_.length;w++){const m=_[w];H(m)&&J(p,m.getAttribute(a),a,r,m)}}b&&b(d)}const v=[];if(t.indexOf("[")!==-1){const o=/\[([\w-]+)/g;let d;for(;(d=o.exec(t))!==null;)v.push(d[1])}else v.push(t);Et({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:b,observed:v.concat(u),onAttributeChange:h,onAttrChange:g,effects:E,declared:q,persist:R}),kt();const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";tt().push({selector:t,attribute:e,ComponentFn:l,onInit:b,onSubtreeChange:f,query:c}),Lt(),window[e]=I;function i(){vt()>0?At(function(){I(document.body)}):I(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),I}function qt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Rt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,r=t.threshold!=null?t.threshold:25,s=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},h=typeof t.onChange=="function"?t.onChange:function(){},f=new Map,b=new Map,g=new Set;let S=0,A=0,E=0,q={sort:null,filters:{},search:""},R=null,I=0,v=0,n=!1;function c(a){b.set(a,++I)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function o(){if(f.size<=e)return;const a=Array.from(f.keys()).sort(function(_,w){return(b.get(_)||0)-(b.get(w)||0)});let p=0;for(;f.size>e&&p<a.length;)f.delete(a[p]),b.delete(a[p]),p++}function d(a,p){g.add(a),u(q,a,p)}return{get:function(a){return f.get(a)},has:function(a){return f.has(a)},peek:function(){return f.size?f.values().next().value:void 0},get logicalTotal(){return S},get grandTotal(){return A},get queryGen(){return E},get size(){return f.size},ensure:function(a,p){clearTimeout(R),v=a;for(let D=a;D<p;D++)f.has(D)&&c(D);if(S<=0)return;const _=Math.max(0,a-r),w=Math.min(S,p+r),m=Math.floor(_/l),L=Math.floor(Math.max(0,w-1)/l);let x=-1;for(let D=m;D<=L;D++){const y=D*l,C=Math.min(l,S-y);let k=!1;const Bt=Math.max(y,_),zt=Math.min(y+C,w);for(let B=Bt;B<zt;B++)if(!f.has(B)){k=!0;break}if(k&&!g.has(y)){x=y;break}}x!==-1&&(R=setTimeout(function(){d(x,l)},s))},ingest:function(a){if(a=a||{},a.queryGen!=null&&a.queryGen!==E)return!1;const p=a.offset||0,_=a.data||[];let w=0;for(let m=0;m<_.length;m++)_[m]!=null&&w++;if(w===0&&(a.provisional||a.filtered>0))return g.delete(p),!1;n&&(f.clear(),b.clear(),n=!1),a.provisional||(A=a.total!=null?a.total:A,S=a.filtered!=null?a.filtered:a.data?a.data.length:S);for(let m=0;m<_.length;m++)_[m]!=null&&(f.set(p+m,_[m]),c(p+m));return g.delete(p),o(),h(),!0},requestInitial:function(a){a&&(q=a),d(0,l)},invalidate:function(a){E++,g.clear(),clearTimeout(R),a&&(q=a),n=!0,d(0,l)},revalidate:function(){E++,g.clear(),clearTimeout(R),n=!0;const a=Math.max(0,Math.floor(v/l)*l);d(a,l)},release:function(a){g.delete(a)},destroy:function(){clearTimeout(R),f.clear(),b.clear(),g.clear()},configure:function(a){a=a||{};let p=!1;if(a.windowSize!=null&&a.windowSize>0&&a.windowSize!==e){const _=a.windowSize<e;e=a.windowSize,_&&o(),p=!0}a.pageSize!=null&&a.pageSize>0&&(l=a.pageSize),a.threshold!=null&&a.threshold>=0&&(r=a.threshold),a.fetchDebounce!=null&&a.fetchDebounce>=0&&(s=a.fetchDebounce),p&&h()},setGrandTotal:function(a){a==null||isNaN(a)||a<0||(A=a,i()||(S=a),h())}}}function et(t){return(t||"").replace(/^#/,"")}function V(t){const e=t===void 0?location.hash:t,l={},r=et(e);if(!r)return l;const s=r.split("&");for(let u=0;u<s.length;u++){const h=s[u];if(!h)continue;const f=h.indexOf(":"),b=f>-1?h.slice(0,f):h,g=f>-1?h.slice(f+1):"";if(b)try{l[b]=decodeURIComponent(g)}catch{l[b]=g}}return l}function It(t){if(!t)return null;const e=V();return t in e?e[t]:null}function Ft(t,e){if(!t)return;const l=V();e==null?delete l[t]:l[t]=String(e);const s=Object.keys(l).map(function(u){const h=l[u];return h===""?u:u+":"+encodeURIComponent(h)}).join("&");et(location.hash)!==s&&(location.hash=s)}function Ot(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Ht(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const r=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return r?e?r+"-"+e:r:e||null}function Wt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Mt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function Nt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Pt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),r=t.slice(e+1),s=r?r.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=It,window.lnCore.hashSet=Ft,window.lnCore.hashLinkClick=Ot,window.lnCore.resolveHashNamespace=Ht,window.lnCore.hashSortEncode=Wt,window.lnCore.hashSortDecode=Mt,window.lnCore.hashFilterEncode=Nt,window.lnCore.hashFilterDecode=Pt);function nt(t,e,l,r,s=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const u=Math.max(0,t||0),h=Math.max(0,e||0),f=Math.floor(u/l),b=Math.ceil(h/l),g=Math.max(0,f-s),S=Math.min(r,f+b+s),A=g*l,E=Math.max(0,(r-S)*l);return{start:g,end:S,topPadding:A,bottomPadding:E}}function Vt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let s=0;if(Array.isArray(t))for(let f=0;f<t.length;f++)r.has(t[f])&&s++;else s=r.size;const u=l>0&&s===l,h=s>0&&s<l;return{totalCount:l,selectedCount:s,isAllSelected:u,isIndeterminate:h}}function it(t,e,l){const r=new Set(t);return e==null||((l!==void 0?l:!r.has(e))?r.add(e):r.delete(e)),r}function lt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let s=0;s<e.length;s++)e[s]!=null&&r.add(e[s]);else for(let s=0;s<e.length;s++)r.delete(e[s]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function b(n,c){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const o=parseInt(c,10);o>0&&n._cache.configure({windowSize:o})}}function g(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>0&&n._cache.configure({pageSize:i})}function S(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>=0&&n._cache.configure({threshold:i})}function A(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:O,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:O,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:Y,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:b,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:g,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:S,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},q=yt(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function R(n,c){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(at(c)).format(n)}catch{return String(n)}}function I(n){let c=n.parentElement;for(;c&&c!==document.body&&c!==document.documentElement;){const o=getComputedStyle(c).overflowY;if(o==="auto"||o==="scroll")return c;c=c.parentElement}return null}function v(n){this.dom=n,mt(this,n,q),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const c=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=c?Array.from(c.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(o){const d=(o.detail&&o.detail.query!=null?o.detail.query:o.detail&&o.detail.term!=null?o.detail.term:"").trim();i.isDataDriven?(i.currentSearch=d,T(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=d.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),T(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(o){o.preventDefault(),i._onSetSearch(o)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",T(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),T(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(o){const d=o.detail||{},a=d.data||[],p=d.total!=null?d.total:a.length;if(!(i._hasInitialSeed&&!i.isLoaded&&a.length===0&&p===0)){if(i._windowed){i._cache.ingest(d)&&!d.provisional&&n.classList.remove("ln-table--loading");return}i._data=a,i._lastTotal=p,i._lastFiltered=d.filtered!=null?d.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),T(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(o){const d=o.detail&&o.detail.loading;n.classList.toggle("ln-table--loading",!!d),d&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(o){!i._windowed||!i._cache||i._cache.release(o.detail&&o.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(o){o.preventDefault(),i.currentSort=o.detail.direction==="none"?null:{field:o.detail.field,direction:o.detail.direction},i._requestData()},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(o){if(o.target.closest("[data-ln-table-row-select]")||o.target.closest("[data-ln-table-row-action]")||o.target.closest("a")||o.target.closest("button")||o.ctrlKey||o.metaKey||o.button===1)return;const d=o.target.closest("[data-ln-table-row]");if(!d)return;const a=d.getAttribute("data-ln-table-row-id"),p=d._lnRecord||{};T(n,"ln-table:row-click",{table:i.name,id:a,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(o){const d=o.target.closest("[data-ln-table-row-action]");if(!d)return;const a=d.closest("[data-ln-table-row]");if(!a)return;const p=d.getAttribute("data-ln-table-row-action"),_=a.getAttribute("data-ln-table-row-id"),w=a._lnRecord||{};T(n,"ln-table:row-action",{table:i.name,id:_,action:p,record:w})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():T(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(o){o.preventDefault();const d=o.detail.direction==="none"?null:o.detail.direction;i._sortCol=d===null?-1:o.detail.column,i._sortDir=d,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),T(n,"ln-table:sorted",{column:o.detail.column,direction:o.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(o){if(o.preventDefault(),!o.detail)return;const d=o.detail.key,a=o.detail.values||[];if(d){if(a.length===0)delete i._columnFilters[d];else{const p=[];for(let _=0;_<a.length;_++)p.push(a[_].toLowerCase());i._columnFilters[d]=p}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),T(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}v.prototype._parseRows=function(){const n=this.tbody.rows,c=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const o=n[i],d=[],a=[],p=[];for(let w=0;w<o.cells.length;w++){const m=o.cells[w],L=m.textContent.trim();d[w]=$(m),a[w]=L.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||p.push(L.toLowerCase())}let _=null;if(this.isDataDriven){_={};const w=o.getAttribute("data-ln-table-row-id");w!=null&&(_.id=w);for(let m=0;m<c.length;m++){const L=c[m].getAttribute("data-ln-table-col");if(L){const x=m;if(x<o.cells.length){const D=o.cells[x];_[L]=$(D)}}}}this._data.push({values:d,rawTexts:a,html:o.outerHTML,searchText:p.join(" "),id:this.isDataDriven&&_?_.id:void 0,..._})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),T(this.dom,"ln-table:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},v.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(c){const i=document.createElement("col");i.style.width=c.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,c=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||c===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,c=document.createDocumentFragment();for(let i=0;i<n.length;i++){const o=this._buildRow(n[i]);if(!o)break;c.appendChild(o)}this.tbody.replaceChildren(c),this._selectable&&this._updateSelectAll()}else{const n=[],c=this._filteredData;for(let i=0;i<c.length;i++)n.push(c[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const o=this._cache?this._cache.peek():null;i=o?this._buildRow(o):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=I(this.dom):this._scrollContainer=null;const c=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},c.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,c=n.length,i=this._rowHeight;if(!i||!c)return;const o=this.thead?this.thead.offsetHeight:0,d=this._scrollContainer;let a,p;if(d){const y=this.table.getBoundingClientRect(),C=d.getBoundingClientRect(),k=y.top-C.top+d.scrollTop+o;a=d.scrollTop-k,p=d.clientHeight}else{const k=this.table.getBoundingClientRect().top+window.scrollY+o;a=window.scrollY-k,p=window.innerHeight}const _=nt(a,p,i,c,15),w=_.start,m=_.end;if(w===this._vStart&&m===this._vEnd)return;this._vStart=w,this._vEnd=m;const L=this.ths.length||1,x=_.topPadding,D=_.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(x>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const k=document.createElement("td");k.setAttribute("colspan",L),k.style.height=x+"px",C.appendChild(k),y.appendChild(C)}for(let C=w;C<m;C++){const k=this._buildRow(n[C]);k&&y.appendChild(k)}if(D>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const k=document.createElement("td");k.setAttribute("colspan",L),k.style.height=D+"px",C.appendChild(k),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";x>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+L+'" style="height:'+x+'px;padding:0;border:none"></td></tr>');for(let C=w;C<m;C++)y+=n[C].html;D>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+L+'" style="height:'+D+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const c=document.createElement("td");return c.setAttribute("colspan",this.ths.length||1),c.style.height=this._rowHeight+"px",n.appendChild(c),n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const c=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,o=this._scrollContainer;let d,a;if(o){const y=this.table.getBoundingClientRect(),C=o.getBoundingClientRect(),k=y.top-C.top+o.scrollTop+i;d=o.scrollTop-k,a=o.clientHeight}else{const k=this.table.getBoundingClientRect().top+window.scrollY+i;d=window.scrollY-k,a=window.innerHeight}const p=nt(d,a,n,c,15),_=p.start,w=p.end,m=this.ths.length||1,L=p.topPadding,x=p.bottomPadding,D=document.createDocumentFragment();if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),D.appendChild(y)}for(let y=_;y<w;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&D.appendChild(C)}else D.appendChild(this._buildPlaceholderRow());if(x>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=x+"px",y.appendChild(C),D.appendChild(y)}this.tbody.replaceChildren(D),this._vStart=_,this._vEnd=w,this._cache.ensure(_,w)},v.prototype._showEmptyState=function(){const n=this.ths.length||1;let c=null,i=null;if(this.isDataDriven){const o=this._lastTotal!=null?this._lastTotal:this._data.length,a=this.visibleCount===0&&o>0,p=a?this.name+"-empty-filtered":this.name+"-empty";if(i=K(this.dom,p,"ln-table"),!i){const _=this.dom.querySelector("template[data-ln-table-empty]");if(_){const w=a?"search":"initial",m=_.content.querySelector('[data-ln-table-empty-when="'+w+'"]')||_.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")c=i;else{const _=document.createElement("td");_.setAttribute("colspan",String(n)),_.appendChild(i);const w=document.createElement("tr");w.className="ln-table__empty",w.appendChild(_),c=w}}else{const o=this.dom.querySelector("template["+l+"]"),d=document.createElement("td");d.setAttribute("colspan",String(n)),o&&d.appendChild(document.importNode(o.content,!0));const a=document.createElement("tr");a.className="ln-table__empty",a.appendChild(d),c=a}c?this.tbody.replaceChildren(c):this.tbody.replaceChildren(),T(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._fillRow=function(n,c){M(n,c);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let o=0;o<i.length;o++){const d=i[o],a=d.getAttribute("data-ln-table-cell-attr").split(",");for(let p=0;p<a.length;p++){const _=a[p].trim().split(":");if(_.length!==2)continue;const w=_[0].trim(),m=_[1].trim();c[w]!=null&&d.setAttribute(m,c[w])}}},v.prototype._buildRow=function(n){let c=K(this.dom,this.name+"-row","ln-table");if(!c){const o=this.dom.querySelector("template[data-ln-table-row]");o&&(c=document.importNode(o.content,!0))}let i=c?c.querySelector("[data-ln-table-row]")||c.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const o=document.createElement("tbody");o.innerHTML=n.html,i=o.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const o=this.ths;for(let d=0;d<o.length;d++){const a=o[d].hasAttribute("data-ln-table-col-select"),p=document.createElement("td");if(a){const _=document.createElement("input");_.type="checkbox",_.setAttribute("data-ln-table-row-select",""),_.setAttribute("aria-label","Select row"),p.appendChild(_)}else{const _=o[d].getAttribute("data-ln-table-col");_&&n[_]!=null&&(p.textContent=String(n[_]))}i.appendChild(p)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const o=i.querySelector("[data-ln-table-row-select]");o&&(o.checked=!0)}return i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}rt(this,"ln-table:request-data","table")},v.prototype._enterWindowedMode=function(){const n=this,c=this.dom,i=parseInt(c.getAttribute("data-ln-table-window"),10),o=parseInt(c.getAttribute("data-ln-table-window-page"),10),d=parseInt(c.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),T(c,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=qt(this._onCacheChange),this._cache=Rt({windowSize:i>0?i:1e3,pageSize:o>0?o:200,threshold:d>=0?d:25,fetchDebounce:120,requestPage:function(a,p,_){T(c,"ln-table:request-data",{table:n.name,sort:a.sort,filters:a.filters,search:a.search,offset:p,limit:_,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const c=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:c,filtered:c})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),c=[];for(let o=0;o<n.length;o++){const d=n[o].getAttribute("data-ln-table-row-id");d!=null&&c.push(d)}const i=Vt(c,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let c=0;c<n.length;c++){const i=n[c].getAttribute("data-ln-table-row-id"),o=i!=null&&this.selectedIds.has(i);n[c].classList.toggle("ln-row-selected",o);const d=n[c].querySelector("[data-ln-table-row-select]");d&&(d.checked=o)}this._updateSelectAll()},Object.defineProperty(v.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(c){const i=c.target.closest("[data-ln-table-row-select]");if(!i)return;const o=i.closest("[data-ln-table-row]");if(!o)return;const d=o.getAttribute("data-ln-table-row-id");d!=null&&(n.selectedIds=it(n.selectedIds,d,i.checked),o.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),T(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const c=document.createElement("input");c.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),o=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";c.setAttribute("aria-label",o),this._selectAllCheckbox.appendChild(c),this._selectAllCheckbox=c}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const c=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],o=[];for(let d=0;d<i.length;d++){const a=i[d].getAttribute("data-ln-table-row-id"),p=i[d].querySelector("[data-ln-table-row-select]");a!=null&&(o.push(a),i[d].classList.toggle("ln-row-selected",c),p&&(p.checked=c))}n.selectedIds=lt(n.selectedIds,o,c),n.selectedCount=n.selectedIds.size,T(n.dom,"ln-table:select-all",{table:n.name,selected:c}),T(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const c=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<c.length;i++){const o=c[i].querySelector("[data-ln-table-row-select]"),d=c[i].getAttribute("data-ln-table-row-id");o&&o.checked&&d!=null&&(n.selectedIds=it(n.selectedIds,d,!0),c[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},v.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const c=n.querySelector('input[type="checkbox"]');c&&c.remove()}if(this._selectAllCheckbox=null,this.selectedIds=lt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const c=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<c.length;i++){c[i].classList.remove("ln-row-selected");const o=c[i].querySelector("[data-ln-table-row-select]");o&&(o.checked=!1)}}this._updateFooter()},v.prototype._updateFooter=function(){let n=0,c=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,c=this.visibleCount):(n=this._data.length,c=this._filteredData.length);const i=c<n;if(this._totalSpan&&(this._totalSpan.textContent=R(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?R(c,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const o=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=o>0?R(o,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",o===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},xt(t,e,v,"ln-table",{attributes:E})})()})();
|
|
1
|
+
(function(){"use strict";function z(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function H(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let r=null;for(let s=1;s<e.length;s++)if(e[s]&&e[s].nodeType===1){r=e[s];break}if(!H(r))return}t.apply(console,e)}}function T(t,e,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function rt(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const r={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};r[l]=t.name,T(t.dom,e,r)}function F(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){F(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function $(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}const j={};function ot(t,e){j[t]=e}function st(t){return j[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ot,window.lnCore.getDataMapper=st);function at(t){const e=t?t.closest("[lang]"):null,l=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function ct(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,F(function(){new MutationObserver(function(){T(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function dt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];U[l]=e}function ut(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return U[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=dt,window.lnCore.getLocaleFallback=ut,window.lnCore.ensureLocaleObserver=ct);const W={};function G(t,e){W[t]||(W[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=W[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function K(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return G(e,l)}function Q(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let h=0;h<l.length;h++){const f=l[h],b=f.getAttribute("data-ln-field");e[b]!=null&&(f.textContent=e[b])}const r=t.querySelectorAll("[data-ln-attr]");for(let h=0;h<r.length;h++){const f=r[h],b=f.getAttribute("data-ln-attr").split(",");for(let g=0;g<b.length;g++){const S=b[g].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();e[E]!=null&&f.setAttribute(A,e[E])}}const s=t.querySelectorAll("[data-ln-show]");for(let h=0;h<s.length;h++){const f=s[h],b=f.getAttribute("data-ln-show");b in e&&f.classList.toggle("hidden",!e[b])}const u=t.querySelectorAll("[data-ln-class]");for(let h=0;h<u.length;h++){const f=u[h],b=f.getAttribute("data-ln-class").split(",");for(let g=0;g<b.length;g++){const S=b[g].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();E in e&&f.classList.toggle(A,!!e[E])}}return t}function ht(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<l.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[r],e??null),l[r].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)Q(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function M(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(h,f){return e[f]!==void 0?e[f]:""}))}const r=function(u,h){return e[h]!==void 0?e[h]:""},s=Array.from(t.querySelectorAll("*"));t.nodeType===1&&s.push(t);for(let u=0;u<s.length;u++){const h=s[u],f=h.attributes;for(let b=0;b<f.length;b++){const g=f[b];g.value.indexOf("{{")!==-1&&h.setAttribute(g.name,g.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function ft(t,e,l,r,s,u){const h={};for(let b=0;b<t.children.length;b++){const g=t.children[b],S=g.getAttribute("data-ln-render-key");S&&(h[S]=g)}const f=document.createDocumentFragment();for(let b=0;b<e.length;b++){const g=e[b],S=String(r(g));let A=h[S];if(A)s(A,g,b);else{const E=G(l,u);if(!E||(M(E,g),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",S),s(A,g,b)}f.appendChild(A)}t.textContent="",t.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=Q,window.lnCore.lnFill=ht,window.lnCore.renderList=ft);function O(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function bt(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function Y(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function _t(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const N=new Map;function pt(t,e){const l=(t?t.join("|"):"")+"::"+e;if(N.has(l))return N.get(l);const r=new Set(t||[]),s=function(u,h){const f=u.getAttribute(h);return f!==null&&r.has(f)?f:e};return N.set(l,s),s}function gt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function wt(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function J(t,e,l,r,s){if(!t||e===null)return!0;const u=r||"ln-component",h=t.type;if(h==="trigger"||h==="marker"||h==="string"||h==="list"||!h||e===""&&t.fallback!==void 0)return!0;const f=b=>{s?console.warn(b,s):console.warn(b)};if(h==="boolean"){const b=e.trim().toLowerCase();return b!==""&&b!=="true"&&b!=="false"&&b!=="1"&&b!=="0"?(f(`[${u}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(h==="enum"){const b=t.values||[];return b.includes(e)?!0:(f(`[${u}] Invalid value "${e}" for attribute "${l}". Allowed: ${b.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(h==="integer"){if(!/^-?\d+$/.test(e))return f(`[${u}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const b=parseInt(e,10);return t.min!==void 0&&b<t.min?(f(`[${u}] Value ${b} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&b>t.max?(f(`[${u}] Value ${b} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(h==="float")return isNaN(Number(e))?(f(`[${u}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(h==="json")try{return JSON.parse(e),!0}catch(b){return f(`[${u}] Invalid JSON for attribute "${l}": ${b.message}. Fallback: ${t.fallback}.`),!1}return!0}function mt(t,e,l){for(const r in l){const[s,u,h]=l[r];Object.defineProperty(t,r,{get:function(){return s(e,u,h)},enumerable:!0,configurable:!0})}return t}function yt(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=pt(r.values,r.fallback);break;case"integer":s=bt;break;case"float":s=gt;break;case"boolean":s=Y;break;case"list":s=_t;break;case"json":s=wt;break;case"string":default:s=O;break}s||(s=O),e[r.prop]=[s,l,r.fallback]}return e}function Ct(t){const e={};for(const l in t){const r=t[l];r&&r.effect&&(e[l]=r.effect)}return Object.keys(e).length?e:null}function St(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}function P(t,e,l,r){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",h=Array.from(t.querySelectorAll(u));t.matches&&t.matches(u)&&h.push(t);for(const f of h)if(!f[l]){window.lnCore._persistSink&&f.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(f,e);try{f[l]=new r(f)}catch(b){console.error("["+l+"] init failed",f,b)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function vt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function At(t){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(t):setTimeout(t,0)):t()}function X(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function Et(t){const e=X(),l=t.observed||[];for(let r=0;r<l.length;r++){const s=l[r];e.byAttr.has(s)||e.byAttr.set(s,[]),e.byAttr.get(s).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const r in t.attributes){e.byDeclaredAttr.has(r)||e.byDeclaredAttr.set(r,[]);const s=e.byDeclaredAttr.get(r);s.some(u=>u.componentTag===t.componentTag)||s.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=St(t);if(r===null)e.reactiveWildcard.push(t);else for(const s of r)e.byReactive.has(s)||e.byReactive.set(s,[]),e.byReactive.get(s).push(t)}t.persist&&e.persist.push(t)}function Z(t,e,l,r){for(let s=0;s<t.length;s++){const u=t[s];if(!e[u.attribute])continue;const h=u.effects&&u.effects[l];h?h(e,l,r):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(e,l,r)}}function Dt(t){const e=t.target,l=t.attributeName;if(t.oldValue===e.getAttribute(l))return;const r=X(),s=r.byAttr.get(l);if(z()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(l)&&H(e)){const u=r.byDeclaredAttr.get(l),h=e.getAttribute(l);for(let f=0;f<u.length;f++)J(u[f].spec,h,l,u[f].componentTag,e)}if(window.lnCore._debugSink&&(l.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",l,e,{oldValue:t.oldValue,newValue:e.getAttribute(l)}),l.indexOf("data-ln-")===0){const u=r.byReactive.get(l);u&&Z(u,e,l,t.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,e,l,t.oldValue)}if(s)for(let u=0;u<s.length;u++){const h=s[u];if(h.handler){h.handler(e,l,t.oldValue);continue}h.onAttributeChange&&e[h.attribute]?h.onAttributeChange(e,l):(P(e,h.selector,h.attribute,h.ComponentFn),h.onInit&&h.onInit(e))}}function kt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,F(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Dt(e[l])}catch(r){console.error("[ln-core] mutation handler failed",e[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function tt(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Tt(t){const e=tt();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const r=e[l];if(r.onSubtreeChange){const s=r.query,u=t.target.nodeType===1?t.target.matches(s)?t.target:t.target.closest(s):t.target.parentElement?t.target.parentElement.closest(s):null;u&&r.onSubtreeChange(u,t)}}for(let l=0;l<t.addedNodes.length;l++){const r=t.addedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const u=e[s];P(r,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(r)}}for(let l=0;l<t.removedNodes.length;l++){const r=t.removedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const u=e[s],h=u.query,f=Array.from(r.querySelectorAll(h));r.matches&&r.matches(h)&&f.push(r);for(let b=0;b<f.length;b++){const g=f[b];if(!document.contains(g)){const S=g[u.attribute];if(S&&typeof S.destroy=="function")try{S.destroy()}catch(A){console.error("["+u.attribute+"] destroy failed",g,A)}delete g[u.attribute]}}}}}}function Lt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,F(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{Tt(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xt(t,e,l,r,s={}){const u=s.extraAttributes||[],h=s.onAttributeChange||null,f=s.onSubtreeChange||null,b=s.onInit||null,g=s.onAttrChange||null,S=s.effects||null,A=s.attributes||null,E=A?Ct(A):S,q=A?new Set(Object.keys(A)):null,R=s.persist||null;function I(o){const d=o||document.body;if(P(d,t,e,l),A&&z())for(const a in A){const p=A[a],_=Array.from(d.querySelectorAll("["+a+"]"));d.matches&&d.matches("["+a+"]")&&_.push(d);for(let w=0;w<_.length;w++){const m=_[w];H(m)&&J(p,m.getAttribute(a),a,r,m)}}b&&b(d)}const v=[];if(t.indexOf("[")!==-1){const o=/\[([\w-]+)/g;let d;for(;(d=o.exec(t))!==null;)v.push(d[1])}else v.push(t);Et({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:b,observed:v.concat(u),onAttributeChange:h,onAttrChange:g,effects:E,declared:q,persist:R}),kt();const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";tt().push({selector:t,attribute:e,ComponentFn:l,onInit:b,onSubtreeChange:f,query:c}),Lt(),window[e]=I;function i(){vt()>0?At(function(){I(document.body)}):I(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),I}function qt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Rt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,r=t.threshold!=null?t.threshold:25,s=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},h=typeof t.onChange=="function"?t.onChange:function(){},f=new Map,b=new Map,g=new Set;let S=0,A=0,E=0,q={sort:null,filters:{},search:""},R=null,I=0,v=0,n=!1;function c(a){b.set(a,++I)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function o(){if(f.size<=e)return;const a=Array.from(f.keys()).sort(function(_,w){return(b.get(_)||0)-(b.get(w)||0)});let p=0;for(;f.size>e&&p<a.length;)f.delete(a[p]),b.delete(a[p]),p++}function d(a,p){g.add(a),u(q,a,p)}return{get:function(a){return f.get(a)},has:function(a){return f.has(a)},peek:function(){return f.size?f.values().next().value:void 0},get logicalTotal(){return S},get grandTotal(){return A},get queryGen(){return E},get size(){return f.size},ensure:function(a,p){clearTimeout(R),v=a;for(let D=a;D<p;D++)f.has(D)&&c(D);if(S<=0)return;const _=Math.max(0,a-r),w=Math.min(S,p+r),m=Math.floor(_/l),L=Math.floor(Math.max(0,w-1)/l);let x=-1;for(let D=m;D<=L;D++){const y=D*l,C=Math.min(l,S-y);let k=!1;const Bt=Math.max(y,_),zt=Math.min(y+C,w);for(let B=Bt;B<zt;B++)if(!f.has(B)){k=!0;break}if(k&&!g.has(y)){x=y;break}}x!==-1&&(R=setTimeout(function(){d(x,l)},s))},ingest:function(a){if(a=a||{},a.queryGen!=null&&a.queryGen!==E)return!1;const p=a.offset||0,_=a.data||[];let w=0;for(let m=0;m<_.length;m++)_[m]!=null&&w++;if(w===0&&(a.provisional||a.filtered>0))return g.delete(p),!1;n&&(f.clear(),b.clear(),n=!1),a.provisional||(A=a.total!=null?a.total:A,S=a.filtered!=null?a.filtered:a.data?a.data.length:S);for(let m=0;m<_.length;m++)_[m]!=null&&(f.set(p+m,_[m]),c(p+m));return g.delete(p),o(),h(),!0},requestInitial:function(a){a&&(q=a),d(0,l)},invalidate:function(a){E++,g.clear(),clearTimeout(R),a&&(q=a),n=!0,d(0,l)},revalidate:function(){E++,g.clear(),clearTimeout(R),n=!0;const a=Math.max(0,Math.floor(v/l)*l);d(a,l)},release:function(a){g.delete(a)},destroy:function(){clearTimeout(R),f.clear(),b.clear(),g.clear()},configure:function(a){a=a||{};let p=!1;if(a.windowSize!=null&&a.windowSize>0&&a.windowSize!==e){const _=a.windowSize<e;e=a.windowSize,_&&o(),p=!0}a.pageSize!=null&&a.pageSize>0&&(l=a.pageSize),a.threshold!=null&&a.threshold>=0&&(r=a.threshold),a.fetchDebounce!=null&&a.fetchDebounce>=0&&(s=a.fetchDebounce),p&&h()},setGrandTotal:function(a){a==null||isNaN(a)||a<0||(A=a,i()||(S=a),h())}}}function et(t){return(t||"").replace(/^#/,"")}function V(t){const e=t===void 0?location.hash:t,l={},r=et(e);if(!r)return l;const s=r.split("&");for(let u=0;u<s.length;u++){const h=s[u];if(!h)continue;const f=h.indexOf(":"),b=f>-1?h.slice(0,f):h,g=f>-1?h.slice(f+1):"";if(b)try{l[b]=decodeURIComponent(g)}catch{l[b]=g}}return l}function It(t){if(!t)return null;const e=V();return t in e?e[t]:null}function Ft(t,e){if(!t)return;const l=V();e==null?delete l[t]:l[t]=String(e);const s=Object.keys(l).map(function(u){const h=l[u];return h===""?u:u+":"+encodeURIComponent(h)}).join("&");et(location.hash)!==s&&(location.hash=s)}function Ot(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Ht(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const r=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return r?e?r+"-"+e:r:e||null}function Wt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Mt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function Nt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Pt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),r=t.slice(e+1),s=r?r.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=It,window.lnCore.hashSet=Ft,window.lnCore.hashLinkClick=Ot,window.lnCore.resolveHashNamespace=Ht,window.lnCore.hashSortEncode=Wt,window.lnCore.hashSortDecode=Mt,window.lnCore.hashFilterEncode=Nt,window.lnCore.hashFilterDecode=Pt);function nt(t,e,l,r,s=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const u=Math.max(0,t||0),h=Math.max(0,e||0),f=Math.floor(u/l),b=Math.ceil(h/l),g=Math.max(0,f-s),S=Math.min(r,f+b+s),A=g*l,E=Math.max(0,(r-S)*l);return{start:g,end:S,topPadding:A,bottomPadding:E}}function Vt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let s=0;if(Array.isArray(t))for(let f=0;f<t.length;f++)r.has(t[f])&&s++;else s=r.size;const u=l>0&&s===l,h=s>0&&s<l;return{totalCount:l,selectedCount:s,isAllSelected:u,isIndeterminate:h}}function it(t,e,l){const r=new Set(t);return e==null||((l!==void 0?l:!r.has(e))?r.add(e):r.delete(e)),r}function lt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let s=0;s<e.length;s++)e[s]!=null&&r.add(e[s]);else for(let s=0;s<e.length;s++)r.delete(e[s]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function b(n,c){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const o=parseInt(c,10);o>0&&n._cache.configure({windowSize:o})}}function g(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>0&&n._cache.configure({pageSize:i})}function S(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>=0&&n._cache.configure({threshold:i})}function A(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:O,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:O,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:Y,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:b,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:g,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:S,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},q=yt(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function R(n,c){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(at(c)).format(n)}catch{return String(n)}}function I(n){let c=n.parentElement;for(;c&&c!==document.body&&c!==document.documentElement;){const o=getComputedStyle(c).overflowY;if(o==="auto"||o==="scroll")return c;c=c.parentElement}return null}function v(n){this.dom=n,mt(this,n,q),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const c=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=c?Array.from(c.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(o){const d=(o.detail&&o.detail.query!=null?o.detail.query:o.detail&&o.detail.term!=null?o.detail.term:"").trim();i.isDataDriven?(i.currentSearch=d,T(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=d.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),T(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(o){o.preventDefault(),i._onSetSearch(o)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",T(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),T(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(o){const d=o.detail||{},a=d.data||[],p=d.total!=null?d.total:a.length;if(!(i._hasInitialSeed&&!i.isLoaded&&a.length===0&&p===0)){if(i._windowed){i._cache.ingest(d)&&!d.provisional&&n.classList.remove("ln-table--loading");return}i._data=a,i._lastTotal=p,i._lastFiltered=d.filtered!=null?d.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),T(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(o){const d=o.detail&&o.detail.loading;n.classList.toggle("ln-table--loading",!!d),d&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(o){!i._windowed||!i._cache||i._cache.release(o.detail&&o.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(o){!o.detail||o.detail.field==null||(o.preventDefault(),i.currentSort=o.detail.direction==="none"?null:{field:o.detail.field,direction:o.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(o){if(o.target.closest("[data-ln-table-row-select]")||o.target.closest("[data-ln-table-row-action]")||o.target.closest("a")||o.target.closest("button")||o.ctrlKey||o.metaKey||o.button===1)return;const d=o.target.closest("[data-ln-table-row]");if(!d)return;const a=d.getAttribute("data-ln-table-row-id"),p=d._lnRecord||{};T(n,"ln-table:row-click",{table:i.name,id:a,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(o){const d=o.target.closest("[data-ln-table-row-action]");if(!d)return;const a=d.closest("[data-ln-table-row]");if(!a)return;const p=d.getAttribute("data-ln-table-row-action"),_=a.getAttribute("data-ln-table-row-id"),w=a._lnRecord||{};T(n,"ln-table:row-action",{table:i.name,id:_,action:p,record:w})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():T(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(o){if(!o.detail||o.detail.column==null)return;o.preventDefault();const d=o.detail.direction==="none"?null:o.detail.direction;i._sortCol=d===null?-1:o.detail.column,i._sortDir=d,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),T(n,"ln-table:sorted",{column:o.detail.column,direction:o.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(o){if(o.preventDefault(),!o.detail)return;const d=o.detail.key,a=o.detail.values||[];if(d){if(a.length===0)delete i._columnFilters[d];else{const p=[];for(let _=0;_<a.length;_++)p.push(a[_].toLowerCase());i._columnFilters[d]=p}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),T(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}v.prototype._parseRows=function(){const n=this.tbody.rows,c=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const o=n[i],d=[],a=[],p=[];for(let w=0;w<o.cells.length;w++){const m=o.cells[w],L=m.textContent.trim();d[w]=$(m),a[w]=L.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||p.push(L.toLowerCase())}let _=null;if(this.isDataDriven){_={};const w=o.getAttribute("data-ln-table-row-id");w!=null&&(_.id=w);for(let m=0;m<c.length;m++){const L=c[m].getAttribute("data-ln-table-col");if(L){const x=m;if(x<o.cells.length){const D=o.cells[x];_[L]=$(D)}}}}this._data.push({values:d,rawTexts:a,html:o.outerHTML,searchText:p.join(" "),id:this.isDataDriven&&_?_.id:void 0,..._})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),T(this.dom,"ln-table:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},v.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(c){const i=document.createElement("col");i.style.width=c.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,c=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||c===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,c=document.createDocumentFragment();for(let i=0;i<n.length;i++){const o=this._buildRow(n[i]);if(!o)break;c.appendChild(o)}this.tbody.replaceChildren(c),this._selectable&&this._updateSelectAll()}else{const n=[],c=this._filteredData;for(let i=0;i<c.length;i++)n.push(c[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const o=this._cache?this._cache.peek():null;i=o?this._buildRow(o):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=I(this.dom):this._scrollContainer=null;const c=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},c.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,c=n.length,i=this._rowHeight;if(!i||!c)return;const o=this.thead?this.thead.offsetHeight:0,d=this._scrollContainer;let a,p;if(d){const y=this.table.getBoundingClientRect(),C=d.getBoundingClientRect(),k=y.top-C.top+d.scrollTop+o;a=d.scrollTop-k,p=d.clientHeight}else{const k=this.table.getBoundingClientRect().top+window.scrollY+o;a=window.scrollY-k,p=window.innerHeight}const _=nt(a,p,i,c,15),w=_.start,m=_.end;if(w===this._vStart&&m===this._vEnd)return;this._vStart=w,this._vEnd=m;const L=this.ths.length||1,x=_.topPadding,D=_.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(x>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const k=document.createElement("td");k.setAttribute("colspan",L),k.style.height=x+"px",C.appendChild(k),y.appendChild(C)}for(let C=w;C<m;C++){const k=this._buildRow(n[C]);k&&y.appendChild(k)}if(D>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const k=document.createElement("td");k.setAttribute("colspan",L),k.style.height=D+"px",C.appendChild(k),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";x>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+L+'" style="height:'+x+'px;padding:0;border:none"></td></tr>');for(let C=w;C<m;C++)y+=n[C].html;D>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+L+'" style="height:'+D+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const c=document.createElement("td");return c.setAttribute("colspan",this.ths.length||1),c.style.height=this._rowHeight+"px",n.appendChild(c),n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const c=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,o=this._scrollContainer;let d,a;if(o){const y=this.table.getBoundingClientRect(),C=o.getBoundingClientRect(),k=y.top-C.top+o.scrollTop+i;d=o.scrollTop-k,a=o.clientHeight}else{const k=this.table.getBoundingClientRect().top+window.scrollY+i;d=window.scrollY-k,a=window.innerHeight}const p=nt(d,a,n,c,15),_=p.start,w=p.end,m=this.ths.length||1,L=p.topPadding,x=p.bottomPadding,D=document.createDocumentFragment();if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),D.appendChild(y)}for(let y=_;y<w;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&D.appendChild(C)}else D.appendChild(this._buildPlaceholderRow());if(x>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=x+"px",y.appendChild(C),D.appendChild(y)}this.tbody.replaceChildren(D),this._vStart=_,this._vEnd=w,this._cache.ensure(_,w)},v.prototype._showEmptyState=function(){const n=this.ths.length||1;let c=null,i=null;if(this.isDataDriven){const o=this._lastTotal!=null?this._lastTotal:this._data.length,a=this.visibleCount===0&&o>0,p=a?this.name+"-empty-filtered":this.name+"-empty";if(i=K(this.dom,p,"ln-table"),!i){const _=this.dom.querySelector("template[data-ln-table-empty]");if(_){const w=a?"search":"initial",m=_.content.querySelector('[data-ln-table-empty-when="'+w+'"]')||_.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")c=i;else{const _=document.createElement("td");_.setAttribute("colspan",String(n)),_.appendChild(i);const w=document.createElement("tr");w.className="ln-table__empty",w.appendChild(_),c=w}}else{const o=this.dom.querySelector("template["+l+"]"),d=document.createElement("td");d.setAttribute("colspan",String(n)),o&&d.appendChild(document.importNode(o.content,!0));const a=document.createElement("tr");a.className="ln-table__empty",a.appendChild(d),c=a}c?this.tbody.replaceChildren(c):this.tbody.replaceChildren(),T(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._fillRow=function(n,c){M(n,c);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let o=0;o<i.length;o++){const d=i[o],a=d.getAttribute("data-ln-table-cell-attr").split(",");for(let p=0;p<a.length;p++){const _=a[p].trim().split(":");if(_.length!==2)continue;const w=_[0].trim(),m=_[1].trim();c[w]!=null&&d.setAttribute(m,c[w])}}},v.prototype._buildRow=function(n){let c=K(this.dom,this.name+"-row","ln-table");if(!c){const o=this.dom.querySelector("template[data-ln-table-row]");o&&(c=document.importNode(o.content,!0))}let i=c?c.querySelector("[data-ln-table-row]")||c.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const o=document.createElement("tbody");o.innerHTML=n.html,i=o.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const o=this.ths;for(let d=0;d<o.length;d++){const a=o[d].hasAttribute("data-ln-table-col-select"),p=document.createElement("td");if(a){const _=document.createElement("input");_.type="checkbox",_.setAttribute("data-ln-table-row-select",""),_.setAttribute("aria-label","Select row"),p.appendChild(_)}else{const _=o[d].getAttribute("data-ln-table-col");_&&n[_]!=null&&(p.textContent=String(n[_]))}i.appendChild(p)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const o=i.querySelector("[data-ln-table-row-select]");o&&(o.checked=!0)}return i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}rt(this,"ln-table:request-data","table")},v.prototype._enterWindowedMode=function(){const n=this,c=this.dom,i=parseInt(c.getAttribute("data-ln-table-window"),10),o=parseInt(c.getAttribute("data-ln-table-window-page"),10),d=parseInt(c.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),T(c,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=qt(this._onCacheChange),this._cache=Rt({windowSize:i>0?i:1e3,pageSize:o>0?o:200,threshold:d>=0?d:25,fetchDebounce:120,requestPage:function(a,p,_){T(c,"ln-table:request-data",{table:n.name,sort:a.sort,filters:a.filters,search:a.search,offset:p,limit:_,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const c=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:c,filtered:c})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),c=[];for(let o=0;o<n.length;o++){const d=n[o].getAttribute("data-ln-table-row-id");d!=null&&c.push(d)}const i=Vt(c,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let c=0;c<n.length;c++){const i=n[c].getAttribute("data-ln-table-row-id"),o=i!=null&&this.selectedIds.has(i);n[c].classList.toggle("ln-row-selected",o);const d=n[c].querySelector("[data-ln-table-row-select]");d&&(d.checked=o)}this._updateSelectAll()},Object.defineProperty(v.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(c){const i=c.target.closest("[data-ln-table-row-select]");if(!i)return;const o=i.closest("[data-ln-table-row]");if(!o)return;const d=o.getAttribute("data-ln-table-row-id");d!=null&&(n.selectedIds=it(n.selectedIds,d,i.checked),o.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),T(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const c=document.createElement("input");c.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),o=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";c.setAttribute("aria-label",o),this._selectAllCheckbox.appendChild(c),this._selectAllCheckbox=c}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const c=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],o=[];for(let d=0;d<i.length;d++){const a=i[d].getAttribute("data-ln-table-row-id"),p=i[d].querySelector("[data-ln-table-row-select]");a!=null&&(o.push(a),i[d].classList.toggle("ln-row-selected",c),p&&(p.checked=c))}n.selectedIds=lt(n.selectedIds,o,c),n.selectedCount=n.selectedIds.size,T(n.dom,"ln-table:select-all",{table:n.name,selected:c}),T(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const c=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<c.length;i++){const o=c[i].querySelector("[data-ln-table-row-select]"),d=c[i].getAttribute("data-ln-table-row-id");o&&o.checked&&d!=null&&(n.selectedIds=it(n.selectedIds,d,!0),c[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},v.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const c=n.querySelector('input[type="checkbox"]');c&&c.remove()}if(this._selectAllCheckbox=null,this.selectedIds=lt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const c=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<c.length;i++){c[i].classList.remove("ln-row-selected");const o=c[i].querySelector("[data-ln-table-row-select]");o&&(o.checked=!1)}}this._updateFooter()},v.prototype._updateFooter=function(){let n=0,c=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,c=this.visibleCount):(n=this._data.length,c=this._filteredData.length);const i=c<n;if(this._totalSpan&&(this._totalSpan.textContent=R(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?R(c,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const o=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=o>0?R(o,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",o===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},xt(t,e,v,"ln-table",{attributes:E})})()})();
|
|
@@ -299,6 +299,7 @@ import { calculateSelectionState, calculateVirtualWindow, toggleRowSelection, to
|
|
|
299
299
|
|
|
300
300
|
// --- Sort ---
|
|
301
301
|
this._onSort = function (e) {
|
|
302
|
+
if (!e.detail || e.detail.field == null) return;
|
|
302
303
|
e.preventDefault();
|
|
303
304
|
self.currentSort = e.detail.direction === 'none' ? null : { field: e.detail.field, direction: e.detail.direction };
|
|
304
305
|
self._requestData();
|
|
@@ -388,6 +389,7 @@ import { calculateSelectionState, calculateVirtualWindow, toggleRowSelection, to
|
|
|
388
389
|
}
|
|
389
390
|
|
|
390
391
|
this._onSort = function (e) {
|
|
392
|
+
if (!e.detail || e.detail.column == null) return;
|
|
391
393
|
e.preventDefault();
|
|
392
394
|
const direction = e.detail.direction === 'none' ? null : e.detail.direction;
|
|
393
395
|
self._sortCol = direction === null ? -1 : e.detail.column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function L(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!S(r))return}e.apply(console,t)}}function I(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function _(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){_(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const $={};function V(e,t){$[e]=t}function H(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=H);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function K(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function P(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=K,window.lnCore.getLocaleFallback=P,window.lnCore.ensureLocaleObserver=U);const k={};function Q(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const a=n[s],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const a=r[s],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const a=i[s],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const a=l[s],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function X(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,a){return t[a]!==void 0?t[a]:""}))}const r=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],a=s.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&s.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function G(e,t,n,r,i,l){const s={};for(let o=0;o<e.children.length;o++){const c=e.children[o],u=c.getAttribute("data-ln-render-key");u&&(s[u]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],u=String(r(c));let d=s[u];if(d)i(d,c,o);else{const f=Q(n,l);if(!f||(R(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,c,o)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=N,window.lnCore.lnFill=X,window.lnCore.renderList=G);function B(e,t,n,r,i){if(!e||t===null)return!0;const l=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const a=o=>{i?console.warn(o,i):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${l}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${l}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${l}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function J(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function z(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function E(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s=Array.from(e.querySelectorAll(l));e.matches&&e.matches(l)&&s.push(e);for(const a of s)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Y(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Z(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function F(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ee(e){const t=F(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=z(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function M(e,t,n,r){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function te(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=F(),i=r.byAttr.get(n);if(L()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&S(t)){const l=r.byDeclaredAttr.get(n),s=t.getAttribute(n);for(let a=0;a<l.length;a++)B(l[a].spec,s,n,l[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const l=r.byReactive.get(n);l&&M(l,t,n,e.oldValue),r.reactiveWildcard.length&&M(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let l=0;l<i.length;l++){const s=i[l];if(s.handler){s.handler(t,n,e.oldValue);continue}s.onAttributeChange&&t[s.attribute]?s.onAttributeChange(t,n):(E(t,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(t))}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,_(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{te(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function W(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function re(e){const t=W();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,l=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;l&&r.onSubtreeChange(l,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const l=t[i];E(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const l=t[i],s=l.query,a=Array.from(r.querySelectorAll(s));r.matches&&r.matches(s)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const u=c[l.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+l.attribute+"] destroy failed",c,d)}delete c[l.attribute]}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{re(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t,n,r,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,a=i.onSubtreeChange||null,o=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?J(d):u,m=d?new Set(Object.keys(d)):null,h=i.persist||null;function w(A){const p=A||document.body;if(E(p,e,t,n),d&&L())for(const v in d){const be=d[v],T=Array.from(p.querySelectorAll("["+v+"]"));p.matches&&p.matches("["+v+"]")&&T.push(p);for(let O=0;O<T.length;O++){const x=T[O];S(x)&&B(be,x.getAttribute(v),v,r,x)}}o&&o(p)}const y=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let p;for(;(p=A.exec(e))!==null;)y.push(p[1])}else y.push(e);ee({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:y.concat(l),onAttributeChange:s,onAttrChange:c,effects:f,declared:m,persist:h}),ne();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";W().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:b}),oe(),window[t]=w;function g(){Y()>0?Z(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),w}function j(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,n={},r=j(t);if(!r)return n;const i=r.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const a=s.indexOf(":"),o=a>-1?s.slice(0,a):s,c=a>-1?s.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function ie(e){if(!e)return null;const t=q();return e in t?t[e]:null}function se(e,t){if(!e)return;const n=q();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");j(location.hash)!==i&&(location.hash=i)}function ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function de(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function we(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=ie,window.lnCore.hashSet=se,window.lnCore.hashLinkClick=ae,window.lnCore.resolveHashNamespace=ce,window.lnCore.hashSortEncode=ue,window.lnCore.hashSortDecode=de,window.lnCore.hashFilterEncode=fe,window.lnCore.hashFilterDecode=we),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const n={"data-ln-table-coordinator":{type:"marker",description:"Mounts table coordinator mediating between table, search, filter, and pagination"}};document.addEventListener("keydown",function(a){if(a.key!=="/"||a.defaultPrevented||document.activeElement&&(document.activeElement.tagName==="INPUT"||document.activeElement.tagName==="TEXTAREA"||document.activeElement.isContentEditable))return;const o=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!o)return;const c=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o:o.querySelector('input[type="search"], input[type="text"], input');c&&(a.preventDefault(),c.focus())});function r(a){return this.dom=a,s(this),this}function i(a,o){const c=o?'[data-ln-search-for="'+o+'"]':"[data-ln-search-for]",u=a.querySelector(c)||document.querySelector(c);return u?u.tagName==="INPUT"||u.tagName==="TEXTAREA"?u:u.querySelector("input, textarea"):null}function l(a,o){if(o){const u=a.querySelectorAll('[data-ln-filter="'+o+'"]');if(u.length>0)return u;const d=document.querySelectorAll('[data-ln-filter="'+o+'"]');if(d.length>0)return d}const c=a.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function s(a){const o=a.dom;function c(u){const d=u.target;if(d&&d.hasAttribute&&(d.hasAttribute("data-ln-table")||d.tagName==="TABLE"))return d;const f=u.detail&&u.detail.targetId||d&&d.id;return f?o.querySelector('[data-ln-table-source="'+f+'"]')||o.querySelector('[data-ln-table="'+f+'"]')||o.querySelector("#"+f)||(o.id===f?o:null)||document.getElementById(f):null}a._handlers={filter:function(u){if(!u.detail)return;const d=c(u);if(!d)return;const f=u.detail.key,m=u.detail.values||[],h=d.querySelectorAll("th");for(let w=0;w<h.length;w++)if((h[w].getAttribute("data-ln-table-filter-col")||h[w].getAttribute("data-ln-filter-col")||h[w].getAttribute("data-ln-filter-key")||h[w].getAttribute("data-ln-field"))===f){const C=h[w].querySelector("[data-ln-table-col-filter], .table-filter");C&&C.classList.toggle("ln-filter-active",m.length>0);break}},clear:function(u){const d=u.target.closest("[data-ln-table-clear], [data-ln-table-clear-all]");if(!d)return;const f=d.closest("[data-ln-table], table")||o.querySelector("[data-ln-table], table");if(!f)return;const m=f.lnTable&&f.lnTable.name||f.id,h=f.querySelectorAll("th");for(let b=0;b<h.length;b++){const g=h[b].querySelector("[data-ln-table-col-filter], .table-filter");g&&g.classList.remove("ln-filter-active")}const w=f.getAttribute("data-ln-table-source")||f.id,y=w?document.getElementById(w):null;if(y&&y.hasAttribute("data-ln-search"))y.setAttribute("data-ln-search","");else{const b=i(o,w);b&&b.value!==""&&(b.value="",b.dispatchEvent(new Event("input",{bubbles:!0})))}const C=l(o,w);for(let b=0;b<C.length;b++){const g=C[b].querySelector("[data-ln-filter-reset]");if(!g)continue;const A=C[b].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!g.checked||A)&&(g.checked=!0,g.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&I(f,"ln-table:request-clear-filters",{table:m})}},o.addEventListener("ln-filter:change",a._handlers.filter),o.addEventListener("click",a._handlers.clear)}r.prototype.destroy=function(){this.dom[t]&&(this._handlers&&(this.dom.removeEventListener("ln-filter:change",this._handlers.filter),this.dom.removeEventListener("click",this._handlers.clear),this._handlers=null),delete this.dom[t])},le(e,t,r,"ln-table-coordinator",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function L(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function _(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!_(r))return}e.apply(console,t)}}function I(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const $={};function V(e,t){$[e]=t}function H(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=H);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function K(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function P(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=K,window.lnCore.getLocaleFallback=P,window.lnCore.ensureLocaleObserver=U);const k={};function Q(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const a=n[s],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const a=r[s],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const a=i[s],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const a=l[s],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function X(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,a){return t[a]!==void 0?t[a]:""}))}const r=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],a=s.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&s.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function G(e,t,n,r,i,l){const s={};for(let o=0;o<e.children.length;o++){const c=e.children[o],u=c.getAttribute("data-ln-render-key");u&&(s[u]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],u=String(r(c));let d=s[u];if(d)i(d,c,o);else{const f=Q(n,l);if(!f||(R(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,c,o)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=N,window.lnCore.lnFill=X,window.lnCore.renderList=G);function B(e,t,n,r,i){if(!e||t===null)return!0;const l=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const a=o=>{i?console.warn(o,i):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${l}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${l}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${l}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function J(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function z(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function E(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s=Array.from(e.querySelectorAll(l));e.matches&&e.matches(l)&&s.push(e);for(const a of s)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Y(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Z(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function F(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ee(e){const t=F(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=z(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function M(e,t,n,r){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function te(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=F(),i=r.byAttr.get(n);if(L()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&_(t)){const l=r.byDeclaredAttr.get(n),s=t.getAttribute(n);for(let a=0;a<l.length;a++)B(l[a].spec,s,n,l[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const l=r.byReactive.get(n);l&&M(l,t,n,e.oldValue),r.reactiveWildcard.length&&M(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let l=0;l<i.length;l++){const s=i[l];if(s.handler){s.handler(t,n,e.oldValue);continue}s.onAttributeChange&&t[s.attribute]?s.onAttributeChange(t,n):(E(t,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(t))}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{te(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function W(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function re(e){const t=W();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,l=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;l&&r.onSubtreeChange(l,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const l=t[i];E(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const l=t[i],s=l.query,a=Array.from(r.querySelectorAll(s));r.matches&&r.matches(s)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const u=c[l.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+l.attribute+"] destroy failed",c,d)}delete c[l.attribute]}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{re(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t,n,r,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,a=i.onSubtreeChange||null,o=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?J(d):u,C=d?new Set(Object.keys(d)):null,h=i.persist||null;function w(A){const p=A||document.body;if(E(p,e,t,n),d&&L())for(const v in d){const be=d[v],q=Array.from(p.querySelectorAll("["+v+"]"));p.matches&&p.matches("["+v+"]")&&q.push(p);for(let O=0;O<q.length;O++){const x=q[O];_(x)&&B(be,x.getAttribute(v),v,r,x)}}o&&o(p)}const y=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let p;for(;(p=A.exec(e))!==null;)y.push(p[1])}else y.push(e);ee({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:y.concat(l),onAttributeChange:s,onAttrChange:c,effects:f,declared:C,persist:h}),ne();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";W().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:b}),oe(),window[t]=w;function g(){Y()>0?Z(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),w}function j(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=j(t);if(!r)return n;const i=r.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const a=s.indexOf(":"),o=a>-1?s.slice(0,a):s,c=a>-1?s.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function ie(e){if(!e)return null;const t=T();return e in t?t[e]:null}function se(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");j(location.hash)!==i&&(location.hash=i)}function ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function de(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function we(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=ie,window.lnCore.hashSet=se,window.lnCore.hashLinkClick=ae,window.lnCore.resolveHashNamespace=ce,window.lnCore.hashSortEncode=ue,window.lnCore.hashSortDecode=de,window.lnCore.hashFilterEncode=fe,window.lnCore.hashFilterDecode=we),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const n={"data-ln-table-coordinator":{type:"marker",description:"Mounts table coordinator mediating between table, search, filter, and pagination"}};document.addEventListener("keydown",function(a){if(a.key!=="/"||a.defaultPrevented||document.activeElement&&(document.activeElement.tagName==="INPUT"||document.activeElement.tagName==="TEXTAREA"||document.activeElement.isContentEditable))return;const o=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!o)return;const c=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o:o.querySelector('input[type="search"], input[type="text"], input');c&&(a.preventDefault(),c.focus())});function r(a){return this.dom=a,s(this),this}function i(a,o){const c=o?'[data-ln-search-for="'+o+'"]':"[data-ln-search-for]",u=a.querySelector(c)||document.querySelector(c);return u?u.tagName==="INPUT"||u.tagName==="TEXTAREA"?u:u.querySelector("input, textarea"):null}function l(a,o){if(o){const u=a.querySelectorAll('[data-ln-filter="'+o+'"]');if(u.length>0)return u;const d=document.querySelectorAll('[data-ln-filter="'+o+'"]');if(d.length>0)return d}const c=a.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function s(a){const o=a.dom;function c(u){const d=u.target;if(d&&d.hasAttribute&&(d.hasAttribute("data-ln-table")||d.tagName==="TABLE"))return d;const f=u.detail&&u.detail.targetId||d&&d.id;if(!f)return null;const C=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return o.querySelector('[data-ln-table-source="'+C+'"]')||o.querySelector('[data-ln-table="'+C+'"]')||(o.id===f?o:null)||document.getElementById(f)}a._handlers={filter:function(u){if(!u.detail)return;const d=c(u);if(!d)return;const f=u.detail.key,C=u.detail.values||[],h=d.querySelectorAll("th");for(let w=0;w<h.length;w++)if((h[w].getAttribute("data-ln-table-filter-col")||h[w].getAttribute("data-ln-filter-col")||h[w].getAttribute("data-ln-filter-key")||h[w].getAttribute("data-ln-field"))===f){const m=h[w].querySelector("[data-ln-table-col-filter], .table-filter");m&&m.classList.toggle("ln-filter-active",C.length>0);break}},clear:function(u){const d=u.target.closest("[data-ln-table-clear], [data-ln-table-clear-all]");if(!d)return;const f=d.closest("[data-ln-table], table")||o.querySelector("[data-ln-table], table");if(!f)return;const C=f.lnTable&&f.lnTable.name||f.id,h=f.querySelectorAll("th");for(let b=0;b<h.length;b++){const g=h[b].querySelector("[data-ln-table-col-filter], .table-filter");g&&g.classList.remove("ln-filter-active")}const w=f.getAttribute("data-ln-table-source")||f.id,y=w?document.getElementById(w):null;if(y&&y.hasAttribute("data-ln-search"))y.setAttribute("data-ln-search","");else{const b=i(o,w);b&&b.value!==""&&(b.value="",b.dispatchEvent(new Event("input",{bubbles:!0})))}const m=l(o,w);for(let b=0;b<m.length;b++){const g=m[b].querySelector("[data-ln-filter-reset]");if(!g)continue;const A=m[b].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!g.checked||A)&&(g.checked=!0,g.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&I(f,"ln-table:request-clear-filters",{table:C})}},o.addEventListener("ln-filter:change",a._handlers.filter),o.addEventListener("click",a._handlers.clear)}r.prototype.destroy=function(){this.dom[t]&&(this._handlers&&(this.dom.removeEventListener("ln-filter:change",this._handlers.filter),this.dom.removeEventListener("click",this._handlers.clear),this._handlers=null),delete this.dom[t])},le(e,t,r,"ln-table-coordinator",{attributes:n})})()})();
|
|
@@ -82,9 +82,9 @@ import { registerComponent, dispatch } from '../../ln-core';
|
|
|
82
82
|
if (el && el.hasAttribute && (el.hasAttribute('data-ln-table') || el.tagName === 'TABLE')) return el;
|
|
83
83
|
const targetId = (e.detail && e.detail.targetId) || (el && el.id);
|
|
84
84
|
if (!targetId) return null;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
dom.querySelector('
|
|
85
|
+
const safeId = (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') ? CSS.escape(targetId) : targetId.replace(/(["\\])/g, '\\$1');
|
|
86
|
+
return dom.querySelector('[data-ln-table-source="' + safeId + '"]') ||
|
|
87
|
+
dom.querySelector('[data-ln-table="' + safeId + '"]') ||
|
|
88
88
|
(dom.id === targetId ? dom : null) ||
|
|
89
89
|
document.getElementById(targetId);
|
|
90
90
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Applied to a wrapper `<section data-ln-tabs>` containing trigger buttons (`data-ln-tab="key"`) and panels (`data-ln-panel="key"`).
|
|
4
4
|
> On trigger `click`, it writes `data-ln-tabs-active="key"` on the wrapper. An attribute observer synchronizes the DOM:
|
|
5
|
-
> toggling `class="hidden"
|
|
5
|
+
> toggling the HTML5 `hidden` boolean property, `class="hidden"`, and `aria-hidden` on panels, and updating `aria-selected` on triggers. When configured with an `id`
|
|
6
6
|
> and anchor triggers (`<a href="#id:key">`), it synchronizes the active tab with `window.location.hash` for deep-linking and browser history persistence.
|
|
7
7
|
|
|
8
8
|
---
|
|
@@ -206,7 +206,7 @@ Each instance caches `tabs[]`/`panels[]` and derived `mapTabs`/`mapPanels` (keye
|
|
|
206
206
|
### Activation order (`_applyActive`)
|
|
207
207
|
|
|
208
208
|
1. An invalid key (typo, removed panel) silently resolves to `defaultKey` — permissive by design, the component is downstream of attribute writes.
|
|
209
|
-
2. Tab buttons flip `data-active`/`aria-selected` first, then panels
|
|
209
|
+
2. Tab buttons flip `data-active`/`aria-selected` first, then panels toggle boolean `hidden`, `.hidden` class, and `aria-hidden` — natural read order for assistive tech.
|
|
210
210
|
3. Auto-focus is deferred one `setTimeout(0)` (the panel was just un-hidden; layout hasn't settled) with `{ preventScroll: true }`.
|
|
211
211
|
4. Event dispatch happens after all DOM/ARIA writes; persistence save happens last, only when `data-ln-persist` is present and hash mode is off.
|
|
212
212
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function K(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!A(r))return}e.apply(console,t)}}function q(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const N={};function G(e,t){N[e]=t}function X(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=G,window.lnCore.getDataMapper=X);function Y(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function Z(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function ee(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Z,window.lnCore.getLocaleFallback=ee,window.lnCore.ensureLocaleObserver=Y);const v={};function te(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function D(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let a=0;a<n.length;a++){const c=n[a],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const c=r[a],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const d=i[u].trim().split(":");if(d.length!==2)continue;const l=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(l,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let a=0;a<o.length;a++){const c=o[a],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let a=0;a<s.length;a++){const c=s[a],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const d=i[u].trim().split(":");if(d.length!==2)continue;const l=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(l,!!t[f])}}return e}function ne(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)D(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,a){return t[a]!==void 0?t[a]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const a=o[s],c=a.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&a.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function re(e,t,n,r,o,s){const a={};for(let i=0;i<e.children.length;i++){const u=e.children[i],d=u.getAttribute("data-ln-render-key");d&&(a[d]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],d=String(r(u));let l=a[d];if(l)o(l,u,i);else{const f=te(n,s);if(!f||(R(f,u),l=f.firstElementChild,!l))continue;l.setAttribute("data-ln-render-key",d),o(l,u,i)}c.appendChild(l)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=D,window.lnCore.lnFill=ne,window.lnCore.renderList=re);function I(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function oe(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function F(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function ie(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function se(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const r=new Set(e||[]),o=function(s,a){const c=s.getAttribute(a);return c!==null&&r.has(c)?c:t};return _.set(n,o),o}function ae(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function le(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function M(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const c=i=>{o?console.warn(i,o):console.warn(i)};if(a==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,n){for(const r in n){const[o,s,a]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,a)},enumerable:!0,configurable:!0})}return e}function ue(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=se(r.values,r.fallback);break;case"integer":o=oe;break;case"float":o=ae;break;case"boolean":o=F;break;case"list":o=ie;break;case"json":o=le;break;case"string":default:o=I;break}o||(o=I),t[r.prop]=[o,n,r.fallback]}return t}function de(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function fe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function k(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&a.push(e);for(const c of a)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(i){console.error("["+n+"] init failed",c,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function j(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function we(e){const t=j(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=fe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function B(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const a=s.effects&&s.effects[n];a?a(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=j(),o=r.byAttr.get(n);if(K()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&A(t)){const s=r.byDeclaredAttr.get(n),a=t.getAttribute(n);for(let c=0;c<s.length;c++)M(s[c].spec,a,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&B(s,t,n,e.oldValue),r.reactiveWildcard.length&&B(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const a=o[s];if(a.handler){a.handler(t,n,e.oldValue);continue}a.onAttributeChange&&t[a.attribute]?a.onAttributeChange(t,n):(k(t,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(t))}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=H();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];k(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],a=s.query,c=Array.from(r.querySelectorAll(a));r.matches&&r.matches(a)&&c.push(r);for(let i=0;i<c.length;i++){const u=c[i];if(!document.contains(u)){const d=u[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(l){console.error("["+s.attribute+"] destroy failed",u,l)}delete u[s.attribute]}}}}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{me(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e,t,n,r,o={}){const s=o.extraAttributes||[],a=o.onAttributeChange||null,c=o.onSubtreeChange||null,i=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,l=o.attributes||null,f=l?de(l):d,b=l?new Set(Object.keys(l)):null,C=o.persist||null;function h(E){const w=E||document.body;if(k(w,e,t,n),l&&K())for(const g in l){const Ee=l[g],T=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&T.push(w);for(let O=0;O<T.length;O++){const x=T[O];A(x)&&M(Ee,x.getAttribute(g),g,r,x)}}i&&i(w)}const L=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)L.push(w[1])}else L.push(e);we({selector:e,attribute:t,componentTag:r,attributes:l,ComponentFn:n,onInit:i,observed:L.concat(s),onAttributeChange:a,onAttrChange:u,effects:f,declared:b,persist:C}),ge();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";H().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:Le}),ye(),window[t]=h;function J(){he()>0?be(function(){h(document.body)}):h(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",J):J(),h}function W(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},r=W(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const a=o[s];if(!a)continue;const c=a.indexOf(":"),i=c>-1?a.slice(0,c):a,u=c>-1?a.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function p(e){if(!e)return null;const t=S();return e in t?t[e]:null}function y(e,t){if(!e)return;const n=S();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const a=n[s];return a===""?s:s+":"+encodeURIComponent(a)}).join("&");W(location.hash)!==o&&(location.hash=o)}function P(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=p,window.lnCore.hashSet=y,window.lnCore.hashLinkClick=P,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Se);function V(e,t,n,r){const o=(e||"").toLowerCase().trim();if(o)return o;if((t||"").toUpperCase()!=="A")return"";const s=n||"";if(!s.startsWith("#"))return"";const a=s.slice(1);if(!a)return"";const c=a.split("&"),i=(r||"").toLowerCase().trim();if(i)for(const l of c){const f=l.indexOf(":");if(f>0&&l.slice(0,f).toLowerCase().trim()===i)return l.slice(f+1).toLowerCase().trim()}const u=c[c.length-1]||"",d=u.indexOf(":");return(d>0?u.slice(d+1):u).toLowerCase().trim()}function U(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const n=e.filter(s=>(s.tagName||"").toUpperCase()==="A"&&(s.href||"").startsWith("#")),r=n.length>0&&n.length===e.length,o=(t||"").toLowerCase().trim();return n.length>0&&n.length!==e.length?{hashEnabled:!1,warning:"mixed"}:r&&!o?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:r&&!!o,warning:null}}function Q(e,t,n){const r=(e||"").toLowerCase().trim();return r&&Array.isArray(t)&&t.includes(r)?r:(n||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function n(i){const u=i.getAttribute("data-ln-tabs-active");i[t]&&i[t]._applyActive(u)}function r(i,u){return(i.getAttribute(u)||i.id||"").toLowerCase().trim()}const o={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:n,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:F,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:r,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},s=ue(o);function a(i){return this.dom=i,ce(this,i,s),this.activeKey=null,c.call(this),this}function c(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const i=this.tabs.map(l=>({tagName:l.tagName,href:l.getAttribute("href")})),u=U(i,this.nsKey);this.hashEnabled=u.hashEnabled,u.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):u.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const l of this.tabs){const f=V(l.getAttribute("data-ln-tab"),l.tagName,l.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=l:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',l)}for(const l of this.panels){const f=(l.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=l)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const d=this;this._clickHandlers=[];for(const l of this.tabs){if(l[t+"Trigger"])continue;const f=function(b){const C=l.tagName==="A";if(!C&&(b.ctrlKey||b.metaKey||b.button===1))return;const h=V(l.getAttribute("data-ln-tab"),l.tagName,l.getAttribute("href"),d.nsKey);h&&(C&&!P(b)||(d.hashEnabled?p(d.nsKey)===h?d.dom.setAttribute("data-ln-tabs-active",h):y(d.nsKey,h):d.dom.setAttribute("data-ln-tabs-active",h)))};l.addEventListener("click",f),l[t+"Trigger"]=f,d._clickHandlers.push({el:l,handler:f})}if(this._onRequestSelect=function(l){const f=l.detail&&(l.detail.key||l.detail.tab);f&&d.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!d.hashEnabled)return;const l=p(d.nsKey);d.dom.setAttribute("data-ln-tabs-active",l!==null?l:d.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const l=Q(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",l)}}a.prototype.select=function(i){const u=(i+"").toLowerCase().trim();u&&(this.hashEnabled?p(this.nsKey)===u?this.dom.setAttribute("data-ln-tabs-active",u):y(this.nsKey,u):this.dom.setAttribute("data-ln-tabs-active",u))},a.prototype._applyActive=function(i){var d;if(i=Q(i,Object.keys(this.mapPanels),this.defaultKey),i===this.activeKey)return;const u=this.activeKey;if(u!==null&&z(this.dom,"ln-tabs:before-change",{key:i,previousKey:u,tab:this.mapTabs[i],panel:this.mapPanels[i],target:this.dom}).defaultPrevented){u in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",u),this.hashEnabled&&p(this.nsKey)!==u&&y(this.nsKey,u));return}this.activeKey=i;for(const l in this.mapTabs){const f=this.mapTabs[l];l===i?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const l in this.mapPanels){const f=this.mapPanels[l],b=l===i;f.classList.toggle("hidden",!b),f.setAttribute("aria-hidden",b?"false":"true")}if(this.autoFocus){const l=(d=this.mapPanels[i])==null?void 0:d.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');l&&setTimeout(()=>l.focus({preventScroll:!0}),0)}q(this.dom,"ln-tabs:change",{key:i,previousKey:u,tab:this.mapTabs[i],panel:this.mapPanels[i],target:this.dom})},a.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:i,handler:u}of this._clickHandlers)i.removeEventListener("click",u),delete i[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},Ce(e,t,a,"ln-tabs",{attributes:o,persist:{attr:"data-ln-tabs-active",hashActive:function(i){const u=Array.from(i.querySelectorAll("[data-ln-tab]")).map(function(l){return{tagName:l.tagName,href:l.getAttribute("href")}}),d=(i.getAttribute("data-ln-tabs-key")||i.id||"").toLowerCase().trim();return U(u,d).hashEnabled}}})})()})();
|
|
1
|
+
(function(){"use strict";function K(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!A(r))return}e.apply(console,t)}}function q(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const N={};function G(e,t){N[e]=t}function X(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=G,window.lnCore.getDataMapper=X);function Y(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function Z(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function ee(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Z,window.lnCore.getLocaleFallback=ee,window.lnCore.ensureLocaleObserver=Y);const v={};function te(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function D(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let a=0;a<n.length;a++){const c=n[a],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const c=r[a],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const d=i[u].trim().split(":");if(d.length!==2)continue;const l=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(l,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let a=0;a<o.length;a++){const c=o[a],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let a=0;a<s.length;a++){const c=s[a],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const d=i[u].trim().split(":");if(d.length!==2)continue;const l=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(l,!!t[f])}}return e}function ne(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)D(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,a){return t[a]!==void 0?t[a]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const a=o[s],c=a.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&a.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function re(e,t,n,r,o,s){const a={};for(let i=0;i<e.children.length;i++){const u=e.children[i],d=u.getAttribute("data-ln-render-key");d&&(a[d]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],d=String(r(u));let l=a[d];if(l)o(l,u,i);else{const f=te(n,s);if(!f||(R(f,u),l=f.firstElementChild,!l))continue;l.setAttribute("data-ln-render-key",d),o(l,u,i)}c.appendChild(l)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=D,window.lnCore.lnFill=ne,window.lnCore.renderList=re);function I(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function oe(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function F(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function ie(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function se(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const r=new Set(e||[]),o=function(s,a){const c=s.getAttribute(a);return c!==null&&r.has(c)?c:t};return _.set(n,o),o}function ae(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function le(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function M(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const c=i=>{o?console.warn(i,o):console.warn(i)};if(a==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,n){for(const r in n){const[o,s,a]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,a)},enumerable:!0,configurable:!0})}return e}function ue(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=se(r.values,r.fallback);break;case"integer":o=oe;break;case"float":o=ae;break;case"boolean":o=F;break;case"list":o=ie;break;case"json":o=le;break;case"string":default:o=I;break}o||(o=I),t[r.prop]=[o,n,r.fallback]}return t}function de(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function fe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function k(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&a.push(e);for(const c of a)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(i){console.error("["+n+"] init failed",c,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function j(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function we(e){const t=j(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=fe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function B(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const a=s.effects&&s.effects[n];a?a(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=j(),o=r.byAttr.get(n);if(K()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&A(t)){const s=r.byDeclaredAttr.get(n),a=t.getAttribute(n);for(let c=0;c<s.length;c++)M(s[c].spec,a,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&B(s,t,n,e.oldValue),r.reactiveWildcard.length&&B(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const a=o[s];if(a.handler){a.handler(t,n,e.oldValue);continue}a.onAttributeChange&&t[a.attribute]?a.onAttributeChange(t,n):(k(t,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(t))}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=H();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];k(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],a=s.query,c=Array.from(r.querySelectorAll(a));r.matches&&r.matches(a)&&c.push(r);for(let i=0;i<c.length;i++){const u=c[i];if(!document.contains(u)){const d=u[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(l){console.error("["+s.attribute+"] destroy failed",u,l)}delete u[s.attribute]}}}}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{me(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e,t,n,r,o={}){const s=o.extraAttributes||[],a=o.onAttributeChange||null,c=o.onSubtreeChange||null,i=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,l=o.attributes||null,f=l?de(l):d,h=l?new Set(Object.keys(l)):null,C=o.persist||null;function b(E){const w=E||document.body;if(k(w,e,t,n),l&&K())for(const g in l){const Ee=l[g],T=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&T.push(w);for(let O=0;O<T.length;O++){const x=T[O];A(x)&&M(Ee,x.getAttribute(g),g,r,x)}}i&&i(w)}const L=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)L.push(w[1])}else L.push(e);we({selector:e,attribute:t,componentTag:r,attributes:l,ComponentFn:n,onInit:i,observed:L.concat(s),onAttributeChange:a,onAttrChange:u,effects:f,declared:h,persist:C}),ge();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";H().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:Le}),ye(),window[t]=b;function J(){he()>0?be(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",J):J(),b}function W(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},r=W(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const a=o[s];if(!a)continue;const c=a.indexOf(":"),i=c>-1?a.slice(0,c):a,u=c>-1?a.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function p(e){if(!e)return null;const t=S();return e in t?t[e]:null}function y(e,t){if(!e)return;const n=S();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const a=n[s];return a===""?s:s+":"+encodeURIComponent(a)}).join("&");W(location.hash)!==o&&(location.hash=o)}function P(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=p,window.lnCore.hashSet=y,window.lnCore.hashLinkClick=P,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Se);function V(e,t,n,r){const o=(e||"").toLowerCase().trim();if(o)return o;if((t||"").toUpperCase()!=="A")return"";const s=n||"";if(!s.startsWith("#"))return"";const a=s.slice(1);if(!a)return"";const c=a.split("&"),i=(r||"").toLowerCase().trim();if(i)for(const l of c){const f=l.indexOf(":");if(f>0&&l.slice(0,f).toLowerCase().trim()===i)return l.slice(f+1).toLowerCase().trim()}const u=c[c.length-1]||"",d=u.indexOf(":");return(d>0?u.slice(d+1):u).toLowerCase().trim()}function U(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const n=e.filter(s=>(s.tagName||"").toUpperCase()==="A"&&(s.href||"").startsWith("#")),r=n.length>0&&n.length===e.length,o=(t||"").toLowerCase().trim();return n.length>0&&n.length!==e.length?{hashEnabled:!1,warning:"mixed"}:r&&!o?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:r&&!!o,warning:null}}function Q(e,t,n){const r=(e||"").toLowerCase().trim();return r&&Array.isArray(t)&&t.includes(r)?r:(n||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function n(i){const u=i.getAttribute("data-ln-tabs-active");i[t]&&i[t]._applyActive(u)}function r(i,u){return(i.getAttribute(u)||i.id||"").toLowerCase().trim()}const o={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:n,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:F,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:r,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},s=ue(o);function a(i){return this.dom=i,ce(this,i,s),this.activeKey=null,c.call(this),this}function c(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const i=this.tabs.map(l=>({tagName:l.tagName,href:l.getAttribute("href")})),u=U(i,this.nsKey);this.hashEnabled=u.hashEnabled,u.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):u.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const l of this.tabs){const f=V(l.getAttribute("data-ln-tab"),l.tagName,l.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=l:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',l)}for(const l of this.panels){const f=(l.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=l)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const d=this;this._clickHandlers=[];for(const l of this.tabs){if(l[t+"Trigger"])continue;const f=function(h){const C=l.tagName==="A";if(!C&&(h.ctrlKey||h.metaKey||h.button===1))return;const b=V(l.getAttribute("data-ln-tab"),l.tagName,l.getAttribute("href"),d.nsKey);b&&(C&&!P(h)||(d.hashEnabled?p(d.nsKey)===b?d.dom.setAttribute("data-ln-tabs-active",b):y(d.nsKey,b):d.dom.setAttribute("data-ln-tabs-active",b)))};l.addEventListener("click",f),l[t+"Trigger"]=f,d._clickHandlers.push({el:l,handler:f})}if(this._onRequestSelect=function(l){const f=l.detail&&(l.detail.key||l.detail.tab);f&&d.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!d.hashEnabled)return;const l=p(d.nsKey);d.dom.setAttribute("data-ln-tabs-active",l!==null?l:d.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const l=Q(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",l)}}a.prototype.select=function(i){const u=(i+"").toLowerCase().trim();u&&(this.hashEnabled?p(this.nsKey)===u?this.dom.setAttribute("data-ln-tabs-active",u):y(this.nsKey,u):this.dom.setAttribute("data-ln-tabs-active",u))},a.prototype._applyActive=function(i){var d;if(i=Q(i,Object.keys(this.mapPanels),this.defaultKey),i===this.activeKey)return;const u=this.activeKey;if(u!==null&&z(this.dom,"ln-tabs:before-change",{key:i,previousKey:u,tab:this.mapTabs[i],panel:this.mapPanels[i],target:this.dom}).defaultPrevented){u in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",u),this.hashEnabled&&p(this.nsKey)!==u&&y(this.nsKey,u));return}this.activeKey=i;for(const l in this.mapTabs){const f=this.mapTabs[l];l===i?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const l in this.mapPanels){const f=this.mapPanels[l],h=l===i;f.hidden=!h,f.classList.toggle("hidden",!h),f.setAttribute("aria-hidden",h?"false":"true")}if(this.autoFocus){const l=(d=this.mapPanels[i])==null?void 0:d.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');l&&setTimeout(()=>l.focus({preventScroll:!0}),0)}q(this.dom,"ln-tabs:change",{key:i,previousKey:u,tab:this.mapTabs[i],panel:this.mapPanels[i],target:this.dom})},a.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:i,handler:u}of this._clickHandlers)i.removeEventListener("click",u),delete i[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},Ce(e,t,a,"ln-tabs",{attributes:o,persist:{attr:"data-ln-tabs-active",hashActive:function(i){const u=Array.from(i.querySelectorAll("[data-ln-tab]")).map(function(l){return{tagName:l.tagName,href:l.getAttribute("href")}}),d=(i.getAttribute("data-ln-tabs-key")||i.id||"").toLowerCase().trim();return U(u,d).hashEnabled}}})})()})();
|
|
@@ -160,6 +160,7 @@ import { deriveKeyFromTrigger, determineTabsMode, resolveActiveTabKey } from './
|
|
|
160
160
|
for (const k in this.mapPanels) {
|
|
161
161
|
const panel = this.mapPanels[k];
|
|
162
162
|
const show = (k === key);
|
|
163
|
+
panel.hidden = !show;
|
|
163
164
|
panel.classList.toggle("hidden", !show);
|
|
164
165
|
panel.setAttribute("aria-hidden", show ? "false" : "true");
|
|
165
166
|
}
|
package/package.json
CHANGED