@livenetworks/ashlar 2.0.8 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-api-connector/ln-api-connector.js +1 -1
  4. package/components/ln-api-connector/ln-api-connector.schema.json +105 -96
  5. package/components/ln-api-connector/src/ln-api-connector.js +1 -0
  6. package/components/ln-api-queue/ln-api-queue.js +1 -1
  7. package/components/ln-autoresize/ln-autoresize.js +1 -1
  8. package/components/ln-autosave/ln-autosave.js +1 -1
  9. package/components/ln-chart/ln-chart.js +1 -1
  10. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  11. package/components/ln-confirm/ln-confirm.js +1 -1
  12. package/components/ln-core/attrs.js +13 -0
  13. package/components/ln-core/form.js +10 -0
  14. package/components/ln-core/lifecycle.js +6 -1
  15. package/components/ln-core/ln-core.schema.json +110 -109
  16. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  17. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  18. package/components/ln-data-coordinator/src/ln-data-coordinator.js +7 -3
  19. package/components/ln-data-store/ln-data-store.js +1 -1
  20. package/components/ln-date/ln-date.js +1 -1
  21. package/components/ln-debug/ln-debug.js +1 -1
  22. package/components/ln-debug/src/generated-attributes.js +3 -0
  23. package/components/ln-dropdown/ln-dropdown.js +1 -1
  24. package/components/ln-editor/ln-editor.js +1 -1
  25. package/components/ln-external-links/ln-external-links.js +1 -1
  26. package/components/ln-fill/ln-fill.js +1 -1
  27. package/components/ln-filter/ln-filter.js +1 -1
  28. package/components/ln-filter/ln-filter.schema.json +161 -153
  29. package/components/ln-filter/src/ln-filter.js +77 -5
  30. package/components/ln-form/ln-form.js +1 -1
  31. package/components/ln-form/ln-form.schema.json +51 -45
  32. package/components/ln-form/src/ln-form.js +21 -0
  33. package/components/ln-http/ln-http.js +1 -1
  34. package/components/ln-include/ln-include.js +1 -1
  35. package/components/ln-key/ln-key.js +1 -1
  36. package/components/ln-link/ln-link.js +1 -1
  37. package/components/ln-list/ln-list.js +1 -1
  38. package/components/ln-modal/ln-modal.js +1 -1
  39. package/components/ln-nav/ln-nav.js +1 -1
  40. package/components/ln-number/ln-number.js +1 -1
  41. package/components/ln-number/src/ln-number.js +26 -0
  42. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  43. package/components/ln-options/ln-options.js +1 -1
  44. package/components/ln-options/ln-options.schema.json +47 -41
  45. package/components/ln-options/src/ln-options.js +4 -4
  46. package/components/ln-persist/ln-persist.js +1 -1
  47. package/components/ln-picklist/ln-picklist.js +1 -1
  48. package/components/ln-popover/ln-popover.js +1 -1
  49. package/components/ln-progress/ln-progress.js +1 -1
  50. package/components/ln-router/ln-router.js +1 -1
  51. package/components/ln-scroll/ln-scroll.js +1 -1
  52. package/components/ln-search/ln-search.js +1 -1
  53. package/components/ln-search/src/ln-search.js +17 -1
  54. package/components/ln-slug/ln-slug.js +1 -1
  55. package/components/ln-slug/src/ln-slug.js +25 -1
  56. package/components/ln-sort/ln-sort.js +1 -1
  57. package/components/ln-sortable/ln-sortable.js +1 -1
  58. package/components/ln-stat/ln-stat.js +1 -1
  59. package/components/ln-table/ln-table.js +1 -1
  60. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  61. package/components/ln-tabs/ln-tabs.js +1 -1
  62. package/components/ln-time/ln-time.js +1 -1
  63. package/components/ln-toast/ln-toast.js +1 -1
  64. package/components/ln-toggle/ln-toggle.js +1 -1
  65. package/components/ln-tooltip/ln-tooltip.js +1 -1
  66. package/components/ln-translations/ln-translations.js +1 -1
  67. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  68. package/components/ln-upload/ln-upload.js +1 -1
  69. package/components/ln-validate/ln-validate.js +1 -1
  70. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  71. package/ln-ashlar.html-data.json +13 -0
  72. package/package.json +2 -1
  73. package/web-types.json +22 -1
@@ -1 +1 @@
1
- (function(){"use strict";function E(){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 o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!m(o))return}e.apply(console,t)}}function D(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function N(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(r),r}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const I={};function j(e,t){I[e]=t}function V(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=V);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const L={};function H(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];L[n]=t}function K(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return L[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=H,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=U);const A={};function Q(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],s=c.getAttribute("data-ln-field");t[s]!=null&&(c.textContent=t[s])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],s=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<s.length;a++){const u=s[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const c=r[l],s=c.getAttribute("data-ln-show");s in t&&c.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const c=i[l],s=c.getAttribute("data-ln-class").split(",");for(let a=0;a<s.length;a++){const u=s[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function G(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].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 n=0;n<t.length;n++)t[n].textContent=""}})));function $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(i,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let i=0;i<r.length;i++){const l=r[i],c=l.attributes;for(let s=0;s<c.length;s++){const a=c[s];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function J(e,t,n,o,r,i){const l={};for(let s=0;s<e.children.length;s++){const a=e.children[s],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const c=document.createDocumentFragment();for(let s=0;s<t.length;s++){const a=t[s],u=String(o(a));let d=l[u];if(d)r(d,a,s);else{const f=Q(n,i);if(!f||($(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),r(d,a,s)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=G,window.lnCore.renderList=J);function P(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function q(e,t,n,o,r){if(!e||t===null)return!0;const i=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=s=>{r?console.warn(s,r):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(c(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(c(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(c(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(c(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return c(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function z(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function v(e,t,n,o){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(s){console.error("["+n+"] init failed",c,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Y(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Z(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function R(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ee(e){const t=R(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(i=>i.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=z(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function B(e,t,n,o){for(let r=0;r<e.length;r++){const i=e[r];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,o):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,o)}}function te(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=R(),r=o.byAttr.get(n);if(E()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&m(t)){const i=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<i.length;c++)q(i[c].spec,l,n,i[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||r)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=o.byReactive.get(n);i&&B(i,t,n,e.oldValue),o.reactiveWildcard.length&&B(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let i=0;i<r.length;i++){const l=r[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(v(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{te(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function M(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function oe(e){const t=M();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,i=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;i&&o.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const i=t[r];v(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const i=t[r],l=i.query,c=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&c.push(o);for(let s=0;s<c.length;s++){const a=c[s];if(!document.contains(a)){const u=a[i.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+i.attribute+"] destroy failed",a,d)}delete a[i.attribute]}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{oe(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ie(e,t,n,o,r={}){const i=r.extraAttributes||[],l=r.onAttributeChange||null,c=r.onSubtreeChange||null,s=r.onInit||null,a=r.onAttrChange||null,u=r.effects||null,d=r.attributes||null,f=d?X(d):u,h=d?new Set(Object.keys(d)):null,p=r.persist||null;function w(_){const g=_||document.body;if(v(g,e,t,n),d&&E())for(const C in d){const ge=d[C],k=Array.from(g.querySelectorAll("["+C+"]"));g.matches&&g.matches("["+C+"]")&&k.push(g);for(let S=0;S<k.length;S++){const O=k[S];m(O)&&q(ge,O.getAttribute(C),C,o,O)}}s&&s(g)}const b=[];if(e.indexOf("[")!==-1){const _=/\[([\w-]+)/g;let g;for(;(g=_.exec(e))!==null;)b.push(g[1])}else b.push(e);ee({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:s,observed:b.concat(i),onAttributeChange:l,onAttrChange:a,effects:f,declared:h,persist:p}),ne();const be=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";M().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:c,query:be}),re(),window[t]=w;function F(){Y()>0?Z(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",F):F(),w}function W(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},o=W(t);if(!o)return n;const r=o.split("&");for(let i=0;i<r.length;i++){const l=r[i];if(!l)continue;const c=l.indexOf(":"),s=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(s)try{n[s]=decodeURIComponent(a)}catch{n[s]=a}}return n}function le(e){if(!e)return null;const t=x();return e in t?t[e]:null}function se(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");W(location.hash)!==r&&(location.hash=r)}function ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function de(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ue(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function we(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=le,window.lnCore.hashSet=se,window.lnCore.hashLinkClick=ce,window.lnCore.resolveHashNamespace=ae,window.lnCore.hashSortEncode=de,window.lnCore.hashSortDecode=ue,window.lnCore.hashFilterEncode=fe,window.lnCore.hashFilterDecode=we);function he(){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=he),(function(){const e="data-ln-scroll",t="lnScroll";if(window[t]!==void 0)return;const n={"data-ln-scroll":{effect:null,type:"string",description:"Target element ID or CSS selector to scroll into view"},"data-ln-scroll-behavior":{effect:null,type:"enum",values:["smooth","auto"],fallback:"smooth",description:"Scroll animation behavior transition"},"data-ln-scroll-block":{effect:null,type:"enum",values:["start","center","end","nearest"],fallback:"start",description:"Vertical alignment positioning of scrolled target"},"data-ln-scroll-set":{effect:null,type:"string",description:"Optional state attribute assignment on target after scroll (e.g. data-ln-toggle=open)"},"data-ln-scroll-focus":{effect:null,type:"string",description:'CSS selector of element to focus after scroll, or "false" to disable'},"data-ln-scroll-delay":{effect:null,type:"integer",fallback:450,min:0,description:"Delay in milliseconds before shifting keyboard focus"},"data-ln-scroll-update-hash":{effect:null,type:"boolean",fallback:!1,description:"Whether to update URL hash with target ID"}};function o(r){if(r[t])return r[t];if(!(!r||r.tagName!=="A"&&r.tagName!=="BUTTON"))return r[t]=this,this.dom=r,this._handleClick=this._handleClick.bind(this),this.dom.addEventListener("click",this._handleClick),this}o.prototype._handleClick=function(r){if(this.dom.tagName==="A"&&(r.ctrlKey||r.metaKey||r.shiftKey||r.altKey||r.button!==0))return;let i=(this.dom.getAttribute("data-ln-scroll")||"").trim();if(i||(i=(this.dom.getAttribute("href")||"").trim()),!i||i==="#")return;!i.startsWith("#")&&!i.startsWith(".")&&!i.startsWith("[")&&(i="#"+i);let l=null;try{l=document.querySelector(i)}catch{const p=i.replace(/^#/,"");l=document.getElementById(p)}if(!l)return;r.preventDefault();const c=this.dom.getAttribute("data-ln-scroll-set");if(c){const h=c.indexOf(":");if(h!==-1){const p=c.slice(0,h).trim(),w=c.slice(h+1).trim();try{const b=document.querySelector(p);b&&(b.value=w,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})))}catch{}}}if(N(this.dom,"ln-scroll:before-scroll",{target:l,link:this.dom,href:i}).defaultPrevented)return;const a=this.dom.getAttribute("data-ln-scroll-behavior")||"smooth",u=this.dom.getAttribute("data-ln-scroll-block")||"start";if(l.scrollIntoView({behavior:a,block:u}),P(this.dom,"data-ln-scroll-update-hash",!1))try{window.history&&window.history.pushState&&window.history.pushState(null,"",i)}catch{}const f=this.dom.getAttribute("data-ln-scroll-focus");if(f!=="false"&&f!=="0"){const h=parseInt(this.dom.getAttribute("data-ln-scroll-delay"),10),p=isNaN(h)?450:h;window.setTimeout(function(){let w=null;if(f&&f!=="true"&&f!=="1")try{w=document.querySelector(f)}catch{}w||(w=l.querySelector('input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])')),!w&&l.getAttribute("tabindex")!==null&&(w=l),w&&typeof w.focus=="function"&&w.focus({preventScroll:!0})},p)}D(this.dom,"ln-scroll:scrolled",{target:l,link:this.dom,href:i})},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("click",this._handleClick),delete this.dom[t])},ie(e,t,o,"ln-scroll",{attributes:n})})()})();
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 C(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 o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!C(o))return}e.apply(console,t)}}function T(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function z(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(r),r}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function X(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,r={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(o&&l.matches&&l.matches(o)))if(l.type==="checkbox")n&&i[l.name]===1?r[l.name]=l.checked:(r[l.name]||(r[l.name]=[]),l.checked&&r[l.name].push(l.value));else if(l.type==="radio")l.checked&&(r[l.name]=l.value);else if(l.type==="select-multiple"){r[l.name]=[];for(let a=0;a<l.options.length;a++)l.options[a].selected&&r[l.name].push(l.options[a].value)}else if(n&&l.type==="hidden")r[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const a=Number(l.value);r[l.name]=l.value===""||isNaN(a)?null:a}else r[l.name]=l.value}return r}function Y(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Z(e,t){const n=e.elements,o=[],r={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(r[i.name]=(r[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const l=t[c];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(r[i.name]>1){const a=String(l).split(",").map(function(u){return u.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=Y(l);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let a=0;a<i.options.length;a++)i.options[a].selected=l.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Z,window.lnCore.serializeForm=X,window.lnCore.resolveFormMethod=G);const N={};function ee(e,t){N[e]=t}function te(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){T(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=oe,window.lnCore.getLocaleFallback=re,window.lnCore.ensureLocaleObserver=ne);const A={};function ie(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<l.length;a++){const u=l[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let i=0;i<r.length;i++){const c=r[i],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],l=c.getAttribute("data-ln-class").split(",");for(let a=0;a<l.length;a++){const u=l[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].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)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const i=r[s],c=i.attributes;for(let l=0;l<c.length;l++){const a=c[l];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function se(e,t,n,o,r,s){const i={};for(let l=0;l<e.children.length;l++){const a=e.children[l],u=a.getAttribute("data-ln-render-key");u&&(i[u]=a)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const a=t[l],u=String(o(a));let d=i[u];if(d)r(d,a,l);else{const f=ie(n,s);if(!f||(q(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),r(d,a,l)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=F,window.lnCore.lnFill=le,window.lnCore.renderList=se);function v(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function B(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function k(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const x=new Map;function R(e,t){const n=(e?e.join("|"):"")+"::"+t;if(x.has(n))return x.get(n);const o=new Set(e||[]),r=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return x.set(n,r),r}function W(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function j(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function U(e,t,n,o,r){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{r?console.warn(l,r):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,n){for(const o in n){const[r,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return r(t,s,i)},enumerable:!0,configurable:!0})}return e}function ae(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let r=o.read;if(!r&&o.type)switch(o.type){case"enum":r=R(o.values,o.fallback);break;case"integer":r=B;break;case"float":r=W;break;case"boolean":r=k;break;case"list":r=M;break;case"json":r=j;break;case"string":default:r=v;break}r||(r=v),t[o.prop]=[r,n,o.fallback]}return t}function ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.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 n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ce,window.lnCore.attrSpec=ae,window.lnCore.attrStr=v,window.lnCore.attrInt=B,window.lnCore.attrBool=k,window.lnCore.attrList=M,window.lnCore.attrEnum=R,window.lnCore.attrFloat=W,window.lnCore.attrJson=j);function S(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}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 V(){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=V(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=de(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function H(e,t,n,o){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function be(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=V(),r=o.byAttr.get(n);if(D()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&C(t)){const s=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)U(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||r)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&H(s,t,n,e.oldValue),o.reactiveWildcard.length&&H(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const i=r[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(S(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{be(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function K(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=K();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,s=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r];S(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r],i=s.query,c=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&c.push(o);for(let l=0;l<c.length;l++){const a=c[l];if(!document.contains(a)){const u=a[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",a,d)}delete a[s.attribute]}}}}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ge(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Q(e,t,n,o,r={}){const s=r.extraAttributes||[],i=r.onAttributeChange||null,c=r.onSubtreeChange||null,l=r.onInit||null,a=r.onAttrChange||null,u=r.effects||null,d=r.attributes||null,f=d?ue(d):u,h=d?new Set(Object.keys(d)):null,g=r.persist||null;function w(O){const p=O||document.body;if(S(p,e,t,n),d&&D())for(const m in d){const Le=d[m],E=Array.from(p.querySelectorAll("["+m+"]"));p.matches&&p.matches("["+m+"]")&&E.push(p);for(let I=0;I<E.length;I++){const L=E[I];C(L)&&U(Le,L.getAttribute(m),m,o,L)}}l&&l(p)}const b=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let p;for(;(p=O.exec(e))!==null;)b.push(p[1])}else b.push(e);he({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:l,observed:b.concat(s),onAttributeChange:i,onAttrChange:a,effects:f,declared:h,persist:g}),pe();const Ee=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ie=r.subtreeQuery||(Ee?e:"["+e+"]");K().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:Ie}),me(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Q);function P(){fe()>0?we(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",P):P(),w}function J(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},o=J(t);if(!o)return n;const r=o.split("&");for(let s=0;s<r.length;s++){const i=r[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(a)}catch{n[l]=a}}return n}function ye(e){if(!e)return null;const t=_();return e in t?t[e]:null}function Ce(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");J(location.hash)!==r&&(location.hash=r)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function xe(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 _e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=ye,window.lnCore.hashSet=Ce,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=xe,window.lnCore.hashFilterEncode=Se,window.lnCore.hashFilterDecode=_e);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(){const e="data-ln-scroll",t="lnScroll";if(window[t]!==void 0)return;const n={"data-ln-scroll":{effect:null,type:"string",description:"Target element ID or CSS selector to scroll into view"},"data-ln-scroll-behavior":{effect:null,type:"enum",values:["smooth","auto"],fallback:"smooth",description:"Scroll animation behavior transition"},"data-ln-scroll-block":{effect:null,type:"enum",values:["start","center","end","nearest"],fallback:"start",description:"Vertical alignment positioning of scrolled target"},"data-ln-scroll-set":{effect:null,type:"string",description:"Optional state attribute assignment on target after scroll (e.g. data-ln-toggle=open)"},"data-ln-scroll-focus":{effect:null,type:"string",description:'CSS selector of element to focus after scroll, or "false" to disable'},"data-ln-scroll-delay":{effect:null,type:"integer",fallback:450,min:0,description:"Delay in milliseconds before shifting keyboard focus"},"data-ln-scroll-update-hash":{effect:null,type:"boolean",fallback:!1,description:"Whether to update URL hash with target ID"}};function o(r){if(r[t])return r[t];if(!(!r||r.tagName!=="A"&&r.tagName!=="BUTTON"))return r[t]=this,this.dom=r,this._handleClick=this._handleClick.bind(this),this.dom.addEventListener("click",this._handleClick),this}o.prototype._handleClick=function(r){if(this.dom.tagName==="A"&&(r.ctrlKey||r.metaKey||r.shiftKey||r.altKey||r.button!==0))return;let s=(this.dom.getAttribute("data-ln-scroll")||"").trim();if(s||(s=(this.dom.getAttribute("href")||"").trim()),!s||s==="#")return;!s.startsWith("#")&&!s.startsWith(".")&&!s.startsWith("[")&&(s="#"+s);let i=null;try{i=document.querySelector(s)}catch{const g=s.replace(/^#/,"");i=document.getElementById(g)}if(!i)return;r.preventDefault();const c=this.dom.getAttribute("data-ln-scroll-set");if(c){const h=c.indexOf(":");if(h!==-1){const g=c.slice(0,h).trim(),w=c.slice(h+1).trim();try{const b=document.querySelector(g);b&&(b.value=w,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})))}catch{}}}if(z(this.dom,"ln-scroll:before-scroll",{target:i,link:this.dom,href:s}).defaultPrevented)return;const a=this.dom.getAttribute("data-ln-scroll-behavior")||"smooth",u=this.dom.getAttribute("data-ln-scroll-block")||"start";if(i.scrollIntoView({behavior:a,block:u}),k(this.dom,"data-ln-scroll-update-hash",!1))try{window.history&&window.history.pushState&&window.history.pushState(null,"",s)}catch{}const f=this.dom.getAttribute("data-ln-scroll-focus");if(f!=="false"&&f!=="0"){const h=parseInt(this.dom.getAttribute("data-ln-scroll-delay"),10),g=isNaN(h)?450:h;window.setTimeout(function(){let w=null;if(f&&f!=="true"&&f!=="1")try{w=document.querySelector(f)}catch{}w||(w=i.querySelector('input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])')),!w&&i.getAttribute("tabindex")!==null&&(w=i),w&&typeof w.focus=="function"&&w.focus({preventScroll:!0})},g)}T(this.dom,"ln-scroll:scrolled",{target:i,link:this.dom,href:s})},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("click",this._handleClick),delete this.dom[t])},Q(e,t,o,"ln-scroll",{attributes:n})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function j(){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 I(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!I(r))return}e.apply(console,t)}}function Z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function ee(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const W={};function te(e,t){W[e]=t}function ne(e){return W[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=te,window.lnCore.getDataMapper=ne);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){Z(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];U[n]=t}function ie(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return U[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=oe,window.lnCore.getLocaleFallback=ie,window.lnCore.ensureLocaleObserver=re);const O={};function le(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function V(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const d=n[l],a=d.getAttribute("data-ln-field");t[a]!=null&&(d.textContent=t[a])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const d=r[l],a=d.getAttribute("data-ln-attr").split(",");for(let f=0;f<a.length;f++){const p=a[f].trim().split(":");if(p.length!==2)continue;const h=p[0].trim(),b=p[1].trim();t[b]!=null&&d.setAttribute(h,t[b])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const d=o[l],a=d.getAttribute("data-ln-show");a in t&&d.classList.toggle("hidden",!t[a])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const d=i[l],a=d.getAttribute("data-ln-class").split(",");for(let f=0;f<a.length;f++){const p=a[f].trim().split(":");if(p.length!==2)continue;const h=p[0].trim(),b=p[1].trim();b in t&&d.classList.toggle(h,!!t[b])}}return e}function se(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)V(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function K(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,d){return t[d]!==void 0?t[d]:""}))}const r=function(i,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let i=0;i<o.length;i++){const l=o[i],d=l.attributes;for(let a=0;a<d.length;a++){const f=d[a];f.value.indexOf("{{")!==-1&&l.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ce(e,t,n,r,o,i){const l={};for(let a=0;a<e.children.length;a++){const f=e.children[a],p=f.getAttribute("data-ln-render-key");p&&(l[p]=f)}const d=document.createDocumentFragment();for(let a=0;a<t.length;a++){const f=t[a],p=String(r(f));let h=l[p];if(h)o(h,f,a);else{const b=le(n,i);if(!b||(K(b,f),h=b.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",p),o(h,f,a)}d.appendChild(h)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=V,window.lnCore.lnFill=se,window.lnCore.renderList=ce);function L(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function ae(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function ue(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function de(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const D=new Map;function fe(e,t){const n=(e?e.join("|"):"")+"::"+t;if(D.has(n))return D.get(n);const r=new Set(e||[]),o=function(i,l){const d=i.getAttribute(l);return d!==null&&r.has(d)?d:t};return D.set(n,o),o}function he(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function we(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Q(e,t,n,r,o){if(!e||t===null)return!0;const i=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const d=a=>{o?console.warn(a,o):console.warn(a)};if(l==="boolean"){const a=t.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(d(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const a=e.values||[];return a.includes(t)?!0:(d(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${a.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return d(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const a=parseInt(t,10);return e.min!==void 0&&a<e.min?(d(`[${i}] Value ${a} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&a>e.max?(d(`[${i}] Value ${a} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(d(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(a){return d(`[${i}] Invalid JSON for attribute "${n}": ${a.message}. Fallback: ${e.fallback}.`),!1}return!0}function pe(e,t,n){for(const r in n){const[o,i,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,i,l)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=fe(r.values,r.fallback);break;case"integer":o=ae;break;case"float":o=he;break;case"boolean":o=ue;break;case"list":o=de;break;case"json":o=we;break;case"string":default:o=L;break}o||(o=L),t[r.prop]=[o,n,r.fallback]}return t}function be(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function me(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function R(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const d of l)if(!d[n]){window.lnCore._persistSink&&d.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(d,t);try{d[n]=new r(d)}catch(a){console.error("["+n+"] init failed",d,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function q(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 P(){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=P(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(i=>i.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=me(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function J(e,t,n,r){for(let o=0;o<e.length;o++){const i=e[o];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function Ae(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=P(),o=r.byAttr.get(n);if(j()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&I(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let d=0;d<i.length;d++)Q(i[d].spec,l,n,i[d].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&J(i,t,n,e.oldValue),r.reactiveWildcard.length&&J(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let i=0;i<o.length;i++){const l=o[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(R(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ae(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Se(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,i=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o];R(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o],l=i.query,d=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&d.push(r);for(let a=0;a<d.length;a++){const f=d[a];if(!document.contains(f)){const p=f[i.attribute];if(p&&typeof p.destroy=="function")try{p.destroy()}catch(h){console.error("["+i.attribute+"] destroy failed",f,h)}delete f[i.attribute]}}}}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Se(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function G(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,d=o.onSubtreeChange||null,a=o.onInit||null,f=o.onAttrChange||null,p=o.effects||null,h=o.attributes||null,b=h?be(h):p,k=h?new Set(Object.keys(h)):null,F=o.persist||null;function _(u){const c=u||document.body;if(R(c,e,t,n),h&&j())for(const s in h){const w=h[s],m=Array.from(c.querySelectorAll("["+s+"]"));c.matches&&c.matches("["+s+"]")&&m.push(c);for(let A=0;A<m.length;A++){const g=m[A];I(g)&&Q(w,g.getAttribute(s),s,r,g)}}a&&a(c)}const S=[];if(e.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let c;for(;(c=u.exec(e))!==null;)S.push(c[1])}else S.push(e);Ce({selector:e,attribute:t,componentTag:r,attributes:h,ComponentFn:n,onInit:a,observed:S.concat(i),onAttributeChange:l,onAttrChange:f,effects:b,declared:k,persist:F}),_e();const M=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";z().push({selector:e,attribute:t,ComponentFn:n,onInit:a,onSubtreeChange:d,query:M}),xe(),window[t]=_;function v(){ye()>0?q(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):v(),_}function X(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=X(t);if(!r)return n;const o=r.split("&");for(let i=0;i<o.length;i++){const l=o[i];if(!l)continue;const d=l.indexOf(":"),a=d>-1?l.slice(0,d):l,f=d>-1?l.slice(d+1):"";if(a)try{n[a]=decodeURIComponent(f)}catch{n[a]=f}}return n}function B(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Y(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");X(location.hash)!==o&&(location.hash=o)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function N(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ee(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 ke(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 n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=B,window.lnCore.hashSet=Y,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=N,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Ie);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 H(e){return String(e||"").trim().toLowerCase()}function Le(e){const t=H(e);return t?t.split(/\s+/).filter(Boolean):[]}function De(e){if(e==null)return null;const t=String(e).split(",").map(n=>n.trim()).filter(Boolean);return t.length?t:null}function Re(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=String(e).toLowerCase();for(let r=0;r<t.length;r++)if(n.indexOf(t[r])===-1)return!1;return!0}function qe(e){return!e||e.length===0?"":e.join(" ").replace(/\s+/g," ").trim().toLowerCase()}(function(){const e="data-ln-search",t="lnSearch",n="data-ln-search-for",r="lnSearchControl",o="data-ln-search-items",i="data-ln-search-fields",l="data-ln-search-exclude",d="data-ln-search-hide",a="data-ln-hash";if(window[t]!==void 0)return;const f={"data-ln-search":{type:"string",effect:v,description:"Active search query term on target element or container"},"data-ln-hash":{type:"string",effect:v,description:"URL hash routing key for search state persistence"},"data-ln-search-for":{prop:"targetId",type:"string",read:L,fallback:null,description:"Target table or list element ID that this input controls"},"data-ln-search-fields":{type:"list",description:"Comma-separated field names to include in client search"},"data-ln-search-items":{type:"string",description:"CSS selector matching searchable child items"},"data-ln-search-exclude":{type:"string",description:"CSS selector matching child items to exclude from search"},"data-ln-search-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-search-clear-for":{type:"trigger",description:"Click trigger to clear search input for target"}},p=ge(f);function h(u){const c=N(u,"search");if(c)return c;if(u.id){const s=document.querySelector("["+n+'="'+u.id+'"]');if(s){const w=N(s,"search");if(w)return w}}return null}function b(u){return u.matches("input, textarea")?u:u.querySelector("input, textarea")}function k(u,c){const s=u.childNodes;for(let w=0;w<s.length;w++){const m=s[w];if(m.nodeType===3){c.push(m.nodeValue);continue}m.nodeType===1&&(m.hasAttribute(l)||k(m,c))}}function F(u){if(u._lnSearchText!==void 0)return u._lnSearchText;const c=[];k(u,c);const s=qe(c);return u._lnSearchText=s,s}function _(u,c){if(!u.id)return;const s=document.querySelectorAll("["+n+'="'+u.id+'"]');for(const w of s){const m=b(w);m&&m.value!==c&&(m.value=c)}}function S(u){this.dom=u,this.term=u.getAttribute(e)||"",this._destroyed=!1;const c=this;return this.nsKey=h(u),this.hashEnabled=!!this.nsKey,this._onHashChange=function(){if(c._destroyed||!c.hashEnabled)return;const s=B(c.nsKey),w=c.dom.getAttribute(e)||"";s!==null&&s!==w?c.dom.setAttribute(e,s):s===null&&w!==""&&c.dom.setAttribute(e,"")},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),q(function(){if(!c._destroyed){if(c.hashEnabled){const s=B(c.nsKey);if(s!==null&&s!==c.term){c.term=s,c.dom.setAttribute(e,s),_(c.dom,s),c._apply();return}}H(c.term)&&(_(c.dom,c.term),c._apply())}}),this}S.prototype._apply=function(){const u=this.dom,c=H(this.term),s=Le(c);this.hashEnabled&&Y(this.nsKey,this.term?this.term:null);const w=De(u.getAttribute(i));if(ee(u,"ln-search:change",{term:c,tokens:s,targetId:u.id,fields:w}).defaultPrevented)return;const A=u.getAttribute(o),g=A?u.querySelectorAll(A):u.children;for(let y=0;y<g.length;y++){const C=g[y];if(C.removeAttribute(d),C.hasAttribute(l)||s.length===0)continue;const E=F(C);Re(E,s)||C.setAttribute(d,"true")}},S.prototype.destroy=function(){this.dom[t]&&(this._destroyed=!0,this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function x(u){if(this.dom=u,pe(this,u,p),this.input=b(u),this._attachHandler(),this.input&&this.input.value.trim()){const c=this;q(function(){const s=document.getElementById(c.targetId);s&&((s.getAttribute(e)||"").trim()||c._write(c.input.value))})}return this}x.prototype._write=function(u){const c=document.getElementById(this.targetId);c&&c.getAttribute(e)!==u&&c.setAttribute(e,u)},x.prototype._attachHandler=function(){if(!this.input)return;const u=this;this._onInput=function(){u._write(u.input.value)},this.input.addEventListener("input",this._onInput)},x.prototype.destroy=function(){this.dom[r]&&(this.input&&this._onInput&&this.input.removeEventListener("input",this._onInput),delete this.dom[r])};function M(u){const c=u.getAttribute("data-ln-search-clear-for");if(c){const g=document.getElementById(c),y=document.querySelector("["+n+'="'+c+'"]'),C=y?b(y):null;return{target:g,input:C}}const s=u.closest("["+e+"]");if(s){const g=s.id?document.querySelector("["+n+'="'+s.id+'"]'):null,y=g?b(g):null;return{target:s,input:y}}const w=u.closest("[data-ln-table-source], [data-ln-list-source]");if(w){const g=w.getAttribute("data-ln-table-source")||w.getAttribute("data-ln-list-source"),y=g?document.getElementById(g):null;if(y&&y.hasAttribute(e)){const C=document.querySelector("["+n+'="'+g+'"]'),E=C?b(C):null;return{target:y,input:E}}}const m=u.closest("["+n+"]");if(m){const g=m.getAttribute(n),y=g?document.getElementById(g):null,C=b(m);return{target:y,input:C}}const A=u.parentElement;if(A){const g=A.querySelector("["+n+"]");if(g){const y=g.getAttribute(n),C=y?document.getElementById(y):null,E=b(g);return{target:C,input:E}}}return{target:null,input:null}}document.addEventListener("click",function(u){const c=u.target.closest("[data-ln-search-clear], [data-ln-search-clear-for]");if(!c)return;const s=M(c);!s.target&&!s.input||(u.preventDefault(),s.input&&(s.input.value="",s.input.focus()),s.target&&s.target.setAttribute(e,""))});function v(u,c){const s=u[t];if(!s||s._destroyed)return;if(c===a){s._onHashChange&&window.removeEventListener("hashchange",s._onHashChange),s.nsKey=h(u),s.hashEnabled=!!s.nsKey,s.hashEnabled&&window.addEventListener("hashchange",s._onHashChange);return}const w=u.getAttribute(e)||"";w!==s.term&&(s.term=w,_(u,w),s._apply())}G(e,t,S,"ln-search",{attributes:f,onSubtreeChange:function(u,c){const s=c.target;s&&s._lnSearchText!==void 0&&delete s._lnSearchText,s&&s.parentElement&&s.parentElement._lnSearchText!==void 0&&delete s.parentElement._lnSearchText},persist:{attr:e,hashActive:function(u){return!!h(u)}}}),G(n,r,x,"ln-search-control")})()})();
1
+ (function(){"use strict";function W(){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 L(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!L(r))return}e.apply(console,t)}}function se(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function ce(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ue(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[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")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let f=0;f<o.options.length;f++)o.options[f].selected&&i[o.name].push(o.options[f].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const f=Number(o.value);i[o.name]=o.value===""||isNaN(f)?null:f}else i[o.name]=o.value}return i}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function fe(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const o=t[c];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const f=String(o).split(",").map(function(p){return p.trim()});l.checked=f.indexOf(l.value)!==-1}else l.checked=de(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let f=0;f<l.options.length;f++)l.options[f].selected=o.indexOf(l.options[f].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=fe,window.lnCore.serializeForm=ue,window.lnCore.resolveFormMethod=ae);const U={};function he(e,t){U[e]=t}function we(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=he,window.lnCore.getDataMapper=we);function pe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){se(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const V={};function ge(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];V[n]=t}function be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return V[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ge,window.lnCore.getLocaleFallback=be,window.lnCore.ensureLocaleObserver=pe);const q={};function me(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function K(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],o=c.getAttribute("data-ln-attr").split(",");for(let f=0;f<o.length;f++){const p=o[f].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),m=p[1].trim();t[m]!=null&&c.setAttribute(w,t[m])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],o=c.getAttribute("data-ln-class").split(",");for(let f=0;f<o.length;f++){const p=o[f].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),m=p[1].trim();m in t&&c.classList.toggle(w,!!t[m])}}return e}function ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)K(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function Q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let o=0;o<c.length;o++){const f=c[o];f.value.indexOf("{{")!==-1&&l.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ce(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const f=e.children[o],p=f.getAttribute("data-ln-render-key");p&&(l[p]=f)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const f=t[o],p=String(r(f));let w=l[p];if(w)i(w,f,o);else{const m=me(n,s);if(!m||(Q(m,f),w=m.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",p),i(w,f,o)}c.appendChild(w)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=K,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function T(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function z(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function J(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function P(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const D=new Map;function G(e,t){const n=(e?e.join("|"):"")+"::"+t;if(D.has(n))return D.get(n);const r=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&r.has(c)?c:t};return D.set(n,i),i}function X(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Y(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Z(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function te(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=G(r.values,r.fallback);break;case"integer":i=z;break;case"float":i=X;break;case"boolean":i=J;break;case"list":i=P;break;case"json":i=Y;break;case"string":default:i=T;break}i||(i=T),t[r.prop]=[i,n,r.fallback]}return t}function Ae(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function _e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ee,window.lnCore.attrSpec=te,window.lnCore.attrStr=T,window.lnCore.attrInt=z,window.lnCore.attrBool=J,window.lnCore.attrList=P,window.lnCore.attrEnum=G,window.lnCore.attrFloat=X,window.lnCore.attrJson=Y);function R(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(o){console.error("["+n+"] init failed",c,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function B(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 ne(){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 Se(e){const t=ne(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=_e(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function re(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function xe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=ne(),i=r.byAttr.get(n);if(W()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&L(t)){const s=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<s.length;c++)Z(s[c].spec,l,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&re(s,t,n,e.oldValue),r.reactiveWildcard.length&&re(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const l=i[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(R(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function oe(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ee(e){const t=oe();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];R(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],l=s.query,c=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&c.push(r);for(let o=0;o<c.length;o++){const f=c[o];if(!document.contains(f)){const p=f[s.attribute];if(p&&typeof p.destroy=="function")try{p.destroy()}catch(w){console.error("["+s.attribute+"] destroy failed",f,w)}delete f[s.attribute]}}}}}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Ee(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function N(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,f=i.onAttrChange||null,p=i.effects||null,w=i.attributes||null,m=w?Ae(w):p,O=w?new Set(Object.keys(w)):null,H=i.persist||null;function _(d){const a=d||document.body;if(R(a,e,t,n),w&&W())for(const u in w){const h=w[u],g=Array.from(a.querySelectorAll("["+u+"]"));a.matches&&a.matches("["+u+"]")&&g.push(a);for(let A=0;A<g.length;A++){const b=g[A];L(b)&&Z(h,b.getAttribute(u),u,r,b)}}o&&o(a)}const v=[];if(e.indexOf("[")!==-1){const d=/\[([\w-]+)/g;let a;for(;(a=d.exec(e))!==null;)v.push(a[1])}else v.push(e);Se({selector:e,attribute:t,componentTag:r,attributes:w,ComponentFn:n,onInit:o,observed:v.concat(s),onAttributeChange:l,onAttrChange:f,effects:m,declared:O,persist:H}),ke();const S=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,j=i.subtreeQuery||(S?e:"["+e+"]");oe().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:j}),Te(),window[t]=_,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=N);function x(){ve()>0?B(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),_}function Ie(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ie(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=ie(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),o=c>-1?l.slice(0,c):l,f=c>-1?l.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(f)}catch{n[o]=f}}return n}function F(e){if(!e)return null;const t=$();return e in t?t[e]:null}function le(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");ie(location.hash)!==i&&(location.hash=i)}function Oe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function M(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Le(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 De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=F,window.lnCore.hashSet=le,window.lnCore.hashLinkClick=Oe,window.lnCore.resolveHashNamespace=M,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Re);function Be(){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=Be);function I(e){return String(e||"").trim().toLowerCase()}function Ne(e){const t=I(e);return t?t.split(/\s+/).filter(Boolean):[]}function $e(e){if(e==null)return null;const t=String(e).split(",").map(n=>n.trim()).filter(Boolean);return t.length?t:null}function Fe(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const n=String(e).toLowerCase();for(let r=0;r<t.length;r++)if(n.indexOf(t[r])===-1)return!1;return!0}function Me(e){return!e||e.length===0?"":e.join(" ").replace(/\s+/g," ").trim().toLowerCase()}(function(){const e="data-ln-search",t="lnSearch",n="data-ln-search-for",r="lnSearchControl",i="data-ln-search-items",s="data-ln-search-fields",l="data-ln-search-exclude",c="data-ln-search-hide",o="data-ln-hash";if(window[t]!==void 0)return;const f={"data-ln-search":{type:"string",effect:x,description:"Active search query term on target element or container"},"data-ln-hash":{type:"string",effect:x,description:"URL hash routing key for search state persistence"},"data-ln-search-for":{prop:"targetId",type:"string",read:T,fallback:null,description:"Target table or list element ID that this input controls"},"data-ln-search-fields":{type:"list",description:"Comma-separated field names to include in client search"},"data-ln-search-items":{type:"string",description:"CSS selector matching searchable child items"},"data-ln-search-exclude":{type:"string",description:"CSS selector matching child items to exclude from search"},"data-ln-search-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-search-clear-for":{type:"trigger",description:"Click trigger to clear search input for target"}},p=te(f);function w(d){const a=M(d,"search");if(a)return a;if(d.id){const u=document.querySelector("["+n+'="'+d.id+'"]');if(u){const h=M(u,"search");if(h)return h}}return null}function m(d){return d.matches("input, textarea")?d:d.querySelector("input, textarea")}function O(d,a){const u=d.childNodes;for(let h=0;h<u.length;h++){const g=u[h];if(g.nodeType===3){a.push(g.nodeValue);continue}g.nodeType===1&&(g.hasAttribute(l)||O(g,a))}}function H(d){if(d._lnSearchText!==void 0)return d._lnSearchText;const a=[];O(d,a);const u=Me(a);return d._lnSearchText=u,u}function _(d,a){if(!d.id)return;const u=document.querySelectorAll("["+n+'="'+d.id+'"]');for(const h of u){const g=m(h);g&&g.value!==a&&(g.value=a)}}function v(d){this.dom=d,this.term=d.getAttribute(e)||"",this._destroyed=!1;const a=this;return this.nsKey=w(d),this.hashEnabled=!!this.nsKey,this._queueApply=Ie(function(){a._destroyed||a._apply()}),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const u=F(a.nsKey),h=a.dom.getAttribute(e)||"";u!==null&&u!==h?a.dom.setAttribute(e,u):u===null&&h!==""&&a.dom.setAttribute(e,"")},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),B(function(){if(!a._destroyed){if(a.hashEnabled){const u=F(a.nsKey);if(u!==null&&u!==a.term){a.term=u,a.dom.setAttribute(e,u),_(a.dom,u),a._apply();return}}I(a.term)&&(_(a.dom,a.term),a._apply())}}),this}v.prototype._apply=function(){const d=this.dom,a=I(this.term),u=Ne(a);this.hashEnabled&&le(this.nsKey,this.term?this.term:null);const h=$e(d.getAttribute(s));if(ce(d,"ln-search:change",{term:a,tokens:u,targetId:d.id,fields:h}).defaultPrevented)return;const A=d.getAttribute(i),b=A?d.querySelectorAll(A):d.children;for(let y=0;y<b.length;y++){const C=b[y];if(C.removeAttribute(c),C.hasAttribute(l)||u.length===0)continue;const k=H(C);Fe(k,u)||C.setAttribute(c,"true")}},v.prototype.destroy=function(){this.dom[t]&&(this._destroyed=!0,this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function S(d){if(this.dom=d,ee(this,d,p),this.input=m(d),this._attachHandler(),this.input&&this.input.value.trim()){const a=this;B(function(){const u=document.getElementById(a.targetId);u&&((u.getAttribute(e)||"").trim()||a._write(a.input.value))})}return this}S.prototype._write=function(d){const a=document.getElementById(this.targetId);a&&a.getAttribute(e)!==d&&a.setAttribute(e,d)},S.prototype._attachHandler=function(){if(!this.input)return;const d=this;this._onInput=function(){d._write(d.input.value)},this.input.addEventListener("input",this._onInput)},S.prototype.destroy=function(){this.dom[r]&&(this.input&&this._onInput&&this.input.removeEventListener("input",this._onInput),delete this.dom[r])};function j(d){const a=d.getAttribute("data-ln-search-clear-for");if(a){const b=document.getElementById(a),y=document.querySelector("["+n+'="'+a+'"]'),C=y?m(y):null;return{target:b,input:C}}const u=d.closest("["+e+"]");if(u){const b=u.id?document.querySelector("["+n+'="'+u.id+'"]'):null,y=b?m(b):null;return{target:u,input:y}}const h=d.closest("[data-ln-table-source], [data-ln-list-source]");if(h){const b=h.getAttribute("data-ln-table-source")||h.getAttribute("data-ln-list-source"),y=b?document.getElementById(b):null;if(y&&y.hasAttribute(e)){const C=document.querySelector("["+n+'="'+b+'"]'),k=C?m(C):null;return{target:y,input:k}}}const g=d.closest("["+n+"]");if(g){const b=g.getAttribute(n),y=b?document.getElementById(b):null,C=m(g);return{target:y,input:C}}const A=d.parentElement;if(A){const b=A.querySelector("["+n+"]");if(b){const y=b.getAttribute(n),C=y?document.getElementById(y):null,k=m(b);return{target:C,input:k}}}return{target:null,input:null}}document.addEventListener("click",function(d){const a=d.target.closest("[data-ln-search-clear], [data-ln-search-clear-for]");if(!a)return;const u=j(a);!u.target&&!u.input||(d.preventDefault(),u.input&&(u.input.value="",u.input.focus()),u.target&&u.target.setAttribute(e,""))});function x(d,a){const u=d[t];if(!u||u._destroyed)return;if(a===o){u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=w(d),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange);return}const h=d.getAttribute(e)||"";h!==u.term&&(u.term=h,_(d,h),u._apply())}N(e,t,v,"ln-search",{attributes:f,onSubtreeChange:function(d,a){const u=a.target;u&&u._lnSearchText!==void 0&&delete u._lnSearchText,u&&u.parentElement&&u.parentElement._lnSearchText!==void 0&&delete u.parentElement._lnSearchText;const h=d[t];if(h&&!h._destroyed&&I(h.term)&&(a.addedNodes.length>0||a.removedNodes.length>0)){for(let g=0;g<a.addedNodes.length;g++){const A=a.addedNodes[g];A._lnSearchText!==void 0&&delete A._lnSearchText}h._queueApply()}},persist:{attr:e,hashActive:function(d){return!!w(d)}}}),N(n,r,S,"ln-search-control")})()})();
@@ -1,4 +1,4 @@
1
- import { dispatchCancelable, hashGet, hashSet, queueBoot, registerComponent, resolveHashNamespace, defineAttrs, attrSpec, attrStr } from '../../ln-core';
1
+ import { dispatchCancelable, hashGet, hashSet, queueBoot, registerComponent, resolveHashNamespace, defineAttrs, attrSpec, attrStr, createBatcher } from '../../ln-core';
2
2
  import { collapseSearchParts, matchesSearchTokens, normalizeSearchTerm, parseSearchFields, tokenizeSearchQuery } from '../../ln-core/matching.js';
3
3
 
4
4
  (function () {
@@ -90,6 +90,12 @@ import { collapseSearchParts, matchesSearchTokens, normalizeSearchTerm, parseSea
90
90
  this.nsKey = _resolveSearchHashNamespace(dom);
91
91
  this.hashEnabled = !!this.nsKey;
92
92
 
93
+ this._queueApply = createBatcher(function () {
94
+ if (!self._destroyed) {
95
+ self._apply();
96
+ }
97
+ });
98
+
93
99
  this._onHashChange = function () {
94
100
  if (self._destroyed || !self.hashEnabled) return;
95
101
  const query = hashGet(self.nsKey);
@@ -319,6 +325,16 @@ import { collapseSearchParts, matchesSearchTokens, normalizeSearchTerm, parseSea
319
325
  if (target && target.parentElement && target.parentElement._lnSearchText !== undefined) {
320
326
  delete target.parentElement._lnSearchText;
321
327
  }
328
+ const inst = el[DOM_ATTRIBUTE];
329
+ if (inst && !inst._destroyed && normalizeSearchTerm(inst.term)) {
330
+ if (mut.addedNodes.length > 0 || mut.removedNodes.length > 0) {
331
+ for (let i = 0; i < mut.addedNodes.length; i++) {
332
+ const node = mut.addedNodes[i];
333
+ if (node._lnSearchText !== undefined) delete node._lnSearchText;
334
+ }
335
+ inst._queueApply();
336
+ }
337
+ }
322
338
  },
323
339
  persist: {
324
340
  attr: DOM_SELECTOR,
@@ -1 +1 @@
1
- (function(){"use strict";function E(){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 p(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!p(r))return}e.apply(console,t)}}function B(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const L={};function j(e,t){L[e]=t}function W(e){return L[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=W);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){B(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function V(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function H(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=V,window.lnCore.getLocaleFallback=H,window.lnCore.ensureLocaleObserver=U);const C={};function Q(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const u=n[l],s=u.getAttribute("data-ln-field");t[s]!=null&&(u.textContent=t[s])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const u=r[l],s=u.getAttribute("data-ln-attr").split(",");for(let c=0;c<s.length;c++){const d=s[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&u.setAttribute(a,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const u=o[l],s=u.getAttribute("data-ln-show");s in t&&u.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const u=i[l],s=u.getAttribute("data-ln-class").split(",");for(let c=0;c<s.length;c++){const d=s[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&u.classList.toggle(a,!!t[f])}}return e}function J(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function D(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,u){return t[u]!==void 0?t[u]:""}))}const r=function(i,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let i=0;i<o.length;i++){const l=o[i],u=l.attributes;for(let s=0;s<u.length;s++){const c=u[s];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function K(e,t,n,r,o,i){const l={};for(let s=0;s<e.children.length;s++){const c=e.children[s],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const u=document.createDocumentFragment();for(let s=0;s<t.length;s++){const c=t[s],d=String(r(c));let a=l[d];if(a)o(a,c,s);else{const f=Q(n,i);if(!f||(D(f,c),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),o(a,c,s)}u.appendChild(a)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=D,window.lnCore.fill=N,window.lnCore.lnFill=J,window.lnCore.renderList=K);function m(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function P(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function z(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function X(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const r=new Set(e||[]),o=function(i,l){const u=i.getAttribute(l);return u!==null&&r.has(u)?u:t};return y.set(n,o),o}function Y(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function T(e,t,n,r,o){if(!e||t===null)return!0;const i=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const u=s=>{o?console.warn(s,o):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(u(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(u(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return u(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(u(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(u(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(u(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return u(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(e,t,n){for(const r in n){const[o,i,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,i,l)},enumerable:!0,configurable:!0})}return e}function te(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=X(r.values,r.fallback);break;case"integer":o=P;break;case"float":o=Y;break;case"boolean":o=z;break;case"list":o=G;break;case"json":o=Z;break;case"string":default:o=m;break}o||(o=m),t[r.prop]=[o,n,r.fallback]}return t}function ne(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function re(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function A(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const u of l)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new r(u)}catch(s){console.error("["+n+"] init failed",u,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ie(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 I(){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 le(e){const t=I(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(i=>i.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=re(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function R(e,t,n,r){for(let o=0;o<e.length;o++){const i=e[o];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function se(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=I(),o=r.byAttr.get(n);if(E()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&p(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let u=0;u<i.length;u++)T(i[u].spec,l,n,i[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&R(i,t,n,e.oldValue),r.reactiveWildcard.length&&R(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let i=0;i<o.length;i++){const l=o[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(A(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{se(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ce(e){const t=q();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,i=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o];A(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o],l=i.query,u=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&u.push(r);for(let s=0;s<u.length;s++){const c=u[s];if(!document.contains(c)){const d=c[i.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(a){console.error("["+i.attribute+"] destroy failed",c,a)}delete c[i.attribute]}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ce(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function de(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,u=o.onSubtreeChange||null,s=o.onInit||null,c=o.onAttrChange||null,d=o.effects||null,a=o.attributes||null,f=a?ne(a):d,_e=a?new Set(Object.keys(a)):null,xe=o.persist||null;function g(v){const w=v||document.body;if(A(w,e,t,n),a&&E())for(const h in a){const Se=a[h],S=Array.from(w.querySelectorAll("["+h+"]"));w.matches&&w.matches("["+h+"]")&&S.push(w);for(let k=0;k<S.length;k++){const O=S[k];p(O)&&T(Se,O.getAttribute(h),h,r,O)}}s&&s(w)}const x=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let w;for(;(w=v.exec(e))!==null;)x.push(w[1])}else x.push(e);le({selector:e,attribute:t,componentTag:r,attributes:a,ComponentFn:n,onInit:s,observed:x.concat(i),onAttributeChange:l,onAttrChange:c,effects:f,declared:_e,persist:xe}),ue();const ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";q().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:u,query:ve}),ae(),window[t]=g;function M(){oe()>0?ie(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M(),g}function F(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},r=F(t);if(!r)return n;const o=r.split("&");for(let i=0;i<o.length;i++){const l=o[i];if(!l)continue;const u=l.indexOf(":"),s=u>-1?l.slice(0,u):l,c=u>-1?l.slice(u+1):"";if(s)try{n[s]=decodeURIComponent(c)}catch{n[s]=c}}return n}function fe(e){if(!e)return null;const t=_();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");F(location.hash)!==o&&(location.hash=o)}function he(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function be(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ge(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function pe(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 Ce(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function me(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=fe,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=he,window.lnCore.resolveHashNamespace=be,window.lnCore.hashSortEncode=ge,window.lnCore.hashSortDecode=pe,window.lnCore.hashFilterEncode=Ce,window.lnCore.hashFilterDecode=me);function ye(){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=ye);function Ae(e,t="-"){if(e==null)return"";const n=t||"-",r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,n).replace(new RegExp(`${r}+`,"g"),n).replace(new RegExp(`^${r}+|${r}+$`,"g"),"")}(function(){const e="data-ln-slug-from",t="lnSlug";if(window[t]!==void 0)return;const n={"data-ln-slug-from":{prop:"sourceName",type:"string",read:m,fallback:"",description:"Name of the source input field to derive URL slug from"}},r=te(n);function o(i){if(i.tagName!=="INPUT")return console.warn("[ln-slug] Can only be applied to <input>, got:",i.tagName),this;const l=i.form;if(!l)return console.warn("[ln-slug] Slug input is not inside a <form>:",i),this;ee(this,i,r);const u=l.elements[this.sourceName];if(!u)return console.warn('[ln-slug] Source field "'+this.sourceName+'" not found in form:',i),this;if(typeof u.addEventListener!="function")return console.warn('[ln-slug] Source field "'+this.sourceName+'" is a RadioNodeList (same-name group) — single source field required:',i),this;this.dom=i,this.source=u,this._pristine=i.value==="",this._mirroring=!1;const s=this;return this._onSource=function(){s._pristine&&s._mirror()},this._onSlug=function(){s._mirroring||(s._pristine=s.dom.value==="")},u.addEventListener("input",this._onSource),i.addEventListener("input",this._onSlug),this._pristine&&u.value&&u.value.trim()!==""&&this._mirror(),this}o.prototype._mirror=function(){this._mirroring=!0,this.dom.value=Ae(this.source.value),this.dom.dispatchEvent(new Event("input",{bubbles:!0})),this._mirroring=!1},o.prototype.destroy=function(){this.dom[t]&&(this.source.removeEventListener("input",this._onSource),this.dom.removeEventListener("input",this._onSlug),delete this.dom[t])},de(e,t,o,"ln-slug",{attributes:n})})()})();
1
+ (function(){"use strict";function E(){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 r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!m(r))return}e.apply(console,t)}}function K(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function G(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,o={};if(n)for(let u=0;u<s.length;u++){const i=s[u];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[i.name]||0)+1)}for(let u=0;u<s.length;u++){const i=s[u];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&o[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let c=0;c<i.options.length;c++)i.options[c].selected&&l[i.name].push(i.options[c].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const c=Number(i.value);l[i.name]=i.value===""||isNaN(c)?null:c}else l[i.name]=i.value}return l}function X(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Y(e,t){const n=e.elements,r=[],l={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const u=o.getAttribute("data-ln-fill-as")||o.name;if(!u||!(u in t))continue;const i=t[u];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(i).split(",").map(function(a){return a.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=X(i);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let c=0;c<o.options.length;c++)o.options[c].selected=i.indexOf(o.options[c].value)!==-1;r.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),r.push(o)}return r}function Z(e,t,{get:n,set:r}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(l){r?r.call(this,l,s=>t.set.call(this,s)):t.set.call(this,l)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Y,window.lnCore.serializeForm=G,window.lnCore.resolveFormMethod=z);const L={};function ee(e,t){L[e]=t}function te(e){return L[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){K(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function re(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=re,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=ne);const C={};function ie(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const u=n[o],i=u.getAttribute("data-ln-field");t[i]!=null&&(u.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const u=r[o],i=u.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const a=i[c].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&u.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const u=l[o],i=u.getAttribute("data-ln-show");i in t&&u.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const u=s[o],i=u.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const a=i[c].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&u.classList.toggle(d,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function F(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,u){return t[u]!==void 0?t[u]:""}))}const r=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],u=o.attributes;for(let i=0;i<u.length;i++){const c=u[i];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function se(e,t,n,r,l,s){const o={};for(let i=0;i<e.children.length;i++){const c=e.children[i],a=c.getAttribute("data-ln-render-key");a&&(o[a]=c)}const u=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],a=String(r(c));let d=o[a];if(d)l(d,c,i);else{const f=ie(n,s);if(!f||(F(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),l(d,c,i)}u.appendChild(d)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=F,window.lnCore.fill=N,window.lnCore.lnFill=le,window.lnCore.renderList=se);function b(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function T(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function D(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function I(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function R(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const r=new Set(e||[]),l=function(s,o){const u=s.getAttribute(o);return u!==null&&r.has(u)?u:t};return y.set(n,l),l}function M(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function q(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function j(e,t,n,r,l){if(!e||t===null)return!0;const s=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const u=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(u(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(u(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return u(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(u(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(u(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(u(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return u(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function B(e,t,n){for(const r in n){const[l,s,o]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function W(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=R(r.values,r.fallback);break;case"integer":l=T;break;case"float":l=M;break;case"boolean":l=D;break;case"list":l=I;break;case"json":l=q;break;case"string":default:l=b;break}l||(l=b),t[r.prop]=[l,n,r.fallback]}return t}function ue(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=B,window.lnCore.attrSpec=W,window.lnCore.attrStr=b,window.lnCore.attrInt=T,window.lnCore.attrBool=D,window.lnCore.attrList=I,window.lnCore.attrEnum=R,window.lnCore.attrFloat=M,window.lnCore.attrJson=q);function A(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&o.push(e);for(const u of o)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new r(u)}catch(i){console.error("["+n+"] init failed",u,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function de(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 U(){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 fe(e){const t=U(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[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=ce(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 V(e,t,n,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function we(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=U(),l=r.byAttr.get(n);if(E()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&m(t)){const s=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let u=0;u<s.length;u++)j(s[u].spec,o,n,s[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&V(s,t,n,e.oldValue),r.reactiveWildcard.length&&V(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const o=l[s];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(A(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function he(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{we(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function pe(e){const t=H();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const l=r.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];A(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],o=s.query,u=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&u.push(r);for(let i=0;i<u.length;i++){const c=u[i];if(!document.contains(c)){const a=c[s.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",c,d)}delete c[s.attribute]}}}}}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{pe(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function P(e,t,n,r,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,u=l.onSubtreeChange||null,i=l.onInit||null,c=l.onAttrChange||null,a=l.effects||null,d=l.attributes||null,f=d?ue(d):a,Oe=d?new Set(Object.keys(d)):null,Ee=l.persist||null;function g(x){const w=x||document.body;if(A(w,e,t,n),d&&E())for(const h in d){const Ne=d[h],S=Array.from(w.querySelectorAll("["+h+"]"));w.matches&&w.matches("["+h+"]")&&S.push(w);for(let k=0;k<S.length;k++){const O=S[k];m(O)&&j(Ne,O.getAttribute(h),h,r,O)}}i&&i(w)}const _=[];if(e.indexOf("[")!==-1){const x=/\[([\w-]+)/g;let w;for(;(w=x.exec(e))!==null;)_.push(w[1])}else _.push(e);fe({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:i,observed:_.concat(s),onAttributeChange:o,onAttrChange:c,effects:f,declared:Oe,persist:Ee}),he();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,$e=l.subtreeQuery||(Le?e:"["+e+"]");H().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:u,query:$e}),be(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=P);function J(){ae()>0?de(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",J):J(),g}function Q(e){return(e||"").replace(/^#/,"")}function v(e){const t=e===void 0?location.hash:e,n={},r=Q(t);if(!r)return n;const l=r.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const u=o.indexOf(":"),i=u>-1?o.slice(0,u):o,c=u>-1?o.slice(u+1):"";if(i)try{n[i]=decodeURIComponent(c)}catch{n[i]=c}}return n}function ge(e){if(!e)return null;const t=v();return e in t?t[e]:null}function me(e,t){if(!e)return;const n=v();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");Q(location.hash)!==l&&(location.hash=l)}function Ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ye(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ae(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ve(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 _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function xe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=v,window.lnCore.hashGet=ge,window.lnCore.hashSet=me,window.lnCore.hashLinkClick=Ce,window.lnCore.resolveHashNamespace=ye,window.lnCore.hashSortEncode=Ae,window.lnCore.hashSortDecode=ve,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=xe);function Se(){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=Se);function ke(e,t="-"){if(e==null)return"";const n=t||"-",r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,n).replace(new RegExp(`${r}+`,"g"),n).replace(new RegExp(`^${r}+|${r}+$`,"g"),"")}(function(){const e="data-ln-slug-from",t="lnSlug";if(window[t]!==void 0)return;const n={"data-ln-slug-from":{prop:"sourceName",type:"string",read:b,fallback:"",description:"Name of the source input field to derive URL slug from"}},r=W(n),l=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(o){if(o.tagName!=="INPUT")return console.warn("[ln-slug] Can only be applied to <input>, got:",o.tagName),this;const u=o.form;if(!u)return console.warn("[ln-slug] Slug input is not inside a <form>:",o),this;B(this,o,r);const i=u.elements[this.sourceName];if(!i)return console.warn('[ln-slug] Source field "'+this.sourceName+'" not found in form:',o),this;if(typeof i.addEventListener!="function")return console.warn('[ln-slug] Source field "'+this.sourceName+'" is a RadioNodeList (same-name group) — single source field required:',o),this;this.dom=o,this.form=u,this.source=i,this._pristine=o.value==="",this._mirroring=!1;const c=this;return Z(o,l,{get:function(){return l.get.call(o)},set:function(a){l.set.call(o,a),c._mirroring||(c._pristine=a===""||a===null||a===void 0)}}),this._onSource=function(){c._pristine&&c._mirror()},this._onSlug=function(){c._mirroring||(c._pristine=c.dom.value==="")},this._onFormReset=function(){setTimeout(function(){c._pristine=c.dom.value===""},0)},i.addEventListener("input",this._onSource),o.addEventListener("input",this._onSlug),u.addEventListener("reset",this._onFormReset),this._pristine&&i.value&&i.value.trim()!==""&&this._mirror(),this}s.prototype._mirror=function(){this._mirroring=!0,this.dom.value=ke(this.source.value),this.dom.dispatchEvent(new Event("input",{bubbles:!0})),this._mirroring=!1},s.prototype.destroy=function(){this.dom[t]&&(this.source.removeEventListener("input",this._onSource),this.dom.removeEventListener("input",this._onSlug),this._onFormReset&&this.form&&this.form.removeEventListener("reset",this._onFormReset),Object.defineProperty(this.dom,"value",l),delete this.dom[t])},P(e,t,s,"ln-slug",{attributes:n})})()})();
@@ -1,4 +1,4 @@
1
- import { registerComponent, defineAttrs, attrSpec, attrStr } from '../../ln-core';
1
+ import { registerComponent, defineAttrs, attrSpec, attrStr, interceptValueProperty } from '../../ln-core';
2
2
  import { generateSlug } from './slug-model.js';
3
3
 
4
4
  (function () {
@@ -12,6 +12,7 @@ import { generateSlug } from './slug-model.js';
12
12
  'data-ln-slug-from': { prop: 'sourceName', type: 'string', read: attrStr, fallback: '', description: 'Name of the source input field to derive URL slug from' }
13
13
  };
14
14
  const ATTR_SPEC = attrSpec(ATTRIBUTES);
15
+ const _inputValueDesc = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
15
16
 
16
17
  function _component(dom) {
17
18
  if (dom.tagName !== 'INPUT') {
@@ -35,12 +36,25 @@ import { generateSlug } from './slug-model.js';
35
36
  }
36
37
 
37
38
  this.dom = dom;
39
+ this.form = form;
38
40
  this.source = source;
39
41
  this._pristine = dom.value === '';
40
42
  this._mirroring = false;
41
43
 
42
44
  const self = this;
43
45
 
46
+ interceptValueProperty(dom, _inputValueDesc, {
47
+ get: function () {
48
+ return _inputValueDesc.get.call(dom);
49
+ },
50
+ set: function (val) {
51
+ _inputValueDesc.set.call(dom, val);
52
+ if (!self._mirroring) {
53
+ self._pristine = (val === '' || val === null || val === undefined);
54
+ }
55
+ }
56
+ });
57
+
44
58
  this._onSource = function () {
45
59
  if (!self._pristine) return;
46
60
  self._mirror();
@@ -49,9 +63,15 @@ import { generateSlug } from './slug-model.js';
49
63
  if (self._mirroring) return;
50
64
  self._pristine = (self.dom.value === '');
51
65
  };
66
+ this._onFormReset = function () {
67
+ setTimeout(function () {
68
+ self._pristine = (self.dom.value === '');
69
+ }, 0);
70
+ };
52
71
 
53
72
  source.addEventListener('input', this._onSource);
54
73
  dom.addEventListener('input', this._onSlug);
74
+ form.addEventListener('reset', this._onFormReset);
55
75
 
56
76
  // Initial check — if source field already has text and slug is pristine, mirror immediately
57
77
  if (this._pristine && source.value && source.value.trim() !== '') {
@@ -72,6 +92,10 @@ import { generateSlug } from './slug-model.js';
72
92
  if (!this.dom[DOM_ATTRIBUTE]) return;
73
93
  this.source.removeEventListener('input', this._onSource);
74
94
  this.dom.removeEventListener('input', this._onSlug);
95
+ if (this._onFormReset && this.form) {
96
+ this.form.removeEventListener('reset', this._onFormReset);
97
+ }
98
+ Object.defineProperty(this.dom, 'value', _inputValueDesc);
75
99
  delete this.dom[DOM_ATTRIBUTE];
76
100
  };
77
101
 
@@ -1 +1 @@
1
- (function(){"use strict";function V(){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 I(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!I(r))return}e.apply(console,t)}}function te(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function W(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function O(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}const U={};function ne(e,t){U[e]=t}function re(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){te(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const K={};function le(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];K[n]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return K[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const L={};function ue(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=L[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function P(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const u=n[l],c=u.getAttribute("data-ln-field");t[c]!=null&&(u.textContent=t[c])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const u=r[l],c=u.getAttribute("data-ln-attr").split(",");for(let d=0;d<c.length;d++){const b=c[d].trim().split(":");if(b.length!==2)continue;const f=b[0].trim(),C=b[1].trim();t[C]!=null&&u.setAttribute(f,t[C])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const u=o[l],c=u.getAttribute("data-ln-show");c in t&&u.classList.toggle("hidden",!t[c])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const u=i[l],c=u.getAttribute("data-ln-class").split(",");for(let d=0;d<c.length;d++){const b=c[d].trim().split(":");if(b.length!==2)continue;const f=b[0].trim(),C=b[1].trim();C in t&&u.classList.toggle(f,!!t[C])}}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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)P(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function Q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,u){return t[u]!==void 0?t[u]:""}))}const r=function(i,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let i=0;i<o.length;i++){const l=o[i],u=l.attributes;for(let c=0;c<u.length;c++){const d=u[c];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ae(e,t,n,r,o,i){const l={};for(let c=0;c<e.children.length;c++){const d=e.children[c],b=d.getAttribute("data-ln-render-key");b&&(l[b]=d)}const u=document.createDocumentFragment();for(let c=0;c<t.length;c++){const d=t[c],b=String(r(d));let f=l[b];if(f)o(f,d,c);else{const C=ue(n,i);if(!C||(Q(C,d),f=C.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",b),o(f,d,c)}u.appendChild(f)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=P,window.lnCore.lnFill=ce,window.lnCore.renderList=ae);function D(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function de(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function fe(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function he(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const N=new Map;function we(e,t){const n=(e?e.join("|"):"")+"::"+t;if(N.has(n))return N.get(n);const r=new Set(e||[]),o=function(i,l){const u=i.getAttribute(l);return u!==null&&r.has(u)?u:t};return N.set(n,o),o}function be(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function pe(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function z(e,t,n,r,o){if(!e||t===null)return!0;const i=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const u=c=>{o?console.warn(c,o):console.warn(c)};if(l==="boolean"){const c=t.trim().toLowerCase();return c!==""&&c!=="true"&&c!=="false"&&c!=="1"&&c!=="0"?(u(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const c=e.values||[];return c.includes(t)?!0:(u(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${c.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return u(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const c=parseInt(t,10);return e.min!==void 0&&c<e.min?(u(`[${i}] Value ${c} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&c>e.max?(u(`[${i}] Value ${c} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(u(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(c){return u(`[${i}] Invalid JSON for attribute "${n}": ${c.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const r in n){const[o,i,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,i,l)},enumerable:!0,configurable:!0})}return e}function me(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=we(r.values,r.fallback);break;case"integer":o=de;break;case"float":o=be;break;case"boolean":o=fe;break;case"list":o=he;break;case"json":o=pe;break;case"string":default:o=D;break}o||(o=D),t[r.prop]=[o,n,r.fallback]}return t}function ye(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function $(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const u of l)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new r(u)}catch(c){console.error("["+n+"] init failed",u,c)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function q(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=J(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(i=>i.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ce(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function G(e,t,n,r){for(let o=0;o<e.length;o++){const i=e[o];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function Se(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=J(),o=r.byAttr.get(n);if(V()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&I(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let u=0;u<i.length;u++)z(i[u].spec,l,n,i[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&G(i,t,n,e.oldValue),r.reactiveWildcard.length&&G(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let i=0;i<o.length;i++){const l=o[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):($(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Se(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function xe(e){const t=X();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,i=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o];$(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o],l=i.query,u=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&u.push(r);for(let c=0;c<u.length;c++){const d=u[c];if(!document.contains(d)){const b=d[i.attribute];if(b&&typeof b.destroy=="function")try{b.destroy()}catch(f){console.error("["+i.attribute+"] destroy failed",d,f)}delete d[i.attribute]}}}}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{xe(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,u=o.onSubtreeChange||null,c=o.onInit||null,d=o.onAttrChange||null,b=o.effects||null,f=o.attributes||null,C=f?ye(f):b,a=f?new Set(Object.keys(f)):null,m=o.persist||null;function s(S){const w=S||document.body;if($(w,e,t,n),f&&V())for(const A in f){const j=f[A],v=Array.from(w.querySelectorAll("["+A+"]"));w.matches&&w.matches("["+A+"]")&&v.push(w);for(let x=0;x<v.length;x++){const k=v[x];I(k)&&z(j,k.getAttribute(A),A,r,k)}}c&&c(w)}const g=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let w;for(;(w=S.exec(e))!==null;)g.push(w[1])}else g.push(e);_e({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:c,observed:g.concat(i),onAttributeChange:l,onAttrChange:d,effects:C,declared:a,persist:m}),ve();const p=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";X().push({selector:e,attribute:t,ComponentFn:n,onInit:c,onSubtreeChange:u,query:p}),ke(),window[t]=s;function y(){Ae()>0?q(function(){s(document.body)}):s(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),s}function Te(e){let t=!1;for(let n=0;n<e.length;n++){const r=e[n];if(!(r===""||r==null)&&(t=!0,!Number.isFinite(Number(r))))return"string"}return t?"number":"string"}function Ie(e,t,n,r){if(n==="number"){const l=parseFloat(e),u=parseFloat(t);return(isNaN(l)?0:l)-(isNaN(u)?0:u)}const o=e!=null?String(e):"",i=t!=null?String(t):"";return r?r.compare(o,i):o<i?-1:o>i?1:0}function Y(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,n={},r=Y(t);if(!r)return n;const o=r.split("&");for(let i=0;i<o.length;i++){const l=o[i];if(!l)continue;const u=l.indexOf(":"),c=u>-1?l.slice(0,u):l,d=u>-1?l.slice(u+1):"";if(c)try{n[c]=decodeURIComponent(d)}catch{n[c]=d}}return n}function B(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Z(e,t){if(!e)return;const n=R();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");Y(location.hash)!==o&&(location.hash=o)}function Oe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function T(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function F(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 De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=B,window.lnCore.hashSet=Z,window.lnCore.hashLinkClick=Oe,window.lnCore.resolveHashNamespace=T,window.lnCore.hashSortEncode=ee,window.lnCore.hashSortDecode=F,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=De);function Ne(){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=Ne);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function $e(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function qe(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function Re(e,t,n,r){const o=_(e);if(o==="none")return()=>0;const i=o==="desc"?-1:1,l=typeof r=="function"?r:u=>u;return function(u,c){const d=l(u),b=l(c);return Ie(d,b,t,n)*i}}function M(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function Be(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const n=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(n&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(n));if(e.tagName==="TABLE"){const r=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(r)return Array.from(r.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",n="data-ln-sort-field",r="data-ln-sort-state",o="data-ln-sort-dir",i="data-ln-hash";if(window[t]!==void 0)return;function l(a,m){return a.getAttribute(m)||null}const u={"data-ln-sort":{prop:"targetId",type:"string",read:D,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:l,effect:C,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:l,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:C,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:C,description:"URL hash routing key for sort state persistence"}},c=me(u),d=new WeakMap;function b(a,m,s){if(m){const g=a.querySelector('[data-ln-field="'+m+'"]');return g?O(g):""}return s!=null&&a.cells&&a.cells[s]?O(a.cells[s]):O(a)}function f(a){this.dom=a,ge(this,a,c);const m=a.closest("th");this.column=!this.field&&m?m.cellIndex:null,this._state=_(a.getAttribute(r)),a.hasAttribute(r)||a.setAttribute(r,this._state),this._destroyed=!1,this.nsKey=T(a,"sort"),this.hashEnabled=!!this.nsKey;const s=this;this._onClick=function(h){const p=h.target.closest("["+o+"]");if(!p)return;const y=_(p.getAttribute(o));s._apply(y)},a.addEventListener("click",this._onClick),this._onSortChange=function(h){if(s._destroyed||!h.detail)return;const p=s._resolveTarget();if(!(p&&(h.target===p||p.contains(h.target))||h.detail.targetId&&h.detail.targetId===s.targetId))return;if(qe({field:s.field,column:s.column},{field:h.detail.field,column:h.detail.column})){const w=_(h.detail.direction);w&&a.getAttribute(r)!==w&&(s._state=w,a.setAttribute(r,w),s._updateAriaSort(w));return}a.getAttribute(r)!=="none"&&(s._state="none",a.setAttribute(r,"none"),s._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(s._destroyed||!s.hashEnabled)return;const h=B(s.nsKey),p=F(h);if(p)s.field!==null&&p.fieldOrColumn===s.field||s.column!==null&&String(s.column)===p.fieldOrColumn?s._state!==p.direction&&s._apply(p.direction,!0):s._state!=="none"&&(s._state="none",a.setAttribute(r,"none"),s._updateAriaSort("none"));else if(s._state!=="none"){s._state="none",a.setAttribute(r,"none"),s._updateAriaSort("none");const y=s._resolveTarget();y&&(W(y,"ln-sort:change",{field:s.field,column:s.column,direction:"none",targetId:s.targetId}).defaultPrevented||s._defaultSort(y,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let g=!1;if(this.hashEnabled){const h=B(this.nsKey),p=F(h);p&&((s.field!==null&&p.fieldOrColumn===s.field||s.column!==null&&String(s.column)===p.fieldOrColumn)&&q(function(){s._destroyed||s._apply(p.direction,!0)}),g=!0)}if(!g){const h=_(a.getAttribute(r));h&&h!=="none"&&q(function(){s._destroyed||s._apply(h,!0)})}return this}f.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},f.prototype._updateAriaSort=function(a){const m=this.dom.closest("th");m&&m.setAttribute("aria-sort",$e(a))},f.prototype._apply=function(a,m){if(this._destroyed)return;if(!this.field&&this.column===null){const y=this.dom.closest("th");y&&y.cellIndex!==void 0&&(this.column=y.cellIndex)}const s=_(a);this._state=s,this.dom.getAttribute(r)!==s&&this.dom.setAttribute(r,s),this._updateAriaSort(s);const g=this._resolveTarget();if(!g)return;const h={field:this.field,column:this.column,direction:s,targetId:this.targetId};if(!m&&this.hashEnabled){const y=ee(this.field!==null?this.field:this.column,s);Z(this.nsKey,y)}W(g,"ln-sort:change",h).defaultPrevented||this._defaultSort(g,s)},f.prototype._defaultSort=function(a,m){const s=Be(a,this.itemsSelector);if(!s.length)return;const g=s[0].parentNode,h=s.filter(function(w){return!M(w)});if(!h.length)return;d.has(a)||d.set(a,h.slice());let p;if(m==="none"){const w=d.get(a)||h;d.delete(a),p=w.filter(function(A){return A.parentNode===g&&!M(A)})}else{const w=this.field,A=this.column,j=h.map(function(H){return b(H,w,A)}),v=Te(j),x=typeof Intl<"u"?new Intl.Collator(oe(this.dom),{sensitivity:"base",numeric:!0}):null,k=Re(m,v,x,function(H){return b(H,w,A)});p=h.slice().sort(k)}const y=document.createDocumentFragment();let S=0;for(let w=0;w<s.length;w++){const A=s[w];M(A)?y.appendChild(A):S<p.length&&y.appendChild(p[S++])}g.appendChild(y)},f.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function C(a,m){const s=a[t];if(!(!s||s._destroyed))if(m===n){const g=a.closest("th");s.column=!s.field&&g?g.cellIndex:null}else if(m===r){const g=_(a.getAttribute(r));g!==s._state&&s._apply(g)}else m===i&&(s.hashEnabled&&s._onHashChange&&window.removeEventListener("hashchange",s._onHashChange),s.nsKey=T(a,"sort"),s.hashEnabled=!!s.nsKey,s.hashEnabled&&window.addEventListener("hashchange",s._onHashChange))}Ee(e,t,f,"ln-sort",{attributes:u,persist:{attr:r,hashActive:function(a){return!!T(a,"sort")}}})})()})();
1
+ (function(){"use strict";function V(){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 O(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!O(r))return}e.apply(console,t)}}function ce(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function W(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function L(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function de(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const l=s[a];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let a=0;a<s.length;a++){const l=s[a];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let c=0;c<l.options.length;c++)l.options[c].selected&&o[l.name].push(l.options[c].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const c=Number(l.value);o[l.name]=l.value===""||isNaN(c)?null:c}else o[l.name]=l.value}return o}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function we(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const l=t[a];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const c=String(l).split(",").map(function(w){return w.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=he(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let c=0;c<i.options.length;c++)i.options[c].selected=l.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=de);const U={};function pe(e,t){U[e]=t}function be(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=pe,window.lnCore.getDataMapper=be);function ge(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){ce(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const K={};function ye(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];K[n]=t}function Ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return K[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ye,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=me);const D={};function Ae(e,t){D[e]||(D[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=D[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],l=a.getAttribute("data-ln-field");t[l]!=null&&(a.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],l=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<l.length;c++){const w=l[c].trim().split(":");if(w.length!==2)continue;const f=w[0].trim(),C=w[1].trim();t[C]!=null&&a.setAttribute(f,t[C])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],l=a.getAttribute("data-ln-show");l in t&&a.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],l=a.getAttribute("data-ln-class").split(",");for(let c=0;c<l.length;c++){const w=l[c].trim().split(":");if(w.length!==2)continue;const f=w[0].trim(),C=w[1].trim();C in t&&a.classList.toggle(f,!!t[C])}}return e}function _e(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)z(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function P(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let l=0;l<a.length;l++){const c=a[l];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ve(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const c=e.children[l],w=c.getAttribute("data-ln-render-key");w&&(i[w]=c)}const a=document.createDocumentFragment();for(let l=0;l<t.length;l++){const c=t[l],w=String(r(c));let f=i[w];if(f)o(f,c,l);else{const C=Ae(n,s);if(!C||(P(C,c),f=C.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",w),o(f,c,l)}a.appendChild(f)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=z,window.lnCore.lnFill=_e,window.lnCore.renderList=ve);function I(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Q(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function J(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const N=new Map;function X(e,t){const n=(e?e.join("|"):"")+"::"+t;if(N.has(n))return N.get(n);const r=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return N.set(n,o),o}function Y(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function ee(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(a(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(a(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return a(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function te(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function ne(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=X(r.values,r.fallback);break;case"integer":o=Q;break;case"float":o=Y;break;case"boolean":o=J;break;case"list":o=G;break;case"json":o=Z;break;case"string":default:o=I;break}o||(o=I),t[r.prop]=[o,n,r.fallback]}return t}function Se(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function xe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=te,window.lnCore.attrSpec=ne,window.lnCore.attrStr=I,window.lnCore.attrInt=Q,window.lnCore.attrBool=J,window.lnCore.attrList=G,window.lnCore.attrEnum=X,window.lnCore.attrFloat=Y,window.lnCore.attrJson=Z);function F(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(l){console.error("["+n+"] init failed",a,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ke(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function q(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 re(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ee(e){const t=re(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=xe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function oe(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Ie(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=re(),o=r.byAttr.get(n);if(V()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&O(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<s.length;a++)ee(s[a].spec,i,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&oe(s,t,n,e.oldValue),r.reactiveWildcard.length&&oe(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(F(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ie(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ie(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Oe(e){const t=ie();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];F(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let l=0;l<a.length;l++){const c=a[l];if(!document.contains(c)){const w=c[s.attribute];if(w&&typeof w.destroy=="function")try{w.destroy()}catch(f){console.error("["+s.attribute+"] destroy failed",c,f)}delete c[s.attribute]}}}}}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Oe(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,l=o.onInit||null,c=o.onAttrChange||null,w=o.effects||null,f=o.attributes||null,C=f?Se(f):w,d=f?new Set(Object.keys(f)):null,m=o.persist||null;function u(v){const p=v||document.body;if(F(p,e,t,n),f&&V())for(const A in f){const j=f[A],S=Array.from(p.querySelectorAll("["+A+"]"));p.matches&&p.matches("["+A+"]")&&S.push(p);for(let x=0;x<S.length;x++){const k=S[x];O(k)&&ee(j,k.getAttribute(A),A,r,k)}}l&&l(p)}const g=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let p;for(;(p=v.exec(e))!==null;)g.push(p[1])}else g.push(e);Ee({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:g.concat(s),onAttributeChange:i,onAttrChange:c,effects:C,declared:d,persist:m}),Te();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,b=o.subtreeQuery||(h?e:"["+e+"]");ie().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:a,query:b}),Le(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le);function y(){ke()>0?q(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),u}function De(e){let t=!1;for(let n=0;n<e.length;n++){const r=e[n];if(!(r===""||r==null)&&(t=!0,!Number.isFinite(Number(r))))return"string"}return t?"number":"string"}function Ne(e,t,n,r){if(n==="number"){const i=parseFloat(e),a=parseFloat(t);return(isNaN(i)?0:i)-(isNaN(a)?0:a)}const o=e!=null?String(e):"",s=t!=null?String(t):"";return r?r.compare(o,s):o<s?-1:o>s?1:0}function se(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=se(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),l=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(l)try{n[l]=decodeURIComponent(c)}catch{n[l]=c}}return n}function R(e){if(!e)return null;const t=$();return e in t?t[e]:null}function ae(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");se(location.hash)!==o&&(location.hash=o)}function Fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function T(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function B(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 qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=R,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=T,window.lnCore.hashSortEncode=ue,window.lnCore.hashSortDecode=B,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=$e);function Re(){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=Re);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function Be(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function Me(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function je(e,t,n,r){const o=_(e);if(o==="none")return()=>0;const s=o==="desc"?-1:1,i=typeof r=="function"?r:a=>a;return function(a,l){const c=i(a),w=i(l);return Ne(c,w,t,n)*s}}function M(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function He(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const n=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(n&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(n));if(e.tagName==="TABLE"){const r=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(r)return Array.from(r.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",n="data-ln-sort-field",r="data-ln-sort-state",o="data-ln-sort-dir",s="data-ln-hash";if(window[t]!==void 0)return;function i(d,m){return d.getAttribute(m)||null}const a={"data-ln-sort":{prop:"targetId",type:"string",read:I,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:i,effect:C,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:i,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:C,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:C,description:"URL hash routing key for sort state persistence"}},l=ne(a),c=new WeakMap;function w(d,m,u){if(m){const g=d.querySelector('[data-ln-field="'+m+'"]');return g?L(g):""}return u!=null&&d.cells&&d.cells[u]?L(d.cells[u]):L(d)}function f(d){this.dom=d,te(this,d,l);const m=d.closest("th");this.column=!this.field&&m?m.cellIndex:null,this._state=_(d.getAttribute(r)),d.hasAttribute(r)||d.setAttribute(r,this._state),this._destroyed=!1,this.nsKey=T(d,"sort"),this.hashEnabled=!!this.nsKey;const u=this;this._onClick=function(h){const b=h.target.closest("["+o+"]");if(!b)return;const y=_(b.getAttribute(o));u._apply(y)},d.addEventListener("click",this._onClick),this._onSortChange=function(h){if(u._destroyed||!h.detail)return;const b=u._resolveTarget();if(!(b&&(h.target===b||b.contains(h.target))||h.detail.targetId&&h.detail.targetId===u.targetId))return;if(Me({field:u.field,column:u.column},{field:h.detail.field,column:h.detail.column})){const p=_(h.detail.direction);p&&d.getAttribute(r)!==p&&(u._state=p,d.setAttribute(r,p),u._updateAriaSort(p));return}d.getAttribute(r)!=="none"&&(u._state="none",d.setAttribute(r,"none"),u._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(u._destroyed||!u.hashEnabled)return;const h=R(u.nsKey),b=B(h);if(b)u.field!==null&&b.fieldOrColumn===u.field||u.column!==null&&String(u.column)===b.fieldOrColumn?u._state!==b.direction&&u._apply(b.direction,!0):u._state!=="none"&&(u._state="none",d.setAttribute(r,"none"),u._updateAriaSort("none"));else if(u._state!=="none"){u._state="none",d.setAttribute(r,"none"),u._updateAriaSort("none");const y=u._resolveTarget();y&&(W(y,"ln-sort:change",{field:u.field,column:u.column,direction:"none",targetId:u.targetId}).defaultPrevented||u._defaultSort(y,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let g=!1;if(this.hashEnabled){const h=R(this.nsKey),b=B(h);b&&((u.field!==null&&b.fieldOrColumn===u.field||u.column!==null&&String(u.column)===b.fieldOrColumn)&&q(function(){u._destroyed||u._apply(b.direction,!0)}),g=!0)}if(!g){const h=_(d.getAttribute(r));h&&h!=="none"&&q(function(){u._destroyed||u._apply(h,!0)})}return this}f.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},f.prototype._updateAriaSort=function(d){const m=this.dom.closest("th");m&&m.setAttribute("aria-sort",Be(d))},f.prototype._apply=function(d,m){if(this._destroyed)return;if(!this.field&&this.column===null){const y=this.dom.closest("th");y&&y.cellIndex!==void 0&&(this.column=y.cellIndex)}const u=_(d);this._state=u,this.dom.getAttribute(r)!==u&&this.dom.setAttribute(r,u),this._updateAriaSort(u);const g=this._resolveTarget();if(!g)return;const h={field:this.field,column:this.column,direction:u,targetId:this.targetId};if(!m&&this.hashEnabled){const y=ue(this.field!==null?this.field:this.column,u);ae(this.nsKey,y)}W(g,"ln-sort:change",h).defaultPrevented||this._defaultSort(g,u)},f.prototype._defaultSort=function(d,m){const u=He(d,this.itemsSelector);if(!u.length)return;const g=u[0].parentNode,h=u.filter(function(p){return!M(p)});if(!h.length)return;c.has(d)||c.set(d,h.slice());let b;if(m==="none"){const p=c.get(d)||h;c.delete(d),b=p.filter(function(A){return A.parentNode===g&&!M(A)})}else{const p=this.field,A=this.column,j=h.map(function(H){return w(H,p,A)}),S=De(j),x=typeof Intl<"u"?new Intl.Collator(ge(this.dom),{sensitivity:"base",numeric:!0}):null,k=je(m,S,x,function(H){return w(H,p,A)});b=h.slice().sort(k)}const y=document.createDocumentFragment();let v=0;for(let p=0;p<u.length;p++){const A=u[p];M(A)?y.appendChild(A):v<b.length&&y.appendChild(b[v++])}g.appendChild(y)},f.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function C(d,m){const u=d[t];if(!(!u||u._destroyed))if(m===n){const g=d.closest("th");u.column=!u.field&&g?g.cellIndex:null}else if(m===r){const g=_(d.getAttribute(r));g!==u._state&&u._apply(g)}else m===s&&(u.hashEnabled&&u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=T(d,"sort"),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange))}le(e,t,f,"ln-sort",{attributes:a,persist:{attr:r,hashActive:function(d){return!!T(d,"sort")}}})})()})();