@livenetworks/ashlar 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) 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-queue/ln-api-queue.js +1 -1
  5. package/components/ln-autoresize/ln-autoresize.js +1 -1
  6. package/components/ln-autoresize/src/ln-autoresize.js +3 -1
  7. package/components/ln-autosave/ln-autosave.js +1 -1
  8. package/components/ln-chart/ln-chart.js +1 -1
  9. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  10. package/components/ln-confirm/ln-confirm.js +1 -1
  11. package/components/ln-core/lifecycle.js +33 -12
  12. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  13. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  14. package/components/ln-data-store/ln-data-store.js +1 -1
  15. package/components/ln-date/ln-date.js +1 -1
  16. package/components/ln-date/src/ln-date.js +22 -13
  17. package/components/ln-debug/ln-debug.js +1 -1
  18. package/components/ln-dropdown/ln-dropdown.js +1 -1
  19. package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
  20. package/components/ln-dropdown/src/ln-dropdown.js +18 -5
  21. package/components/ln-editor/ln-editor.js +1 -1
  22. package/components/ln-editor/src/ln-editor.js +45 -12
  23. package/components/ln-external-links/ln-external-links.js +1 -1
  24. package/components/ln-filter/ln-filter.js +1 -1
  25. package/components/ln-filter/ln-filter.schema.json +1 -1
  26. package/components/ln-filter/src/ln-filter.js +11 -10
  27. package/components/ln-form/ln-form.js +1 -1
  28. package/components/ln-form/src/ln-form.js +11 -0
  29. package/components/ln-icon/ln-icon.js +1 -1
  30. package/components/ln-include/ln-include.js +1 -1
  31. package/components/ln-key/ln-key.js +1 -1
  32. package/components/ln-link/ln-link.js +1 -1
  33. package/components/ln-list/ln-list.js +1 -1
  34. package/components/ln-list/src/ln-list.js +14 -5
  35. package/components/ln-modal/ln-modal.js +1 -1
  36. package/components/ln-nav/ln-nav.js +1 -1
  37. package/components/ln-number/ln-number.js +1 -1
  38. package/components/ln-number/src/ln-number.js +22 -12
  39. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  40. package/components/ln-options/ln-options.js +1 -1
  41. package/components/ln-picklist/ln-picklist.js +1 -1
  42. package/components/ln-popover/ln-popover.js +1 -1
  43. package/components/ln-popover/ln-popover.schema.json +82 -82
  44. package/components/ln-popover/src/ln-popover.js +22 -5
  45. package/components/ln-progress/ln-progress.js +1 -1
  46. package/components/ln-router/ln-router.js +1 -1
  47. package/components/ln-scroll/ln-scroll.js +1 -1
  48. package/components/ln-search/ln-search.js +1 -1
  49. package/components/ln-search/ln-search.schema.json +103 -103
  50. package/components/ln-search/src/ln-search.js +9 -5
  51. package/components/ln-slug/ln-slug.js +1 -1
  52. package/components/ln-sort/ln-sort.js +1 -1
  53. package/components/ln-sortable/ln-sortable.js +1 -1
  54. package/components/ln-sortable/src/ln-sortable.js +52 -7
  55. package/components/ln-stat/ln-stat.js +1 -1
  56. package/components/ln-table/ln-table.js +1 -1
  57. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  58. package/components/ln-tabs/ln-tabs.js +1 -1
  59. package/components/ln-tabs/src/ln-tabs.js +12 -8
  60. package/components/ln-time/ln-time.js +1 -1
  61. package/components/ln-time/src/ln-time.js +17 -7
  62. package/components/ln-toast/ln-toast.js +1 -1
  63. package/components/ln-toggle/ln-toggle.js +1 -1
  64. package/components/ln-tooltip/ln-tooltip.js +1 -1
  65. package/components/ln-translations/ln-translations.js +1 -1
  66. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  67. package/components/ln-upload/ln-upload.js +1 -1
  68. package/components/ln-validate/ln-validate.js +1 -1
  69. package/components/ln-validate/src/ln-validate.js +21 -7
  70. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  71. package/package.json +1 -1
  72. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function D(){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 m(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 n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!m(n))return}e.apply(console,t)}}function I(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&l[o.name].push(o.options[u].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const u=Number(o.value);l[o.name]=o.value===""||isNaN(u)?null:u}else l[o.name]=o.value}return l}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(o).split(",").map(function(d){return d.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=ee(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<i.options.length;u++)i.options[u].selected=o.indexOf(i.options[u].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const q={};function ne(e,t){q[e]=t}function re(e){return q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function ie(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];F[r]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const y={};function se(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(a,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(a,!!t[f])}}return e}function ce(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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].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)T(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function $(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ue(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const u=e.children[o],d=u.getAttribute("data-ln-render-key");d&&(i[d]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],d=String(n(u));let a=i[d];if(a)l(a,u,o);else{const f=se(r,s);if(!f||($(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),l(a,u,o)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=ce,window.lnCore.renderList=ue);function h(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function N(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function R(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function B(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return A.set(r,l),l}function j(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function W(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function V(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function H(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=B(n.values,n.fallback);break;case"integer":l=N;break;case"float":l=j;break;case"boolean":l=R;break;case"list":l=M;break;case"json":l=W;break;case"string":default:l=h;break}l||(l=h),t[n.prop]=[l,r,n.fallback]}return t}function ae(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=U,window.lnCore.attrSpec=H,window.lnCore.attrStr=h,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=M,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&b(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)b(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(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 Q(){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 he(e){const t=Q(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=de(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function K(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function be(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=Q(),l=n.byAttr.get(t),s=D()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&m(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let u=0;u<c.length;u++)V(c[u].spec,o,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&K(c,i,t,e.oldValue),n.reactiveWildcard.length&&K(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(J(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{be(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ge(e){const t=x();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&b(n,i);else if(n.matches&&n.matches(i.query)&&b(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)b(c[o],i)}}i.onInit&&i.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&v(n,i);else if(n.matches&&n.matches(c)&&v(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let u=0;u<o.length;u++)v(o[u],i)}}}}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{ge(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e){x().push(e),P()}function z(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,u=l.onAttrChange||null,d=l.effects||null,a=l.attributes||null,f=a?ae(a):d,De=a?new Set(Object.keys(a)):null,Ie=l.persist||null;function C(k){const w=k||document.body;if(J(w,e,t,r),a&&D())for(const p in a){const Te=a[p],O=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&O.push(w);for(let L=0;L<O.length;L++){const E=O[L];m(E)&&V(Te,E.getAttribute(p),p,n,E)}}o&&o(w)}const S=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)S.push(w[1])}else S.push(e);he({selector:e,attribute:t,componentTag:n,attributes:a,ComponentFn:r,onInit:o,observed:S.concat(s),onAttributeChange:i,onAttrChange:u,effects:f,declared:De,persist:Ie}),pe();const qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Fe=l.subtreeQuery||(qe?e:"["+e+"]");x().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:Fe}),P(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ce);function X(){fe()>0?we(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),C}function G(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,r={},n=G(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function me(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const r=_();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");G(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n: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 Se(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=Se,window.lnCore.hashFilterDecode=ke);function Oe(){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=Oe);function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t).trim(),n=e.slice(t+1).trim();if(!r)return null;const l={};return l[r]=[n],l}function Ee(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const r={"data-ln-stat":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:h,fallback:"",description:"JSON or key:value filter criteria for record counting"}},n=H(r);function l(s){return this.dom=s,U(this,s,n),this._onSetCount=function(i){s.textContent=Ee(i.detail&&i.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),I(s,"ln-stat:request-count",{stat:this._storeName,filters:Le(this._filterRaw)}),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},z(e,t,l,"ln-stat",{attributes:r})})()})();
1
+ (function(){"use strict";function I(){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 m(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 l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!m(l))return}e.apply(console,t)}}function q(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&i[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&o[n.name].push(n.options[u].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const u=Number(n.value);o[n.name]=n.value===""||isNaN(u)?null:u}else o[n.name]=n.value}return o}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const r=e.elements,l=[],o={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const n=t[c];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(o[i.name]>1){const u=String(n).split(",").map(function(a){return a.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=re(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<i.options.length;u++)i.options[u].selected=n.indexOf(i.options[u].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const F={};function ie(e,t){F[e]=t}function le(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ie,window.lnCore.getDataMapper=le);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function ce(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];T[r]=t}function ue(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=se);const y={};function ae(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function de(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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].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)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function N(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const l=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],c=i.attributes;for(let n=0;n<c.length;n++){const u=c[n];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function fe(e,t,r,l,o,s){const i={};for(let n=0;n<e.children.length;n++){const u=e.children[n],a=u.getAttribute("data-ln-render-key");a&&(i[a]=u)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],a=String(l(u));let d=i[a];if(d)o(d,u,n);else{const f=ae(r,s);if(!f||(N(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),o(d,u,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=$,window.lnCore.lnFill=de,window.lnCore.renderList=fe);function h(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function R(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function M(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function j(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const l=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&l.has(c)?c:t};return A.set(r,o),o}function W(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function V(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function U(e,t,r,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function H(e,t,r){for(const l in r){const[o,s,i]=r[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=j(l.values,l.fallback);break;case"integer":o=R;break;case"float":o=W;break;case"boolean":o=M;break;case"list":o=B;break;case"json":o=V;break;case"string":default:o=h;break}o||(o=h),t[l.prop]=[o,r,l.fallback]}return t}function we(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function he(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=H,window.lnCore.attrSpec=J,window.lnCore.attrStr=h,window.lnCore.attrInt=R,window.lnCore.attrBool=M,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=W,window.lnCore.attrJson=V);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Q(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&b(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)b(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(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 K(){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 ge(e){const t=K(),r=e.observed||[];for(let l=0;l<r.length;l++){const o=r[l];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 l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=he(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function P(e,t,r,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function Ce(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=K(),o=l.byAttr.get(t),s=I()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&m(i)){const c=l.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let u=0;u<c.length;u++)U(c[u].spec,n,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&P(c,i,t,e.oldValue),l.reactiveWildcard.length&&P(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(Q(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ce(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function _(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=x();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=v();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&b(s,n);else if(s.matches&&s.matches(n.query)&&b(s,n),s.querySelectorAll){const u=s.querySelectorAll(n.query);for(let a=0;a<u.length;a++)b(u[a],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],u=n.query;if(u){if(!i)s.matches&&s.matches(u)&&_(s,n);else if(s.matches&&s.matches(u)&&_(s,n),s.querySelectorAll){const a=s.querySelectorAll(u);for(let d=0;d<a.length;d++)_(a[d],n)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{ye(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){x().push(e),e.onSubtreeChange&&e.query&&v().push(e),z()}function G(e,t,r,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,u=o.onAttrChange||null,a=o.effects||null,d=o.attributes||null,f=d?we(d):a,Fe=d?new Set(Object.keys(d)):null,Te=o.persist||null;function C(O){const w=O||document.body;if(Q(w,e,t,r),d&&I())for(const p in d){const Ne=d[p],E=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&E.push(w);for(let L=0;L<E.length;L++){const D=E[L];m(D)&&U(Ne,D.getAttribute(p),p,l,D)}}n&&n(w)}const k=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)k.push(w[1])}else k.push(e);ge({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:r,onInit:n,observed:k.concat(s),onAttributeChange:i,onAttrChange:u,effects:f,declared:Fe,persist:Te}),me();const $e=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Y=o.subtreeQuery||($e?e:"["+e+"]"),Z={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Y};x().push(Z),c&&Y&&v().push(Z),z(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G,window.lnCore.observeLifecycle=Ae);function ee(){be()>0?pe(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ee):ee(),C}function X(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},l=X(t);if(!l)return r;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(u)}catch{r[n]=u}}return r}function xe(e){if(!e)return null;const t=S();return e in t?t[e]:null}function ve(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");X(location.hash)!==o&&(location.hash=o)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Se(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(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 Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=xe,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Le);function De(){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=De);function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t).trim(),l=e.slice(t+1).trim();if(!r)return null;const o={};return o[r]=[l],o}function qe(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const r={"data-ln-stat":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:h,fallback:"",description:"JSON or key:value filter criteria for record counting"}},l=J(r);function o(s){return this.dom=s,H(this,s,l),this._onSetCount=function(i){s.textContent=qe(i.detail&&i.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),q(s,"ln-stat:request-count",{stat:this._storeName,filters:Ie(this._filterRaw)}),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},G(e,t,o,"ln-stat",{attributes:r})})()})();
@@ -1 +1 @@
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 N(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 c=1;c<e.length;c++)if(e[c]&&e[c].nodeType===1){r=e[c];break}if(!N(r))return}t.apply(console,e)}}function D(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 wt(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,D(t.dom,e,r)}function H(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){H(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function G(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()}function _t(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function gt(t,e){const l=!!(e&&e.typed),r=e&&e.exclude,c={},b=t.elements,a={};if(l)for(let h=0;h<b.length;h++){const o=b[h];o.name&&o.type==="checkbox"&&!o.disabled&&(a[o.name]=(a[o.name]||0)+1)}for(let h=0;h<b.length;h++){const o=b[h];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")l&&a[o.name]===1?c[o.name]=o.checked:(c[o.name]||(c[o.name]=[]),o.checked&&c[o.name].push(o.value));else if(o.type==="radio")o.checked&&(c[o.name]=o.value);else if(o.type==="select-multiple"){c[o.name]=[];for(let p=0;p<o.options.length;p++)o.options[p].selected&&c[o.name].push(o.options[p].value)}else if(l&&o.type==="hidden")c[o.name]=o.value;else if(l&&(o.type==="number"||o.type==="range")){const p=Number(o.value);c[o.name]=o.value===""||isNaN(p)?null:p}else c[o.name]=o.value}return c}function mt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function yt(t,e){const l=t.elements,r=[],c={};for(let b=0;b<l.length;b++){const a=l[b];a.name&&a.type==="checkbox"&&(c[a.name]=(c[a.name]||0)+1)}for(let b=0;b<l.length;b++){const a=l[b];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const h=a.getAttribute("data-ln-fill-as")||a.name;if(!h||!(h in e))continue;const o=e[h];if(a.type==="checkbox"){if(Array.isArray(o))a.checked=o.indexOf(a.value)!==-1;else if(c[a.name]>1){const p=String(o).split(",").map(function(v){return v.trim()});a.checked=p.indexOf(a.value)!==-1}else a.checked=mt(o);r.push(a)}else if(a.type==="radio")a.checked=a.value===String(o),r.push(a);else if(a.type==="select-multiple"){if(Array.isArray(o))for(let p=0;p<a.options.length;p++)a.options[p].selected=o.indexOf(a.options[p].value)!==-1;r.push(a)}else a.value=o,a.tagName==="SELECT"&&o!=null&&a.setAttribute("data-ln-value",o),r.push(a)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=yt,window.lnCore.serializeForm=gt,window.lnCore.resolveFormMethod=_t);const K={};function Ct(t,e){K[t]=e}function St(t){return K[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ct,window.lnCore.getDataMapper=St);function vt(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 At(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,H(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function Et(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];Q[l]=e}function kt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return Q[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Et,window.lnCore.getLocaleFallback=kt,window.lnCore.ensureLocaleObserver=At);const M={};function Y(t,e){M[t]||(M[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=M[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function J(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return Y(e,l)}function X(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let a=0;a<l.length;a++){const h=l[a],o=h.getAttribute("data-ln-field");e[o]!=null&&(h.textContent=e[o])}const r=t.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const h=r[a],o=h.getAttribute("data-ln-attr").split(",");for(let p=0;p<o.length;p++){const v=o[p].trim().split(":");if(v.length!==2)continue;const A=v[0].trim(),E=v[1].trim();e[E]!=null&&h.setAttribute(A,e[E])}}const c=t.querySelectorAll("[data-ln-show]");for(let a=0;a<c.length;a++){const h=c[a],o=h.getAttribute("data-ln-show");o in e&&h.classList.toggle("hidden",!e[o])}const b=t.querySelectorAll("[data-ln-class]");for(let a=0;a<b.length;a++){const h=b[a],o=h.getAttribute("data-ln-class").split(",");for(let p=0;p<o.length;p++){const v=o[p].trim().split(":");if(v.length!==2)continue;const A=v[0].trim(),E=v[1].trim();E in e&&h.classList.toggle(A,!!e[E])}}return t}function xt(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)X(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 W(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const b=l.currentNode;b.textContent.indexOf("{{")!==-1&&(b.textContent=b.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,h){return e[h]!==void 0?e[h]:""}))}const r=function(b,a){return e[a]!==void 0?e[a]:""},c=Array.from(t.querySelectorAll("*"));t.nodeType===1&&c.push(t);for(let b=0;b<c.length;b++){const a=c[b],h=a.attributes;for(let o=0;o<h.length;o++){const p=h[o];p.value.indexOf("{{")!==-1&&a.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function Dt(t,e,l,r,c,b){const a={};for(let o=0;o<t.children.length;o++){const p=t.children[o],v=p.getAttribute("data-ln-render-key");v&&(a[v]=p)}const h=document.createDocumentFragment();for(let o=0;o<e.length;o++){const p=e[o],v=String(r(p));let A=a[v];if(A)c(A,p,o);else{const E=Y(l,b);if(!E||(W(E,p),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",v),c(A,p,o)}h.appendChild(A)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=X,window.lnCore.lnFill=xt,window.lnCore.renderList=Dt);function R(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function Z(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function P(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const c=r.trim().toLowerCase();return!(c==="false"||c==="0")}function tt(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const V=new Map;function et(t,e){const l=(t?t.join("|"):"")+"::"+e;if(V.has(l))return V.get(l);const r=new Set(t||[]),c=function(b,a){const h=b.getAttribute(a);return h!==null&&r.has(h)?h:e};return V.set(l,c),c}function nt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function it(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function lt(t,e,l,r,c){if(!t||e===null)return!0;const b=r||"ln-component",a=t.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||e===""&&t.fallback!==void 0)return!0;const h=o=>{c?console.warn(o,c):console.warn(o)};if(a==="boolean"){const o=e.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(h(`[${b}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const o=t.values||[];return o.includes(e)?!0:(h(`[${b}] Invalid value "${e}" for attribute "${l}". Allowed: ${o.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(e))return h(`[${b}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const o=parseInt(e,10);return t.min!==void 0&&o<t.min?(h(`[${b}] Value ${o} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&o>t.max?(h(`[${b}] Value ${o} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(a==="float")return isNaN(Number(e))?(h(`[${b}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(e),!0}catch(o){return h(`[${b}] Invalid JSON for attribute "${l}": ${o.message}. Fallback: ${t.fallback}.`),!1}return!0}function rt(t,e,l){for(const r in l){const[c,b,a]=l[r];Object.defineProperty(t,r,{get:function(){return c(e,b,a)},enumerable:!0,configurable:!0})}return t}function ot(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let c=r.read;if(!c&&r.type)switch(r.type){case"enum":c=et(r.values,r.fallback);break;case"integer":c=Z;break;case"float":c=nt;break;case"boolean":c=P;break;case"list":c=tt;break;case"json":c=it;break;case"string":default:c=R;break}c||(c=R),e[r.prop]=[c,l,r.fallback]}return e}function Tt(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 Lt(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}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=rt,window.lnCore.attrSpec=ot,window.lnCore.attrStr=R,window.lnCore.attrInt=Z,window.lnCore.attrBool=P,window.lnCore.attrList=tt,window.lnCore.attrEnum=et,window.lnCore.attrFloat=nt,window.lnCore.attrJson=it);function O(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(l){console.error("["+e.attribute+"] init failed",t,l)}}}function st(t,e,l,r){if(t.nodeType!==1)return;const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",a={selector:e,attribute:l,ComponentFn:r};if(t.matches&&t.matches(b)&&O(t,a),t.querySelectorAll){const h=t.querySelectorAll(b);for(let o=0;o<h.length;o++)O(h[o],a)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function qt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function It(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 at(){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 Ft(t){const e=at(),l=t.observed||[];for(let r=0;r<l.length;r++){const c=l[r];e.byAttr.has(c)||e.byAttr.set(c,[]),e.byAttr.get(c).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 c=e.byDeclaredAttr.get(r);c.some(b=>b.componentTag===t.componentTag)||c.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=Lt(t);if(r===null)e.reactiveWildcard.push(t);else for(const c of r)e.byReactive.has(c)||e.byReactive.set(c,[]),e.byReactive.get(c).push(t)}t.persist&&e.persist.push(t)}function ct(t,e,l,r){for(let c=0;c<t.length;c++){const b=t[c];if(!e[b.attribute])continue;const a=b.effects&&b.effects[l];a?a(e,l,r):b.onAttrChange&&(!b.declared||b.declared.has(l))&&b.onAttrChange(e,l,r)}}function Rt(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,r=at(),c=r.byAttr.get(e),b=U()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(e);if(!l&&!c&&!b)return;const a=t.target;if(t.oldValue!==a.getAttribute(e)){if(b&&N(a)){const h=r.byDeclaredAttr.get(e),o=a.getAttribute(e);for(let p=0;p<h.length;p++)lt(h[p].spec,o,e,h[p].componentTag,a)}if(window.lnCore._debugSink&&(l||c)&&window.lnCore._debugSink("attr",e,a,{oldValue:t.oldValue,newValue:a.getAttribute(e)}),l){const h=r.byReactive.get(e);h&&ct(h,a,e,t.oldValue),r.reactiveWildcard.length&&ct(r.reactiveWildcard,a,e,t.oldValue)}if(c)for(let h=0;h<c.length;h++){const o=c[h];if(o.handler){o.handler(a,e,t.oldValue);continue}o.onAttributeChange&&a[o.attribute]?o.onAttributeChange(a,e):(st(a,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(a))}}}function Ot(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Rt(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 B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function z(t,e){if(!document.contains(t))if(e.attribute){const l=t[e.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(r){console.error("["+e.attribute+"] destroy failed",t,r)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Ht(t){const e=B();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const r=e[l];if(r.onSubtreeChange&&r.query){const c=r.query,b=t.target.nodeType===1?t.target.matches&&t.target.matches(c)?t.target:t.target.closest?t.target.closest(c):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(c):null;b&&r.onSubtreeChange(b,t)}}for(let l=0;l<t.addedNodes.length;l++){const r=t.addedNodes[l];if(r.nodeType===1){const c=!!(r.firstElementChild||r.children&&r.children.length);for(let b=0;b<e.length;b++){const a=e[b];if(a.selector&&a.attribute&&a.ComponentFn){if(!c)r.matches&&r.matches(a.query)&&O(r,a);else if(r.matches&&r.matches(a.query)&&O(r,a),r.querySelectorAll){const h=r.querySelectorAll(a.query);for(let o=0;o<h.length;o++)O(h[o],a)}}a.onInit&&a.onInit(r)}}}for(let l=0;l<t.removedNodes.length;l++){const r=t.removedNodes[l];if(r.nodeType===1){const c=!!(r.firstElementChild||r.children&&r.children.length);for(let b=0;b<e.length;b++){const a=e[b],h=a.query;if(h){if(!c)r.matches&&r.matches(h)&&z(r,a);else if(r.matches&&r.matches(h)&&z(r,a),r.querySelectorAll){const o=r.querySelectorAll(h);for(let p=0;p<o.length;p++)z(o[p],a)}}}}}}}function dt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{Ht(r)}catch(c){console.error("[ln-core] lifecycle handler failed",r.target,c)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Nt(t){B().push(t),dt()}function ut(t,e,l,r,c={}){const b=c.extraAttributes||[],a=c.onAttributeChange||null,h=c.onSubtreeChange||null,o=c.onInit||null,p=c.onAttrChange||null,v=c.effects||null,A=c.attributes||null,E=A?Tt(A):v,q=A?new Set(Object.keys(A)):null,I=c.persist||null;function F(s){const f=s||document.body;if(st(f,t,e,l),A&&U())for(const d in A){const _=A[d],w=Array.from(f.querySelectorAll("["+d+"]"));f.matches&&f.matches("["+d+"]")&&w.push(f);for(let g=0;g<w.length;g++){const m=w[g];N(m)&&lt(_,m.getAttribute(d),d,r,m)}}o&&o(f)}const S=[];if(t.indexOf("[")!==-1){const s=/\[([\w-]+)/g;let f;for(;(f=s.exec(t))!==null;)S.push(f[1])}else S.push(t);Ft({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:o,observed:S.concat(b),onAttributeChange:a,onAttrChange:p,effects:E,declared:q,persist:I}),Ot();const n=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,u=c.subtreeQuery||(n?t:"["+t+"]");B().push({selector:t,attribute:e,ComponentFn:l,onInit:o,onSubtreeChange:h,query:u}),dt(),window[e]=F,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ut,window.lnCore.observeLifecycle=Nt);function i(){qt()>0?It(function(){F(document.body)}):F(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),F}function Mt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Wt(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,c=t.fetchDebounce!=null?t.fetchDebounce:120;const b=typeof t.requestPage=="function"?t.requestPage:function(){},a=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,o=new Map,p=new Set;let v=0,A=0,E=0,q={sort:null,filters:{},search:""},I=null,F=0,S=0,n=!1;function u(d){o.set(d,++F)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function s(){if(h.size<=e)return;const d=Array.from(h.keys()).sort(function(w,g){return(o.get(w)||0)-(o.get(g)||0)});let _=0;for(;h.size>e&&_<d.length;)h.delete(d[_]),o.delete(d[_]),_++}function f(d,_){p.add(d),b(q,d,_)}return{get:function(d){return h.get(d)},has:function(d){return h.has(d)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return v},get grandTotal(){return A},get queryGen(){return E},get size(){return h.size},ensure:function(d,_){clearTimeout(I),S=d;for(let k=d;k<_;k++)h.has(k)&&u(k);if(v<=0)return;const w=Math.max(0,d-r),g=Math.min(v,_+r),m=Math.floor(w/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let k=m;k<=T;k++){const y=k*l,C=Math.min(l,v-y);let x=!1;const Yt=Math.max(y,w),Jt=Math.min(y+C,g);for(let j=Yt;j<Jt;j++)if(!h.has(j)){x=!0;break}if(x&&!p.has(y)){L=y;break}}L!==-1&&(I=setTimeout(function(){f(L,l)},c))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const _=d.offset||0,w=d.data||[];let g=0;for(let m=0;m<w.length;m++)w[m]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return p.delete(_),!1;n&&(h.clear(),o.clear(),n=!1),d.provisional||(A=d.total!=null?d.total:A,v=d.filtered!=null?d.filtered:d.data?d.data.length:v);for(let m=0;m<w.length;m++)w[m]!=null&&(h.set(_+m,w[m]),u(_+m));return p.delete(_),s(),a(),!0},requestInitial:function(d){d&&(q=d),f(0,l)},invalidate:function(d){E++,p.clear(),clearTimeout(I),d&&(q=d),n=!0,f(0,l)},revalidate:function(){E++,p.clear(),clearTimeout(I),n=!0;const d=Math.max(0,Math.floor(S/l)*l);f(d,l)},release:function(d){p.delete(d)},destroy:function(){clearTimeout(I),h.clear(),o.clear(),p.clear()},configure:function(d){d=d||{};let _=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==e){const w=d.windowSize<e;e=d.windowSize,w&&s(),_=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(r=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(c=d.fetchDebounce),_&&a()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(A=d,i()||(v=d),a())}}}function ht(t){return(t||"").replace(/^#/,"")}function $(t){const e=t===void 0?location.hash:t,l={},r=ht(e);if(!r)return l;const c=r.split("&");for(let b=0;b<c.length;b++){const a=c[b];if(!a)continue;const h=a.indexOf(":"),o=h>-1?a.slice(0,h):a,p=h>-1?a.slice(h+1):"";if(o)try{l[o]=decodeURIComponent(p)}catch{l[o]=p}}return l}function Pt(t){if(!t)return null;const e=$();return t in e?e[t]:null}function Vt(t,e){if(!t)return;const l=$();e==null?delete l[t]:l[t]=String(e);const c=Object.keys(l).map(function(b){const a=l[b];return a===""?b:b+":"+encodeURIComponent(a)}).join("&");ht(location.hash)!==c&&(location.hash=c)}function Bt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function zt(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 $t(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function jt(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 Ut(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Gt(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),c=r?r.split(",").map(function(b){try{return decodeURIComponent(b)}catch{return b}}).filter(Boolean):[];return{key:l,values:c}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Pt,window.lnCore.hashSet=Vt,window.lnCore.hashLinkClick=Bt,window.lnCore.resolveHashNamespace=zt,window.lnCore.hashSortEncode=$t,window.lnCore.hashSortDecode=jt,window.lnCore.hashFilterEncode=Ut,window.lnCore.hashFilterDecode=Gt);function Kt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Kt);function ft(t,e,l,r,c=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const b=Math.max(0,t||0),a=Math.max(0,e||0),h=Math.floor(b/l),o=Math.ceil(a/l),p=Math.max(0,h-c),v=Math.min(r,h+o+c),A=p*l,E=Math.max(0,(r-v)*l);return{start:p,end:v,topPadding:A,bottomPadding:E}}function Qt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let c=0;if(Array.isArray(t))for(let h=0;h<t.length;h++)r.has(t[h])&&c++;else c=r.size;const b=l>0&&c===l,a=c>0&&c<l;return{totalCount:l,selectedCount:c,isAllSelected:b,isIndeterminate:a}}function bt(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 pt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let c=0;c<e.length;c++)e[c]!=null&&r.add(e[c]);else for(let c=0;c<e.length;c++)r.delete(e[c]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function o(n,u){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 s=parseInt(u,10);s>0&&n._cache.configure({windowSize:s})}}function p(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>0&&n._cache.configure({pageSize:i})}function v(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.configure({threshold:i})}function A(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:R,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:R,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:P,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:o,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:v,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=ot(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function I(n,u){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(vt(u)).format(n)}catch{return String(n)}}function F(n){let u=n.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const s=getComputedStyle(u).overflowY;if(s==="auto"||s==="scroll")return u;u=u.parentElement}return null}function S(n){this.dom=n,rt(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 u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.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(s){const f=(s.detail&&s.detail.query!=null?s.detail.query:s.detail&&s.detail.term!=null?s.detail.term:"").trim();i.isDataDriven?(i.currentSearch=f,D(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=f.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(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(s){s.preventDefault(),i._onSetSearch(s)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(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(),D(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(s){const f=s.detail||{},d=f.data||[],_=f.total!=null?f.total:d.length;if(!(i._hasInitialSeed&&!i.isLoaded&&d.length===0&&_===0)){if(i._windowed){i._cache.ingest(f)&&!f.provisional&&n.classList.remove("ln-table--loading");return}i._data=d,i._lastTotal=_,i._lastFiltered=f.filtered!=null?f.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(),D(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(s){const f=s.detail&&s.detail.loading;n.classList.toggle("ln-table--loading",!!f),f&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(s){!i._windowed||!i._cache||i._cache.release(s.detail&&s.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(s){!s.detail||s.detail.field==null||(s.preventDefault(),i.currentSort=s.detail.direction==="none"?null:{field:s.detail.field,direction:s.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(s){if(s.target.closest("[data-ln-table-row-select]")||s.target.closest("[data-ln-table-row-action]")||s.target.closest("a")||s.target.closest("button")||s.ctrlKey||s.metaKey||s.button===1)return;const f=s.target.closest("[data-ln-table-row]");if(!f)return;const d=f.getAttribute("data-ln-table-row-id"),_=f._lnRecord||{};D(n,"ln-table:row-click",{table:i.name,id:d,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(s){const f=s.target.closest("[data-ln-table-row-action]");if(!f)return;const d=f.closest("[data-ln-table-row]");if(!d)return;const _=f.getAttribute("data-ln-table-row-action"),w=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(n,"ln-table:row-action",{table:i.name,id:w,action:_,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():D(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(s){if(!s.detail||s.detail.column==null)return;s.preventDefault();const f=s.detail.direction==="none"?null:s.detail.direction;i._sortCol=f===null?-1:s.detail.column,i._sortDir=f,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),D(n,"ln-table:sorted",{column:s.detail.column,direction:s.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(s){if(s.preventDefault(),!s.detail)return;const f=s.detail.key,d=s.detail.values||[];if(f){if(d.length===0)delete i._columnFilters[f];else{const _=[];for(let w=0;w<d.length;w++)_.push(d[w].toLowerCase());i._columnFilters[f]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}S.prototype._parseRows=function(){const n=this.tbody.rows,u=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const s=n[i],f=[],d=[],_=[];for(let g=0;g<s.cells.length;g++){const m=s.cells[g],T=m.textContent.trim();f[g]=G(m),d[g]=T.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||_.push(T.toLowerCase())}let w=null;if(this.isDataDriven){w={};const g=s.getAttribute("data-ln-table-row-id");g!=null&&(w.id=g);for(let m=0;m<u.length;m++){const T=u[m].getAttribute("data-ln-table-col");if(T){const L=m;if(L<s.cells.length){const k=s.cells[L];w[T]=G(k)}}}}this._data.push({values:f,rawTexts:d,html:s.outerHTML,searchText:_.join(" "),id:this.isDataDriven&&w?w.id:void 0,...w})}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(),D(this.dom,"ln-table:ready",{total:this._data.length})},S.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},S.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(u){const i=document.createElement("col");i.style.width=u.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},S.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,u=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||u===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())}},S.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,u=document.createDocumentFragment();for(let i=0;i<n.length;i++){const s=this._buildRow(n[i]);if(!s)break;u.appendChild(s)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const n=[],u=this._filteredData;for(let i=0;i<u.length;i++)n.push(u[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},S.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 s=this._cache?this._cache.peek():null;i=s?this._buildRow(s):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=F(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},S.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)},S.prototype._renderVirtual=function(){const n=this._filteredData,u=n.length,i=this._rowHeight;if(!i||!u)return;const s=this.thead?this.thead.offsetHeight:0,f=this._scrollContainer;let d,_;if(f){const y=this.table.getBoundingClientRect(),C=f.getBoundingClientRect(),x=y.top-C.top+f.scrollTop+s;d=f.scrollTop-x,_=f.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+s;d=window.scrollY-x,_=window.innerHeight}const w=ft(d,_,i,u,15),g=w.start,m=w.end;if(g===this._vStart&&m===this._vEnd)return;this._vStart=g,this._vEnd=m;const T=this.ths.length||1,L=w.topPadding,k=w.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",C.appendChild(x),y.appendChild(C)}for(let C=g;C<m;C++){const x=this._buildRow(n[C]);x&&y.appendChild(x)}if(k>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=k+"px",C.appendChild(x),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";L>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let C=g;C<m;C++)y+=n[C].html;k>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+k+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},S.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",n.appendChild(u),n},S.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 u=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,s=this._scrollContainer;let f,d;if(s){const y=this.table.getBoundingClientRect(),C=s.getBoundingClientRect(),x=y.top-C.top+s.scrollTop+i;f=s.scrollTop-x,d=s.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+i;f=window.scrollY-x,d=window.innerHeight}const _=ft(f,d,n,u,15),w=_.start,g=_.end,m=this.ths.length||1,T=_.topPadding,L=_.bottomPadding,k=document.createDocumentFragment();if(T>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=T+"px",y.appendChild(C),k.appendChild(y)}for(let y=w;y<g;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&k.appendChild(C)}else k.appendChild(this._buildPlaceholderRow());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),k.appendChild(y)}this.tbody.replaceChildren(k),this._vStart=w,this._vEnd=g,this._cache.ensure(w,g)},S.prototype._showEmptyState=function(){const n=this.ths.length||1;let u=null,i=null;if(this.isDataDriven){const s=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&s>0,_=d?this.name+"-empty-filtered":this.name+"-empty";if(i=J(this.dom,_,"ln-table"),!i){const w=this.dom.querySelector("template[data-ln-table-empty]");if(w){const g=d?"search":"initial",m=w.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||w.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")u=i;else{const w=document.createElement("td");w.setAttribute("colspan",String(n)),w.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(w),u=g}}else{const s=this.dom.querySelector("template["+l+"]"),f=document.createElement("td");f.setAttribute("colspan",String(n)),s&&f.appendChild(document.importNode(s.content,!0));const d=document.createElement("tr");d.className="ln-table__empty",d.appendChild(f),u=d}u?this.tbody.replaceChildren(u):this.tbody.replaceChildren(),D(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})},S.prototype._fillRow=function(n,u){W(n,u);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let s=0;s<i.length;s++){const f=i[s],d=f.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<d.length;_++){const w=d[_].trim().split(":");if(w.length!==2)continue;const g=w[0].trim(),m=w[1].trim();u[g]!=null&&f.setAttribute(m,u[g])}}},S.prototype._buildRow=function(n){let u=J(this.dom,this.name+"-row","ln-table");if(!u){const s=this.dom.querySelector("template[data-ln-table-row]");s&&(u=document.importNode(s.content,!0))}let i=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const s=document.createElement("tbody");s.innerHTML=n.html,i=s.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const s=this.ths;for(let f=0;f<s.length;f++){const d=s[f].hasAttribute("data-ln-table-col-select"),_=document.createElement("td");if(d){const w=document.createElement("input");w.type="checkbox",w.setAttribute("data-ln-table-row-select",""),w.setAttribute("aria-label","Select row"),_.appendChild(w)}else{const w=s[f].getAttribute("data-ln-table-col");w&&n[w]!=null&&(_.textContent=String(n[w]))}i.appendChild(_)}}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 s=i.querySelector("[data-ln-table-row-select]");s&&(s.checked=!0)}return i},S.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}wt(this,"ln-table:request-data","table")},S.prototype._enterWindowedMode=function(){const n=this,u=this.dom,i=parseInt(u.getAttribute("data-ln-table-window"),10),s=parseInt(u.getAttribute("data-ln-table-window-page"),10),f=parseInt(u.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(),D(u,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Mt(this._onCacheChange),this._cache=Wt({windowSize:i>0?i:1e3,pageSize:s>0?s:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(d,_,w){D(u,"ln-table:request-data",{table:n.name,sort:d.sort,filters:d.filters,search:d.search,offset:_,limit:w,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},S.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 u=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:u,filtered:u})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},S.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()},S.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let s=0;s<n.length;s++){const f=n[s].getAttribute("data-ln-table-row-id");f!=null&&u.push(f)}const i=Qt(u,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},S.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<n.length;u++){const i=n[u].getAttribute("data-ln-table-row-id"),s=i!=null&&this.selectedIds.has(i);n[u].classList.toggle("ln-row-selected",s);const f=n[u].querySelector("[data-ln-table-row-select]");f&&(f.checked=s)}this._updateSelectAll()},Object.defineProperty(S.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),S.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(u){const i=u.target.closest("[data-ln-table-row-select]");if(!i)return;const s=i.closest("[data-ln-table-row]");if(!s)return;const f=s.getAttribute("data-ln-table-row-id");f!=null&&(n.selectedIds=bt(n.selectedIds,f,i.checked),s.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),D(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 u=document.createElement("input");u.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),s=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";u.setAttribute("aria-label",s),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],s=[];for(let f=0;f<i.length;f++){const d=i[f].getAttribute("data-ln-table-row-id"),_=i[f].querySelector("[data-ln-table-row-select]");d!=null&&(s.push(d),i[f].classList.toggle("ln-row-selected",u),_&&(_.checked=u))}n.selectedIds=pt(n.selectedIds,s,u),n.selectedCount=n.selectedIds.size,D(n.dom,"ln-table:select-all",{table:n.name,selected:u}),D(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 u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){const s=u[i].querySelector("[data-ln-table-row-select]"),f=u[i].getAttribute("data-ln-table-row-id");s&&s.checked&&f!=null&&(n.selectedIds=bt(n.selectedIds,f,!0),u[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},S.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 u=n.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=pt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){u[i].classList.remove("ln-row-selected");const s=u[i].querySelector("[data-ln-table-row-select]");s&&(s.checked=!1)}}this._updateFooter()},S.prototype._updateFooter=function(){let n=0,u=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(n=this._data.length,u=this._filteredData.length);const i=u<n;if(this._totalSpan&&(this._totalSpan.textContent=I(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?I(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const s=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=s>0?I(s,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",s===0)}},S.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])},ut(t,e,S,"ln-table",{attributes:E})})()})();
1
+ (function(){"use strict";function G(){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 N(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 o=null;for(let s=1;s<e.length;s++)if(e[s]&&e[s].nodeType===1){o=e[s];break}if(!N(o))return}t.apply(console,e)}}function D(t,e,l){const o=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,o),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o}))}function _t(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const o={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};o[l]=t.name,D(t.dom,e,o)}function H(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){H(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function K(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()}function gt(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function mt(t,e){const l=!!(e&&e.typed),o=e&&e.exclude,s={},h=t.elements,c={};if(l)for(let f=0;f<h.length;f++){const r=h[f];r.name&&r.type==="checkbox"&&!r.disabled&&(c[r.name]=(c[r.name]||0)+1)}for(let f=0;f<h.length;f++){const r=h[f];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")l&&c[r.name]===1?s[r.name]=r.checked:(s[r.name]||(s[r.name]=[]),r.checked&&s[r.name].push(r.value));else if(r.type==="radio")r.checked&&(s[r.name]=r.value);else if(r.type==="select-multiple"){s[r.name]=[];for(let p=0;p<r.options.length;p++)r.options[p].selected&&s[r.name].push(r.options[p].value)}else if(l&&r.type==="hidden")s[r.name]=r.value;else if(l&&(r.type==="number"||r.type==="range")){const p=Number(r.value);s[r.name]=r.value===""||isNaN(p)?null:p}else s[r.name]=r.value}return s}function yt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function Ct(t,e){const l=t.elements,o=[],s={};for(let h=0;h<l.length;h++){const c=l[h];c.name&&c.type==="checkbox"&&(s[c.name]=(s[c.name]||0)+1)}for(let h=0;h<l.length;h++){const c=l[h];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const f=c.getAttribute("data-ln-fill-as")||c.name;if(!f||!(f in e))continue;const r=e[f];if(c.type==="checkbox"){if(Array.isArray(r))c.checked=r.indexOf(c.value)!==-1;else if(s[c.name]>1){const p=String(r).split(",").map(function(m){return m.trim()});c.checked=p.indexOf(c.value)!==-1}else c.checked=yt(r);o.push(c)}else if(c.type==="radio")c.checked=c.value===String(r),o.push(c);else if(c.type==="select-multiple"){if(Array.isArray(r))for(let p=0;p<c.options.length;p++)c.options[p].selected=r.indexOf(c.options[p].value)!==-1;o.push(c)}else c.value=r,c.tagName==="SELECT"&&r!=null&&c.setAttribute("data-ln-value",r),o.push(c)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ct,window.lnCore.serializeForm=mt,window.lnCore.resolveFormMethod=gt);const Q={};function St(t,e){Q[t]=e}function vt(t){return Q[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=St,window.lnCore.getDataMapper=vt);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 Et(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,H(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Y={};function kt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];Y[l]=e}function xt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return Y[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=kt,window.lnCore.getLocaleFallback=xt,window.lnCore.ensureLocaleObserver=Et);const M={};function J(t,e){M[t]||(M[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=M[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function X(t,e,l){if(t){const o=t.querySelector('[data-ln-template="'+e+'"]');if(o)return o.content.cloneNode(!0)}return J(e,l)}function Z(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let c=0;c<l.length;c++){const f=l[c],r=f.getAttribute("data-ln-field");e[r]!=null&&(f.textContent=e[r])}const o=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<o.length;c++){const f=o[c],r=f.getAttribute("data-ln-attr").split(",");for(let p=0;p<r.length;p++){const m=r[p].trim().split(":");if(m.length!==2)continue;const v=m[0].trim(),E=m[1].trim();e[E]!=null&&f.setAttribute(v,e[E])}}const s=t.querySelectorAll("[data-ln-show]");for(let c=0;c<s.length;c++){const f=s[c],r=f.getAttribute("data-ln-show");r in e&&f.classList.toggle("hidden",!e[r])}const h=t.querySelectorAll("[data-ln-class]");for(let c=0;c<h.length;c++){const f=h[c],r=f.getAttribute("data-ln-class").split(",");for(let p=0;p<r.length;p++){const m=r[p].trim().split(":");if(m.length!==2)continue;const v=m[0].trim(),E=m[1].trim();E in e&&f.classList.toggle(v,!!e[E])}}return t}function Dt(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 o=0;o<l.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[o],e??null),l[o].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)Z(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 W(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const h=l.currentNode;h.textContent.indexOf("{{")!==-1&&(h.textContent=h.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,f){return e[f]!==void 0?e[f]:""}))}const o=function(h,c){return e[c]!==void 0?e[c]:""},s=Array.from(t.querySelectorAll("*"));t.nodeType===1&&s.push(t);for(let h=0;h<s.length;h++){const c=s[h],f=c.attributes;for(let r=0;r<f.length;r++){const p=f[r];p.value.indexOf("{{")!==-1&&c.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return t}function Tt(t,e,l,o,s,h){const c={};for(let r=0;r<t.children.length;r++){const p=t.children[r],m=p.getAttribute("data-ln-render-key");m&&(c[m]=p)}const f=document.createDocumentFragment();for(let r=0;r<e.length;r++){const p=e[r],m=String(o(p));let v=c[m];if(v)s(v,p,r);else{const E=J(l,h);if(!E||(W(E,p),v=E.firstElementChild,!v))continue;v.setAttribute("data-ln-render-key",m),s(v,p,r)}f.appendChild(v)}t.textContent="",t.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=Z,window.lnCore.lnFill=Dt,window.lnCore.renderList=Tt);function F(t,e,l){const o=t.getAttribute(e);return o===null?l:o}function tt(t,e,l){const o=parseInt(t.getAttribute(e),10);return isNaN(o)?l:o}function P(t,e,l=!1){const o=t.getAttribute(e);if(o===null)return!!l;const s=o.trim().toLowerCase();return!(s==="false"||s==="0")}function et(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const V=new Map;function nt(t,e){const l=(t?t.join("|"):"")+"::"+e;if(V.has(l))return V.get(l);const o=new Set(t||[]),s=function(h,c){const f=h.getAttribute(c);return f!==null&&o.has(f)?f:e};return V.set(l,s),s}function it(t,e,l){const o=parseFloat(t.getAttribute(e));return isNaN(o)?l:o}function lt(t,e,l){const o=t.getAttribute(e);if(!o)return l;try{return JSON.parse(o)}catch{return l}}function rt(t,e,l,o,s){if(!t||e===null)return!0;const h=o||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const f=r=>{s?console.warn(r,s):console.warn(r)};if(c==="boolean"){const r=e.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(f(`[${h}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const r=t.values||[];return r.includes(e)?!0:(f(`[${h}] Invalid value "${e}" for attribute "${l}". Allowed: ${r.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return f(`[${h}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const r=parseInt(e,10);return t.min!==void 0&&r<t.min?(f(`[${h}] Value ${r} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&r>t.max?(f(`[${h}] Value ${r} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(f(`[${h}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(r){return f(`[${h}] Invalid JSON for attribute "${l}": ${r.message}. Fallback: ${t.fallback}.`),!1}return!0}function ot(t,e,l){for(const o in l){const[s,h,c]=l[o];Object.defineProperty(t,o,{get:function(){return s(e,h,c)},enumerable:!0,configurable:!0})}return t}function st(t){const e={};for(const l in t){const o=t[l];if(!o||!o.prop)continue;let s=o.read;if(!s&&o.type)switch(o.type){case"enum":s=nt(o.values,o.fallback);break;case"integer":s=tt;break;case"float":s=it;break;case"boolean":s=P;break;case"list":s=et;break;case"json":s=lt;break;case"string":default:s=F;break}s||(s=F),e[o.prop]=[s,l,o.fallback]}return e}function Lt(t){const e={};for(const l in t){const o=t[l];o&&o.effect&&(e[l]=o.effect)}return Object.keys(e).length?e:null}function qt(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}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ot,window.lnCore.attrSpec=st,window.lnCore.attrStr=F,window.lnCore.attrInt=tt,window.lnCore.attrBool=P,window.lnCore.attrList=et,window.lnCore.attrEnum=nt,window.lnCore.attrFloat=it,window.lnCore.attrJson=lt);function O(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(l){console.error("["+e.attribute+"] init failed",t,l)}}}function at(t,e,l,o){if(t.nodeType!==1)return;const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c={selector:e,attribute:l,ComponentFn:o};if(t.matches&&t.matches(h)&&O(t,c),t.querySelectorAll){const f=t.querySelectorAll(h);for(let r=0;r<f.length;r++)O(f[r],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function It(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Rt(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 ct(){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 Ft(t){const e=ct(),l=t.observed||[];for(let o=0;o<l.length;o++){const s=l[o];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 o in t.attributes){e.byDeclaredAttr.has(o)||e.byDeclaredAttr.set(o,[]);const s=e.byDeclaredAttr.get(o);s.some(h=>h.componentTag===t.componentTag)||s.push({spec:t.attributes[o],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const o=qt(t);if(o===null)e.reactiveWildcard.push(t);else for(const s of o)e.byReactive.has(s)||e.byReactive.set(s,[]),e.byReactive.get(s).push(t)}t.persist&&e.persist.push(t)}function dt(t,e,l,o){for(let s=0;s<t.length;s++){const h=t[s];if(!e[h.attribute])continue;const c=h.effects&&h.effects[l];c?c(e,l,o):h.onAttrChange&&(!h.declared||h.declared.has(l))&&h.onAttrChange(e,l,o)}}function Ot(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,o=ct(),s=o.byAttr.get(e),h=G()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(e);if(!l&&!s&&!h)return;const c=t.target;if(t.oldValue!==c.getAttribute(e)){if(h&&N(c)){const f=o.byDeclaredAttr.get(e),r=c.getAttribute(e);for(let p=0;p<f.length;p++)rt(f[p].spec,r,e,f[p].componentTag,c)}if(window.lnCore._debugSink&&(l||s)&&window.lnCore._debugSink("attr",e,c,{oldValue:t.oldValue,newValue:c.getAttribute(e)}),l){const f=o.byReactive.get(e);f&&dt(f,c,e,t.oldValue),o.reactiveWildcard.length&&dt(o.reactiveWildcard,c,e,t.oldValue)}if(s)for(let f=0;f<s.length;f++){const r=s[f];if(r.handler){r.handler(c,e,t.oldValue);continue}r.onAttributeChange&&c[r.attribute]?r.onAttributeChange(c,e):(at(c,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(c))}}}function Ht(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Ot(e[l])}catch(o){console.error("[ln-core] mutation handler failed",e[l].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function $(t,e){if(!document.contains(t))if(e.attribute){const l=t[e.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(o){console.error("["+e.attribute+"] destroy failed",t,o)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Nt(t){const e=B();if(!e.length)return;const l=t.target;if(l){const s=l.nodeType===1?l:l.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=z();if(t.target&&o.length)for(let s=0;s<o.length;s++){const h=o[s],c=h.query,f=t.target.nodeType===1?t.target.matches&&t.target.matches(c)?t.target:t.target.closest?t.target.closest(c):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(c):null;f&&h.onSubtreeChange(f,t)}for(let s=0;s<t.addedNodes.length;s++){const h=t.addedNodes[s];if(h.nodeType===1){const c=!!(h.firstElementChild||h.children&&h.children.length);for(let f=0;f<e.length;f++){const r=e[f];if(r.selector&&r.attribute&&r.ComponentFn){if(!c)h.matches&&h.matches(r.query)&&O(h,r);else if(h.matches&&h.matches(r.query)&&O(h,r),h.querySelectorAll){const p=h.querySelectorAll(r.query);for(let m=0;m<p.length;m++)O(p[m],r)}}r.onInit&&r.onInit(h)}}}for(let s=0;s<t.removedNodes.length;s++){const h=t.removedNodes[s];if(h.nodeType===1){const c=!!(h.firstElementChild||h.children&&h.children.length);for(let f=0;f<e.length;f++){const r=e[f],p=r.query;if(p){if(!c)h.matches&&h.matches(p)&&$(h,r);else if(h.matches&&h.matches(p)&&$(h,r),h.querySelectorAll){const m=h.querySelectorAll(p);for(let v=0;v<m.length;v++)$(m[v],r)}}}}}}function ut(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const o=e[l];if(o.type==="childList")try{Nt(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Mt(t){B().push(t),t.onSubtreeChange&&t.query&&z().push(t),ut()}function ht(t,e,l,o,s={}){const h=s.extraAttributes||[],c=s.onAttributeChange||null,f=s.onSubtreeChange||null,r=s.onInit||null,p=s.onAttrChange||null,m=s.effects||null,v=s.attributes||null,E=v?Lt(v):m,q=v?new Set(Object.keys(v)):null,I=s.persist||null;function R(b){const d=b||document.body;if(at(d,t,e,l),v&&G())for(const w in v){const _=v[w],g=Array.from(d.querySelectorAll("["+w+"]"));d.matches&&d.matches("["+w+"]")&&g.push(d);for(let y=0;y<g.length;y++){const T=g[y];N(T)&&rt(_,T.getAttribute(w),w,o,T)}}r&&r(d)}const A=[];if(t.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let d;for(;(d=b.exec(t))!==null;)A.push(d[1])}else A.push(t);Ft({selector:t,attribute:e,componentTag:o,attributes:v,ComponentFn:l,onInit:r,observed:A.concat(h),onAttributeChange:c,onAttrChange:p,effects:E,declared:q,persist:I}),Ht();const n=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,u=s.subtreeQuery||(n?t:"["+t+"]"),i={selector:t,attribute:e,ComponentFn:l,onInit:r,onSubtreeChange:f,query:u};B().push(i),f&&u&&z().push(i),ut(),window[e]=R,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ht,window.lnCore.observeLifecycle=Mt);function a(){It()>0?Rt(function(){R(document.body)}):R(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a(),R}function Wt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Pt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,o=t.threshold!=null?t.threshold:25,s=t.fetchDebounce!=null?t.fetchDebounce:120;const h=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},f=new Map,r=new Map,p=new Set;let m=0,v=0,E=0,q={sort:null,filters:{},search:""},I=null,R=0,A=0,n=!1;function u(d){r.set(d,++R)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function a(){if(f.size<=e)return;const d=Array.from(f.keys()).sort(function(_,g){return(r.get(_)||0)-(r.get(g)||0)});let w=0;for(;f.size>e&&w<d.length;)f.delete(d[w]),r.delete(d[w]),w++}function b(d,w){p.add(d),h(q,d,w)}return{get:function(d){return f.get(d)},has:function(d){return f.has(d)},peek:function(){return f.size?f.values().next().value:void 0},get logicalTotal(){return m},get grandTotal(){return v},get queryGen(){return E},get size(){return f.size},ensure:function(d,w){clearTimeout(I),A=d;for(let k=d;k<w;k++)f.has(k)&&u(k);if(m<=0)return;const _=Math.max(0,d-o),g=Math.min(m,w+o),y=Math.floor(_/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let k=y;k<=T;k++){const C=k*l,S=Math.min(l,m-C);let x=!1;const Jt=Math.max(C,_),Xt=Math.min(C+S,g);for(let U=Jt;U<Xt;U++)if(!f.has(U)){x=!0;break}if(x&&!p.has(C)){L=C;break}}L!==-1&&(I=setTimeout(function(){b(L,l)},s))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const w=d.offset||0,_=d.data||[];let g=0;for(let y=0;y<_.length;y++)_[y]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return p.delete(w),!1;n&&(f.clear(),r.clear(),n=!1),d.provisional||(v=d.total!=null?d.total:v,m=d.filtered!=null?d.filtered:d.data?d.data.length:m);for(let y=0;y<_.length;y++)_[y]!=null&&(f.set(w+y,_[y]),u(w+y));return p.delete(w),a(),c(),!0},requestInitial:function(d){d&&(q=d),b(0,l)},invalidate:function(d){E++,p.clear(),clearTimeout(I),d&&(q=d),n=!0,b(0,l)},revalidate:function(){E++,p.clear(),clearTimeout(I),n=!0;const d=Math.max(0,Math.floor(A/l)*l);b(d,l)},release:function(d){p.delete(d)},destroy:function(){clearTimeout(I),f.clear(),r.clear(),p.clear()},configure:function(d){d=d||{};let w=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==e){const _=d.windowSize<e;e=d.windowSize,_&&a(),w=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(o=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(s=d.fetchDebounce),w&&c()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(v=d,i()||(m=d),c())}}}function ft(t){return(t||"").replace(/^#/,"")}function j(t){const e=t===void 0?location.hash:t,l={},o=ft(e);if(!o)return l;const s=o.split("&");for(let h=0;h<s.length;h++){const c=s[h];if(!c)continue;const f=c.indexOf(":"),r=f>-1?c.slice(0,f):c,p=f>-1?c.slice(f+1):"";if(r)try{l[r]=decodeURIComponent(p)}catch{l[r]=p}}return l}function Vt(t){if(!t)return null;const e=j();return t in e?e[t]:null}function Bt(t,e){if(!t)return;const l=j();e==null?delete l[t]:l[t]=String(e);const s=Object.keys(l).map(function(h){const c=l[h];return c===""?h:h+":"+encodeURIComponent(c)}).join("&");ft(location.hash)!==s&&(location.hash=s)}function zt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function $t(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 o=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return o?e?o+"-"+e:o:e||null}function jt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Ut(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 Gt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Kt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),o=t.slice(e+1),s=o?o.split(",").map(function(h){try{return decodeURIComponent(h)}catch{return h}}).filter(Boolean):[];return{key:l,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=j,window.lnCore.hashGet=Vt,window.lnCore.hashSet=Bt,window.lnCore.hashLinkClick=zt,window.lnCore.resolveHashNamespace=$t,window.lnCore.hashSortEncode=jt,window.lnCore.hashSortDecode=Ut,window.lnCore.hashFilterEncode=Gt,window.lnCore.hashFilterDecode=Kt);function Qt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Qt);function bt(t,e,l,o,s=15){if(o<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const h=Math.max(0,t||0),c=Math.max(0,e||0),f=Math.floor(h/l),r=Math.ceil(c/l),p=Math.max(0,f-s),m=Math.min(o,f+r+s),v=p*l,E=Math.max(0,(o-m)*l);return{start:p,end:m,topPadding:v,bottomPadding:E}}function Yt(t,e){const l=Array.isArray(t)?t.length:0,o=e instanceof Set?e:new Set(e||[]);let s=0;if(Array.isArray(t))for(let f=0;f<t.length;f++)o.has(t[f])&&s++;else s=o.size;const h=l>0&&s===l,c=s>0&&s<l;return{totalCount:l,selectedCount:s,isAllSelected:h,isIndeterminate:c}}function pt(t,e,l){const o=new Set(t);return e==null||((l!==void 0?l:!o.has(e))?o.add(e):o.delete(e)),o}function wt(t,e,l){const o=new Set(t);if(!Array.isArray(e))return o;if(l)for(let s=0;s<e.length;s++)e[s]!=null&&o.add(e[s]);else for(let s=0;s<e.length;s++)o.delete(e[s]);return o}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function r(n,u){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 a=parseInt(u,10);a>0&&n._cache.configure({windowSize:a})}}function p(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>0&&n._cache.configure({pageSize:i})}function m(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.configure({threshold:i})}function v(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:F,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:F,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:P,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:r,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:m,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:v,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=st(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function I(n,u){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(At(u)).format(n)}catch{return String(n)}}function R(n){let u=n.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const a=getComputedStyle(u).overflowY;if(a==="auto"||a==="scroll")return u;u=u.parentElement}return null}function A(n){this.dom=n,ot(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 u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.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(a){const b=(a.detail&&a.detail.query!=null?a.detail.query:a.detail&&a.detail.term!=null?a.detail.term:"").trim();i.isDataDriven?(i.currentSearch=b,D(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=b.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(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(a){a.preventDefault(),i._onSetSearch(a)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(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(),D(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(a){const b=a.detail||{},d=b.data||[],w=b.total!=null?b.total:d.length;if(!(i._hasInitialSeed&&!i.isLoaded&&d.length===0&&w===0)){if(i._windowed){i._cache.ingest(b)&&!b.provisional&&n.classList.remove("ln-table--loading");return}i._data=d,i._lastTotal=w,i._lastFiltered=b.filtered!=null?b.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(),D(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(a){const b=a.detail&&a.detail.loading;n.classList.toggle("ln-table--loading",!!b),b&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(a){!i._windowed||!i._cache||i._cache.release(a.detail&&a.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(a){!a.detail||a.detail.field==null||(a.preventDefault(),i.currentSort=a.detail.direction==="none"?null:{field:a.detail.field,direction:a.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(a){if(a.target.closest("[data-ln-table-row-select]")||a.target.closest("[data-ln-table-row-action]")||a.target.closest("a")||a.target.closest("button")||a.ctrlKey||a.metaKey||a.button===1)return;const b=a.target.closest("[data-ln-table-row]");if(!b)return;const d=b.getAttribute("data-ln-table-row-id"),w=b._lnRecord||{};D(n,"ln-table:row-click",{table:i.name,id:d,record:w})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(a){const b=a.target.closest("[data-ln-table-row-action]");if(!b)return;const d=b.closest("[data-ln-table-row]");if(!d)return;const w=b.getAttribute("data-ln-table-row-action"),_=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(n,"ln-table:row-action",{table:i.name,id:_,action:w,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():D(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(a){if(!a.detail||a.detail.column==null)return;a.preventDefault();const b=a.detail.direction==="none"?null:a.detail.direction;i._sortCol=b===null?-1:a.detail.column,i._sortDir=b,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),D(n,"ln-table:sorted",{column:a.detail.column,direction:a.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(a){if(a.preventDefault(),!a.detail)return;const b=a.detail.key,d=a.detail.values||[];if(b){if(d.length===0)delete i._columnFilters[b];else{const w=[];for(let _=0;_<d.length;_++)w.push(d[_].toLowerCase());i._columnFilters[b]=w}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}A.prototype._parseRows=function(){const n=this.tbody.rows,u=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const a=n[i],b=[],d=[],w=[];for(let g=0;g<a.cells.length;g++){const y=a.cells[g],T=y.textContent.trim();b[g]=K(y),d[g]=T.toLowerCase(),y.querySelector("[data-ln-table-row-action]")||w.push(T.toLowerCase())}let _=null;if(this.isDataDriven){_={};const g=a.getAttribute("data-ln-table-row-id");g!=null&&(_.id=g);for(let y=0;y<u.length;y++){const T=u[y].getAttribute("data-ln-table-col");if(T){const L=y;if(L<a.cells.length){const k=a.cells[L];_[T]=K(k)}}}}this._data.push({values:b,rawTexts:d,html:a.outerHTML,searchText:w.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(),D(this.dom,"ln-table:ready",{total:this._data.length})},A.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},A.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(u){const i=document.createElement("col");i.style.width=u.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},A.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,u=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||u===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())}},A.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,u=document.createDocumentFragment();for(let i=0;i<n.length;i++){const a=this._buildRow(n[i]);if(!a)break;u.appendChild(a)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const n=[],u=this._filteredData;for(let i=0;i<u.length;i++)n.push(u[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},A.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 a=this._cache?this._cache.peek():null;i=a?this._buildRow(a):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=R(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},A.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)},A.prototype._renderVirtual=function(){const n=this._filteredData,u=n.length,i=this._rowHeight;if(!i||!u)return;const a=this.thead?this.thead.offsetHeight:0,b=this._scrollContainer;let d,w;if(b){const C=this.table.getBoundingClientRect(),S=b.getBoundingClientRect(),x=C.top-S.top+b.scrollTop+a;d=b.scrollTop-x,w=b.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+a;d=window.scrollY-x,w=window.innerHeight}const _=bt(d,w,i,u,15),g=_.start,y=_.end;if(g===this._vStart&&y===this._vEnd)return;this._vStart=g,this._vEnd=y;const T=this.ths.length||1,L=_.topPadding,k=_.bottomPadding;if(this.isDataDriven){const C=document.createDocumentFragment();if(L>0){const S=document.createElement("tr");S.className="ln-table__spacer",S.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",S.appendChild(x),C.appendChild(S)}for(let S=g;S<y;S++){const x=this._buildRow(n[S]);x&&C.appendChild(x)}if(k>0){const S=document.createElement("tr");S.className="ln-table__spacer",S.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=k+"px",S.appendChild(x),C.appendChild(S)}this.tbody.replaceChildren(C),this._selectable&&this._updateSelectAll()}else{let C="";L>0&&(C+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let S=g;S<y;S++)C+=n[S].html;k>0&&(C+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+k+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=C,this._selectable&&this._restoreSelection()}},A.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",n.appendChild(u),n},A.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 u=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,a=this._scrollContainer;let b,d;if(a){const C=this.table.getBoundingClientRect(),S=a.getBoundingClientRect(),x=C.top-S.top+a.scrollTop+i;b=a.scrollTop-x,d=a.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+i;b=window.scrollY-x,d=window.innerHeight}const w=bt(b,d,n,u,15),_=w.start,g=w.end,y=this.ths.length||1,T=w.topPadding,L=w.bottomPadding,k=document.createDocumentFragment();if(T>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const S=document.createElement("td");S.setAttribute("colspan",y),S.style.height=T+"px",C.appendChild(S),k.appendChild(C)}for(let C=_;C<g;C++)if(this._cache.has(C)){const S=this._buildRow(this._cache.get(C));S&&k.appendChild(S)}else k.appendChild(this._buildPlaceholderRow());if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const S=document.createElement("td");S.setAttribute("colspan",y),S.style.height=L+"px",C.appendChild(S),k.appendChild(C)}this.tbody.replaceChildren(k),this._vStart=_,this._vEnd=g,this._cache.ensure(_,g)},A.prototype._showEmptyState=function(){const n=this.ths.length||1;let u=null,i=null;if(this.isDataDriven){const a=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&a>0,w=d?this.name+"-empty-filtered":this.name+"-empty";if(i=X(this.dom,w,"ln-table"),!i){const _=this.dom.querySelector("template[data-ln-table-empty]");if(_){const g=d?"search":"initial",y=_.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||_.content.firstElementChild;y&&(i=document.importNode(y,!0))}}if(i)if(i.tagName==="TR")u=i;else{const _=document.createElement("td");_.setAttribute("colspan",String(n)),_.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(_),u=g}}else{const a=this.dom.querySelector("template["+l+"]"),b=document.createElement("td");b.setAttribute("colspan",String(n)),a&&b.appendChild(document.importNode(a.content,!0));const d=document.createElement("tr");d.className="ln-table__empty",d.appendChild(b),u=d}u?this.tbody.replaceChildren(u):this.tbody.replaceChildren(),D(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})},A.prototype._fillRow=function(n,u){W(n,u);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let a=0;a<i.length;a++){const b=i[a],d=b.getAttribute("data-ln-table-cell-attr").split(",");for(let w=0;w<d.length;w++){const _=d[w].trim().split(":");if(_.length!==2)continue;const g=_[0].trim(),y=_[1].trim();u[g]!=null&&b.setAttribute(y,u[g])}}},A.prototype._buildRow=function(n){let u=X(this.dom,this.name+"-row","ln-table");if(!u){const a=this.dom.querySelector("template[data-ln-table-row]");a&&(u=document.importNode(a.content,!0))}let i=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const a=document.createElement("tbody");a.innerHTML=n.html,i=a.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const a=this.ths;for(let b=0;b<a.length;b++){const d=a[b].hasAttribute("data-ln-table-col-select"),w=document.createElement("td");if(d){const _=document.createElement("input");_.type="checkbox",_.setAttribute("data-ln-table-row-select",""),_.setAttribute("aria-label","Select row"),w.appendChild(_)}else{const _=a[b].getAttribute("data-ln-table-col");_&&n[_]!=null&&(w.textContent=String(n[_]))}i.appendChild(w)}}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 a=i.querySelector("[data-ln-table-row-select]");a&&(a.checked=!0)}return i},A.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}_t(this,"ln-table:request-data","table")},A.prototype._enterWindowedMode=function(){const n=this,u=this.dom,i=parseInt(u.getAttribute("data-ln-table-window"),10),a=parseInt(u.getAttribute("data-ln-table-window-page"),10),b=parseInt(u.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(),D(u,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Wt(this._onCacheChange),this._cache=Pt({windowSize:i>0?i:1e3,pageSize:a>0?a:200,threshold:b>=0?b:25,fetchDebounce:120,requestPage:function(d,w,_){D(u,"ln-table:request-data",{table:n.name,sort:d.sort,filters:d.filters,search:d.search,offset:w,limit:_,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},A.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 u=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:u,filtered:u})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},A.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()},A.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let a=0;a<n.length;a++){const b=n[a].getAttribute("data-ln-table-row-id");b!=null&&u.push(b)}const i=Yt(u,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},A.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<n.length;u++){const i=n[u].getAttribute("data-ln-table-row-id"),a=i!=null&&this.selectedIds.has(i);n[u].classList.toggle("ln-row-selected",a);const b=n[u].querySelector("[data-ln-table-row-select]");b&&(b.checked=a)}this._updateSelectAll()},Object.defineProperty(A.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),A.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(u){const i=u.target.closest("[data-ln-table-row-select]");if(!i)return;const a=i.closest("[data-ln-table-row]");if(!a)return;const b=a.getAttribute("data-ln-table-row-id");b!=null&&(n.selectedIds=pt(n.selectedIds,b,i.checked),a.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),D(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 u=document.createElement("input");u.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),a=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";u.setAttribute("aria-label",a),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],a=[];for(let b=0;b<i.length;b++){const d=i[b].getAttribute("data-ln-table-row-id"),w=i[b].querySelector("[data-ln-table-row-select]");d!=null&&(a.push(d),i[b].classList.toggle("ln-row-selected",u),w&&(w.checked=u))}n.selectedIds=wt(n.selectedIds,a,u),n.selectedCount=n.selectedIds.size,D(n.dom,"ln-table:select-all",{table:n.name,selected:u}),D(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 u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){const a=u[i].querySelector("[data-ln-table-row-select]"),b=u[i].getAttribute("data-ln-table-row-id");a&&a.checked&&b!=null&&(n.selectedIds=pt(n.selectedIds,b,!0),u[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},A.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 u=n.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=wt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){u[i].classList.remove("ln-row-selected");const a=u[i].querySelector("[data-ln-table-row-select]");a&&(a.checked=!1)}}this._updateFooter()},A.prototype._updateFooter=function(){let n=0,u=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(n=this._data.length,u=this._filteredData.length);const i=u<n;if(this._totalSpan&&(this._totalSpan.textContent=I(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?I(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const a=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=a>0?I(a,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",a===0)}},A.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])},ht(t,e,A,"ln-table",{attributes:E})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function F(){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 k(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 l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!k(r))return}e.apply(console,t)}}function $(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,i={};if(o)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")o&&i[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")l[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function re(e,t){const o=e.elements,r=[],l={};for(let s=0;s<o.length;s++){const i=o[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<o.length;s++){const i=o[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 n=t[a];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=ne(n);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=re,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const B={};function oe(e,t){B[e]=t}function ie(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){$(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function ae(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];R[o]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=le);const _={};function ce(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=_[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const a=o[i],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const u=n[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 l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const u=n[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 ue(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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[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)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function j(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.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]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],a=i.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function de(e,t,o,r,l,s){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(i[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(r(c));let d=i[u];if(d)l(d,c,n);else{const f=ce(o,s);if(!f||(j(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,n)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=ue,window.lnCore.renderList=de);function E(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function W(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function U(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const q=new Map;function H(e,t){const o=(e?e.join("|"):"")+"::"+t;if(q.has(o))return q.get(o);const r=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return q.set(o,l),l}function K(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function P(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function Q(e,t,o,r,l){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=n=>{l?console.warn(n,l):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function fe(e,t,o){for(const r in o){const[l,s,i]=o[r];Object.defineProperty(e,r,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function we(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=H(r.values,r.fallback);break;case"integer":l=W;break;case"float":l=K;break;case"boolean":l=U;break;case"list":l=V;break;case"json":l=P;break;case"string":default:l=E;break}l||(l=E),t[r.prop]=[l,o,r.fallback]}return t}function he(e){const t={};for(const o in e){const r=e[o];r&&r.effect&&(t[o]=r.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=fe,window.lnCore.attrSpec=we,window.lnCore.attrStr=E,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=K,window.lnCore.attrJson=P);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function J(e,t,o,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(s)&&A(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)A(a[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(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 X(){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 me(e){const t=X(),o=e.observed||[];for(let r=0;r<o.length;r++){const l=o[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).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 l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=be(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function z(e,t,o,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[o];i?i(t,o,r):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,r)}}function ye(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=X(),l=r.byAttr.get(t),s=F()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&k(i)){const a=r.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let c=0;c<a.length;c++)Q(a[c].spec,n,t,a[c].componentTag,i)}if(window.lnCore._debugSink&&(o||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const a=r.byReactive.get(t);a&&z(a,i,t,e.oldValue),r.reactiveWildcard.length&&z(r.reactiveWildcard,i,t,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const n=l[a];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(J(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{ye(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function L(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ae(e){const t=L();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const l=r.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&r.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)r.matches&&r.matches(i.query)&&A(r,i);else if(r.matches&&r.matches(i.query)&&A(r,i),r.querySelectorAll){const a=r.querySelectorAll(i.query);for(let n=0;n<a.length;n++)A(a[n],i)}}i.onInit&&i.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const i=t[s],a=i.query;if(a){if(!l)r.matches&&r.matches(a)&&O(r,i);else if(r.matches&&r.matches(a)&&O(r,i),r.querySelectorAll){const n=r.querySelectorAll(a);for(let c=0;c<n.length;c++)O(n[c],i)}}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{Ae(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ve(e){L().push(e),G()}function Y(e,t,o,r,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,a=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?he(d):u,m=d?new Set(Object.keys(d)):null,b=l.persist||null;function w(v){const g=v||document.body;if(J(g,e,t,o),d&&F())for(const S in d){const Ie=d[S],I=Array.from(g.querySelectorAll("["+S+"]"));g.matches&&g.matches("["+S+"]")&&I.push(g);for(let D=0;D<I.length;D++){const N=I[D];k(N)&&Q(Ie,N.getAttribute(S),S,r,N)}}n&&n(g)}const y=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let g;for(;(g=v.exec(e))!==null;)y.push(g[1])}else y.push(e);me({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:o,onInit:n,observed:y.concat(s),onAttributeChange:i,onAttrChange:c,effects:f,declared:m,persist:b}),Ce();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,h=l.subtreeQuery||(C?e:"["+e+"]");L().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:h}),G(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=ve);function p(){pe()>0?ge(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),w}function Z(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,o={},r=Z(t);if(!r)return o;const l=r.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),n=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function Se(e){if(!e)return null;const t=T();return e in t?t[e]:null}function xe(e,t){if(!e)return;const o=T();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(s){const i=o[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Z(location.hash)!==l&&(location.hash=l)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.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 Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(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 Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Se,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function Te(){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=Te),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const o={"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 n=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!n)return;const c=n.tagName==="INPUT"||n.tagName==="TEXTAREA"?n:n.querySelector('input[type="search"], input[type="text"], input');c&&(a.preventDefault(),c.focus())});function r(a){return this.dom=a,i(this),this}function l(a,n){const c=n?'[data-ln-search-for="'+n+'"]':"[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 s(a,n){if(n){const u=a.querySelectorAll('[data-ln-filter="'+n+'"]');if(u.length>0)return u;const d=document.querySelectorAll('[data-ln-filter="'+n+'"]');if(d.length>0)return d}const c=a.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function i(a){const n=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 m=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return n.querySelector('[data-ln-table-source="'+m+'"]')||n.querySelector('[data-ln-table="'+m+'"]')||(n.id===f?n: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,m=u.detail.values||[],b=d.querySelectorAll("th");for(let w=0;w<b.length;w++)if((b[w].getAttribute("data-ln-table-filter-col")||b[w].getAttribute("data-ln-filter-col")||b[w].getAttribute("data-ln-filter-key")||b[w].getAttribute("data-ln-field"))===f){const C=b[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")||n.querySelector("[data-ln-table], table");if(!f)return;const m=f.lnTable&&f.lnTable.name||f.id,b=f.querySelectorAll("th");for(let h=0;h<b.length;h++){const p=b[h].querySelector("[data-ln-table-col-filter], .table-filter");p&&p.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 h=l(n,w);h&&h.value!==""&&(h.value="",h.dispatchEvent(new Event("input",{bubbles:!0})))}const C=s(n,w);for(let h=0;h<C.length;h++){const p=C[h].querySelector("[data-ln-filter-reset]");if(!p)continue;const v=C[h].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!p.checked||v)&&(p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&$(f,"ln-table:request-clear-filters",{table:m})}},n.addEventListener("ln-filter:change",a._handlers.filter),n.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])},Y(e,t,r,"ln-table-coordinator",{attributes:o})})()})();
1
+ (function(){"use strict";function R(){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 i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!_(i))return}e.apply(console,t)}}function B(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}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()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,o={};if(r)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const r=e.elements,i=[],l={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const a=o.getAttribute("data-ln-fill-as")||o.name;if(!a||!(a in t))continue;const n=t[a];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=oe(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const M={};function le(e,t){M[e]=t}function se(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){B(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function ce(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];j[r]=t}function ue(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=ce,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ae);const k={};function de(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=k[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const a=r[o],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const a=i[o],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const u=n[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 l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const a=l[o],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const a=s[o],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const u=n[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 fe(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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].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)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function U(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,a){return t[a]!==void 0?t[a]:""}))}const i=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],a=o.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function we(e,t,r,i,l,s){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(o[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(i(c));let d=o[u];if(d)l(d,c,n);else{const f=de(r,s);if(!f||(U(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,n)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=W,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function E(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function V(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function H(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const q=new Map;function P(e,t){const r=(e?e.join("|"):"")+"::"+t;if(q.has(r))return q.get(r);const i=new Set(e||[]),l=function(s,o){const a=s.getAttribute(o);return a!==null&&i.has(a)?a:t};return q.set(r,l),l}function Q(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function J(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function X(e,t,r,i,l){if(!e||t===null)return!0;const s=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const a=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function he(e,t,r){for(const i in r){const[l,s,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=P(i.values,i.fallback);break;case"integer":l=V;break;case"float":l=Q;break;case"boolean":l=H;break;case"list":l=K;break;case"json":l=J;break;case"string":default:l=E;break}l||(l=E),t[i.prop]=[l,r,i.fallback]}return t}function pe(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function ge(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=he,window.lnCore.attrSpec=be,window.lnCore.attrStr=E,window.lnCore.attrInt=V,window.lnCore.attrBool=H,window.lnCore.attrList=K,window.lnCore.attrEnum=P,window.lnCore.attrFloat=Q,window.lnCore.attrJson=J);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function z(e,t,r,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(s)&&A(e,o),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)A(a[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(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 G(){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 Ce(e){const t=G(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ge(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,r,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,i):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,i)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=G(),l=i.byAttr.get(t),s=R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&_(o)){const a=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let c=0;c<a.length;c++)X(a[c].spec,n,t,a[c].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const a=i.byReactive.get(t);a&&Y(a,o,t,e.oldValue),i.reactiveWildcard.length&&Y(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const n=l[a];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(z(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function L(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function T(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Se(e){const t=L();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=T();if(e.target&&i.length)for(let l=0;l<i.length;l++){const s=i[l],o=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;a&&s.onSubtreeChange(a,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)s.matches&&s.matches(n.query)&&A(s,n);else if(s.matches&&s.matches(n.query)&&A(s,n),s.querySelectorAll){const c=s.querySelectorAll(n.query);for(let u=0;u<c.length;u++)A(c[u],n)}}n.onInit&&n.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c){if(!o)s.matches&&s.matches(c)&&O(s,n);else if(s.matches&&s.matches(c)&&O(s,n),s.querySelectorAll){const u=s.querySelectorAll(c);for(let d=0;d<u.length;d++)O(u[d],n)}}}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{Se(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){L().push(e),e.onSubtreeChange&&e.query&&T().push(e),Z()}function ee(e,t,r,i,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,a=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?pe(d):u,m=d?new Set(Object.keys(d)):null,b=l.persist||null;function w(D){const g=D||document.body;if(z(g,e,t,r),d&&R())for(const v in d){const Ne=d[v],N=Array.from(g.querySelectorAll("["+v+"]"));g.matches&&g.matches("["+v+"]")&&N.push(g);for(let F=0;F<N.length;F++){const $=N[F];_($)&&X(Ne,$.getAttribute(v),v,i,$)}}n&&n(g)}const y=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let g;for(;(g=D.exec(e))!==null;)y.push(g[1])}else y.push(e);Ce({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:r,onInit:n,observed:y.concat(s),onAttributeChange:o,onAttrChange:c,effects:f,declared:m,persist:b}),ve();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,h=l.subtreeQuery||(C?e:"["+e+"]"),p={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:h};L().push(p),a&&h&&T().push(p),Z(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=xe);function x(){me()>0?ye(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),w}function te(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,r={},i=te(t);if(!i)return r;const l=i.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const a=o.indexOf(":"),n=a>-1?o.slice(0,a):o,c=a>-1?o.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function _e(e){if(!e)return null;const t=I();return e in t?t[e]:null}function ke(e,t){if(!e)return;const r=I();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");te(location.hash)!==l&&(location.hash=l)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function qe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Te(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 Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=_e,window.lnCore.hashSet=ke,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=qe,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Ie);function De(){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=De),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const r={"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 n=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!n)return;const c=n.tagName==="INPUT"||n.tagName==="TEXTAREA"?n:n.querySelector('input[type="search"], input[type="text"], input');c&&(a.preventDefault(),c.focus())});function i(a){return this.dom=a,o(this),this}function l(a,n){const c=n?'[data-ln-search-for="'+n+'"]':"[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 s(a,n){if(n){const u=a.querySelectorAll('[data-ln-filter="'+n+'"]');if(u.length>0)return u;const d=document.querySelectorAll('[data-ln-filter="'+n+'"]');if(d.length>0)return d}const c=a.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function o(a){const n=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 m=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return n.querySelector('[data-ln-table-source="'+m+'"]')||n.querySelector('[data-ln-table="'+m+'"]')||(n.id===f?n: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,m=u.detail.values||[],b=d.querySelectorAll("th");for(let w=0;w<b.length;w++)if((b[w].getAttribute("data-ln-table-filter-col")||b[w].getAttribute("data-ln-filter-col")||b[w].getAttribute("data-ln-filter-key")||b[w].getAttribute("data-ln-field"))===f){const C=b[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")||n.querySelector("[data-ln-table], table");if(!f)return;const m=f.lnTable&&f.lnTable.name||f.id,b=f.querySelectorAll("th");for(let h=0;h<b.length;h++){const p=b[h].querySelector("[data-ln-table-col-filter], .table-filter");p&&p.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 h=l(n,w);h&&h.value!==""&&(h.value="",h.dispatchEvent(new Event("input",{bubbles:!0})))}const C=s(n,w);for(let h=0;h<C.length;h++){const p=C[h].querySelector("[data-ln-filter-reset]");if(!p)continue;const x=C[h].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!p.checked||x)&&(p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&B(f,"ln-table:request-clear-filters",{table:m})}},n.addEventListener("ln-filter:change",a._handlers.filter),n.addEventListener("click",a._handlers.clear)}i.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])},ee(e,t,i,"ln-table-coordinator",{attributes:r})})()})();