@livenetworks/ashlar 2.0.8 → 2.0.10

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.
Files changed (73) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-api-connector/ln-api-connector.js +1 -1
  4. package/components/ln-api-connector/ln-api-connector.schema.json +105 -96
  5. package/components/ln-api-connector/src/ln-api-connector.js +1 -0
  6. package/components/ln-api-queue/ln-api-queue.js +1 -1
  7. package/components/ln-autoresize/ln-autoresize.js +1 -1
  8. package/components/ln-autosave/ln-autosave.js +1 -1
  9. package/components/ln-chart/ln-chart.js +1 -1
  10. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  11. package/components/ln-confirm/ln-confirm.js +1 -1
  12. package/components/ln-core/attrs.js +13 -0
  13. package/components/ln-core/form.js +10 -0
  14. package/components/ln-core/lifecycle.js +6 -1
  15. package/components/ln-core/ln-core.schema.json +110 -109
  16. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  17. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  18. package/components/ln-data-coordinator/src/ln-data-coordinator.js +7 -3
  19. package/components/ln-data-store/ln-data-store.js +1 -1
  20. package/components/ln-date/ln-date.js +1 -1
  21. package/components/ln-debug/ln-debug.js +1 -1
  22. package/components/ln-debug/src/generated-attributes.js +3 -0
  23. package/components/ln-dropdown/ln-dropdown.js +1 -1
  24. package/components/ln-editor/ln-editor.js +1 -1
  25. package/components/ln-external-links/ln-external-links.js +1 -1
  26. package/components/ln-fill/ln-fill.js +1 -1
  27. package/components/ln-filter/ln-filter.js +1 -1
  28. package/components/ln-filter/ln-filter.schema.json +161 -153
  29. package/components/ln-filter/src/ln-filter.js +77 -5
  30. package/components/ln-form/ln-form.js +1 -1
  31. package/components/ln-form/ln-form.schema.json +51 -45
  32. package/components/ln-form/src/ln-form.js +21 -0
  33. package/components/ln-http/ln-http.js +1 -1
  34. package/components/ln-include/ln-include.js +1 -1
  35. package/components/ln-key/ln-key.js +1 -1
  36. package/components/ln-link/ln-link.js +1 -1
  37. package/components/ln-list/ln-list.js +1 -1
  38. package/components/ln-modal/ln-modal.js +1 -1
  39. package/components/ln-nav/ln-nav.js +1 -1
  40. package/components/ln-number/ln-number.js +1 -1
  41. package/components/ln-number/src/ln-number.js +26 -0
  42. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  43. package/components/ln-options/ln-options.js +1 -1
  44. package/components/ln-options/ln-options.schema.json +47 -41
  45. package/components/ln-options/src/ln-options.js +4 -4
  46. package/components/ln-persist/ln-persist.js +1 -1
  47. package/components/ln-picklist/ln-picklist.js +1 -1
  48. package/components/ln-popover/ln-popover.js +1 -1
  49. package/components/ln-progress/ln-progress.js +1 -1
  50. package/components/ln-router/ln-router.js +1 -1
  51. package/components/ln-scroll/ln-scroll.js +1 -1
  52. package/components/ln-search/ln-search.js +1 -1
  53. package/components/ln-search/src/ln-search.js +17 -1
  54. package/components/ln-slug/ln-slug.js +1 -1
  55. package/components/ln-slug/src/ln-slug.js +25 -1
  56. package/components/ln-sort/ln-sort.js +1 -1
  57. package/components/ln-sortable/ln-sortable.js +1 -1
  58. package/components/ln-stat/ln-stat.js +1 -1
  59. package/components/ln-table/ln-table.js +1 -1
  60. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  61. package/components/ln-tabs/ln-tabs.js +1 -1
  62. package/components/ln-time/ln-time.js +1 -1
  63. package/components/ln-toast/ln-toast.js +1 -1
  64. package/components/ln-toggle/ln-toggle.js +1 -1
  65. package/components/ln-tooltip/ln-tooltip.js +1 -1
  66. package/components/ln-translations/ln-translations.js +1 -1
  67. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  68. package/components/ln-upload/ln-upload.js +1 -1
  69. package/components/ln-validate/ln-validate.js +1 -1
  70. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  71. package/ln-ashlar.html-data.json +13 -0
  72. package/package.json +2 -1
  73. package/web-types.json +22 -1
@@ -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 D(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(!D(r))return}e.apply(console,t)}}function E(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 ue(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 T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function P(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}const Q={};function ce(e,t){Q[e]=t}function de(e){return Q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=de);function fe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const J={};function he(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];J[n]=t}function ge(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return J[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=he,window.lnCore.getLocaleFallback=ge,window.lnCore.ensureLocaleObserver=fe);const N={};function be(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=N[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function G(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],s=a.getAttribute("data-ln-field");t[s]!=null&&(a.textContent=t[s])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],s=a.getAttribute("data-ln-attr").split(",");for(let h=0;h<s.length;h++){const y=s[h].trim().split(":");if(y.length!==2)continue;const p=y[0].trim(),m=y[1].trim();t[m]!=null&&a.setAttribute(p,t[m])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],s=a.getAttribute("data-ln-show");s in t&&a.classList.toggle("hidden",!t[s])}const l=e.querySelectorAll("[data-ln-class]");for(let i=0;i<l.length;i++){const a=l[i],s=a.getAttribute("data-ln-class").split(",");for(let h=0;h<s.length;h++){const y=s[h].trim().split(":");if(y.length!==2)continue;const p=y[0].trim(),m=y[1].trim();m in t&&a.classList.toggle(p,!!t[m])}}return e}function we(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)G(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 X(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(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(l,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let l=0;l<o.length;l++){const i=o[l],a=i.attributes;for(let s=0;s<a.length;s++){const h=a[s];h.value.indexOf("{{")!==-1&&i.setAttribute(h.name,h.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function pe(e,t,n,r,o,l){const i={};for(let s=0;s<e.children.length;s++){const h=e.children[s],y=h.getAttribute("data-ln-render-key");y&&(i[y]=h)}const a=document.createDocumentFragment();for(let s=0;s<t.length;s++){const h=t[s],y=String(r(h));let p=i[y];if(p)o(p,h,s);else{const m=be(n,l);if(!m||(X(m,h),p=m.firstElementChild,!p))continue;p.setAttribute("data-ln-render-key",y),o(p,h,s)}a.appendChild(p)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=X,window.lnCore.fill=G,window.lnCore.lnFill=we,window.lnCore.renderList=pe);function F(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function ye(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function me(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 Ce(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function Ae(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const r=new Set(e||[]),o=function(l,i){const a=l.getAttribute(i);return a!==null&&r.has(a)?a:t};return $.set(n,o),o}function ve(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ke(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Y(e,t,n,r,o){if(!e||t===null)return!0;const l=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=s=>{o?console.warn(s,o):console.warn(s)};if(i==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const s=e.values||[];return s.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(a(`[${l}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(a(`[${l}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(s){return a(`[${l}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function _e(e,t,n){for(const r in n){const[o,l,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,l,i)},enumerable:!0,configurable:!0})}return e}function xe(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=Ae(r.values,r.fallback);break;case"integer":o=ye;break;case"float":o=ve;break;case"boolean":o=me;break;case"list":o=Ce;break;case"json":o=ke;break;case"string":default:o=F;break}o||(o=F),t[r.prop]=[o,n,r.fallback]}return t}function Se(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 Ie(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 B(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(l));e.matches&&e.matches(l)&&i.push(e);for(const a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(s){console.error("["+n+"] init failed",a,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function L(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 z(){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 Te(e){const t=z(),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(l=>l.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ie(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 Z(e,t,n,r){for(let o=0;o<e.length;o++){const l=e[o];if(!t[l.attribute])continue;const i=l.effects&&l.effects[n];i?i(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function Le(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=z(),o=r.byAttr.get(n);if(K()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&D(t)){const l=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<l.length;a++)Y(l[a].spec,i,n,l[a].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 l=r.byReactive.get(n);l&&Z(l,t,n,e.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let l=0;l<o.length;l++){const i=o[l];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(B(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function Re(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Le(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 ee(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function qe(e){const t=ee();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,l=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):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 o=0;o<t.length;o++){const l=t[o];B(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 o=0;o<t.length;o++){const l=t[o],i=l.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let s=0;s<a.length;s++){const h=a[s];if(!document.contains(h)){const y=h[l.attribute];if(y&&typeof y.destroy=="function")try{y.destroy()}catch(p){console.error("["+l.attribute+"] destroy failed",h,p)}delete h[l.attribute]}}}}}}function Oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{qe(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function De(e,t,n,r,o={}){const l=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,s=o.onInit||null,h=o.onAttrChange||null,y=o.effects||null,p=o.attributes||null,m=p?Se(p):y,H=p?new Set(Object.keys(p)):null,_=o.persist||null;function v(f){const d=f||document.body;if(B(d,e,t,n),p&&K())for(const g in p){const w=p[g],c=Array.from(d.querySelectorAll("["+g+"]"));d.matches&&d.matches("["+g+"]")&&c.push(d);for(let b=0;b<c.length;b++){const C=c[b];D(C)&&Y(w,C.getAttribute(g),g,r,C)}}s&&s(d)}const x=[];if(e.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let d;for(;(d=f.exec(e))!==null;)x.push(d[1])}else x.push(e);Te({selector:e,attribute:t,componentTag:r,attributes:p,ComponentFn:n,onInit:s,observed:x.concat(l),onAttributeChange:i,onAttrChange:h,effects:m,declared:H,persist:_}),Re();const q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";ee().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:a,query:q}),Oe(),window[t]=v;function u(){Ee()>0?L(function(){v(document.body)}):v(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),v}function Ne(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function te(e){return(e||"").replace(/^#/,"")}function M(e){const t=e===void 0?location.hash:e,n={},r=te(t);if(!r)return n;const o=r.split("&");for(let l=0;l<o.length;l++){const i=o[l];if(!i)continue;const a=i.indexOf(":"),s=a>-1?i.slice(0,a):i,h=a>-1?i.slice(a+1):"";if(s)try{n[s]=decodeURIComponent(h)}catch{n[s]=h}}return n}function V(e){if(!e)return null;const t=M();return e in t?t[e]:null}function ne(e,t){if(!e)return;const n=M();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(l){const i=n[l];return i===""?l:l+":"+encodeURIComponent(i)}).join("&");te(location.hash)!==o&&(location.hash=o)}function Fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function R(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 $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(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 re(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function j(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(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=M,window.lnCore.hashGet=V,window.lnCore.hashSet=ne,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=R,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=Be,window.lnCore.hashFilterEncode=re,window.lnCore.hashFilterDecode=j);function Me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Me);function oe(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let r=0;r<t.length;r++)if(String(t[r]).trim().toLowerCase()===n)return!0;return!1}function Ve(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function je(e,t,n){if(!t||typeof t!="object")return!0;const r=Object.keys(t);if(r.length===0)return!0;for(let o=0;o<r.length;o++){const l=t[r[o]];let i="";if(l.col!==null&&l.col!==void 0?i=e[l.col]||"":l.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(l.attr)||""),!oe(i,l.values))return!1}return!0}function ie(e,t,n,r){if(r!=null&&!isNaN(r))return parseInt(r,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const l=t.closest("th");if(l&&typeof l.cellIndex=="number")return l.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const a=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(a&&typeof a.querySelector=="function"){const s=a.querySelector('[data-ln-popover-for="'+i.id+'"]');if(s&&typeof s.closest=="function"){const h=s.closest("th");if(h&&typeof h.cellIndex=="number")return h.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),l=String(n).trim().toLowerCase();for(let i=0;i<o.length;i++){const a=o[i],s=a.getAttribute("data-ln-table-filter-col")||a.getAttribute("data-ln-filter-col")||a.getAttribute("data-ln-filter-key")||a.getAttribute("data-ln-table-col")||a.getAttribute("data-ln-col")||a.getAttribute("data-ln-field");if(s&&s.trim().toLowerCase()===l)return typeof a.cellIndex=="number"?a.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,a=i&&i.id||t.id||null;if(a)for(let s=0;s<o.length;s++){const h=o[s];if(typeof h.querySelector=="function"&&h.querySelector('[data-ln-popover-for="'+a+'"]'))return typeof h.cellIndex=="number"?h.cellIndex:s}}for(let i=0;i<o.length;i++){const a=o[i],h=Array.from(a.childNodes||[]).filter(p=>p.nodeType===3),y=(h.length>0?h.map(p=>p.textContent.trim()).join(" "):a.textContent||"").trim().toLowerCase();if(y&&y===l)return typeof a.cellIndex=="number"?a.cellIndex:i}}return null}function He(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let r=0;r<e.length;r++){const o=e[r];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function We(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function le(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",r="data-ln-filter-value",o="data-ln-filter-hide",l="data-ln-filter-reset",i="data-ln-filter-col",a="data-ln-hash",s="data-ln-filter-values",h=new WeakMap;if(window[t]!==void 0)return;const y={"data-ln-filter":{prop:"targetId",type:"string",read:F,fallback:null,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:q,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:q,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"}},p=xe(y);function m(u){return u.hasAttribute(l)||!u.getAttribute(r)}function H(u){const f=u.dom.querySelectorAll("["+n+"]"),d=[];for(let w=0;w<f.length;w++){const c=f[w];d.push({key:c.getAttribute(n),value:c.getAttribute(r)||"",checked:c.checked,isReset:m(c)})}const g=He(d);return{key:g.key,values:g.values,targetId:u.targetId}}function _(u,f,d){const g=u.querySelectorAll("["+n+"]"),w=Array.isArray(d)&&d.length>0;for(let c=0;c<g.length;c++){const b=g[c];m(b)?b.checked=!w:w&&b.getAttribute(n)===f&&d.indexOf(b.getAttribute(r))!==-1?b.checked=!0:b.checked=!1}}function v(u){this.dom=u,_e(this,u,p);const f=u.getAttribute(i);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=R(u,"filter"),this.hashEnabled=!!this.nsKey;const d=this,g=Ne(function(){d._render()});this._queueRender=g,this._attachHandlers(),this._onHashChange=function(){if(d._destroyed||!d.hashEnabled)return;const c=V(d.nsKey),b=j(c);b&&b.key&&b.values.length>0?_(d.dom,b.key,b.values):_(d.dom,null,[]),d._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let w=!1;if(this.hashEnabled){const c=V(this.nsKey),b=j(c);b&&b.key&&b.values.length>0&&(_(u,b.key,b.values),L(function(){d._destroyed||d._render()}),w=!0)}if(!w){const c=le(u.getAttribute(s));if(c.length>0){const b=u.querySelector("["+n+"]"),C=b?b.getAttribute(n):null;C&&(_(u,C,c),L(function(){d._destroyed||d._render()}),w=!0)}}if(!w){const c=u.querySelectorAll("["+n+"]");for(let b=0;b<c.length;b++)if(c[b].checked&&!m(c[b])){L(function(){d._destroyed||d._render()});break}}return this}v.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(f){const d=f.target;if(!d||!d.hasAttribute||!d.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(m(d)){for(let w=0;w<g.length;w++)m(g[w])||(g[w].checked=!1);d.checked=!0,u._queueRender();return}if(d.checked){for(let c=0;c<g.length;c++)m(g[c])&&(g[c].checked=!1);let w=!1;for(let c=0;c<g.length;c++)if(m(g[c])){w=!0;break}if(w){let c=!0;for(let b=0;b<g.length;b++)if(!m(g[b])&&!g[b].checked){c=!1;break}if(c)for(let b=0;b<g.length;b++)m(g[b])?g[b].checked=!0:g[b].checked=!1}}else{let w=!1;for(let c=0;c<g.length;c++)if(!m(g[c])&&g[c].checked){w=!0;break}if(!w)for(let c=0;c<g.length;c++)m(g[c])&&(g[c].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},v.prototype._render=function(){const u=this,f=H(this),d=this._lastSnapshot;if(!(!d||d.key!==f.key||Ve(d.values,f.values)))return;const w=f.key===null||f.values.length===0,c=document.getElementById(u.targetId),b={key:f.key,values:f.values.slice(),targetId:u.targetId};E(u.dom,"ln-filter:change",b);let C=!1;c&&c!==u.dom&&ue(c,"ln-filter:change",b).defaultPrevented&&(C=!0);const O=d&&d.values.length>0,S=f.values.length===0;if(O&&S){const A={targetId:u.targetId};E(u.dom,"ln-filter:reset",A),c&&c!==u.dom&&E(c,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const k=We(f.values);if(k?this.dom.setAttribute(s,k):this.dom.removeAttribute(s),this.hashEnabled){const A=re(f.key,f.values);ne(this.nsKey,A)}if(C)return;const I=c&&(c.tagName==="TABLE"?c:c.querySelector?c.querySelector("table"):null);if(I)u._filterTableRows(f,I);else{if(!c)return;const A=c.children;for(let W=0;W<A.length;W++){const U=A[W];if(U.removeAttribute(o),w)continue;const ae=U.getAttribute("data-"+f.key);ae!==null&&(oe(ae,f.values)||U.setAttribute(o,"true"))}}};function x(u){if(!u)return"";const f=u.querySelector?u.querySelector("[data-ln-value]"):null;return P(f||u)}function se(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}v.prototype._filterTableRows=function(u,f){if(!f){const C=document.getElementById(this.targetId);if(!C||(f=C.tagName==="TABLE"?C:C.querySelector?C.querySelector("table"):null,!f))return}const d=ie(f,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(d!==null?"col"+d:"attr-filter"),w=u.values;h.has(f)||h.set(f,{});const c=h.get(f);g&&w.length>0?c[g]={col:d,values:w.slice(),attr:"data-"+g}:g&&delete c[g];const b=f.tBodies;for(let C=0;C<b.length;C++){const O=b[C].rows;for(let S=0;S<O.length;S++){const k=O[S];if(se(k))continue;const I={};for(let A=0;A<k.cells.length;A++)I[A]=x(k.cells[A]);je(I,c,k)?k.removeAttribute(o):k.setAttribute(o,"true")}}},v.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const f=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(f&&h.has(f)){const d=h.get(f),g=ie(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),w=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);w&&d[w]&&(delete d[w],this._filterTableRows({key:null,values:[]},f)),Object.keys(d).length===0&&h.delete(f)}}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function q(u,f){const d=u[t];if(!(!d||d._destroyed)){if(f===a)d.hashEnabled&&d._onHashChange&&window.removeEventListener("hashchange",d._onHashChange),d.nsKey=R(u,"filter"),d.hashEnabled=!!d.nsKey,d.hashEnabled&&window.addEventListener("hashchange",d._onHashChange);else if(f===s){const g=le(u.getAttribute(s)),w=u.querySelector("["+n+"]"),c=w?w.getAttribute(n):null;c&&(_(u,c,g),d._render())}}}De(e,t,v,"ln-filter",{attributes:y,persist:{attr:s,hashActive:function(u){return!!R(u,"filter")}}})})()})();
1
+ (function(){"use strict";function U(){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 D(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(!D(r))return}e.apply(console,t)}}function L(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 be(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 q(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){q(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function K(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function ye(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function me(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const l=s[a];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let a=0;a<s.length;a++){const l=s[a];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let f=0;f<l.options.length;f++)l.options[f].selected&&o[l.name].push(l.options[f].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const f=Number(l.value);o[l.name]=l.value===""||isNaN(f)?null:f}else o[l.name]=l.value}return o}function Ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ae(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const l=t[a];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const f=String(l).split(",").map(function(b){return b.trim()});i.checked=f.indexOf(i.value)!==-1}else i.checked=Ce(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let f=0;f<i.options.length;f++)i.options[f].selected=l.indexOf(i.options[f].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ae,window.lnCore.serializeForm=me,window.lnCore.resolveFormMethod=ye);const Q={};function ve(e,t){Q[e]=t}function ke(e){return Q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ve,window.lnCore.getDataMapper=ke);function _e(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,q(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function xe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];P[n]=t}function Se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=xe,window.lnCore.getLocaleFallback=Se,window.lnCore.ensureLocaleObserver=_e);const N={};function Ie(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=N[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function J(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],l=a.getAttribute("data-ln-field");t[l]!=null&&(a.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],l=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<l.length;f++){const b=l[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),A=b[1].trim();t[A]!=null&&a.setAttribute(m,t[A])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],l=a.getAttribute("data-ln-show");l in t&&a.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],l=a.getAttribute("data-ln-class").split(",");for(let f=0;f<l.length;f++){const b=l[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),A=b[1].trim();A in t&&a.classList.toggle(m,!!t[A])}}return e}function Ee(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)J(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 G(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(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let l=0;l<a.length;l++){const f=a[l];f.value.indexOf("{{")!==-1&&i.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Te(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const f=e.children[l],b=f.getAttribute("data-ln-render-key");b&&(i[b]=f)}const a=document.createDocumentFragment();for(let l=0;l<t.length;l++){const f=t[l],b=String(r(f));let m=i[b];if(m)o(m,f,l);else{const A=Ie(n,s);if(!A||(G(A,f),m=A.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),o(m,f,l)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=J,window.lnCore.lnFill=Ee,window.lnCore.renderList=Te);function R(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function z(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function X(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 Y(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const B=new Map;function Z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(B.has(n))return B.get(n);const r=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return B.set(n,o),o}function ee(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function te(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function ne(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(a(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(a(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return a(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function oe(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=Z(r.values,r.fallback);break;case"integer":o=z;break;case"float":o=ee;break;case"boolean":o=X;break;case"list":o=Y;break;case"json":o=te;break;case"string":default:o=R;break}o||(o=R),t[r.prop]=[o,n,r.fallback]}return t}function Le(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 qe(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}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=re,window.lnCore.attrSpec=oe,window.lnCore.attrStr=R,window.lnCore.attrInt=z,window.lnCore.attrBool=X,window.lnCore.attrList=Y,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=ee,window.lnCore.attrJson=te);function M(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(l){console.error("["+n+"] init failed",a,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Re(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function E(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 ie(){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 Oe(e){const t=ie(),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=qe(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 le(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=ie(),o=r.byAttr.get(n);if(U()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&D(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<s.length;a++)ne(s[a].spec,i,n,s[a].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&&le(s,t,n,e.oldValue),r.reactiveWildcard.length&&le(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(M(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,q(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Fe(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 se(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ne(e){const t=se();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];M(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],i=s.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let l=0;l<a.length;l++){const f=a[l];if(!document.contains(f)){const b=f[s.attribute];if(b&&typeof b.destroy=="function")try{b.destroy()}catch(m){console.error("["+s.attribute+"] destroy failed",f,m)}delete f[s.attribute]}}}}}}function Be(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,q(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Ne(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ae(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,l=o.onInit||null,f=o.onAttrChange||null,b=o.effects||null,m=o.attributes||null,A=m?Le(m):b,v=m?new Set(Object.keys(m)):null,T=o.persist||null;function _(u){const d=u||document.body;if(M(d,e,t,n),m&&U())for(const c in m){const g=m[c],p=Array.from(d.querySelectorAll("["+c+"]"));d.matches&&d.matches("["+c+"]")&&p.push(d);for(let h=0;h<p.length;h++){const w=p[h];D(w)&&ne(g,w.getAttribute(c),c,r,w)}}l&&l(d)}const x=[];if(e.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let d;for(;(d=u.exec(e))!==null;)x.push(d[1])}else x.push(e);Oe({selector:e,attribute:t,componentTag:r,attributes:m,ComponentFn:n,onInit:l,observed:x.concat(s),onAttributeChange:i,onAttrChange:f,effects:A,declared:v,persist:T}),De();const H=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,W=o.subtreeQuery||(H?e:"["+e+"]");se().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:a,query:W}),Be(),window[t]=_,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ae);function I(){Re()>0?E(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I):I(),_}function ue(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ce(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=ce(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),l=a>-1?i.slice(0,a):i,f=a>-1?i.slice(a+1):"";if(l)try{n[l]=decodeURIComponent(f)}catch{n[l]=f}}return n}function j(e){if(!e)return null;const t=$();return e in t?t[e]:null}function de(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");ce(location.hash)!==o&&(location.hash=o)}function Me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function O(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 $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(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 V(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=$,window.lnCore.hashGet=j,window.lnCore.hashSet=de,window.lnCore.hashLinkClick=Me,window.lnCore.resolveHashNamespace=O,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=fe,window.lnCore.hashFilterDecode=V);function Ve(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ve);function he(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let r=0;r<t.length;r++)if(String(t[r]).trim().toLowerCase()===n)return!0;return!1}function He(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function We(e,t,n){if(!t||typeof t!="object")return!0;const r=Object.keys(t);if(r.length===0)return!0;for(let o=0;o<r.length;o++){const s=t[r[o]];let i="";if(s.col!==null&&s.col!==void 0?i=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(s.attr)||""),!he(i,s.values))return!1}return!0}function ge(e,t,n,r){if(r!=null&&!isNaN(r))return parseInt(r,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const a=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(a&&typeof a.querySelector=="function"){const l=a.querySelector('[data-ln-popover-for="'+i.id+'"]');if(l&&typeof l.closest=="function"){const f=l.closest("th");if(f&&typeof f.cellIndex=="number")return f.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let i=0;i<o.length;i++){const a=o[i],l=a.getAttribute("data-ln-table-filter-col")||a.getAttribute("data-ln-filter-col")||a.getAttribute("data-ln-filter-key")||a.getAttribute("data-ln-table-col")||a.getAttribute("data-ln-col")||a.getAttribute("data-ln-field");if(l&&l.trim().toLowerCase()===s)return typeof a.cellIndex=="number"?a.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,a=i&&i.id||t.id||null;if(a)for(let l=0;l<o.length;l++){const f=o[l];if(typeof f.querySelector=="function"&&f.querySelector('[data-ln-popover-for="'+a+'"]'))return typeof f.cellIndex=="number"?f.cellIndex:l}}for(let i=0;i<o.length;i++){const a=o[i],f=Array.from(a.childNodes||[]).filter(m=>m.nodeType===3),b=(f.length>0?f.map(m=>m.textContent.trim()).join(" "):a.textContent||"").trim().toLowerCase();if(b&&b===s)return typeof a.cellIndex=="number"?a.cellIndex:i}}return null}function Ue(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let r=0;r<e.length;r++){const o=e[r];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function Ke(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function pe(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",r="data-ln-filter-value",o="data-ln-filter-hide",s="data-ln-filter-reset",i="data-ln-filter-col",a="data-ln-hash",l="data-ln-filter-values",f="data-ln-filter-target",b=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:R,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},A=oe(m);function v(u){return u.hasAttribute(s)||!u.getAttribute(r)}function T(u){const d=u.dom.querySelectorAll("["+n+"]"),c=[];for(let p=0;p<d.length;p++){const h=d[p];c.push({key:h.getAttribute(n),value:h.getAttribute(r)||"",checked:h.checked,isReset:v(h)})}const g=Ue(c);return{key:g.key,values:g.values,targetId:u.targetId}}function _(u,d,c){const g=u.querySelectorAll("["+n+"]"),p=Array.isArray(c)&&c.length>0;for(let h=0;h<g.length;h++){const w=g[h];v(w)?w.checked=!p:p&&w.getAttribute(n)===d&&c.indexOf(w.getAttribute(r))!==-1?w.checked=!0:w.checked=!1}}function x(u){this.dom=u,re(this,u,A);const d=u.getAttribute(i);this.colIndex=d!==null?parseInt(d,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=O(u,"filter"),this.hashEnabled=!!this.nsKey;const c=this,g=ue(function(){c._render()});this._queueRender=g;const p=ue(function(){c._destroyed||c._applyDomFilter()});this._queueDomFilter=p;function h(){if(!c.targetId)return;const y=document.getElementById(c.targetId);y&&!y.hasAttribute(f)&&y.setAttribute(f,c.targetId)}this._ensureTargetMarked=h,h(),E(function(){c._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(c._destroyed||!c.hashEnabled)return;const y=j(c.nsKey),C=V(y);C&&C.key&&C.values.length>0?_(c.dom,C.key,C.values):_(c.dom,null,[]),c._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let w=!1;if(this.hashEnabled){const y=j(this.nsKey),C=V(y);C&&C.key&&C.values.length>0&&(_(u,C.key,C.values),E(function(){c._destroyed||c._render()}),w=!0)}if(!w){const y=pe(u.getAttribute(l));if(y.length>0){const C=u.querySelector("["+n+"]"),S=C?C.getAttribute(n):null;S&&(_(u,S,y),E(function(){c._destroyed||c._render()}),w=!0)}}if(!w){const y=u.querySelectorAll("["+n+"]");for(let C=0;C<y.length;C++)if(y[C].checked&&!v(y[C])){E(function(){c._destroyed||c._render()});break}}return this}x.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(d){const c=d.target;if(!c||!c.hasAttribute||!c.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(v(c)){for(let p=0;p<g.length;p++)v(g[p])||(g[p].checked=!1);c.checked=!0,u._queueRender();return}if(c.checked){for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!1);let p=!1;for(let h=0;h<g.length;h++)if(v(g[h])){p=!0;break}if(p){let h=!0;for(let w=0;w<g.length;w++)if(!v(g[w])&&!g[w].checked){h=!1;break}if(h)for(let w=0;w<g.length;w++)v(g[w])?g[w].checked=!0:g[w].checked=!1}}else{let p=!1;for(let h=0;h<g.length;h++)if(!v(g[h])&&g[h].checked){p=!0;break}if(!p)for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},x.prototype._render=function(){const u=this,d=T(this),c=this._lastSnapshot;if(!(!c||c.key!==d.key||He(c.values,d.values)))return;d.key===null||d.values.length;const p=document.getElementById(u.targetId),h={key:d.key,values:d.values.slice(),targetId:u.targetId};L(u.dom,"ln-filter:change",h);let w=!1;p&&p!==u.dom&&be(p,"ln-filter:change",h).defaultPrevented&&(w=!0);const y=c&&c.values.length>0,C=d.values.length===0;if(y&&C){const k={targetId:u.targetId};L(u.dom,"ln-filter:reset",k),p&&p!==u.dom&&L(p,"ln-filter:reset",k)}this._lastSnapshot={key:d.key,values:d.values.slice()};const S=Ke(d.values);if(S?this.dom.setAttribute(l,S):this.dom.removeAttribute(l),this.hashEnabled){const k=fe(d.key,d.values);de(this.nsKey,k)}w||u._applyDomFilter(p)},x.prototype._applyDomFilter=function(u){const d=u||document.getElementById(this.targetId);if(!d)return;const c=T(this),g=c.key===null||c.values.length===0,p=d.tagName==="TABLE"?d:d.querySelector?d.querySelector("table"):null;if(p)this._filterTableRows(c,p);else{const h=d.children;for(let w=0;w<h.length;w++){const y=h[w];if(y.removeAttribute(o),g)continue;const C=y.getAttribute("data-"+c.key);C!==null&&(he(C,c.values)||y.setAttribute(o,"true"))}}};function H(u){if(!u)return"";const d=u.querySelector?u.querySelector("[data-ln-value]"):null;return K(d||u)}function W(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}x.prototype._filterTableRows=function(u,d){if(!d){const y=document.getElementById(this.targetId);if(!y||(d=y.tagName==="TABLE"?y:y.querySelector?y.querySelector("table"):null,!d))return}const c=ge(d,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(c!==null?"col"+c:"attr-filter"),p=u.values;b.has(d)||b.set(d,{});const h=b.get(d);g&&p.length>0?h[g]={col:c,values:p.slice(),attr:"data-"+g}:g&&delete h[g];const w=d.tBodies;for(let y=0;y<w.length;y++){const C=w[y].rows;for(let S=0;S<C.length;S++){const k=C[S];if(W(k))continue;const we={};for(let F=0;F<k.cells.length;F++)we[F]=H(k.cells[F]);We(we,h,k)?k.removeAttribute(o):k.setAttribute(o,"true")}}},x.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const d=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(d&&b.has(d)){const c=b.get(d),g=ge(d,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),p=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);p&&c[p]&&(delete c[p],this._filterTableRows({key:null,values:[]},d)),Object.keys(c).length===0&&b.delete(d)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&u.removeAttribute(f)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(u,d){const c=u[t];if(!(!c||c._destroyed))if(d===a)c.hashEnabled&&c._onHashChange&&window.removeEventListener("hashchange",c._onHashChange),c.nsKey=O(u,"filter"),c.hashEnabled=!!c.nsKey,c.hashEnabled&&window.addEventListener("hashchange",c._onHashChange);else if(d===l){const g=pe(u.getAttribute(l)),p=u.querySelector("["+n+"]"),h=p?p.getAttribute(n):null;h&&(_(u,h,g),c._render())}else d===e&&(c.targetId=u.getAttribute(e)||null,c._ensureTargetMarked(),c._render())}ae(e,t,x,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+f+"]",onSubtreeChange:function(u,d){if(d.addedNodes.length===0&&d.removedNodes.length===0)return;let c=null,g=null;if(u.hasAttribute(f)?(g=u,c=u.getAttribute(f)||u.id):u.hasAttribute(e)&&(c=u.getAttribute(e),g=c?document.getElementById(c):null),!c||!g)return;const p=document.querySelectorAll("["+e+'="'+c+'"]');for(let h=0;h<p.length;h++){const w=p[h][t];w&&!w._destroyed&&T(w).values.length>0&&w._queueDomFilter()}},persist:{attr:l,hashActive:function(u){return!!O(u,"filter")}}})})()})();
@@ -1,153 +1,161 @@
1
- {
2
- "$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
3
- "component": "ln-filter",
4
- "generator": "scripts/sync-ln-schemas.mjs",
5
- "attributes": {
6
- "data-ln-col": {
7
- "direction": "author",
8
- "sources": [
9
- "src/filter-model.js"
10
- ]
11
- },
12
- "data-ln-debug": {
13
- "direction": null,
14
- "sources": [
15
- "ln-filter-dev.scss"
16
- ]
17
- },
18
- "data-ln-empty": {
19
- "direction": "author",
20
- "sources": [
21
- "src/ln-filter.js"
22
- ]
23
- },
24
- "data-ln-empty-state": {
25
- "direction": "author",
26
- "sources": [
27
- "src/ln-filter.js"
28
- ]
29
- },
30
- "data-ln-field": {
31
- "direction": "author",
32
- "sources": [
33
- "src/filter-model.js"
34
- ]
35
- },
36
- "data-ln-filter": {
37
- "direction": null,
38
- "sources": [
39
- "ln-filter-dev.scss",
40
- "src/ln-filter.js"
41
- ],
42
- "type": "string",
43
- "description": "Target table or list element ID to filter"
44
- },
45
- "data-ln-filter-col": {
46
- "direction": "author",
47
- "sources": [
48
- "src/filter-model.js",
49
- "src/ln-filter.js"
50
- ],
51
- "type": "string",
52
- "description": "Column name or index filter specifier"
53
- },
54
- "data-ln-filter-hide": {
55
- "direction": "runtime",
56
- "sources": [
57
- "ln-filter.scss",
58
- "src/ln-filter.js"
59
- ],
60
- "type": "enum",
61
- "values": [
62
- "collapse",
63
- "none"
64
- ],
65
- "fallback": "collapse",
66
- "description": "CSS hiding strategy for non-matching rows"
67
- },
68
- "data-ln-filter-key": {
69
- "direction": "author",
70
- "sources": [
71
- "ln-filter-dev.scss",
72
- "src/filter-model.js",
73
- "src/ln-filter.js"
74
- ],
75
- "type": "string",
76
- "description": "Field key for filter matching"
77
- },
78
- "data-ln-filter-reset": {
79
- "direction": "author",
80
- "sources": [
81
- "src/ln-filter.js"
82
- ],
83
- "type": "trigger",
84
- "description": "Filter reset button or option trigger"
85
- },
86
- "data-ln-filter-value": {
87
- "direction": "author",
88
- "sources": [
89
- "src/ln-filter.js"
90
- ],
91
- "type": "string",
92
- "description": "Value to match for this filter input"
93
- },
94
- "data-ln-filter-values": {
95
- "direction": "both",
96
- "sources": [
97
- "src/ln-filter.js"
98
- ],
99
- "type": "string",
100
- "description": "Encoded active filter values"
101
- },
102
- "data-ln-hash": {
103
- "direction": null,
104
- "sources": [
105
- "src/ln-filter.js"
106
- ],
107
- "type": "string",
108
- "description": "URL hash routing key for filter state persistence"
109
- },
110
- "data-ln-popover": {
111
- "direction": "author",
112
- "sources": [
113
- "src/filter-model.js"
114
- ]
115
- },
116
- "data-ln-popover-for": {
117
- "direction": "author",
118
- "sources": [
119
- "src/filter-model.js"
120
- ]
121
- },
122
- "data-ln-sort-exclude": {
123
- "direction": "author",
124
- "sources": [
125
- "src/ln-filter.js"
126
- ]
127
- },
128
- "data-ln-table-col": {
129
- "direction": "author",
130
- "sources": [
131
- "src/filter-model.js"
132
- ]
133
- },
134
- "data-ln-table-empty": {
135
- "direction": "author",
136
- "sources": [
137
- "src/ln-filter.js"
138
- ]
139
- },
140
- "data-ln-table-filter-col": {
141
- "direction": "author",
142
- "sources": [
143
- "src/filter-model.js"
144
- ]
145
- },
146
- "data-ln-value": {
147
- "direction": "author",
148
- "sources": [
149
- "src/ln-filter.js"
150
- ]
151
- }
152
- }
153
- }
1
+ {
2
+ "$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
3
+ "component": "ln-filter",
4
+ "generator": "scripts/sync-ln-schemas.mjs",
5
+ "attributes": {
6
+ "data-ln-col": {
7
+ "direction": "author",
8
+ "sources": [
9
+ "src/filter-model.js"
10
+ ]
11
+ },
12
+ "data-ln-debug": {
13
+ "direction": null,
14
+ "sources": [
15
+ "ln-filter-dev.scss"
16
+ ]
17
+ },
18
+ "data-ln-empty": {
19
+ "direction": "author",
20
+ "sources": [
21
+ "src/ln-filter.js"
22
+ ]
23
+ },
24
+ "data-ln-empty-state": {
25
+ "direction": "author",
26
+ "sources": [
27
+ "src/ln-filter.js"
28
+ ]
29
+ },
30
+ "data-ln-field": {
31
+ "direction": "author",
32
+ "sources": [
33
+ "src/filter-model.js"
34
+ ]
35
+ },
36
+ "data-ln-filter": {
37
+ "direction": "author",
38
+ "sources": [
39
+ "ln-filter-dev.scss",
40
+ "src/ln-filter.js"
41
+ ],
42
+ "type": "string",
43
+ "description": "Target table or list element ID to filter"
44
+ },
45
+ "data-ln-filter-col": {
46
+ "direction": "author",
47
+ "sources": [
48
+ "src/filter-model.js",
49
+ "src/ln-filter.js"
50
+ ],
51
+ "type": "string",
52
+ "description": "Column name or index filter specifier"
53
+ },
54
+ "data-ln-filter-hide": {
55
+ "direction": "runtime",
56
+ "sources": [
57
+ "ln-filter.scss",
58
+ "src/ln-filter.js"
59
+ ],
60
+ "type": "enum",
61
+ "values": [
62
+ "collapse",
63
+ "none"
64
+ ],
65
+ "fallback": "collapse",
66
+ "description": "CSS hiding strategy for non-matching rows"
67
+ },
68
+ "data-ln-filter-key": {
69
+ "direction": "author",
70
+ "sources": [
71
+ "ln-filter-dev.scss",
72
+ "src/filter-model.js",
73
+ "src/ln-filter.js"
74
+ ],
75
+ "type": "string",
76
+ "description": "Field key for filter matching"
77
+ },
78
+ "data-ln-filter-reset": {
79
+ "direction": "author",
80
+ "sources": [
81
+ "src/ln-filter.js"
82
+ ],
83
+ "type": "trigger",
84
+ "description": "Filter reset button or option trigger"
85
+ },
86
+ "data-ln-filter-target": {
87
+ "direction": "both",
88
+ "sources": [
89
+ "src/ln-filter.js"
90
+ ],
91
+ "type": "marker",
92
+ "description": "Marker on target container or table observed by ln-filter"
93
+ },
94
+ "data-ln-filter-value": {
95
+ "direction": "author",
96
+ "sources": [
97
+ "src/ln-filter.js"
98
+ ],
99
+ "type": "string",
100
+ "description": "Value to match for this filter input"
101
+ },
102
+ "data-ln-filter-values": {
103
+ "direction": "both",
104
+ "sources": [
105
+ "src/ln-filter.js"
106
+ ],
107
+ "type": "string",
108
+ "description": "Encoded active filter values"
109
+ },
110
+ "data-ln-hash": {
111
+ "direction": null,
112
+ "sources": [
113
+ "src/ln-filter.js"
114
+ ],
115
+ "type": "string",
116
+ "description": "URL hash routing key for filter state persistence"
117
+ },
118
+ "data-ln-popover": {
119
+ "direction": "author",
120
+ "sources": [
121
+ "src/filter-model.js"
122
+ ]
123
+ },
124
+ "data-ln-popover-for": {
125
+ "direction": "author",
126
+ "sources": [
127
+ "src/filter-model.js"
128
+ ]
129
+ },
130
+ "data-ln-sort-exclude": {
131
+ "direction": "author",
132
+ "sources": [
133
+ "src/ln-filter.js"
134
+ ]
135
+ },
136
+ "data-ln-table-col": {
137
+ "direction": "author",
138
+ "sources": [
139
+ "src/filter-model.js"
140
+ ]
141
+ },
142
+ "data-ln-table-empty": {
143
+ "direction": "author",
144
+ "sources": [
145
+ "src/ln-filter.js"
146
+ ]
147
+ },
148
+ "data-ln-table-filter-col": {
149
+ "direction": "author",
150
+ "sources": [
151
+ "src/filter-model.js"
152
+ ]
153
+ },
154
+ "data-ln-value": {
155
+ "direction": "author",
156
+ "sources": [
157
+ "src/ln-filter.js"
158
+ ]
159
+ }
160
+ }
161
+ }
@@ -11,6 +11,7 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
11
11
  const COL_ATTR = 'data-ln-filter-col';
12
12
  const HASH_ATTR = 'data-ln-hash';
13
13
  const VALUES_ATTR = 'data-ln-filter-values';
14
+ const TARGET_ATTR = 'data-ln-filter-target';
14
15
 
15
16
  // Shared column filter state per plain table (AND across columns, OR within column)
16
17
  const _tableFilters = new WeakMap();
@@ -19,14 +20,15 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
19
20
 
20
21
  // ─── Attribute Contract (SSOT) ──────────────────────────
21
22
  const ATTRIBUTES = {
22
- 'data-ln-filter': { prop: 'targetId', type: 'string', read: attrStr, fallback: null, description: 'Target table or list element ID to filter' },
23
+ 'data-ln-filter': { prop: 'targetId', type: 'string', read: attrStr, fallback: null, effect: _syncAttribute, description: 'Target table or list element ID to filter' },
23
24
  'data-ln-hash': { type: 'string', effect: _syncAttribute, description: 'URL hash routing key for filter state persistence' },
24
25
  'data-ln-filter-values': { type: 'string', effect: _syncAttribute, description: 'Encoded active filter values' },
25
26
  'data-ln-filter-col': { type: 'string', description: 'Column name or index filter specifier' },
26
27
  'data-ln-filter-key': { type: 'string', description: 'Field key for filter matching' },
27
28
  'data-ln-filter-reset': { type: 'trigger', description: 'Filter reset button or option trigger' },
28
29
  'data-ln-filter-value': { type: 'string', description: 'Value to match for this filter input' },
29
- 'data-ln-filter-hide': { type: 'enum', values: ['collapse', 'none'], fallback: 'collapse', description: 'CSS hiding strategy for non-matching rows' }
30
+ 'data-ln-filter-hide': { type: 'enum', values: ['collapse', 'none'], fallback: 'collapse', description: 'CSS hiding strategy for non-matching rows' },
31
+ 'data-ln-filter-target': { type: 'marker', description: 'Marker on target container or table observed by ln-filter' }
30
32
  };
31
33
 
32
34
  const ATTR_SPEC = attrSpec(ATTRIBUTES);
@@ -90,6 +92,31 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
90
92
  });
91
93
 
92
94
  this._queueRender = queueRender;
95
+
96
+ const queueDomFilter = createBatcher(function () {
97
+ if (!self._destroyed) {
98
+ self._applyDomFilter();
99
+ }
100
+ });
101
+
102
+ this._queueDomFilter = queueDomFilter;
103
+
104
+ function _ensureTargetMarked() {
105
+ if (!self.targetId) return;
106
+ const target = document.getElementById(self.targetId);
107
+ if (target && !target.hasAttribute(TARGET_ATTR)) {
108
+ target.setAttribute(TARGET_ATTR, self.targetId);
109
+ }
110
+ }
111
+
112
+ this._ensureTargetMarked = _ensureTargetMarked;
113
+ _ensureTargetMarked();
114
+ queueBoot(function () {
115
+ if (!self._destroyed) {
116
+ _ensureTargetMarked();
117
+ }
118
+ });
119
+
93
120
  this._attachHandlers();
94
121
 
95
122
  // Hash change listener
@@ -274,13 +301,19 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
274
301
  }
275
302
 
276
303
  if (defaultPrevented) return;
304
+ self._applyDomFilter(target);
305
+ };
277
306
 
278
- const table = target && (target.tagName === 'TABLE' ? target : (target.querySelector ? target.querySelector('table') : null));
307
+ _component.prototype._applyDomFilter = function (targetOverride) {
308
+ const target = targetOverride || document.getElementById(this.targetId);
309
+ if (!target) return;
310
+ const active = _deriveActive(this);
311
+ const isReset = active.key === null || active.values.length === 0;
312
+ const table = target.tagName === 'TABLE' ? target : (target.querySelector ? target.querySelector('table') : null);
279
313
 
280
314
  if (table) {
281
- self._filterTableRows(active, table);
315
+ this._filterTableRows(active, table);
282
316
  } else {
283
- if (!target) return;
284
317
  const children = target.children;
285
318
  for (let i = 0; i < children.length; i++) {
286
319
  const el = children[i];
@@ -383,6 +416,13 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
383
416
  }
384
417
  if (Object.keys(filters).length === 0) _tableFilters.delete(table);
385
418
  }
419
+
420
+ if (this.targetId) {
421
+ const remaining = document.querySelectorAll('[' + DOM_SELECTOR + '="' + this.targetId + '"]');
422
+ if (remaining.length <= 1) {
423
+ target.removeAttribute(TARGET_ATTR);
424
+ }
425
+ }
386
426
  }
387
427
 
388
428
  if (this._onDomChange) {
@@ -420,6 +460,10 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
420
460
  _applyInputValues(el, key, values);
421
461
  instance._render();
422
462
  }
463
+ } else if (attrName === DOM_SELECTOR) {
464
+ instance.targetId = el.getAttribute(DOM_SELECTOR) || null;
465
+ instance._ensureTargetMarked();
466
+ instance._render();
423
467
  }
424
468
  }
425
469
 
@@ -427,6 +471,34 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
427
471
 
428
472
  registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-filter', {
429
473
  attributes: ATTRIBUTES,
474
+ subtreeQuery: '[' + DOM_SELECTOR + '], [' + TARGET_ATTR + ']',
475
+ onSubtreeChange: function (host, mut) {
476
+ if (mut.addedNodes.length === 0 && mut.removedNodes.length === 0) return;
477
+
478
+ let targetId = null;
479
+ let targetEl = null;
480
+
481
+ if (host.hasAttribute(TARGET_ATTR)) {
482
+ targetEl = host;
483
+ targetId = host.getAttribute(TARGET_ATTR) || host.id;
484
+ } else if (host.hasAttribute(DOM_SELECTOR)) {
485
+ targetId = host.getAttribute(DOM_SELECTOR);
486
+ targetEl = targetId ? document.getElementById(targetId) : null;
487
+ }
488
+
489
+ if (!targetId || !targetEl) return;
490
+
491
+ const controls = document.querySelectorAll('[' + DOM_SELECTOR + '="' + targetId + '"]');
492
+ for (let i = 0; i < controls.length; i++) {
493
+ const inst = controls[i][DOM_ATTRIBUTE];
494
+ if (inst && !inst._destroyed) {
495
+ const active = _deriveActive(inst);
496
+ if (active.values.length > 0) {
497
+ inst._queueDomFilter();
498
+ }
499
+ }
500
+ }
501
+ },
430
502
  persist: {
431
503
  attr: VALUES_ATTR,
432
504
  hashActive: function (el) { return !!resolveHashNamespace(el, 'filter'); }