@livenetworks/ashlar 2.1.4 → 2.1.5

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 (56) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-api-connector/ln-api-connector.js +1 -1
  4. package/components/ln-api-queue/ln-api-queue.js +1 -1
  5. package/components/ln-autosave/ln-autosave.js +1 -1
  6. package/components/ln-chart/ln-chart.js +1 -1
  7. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  8. package/components/ln-confirm/ln-confirm.js +1 -1
  9. package/components/ln-core/helpers.js +1 -1
  10. package/components/ln-core/index.js +1 -1
  11. package/components/ln-core/lifecycle.js +41 -0
  12. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  13. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  14. package/components/ln-data-store/ln-data-store.js +1 -1
  15. package/components/ln-date/ln-date.js +1 -1
  16. package/components/ln-debug/ln-debug.js +1 -1
  17. package/components/ln-dropdown/ln-dropdown.js +1 -1
  18. package/components/ln-editor/ln-editor.js +1 -1
  19. package/components/ln-external-links/ln-external-links.js +1 -1
  20. package/components/ln-filter/ln-filter.js +1 -1
  21. package/components/ln-form/ln-form.js +1 -1
  22. package/components/ln-icon/ln-icon.js +1 -1
  23. package/components/ln-include/ln-include.js +1 -1
  24. package/components/ln-key/ln-key.js +1 -1
  25. package/components/ln-link/ln-link.js +1 -1
  26. package/components/ln-list/ln-list.js +1 -1
  27. package/components/ln-modal/ln-modal.js +1 -1
  28. package/components/ln-nav/ln-nav.js +1 -1
  29. package/components/ln-number/ln-number.js +1 -1
  30. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  31. package/components/ln-options/ln-options.js +1 -1
  32. package/components/ln-picklist/ln-picklist.js +1 -1
  33. package/components/ln-popover/ln-popover.js +1 -1
  34. package/components/ln-progress/ln-progress.js +1 -1
  35. package/components/ln-router/ln-router.js +1 -1
  36. package/components/ln-scroll/ln-scroll.js +1 -1
  37. package/components/ln-search/ln-search.js +1 -1
  38. package/components/ln-slug/ln-slug.js +1 -1
  39. package/components/ln-sort/ln-sort.js +1 -1
  40. package/components/ln-sort/src/ln-sort.js +13 -11
  41. package/components/ln-sortable/ln-sortable.js +1 -1
  42. package/components/ln-stat/ln-stat.js +1 -1
  43. package/components/ln-table/ln-table.js +1 -1
  44. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  45. package/components/ln-tabs/ln-tabs.js +1 -1
  46. package/components/ln-time/ln-time.js +1 -1
  47. package/components/ln-toast/ln-toast.js +1 -1
  48. package/components/ln-toggle/ln-toggle.js +1 -1
  49. package/components/ln-tooltip/ln-tooltip.js +1 -1
  50. package/components/ln-translations/ln-translations.js +1 -1
  51. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  52. package/components/ln-upload/ln-upload.js +1 -1
  53. package/components/ln-validate/ln-validate.js +1 -1
  54. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  55. package/package.json +1 -1
  56. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function P(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!N(l))return}e.apply(console,t)}}function x(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function de(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function O(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function fe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function he(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&i[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let d=0;d<n.options.length;d++)n.options[d].selected&&o[n.name].push(n.options[d].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const d=Number(n.value);o[n.name]=n.value===""||isNaN(d)?null:d}else o[n.name]=n.value}return o}function we(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function pe(e,t){const r=e.elements,l=[],o={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const n=t[c];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(n).split(",").map(function(b){return b.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=we(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let d=0;d<i.options.length;d++)i.options[d].selected=n.indexOf(i.options[d].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=pe,window.lnCore.serializeForm=he,window.lnCore.resolveFormMethod=fe);const U={};function be(e,t){U[e]=t}function me(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=be,window.lnCore.getDataMapper=me);function ge(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,O(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function _e(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];W[r]=t}function Ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return W[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=_e,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=ge);const M={};function K(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=M[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ye(e,t,r){if(e){const l=e.querySelector('[data-ln-template="'+t+'"]');if(l)return l.content.cloneNode(!0)}return K(t,r)}function V(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<n.length;d++){const b=n[d].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),v=b[1].trim();t[v]!=null&&c.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let d=0;d<n.length;d++){const b=n[d].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),v=b[1].trim();v in t&&c.classList.toggle(m,!!t[v])}}return e}function ve(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)V(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function Q(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let n=0;n<c.length;n++){const d=c[n];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function Ae(e,t,r,l,o,s){const i={};for(let n=0;n<e.children.length;n++){const d=e.children[n],b=d.getAttribute("data-ln-render-key");b&&(i[b]=d)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const d=t[n],b=String(l(d));let m=i[b];if(m)o(m,d,n);else{const v=K(r,s);if(!v||(Q(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),o(m,d,n)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=V,window.lnCore.lnFill=ve,window.lnCore.renderList=Ae);function I(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function z(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function J(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const B=new Map;function X(e,t){const r=(e?e.join("|"):"")+"::"+t;if(B.has(r))return B.get(r);const l=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&l.has(c)?c:t};return B.set(r,o),o}function Y(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function Z(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function ee(e,t,r,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function xe(e,t,r){for(const l in r){const[o,s,i]=r[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function Se(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=X(l.values,l.fallback);break;case"integer":o=z;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[l.prop]=[o,r,l.fallback]}return t}function ke(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function Le(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=xe,window.lnCore.attrSpec=Se,window.lnCore.attrStr=I,window.lnCore.attrInt=z,window.lnCore.attrBool=J,window.lnCore.attrList=G,window.lnCore.attrEnum=X,window.lnCore.attrFloat=Y,window.lnCore.attrJson=Z);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function te(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&L(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)L(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(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 Oe(e){const t=ne(),r=e.observed||[];for(let l=0;l<r.length;l++){const o=r[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Le(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function re(e,t,r,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function De(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=ne(),o=l.byAttr.get(t),s=P()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&N(i)){const c=l.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let d=0;d<c.length;d++)ee(c[d].spec,n,t,c[d].componentTag,i)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&re(c,i,t,e.oldValue),l.reactiveWildcard.length&&re(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(te(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function qe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,O(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{De(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function H(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ne(e){const t=F();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=R();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&L(s,n);else if(s.matches&&s.matches(n.query)&&L(s,n),s.querySelectorAll){const d=s.querySelectorAll(n.query);for(let b=0;b<d.length;b++)L(d[b],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],d=n.query;if(d){if(!i)s.matches&&s.matches(d)&&H(s,n);else if(s.matches&&s.matches(d)&&H(s,n),s.querySelectorAll){const b=s.querySelectorAll(d);for(let m=0;m<b.length;m++)H(b[m],n)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,O(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{Ne(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Me(e){F().push(e),e.onSubtreeChange&&e.query&&R().push(e),oe()}function ie(e,t,r,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,d=o.onAttrChange||null,b=o.effects||null,m=o.attributes||null,v=m?ke(m):b,j=m?new Set(Object.keys(m)):null,D=o.persist||null;function S(C){const w=C||document.body;if(te(w,e,t,r),m&&P())for(const g in m){const p=m[g],_=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&_.push(w);for(let A=0;A<_.length;A++){const k=_[A];N(k)&&ee(p,k.getAttribute(g),g,l,k)}}n&&n(w)}const E=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let w;for(;(w=C.exec(e))!==null;)E.push(w[1])}else E.push(e);Oe({selector:e,attribute:t,componentTag:l,attributes:m,ComponentFn:r,onInit:n,observed:E.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:j,persist:D}),qe();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=o.subtreeQuery||(u?e:"["+e+"]"),f={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:a};F().push(f),c&&a&&R().push(f),oe(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ie,window.lnCore.observeLifecycle=Me);function h(){Ee()>0?Te(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),S}function le(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,r={},l=le(t);if(!l)return r;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,d=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(d)}catch{r[n]=d}}return r}function Ie(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Be(e,t){if(!e)return;const r=$();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");le(location.hash)!==o&&(location.hash=o)}function Fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function $e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function je(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Ie,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=He,window.lnCore.hashSortDecode=$e,window.lnCore.hashFilterEncode=je,window.lnCore.hashFilterDecode=Pe);function Ue(){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=Ue),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const r={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},l={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},o={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},i={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function n(u){return!!(o[u]||s[u]||i[u]||u==="link")}function d(u){this.dom=u;const a=this;if(this._textarea=u.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",u),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const p=u.querySelector('label[for="'+h+'"]');p&&(p.id||(p.id=h+"-label"),this._surface.setAttribute("aria-labelledby",p.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const C=this._textarea.value.trim();C&&(this._surface.innerHTML=C);const w=u.querySelector('[role="toolbar"]');if(w&&w.nextSibling?u.insertBefore(this._surface,w.nextSibling):u.appendChild(this._surface),w){w.setAttribute("aria-controls",this._surface.id);const p=w.querySelectorAll("[data-ln-editor-action]");for(let _=0;_<p.length;_++){const A=p[_].getAttribute("data-ln-editor-action");n(A)&&p[_].setAttribute("aria-pressed","false")}}this._onInput=function(){a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom})},this._onMousedownToolbar=function(p){p.target.closest("[data-ln-editor-action]")&&p.preventDefault()},this._onClickToolbar=function(p){const _=p.target.closest("[data-ln-editor-action]");if(!_)return;const A=_.getAttribute("data-ln-editor-action");a._execAction(A)},this._onPaste=function(p){v(a,p)},this._onKeydown=function(p){S(a,p)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){a._rafSelection||(a._rafSelection=requestAnimationFrame(function(){a._rafSelection=null,document.contains(a._surface)&&a._updateActiveStates()}))},this._attachSelection=function(){a._listeningSelection||(a._listeningSelection=!0,document.addEventListener("selectionchange",a._onSelectionChange))},this._detachSelection=function(){a._listeningSelection&&(a._listeningSelection=!1,document.removeEventListener("selectionchange",a._onSelectionChange)),a._rafSelection&&(cancelAnimationFrame(a._rafSelection),a._rafSelection=null)},this._onFocus=function(){a._attachSelection(),a._updateActiveStates(),x(a.dom,"ln-editor:focus",{target:a.dom})},this._onBlur=function(){a._detachSelection(),a._syncToTextarea(),x(a.dom,"ln-editor:blur",{target:a.dom})},this._onTextareaInput=function(){a._surface.innerHTML!==a._textarea.value&&(a._surface.innerHTML=a._textarea.value,x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),w&&(w.addEventListener("mousedown",this._onMousedownToolbar),w.addEventListener("click",this._onClickToolbar)),this._onSetContent=function(p){const _=p.detail&&p.detail.html;_!==void 0&&(a._surface.innerHTML=_,a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const g=this._textarea.form;return g&&(this._onFormReset=function(){setTimeout(function(){a._surface.innerHTML=a._textarea.value,x(u,"ln-editor:changed",{html:a._textarea.value,target:u})},0)},g.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(u){if(!(!u||de(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[u])document.execCommand(o[u],!1,null);else if(s[u]){const f=s[u],h=b(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else i[u]?document.execCommand(i[u],!1,null):u==="link"?E(this):u==="unlink"?document.execCommand("unlink",!1,null):u==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const u=this.dom.querySelector('[role="toolbar"]');if(!u)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=a.anchorNode;if(!f||!this._surface.contains(f))return;const h=u.querySelectorAll("[data-ln-editor-action]");for(let C=0;C<h.length;C++){const w=h[C],g=w.getAttribute("data-ln-editor-action");let p=!1;if(o[g])try{p=document.queryCommandState(o[g])}catch{}else if(s[g]){const _=b(this._surface);p=_&&_.toLowerCase()===s[g]}else if(i[g])try{p=document.queryCommandState(i[g])}catch{}else g==="link"&&(p=!!m(a.anchorNode,"A",this._surface));if(n(g)){const _=String(p);w.getAttribute("aria-pressed")!==_&&w.setAttribute("aria-pressed",_)}p?w.classList.contains("ln-editor-active")||w.classList.add("ln-editor-active"):w.classList.contains("ln-editor-active")&&w.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(u){this._surface&&(this._surface.innerHTML=u,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const u=this.dom.querySelector('[role="toolbar"]');u&&(u.removeEventListener("mousedown",this._onMousedownToolbar),u.removeEventListener("click",this._onClickToolbar)),this._detachSelection?this._detachSelection():document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const a=this._textarea?this._textarea.form:null;if(a&&this._onFormReset&&a.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function b(u){const a=window.getSelection();if(!a||a.rangeCount===0)return null;let f=a.anchorNode;if(!f)return null;for(;f&&f!==u;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function m(u,a,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===a)return u;u=u.parentNode}return null}function v(u,a){a.preventDefault();let f="";if(a.clipboardData&&(f=a.clipboardData.getData("text/html"),!f)){const C=a.clipboardData.getData("text/plain");C&&(f=C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=j(f);h&&document.execCommand("insertHTML",!1,h)}function j(u){const a=document.createElement("div");return a.innerHTML=u,D(a),a.innerHTML}function D(u){const a=Array.from(u.childNodes);for(let f=0;f<a.length;f++){const h=a[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(l[h.tagName]){const C=Array.from(h.attributes);for(let w=0;w<C.length;w++){const g=C[w].name;if(h.tagName==="A"&&g==="href"){const p=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(p)||h.removeAttribute("href")}else h.removeAttribute(g)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),D(h)}else{for(;h.firstChild;)u.insertBefore(h.firstChild,h);u.removeChild(h)}}}}function S(u,a){if(!(a.ctrlKey||a.metaKey))return;let f=null;switch(a.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(a.preventDefault(),u._execAction(f))}function E(u){const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=m(a.anchorNode,"A",u._surface),h=a.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const C=ye(u.dom,"ln-editor-link-popover","ln-editor");if(!C)return;const w=C.firstElementChild;if(!w)return;const g=w.querySelector('input[type="url"]'),p=w.querySelector('[data-ln-editor-action="confirm-link"]'),_=w.querySelector('[data-ln-editor-action="cancel-link"]');f&&(g.value=f.getAttribute("href")||"");const A=u.dom.querySelector('[role="toolbar"]');A?A.after(w):u.dom.insertBefore(w,u._surface),g.focus();function k(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function q(){document.removeEventListener("mousedown",ce),u._closeLinkPopover=null,w.remove()}function se(){const y=g.value.trim();if(q(),k(),u._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const ue=m(T.anchorNode,"A",u._surface);ue&&(ue.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function ae(){q(),k(),u._surface.focus()}function We(){q()}function ce(y){const T=u.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!w.contains(y.target)&&!T&&We()}u._closeLinkPopover=q,p.addEventListener("click",se),_.addEventListener("click",ae),g.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),se()):y.key==="Escape"&&(y.preventDefault(),ae())}),document.addEventListener("mousedown",ce)}ie(e,t,d,"ln-editor",{attributes:r})})()})();
1
+ (function(){"use strict";function P(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!N(i))return}e.apply(console,t)}}function x(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function fe(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(o),o}function O(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function he(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function we(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&l[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let d=0;d<n.options.length;d++)n.options[d].selected&&o[n.name].push(n.options[d].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const d=Number(n.value);o[n.name]=n.value===""||isNaN(d)?null:d}else o[n.name]=n.value}return o}function be(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function pe(e,t){const r=e.elements,i=[],o={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[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 n=t[c];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(o[l.name]>1){const d=String(n).split(",").map(function(p){return p.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=be(n);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let d=0;d<l.options.length;d++)l.options[d].selected=n.indexOf(l.options[d].value)!==-1;i.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=pe,window.lnCore.serializeForm=we,window.lnCore.resolveFormMethod=he);const U={};function me(e,t){U[e]=t}function ge(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=me,window.lnCore.getDataMapper=ge);function _e(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,O(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function Ce(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];W[r]=t}function ye(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return W[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ce,window.lnCore.getLocaleFallback=ye,window.lnCore.ensureLocaleObserver=_e);const M={};function K(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=M[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ve(e,t,r){if(e){const i=e.querySelector('[data-ln-template="'+t+'"]');if(i)return i.content.cloneNode(!0)}return K(t,r)}function V(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const c=r[l],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],n=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<n.length;d++){const p=n[d].trim().split(":");if(p.length!==2)continue;const m=p[0].trim(),v=p[1].trim();t[v]!=null&&c.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],n=c.getAttribute("data-ln-class").split(",");for(let d=0;d<n.length;d++){const p=n[d].trim().split(":");if(p.length!==2)continue;const m=p[0].trim(),v=p[1].trim();v in t&&c.classList.toggle(m,!!t[v])}}return e}function Ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)V(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function Q(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let n=0;n<c.length;n++){const d=c[n];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function xe(e,t,r,i,o,s){const l={};for(let n=0;n<e.children.length;n++){const d=e.children[n],p=d.getAttribute("data-ln-render-key");p&&(l[p]=d)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const d=t[n],p=String(i(d));let m=l[p];if(m)o(m,d,n);else{const v=K(r,s);if(!v||(Q(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",p),o(m,d,n)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=V,window.lnCore.lnFill=Ae,window.lnCore.renderList=xe);function I(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function z(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function J(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const B=new Map;function X(e,t){const r=(e?e.join("|"):"")+"::"+t;if(B.has(r))return B.get(r);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return B.set(r,o),o}function Y(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function Z(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function ee(e,t,r,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ke(e,t,r){for(const i in r){const[o,s,l]=r[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function Se(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=X(i.values,i.fallback);break;case"integer":o=z;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[i.prop]=[o,r,i.fallback]}return t}function Le(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function Ee(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ke,window.lnCore.attrSpec=Se,window.lnCore.attrStr=I,window.lnCore.attrInt=z,window.lnCore.attrBool=J,window.lnCore.attrList=G,window.lnCore.attrEnum=X,window.lnCore.attrFloat=Y,window.lnCore.attrJson=Z);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function te(e,t,r,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(s)&&L(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)L(c[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Te(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Oe(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 De(e){const t=ne(),r=e.observed||[];for(let i=0;i<r.length;i++){const o=r[i];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 i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Ee(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function re(e,t,r,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,i):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,i)}}function qe(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=ne(),o=i.byAttr.get(t),s=P()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&N(l)){const c=i.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let d=0;d<c.length;d++)ee(c[d].spec,n,t,c[d].componentTag,l)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const c=i.byReactive.get(t);c&&re(c,l,t,e.oldValue),i.reactiveWildcard.length&&re(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(te(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,O(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{qe(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function H(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=F();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=R();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)s.matches&&s.matches(n.query)&&L(s,n);else if(s.matches&&s.matches(n.query)&&L(s,n),s.querySelectorAll){const d=s.querySelectorAll(n.query);for(let p=0;p<d.length;p++)L(d[p],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],d=n.query;if(d){if(!l)s.matches&&s.matches(d)&&H(s,n);else if(s.matches&&s.matches(d)&&H(s,n),s.querySelectorAll){const p=s.querySelectorAll(d);for(let m=0;m<p.length;m++)H(p[m],n)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,O(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{oe(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Me(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let i=0;i<r.length;i++){const o=r[i];if(o.type==="childList")try{oe(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ie(e){F().push(e),e.onSubtreeChange&&e.query&&R().push(e),ie()}function le(e,t,r,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,d=o.onAttrChange||null,p=o.effects||null,m=o.attributes||null,v=m?Le(m):p,j=m?new Set(Object.keys(m)):null,D=o.persist||null;function k(C){const w=C||document.body;if(te(w,e,t,r),m&&P())for(const g in m){const b=m[g],_=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&_.push(w);for(let A=0;A<_.length;A++){const S=_[A];N(S)&&ee(b,S.getAttribute(g),g,i,S)}}n&&n(w)}const E=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let w;for(;(w=C.exec(e))!==null;)E.push(w[1])}else E.push(e);De({selector:e,attribute:t,componentTag:i,attributes:m,ComponentFn:r,onInit:n,observed:E.concat(s),onAttributeChange:l,onAttrChange:d,effects:v,declared:j,persist:D}),Ne();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=o.subtreeQuery||(u?e:"["+e+"]"),f={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:a};F().push(f),c&&a&&R().push(f),ie(),window[t]=k,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Ie,window.lnCore.withoutLifecycle=Me);function h(){Te()>0?Oe(function(){k(document.body)}):k(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),k}function se(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,r={},i=se(t);if(!i)return r;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),n=c>-1?l.slice(0,c):l,d=c>-1?l.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(d)}catch{r[n]=d}}return r}function Be(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const r=$();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");se(location.hash)!==o&&(location.hash=o)}function Re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function He(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ue(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Be,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=He,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=Pe,window.lnCore.hashFilterDecode=Ue);function We(){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=We),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const r={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},i={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},o={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},l={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function n(u){return!!(o[u]||s[u]||l[u]||u==="link")}function d(u){this.dom=u;const a=this;if(this._textarea=u.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",u),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const b=u.querySelector('label[for="'+h+'"]');b&&(b.id||(b.id=h+"-label"),this._surface.setAttribute("aria-labelledby",b.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const C=this._textarea.value.trim();C&&(this._surface.innerHTML=C);const w=u.querySelector('[role="toolbar"]');if(w&&w.nextSibling?u.insertBefore(this._surface,w.nextSibling):u.appendChild(this._surface),w){w.setAttribute("aria-controls",this._surface.id);const b=w.querySelectorAll("[data-ln-editor-action]");for(let _=0;_<b.length;_++){const A=b[_].getAttribute("data-ln-editor-action");n(A)&&b[_].setAttribute("aria-pressed","false")}}this._onInput=function(){a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom})},this._onMousedownToolbar=function(b){b.target.closest("[data-ln-editor-action]")&&b.preventDefault()},this._onClickToolbar=function(b){const _=b.target.closest("[data-ln-editor-action]");if(!_)return;const A=_.getAttribute("data-ln-editor-action");a._execAction(A)},this._onPaste=function(b){v(a,b)},this._onKeydown=function(b){k(a,b)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){a._rafSelection||(a._rafSelection=requestAnimationFrame(function(){a._rafSelection=null,document.contains(a._surface)&&a._updateActiveStates()}))},this._attachSelection=function(){a._listeningSelection||(a._listeningSelection=!0,document.addEventListener("selectionchange",a._onSelectionChange))},this._detachSelection=function(){a._listeningSelection&&(a._listeningSelection=!1,document.removeEventListener("selectionchange",a._onSelectionChange)),a._rafSelection&&(cancelAnimationFrame(a._rafSelection),a._rafSelection=null)},this._onFocus=function(){a._attachSelection(),a._updateActiveStates(),x(a.dom,"ln-editor:focus",{target:a.dom})},this._onBlur=function(){a._detachSelection(),a._syncToTextarea(),x(a.dom,"ln-editor:blur",{target:a.dom})},this._onTextareaInput=function(){a._surface.innerHTML!==a._textarea.value&&(a._surface.innerHTML=a._textarea.value,x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),w&&(w.addEventListener("mousedown",this._onMousedownToolbar),w.addEventListener("click",this._onClickToolbar)),this._onSetContent=function(b){const _=b.detail&&b.detail.html;_!==void 0&&(a._surface.innerHTML=_,a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const g=this._textarea.form;return g&&(this._onFormReset=function(){setTimeout(function(){a._surface.innerHTML=a._textarea.value,x(u,"ln-editor:changed",{html:a._textarea.value,target:u})},0)},g.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(u){if(!(!u||fe(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[u])document.execCommand(o[u],!1,null);else if(s[u]){const f=s[u],h=p(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else l[u]?document.execCommand(l[u],!1,null):u==="link"?E(this):u==="unlink"?document.execCommand("unlink",!1,null):u==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const u=this.dom.querySelector('[role="toolbar"]');if(!u)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=a.anchorNode;if(!f||!this._surface.contains(f))return;const h=u.querySelectorAll("[data-ln-editor-action]");for(let C=0;C<h.length;C++){const w=h[C],g=w.getAttribute("data-ln-editor-action");let b=!1;if(o[g])try{b=document.queryCommandState(o[g])}catch{}else if(s[g]){const _=p(this._surface);b=_&&_.toLowerCase()===s[g]}else if(l[g])try{b=document.queryCommandState(l[g])}catch{}else g==="link"&&(b=!!m(a.anchorNode,"A",this._surface));if(n(g)){const _=String(b);w.getAttribute("aria-pressed")!==_&&w.setAttribute("aria-pressed",_)}b?w.classList.contains("ln-editor-active")||w.classList.add("ln-editor-active"):w.classList.contains("ln-editor-active")&&w.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(u){this._surface&&(this._surface.innerHTML=u,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const u=this.dom.querySelector('[role="toolbar"]');u&&(u.removeEventListener("mousedown",this._onMousedownToolbar),u.removeEventListener("click",this._onClickToolbar)),this._detachSelection?this._detachSelection():document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const a=this._textarea?this._textarea.form:null;if(a&&this._onFormReset&&a.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function p(u){const a=window.getSelection();if(!a||a.rangeCount===0)return null;let f=a.anchorNode;if(!f)return null;for(;f&&f!==u;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function m(u,a,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===a)return u;u=u.parentNode}return null}function v(u,a){a.preventDefault();let f="";if(a.clipboardData&&(f=a.clipboardData.getData("text/html"),!f)){const C=a.clipboardData.getData("text/plain");C&&(f=C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=j(f);h&&document.execCommand("insertHTML",!1,h)}function j(u){const a=document.createElement("div");return a.innerHTML=u,D(a),a.innerHTML}function D(u){const a=Array.from(u.childNodes);for(let f=0;f<a.length;f++){const h=a[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(i[h.tagName]){const C=Array.from(h.attributes);for(let w=0;w<C.length;w++){const g=C[w].name;if(h.tagName==="A"&&g==="href"){const b=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(b)||h.removeAttribute("href")}else h.removeAttribute(g)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),D(h)}else{for(;h.firstChild;)u.insertBefore(h.firstChild,h);u.removeChild(h)}}}}function k(u,a){if(!(a.ctrlKey||a.metaKey))return;let f=null;switch(a.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(a.preventDefault(),u._execAction(f))}function E(u){const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=m(a.anchorNode,"A",u._surface),h=a.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const C=ve(u.dom,"ln-editor-link-popover","ln-editor");if(!C)return;const w=C.firstElementChild;if(!w)return;const g=w.querySelector('input[type="url"]'),b=w.querySelector('[data-ln-editor-action="confirm-link"]'),_=w.querySelector('[data-ln-editor-action="cancel-link"]');f&&(g.value=f.getAttribute("href")||"");const A=u.dom.querySelector('[role="toolbar"]');A?A.after(w):u.dom.insertBefore(w,u._surface),g.focus();function S(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function q(){document.removeEventListener("mousedown",ue),u._closeLinkPopover=null,w.remove()}function ae(){const y=g.value.trim();if(q(),S(),u._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const de=m(T.anchorNode,"A",u._surface);de&&(de.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function ce(){q(),S(),u._surface.focus()}function Ke(){q()}function ue(y){const T=u.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!w.contains(y.target)&&!T&&Ke()}u._closeLinkPopover=q,b.addEventListener("click",ae),_.addEventListener("click",ce),g.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),ae()):y.key==="Escape"&&(y.preventDefault(),ce())}),document.addEventListener("mousedown",ue)}le(e,t,d,"ln-editor",{attributes:r})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!A(i))return}e.apply(console,t)}}function p(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},c=e.elements,o={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function j(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function W(e,t){const r=e.elements,i=[],l={};for(let c=0;c<r.length;c++){const o=r[c];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<r.length;c++){const o=r[c];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=j(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=W,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function V(e,t){x[e]=t}function U(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=U);function H(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function J(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];k[r]=t}function K(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=J,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=H);const b={};function z(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let o=0;o<c.length;o++){const s=c[o],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function _(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(c,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const o=l[c],s=o.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function P(e,t,r,i,l,c){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(i(a));let d=o[u];if(d)l(d,a,n);else{const f=z(r,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=G,window.lnCore.renderList=P);function g(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function S(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function L(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function E(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function O(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const i=new Set(e||[]),l=function(c,o){const s=c.getAttribute(o);return s!==null&&i.has(s)?s:t};return m.set(r,l),l}function D(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function F(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function Q(e,t,r,i,l){if(!e||t===null)return!0;const c=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,r){for(const i in r){const[l,c,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,c,o)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=O(i.values,i.fallback);break;case"integer":l=S;break;case"float":l=D;break;case"boolean":l=L;break;case"list":l=E;break;case"json":l=F;break;case"string":default:l=g;break}l||(l=g),t[i.prop]=[l,r,i.fallback]}return t}function Z(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=X,window.lnCore.attrSpec=Y,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=E,window.lnCore.attrEnum=O,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function ee(e,t,r,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(c)&&h(e,o),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function te(e){const t=$(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Z(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function q(e,t,r,i){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const o=c.effects&&c.effects[r];o?o(t,r,i):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,i)}}function ne(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=$(),l=i.byAttr.get(t),c=R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(c&&A(o)){const s=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<s.length;a++)Q(s[a].spec,n,t,s[a].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&q(s,o,t,e.oldValue),i.reactiveWildcard.length&&q(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(ee(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ne(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function C(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=I();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=N();if(e.target&&i.length)for(let l=0;l<i.length;l++){const c=i[l],o=c.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;s&&c.onSubtreeChange(s,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)c.matches&&c.matches(n.query)&&h(c,n);else if(c.matches&&c.matches(n.query)&&h(c,n),c.querySelectorAll){const a=c.querySelectorAll(n.query);for(let u=0;u<a.length;u++)h(a[u],n)}}n.onInit&&n.onInit(c)}}}for(let l=0;l<e.removedNodes.length;l++){const c=e.removedNodes[l];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a){if(!o)c.matches&&c.matches(a)&&C(c,n);else if(c.matches&&c.matches(a)&&C(c,n),c.querySelectorAll){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)C(u[d],n)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{oe(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t){te({observed:e,handler:t}),re()}function se(e){I().push(e),e.onSubtreeChange&&e.query&&N().push(e),ie()}function T(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,r={},i=T(t);if(!i)return r;const l=i.split("&");for(let c=0;c<l.length;c++){const o=l[c];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,a=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ce(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ae(e,t){if(!e)return;const r=y();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const o=r[c];return o===""?c:c+":"+encodeURIComponent(o)}).join("&");T(location.hash)!==l&&(location.hash=l)}function ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function de(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function we(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 he(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=y,window.lnCore.hashGet=ce,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=ue,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=we,window.lnCore.hashFilterEncode=he,window.lnCore.hashFilterDecode=pe);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(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",s.appendChild(a),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function i(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function l(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){se({onInit:function(s){if(s.matches&&(s.matches("a")||s.matches("area"))&&r(s),s.querySelectorAll)for(const n of s.querySelectorAll("a, area"))r(n)}}),le(["href"],function(s){s.matches&&(s.matches("a")||s.matches("area"))&&r(s)})},"ln-external-links")}function o(){l(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i()}):i()}window[e]={process:i},o()})()})();
1
+ (function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!A(i))return}e.apply(console,t)}}function p(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},c=e.elements,o={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function j(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function W(e,t){const r=e.elements,i=[],l={};for(let c=0;c<r.length;c++){const o=r[c];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<r.length;c++){const o=r[c];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=j(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=W,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function V(e,t){x[e]=t}function U(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=U);function H(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function J(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];k[r]=t}function K(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=J,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=H);const b={};function z(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let o=0;o<c.length;o++){const s=c[o],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function _(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(c,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const o=l[c],s=o.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function P(e,t,r,i,l,c){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(i(a));let d=o[u];if(d)l(d,a,n);else{const f=z(r,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=G,window.lnCore.renderList=P);function g(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function S(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function L(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function E(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function O(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const i=new Set(e||[]),l=function(c,o){const s=c.getAttribute(o);return s!==null&&i.has(s)?s:t};return m.set(r,l),l}function D(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function F(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function Q(e,t,r,i,l){if(!e||t===null)return!0;const c=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,r){for(const i in r){const[l,c,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,c,o)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=O(i.values,i.fallback);break;case"integer":l=S;break;case"float":l=D;break;case"boolean":l=L;break;case"list":l=E;break;case"json":l=F;break;case"string":default:l=g;break}l||(l=g),t[i.prop]=[l,r,i.fallback]}return t}function Z(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=X,window.lnCore.attrSpec=Y,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=E,window.lnCore.attrEnum=O,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function ee(e,t,r,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(c)&&h(e,o),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function te(e){const t=$(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Z(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function q(e,t,r,i){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const o=c.effects&&c.effects[r];o?o(t,r,i):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,i)}}function ne(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=$(),l=i.byAttr.get(t),c=R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(c&&A(o)){const s=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<s.length;a++)Q(s[a].spec,n,t,s[a].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&q(s,o,t,e.oldValue),i.reactiveWildcard.length&&q(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(ee(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ne(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function C(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=I();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=N();if(e.target&&i.length)for(let l=0;l<i.length;l++){const c=i[l],o=c.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;s&&c.onSubtreeChange(s,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)c.matches&&c.matches(n.query)&&h(c,n);else if(c.matches&&c.matches(n.query)&&h(c,n),c.querySelectorAll){const a=c.querySelectorAll(n.query);for(let u=0;u<a.length;u++)h(a[u],n)}}n.onInit&&n.onInit(c)}}}for(let l=0;l<e.removedNodes.length;l++){const c=e.removedNodes[l];if(c.nodeType===1){if(document.contains(c))continue;const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a){if(!o)c.matches&&c.matches(a)&&C(c,n);else if(c.matches&&c.matches(a)&&C(c,n),c.querySelectorAll){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)C(u[d],n)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{oe(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t){te({observed:e,handler:t}),re()}function se(e){I().push(e),e.onSubtreeChange&&e.query&&N().push(e),ie()}function T(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,r={},i=T(t);if(!i)return r;const l=i.split("&");for(let c=0;c<l.length;c++){const o=l[c];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,a=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ce(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ae(e,t){if(!e)return;const r=y();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const o=r[c];return o===""?c:c+":"+encodeURIComponent(o)}).join("&");T(location.hash)!==l&&(location.hash=l)}function ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function de(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function we(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 he(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=y,window.lnCore.hashGet=ce,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=ue,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=we,window.lnCore.hashFilterEncode=he,window.lnCore.hashFilterDecode=pe);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(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",s.appendChild(a),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function i(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function l(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){se({onInit:function(s){if(s.matches&&(s.matches("a")||s.matches("area"))&&r(s),s.querySelectorAll)for(const n of s.querySelectorAll("a, area"))r(n)}}),le(["href"],function(s){s.matches&&(s.matches("a")||s.matches("area"))&&r(s)})},"ln-external-links")}function o(){l(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i()}):i()}window[e]={process:i},o()})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function P(){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 B(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!B(l))return}e.apply(console,t)}}function L(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function ke(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function R(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){R(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function J(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function _e(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Se(e,t){const n=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(l&&r.matches&&r.matches(l)))if(r.type==="checkbox")n&&i[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&o[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);o[r.name]=r.value===""||isNaN(d)?null:d}else o[r.name]=r.value}return o}function xe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ie(e,t){const n=e.elements,l=[],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 r=t[a];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(r).split(",").map(function(y){return y.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=xe(r);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<i.options.length;d++)i.options[d].selected=r.indexOf(i.options[d].value)!==-1;l.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ie,window.lnCore.serializeForm=Se,window.lnCore.resolveFormMethod=_e);const G={};function Ee(e,t){G[e]=t}function Te(e){return G[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ee,window.lnCore.getDataMapper=Te);function qe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,R(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function Le(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function Re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Le,window.lnCore.getLocaleFallback=Re,window.lnCore.ensureLocaleObserver=qe);const M={};function Oe(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(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],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const a=l[i],r=a.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();t[v]!=null&&a.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],r=a.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();v in t&&a.classList.toggle(m,!!t[v])}}return e}function Fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<n.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[l],t??null),n[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)X(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 Y(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 l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let r=0;r<a.length;r++){const d=a[r];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function De(e,t,n,l,o,s){const i={};for(let r=0;r<e.children.length;r++){const d=e.children[r],y=d.getAttribute("data-ln-render-key");y&&(i[y]=d)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],y=String(l(d));let m=i[y];if(m)o(m,d,r);else{const v=Oe(n,s);if(!v||(Y(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",y),o(m,d,r)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=Fe,window.lnCore.renderList=De);function O(e,t,n){const l=e.getAttribute(t);return l===null?n:l}function Z(e,t,n){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?n:l}function ee(e,t,n=!1){const l=e.getAttribute(t);if(l===null)return!!n;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const l=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&l.has(a)?a:t};return $.set(n,o),o}function re(e,t,n){const l=parseFloat(e.getAttribute(t));return isNaN(l)?n:l}function oe(e,t,n){const l=e.getAttribute(t);if(!l)return n;try{return JSON.parse(l)}catch{return n}}function ie(e,t,n,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=r=>{o?console.warn(r,o):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.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 r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} 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(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function le(e,t,n){for(const l in n){const[o,s,i]=n[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const n in e){const l=e[n];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=ne(l.values,l.fallback);break;case"integer":o=Z;break;case"float":o=re;break;case"boolean":o=ee;break;case"list":o=te;break;case"json":o=oe;break;case"string":default:o=O;break}o||(o=O),t[l.prop]=[o,n,l.fallback]}return t}function Ne(e){const t={};for(const n in e){const l=e[n];l&&l.effect&&(t[n]=l.effect)}return Object.keys(t).length?t:null}function Be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const 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=le,window.lnCore.attrSpec=se,window.lnCore.attrStr=O,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);function E(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ae(e,t,n,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:l};if(e.matches&&e.matches(s)&&E(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)E(a[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function T(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 ce(){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=ce(),n=e.observed||[];for(let l=0;l<n.length;l++){const o=n[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Be(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ue(e,t,n,l){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,l):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,l)}}function He(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,l=ce(),o=l.byAttr.get(t),s=P()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&B(i)){const a=l.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let d=0;d<a.length;d++)ie(a[d].spec,r,t,a[d].componentTag,i)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const a=l.byReactive.get(t);a&&ue(a,i,t,e.oldValue),l.reactiveWildcard.length&&ue(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const r=o[a];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(ae(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{He(t[n])}catch(l){console.error("[ln-core] mutation handler failed",t[n].target,l)}}).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 j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function V(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ve(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=j();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;a&&s.onSubtreeChange(a,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a];if(r.selector&&r.attribute&&r.ComponentFn){if(!i)s.matches&&s.matches(r.query)&&E(s,r);else if(s.matches&&s.matches(r.query)&&E(s,r),s.querySelectorAll){const d=s.querySelectorAll(r.query);for(let y=0;y<d.length;y++)E(d[y],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],d=r.query;if(d){if(!i)s.matches&&s.matches(d)&&V(s,r);else if(s.matches&&s.matches(d)&&V(s,r),s.querySelectorAll){const y=s.querySelectorAll(d);for(let m=0;m<y.length;m++)V(y[m],r)}}}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const l=t[n];if(l.type==="childList")try{Ve(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function We(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),de()}function fe(e,t,n,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,r=o.onInit||null,d=o.onAttrChange||null,y=o.effects||null,m=o.attributes||null,v=m?Ne(m):y,k=m?new Set(Object.keys(m)):null,q=o.persist||null;function S(f){const c=f||document.body;if(ae(c,e,t,n),m&&P())for(const g in m){const w=m[g],h=Array.from(c.querySelectorAll("["+g+"]"));c.matches&&c.matches("["+g+"]")&&h.push(c);for(let b=0;b<h.length;b++){const p=h[b];B(p)&&ie(w,p.getAttribute(g),g,l,p)}}r&&r(c)}const x=[];if(e.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let c;for(;(c=f.exec(e))!==null;)x.push(c[1])}else x.push(e);$e({selector:e,attribute:t,componentTag:l,attributes:m,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:k,persist:q}),je();const Q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,D=o.subtreeQuery||(Q?e:"["+e+"]"),I={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:D};H().push(I),a&&D&&j().push(I),de(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=We);function u(){Me()>0?T(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),S}function he(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ge(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},l=ge(t);if(!l)return n;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),r=a>-1?i.slice(0,a):i,d=a>-1?i.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function U(e){if(!e)return null;const t=W();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=W();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("&");ge(location.hash)!==o&&(location.hash=o)}function Ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function F(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 l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function 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 be(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function K(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=W,window.lnCore.hashGet=U,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=Ue,window.lnCore.resolveHashNamespace=F,window.lnCore.hashSortEncode=Ke,window.lnCore.hashSortDecode=Qe,window.lnCore.hashFilterEncode=be,window.lnCore.hashFilterDecode=K);function Pe(){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=Pe);function pe(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let l=0;l<t.length;l++)if(String(t[l]).trim().toLowerCase()===n)return!0;return!1}function Je(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Ge(e,t,n){if(!t||typeof t!="object")return!0;const l=Object.keys(t);if(l.length===0)return!0;for(let o=0;o<l.length;o++){const s=t[l[o]];let i="";if(s.col!==null&&s.col!==void 0?i=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(s.attr)||""),!pe(i,s.values))return!1}return!0}function ye(e,t,n,l){if(l!=null&&!isNaN(l))return parseInt(l,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const a=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(a&&typeof a.querySelector=="function"){const r=a.querySelector('[data-ln-popover-for="'+i.id+'"]');if(r&&typeof r.closest=="function"){const d=r.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-table-filter-col")||a.getAttribute("data-ln-filter-col")||a.getAttribute("data-ln-filter-key")||a.getAttribute("data-ln-table-col")||a.getAttribute("data-ln-col")||a.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof a.cellIndex=="number"?a.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,a=i&&i.id||t.id||null;if(a)for(let r=0;r<o.length;r++){const d=o[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+a+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let i=0;i<o.length;i++){const a=o[i],d=Array.from(a.childNodes||[]).filter(m=>m.nodeType===3),y=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):a.textContent||"").trim().toLowerCase();if(y&&y===s)return typeof a.cellIndex=="number"?a.cellIndex:i}}return null}function ze(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let l=0;l<e.length;l++){const o=e[l];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function me(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",l="data-ln-filter-value",o="data-ln-filter-hide",s="data-ln-filter-reset",i="data-ln-filter-col",a="data-ln-hash",r="data-ln-filter-values",d="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},v=se(m);function k(u){return u.hasAttribute(s)||!u.getAttribute(l)}function q(u){const f=u.dom.querySelectorAll("["+n+"]"),c=[];for(let w=0;w<f.length;w++){const h=f[w];c.push({key:h.getAttribute(n),value:h.getAttribute(l)||"",checked:h.checked,isReset:k(h)})}const g=ze(c);return{key:g.key,values:g.values,targetId:u.targetId}}function S(u,f,c){const g=u.querySelectorAll("["+n+"]"),w=Array.isArray(c)&&c.length>0;for(let h=0;h<g.length;h++){const b=g[h];k(b)?b.checked=!w:w&&b.getAttribute(n)===f&&c.indexOf(b.getAttribute(l))!==-1?b.checked=!0:b.checked=!1}}function x(u){this.dom=u,le(this,u,v);const f=u.getAttribute(i);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=F(u,"filter"),this.hashEnabled=!!this.nsKey;const c=this,g=he(function(){c._render()});this._queueRender=g;const w=he(function(){c._destroyed||c._applyDomFilter()});this._queueDomFilter=w;function h(){if(!c.targetId)return;const p=document.getElementById(c.targetId);p&&!p.hasAttribute(d)&&p.setAttribute(d,c.targetId)}this._ensureTargetMarked=h,h(),T(function(){c._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(c._destroyed||!c.hashEnabled)return;const p=U(c.nsKey),C=K(p);C&&C.key&&C.values.length>0?S(c.dom,C.key,C.values):S(c.dom,null,[]),c._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const p=U(this.nsKey),C=K(p);C&&C.key&&C.values.length>0&&(S(u,C.key,C.values),T(function(){c._destroyed||c._render()}),b=!0)}if(!b){const p=me(u.getAttribute(r));if(p.length>0){const C=u.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(u,_,p),T(function(){c._destroyed||c._render()}),b=!0)}}if(!b){const p=u.querySelectorAll("["+n+"]");for(let C=0;C<p.length;C++)if(p[C].checked&&!k(p[C])){T(function(){c._destroyed||c._render()});break}}return this}x.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(f){const c=f.target;if(!c||!c.hasAttribute||!c.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(k(c)){for(let w=0;w<g.length;w++)k(g[w])||(g[w].checked=!1);c.checked=!0,u._queueRender();return}if(c.checked){for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!1);let w=!1;for(let h=0;h<g.length;h++)if(k(g[h])){w=!0;break}if(w){let h=!0;for(let b=0;b<g.length;b++)if(!k(g[b])&&!g[b].checked){h=!1;break}if(h)for(let b=0;b<g.length;b++)k(g[b])?g[b].checked=!0:g[b].checked=!1}}else{let w=!1;for(let h=0;h<g.length;h++)if(!k(g[h])&&g[h].checked){w=!0;break}if(!w)for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},x.prototype._render=function(){const u=this,f=q(this),c=this._lastSnapshot;if(!(!c||c.key!==f.key||Je(c.values,f.values)))return;f.key===null||f.values.length;const w=document.getElementById(u.targetId),h={key:f.key,values:f.values.slice(),targetId:u.targetId};L(u.dom,"ln-filter:change",h);let b=!1;w&&w!==u.dom&&ke(w,"ln-filter:change",h).defaultPrevented&&(b=!0);const p=c&&c.values.length>0,C=f.values.length===0;if(p&&C){const A={targetId:u.targetId};L(u.dom,"ln-filter:reset",A),w&&w!==u.dom&&L(w,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=Xe(f.values);if(_?this.dom.setAttribute(r,_):this.dom.removeAttribute(r),this.hashEnabled){const A=be(f.key,f.values);we(this.nsKey,A)}b||u._applyDomFilter(w)},x.prototype._applyDomFilter=function(u){const f=u||document.getElementById(this.targetId);if(!f)return;const c=q(this),g=c.key===null||c.values.length===0,w=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(w)this._filterTableRows(c,w);else{const h=f.children;for(let b=0;b<h.length;b++){const p=h[b],C=g?null:p.getAttribute("data-"+c.key),_=!g&&C!==null&&!pe(C,c.values),A=p.hasAttribute(o);_&&!A?p.setAttribute(o,"true"):!_&&A&&p.removeAttribute(o)}}};function Q(u){if(!u)return"";const f=u.querySelector?u.querySelector("[data-ln-value]"):null;return J(f||u)}function D(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}x.prototype._filterTableRows=function(u,f){if(!f){const p=document.getElementById(this.targetId);if(!p||(f=p.tagName==="TABLE"?p:p.querySelector?p.querySelector("table"):null,!f))return}const c=ye(f,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(c!==null?"col"+c:"attr-filter"),w=u.values;y.has(f)||y.set(f,{});const h=y.get(f);g&&w.length>0?h[g]={col:c,values:w.slice(),attr:"data-"+g}:g&&delete h[g];const b=f.tBodies;for(let p=0;p<b.length;p++){const C=b[p].rows;for(let _=0;_<C.length;_++){const A=C[_];if(D(A))continue;const Ce={};for(let N=0;N<A.cells.length;N++)Ce[N]=Q(A.cells[N]);const Ae=!Ge(Ce,h,A),ve=A.hasAttribute(o);Ae&&!ve?A.setAttribute(o,"true"):!Ae&&ve&&A.removeAttribute(o)}}},x.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const f=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(f&&y.has(f)){const c=y.get(f),g=ye(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),w=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);w&&c[w]&&(delete c[w],this._filterTableRows({key:null,values:[]},f)),Object.keys(c).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&u.removeAttribute(d)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(u,f){const c=u[t];if(!(!c||c._destroyed))if(f===a)c.hashEnabled&&c._onHashChange&&window.removeEventListener("hashchange",c._onHashChange),c.nsKey=F(u,"filter"),c.hashEnabled=!!c.nsKey,c.hashEnabled&&window.addEventListener("hashchange",c._onHashChange);else if(f===r){const g=me(u.getAttribute(r)),w=u.querySelector("["+n+"]"),h=w?w.getAttribute(n):null;h&&(S(u,h,g),c._render())}else f===e&&(c.targetId=u.getAttribute(e)||null,c._ensureTargetMarked(),c._render())}fe(e,t,x,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+d+"]",onSubtreeChange:function(u,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let c=null,g=null;if(u.hasAttribute(d)?(g=u,c=u.getAttribute(d)||u.id):u.hasAttribute(e)&&(c=u.getAttribute(e),g=c?document.getElementById(c):null),!c||!g)return;const w=document.querySelectorAll("["+e+'="'+c+'"]');for(let h=0;h<w.length;h++){const b=w[h][t];b&&!b._destroyed&&q(b).values.length>0&&b._queueDomFilter()}},persist:{attr:r,hashActive:function(u){return!!F(u,"filter")}}})})()})();
1
+ (function(){"use strict";function P(){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 B(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!B(i))return}e.apply(console,t)}}function q(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function _e(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(o),o}function R(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){R(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function J(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function Se(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function xe(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&l[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&o[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);o[r.name]=r.value===""||isNaN(d)?null:d}else o[r.name]=r.value}return o}function Ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ee(e,t){const n=e.elements,i=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[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 r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(o[l.name]>1){const d=String(r).split(",").map(function(y){return y.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=Ie(r);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<l.options.length;d++)l.options[d].selected=r.indexOf(l.options[d].value)!==-1;i.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ee,window.lnCore.serializeForm=xe,window.lnCore.resolveFormMethod=Se);const G={};function Te(e,t){G[e]=t}function Le(e){return G[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Te,window.lnCore.getDataMapper=Le);function qe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,R(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function Re(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function Oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Re,window.lnCore.getLocaleFallback=Oe,window.lnCore.ensureLocaleObserver=qe);const M={};function Fe(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(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],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();t[v]!=null&&c.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();v in t&&c.classList.toggle(m,!!t[v])}}return e}function De(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)X(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 Y(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 i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let r=0;r<c.length;r++){const d=c[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ne(e,t,n,i,o,s){const l={};for(let r=0;r<e.children.length;r++){const d=e.children[r],y=d.getAttribute("data-ln-render-key");y&&(l[y]=d)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],y=String(i(d));let m=l[y];if(m)o(m,d,r);else{const v=Fe(n,s);if(!v||(Y(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",y),o(m,d,r)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=De,window.lnCore.renderList=Ne);function O(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function Z(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function ee(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return $.set(n,o),o}function re(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function oe(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function ie(e,t,n,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{o?console.warn(r,o):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.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 r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} 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(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function le(e,t,n){for(const i in n){const[o,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=ne(i.values,i.fallback);break;case"integer":o=Z;break;case"float":o=re;break;case"boolean":o=ee;break;case"list":o=te;break;case"json":o=oe;break;case"string":default:o=O;break}o||(o=O),t[i.prop]=[o,n,i.fallback]}return t}function Be(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.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}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=le,window.lnCore.attrSpec=se,window.lnCore.attrStr=O,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);function E(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ce(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&E(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)E(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $e(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function T(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 ae(){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=ae(),n=e.observed||[];for(let i=0;i<n.length;i++){const o=n[i];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 i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Me(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ue(e,t,n,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function je(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=ae(),o=i.byAttr.get(t),s=P()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&B(l)){const c=i.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<c.length;d++)ie(c[d].spec,r,t,c[d].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=i.byReactive.get(t);c&&ue(c,l,t,e.oldValue),i.reactiveWildcard.length&&ue(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const r=o[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(ce(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{je(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).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 j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function V(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function de(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=j();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&E(s,r);else if(s.matches&&s.matches(r.query)&&E(s,r),s.querySelectorAll){const d=s.querySelectorAll(r.query);for(let y=0;y<d.length;y++)E(d[y],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],d=r.query;if(d){if(!l)s.matches&&s.matches(d)&&V(s,r);else if(s.matches&&s.matches(d)&&V(s,r),s.querySelectorAll){const y=s.querySelectorAll(d);for(let m=0;m<y.length;m++)V(y[m],r)}}}}}}function fe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,R(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{de(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function We(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let i=0;i<n.length;i++){const o=n[i];if(o.type==="childList")try{de(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ue(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),fe()}function he(e,t,n,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,r=o.onInit||null,d=o.onAttrChange||null,y=o.effects||null,m=o.attributes||null,v=m?Be(m):y,k=m?new Set(Object.keys(m)):null,L=o.persist||null;function S(f){const a=f||document.body;if(ce(a,e,t,n),m&&P())for(const g in m){const w=m[g],h=Array.from(a.querySelectorAll("["+g+"]"));a.matches&&a.matches("["+g+"]")&&h.push(a);for(let b=0;b<h.length;b++){const p=h[b];B(p)&&ie(w,p.getAttribute(g),g,i,p)}}r&&r(a)}const x=[];if(e.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let a;for(;(a=f.exec(e))!==null;)x.push(a[1])}else x.push(e);He({selector:e,attribute:t,componentTag:i,attributes:m,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:l,onAttrChange:d,effects:v,declared:k,persist:L}),Ve();const Q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,D=o.subtreeQuery||(Q?e:"["+e+"]"),I={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:D};H().push(I),c&&D&&j().push(I),fe(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=he,window.lnCore.observeLifecycle=Ue,window.lnCore.withoutLifecycle=We);function u(){$e()>0?T(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),S}function ge(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function we(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},i=we(t);if(!i)return n;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,d=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function U(e){if(!e)return null;const t=W();return e in t?t[e]:null}function be(e,t){if(!e)return;const n=W();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");we(location.hash)!==o&&(location.hash=o)}function Ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function F(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 i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Qe(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 pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function K(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),o=i?i.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=W,window.lnCore.hashGet=U,window.lnCore.hashSet=be,window.lnCore.hashLinkClick=Ke,window.lnCore.resolveHashNamespace=F,window.lnCore.hashSortEncode=Qe,window.lnCore.hashSortDecode=Pe,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=K);function Je(){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=Je);function ye(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let i=0;i<t.length;i++)if(String(t[i]).trim().toLowerCase()===n)return!0;return!1}function Ge(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function ze(e,t,n){if(!t||typeof t!="object")return!0;const i=Object.keys(t);if(i.length===0)return!0;for(let o=0;o<i.length;o++){const s=t[i[o]];let l="";if(s.col!==null&&s.col!==void 0?l=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(l=n.getAttribute(s.attr)||""),!ye(l,s.values))return!1}return!0}function me(e,t,n,i){if(i!=null&&!isNaN(i))return parseInt(i,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const l=t.closest("[data-ln-popover], [id]");if(l&&l.id){const c=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(c&&typeof c.querySelector=="function"){const r=c.querySelector('[data-ln-popover-for="'+l.id+'"]');if(r&&typeof r.closest=="function"){const d=r.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-table-filter-col")||c.getAttribute("data-ln-filter-col")||c.getAttribute("data-ln-filter-key")||c.getAttribute("data-ln-table-col")||c.getAttribute("data-ln-col")||c.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof c.cellIndex=="number"?c.cellIndex:l}if(t){const l=t.closest?t.closest("[data-ln-popover], [id]"):null,c=l&&l.id||t.id||null;if(c)for(let r=0;r<o.length;r++){const d=o[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+c+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let l=0;l<o.length;l++){const c=o[l],d=Array.from(c.childNodes||[]).filter(m=>m.nodeType===3),y=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):c.textContent||"").trim().toLowerCase();if(y&&y===s)return typeof c.cellIndex=="number"?c.cellIndex:l}}return null}function Xe(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let i=0;i<e.length;i++){const o=e[i];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function Ye(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ce(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",i="data-ln-filter-value",o="data-ln-filter-hide",s="data-ln-filter-reset",l="data-ln-filter-col",c="data-ln-hash",r="data-ln-filter-values",d="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},v=se(m);function k(u){return u.hasAttribute(s)||!u.getAttribute(i)}function L(u){const f=u.dom.querySelectorAll("["+n+"]"),a=[];for(let w=0;w<f.length;w++){const h=f[w];a.push({key:h.getAttribute(n),value:h.getAttribute(i)||"",checked:h.checked,isReset:k(h)})}const g=Xe(a);return{key:g.key,values:g.values,targetId:u.targetId}}function S(u,f,a){const g=u.querySelectorAll("["+n+"]"),w=Array.isArray(a)&&a.length>0;for(let h=0;h<g.length;h++){const b=g[h];k(b)?b.checked=!w:w&&b.getAttribute(n)===f&&a.indexOf(b.getAttribute(i))!==-1?b.checked=!0:b.checked=!1}}function x(u){this.dom=u,le(this,u,v);const f=u.getAttribute(l);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=F(u,"filter"),this.hashEnabled=!!this.nsKey;const a=this,g=ge(function(){a._render()});this._queueRender=g;const w=ge(function(){a._destroyed||a._applyDomFilter()});this._queueDomFilter=w;function h(){if(!a.targetId)return;const p=document.getElementById(a.targetId);p&&!p.hasAttribute(d)&&p.setAttribute(d,a.targetId)}this._ensureTargetMarked=h,h(),T(function(){a._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const p=U(a.nsKey),C=K(p);C&&C.key&&C.values.length>0?S(a.dom,C.key,C.values):S(a.dom,null,[]),a._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const p=U(this.nsKey),C=K(p);C&&C.key&&C.values.length>0&&(S(u,C.key,C.values),T(function(){a._destroyed||a._render()}),b=!0)}if(!b){const p=Ce(u.getAttribute(r));if(p.length>0){const C=u.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(u,_,p),T(function(){a._destroyed||a._render()}),b=!0)}}if(!b){const p=u.querySelectorAll("["+n+"]");for(let C=0;C<p.length;C++)if(p[C].checked&&!k(p[C])){T(function(){a._destroyed||a._render()});break}}return this}x.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(f){const a=f.target;if(!a||!a.hasAttribute||!a.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(k(a)){for(let w=0;w<g.length;w++)k(g[w])||(g[w].checked=!1);a.checked=!0,u._queueRender();return}if(a.checked){for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!1);let w=!1;for(let h=0;h<g.length;h++)if(k(g[h])){w=!0;break}if(w){let h=!0;for(let b=0;b<g.length;b++)if(!k(g[b])&&!g[b].checked){h=!1;break}if(h)for(let b=0;b<g.length;b++)k(g[b])?g[b].checked=!0:g[b].checked=!1}}else{let w=!1;for(let h=0;h<g.length;h++)if(!k(g[h])&&g[h].checked){w=!0;break}if(!w)for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},x.prototype._render=function(){const u=this,f=L(this),a=this._lastSnapshot;if(!(!a||a.key!==f.key||Ge(a.values,f.values)))return;f.key===null||f.values.length;const w=document.getElementById(u.targetId),h={key:f.key,values:f.values.slice(),targetId:u.targetId};q(u.dom,"ln-filter:change",h);let b=!1;w&&w!==u.dom&&_e(w,"ln-filter:change",h).defaultPrevented&&(b=!0);const p=a&&a.values.length>0,C=f.values.length===0;if(p&&C){const A={targetId:u.targetId};q(u.dom,"ln-filter:reset",A),w&&w!==u.dom&&q(w,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=Ye(f.values);if(_?this.dom.setAttribute(r,_):this.dom.removeAttribute(r),this.hashEnabled){const A=pe(f.key,f.values);be(this.nsKey,A)}b||u._applyDomFilter(w)},x.prototype._applyDomFilter=function(u){const f=u||document.getElementById(this.targetId);if(!f)return;const a=L(this),g=a.key===null||a.values.length===0,w=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(w)this._filterTableRows(a,w);else{const h=f.children;for(let b=0;b<h.length;b++){const p=h[b],C=g?null:p.getAttribute("data-"+a.key),_=!g&&C!==null&&!ye(C,a.values),A=p.hasAttribute(o);_&&!A?p.setAttribute(o,"true"):!_&&A&&p.removeAttribute(o)}}};function Q(u){if(!u)return"";const f=u.querySelector?u.querySelector("[data-ln-value]"):null;return J(f||u)}function D(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}x.prototype._filterTableRows=function(u,f){if(!f){const p=document.getElementById(this.targetId);if(!p||(f=p.tagName==="TABLE"?p:p.querySelector?p.querySelector("table"):null,!f))return}const a=me(f,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(a!==null?"col"+a:"attr-filter"),w=u.values;y.has(f)||y.set(f,{});const h=y.get(f);g&&w.length>0?h[g]={col:a,values:w.slice(),attr:"data-"+g}:g&&delete h[g];const b=f.tBodies;for(let p=0;p<b.length;p++){const C=b[p].rows;for(let _=0;_<C.length;_++){const A=C[_];if(D(A))continue;const Ae={};for(let N=0;N<A.cells.length;N++)Ae[N]=Q(A.cells[N]);const ve=!ze(Ae,h,A),ke=A.hasAttribute(o);ve&&!ke?A.setAttribute(o,"true"):!ve&&ke&&A.removeAttribute(o)}}},x.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const f=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(f&&y.has(f)){const a=y.get(f),g=me(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),w=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);w&&a[w]&&(delete a[w],this._filterTableRows({key:null,values:[]},f)),Object.keys(a).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&u.removeAttribute(d)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(u,f){const a=u[t];if(!(!a||a._destroyed))if(f===c)a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=F(u,"filter"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange);else if(f===r){const g=Ce(u.getAttribute(r)),w=u.querySelector("["+n+"]"),h=w?w.getAttribute(n):null;h&&(S(u,h,g),a._render())}else f===e&&(a.targetId=u.getAttribute(e)||null,a._ensureTargetMarked(),a._render())}he(e,t,x,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+d+"]",onSubtreeChange:function(u,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let a=null,g=null;if(u.hasAttribute(d)?(g=u,a=u.getAttribute(d)||u.id):u.hasAttribute(e)&&(a=u.getAttribute(e),g=a?document.getElementById(a):null),!a||!g)return;const w=document.querySelectorAll("["+e+'="'+a+'"]');for(let h=0;h<w.length;h++){const b=w[h][t];b&&!b._destroyed&&L(b).values.length>0&&b._queueDomFilter()}},persist:{attr:r,hashActive:function(u){return!!F(u,"filter")}}})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function I(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 s=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){s=t[i];break}if(!C(s))return}e.apply(console,t)}}function te(e,t,r){const s=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,s),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:s}))}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()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const r=!!(t&&t.typed),s=t&&t.exclude,i={},l=e.elements,o={};if(r)for(let c=0;c<l.length;c++){const n=l[c];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let c=0;c<l.length;c++){const n=l[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(s&&n.matches&&n.matches(s)))if(n.type==="checkbox")r&&o[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function D(e,t){const r=e.elements,s=[],i={};for(let l=0;l<r.length;l++){const o=r[l];o.name&&o.type==="checkbox"&&(i[o.name]=(i[o.name]||0)+1)}for(let l=0;l<r.length;l++){const o=r[l];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const n=t[c];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(i[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=re(n);s.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),s.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;s.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),s.push(o)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=D,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=ne);const F={};function ie(e,t){F[e]=t}function le(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ie,window.lnCore.getDataMapper=le);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){te(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function ce(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];q[r]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=se);const y={};function ue(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const c=r[o],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const s=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<s.length;o++){const c=s[o],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[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 i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const c=i[o],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const c=l[o],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[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 de(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<r.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[s],t??null),r[s].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)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function M(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const l=r.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const s=function(l,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const o=i[l],c=o.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return e}function fe(e,t,r,s,i,l){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(s(a));let d=o[u];if(d)i(d,a,n);else{const f=ue(r,l);if(!f||(M(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=R,window.lnCore.lnFill=de,window.lnCore.renderList=fe);function g(e,t,r){const s=e.getAttribute(t);return s===null?r:s}function $(e,t,r){const s=parseInt(e.getAttribute(t),10);return isNaN(s)?r:s}function N(e,t,r=!1){const s=e.getAttribute(t);if(s===null)return!!r;const i=s.trim().toLowerCase();return!(i==="false"||i==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function j(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const s=new Set(e||[]),i=function(l,o){const c=l.getAttribute(o);return c!==null&&s.has(c)?c:t};return A.set(r,i),i}function U(e,t,r){const s=parseFloat(e.getAttribute(t));return isNaN(s)?r:s}function W(e,t,r){const s=e.getAttribute(t);if(!s)return r;try{return JSON.parse(s)}catch{return r}}function H(e,t,r,s,i){if(!e||t===null)return!0;const l=s||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=n=>{i?console.warn(n,i):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${l}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${l}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${l}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(e,t,r){for(const s in r){const[i,l,o]=r[s];Object.defineProperty(e,s,{get:function(){return i(t,l,o)},enumerable:!0,configurable:!0})}return e}function P(e){const t={};for(const r in e){const s=e[r];if(!s||!s.prop)continue;let i=s.read;if(!i&&s.type)switch(s.type){case"enum":i=j(s.values,s.fallback);break;case"integer":i=$;break;case"float":i=U;break;case"boolean":i=N;break;case"list":i=B;break;case"json":i=W;break;case"string":default:i=g;break}i||(i=g),t[s.prop]=[i,r,s.fallback]}return t}function we(e){const t={};for(const r in e){const s=e[r];s&&s.effect&&(t[r]=s.effect)}return Object.keys(t).length?t:null}function he(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=V,window.lnCore.attrSpec=P,window.lnCore.attrStr=g,window.lnCore.attrInt=$,window.lnCore.attrBool=N,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=U,window.lnCore.attrJson=W);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Q(e,t,r,s){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:s};if(e.matches&&e.matches(l)&&h(e,o),e.querySelectorAll){const c=e.querySelectorAll(l);for(let n=0;n<c.length;n++)h(c[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=J(),r=e.observed||[];for(let s=0;s<r.length;s++){const i=r[s];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 s in e.attributes){t.byDeclaredAttr.has(s)||t.byDeclaredAttr.set(s,[]);const i=t.byDeclaredAttr.get(s);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[s],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const s=he(e);if(s===null)t.reactiveWildcard.push(e);else for(const i of s)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function K(e,t,r,s){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const o=l.effects&&l.effects[r];o?o(t,r,s):l.onAttrChange&&(!l.declared||l.declared.has(r))&&l.onAttrChange(t,r,s)}}function me(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,s=J(),i=s.byAttr.get(t),l=I()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(t);if(!r&&!i&&!l)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(l&&C(o)){const c=s.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<c.length;a++)H(c[a].spec,n,t,c[a].componentTag,o)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=s.byReactive.get(t);c&&K(c,o,t,e.oldValue),s.reactiveWildcard.length&&K(s.reactiveWildcard,o,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const n=i[c];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(Q(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{me(t[r])}catch(s){console.error("[ln-core] mutation handler failed",t[r].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function x(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(s){console.error("["+t.attribute+"] destroy failed",e,s)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=_();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const s=v();if(e.target&&s.length)for(let i=0;i<s.length;i++){const l=s[i],o=l.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;c&&l.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const o=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)l.matches&&l.matches(n.query)&&h(l,n);else if(l.matches&&l.matches(n.query)&&h(l,n),l.querySelectorAll){const a=l.querySelectorAll(n.query);for(let u=0;u<a.length;u++)h(a[u],n)}}n.onInit&&n.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){const o=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!o)l.matches&&l.matches(a)&&x(l,n);else if(l.matches&&l.matches(a)&&x(l,n),l.querySelectorAll){const u=l.querySelectorAll(a);for(let d=0;d<u.length;d++)x(u[d],n)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const s=t[r];if(s.type==="childList")try{ye(s)}catch(i){console.error("[ln-core] lifecycle handler failed",s.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){_().push(e),e.onSubtreeChange&&e.query&&v().push(e),z()}function G(e,t,r,s,i={}){const l=i.extraAttributes||[],o=i.onAttributeChange||null,c=i.onSubtreeChange||null,n=i.onInit||null,a=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?we(d):u,Ie=d?new Set(Object.keys(d)):null,De=i.persist||null;function m(E){const w=E||document.body;if(Q(w,e,t,r),d&&I())for(const p in d){const qe=d[p],L=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&L.push(w);for(let O=0;O<L.length;O++){const T=L[O];C(T)&&H(qe,T.getAttribute(p),p,s,T)}}n&&n(w)}const S=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)S.push(w[1])}else S.push(e);ge({selector:e,attribute:t,componentTag:s,attributes:d,ComponentFn:r,onInit:n,observed:S.concat(l),onAttributeChange:o,onAttrChange:a,effects:f,declared:Ie,persist:De}),Ce();const Fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Y=i.subtreeQuery||(Fe?e:"["+e+"]"),Z={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Y};_().push(Z),c&&Y&&v().push(Z),z(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G,window.lnCore.observeLifecycle=Ae);function ee(){pe()>0?be(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ee):ee(),m}function X(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,r={},s=X(t);if(!s)return r;const i=s.split("&");for(let l=0;l<i.length;l++){const o=i[l];if(!o)continue;const c=o.indexOf(":"),n=c>-1?o.slice(0,c):o,a=c>-1?o.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function _e(e){if(!e)return null;const t=k();return e in t?t[e]:null}function ve(e,t){if(!e)return;const r=k();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(l){const o=r[l];return o===""?l:l+":"+encodeURIComponent(o)}).join("&");X(location.hash)!==i&&(location.hash=i)}function xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const s=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return s?t?s+"-"+t:s:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),s=e.slice(t+1),i=s?s.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=_e,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function Te(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Te),(function(){const e="data-ln-form",t="lnForm";if(window[t]!==void 0)return;const r={"data-ln-form":{type:"marker",description:"Identifies the form element as an enhanced ln-form"},"data-ln-form-action-edit":{prop:"_actionEdit",type:"string",read:g,fallback:"",description:"URL template or endpoint used when editing an existing record"},"data-ln-form-action-method":{prop:"_actionMethod",type:"enum",values:["PUT","POST","PATCH"],fallback:"PUT",description:"HTTP method used when submitting edit action"}},s=P(r);function i(l){this.dom=l,V(this,l,s),this._baseAction=l.getAttribute("action")||"";const o=this;function c(){const a=o.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<a.length;u++)a[u].hasAttribute("data-ln-initial-value")||a[u].setAttribute("data-ln-initial-value",a[u].getAttribute("value")||"")}function n(){const a=o.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<a.length;u++)a[u].value=a[u].getAttribute("data-ln-initial-value")||""}return c(),this._onLnFill=function(a){a.target===o.dom&&(a.detail?(c(),o.fill(a.detail),o._applyActionMode(a.detail)):(o.dom.reset(),n()))},this._onReset=function(){o._applyActionMode(null),n()},l.addEventListener("ln-fill",this._onLnFill),l.addEventListener("reset",this._onReset),this}i.prototype.fill=function(l){const o=D(this.dom,l);for(let c=0;c<o.length;c++){const n=o[c],a=n.tagName==="SELECT"||n.type==="checkbox"||n.type==="radio";n.dispatchEvent(new Event(a?"change":"input",{bubbles:!0}))}},i.prototype.reset=function(){this.dom.reset(),this._applyActionMode(null);const l=this.dom.elements;for(let o=0;o<l.length;o++){const c=l[o],n=c.tagName==="SELECT"||c.type==="checkbox"||c.type==="radio";c.dispatchEvent(new Event(n?"change":"input",{bubbles:!0}))}},i.prototype._ensureMethodInput=function(){let l=this.dom.querySelector('input[name="_method"]');return l||(l=document.createElement("input"),l.type="hidden",l.name="_method",l.value="",this.dom.appendChild(l)),l},i.prototype._applyActionMode=function(l){if(!this.dom.hasAttribute("data-ln-form-action-edit"))return;const o=l&&l.id!=null&&l.id!==""?l.id:null,c=this._ensureMethodInput();if(o!==null){const n=this._actionEdit;n?this.dom.setAttribute("action",n.replace(":id",encodeURIComponent(o))):this.dom.setAttribute("action",this._baseAction.replace(/\/$/,"")+"/"+encodeURIComponent(o)),c.value=this._actionMethod||"PUT"}else this.dom.setAttribute("action",this._baseAction),c.value=""},i.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-fill",this._onLnFill),this.dom.removeEventListener("reset",this._onReset),delete this.dom[t])},G(e,t,i,"ln-form",{attributes:r})})()})();
1
+ (function(){"use strict";function I(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function y(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 s=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){s=t[i];break}if(!y(s))return}e.apply(console,t)}}function ne(e,t,r){const s=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,s),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:s}))}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()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const r=!!(t&&t.typed),s=t&&t.exclude,i={},l=e.elements,o={};if(r)for(let c=0;c<l.length;c++){const n=l[c];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let c=0;c<l.length;c++){const n=l[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(s&&n.matches&&n.matches(s)))if(n.type==="checkbox")r&&o[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function D(e,t){const r=e.elements,s=[],i={};for(let l=0;l<r.length;l++){const o=r[l];o.name&&o.type==="checkbox"&&(i[o.name]=(i[o.name]||0)+1)}for(let l=0;l<r.length;l++){const o=r[l];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const n=t[c];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(i[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=ie(n);s.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),s.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;s.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),s.push(o)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=D,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=oe);const F={};function le(e,t){F[e]=t}function se(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){ne(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function ae(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];q[r]=t}function ue(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const C={};function de(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=C[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const c=r[o],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const s=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<s.length;o++){const c=s[o],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[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 i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const c=i[o],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const c=l[o],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[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 fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<r.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[s],t??null),r[s].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)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function M(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const l=r.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const s=function(l,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const o=i[l],c=o.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return e}function we(e,t,r,s,i,l){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(s(a));let d=o[u];if(d)i(d,a,n);else{const f=de(r,l);if(!f||(M(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=R,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function g(e,t,r){const s=e.getAttribute(t);return s===null?r:s}function $(e,t,r){const s=parseInt(e.getAttribute(t),10);return isNaN(s)?r:s}function N(e,t,r=!1){const s=e.getAttribute(t);if(s===null)return!!r;const i=s.trim().toLowerCase();return!(i==="false"||i==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function j(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const s=new Set(e||[]),i=function(l,o){const c=l.getAttribute(o);return c!==null&&s.has(c)?c:t};return A.set(r,i),i}function U(e,t,r){const s=parseFloat(e.getAttribute(t));return isNaN(s)?r:s}function W(e,t,r){const s=e.getAttribute(t);if(!s)return r;try{return JSON.parse(s)}catch{return r}}function H(e,t,r,s,i){if(!e||t===null)return!0;const l=s||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=n=>{i?console.warn(n,i):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${l}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${l}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${l}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(e,t,r){for(const s in r){const[i,l,o]=r[s];Object.defineProperty(e,s,{get:function(){return i(t,l,o)},enumerable:!0,configurable:!0})}return e}function P(e){const t={};for(const r in e){const s=e[r];if(!s||!s.prop)continue;let i=s.read;if(!i&&s.type)switch(s.type){case"enum":i=j(s.values,s.fallback);break;case"integer":i=$;break;case"float":i=U;break;case"boolean":i=N;break;case"list":i=B;break;case"json":i=W;break;case"string":default:i=g;break}i||(i=g),t[s.prop]=[i,r,s.fallback]}return t}function he(e){const t={};for(const r in e){const s=e[r];s&&s.effect&&(t[r]=s.effect)}return Object.keys(t).length?t:null}function pe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=V,window.lnCore.attrSpec=P,window.lnCore.attrStr=g,window.lnCore.attrInt=$,window.lnCore.attrBool=N,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=U,window.lnCore.attrJson=W);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Q(e,t,r,s){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:s};if(e.matches&&e.matches(l)&&h(e,o),e.querySelectorAll){const c=e.querySelectorAll(l);for(let n=0;n<c.length;n++)h(c[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 me(e){const t=J(),r=e.observed||[];for(let s=0;s<r.length;s++){const i=r[s];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 s in e.attributes){t.byDeclaredAttr.has(s)||t.byDeclaredAttr.set(s,[]);const i=t.byDeclaredAttr.get(s);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[s],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const s=pe(e);if(s===null)t.reactiveWildcard.push(e);else for(const i of s)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function K(e,t,r,s){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const o=l.effects&&l.effects[r];o?o(t,r,s):l.onAttrChange&&(!l.declared||l.declared.has(r))&&l.onAttrChange(t,r,s)}}function ye(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,s=J(),i=s.byAttr.get(t),l=I()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(t);if(!r&&!i&&!l)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(l&&y(o)){const c=s.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<c.length;a++)H(c[a].spec,n,t,c[a].componentTag,o)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=s.byReactive.get(t);c&&K(c,o,t,e.oldValue),s.reactiveWildcard.length&&K(s.reactiveWildcard,o,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const n=i[c];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(Q(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ye(t[r])}catch(s){console.error("[ln-core] mutation handler failed",t[r].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function x(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(s){console.error("["+t.attribute+"] destroy failed",e,s)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=_();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const s=v();if(e.target&&s.length)for(let i=0;i<s.length;i++){const l=s[i],o=l.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;c&&l.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const o=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)l.matches&&l.matches(n.query)&&h(l,n);else if(l.matches&&l.matches(n.query)&&h(l,n),l.querySelectorAll){const a=l.querySelectorAll(n.query);for(let u=0;u<a.length;u++)h(a[u],n)}}n.onInit&&n.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){if(document.contains(l))continue;const o=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!o)l.matches&&l.matches(a)&&x(l,n);else if(l.matches&&l.matches(a)&&x(l,n),l.querySelectorAll){const u=l.querySelectorAll(a);for(let d=0;d<u.length;d++)x(u[d],n)}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const s=t[r];if(s.type==="childList")try{z(s)}catch(i){console.error("[ln-core] lifecycle handler failed",s.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="childList")try{z(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&v().push(e),G()}function X(e,t,r,s,i={}){const l=i.extraAttributes||[],o=i.onAttributeChange||null,c=i.onSubtreeChange||null,n=i.onInit||null,a=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?he(d):u,De=d?new Set(Object.keys(d)):null,Fe=i.persist||null;function m(E){const w=E||document.body;if(Q(w,e,t,r),d&&I())for(const p in d){const Re=d[p],L=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&L.push(w);for(let O=0;O<L.length;O++){const T=L[O];y(T)&&H(Re,T.getAttribute(p),p,s,T)}}n&&n(w)}const S=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)S.push(w[1])}else S.push(e);me({selector:e,attribute:t,componentTag:s,attributes:d,ComponentFn:r,onInit:n,observed:S.concat(l),onAttributeChange:o,onAttrChange:a,effects:f,declared:De,persist:Fe}),Ce();const qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Z=i.subtreeQuery||(qe?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Z};_().push(ee),c&&Z&&v().push(ee),G(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=_e,window.lnCore.withoutLifecycle=Ae);function te(){be()>0?ge(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),m}function Y(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,r={},s=Y(t);if(!s)return r;const i=s.split("&");for(let l=0;l<i.length;l++){const o=i[l];if(!o)continue;const c=o.indexOf(":"),n=c>-1?o.slice(0,c):o,a=c>-1?o.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ve(e){if(!e)return null;const t=k();return e in t?t[e]:null}function xe(e,t){if(!e)return;const r=k();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(l){const o=r[l];return o===""?l:l+":"+encodeURIComponent(o)}).join("&");Y(location.hash)!==i&&(location.hash=i)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Se(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const s=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return s?t?s+"-"+t:s:t||null}function Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),s=e.slice(t+1),i=s?s.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Te);function Ie(){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=Ie),(function(){const e="data-ln-form",t="lnForm";if(window[t]!==void 0)return;const r={"data-ln-form":{type:"marker",description:"Identifies the form element as an enhanced ln-form"},"data-ln-form-action-edit":{prop:"_actionEdit",type:"string",read:g,fallback:"",description:"URL template or endpoint used when editing an existing record"},"data-ln-form-action-method":{prop:"_actionMethod",type:"enum",values:["PUT","POST","PATCH"],fallback:"PUT",description:"HTTP method used when submitting edit action"}},s=P(r);function i(l){this.dom=l,V(this,l,s),this._baseAction=l.getAttribute("action")||"";const o=this;function c(){const a=o.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<a.length;u++)a[u].hasAttribute("data-ln-initial-value")||a[u].setAttribute("data-ln-initial-value",a[u].getAttribute("value")||"")}function n(){const a=o.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<a.length;u++)a[u].value=a[u].getAttribute("data-ln-initial-value")||""}return c(),this._onLnFill=function(a){a.target===o.dom&&(a.detail?(c(),o.fill(a.detail),o._applyActionMode(a.detail)):(o.dom.reset(),n()))},this._onReset=function(){o._applyActionMode(null),n()},l.addEventListener("ln-fill",this._onLnFill),l.addEventListener("reset",this._onReset),this}i.prototype.fill=function(l){const o=D(this.dom,l);for(let c=0;c<o.length;c++){const n=o[c],a=n.tagName==="SELECT"||n.type==="checkbox"||n.type==="radio";n.dispatchEvent(new Event(a?"change":"input",{bubbles:!0}))}},i.prototype.reset=function(){this.dom.reset(),this._applyActionMode(null);const l=this.dom.elements;for(let o=0;o<l.length;o++){const c=l[o],n=c.tagName==="SELECT"||c.type==="checkbox"||c.type==="radio";c.dispatchEvent(new Event(n?"change":"input",{bubbles:!0}))}},i.prototype._ensureMethodInput=function(){let l=this.dom.querySelector('input[name="_method"]');return l||(l=document.createElement("input"),l.type="hidden",l.name="_method",l.value="",this.dom.appendChild(l)),l},i.prototype._applyActionMode=function(l){if(!this.dom.hasAttribute("data-ln-form-action-edit"))return;const o=l&&l.id!=null&&l.id!==""?l.id:null,c=this._ensureMethodInput();if(o!==null){const n=this._actionEdit;n?this.dom.setAttribute("action",n.replace(":id",encodeURIComponent(o))):this.dom.setAttribute("action",this._baseAction.replace(/\/$/,"")+"/"+encodeURIComponent(o)),c.value=this._actionMethod||"PUT"}else this.dom.setAttribute("action",this._baseAction),c.value=""},i.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-fill",this._onLnFill),this.dom.removeEventListener("reset",this._onReset),delete this.dom[t])},X(e,t,i,"ln-form",{attributes:r})})()})();